@arkitektbedriftene/fe-lib 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/rich-text.es.js +1091 -1313
  2. package/package.json +10 -10
@@ -1,1192 +1,970 @@
1
- import { createHeadlessEditor as dt } from "@lexical/headless";
2
- import { $generateHtmlFromNodes as ft } from "@lexical/html";
3
- import Y, { $getRoot as et, ParagraphNode as pt, $createParagraphNode as gt, $createTextNode as mt } from "lexical";
4
- import tt, { trimTextContentFromAnchor as xt } from "@lexical/selection";
5
- import { AutoLinkNode as ht, LinkNode as Et } from "@lexical/link";
6
- import { ListNode as vt, ListItemNode as Ct } from "@lexical/list";
7
- import nt, { HeadingNode as yt, QuoteNode as Nt } from "@lexical/rich-text";
8
- import { TableNode as Lt, TableRowNode as Tt, TableCellNode as bt } from "@lexical/table";
9
- import { j } from "./jsx-runtime-d0aa4c5b.js";
10
- import { c as oe, s as rt, u as $t, B as ot, S as wt } from "./Popover-e50ca73e.js";
11
- import U, { createContext as St, useState as Rt, useRef as _t, useCallback as _e } from "react";
12
- import it from "react-dom";
13
- const Ot = ({
14
- text: c,
15
- maxChars: i,
16
- maxLines: h
1
+ import { createHeadlessEditor as je } from "@lexical/headless";
2
+ import { $generateHtmlFromNodes as Ve } from "@lexical/html";
3
+ import A, { $getRoot as De, ParagraphNode as ze, $createParagraphNode as He, $createTextNode as Ke } from "lexical";
4
+ import qe, { trimTextContentFromAnchor as We } from "@lexical/selection";
5
+ import { AutoLinkNode as Ge, LinkNode as Je } from "@lexical/link";
6
+ import { ListNode as Ye, ListItemNode as Qe } from "@lexical/list";
7
+ import Oe, { HeadingNode as Xe, QuoteNode as Ze } from "@lexical/rich-text";
8
+ import { TableNode as et, TableRowNode as tt, TableCellNode as rt } from "@lexical/table";
9
+ import { j as O } from "./jsx-runtime-d0aa4c5b.js";
10
+ import { c as U, s as Fe, u as nt, B as ke, S as ot } from "./Popover-e50ca73e.js";
11
+ import q, { createContext as it, useState as st, useRef as lt, useCallback as ae } from "react";
12
+ import Ae from "react-dom";
13
+ const at = ({
14
+ text: l,
15
+ maxChars: s,
16
+ maxLines: g
17
17
  }) => {
18
- if (c.length === 0)
18
+ if (l.length === 0)
19
19
  return 0;
20
- const L = typeof h == "number", p = typeof i == "number";
21
- if (!L && !p)
22
- return c.length;
23
- let m = 0, a = 0;
24
- for (; a < c.length && (!L || m < h) && (!p || a < i); )
25
- c[a] === `
26
- ` && m++, a++;
27
- return c.slice(0, a).length;
28
- }, Pt = ({
29
- editor: c,
30
- maxChars: i,
31
- maxLines: h
20
+ const C = typeof g == "number", d = typeof s == "number";
21
+ if (!C && !d)
22
+ return l.length;
23
+ let p = 0, e = 0;
24
+ for (; e < l.length && (!C || p < g) && (!d || e < s); )
25
+ l[e] === `
26
+ ` && p++, e++;
27
+ return l.slice(0, e).length;
28
+ }, ct = ({
29
+ editor: l,
30
+ maxChars: s,
31
+ maxLines: g
32
32
  }) => {
33
- const L = et(), p = L.getTextContent(), m = Ot({ text: p, maxChars: i, maxLines: h }), a = p.length - m, e = L.select().anchor;
34
- xt(c, e, a);
35
- const t = L.getLastChild();
36
- return t instanceof pt && t.getChildrenSize() === 0 && t.remove(), a;
37
- }, Dt = (c) => c[0] === "{", _n = (c, i, h) => {
38
- let L = 0;
39
- const p = dt({
40
- nodes: i,
33
+ const C = De(), d = C.getTextContent(), p = at({ text: d, maxChars: s, maxLines: g }), e = d.length - p, n = C.select().anchor;
34
+ We(l, n, e);
35
+ const o = C.getLastChild();
36
+ return o instanceof ze && o.getChildrenSize() === 0 && o.remove(), e;
37
+ }, ut = (l) => l[0] === "{", sr = (l, s, g) => {
38
+ let C = 0;
39
+ const d = je({
40
+ nodes: s,
41
41
  editable: !1
42
42
  });
43
- if (c)
43
+ if (l)
44
44
  try {
45
- if (typeof c == "string" && !Dt(c))
46
- p.update(() => {
47
- const a = et(), u = gt();
48
- u.append(mt(c.trim())), a.append(u);
45
+ if (typeof l == "string" && !ut(l))
46
+ d.update(() => {
47
+ const e = De(), t = He();
48
+ t.append(Ke(l.trim())), e.append(t);
49
49
  });
50
50
  else {
51
- const a = p.parseEditorState(c, () => {
52
- L = Pt({
53
- editor: p,
54
- maxLines: h == null ? void 0 : h.maxLines
51
+ const e = d.parseEditorState(l, () => {
52
+ C = ct({
53
+ editor: d,
54
+ maxLines: g == null ? void 0 : g.maxLines
55
55
  });
56
56
  });
57
- a.isEmpty() || p.setEditorState(a);
57
+ e.isEmpty() || d.setEditorState(e);
58
58
  }
59
- } catch (a) {
60
- console.error(a);
59
+ } catch (e) {
60
+ console.error(e);
61
61
  }
62
- let m = "";
63
- return p.update(() => {
64
- m = ft(p);
65
- }), { html: m, trimCount: L };
66
- }, On = [
67
- yt,
68
- Nt,
69
- vt,
70
- Ct,
71
- ht,
72
- Et,
73
- Lt,
74
- Tt,
75
- bt
62
+ let p = "";
63
+ return d.update(() => {
64
+ p = Ve(d);
65
+ }), { html: p, trimCount: C };
66
+ }, lr = [
67
+ Xe,
68
+ Ze,
69
+ Ye,
70
+ Qe,
71
+ Ge,
72
+ Je,
73
+ et,
74
+ tt,
75
+ rt
76
76
  ];
77
- var ue = {}, ne = {}, Oe;
78
- function Ft() {
79
- if (Oe)
80
- return ne;
81
- Oe = 1;
82
- var c = U;
83
- const i = /* @__PURE__ */ c.createContext(null);
84
- function h(p, m) {
85
- let a = null;
86
- p != null && (a = p[1]);
87
- function u() {
88
- return m ?? (a != null ? a.getTheme() : null);
77
+ var z = {}, B = {}, ce;
78
+ function dt() {
79
+ if (ce)
80
+ return B;
81
+ ce = 1;
82
+ var l = q;
83
+ const s = /* @__PURE__ */ l.createContext(null);
84
+ function g(d, p) {
85
+ let e = null;
86
+ d != null && (e = d[1]);
87
+ function t() {
88
+ return p ?? (e != null ? e.getTheme() : null);
89
89
  }
90
90
  return {
91
- getTheme: u
91
+ getTheme: t
92
92
  };
93
93
  }
94
- function L() {
95
- const p = c.useContext(i);
96
- if (p == null)
94
+ function C() {
95
+ const d = l.useContext(s);
96
+ if (d == null)
97
97
  throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");
98
- return p;
98
+ return d;
99
99
  }
100
- return ne.LexicalComposerContext = i, ne.createLexicalComposerContext = h, ne.useLexicalComposerContext = L, ne;
100
+ return B.LexicalComposerContext = s, B.createLexicalComposerContext = g, B.useLexicalComposerContext = C, B;
101
101
  }
102
- var re = {}, Pe;
103
- function Mt() {
104
- if (Pe)
105
- return re;
106
- Pe = 1;
107
- var c = U;
108
- function i(L) {
109
- let p = new URLSearchParams();
110
- p.append("code", L);
111
- for (let m = 1; m < arguments.length; m++)
112
- p.append("v", arguments[m]);
113
- throw Error(`Minified Lexical error #${L}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
114
- }
115
- let h = c.createContext(null);
116
- return re.LexicalComposerContext = h, re.createLexicalComposerContext = function(L, p) {
117
- let m = null;
118
- return L != null && (m = L[1]), { getTheme: function() {
119
- return p ?? (m != null ? m.getTheme() : null);
102
+ var I = {}, ue;
103
+ function ft() {
104
+ if (ue)
105
+ return I;
106
+ ue = 1;
107
+ var l = q;
108
+ function s(C) {
109
+ let d = new URLSearchParams();
110
+ d.append("code", C);
111
+ for (let p = 1; p < arguments.length; p++)
112
+ d.append("v", arguments[p]);
113
+ throw Error(`Minified Lexical error #${C}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
114
+ }
115
+ let g = l.createContext(null);
116
+ return I.LexicalComposerContext = g, I.createLexicalComposerContext = function(C, d) {
117
+ let p = null;
118
+ return C != null && (p = C[1]), { getTheme: function() {
119
+ return d ?? (p != null ? p.getTheme() : null);
120
120
  } };
121
- }, re.useLexicalComposerContext = function() {
122
- let L = c.useContext(h);
123
- return L == null && i(8), L;
124
- }, re;
121
+ }, I.useLexicalComposerContext = function() {
122
+ let C = l.useContext(g);
123
+ return C == null && s(8), C;
124
+ }, I;
125
125
  }
126
- var de, De;
127
- function Q() {
128
- return De || (De = 1, de = process.env.NODE_ENV === "development" ? Ft() : Mt()), de;
126
+ var H, de;
127
+ function M() {
128
+ return de || (de = 1, H = process.env.NODE_ENV === "development" ? dt() : ft()), H;
129
129
  }
130
- var Fe;
131
- function qt() {
132
- if (Fe)
133
- return ue;
134
- Fe = 1;
135
- var c = Q(), i = Y, h = U;
136
- const L = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
137
- var m = L ? h.useLayoutEffect : h.useEffect;
138
- const a = {
130
+ var fe;
131
+ function pt() {
132
+ if (fe)
133
+ return z;
134
+ fe = 1;
135
+ var l = M(), s = A, g = q;
136
+ const C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
137
+ var p = C ? g.useLayoutEffect : g.useEffect;
138
+ const e = {
139
139
  tag: "history-merge"
140
140
  };
141
- function u({
142
- initialConfig: t,
143
- children: n
141
+ function t({
142
+ initialConfig: o,
143
+ children: r
144
144
  }) {
145
- const r = h.useMemo(
145
+ const i = g.useMemo(
146
146
  () => {
147
147
  const {
148
- theme: s,
149
- namespace: l,
150
- editor__DEPRECATED: o,
151
- nodes: x,
148
+ theme: u,
149
+ namespace: f,
150
+ editor__DEPRECATED: a,
151
+ nodes: h,
152
152
  onError: v,
153
- editorState: g,
154
- html: S
155
- } = t, T = c.createLexicalComposerContext(null, s);
156
- let y = o || null;
157
- if (y === null) {
158
- const w = i.createEditor({
159
- editable: t.editable,
160
- html: S,
161
- namespace: l,
162
- nodes: x,
163
- onError: (R) => v(R, w),
164
- theme: s
153
+ editorState: E
154
+ } = o, $ = l.createLexicalComposerContext(null, u);
155
+ let c = a || null;
156
+ if (c === null) {
157
+ const m = s.createEditor({
158
+ editable: o.editable,
159
+ namespace: f,
160
+ nodes: h,
161
+ onError: (x) => v(x, m),
162
+ theme: u
165
163
  });
166
- e(w, g), y = w;
164
+ n(m, E), c = m;
167
165
  }
168
- return [y, T];
166
+ return [c, $];
169
167
  },
170
168
  // We only do this for init
171
169
  // eslint-disable-next-line react-hooks/exhaustive-deps
172
170
  []
173
171
  );
174
- return m(() => {
175
- const s = t.editable, [l] = r;
176
- l.setEditable(s !== void 0 ? s : !0);
177
- }, []), /* @__PURE__ */ h.createElement(c.LexicalComposerContext.Provider, {
178
- value: r
179
- }, n);
180
- }
181
- function e(t, n) {
182
- if (n !== null) {
183
- if (n === void 0)
184
- t.update(() => {
185
- const r = i.$getRoot();
186
- if (r.isEmpty()) {
187
- const s = i.$createParagraphNode();
188
- r.append(s);
189
- const l = L ? document.activeElement : null;
190
- (i.$getSelection() !== null || l !== null && l === t.getRootElement()) && s.select();
172
+ return p(() => {
173
+ const u = o.editable, [f] = i;
174
+ f.setEditable(u !== void 0 ? u : !0);
175
+ }, []), /* @__PURE__ */ g.createElement(l.LexicalComposerContext.Provider, {
176
+ value: i
177
+ }, r);
178
+ }
179
+ function n(o, r) {
180
+ if (r !== null) {
181
+ if (r === void 0)
182
+ o.update(() => {
183
+ const i = s.$getRoot();
184
+ if (i.isEmpty()) {
185
+ const u = s.$createParagraphNode();
186
+ i.append(u);
187
+ const f = C ? document.activeElement : null;
188
+ (s.$getSelection() !== null || f !== null && f === o.getRootElement()) && u.select();
191
189
  }
192
- }, a);
193
- else if (n !== null)
194
- switch (typeof n) {
190
+ }, e);
191
+ else if (r !== null)
192
+ switch (typeof r) {
195
193
  case "string": {
196
- const r = t.parseEditorState(n);
197
- t.setEditorState(r, a);
194
+ const i = o.parseEditorState(r);
195
+ o.setEditorState(i, e);
198
196
  break;
199
197
  }
200
198
  case "object": {
201
- t.setEditorState(n, a);
199
+ o.setEditorState(r, e);
202
200
  break;
203
201
  }
204
202
  case "function": {
205
- t.update(() => {
206
- i.$getRoot().isEmpty() && n(t);
207
- }, a);
203
+ o.update(() => {
204
+ s.$getRoot().isEmpty() && r(o);
205
+ }, e);
208
206
  break;
209
207
  }
210
208
  }
211
209
  }
212
210
  }
213
- return ue.LexicalComposer = u, ue;
211
+ return z.LexicalComposer = t, z;
214
212
  }
215
- var fe = {}, Me;
216
- function Bt() {
217
- if (Me)
218
- return fe;
219
- Me = 1;
220
- var c = Q(), i = Y, h = U;
221
- let L = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
222
- var p = L ? h.useLayoutEffect : h.useEffect;
223
- let m = { tag: "history-merge" };
224
- function a(u, e) {
225
- if (e !== null) {
226
- if (e === void 0)
227
- u.update(() => {
228
- var t = i.$getRoot();
229
- if (t.isEmpty()) {
230
- let n = i.$createParagraphNode();
231
- t.append(n), t = L ? document.activeElement : null, (i.$getSelection() !== null || t !== null && t === u.getRootElement()) && n.select();
213
+ var K = {}, pe;
214
+ function mt() {
215
+ if (pe)
216
+ return K;
217
+ pe = 1;
218
+ var l = M(), s = A, g = q;
219
+ let C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
220
+ var d = C ? g.useLayoutEffect : g.useEffect;
221
+ let p = { tag: "history-merge" };
222
+ function e(t, n) {
223
+ if (n !== null) {
224
+ if (n === void 0)
225
+ t.update(() => {
226
+ var o = s.$getRoot();
227
+ if (o.isEmpty()) {
228
+ let r = s.$createParagraphNode();
229
+ o.append(r), o = C ? document.activeElement : null, (s.$getSelection() !== null || o !== null && o === t.getRootElement()) && r.select();
232
230
  }
233
- }, m);
234
- else if (e !== null)
235
- switch (typeof e) {
231
+ }, p);
232
+ else if (n !== null)
233
+ switch (typeof n) {
236
234
  case "string":
237
- let t = u.parseEditorState(e);
238
- u.setEditorState(t, m);
235
+ let o = t.parseEditorState(n);
236
+ t.setEditorState(o, p);
239
237
  break;
240
238
  case "object":
241
- u.setEditorState(e, m);
239
+ t.setEditorState(n, p);
242
240
  break;
243
241
  case "function":
244
- u.update(() => {
245
- i.$getRoot().isEmpty() && e(u);
246
- }, m);
242
+ t.update(() => {
243
+ s.$getRoot().isEmpty() && n(t);
244
+ }, p);
247
245
  }
248
246
  }
249
247
  }
250
- return fe.LexicalComposer = function({ initialConfig: u, children: e }) {
251
- let t = h.useMemo(() => {
252
- const { theme: n, namespace: r, editor__DEPRECATED: s, nodes: l, onError: o, editorState: x, html: v } = u, g = c.createLexicalComposerContext(null, n);
253
- let S = s || null;
254
- if (S === null) {
255
- const T = i.createEditor({ editable: u.editable, html: v, namespace: r, nodes: l, onError: (y) => o(y, T), theme: n });
256
- a(T, x), S = T;
248
+ return K.LexicalComposer = function({ initialConfig: t, children: n }) {
249
+ let o = g.useMemo(() => {
250
+ const { theme: r, namespace: i, editor__DEPRECATED: u, nodes: f, onError: a, editorState: h } = t, v = l.createLexicalComposerContext(null, r);
251
+ let E = u || null;
252
+ if (E === null) {
253
+ const $ = s.createEditor({ editable: t.editable, namespace: i, nodes: f, onError: (c) => a(c, $), theme: r });
254
+ e($, h), E = $;
257
255
  }
258
- return [S, g];
256
+ return [E, v];
259
257
  }, []);
260
- return p(() => {
261
- let n = u.editable, [r] = t;
262
- r.setEditable(n !== void 0 ? n : !0);
263
- }, []), h.createElement(
264
- c.LexicalComposerContext.Provider,
265
- { value: t },
266
- e
267
- );
268
- }, fe;
258
+ return d(() => {
259
+ let r = t.editable, [i] = o;
260
+ i.setEditable(r !== void 0 ? r : !0);
261
+ }, []), g.createElement(l.LexicalComposerContext.Provider, { value: o }, n);
262
+ }, K;
269
263
  }
270
- const kt = process.env.NODE_ENV === "development" ? qt() : Bt();
271
- var At = kt, pe = {}, ge, qe;
272
- function It() {
273
- if (qe)
274
- return ge;
275
- qe = 1;
276
- var c = Q(), i = U, p = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
277
- function m(e) {
278
- const [t] = c.useLexicalComposerContext(), n = i.useMemo(() => e(t), [t, e]), r = i.useRef(n.initialValueFn()), [s, l] = i.useState(r.current);
279
- return p(() => {
264
+ const gt = process.env.NODE_ENV === "development" ? pt() : mt();
265
+ var xt = gt, W = {}, G, me;
266
+ function ht() {
267
+ if (me)
268
+ return G;
269
+ me = 1;
270
+ var l = M(), s = q, d = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
271
+ function p(n) {
272
+ const [o] = l.useLexicalComposerContext(), r = s.useMemo(() => n(o), [o, n]), i = s.useRef(r.initialValueFn()), [u, f] = s.useState(i.current);
273
+ return d(() => {
280
274
  const {
281
- initialValueFn: o,
282
- subscribe: x
283
- } = n, v = o();
284
- return r.current !== v && (r.current = v, l(v)), x((g) => {
285
- r.current = g, l(g);
275
+ initialValueFn: a,
276
+ subscribe: h
277
+ } = r, v = a();
278
+ return i.current !== v && (i.current = v, f(v)), h((E) => {
279
+ i.current = E, f(E);
286
280
  });
287
- }, [n, e]), s;
281
+ }, [r, n]), u;
288
282
  }
289
- function a(e) {
283
+ function e(n) {
290
284
  return {
291
- initialValueFn: () => e.isEditable(),
292
- subscribe: (t) => e.registerEditableListener(t)
285
+ initialValueFn: () => n.isEditable(),
286
+ subscribe: (o) => n.registerEditableListener(o)
293
287
  };
294
288
  }
295
- function u() {
296
- return m(a);
289
+ function t() {
290
+ return p(e);
297
291
  }
298
- return ge = u, ge;
292
+ return G = t, G;
299
293
  }
300
- var me, Be;
301
- function Ut() {
302
- if (Be)
303
- return me;
304
- Be = 1;
305
- var c = Q(), i = U, h = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
306
- function L(m) {
307
- let [a] = c.useLexicalComposerContext(), u = i.useMemo(() => m(a), [a, m]), e = i.useRef(u.initialValueFn()), [t, n] = i.useState(e.current);
308
- return h(() => {
309
- let { initialValueFn: r, subscribe: s } = u, l = r();
310
- return e.current !== l && (e.current = l, n(l)), s((o) => {
311
- e.current = o, n(o);
294
+ var J, ge;
295
+ function Et() {
296
+ if (ge)
297
+ return J;
298
+ ge = 1;
299
+ var l = M(), s = q, g = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
300
+ function C(p) {
301
+ let [e] = l.useLexicalComposerContext(), t = s.useMemo(() => p(e), [e, p]), n = s.useRef(t.initialValueFn()), [o, r] = s.useState(n.current);
302
+ return g(() => {
303
+ let { initialValueFn: i, subscribe: u } = t, f = i();
304
+ return n.current !== f && (n.current = f, r(f)), u((a) => {
305
+ n.current = a, r(a);
312
306
  });
313
- }, [u, m]), t;
307
+ }, [t, p]), o;
314
308
  }
315
- function p(m) {
316
- return { initialValueFn: () => m.isEditable(), subscribe: (a) => m.registerEditableListener(a) };
309
+ function d(p) {
310
+ return { initialValueFn: () => p.isEditable(), subscribe: (e) => p.registerEditableListener(e) };
317
311
  }
318
- return me = function() {
319
- return L(p);
320
- }, me;
312
+ return J = function() {
313
+ return C(d);
314
+ }, J;
321
315
  }
322
- var xe, ke;
323
- function lt() {
324
- return ke || (ke = 1, xe = process.env.NODE_ENV === "development" ? It() : Ut()), xe;
316
+ var Y, xe;
317
+ function Me() {
318
+ return xe || (xe = 1, Y = process.env.NODE_ENV === "development" ? ht() : Et()), Y;
325
319
  }
326
- var J = {}, Ae;
327
- function Kt() {
328
- if (Ae)
329
- return J;
330
- Ae = 1;
331
- var c = Y;
332
- function i(e, t) {
333
- let n = e.getFirstChild(), r = 0;
320
+ var F = {}, he;
321
+ function vt() {
322
+ if (he)
323
+ return F;
324
+ he = 1;
325
+ var l = A;
326
+ function s(n, o) {
327
+ let r = n.getFirstChild(), i = 0;
334
328
  e:
335
- for (; n !== null; ) {
336
- if (c.$isElementNode(n)) {
337
- const o = n.getFirstChild();
338
- if (o !== null) {
339
- n = o;
329
+ for (; r !== null; ) {
330
+ if (l.$isElementNode(r)) {
331
+ const a = r.getFirstChild();
332
+ if (a !== null) {
333
+ r = a;
340
334
  continue;
341
335
  }
342
- } else if (c.$isTextNode(n)) {
343
- const o = n.getTextContentSize();
344
- if (r + o > t)
336
+ } else if (l.$isTextNode(r)) {
337
+ const a = r.getTextContentSize();
338
+ if (i + a > o)
345
339
  return {
346
- node: n,
347
- offset: t - r
340
+ node: r,
341
+ offset: o - i
348
342
  };
349
- r += o;
343
+ i += a;
350
344
  }
351
- const s = n.getNextSibling();
352
- if (s !== null) {
353
- n = s;
345
+ const u = r.getNextSibling();
346
+ if (u !== null) {
347
+ r = u;
354
348
  continue;
355
349
  }
356
- let l = n.getParent();
357
- for (; l !== null; ) {
358
- const o = l.getNextSibling();
359
- if (o !== null) {
360
- n = o;
350
+ let f = r.getParent();
351
+ for (; f !== null; ) {
352
+ const a = f.getNextSibling();
353
+ if (a !== null) {
354
+ r = a;
361
355
  continue e;
362
356
  }
363
- l = l.getParent();
357
+ f = f.getParent();
364
358
  }
365
359
  break;
366
360
  }
367
361
  return null;
368
362
  }
369
- function h(e, t = !0) {
370
- if (e)
363
+ function g(n, o = !0) {
364
+ if (n)
371
365
  return !1;
372
- let n = p();
373
- return t && (n = n.trim()), n === "";
366
+ let r = d();
367
+ return o && (r = r.trim()), r === "";
374
368
  }
375
- function L(e, t) {
376
- return () => h(e, t);
369
+ function C(n, o) {
370
+ return () => g(n, o);
377
371
  }
378
- function p() {
379
- return c.$getRoot().getTextContent();
372
+ function d() {
373
+ return l.$getRoot().getTextContent();
380
374
  }
381
- function m(e) {
382
- if (!h(e, !1))
375
+ function p(n) {
376
+ if (!g(n, !1))
383
377
  return !1;
384
- const n = c.$getRoot().getChildren(), r = n.length;
385
- if (r > 1)
378
+ const r = l.$getRoot().getChildren(), i = r.length;
379
+ if (i > 1)
386
380
  return !1;
387
- for (let s = 0; s < r; s++) {
388
- const l = n[s];
389
- if (c.$isDecoratorNode(l))
381
+ for (let u = 0; u < i; u++) {
382
+ const f = r[u];
383
+ if (l.$isDecoratorNode(f))
390
384
  return !1;
391
- if (c.$isElementNode(l)) {
392
- if (!c.$isParagraphNode(l) || l.__indent !== 0)
385
+ if (l.$isElementNode(f)) {
386
+ if (!l.$isParagraphNode(f) || f.__indent !== 0)
393
387
  return !1;
394
- const o = l.getChildren(), x = o.length;
395
- for (let v = 0; v < x; v++) {
396
- const g = o[s];
397
- if (!c.$isTextNode(g))
388
+ const a = f.getChildren(), h = a.length;
389
+ for (let v = 0; v < h; v++) {
390
+ const E = a[u];
391
+ if (!l.$isTextNode(E))
398
392
  return !1;
399
393
  }
400
394
  }
401
395
  }
402
396
  return !0;
403
397
  }
404
- function a(e) {
405
- return () => m(e);
398
+ function e(n) {
399
+ return () => p(n);
406
400
  }
407
- function u(e, t, n, r) {
408
- const s = (T) => T instanceof n, l = (T) => {
409
- const y = c.$createTextNode(T.getTextContent());
410
- y.setFormat(T.getFormat()), T.replace(y);
411
- }, o = (T) => T.getLatest().__mode, x = (T) => {
412
- if (!T.isSimpleText())
401
+ function t(n, o, r, i) {
402
+ const u = (c) => c instanceof r, f = (c) => {
403
+ const m = l.$createTextNode(c.getTextContent());
404
+ m.setFormat(c.getFormat()), c.replace(m);
405
+ }, a = (c) => c.getLatest().__mode, h = (c) => {
406
+ if (!c.isSimpleText())
413
407
  return;
414
- const y = T.getPreviousSibling();
415
- let w = T.getTextContent(), R = T, d;
416
- if (c.$isTextNode(y)) {
417
- const E = y.getTextContent(), f = E + w, N = t(f);
418
- if (s(y))
419
- if (N === null || o(y) !== 0) {
420
- l(y);
408
+ const m = c.getPreviousSibling();
409
+ let x = c.getTextContent(), y = c, T;
410
+ if (l.$isTextNode(m)) {
411
+ const L = m.getTextContent(), w = L + x, b = o(w);
412
+ if (u(m))
413
+ if (b === null || a(m) !== 0) {
414
+ f(m);
421
415
  return;
422
416
  } else {
423
- const C = N.end - E.length;
424
- if (C > 0) {
425
- const b = w.slice(0, C), _ = E + b;
426
- if (y.select(), y.setTextContent(_), C === w.length)
427
- T.remove();
417
+ const N = b.end - L.length;
418
+ if (N > 0) {
419
+ const S = x.slice(0, N), P = L + S;
420
+ if (m.select(), m.setTextContent(P), N === x.length)
421
+ c.remove();
428
422
  else {
429
- const $ = w.slice(C);
430
- T.setTextContent($);
423
+ const D = x.slice(N);
424
+ c.setTextContent(D);
431
425
  }
432
426
  return;
433
427
  }
434
428
  }
435
- else if (N === null || N.start < E.length)
429
+ else if (b === null || b.start < L.length)
436
430
  return;
437
431
  }
438
432
  for (; ; ) {
439
- d = t(w);
440
- let E = d === null ? "" : w.slice(d.end);
441
- if (w = E, E === "") {
442
- const C = R.getNextSibling();
443
- if (c.$isTextNode(C)) {
444
- E = R.getTextContent() + C.getTextContent();
445
- const b = t(E);
446
- if (b === null) {
447
- s(C) ? l(C) : C.markDirty();
433
+ T = o(x);
434
+ let L = T === null ? "" : x.slice(T.end);
435
+ if (x = L, L === "") {
436
+ const N = y.getNextSibling();
437
+ if (l.$isTextNode(N)) {
438
+ L = y.getTextContent() + N.getTextContent();
439
+ const S = o(L);
440
+ if (S === null) {
441
+ u(N) ? f(N) : N.markDirty();
448
442
  return;
449
- } else if (b.start !== 0)
443
+ } else if (S.start !== 0)
450
444
  return;
451
445
  }
452
446
  } else {
453
- const C = t(E);
454
- if (C !== null && C.start === 0)
447
+ const N = o(L);
448
+ if (N !== null && N.start === 0)
455
449
  return;
456
450
  }
457
- if (d === null)
451
+ if (T === null)
458
452
  return;
459
- if (d.start === 0 && c.$isTextNode(y) && y.isTextEntity())
453
+ if (T.start === 0 && l.$isTextNode(m) && m.isTextEntity())
460
454
  continue;
461
- let f;
462
- d.start === 0 ? [f, R] = R.splitText(d.end) : [, f, R] = R.splitText(d.start, d.end);
463
- const N = r(f);
464
- if (N.setFormat(f.getFormat()), f.replace(N), R == null)
455
+ let w;
456
+ T.start === 0 ? [w, y] = y.splitText(T.end) : [, w, y] = y.splitText(T.start, T.end);
457
+ const b = i(w);
458
+ if (b.setFormat(w.getFormat()), w.replace(b), y == null)
465
459
  return;
466
460
  }
467
- }, v = (T) => {
468
- const y = T.getTextContent(), w = t(y);
469
- if (w === null || w.start !== 0) {
470
- l(T);
461
+ }, v = (c) => {
462
+ const m = c.getTextContent(), x = o(m);
463
+ if (x === null || x.start !== 0) {
464
+ f(c);
471
465
  return;
472
466
  }
473
- if (y.length > w.end) {
474
- T.splitText(w.end);
467
+ if (m.length > x.end) {
468
+ c.splitText(x.end);
475
469
  return;
476
470
  }
477
- const R = T.getPreviousSibling();
478
- c.$isTextNode(R) && R.isTextEntity() && (l(R), l(T));
479
- const d = T.getNextSibling();
480
- c.$isTextNode(d) && d.isTextEntity() && (l(d), s(T) && l(T));
481
- }, g = e.registerNodeTransform(c.TextNode, x), S = e.registerNodeTransform(n, v);
482
- return [g, S];
483
- }
484
- return J.$canShowPlaceholder = m, J.$canShowPlaceholderCurry = a, J.$findTextIntersectionFromCharacters = i, J.$isRootTextContentEmpty = h, J.$isRootTextContentEmptyCurry = L, J.$rootTextContent = p, J.registerLexicalTextEntity = u, J;
471
+ const y = c.getPreviousSibling();
472
+ l.$isTextNode(y) && y.isTextEntity() && (f(y), f(c));
473
+ const T = c.getNextSibling();
474
+ l.$isTextNode(T) && T.isTextEntity() && (f(T), u(c) && f(c));
475
+ }, E = n.registerNodeTransform(l.TextNode, h), $ = n.registerNodeTransform(r, v);
476
+ return [E, $];
477
+ }
478
+ return F.$canShowPlaceholder = p, F.$canShowPlaceholderCurry = e, F.$findTextIntersectionFromCharacters = s, F.$isRootTextContentEmpty = g, F.$isRootTextContentEmptyCurry = C, F.$rootTextContent = d, F.registerLexicalTextEntity = t, F;
485
479
  }
486
- var G = {}, Ie;
487
- function jt() {
488
- if (Ie)
489
- return G;
490
- Ie = 1;
491
- var c = Y;
492
- function i(p, m = !0) {
493
- return p ? !1 : (p = h(), m && (p = p.trim()), p === "");
494
- }
495
- function h() {
496
- return c.$getRoot().getTextContent();
497
- }
498
- function L(p) {
499
- if (!i(p, !1))
480
+ var k = {}, Ee;
481
+ function Ct() {
482
+ if (Ee)
483
+ return k;
484
+ Ee = 1;
485
+ var l = A;
486
+ function s(d, p = !0) {
487
+ return d ? !1 : (d = g(), p && (d = d.trim()), d === "");
488
+ }
489
+ function g() {
490
+ return l.$getRoot().getTextContent();
491
+ }
492
+ function C(d) {
493
+ if (!s(d, !1))
500
494
  return !1;
501
- p = c.$getRoot().getChildren();
502
- let m = p.length;
503
- if (1 < m)
495
+ d = l.$getRoot().getChildren();
496
+ let p = d.length;
497
+ if (1 < p)
504
498
  return !1;
505
- for (let u = 0; u < m; u++) {
506
- var a = p[u];
507
- if (c.$isDecoratorNode(a))
499
+ for (let t = 0; t < p; t++) {
500
+ var e = d[t];
501
+ if (l.$isDecoratorNode(e))
508
502
  return !1;
509
- if (c.$isElementNode(a)) {
510
- if (!c.$isParagraphNode(a) || a.__indent !== 0)
503
+ if (l.$isElementNode(e)) {
504
+ if (!l.$isParagraphNode(e) || e.__indent !== 0)
511
505
  return !1;
512
- a = a.getChildren();
513
- let e = a.length;
514
- for (let t = 0; t < e; t++)
515
- if (!c.$isTextNode(a[u]))
506
+ e = e.getChildren();
507
+ let n = e.length;
508
+ for (let o = 0; o < n; o++)
509
+ if (!l.$isTextNode(e[t]))
516
510
  return !1;
517
511
  }
518
512
  }
519
513
  return !0;
520
514
  }
521
- return G.$canShowPlaceholder = L, G.$canShowPlaceholderCurry = function(p) {
522
- return () => L(p);
523
- }, G.$findTextIntersectionFromCharacters = function(p, m) {
524
- var a = p.getFirstChild();
525
- p = 0;
515
+ return k.$canShowPlaceholder = C, k.$canShowPlaceholderCurry = function(d) {
516
+ return () => C(d);
517
+ }, k.$findTextIntersectionFromCharacters = function(d, p) {
518
+ var e = d.getFirstChild();
519
+ d = 0;
526
520
  e:
527
- for (; a !== null; ) {
528
- if (c.$isElementNode(a)) {
529
- var u = a.getFirstChild();
530
- if (u !== null) {
531
- a = u;
521
+ for (; e !== null; ) {
522
+ if (l.$isElementNode(e)) {
523
+ var t = e.getFirstChild();
524
+ if (t !== null) {
525
+ e = t;
532
526
  continue;
533
527
  }
534
- } else if (c.$isTextNode(a)) {
535
- if (u = a.getTextContentSize(), p + u > m)
536
- return { node: a, offset: m - p };
537
- p += u;
528
+ } else if (l.$isTextNode(e)) {
529
+ if (t = e.getTextContentSize(), d + t > p)
530
+ return { node: e, offset: p - d };
531
+ d += t;
538
532
  }
539
- if (u = a.getNextSibling(), u !== null)
540
- a = u;
533
+ if (t = e.getNextSibling(), t !== null)
534
+ e = t;
541
535
  else {
542
- for (a = a.getParent(); a !== null; ) {
543
- if (u = a.getNextSibling(), u !== null) {
544
- a = u;
536
+ for (e = e.getParent(); e !== null; ) {
537
+ if (t = e.getNextSibling(), t !== null) {
538
+ e = t;
545
539
  continue e;
546
540
  }
547
- a = a.getParent();
541
+ e = e.getParent();
548
542
  }
549
543
  break;
550
544
  }
551
545
  }
552
546
  return null;
553
- }, G.$isRootTextContentEmpty = i, G.$isRootTextContentEmptyCurry = function(p, m) {
554
- return () => i(p, m);
555
- }, G.$rootTextContent = h, G.registerLexicalTextEntity = function(p, m, a, u) {
556
- let e = (n) => {
557
- const r = c.$createTextNode(n.getTextContent());
558
- r.setFormat(n.getFormat()), n.replace(r);
559
- }, t = p.registerNodeTransform(c.TextNode, (n) => {
560
- if (n.isSimpleText()) {
561
- var r = n.getPreviousSibling(), s = n.getTextContent(), l = n;
562
- if (c.$isTextNode(r)) {
563
- var o = r.getTextContent(), x = m(o + s);
564
- if (r instanceof a) {
565
- if (x === null || r.getLatest().__mode !== 0) {
566
- e(r);
547
+ }, k.$isRootTextContentEmpty = s, k.$isRootTextContentEmptyCurry = function(d, p) {
548
+ return () => s(d, p);
549
+ }, k.$rootTextContent = g, k.registerLexicalTextEntity = function(d, p, e, t) {
550
+ let n = (r) => {
551
+ const i = l.$createTextNode(r.getTextContent());
552
+ i.setFormat(r.getFormat()), r.replace(i);
553
+ }, o = d.registerNodeTransform(l.TextNode, (r) => {
554
+ if (r.isSimpleText()) {
555
+ var i = r.getPreviousSibling(), u = r.getTextContent(), f = r;
556
+ if (l.$isTextNode(i)) {
557
+ var a = i.getTextContent(), h = p(a + u);
558
+ if (i instanceof e) {
559
+ if (h === null || i.getLatest().__mode !== 0) {
560
+ n(i);
567
561
  return;
568
562
  }
569
- if (x = x.end - o.length, 0 < x) {
570
- l = s.slice(0, x), l = o + l, r.select(), r.setTextContent(l), x === s.length ? n.remove() : (r = s.slice(x), n.setTextContent(r));
563
+ if (h = h.end - a.length, 0 < h) {
564
+ f = u.slice(0, h), f = a + f, i.select(), i.setTextContent(f), h === u.length ? r.remove() : (i = u.slice(h), r.setTextContent(i));
571
565
  return;
572
566
  }
573
- } else if (x === null || x.start < o.length)
567
+ } else if (h === null || h.start < a.length)
574
568
  return;
575
569
  }
576
570
  for (; ; ) {
577
- if (n = m(s), s = x = n === null ? "" : s.slice(n.end), x === "") {
578
- if (o = l.getNextSibling(), c.$isTextNode(o)) {
579
- if (x = l.getTextContent() + o.getTextContent(), x = m(x), x === null) {
580
- o instanceof a ? e(o) : o.markDirty();
571
+ if (r = p(u), u = h = r === null ? "" : u.slice(r.end), h === "") {
572
+ if (a = f.getNextSibling(), l.$isTextNode(a)) {
573
+ if (h = f.getTextContent() + a.getTextContent(), h = p(h), h === null) {
574
+ a instanceof e ? n(a) : a.markDirty();
581
575
  break;
582
- } else if (x.start !== 0)
576
+ } else if (h.start !== 0)
583
577
  break;
584
578
  }
585
- } else if (o = m(x), o !== null && o.start === 0)
579
+ } else if (a = p(h), a !== null && a.start === 0)
586
580
  break;
587
- if (n === null)
581
+ if (r === null)
588
582
  break;
589
- if (n.start === 0 && c.$isTextNode(r) && r.isTextEntity())
583
+ if (r.start === 0 && l.$isTextNode(i) && i.isTextEntity())
590
584
  continue;
591
585
  let v;
592
- if (n.start === 0 ? [v, l] = l.splitText(n.end) : [, v, l] = l.splitText(n.start, n.end), n = u(v), n.setFormat(v.getFormat()), v.replace(n), l == null)
586
+ if (r.start === 0 ? [v, f] = f.splitText(r.end) : [, v, f] = f.splitText(r.start, r.end), r = t(v), r.setFormat(v.getFormat()), v.replace(r), f == null)
593
587
  break;
594
588
  }
595
589
  }
596
590
  });
597
- return p = p.registerNodeTransform(a, (n) => {
598
- var r = n.getTextContent();
599
- const s = m(r);
600
- s === null || s.start !== 0 ? e(n) : r.length > s.end ? n.splitText(s.end) : (r = n.getPreviousSibling(), c.$isTextNode(r) && r.isTextEntity() && (e(r), e(n)), r = n.getNextSibling(), c.$isTextNode(r) && r.isTextEntity() && (e(r), n instanceof a && e(n)));
601
- }), [t, p];
602
- }, G;
591
+ return d = d.registerNodeTransform(e, (r) => {
592
+ var i = r.getTextContent();
593
+ const u = p(i);
594
+ u === null || u.start !== 0 ? n(r) : i.length > u.end ? r.splitText(u.end) : (i = r.getPreviousSibling(), l.$isTextNode(i) && i.isTextEntity() && (n(i), n(r)), i = r.getNextSibling(), l.$isTextNode(i) && i.isTextEntity() && (n(i), r instanceof e && n(r)));
595
+ }), [o, d];
596
+ }, k;
603
597
  }
604
- var he, Ue;
605
- function st() {
606
- return Ue || (Ue = 1, he = process.env.NODE_ENV === "development" ? Kt() : jt()), he;
598
+ var Q, ve;
599
+ function Be() {
600
+ return ve || (ve = 1, Q = process.env.NODE_ENV === "development" ? vt() : Ct()), Q;
607
601
  }
608
- var P = {}, Ke;
609
- function Ht() {
610
- if (Ke)
611
- return P;
612
- Ke = 1;
613
- var c = tt, i = Y;
614
- function h(...d) {
615
- return () => {
616
- d.forEach((E) => E());
617
- };
618
- }
619
- function L(d) {
620
- return `${d}px`;
621
- }
622
- const p = {
623
- attributes: !0,
624
- characterData: !0,
625
- childList: !0,
626
- subtree: !0
627
- };
628
- function m(d, E, f) {
629
- let N = null, C = null, b = null, _ = [];
630
- const $ = document.createElement("div");
631
- function M() {
632
- if (N === null)
633
- throw Error("Unexpected null rootDOMNode");
634
- if (C === null)
635
- throw Error("Unexpected null parentDOMNode");
636
- const {
637
- left: q,
638
- top: K
639
- } = N.getBoundingClientRect(), H = C, A = c.createRectsFromDOMRange(d, E);
640
- $.isConnected || H.append($);
641
- let I = !1;
642
- for (let z = 0; z < A.length; z++) {
643
- const X = A[z], V = _[z] || document.createElement("div"), W = V.style;
644
- W.position !== "absolute" && (W.position = "absolute", I = !0);
645
- const ie = L(X.left - q);
646
- W.left !== ie && (W.left = ie, I = !0);
647
- const Z = L(X.top - K);
648
- W.top !== Z && (V.style.top = Z, I = !0);
649
- const ee = L(X.width);
650
- W.width !== ee && (V.style.width = ee, I = !0);
651
- const te = L(X.height);
652
- W.height !== te && (V.style.height = te, I = !0), V.parentNode !== $ && ($.append(V), I = !0), _[z] = V;
602
+ var _ = {}, Ce;
603
+ function Lt() {
604
+ if (Ce)
605
+ return _;
606
+ Ce = 1;
607
+ var l = qe, s = A;
608
+ function g(c, ...m) {
609
+ m.forEach((x) => {
610
+ if (typeof x == "string") {
611
+ const y = x.split(" ").filter((T) => T !== "");
612
+ c.classList.add(...y);
653
613
  }
654
- for (; _.length > A.length; )
655
- _.pop();
656
- I && f(_);
657
- }
658
- function O() {
659
- C = null, N = null, b !== null && b.disconnect(), b = null, $.remove();
660
- for (const q of _)
661
- q.remove();
662
- _ = [];
663
- }
664
- function F() {
665
- const q = d.getRootElement();
666
- if (q === null)
667
- return O();
668
- const K = q.parentElement;
669
- if (!(K instanceof HTMLElement))
670
- return O();
671
- O(), N = q, C = K, b = new MutationObserver((H) => {
672
- const A = d.getRootElement(), I = A && A.parentElement;
673
- if (A !== N || I !== C)
674
- return F();
675
- for (const z of H)
676
- if (!$.contains(z.target))
677
- return M();
678
- }), b.observe(K, p), M();
679
- }
680
- const B = d.registerRootListener(F);
681
- return () => {
682
- B(), O();
683
- };
684
- }
685
- function a(d, E) {
686
- let f = null, N = null, C = null, b = null, _ = () => {
687
- };
688
- function $(M) {
689
- M.read(() => {
690
- const O = i.$getSelection();
691
- if (!i.$isRangeSelection(O)) {
692
- f = null, N = null, C = null, b = null, _(), _ = () => {
693
- };
694
- return;
695
- }
696
- const {
697
- anchor: F,
698
- focus: B
699
- } = O, q = F.getNode(), K = q.getKey(), H = F.offset, A = B.getNode(), I = A.getKey(), z = B.offset, X = d.getElementByKey(K), V = d.getElementByKey(I), W = f === null || X === null || H !== N || K !== f.getKey() || q !== f && (!(f instanceof i.TextNode) || q.updateDOM(f, X, d._config)), ie = C === null || V === null || z !== b || I !== C.getKey() || A !== C && (!(C instanceof i.TextNode) || A.updateDOM(C, V, d._config));
700
- if (W || ie) {
701
- const Z = d.getElementByKey(F.getNode().getKey()), ee = d.getElementByKey(B.getNode().getKey());
702
- if (Z !== null && ee !== null && Z.tagName === "SPAN" && ee.tagName === "SPAN") {
703
- const te = document.createRange();
704
- let le, se, ae, ce;
705
- B.isBefore(F) ? (le = ee, se = B.offset, ae = Z, ce = F.offset) : (le = Z, se = F.offset, ae = ee, ce = B.offset);
706
- const we = le.firstChild;
707
- if (we === null)
708
- throw Error("Expected text node to be first child of span");
709
- const Se = ae.firstChild;
710
- if (Se === null)
711
- throw Error("Expected text node to be first child of span");
712
- te.setStart(we, se), te.setEnd(Se, ce), _(), _ = m(d, te, (Re) => {
713
- for (const ut of Re) {
714
- const k = ut.style;
715
- k.background !== "Highlight" && (k.background = "Highlight"), k.color !== "HighlightText" && (k.color = "HighlightText"), k.zIndex !== "-1" && (k.zIndex = "-1"), k.pointerEvents !== "none" && (k.pointerEvents = "none"), k.marginTop !== L(-1.5) && (k.marginTop = L(-1.5)), k.paddingTop !== L(4) && (k.paddingTop = L(4)), k.paddingBottom !== L(0) && (k.paddingBottom = L(0));
716
- }
717
- E !== void 0 && E(Re);
718
- });
719
- }
720
- }
721
- f = q, N = H, C = A, b = z;
722
- });
723
- }
724
- return $(d.getEditorState()), h(d.registerUpdateListener(({
725
- editorState: M
726
- }) => $(M)), _, () => {
727
- _();
728
614
  });
729
615
  }
730
- function u(d, ...E) {
731
- E.forEach((f) => {
732
- if (typeof f == "string") {
733
- const N = f.split(" ").filter((C) => C !== "");
734
- d.classList.add(...N);
735
- }
616
+ function C(c, ...m) {
617
+ m.forEach((x) => {
618
+ typeof x == "string" && c.classList.remove(...x.split(" "));
736
619
  });
737
620
  }
738
- function e(d, ...E) {
739
- E.forEach((f) => {
740
- typeof f == "string" && d.classList.remove(...f.split(" "));
741
- });
742
- }
743
- function t(d, E) {
744
- for (const f of E)
745
- if (d.type.startsWith(f))
621
+ function d(c, m) {
622
+ for (const x of m)
623
+ if (c.type.startsWith(x))
746
624
  return !0;
747
625
  return !1;
748
626
  }
749
- function n(d, E) {
750
- const f = d[Symbol.iterator]();
751
- return new Promise((N, C) => {
752
- const b = [], _ = () => {
627
+ function p(c, m) {
628
+ const x = c[Symbol.iterator]();
629
+ return new Promise((y, T) => {
630
+ const L = [], w = () => {
753
631
  const {
754
- done: $,
755
- value: M
756
- } = f.next();
757
- if ($)
758
- return N(b);
759
- const O = new FileReader();
760
- O.addEventListener("error", C), O.addEventListener("load", () => {
761
- const F = O.result;
762
- typeof F == "string" && b.push({
763
- file: M,
764
- result: F
765
- }), _();
766
- }), t(M, E) ? O.readAsDataURL(M) : _();
632
+ done: b,
633
+ value: N
634
+ } = x.next();
635
+ if (b)
636
+ return y(L);
637
+ const S = new FileReader();
638
+ S.addEventListener("error", T), S.addEventListener("load", () => {
639
+ const P = S.result;
640
+ typeof P == "string" && L.push({
641
+ file: N,
642
+ result: P
643
+ }), w();
644
+ }), d(N, m) ? S.readAsDataURL(N) : w();
767
645
  };
768
- _();
646
+ w();
769
647
  });
770
648
  }
771
- function r(d, E) {
772
- const f = [], N = (d || i.$getRoot()).getLatest(), C = E || (i.$isElementNode(N) ? N.getLastDescendant() : N);
773
- let b = N, _ = s(b);
774
- for (; b !== null && !b.is(C); )
775
- if (f.push({
776
- depth: _,
777
- node: b
778
- }), i.$isElementNode(b) && b.getChildrenSize() > 0)
779
- b = b.getFirstChild(), _++;
649
+ function e(c, m) {
650
+ const x = [], y = (c || s.$getRoot()).getLatest(), T = m || (s.$isElementNode(y) ? y.getLastDescendant() : y);
651
+ let L = y, w = t(L);
652
+ for (; L !== null && !L.is(T); )
653
+ if (x.push({
654
+ depth: w,
655
+ node: L
656
+ }), s.$isElementNode(L) && L.getChildrenSize() > 0)
657
+ L = L.getFirstChild(), w++;
780
658
  else {
781
- let $ = null;
782
- for (; $ === null && b !== null; )
783
- $ = b.getNextSibling(), $ === null ? (b = b.getParent(), _--) : b = $;
659
+ let b = null;
660
+ for (; b === null && L !== null; )
661
+ b = L.getNextSibling(), b === null ? (L = L.getParent(), w--) : L = b;
784
662
  }
785
- return b !== null && b.is(C) && f.push({
786
- depth: _,
787
- node: b
788
- }), f;
789
- }
790
- function s(d) {
791
- let E = d, f = 0;
792
- for (; (E = E.getParent()) !== null; )
793
- f++;
794
- return f;
795
- }
796
- function l(d, E) {
797
- let f = d;
798
- for (; f != null; ) {
799
- if (f instanceof E)
800
- return f;
801
- f = f.getParent();
663
+ return L !== null && L.is(T) && x.push({
664
+ depth: w,
665
+ node: L
666
+ }), x;
667
+ }
668
+ function t(c) {
669
+ let m = c, x = 0;
670
+ for (; (m = m.getParent()) !== null; )
671
+ x++;
672
+ return x;
673
+ }
674
+ function n(c, m) {
675
+ let x = c;
676
+ for (; x != null; ) {
677
+ if (x instanceof m)
678
+ return x;
679
+ x = x.getParent();
802
680
  }
803
681
  return null;
804
682
  }
805
- function o(d) {
806
- const E = x(d, (f) => i.$isElementNode(f) && !f.isInline());
807
- if (!i.$isElementNode(E))
808
- throw Error(`Expected node ${d.__key} to have closest block element node.`);
809
- return E;
810
- }
811
- const x = (d, E) => {
812
- let f = d;
813
- for (; f !== i.$getRoot() && f != null; ) {
814
- if (E(f))
815
- return f;
816
- f = f.getParent();
683
+ function o(c) {
684
+ const m = r(c, (x) => s.$isElementNode(x) && !x.isInline());
685
+ if (!s.$isElementNode(m))
686
+ throw Error(`Expected node ${c.__key} to have closest block element node.`);
687
+ return m;
688
+ }
689
+ function r(c, m) {
690
+ let x = c;
691
+ for (; x !== s.$getRoot() && x != null; ) {
692
+ if (m(x))
693
+ return x;
694
+ x = x.getParent();
817
695
  }
818
696
  return null;
819
- };
820
- function v(d, E, f, N) {
821
- const C = ($) => $ instanceof E, b = ($) => {
822
- const M = $.getChildren();
823
- for (let B = 0; B < M.length; B++) {
824
- const q = M[B];
825
- if (C(q))
697
+ }
698
+ function i(...c) {
699
+ return () => {
700
+ c.forEach((m) => m());
701
+ };
702
+ }
703
+ function u(c, m, x, y) {
704
+ const T = (b) => b instanceof m, L = (b) => {
705
+ const N = b.getChildren();
706
+ for (let D = 0; D < N.length; D++) {
707
+ const j = N[D];
708
+ if (T(j))
826
709
  return null;
827
710
  }
828
- let O = $, F = $;
829
- for (; O !== null; )
830
- if (F = O, O = O.getParent(), C(O))
711
+ let S = b, P = b;
712
+ for (; S !== null; )
713
+ if (P = S, S = S.getParent(), T(S))
831
714
  return {
832
- child: F,
833
- parent: O
715
+ child: P,
716
+ parent: S
834
717
  };
835
718
  return null;
836
- }, _ = ($) => {
837
- const M = b($);
838
- if (M !== null) {
719
+ }, w = (b) => {
720
+ const N = L(b);
721
+ if (N !== null) {
839
722
  const {
840
- child: O,
841
- parent: F
842
- } = M;
843
- if (O.is($)) {
844
- N(F, $);
845
- const B = O.getNextSiblings(), q = B.length;
846
- if (F.insertAfter(O), q !== 0) {
847
- const K = f(F);
848
- O.insertAfter(K);
849
- for (let H = 0; H < q; H++)
850
- K.append(B[H]);
723
+ child: S,
724
+ parent: P
725
+ } = N;
726
+ if (S.is(b)) {
727
+ y(P, b);
728
+ const D = S.getNextSiblings(), j = D.length;
729
+ if (P.insertAfter(S), j !== 0) {
730
+ const le = x(P);
731
+ S.insertAfter(le);
732
+ for (let V = 0; V < j; V++)
733
+ le.append(D[V]);
851
734
  }
852
- !F.canBeEmpty() && F.getChildrenSize() === 0 && F.remove();
735
+ !P.canBeEmpty() && P.getChildrenSize() === 0 && P.remove();
853
736
  }
854
737
  }
855
738
  };
856
- return d.registerNodeTransform(E, _);
857
- }
858
- function g(d, E) {
859
- const N = /* @__PURE__ */ new Map(), C = d._pendingEditorState;
860
- for (const [_, $] of E._nodeMap) {
861
- const M = c.$cloneWithProperties($);
862
- if (i.$isTextNode(M)) {
863
- if (!i.$isTextNode($))
864
- throw Error("Expected node be a TextNode");
865
- M.__text = $.__text;
866
- }
867
- N.set(_, M);
739
+ return c.registerNodeTransform(m, w);
740
+ }
741
+ function f(c, m) {
742
+ const y = /* @__PURE__ */ new Map(), T = c._pendingEditorState;
743
+ for (const [w, b] of m._nodeMap) {
744
+ const N = l.$cloneWithProperties(b);
745
+ s.$isTextNode(N) && (N.__text = b.__text), y.set(w, N);
868
746
  }
869
- C && (C._nodeMap = N), d._dirtyType = 2;
870
- const b = E._selection;
871
- i.$setSelection(b === null ? null : b.clone());
747
+ T && (T._nodeMap = y), c._dirtyType = 2;
748
+ const L = m._selection;
749
+ s.$setSelection(L === null ? null : L.clone());
872
750
  }
873
- function S(d) {
874
- const E = i.$getSelection() || i.$getPreviousSelection();
875
- if (i.$isRangeSelection(E)) {
751
+ function a(c) {
752
+ const m = s.$getSelection() || s.$getPreviousSelection();
753
+ if (s.$isRangeSelection(m)) {
876
754
  const {
877
- focus: f
878
- } = E, N = f.getNode(), C = f.offset;
879
- if (i.$isRootOrShadowRoot(N)) {
880
- const b = N.getChildAtIndex(C);
881
- b == null ? N.append(d) : b.insertBefore(d), d.selectNext();
755
+ focus: x
756
+ } = m, y = x.getNode(), T = x.offset;
757
+ if (s.$isRootOrShadowRoot(y)) {
758
+ const L = y.getChildAtIndex(T);
759
+ L == null ? y.append(c) : L.insertBefore(c), c.selectNext();
882
760
  } else {
883
- let b, _;
884
- i.$isTextNode(N) ? (b = N.getParentOrThrow(), _ = N.getIndexWithinParent(), C > 0 && (_ += 1, N.splitText(C))) : (b = N, _ = C);
885
- const [, $] = i.$splitNode(b, _);
886
- $.insertBefore(d), $.selectStart();
761
+ let L, w;
762
+ s.$isTextNode(y) ? (L = y.getParentOrThrow(), w = y.getIndexWithinParent(), T > 0 && (w += 1, y.splitText(T))) : (L = y, w = T);
763
+ const [, b] = s.$splitNode(L, w);
764
+ b.insertBefore(c), b.selectStart();
887
765
  }
888
766
  } else {
889
- if (E != null) {
890
- const N = E.getNodes();
891
- N[N.length - 1].getTopLevelElementOrThrow().insertAfter(d);
767
+ if (s.$isNodeSelection(m) || s.DEPRECATED_$isGridSelection(m)) {
768
+ const y = m.getNodes();
769
+ y[y.length - 1].getTopLevelElementOrThrow().insertAfter(c);
892
770
  } else
893
- i.$getRoot().append(d);
894
- const f = i.$createParagraphNode();
895
- d.insertAfter(f), f.select();
771
+ s.$getRoot().append(c);
772
+ const x = s.$createParagraphNode();
773
+ c.insertAfter(x), x.select();
896
774
  }
897
- return d.getLatest();
775
+ return c.getLatest();
898
776
  }
899
- function T(d, E) {
900
- const f = E();
901
- return d.replace(f), f.append(d), f;
777
+ function h(c, m) {
778
+ const x = m();
779
+ return c.replace(x), x.append(c), x;
902
780
  }
903
- function y(d, E) {
904
- return d !== null ? Object.getPrototypeOf(d).constructor.name === E.name : !1;
781
+ function v(c) {
782
+ return E(c) && c.tagName === "A";
905
783
  }
906
- function w(d, E) {
907
- const f = [];
908
- for (let N = 0; N < d.length; N++) {
909
- const C = E(d[N]);
910
- C !== null && f.push(C);
911
- }
912
- return f;
784
+ function E(c) {
785
+ return c.nodeType === 1;
913
786
  }
914
- function R(d, E) {
915
- const f = d.getFirstChild();
916
- f !== null ? f.insertBefore(E) : d.append(E);
787
+ function $(c, m) {
788
+ return c !== null ? Object.getPrototypeOf(c).constructor.name === m.name : !1;
917
789
  }
918
- return P.$splitNode = i.$splitNode, P.isHTMLAnchorElement = i.isHTMLAnchorElement, P.isHTMLElement = i.isHTMLElement, P.$dfs = r, P.$filter = w, P.$findMatchingParent = x, P.$getNearestBlockElementAncestorOrThrow = o, P.$getNearestNodeOfType = l, P.$insertFirst = R, P.$insertNodeToNearestRoot = S, P.$restoreEditorState = g, P.$wrapNodeInElement = T, P.addClassNamesToElement = u, P.isMimeType = t, P.markSelection = a, P.mediaFileReader = n, P.mergeRegister = h, P.objectKlassEquals = y, P.positionNodeOnRange = m, P.registerNestedElementResolver = v, P.removeClassNamesFromElement = e, P;
790
+ return _.$splitNode = s.$splitNode, _.$dfs = e, _.$findMatchingParent = r, _.$getNearestBlockElementAncestorOrThrow = o, _.$getNearestNodeOfType = n, _.$insertNodeToNearestRoot = a, _.$restoreEditorState = f, _.$wrapNodeInElement = h, _.addClassNamesToElement = g, _.isHTMLAnchorElement = v, _.isHTMLElement = E, _.isMimeType = d, _.mediaFileReader = p, _.mergeRegister = i, _.objectKlassEquals = $, _.registerNestedElementResolver = u, _.removeClassNamesFromElement = C, _;
919
791
  }
920
- var D = {}, je;
921
- function zt() {
922
- if (je)
923
- return D;
924
- je = 1;
925
- var c = tt, i = Y;
926
- function h(e) {
792
+ var R = {}, Le;
793
+ function yt() {
794
+ if (Le)
795
+ return R;
796
+ Le = 1;
797
+ var l = qe, s = A;
798
+ function g(e) {
927
799
  let t = new URLSearchParams();
928
800
  t.append("code", e);
929
801
  for (let n = 1; n < arguments.length; n++)
930
802
  t.append("v", arguments[n]);
931
803
  throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
932
804
  }
933
- function L(...e) {
934
- return () => {
935
- e.forEach((t) => t());
936
- };
937
- }
938
- let p = { attributes: !0, characterData: !0, childList: !0, subtree: !0 };
939
- function m(e, t, n) {
940
- function r() {
941
- if (o === null)
942
- throw Error("Unexpected null rootDOMNode");
943
- if (x === null)
944
- throw Error("Unexpected null parentDOMNode");
945
- let { left: y, top: w } = o.getBoundingClientRect();
946
- var R = x;
947
- let d = c.createRectsFromDOMRange(e, t);
948
- S.isConnected || R.append(S), R = !1;
949
- for (let N = 0; N < d.length; N++) {
950
- var E = d[N];
951
- let C = g[N] || document.createElement("div"), b = C.style;
952
- b.position !== "absolute" && (b.position = "absolute", R = !0);
953
- var f = `${E.left - y}px`;
954
- b.left !== f && (b.left = f, R = !0), f = `${E.top - w}px`, b.top !== f && (C.style.top = f, R = !0), f = `${E.width}px`, b.width !== f && (C.style.width = f, R = !0), E = `${E.height}px`, b.height !== E && (C.style.height = E, R = !0), C.parentNode !== S && (S.append(C), R = !0), g[N] = C;
955
- }
956
- for (; g.length > d.length; )
957
- g.pop();
958
- R && n(g);
959
- }
960
- function s() {
961
- o = x = null, v !== null && v.disconnect(), v = null, S.remove();
962
- for (let y of g)
963
- y.remove();
964
- g = [];
965
- }
966
- function l() {
967
- let y = e.getRootElement();
968
- if (y === null)
969
- return s();
970
- let w = y.parentElement;
971
- if (!(w instanceof HTMLElement))
972
- return s();
973
- s(), o = y, x = w, v = new MutationObserver((R) => {
974
- let d = e.getRootElement(), E = d && d.parentElement;
975
- if (d !== o || E !== x)
976
- return l();
977
- for (let f of R)
978
- if (!S.contains(f.target))
979
- return r();
980
- }), v.observe(w, p), r();
981
- }
982
- let o = null, x = null, v = null, g = [], S = document.createElement("div"), T = e.registerRootListener(l);
983
- return () => {
984
- T(), s();
985
- };
986
- }
987
- function a(e, t) {
805
+ function C(e, t) {
988
806
  for (let n of t)
989
807
  if (e.type.startsWith(n))
990
808
  return !0;
991
809
  return !1;
992
810
  }
993
- let u = (e, t) => {
994
- for (; e !== i.$getRoot() && e != null; ) {
811
+ function d(e, t) {
812
+ for (; e !== s.$getRoot() && e != null; ) {
995
813
  if (t(e))
996
814
  return e;
997
815
  e = e.getParent();
998
816
  }
999
817
  return null;
1000
- };
1001
- return D.$splitNode = i.$splitNode, D.isHTMLAnchorElement = i.isHTMLAnchorElement, D.isHTMLElement = i.isHTMLElement, D.$dfs = function(e, t) {
818
+ }
819
+ function p(e) {
820
+ return e.nodeType === 1;
821
+ }
822
+ return R.$splitNode = s.$splitNode, R.$dfs = function(e, t) {
1002
823
  let n = [];
1003
- e = (e || i.$getRoot()).getLatest(), t = t || (i.$isElementNode(e) ? e.getLastDescendant() : e);
1004
- for (var r = e, s = 0; (r = r.getParent()) !== null; )
1005
- s++;
1006
- for (r = s; e !== null && !e.is(t); )
1007
- if (n.push({ depth: r, node: e }), i.$isElementNode(e) && 0 < e.getChildrenSize())
1008
- e = e.getFirstChild(), r++;
824
+ e = (e || s.$getRoot()).getLatest(), t = t || (s.$isElementNode(e) ? e.getLastDescendant() : e);
825
+ for (var o = e, r = 0; (o = o.getParent()) !== null; )
826
+ r++;
827
+ for (o = r; e !== null && !e.is(t); )
828
+ if (n.push({ depth: o, node: e }), s.$isElementNode(e) && 0 < e.getChildrenSize())
829
+ e = e.getFirstChild(), o++;
1009
830
  else
1010
- for (s = null; s === null && e !== null; )
1011
- s = e.getNextSibling(), s === null ? (e = e.getParent(), r--) : e = s;
1012
- return e !== null && e.is(t) && n.push({ depth: r, node: e }), n;
1013
- }, D.$filter = function(e, t) {
1014
- let n = [];
1015
- for (let r = 0; r < e.length; r++) {
1016
- let s = t(e[r]);
1017
- s !== null && n.push(s);
1018
- }
1019
- return n;
1020
- }, D.$findMatchingParent = u, D.$getNearestBlockElementAncestorOrThrow = function(e) {
1021
- let t = u(e, (n) => i.$isElementNode(n) && !n.isInline());
1022
- return i.$isElementNode(t) || h(4, e.__key), t;
1023
- }, D.$getNearestNodeOfType = function(e, t) {
831
+ for (r = null; r === null && e !== null; )
832
+ r = e.getNextSibling(), r === null ? (e = e.getParent(), o--) : e = r;
833
+ return e !== null && e.is(t) && n.push({ depth: o, node: e }), n;
834
+ }, R.$findMatchingParent = d, R.$getNearestBlockElementAncestorOrThrow = function(e) {
835
+ let t = d(e, (n) => s.$isElementNode(n) && !n.isInline());
836
+ return s.$isElementNode(t) || g(4, e.__key), t;
837
+ }, R.$getNearestNodeOfType = function(e, t) {
1024
838
  for (; e != null; ) {
1025
839
  if (e instanceof t)
1026
840
  return e;
1027
841
  e = e.getParent();
1028
842
  }
1029
843
  return null;
1030
- }, D.$insertFirst = function(e, t) {
1031
- let n = e.getFirstChild();
1032
- n !== null ? n.insertBefore(t) : e.append(t);
1033
- }, D.$insertNodeToNearestRoot = function(e) {
1034
- var t = i.$getSelection() || i.$getPreviousSelection();
1035
- if (i.$isRangeSelection(t)) {
844
+ }, R.$insertNodeToNearestRoot = function(e) {
845
+ var t = s.$getSelection() || s.$getPreviousSelection();
846
+ if (s.$isRangeSelection(t)) {
1036
847
  var { focus: n } = t;
1037
- if (t = n.getNode(), n = n.offset, i.$isRootOrShadowRoot(t))
848
+ if (t = n.getNode(), n = n.offset, s.$isRootOrShadowRoot(t))
1038
849
  n = t.getChildAtIndex(n), n == null ? t.append(e) : n.insertBefore(e), e.selectNext();
1039
850
  else {
1040
- let r, s;
1041
- i.$isTextNode(t) ? (r = t.getParentOrThrow(), s = t.getIndexWithinParent(), 0 < n && (s += 1, t.splitText(n))) : (r = t, s = n), [, t] = i.$splitNode(r, s), t.insertBefore(e), t.selectStart();
851
+ let o, r;
852
+ s.$isTextNode(t) ? (o = t.getParentOrThrow(), r = t.getIndexWithinParent(), 0 < n && (r += 1, t.splitText(n))) : (o = t, r = n), [, t] = s.$splitNode(o, r), t.insertBefore(e), t.selectStart();
1042
853
  }
1043
854
  } else
1044
- t != null ? (t = t.getNodes(), t[t.length - 1].getTopLevelElementOrThrow().insertAfter(e)) : i.$getRoot().append(e), t = i.$createParagraphNode(), e.insertAfter(t), t.select();
855
+ s.$isNodeSelection(t) || s.DEPRECATED_$isGridSelection(t) ? (t = t.getNodes(), t[t.length - 1].getTopLevelElementOrThrow().insertAfter(e)) : s.$getRoot().append(e), t = s.$createParagraphNode(), e.insertAfter(t), t.select();
1045
856
  return e.getLatest();
1046
- }, D.$restoreEditorState = function(e, t) {
1047
- let n = /* @__PURE__ */ new Map(), r = e._pendingEditorState;
1048
- for (let [s, l] of t._nodeMap) {
1049
- let o = c.$cloneWithProperties(l);
1050
- if (i.$isTextNode(o)) {
1051
- if (!i.$isTextNode(l))
1052
- throw Error("Expected node be a TextNode");
1053
- o.__text = l.__text;
1054
- }
1055
- n.set(s, o);
857
+ }, R.$restoreEditorState = function(e, t) {
858
+ let n = /* @__PURE__ */ new Map(), o = e._pendingEditorState;
859
+ for (let [r, i] of t._nodeMap) {
860
+ let u = l.$cloneWithProperties(i);
861
+ s.$isTextNode(u) && (u.__text = i.__text), n.set(r, u);
1056
862
  }
1057
- r && (r._nodeMap = n), e._dirtyType = 2, e = t._selection, i.$setSelection(e === null ? null : e.clone());
1058
- }, D.$wrapNodeInElement = function(e, t) {
863
+ o && (o._nodeMap = n), e._dirtyType = 2, e = t._selection, s.$setSelection(e === null ? null : e.clone());
864
+ }, R.$wrapNodeInElement = function(e, t) {
1059
865
  return t = t(), e.replace(t), t.append(e), t;
1060
- }, D.addClassNamesToElement = function(e, ...t) {
866
+ }, R.addClassNamesToElement = function(e, ...t) {
1061
867
  t.forEach((n) => {
1062
- typeof n == "string" && (n = n.split(" ").filter((r) => r !== ""), e.classList.add(...n));
868
+ typeof n == "string" && (n = n.split(" ").filter((o) => o !== ""), e.classList.add(...n));
1063
869
  });
1064
- }, D.isMimeType = a, D.markSelection = function(e, t) {
1065
- function n(v) {
1066
- v.read(() => {
1067
- var g = i.$getSelection();
1068
- if (i.$isRangeSelection(g)) {
1069
- var { anchor: S, focus: T } = g;
1070
- g = S.getNode();
1071
- var y = g.getKey(), w = S.offset, R = T.getNode(), d = R.getKey(), E = T.offset, f = e.getElementByKey(y), N = e.getElementByKey(d);
1072
- if (y = r === null || f === null || w !== s || y !== r.getKey() || g !== r && (!(r instanceof i.TextNode) || g.updateDOM(r, f, e._config)), d = l === null || N === null || E !== o || d !== l.getKey() || R !== l && (!(l instanceof i.TextNode) || R.updateDOM(l, N, e._config)), y || d) {
1073
- f = e.getElementByKey(S.getNode().getKey());
1074
- var C = e.getElementByKey(T.getNode().getKey());
1075
- if (f !== null && C !== null && f.tagName === "SPAN" && C.tagName === "SPAN") {
1076
- if (d = document.createRange(), T.isBefore(S) ? (y = C, N = T.offset, C = f, f = S.offset) : (y = f, N = S.offset, f = T.offset), y = y.firstChild, y === null || (C = C.firstChild, C === null))
1077
- throw Error("Expected text node to be first child of span");
1078
- d.setStart(y, N), d.setEnd(C, f), x(), x = m(e, d, (b) => {
1079
- for (let _ of b) {
1080
- let $ = _.style;
1081
- $.background !== "Highlight" && ($.background = "Highlight"), $.color !== "HighlightText" && ($.color = "HighlightText"), $.zIndex !== "-1" && ($.zIndex = "-1"), $.pointerEvents !== "none" && ($.pointerEvents = "none"), $.marginTop !== "-1.5px" && ($.marginTop = "-1.5px"), $.paddingTop !== "4px" && ($.paddingTop = "4px"), $.paddingBottom !== "0px" && ($.paddingBottom = "0px");
1082
- }
1083
- t !== void 0 && t(b);
1084
- });
1085
- }
1086
- }
1087
- r = g, s = w, l = R, o = E;
1088
- } else
1089
- o = l = s = r = null, x(), x = () => {
1090
- };
1091
- });
1092
- }
1093
- let r = null, s = null, l = null, o = null, x = () => {
1094
- };
1095
- return n(e.getEditorState()), L(e.registerUpdateListener(({ editorState: v }) => n(v)), x, () => {
1096
- x();
1097
- });
1098
- }, D.mediaFileReader = function(e, t) {
870
+ }, R.isHTMLAnchorElement = function(e) {
871
+ return p(e) && e.tagName === "A";
872
+ }, R.isHTMLElement = p, R.isMimeType = C, R.mediaFileReader = function(e, t) {
1099
873
  let n = e[Symbol.iterator]();
1100
- return new Promise((r, s) => {
1101
- let l = [], o = () => {
1102
- const { done: x, value: v } = n.next();
1103
- if (x)
1104
- return r(l);
1105
- const g = new FileReader();
1106
- g.addEventListener("error", s), g.addEventListener("load", () => {
1107
- const S = g.result;
1108
- typeof S == "string" && l.push({ file: v, result: S }), o();
1109
- }), a(v, t) ? g.readAsDataURL(v) : o();
874
+ return new Promise((o, r) => {
875
+ let i = [], u = () => {
876
+ const { done: f, value: a } = n.next();
877
+ if (f)
878
+ return o(i);
879
+ const h = new FileReader();
880
+ h.addEventListener("error", r), h.addEventListener("load", () => {
881
+ const v = h.result;
882
+ typeof v == "string" && i.push({ file: a, result: v }), u();
883
+ }), C(a, t) ? h.readAsDataURL(a) : u();
1110
884
  };
1111
- o();
885
+ u();
1112
886
  });
1113
- }, D.mergeRegister = L, D.objectKlassEquals = function(e, t) {
887
+ }, R.mergeRegister = function(...e) {
888
+ return () => {
889
+ e.forEach((t) => t());
890
+ };
891
+ }, R.objectKlassEquals = function(e, t) {
1114
892
  return e !== null ? Object.getPrototypeOf(e).constructor.name === t.name : !1;
1115
- }, D.positionNodeOnRange = m, D.registerNestedElementResolver = function(e, t, n, r) {
1116
- return e.registerNodeTransform(t, (s) => {
893
+ }, R.registerNestedElementResolver = function(e, t, n, o) {
894
+ return e.registerNodeTransform(t, (r) => {
1117
895
  e: {
1118
- for (var l = s.getChildren(), o = 0; o < l.length; o++)
1119
- if (l[o] instanceof t) {
1120
- l = null;
896
+ for (var i = r.getChildren(), u = 0; u < i.length; u++)
897
+ if (i[u] instanceof t) {
898
+ i = null;
1121
899
  break e;
1122
900
  }
1123
- for (l = s; l !== null; )
1124
- if (o = l, l = l.getParent(), l instanceof t) {
1125
- l = { child: o, parent: l };
901
+ for (i = r; i !== null; )
902
+ if (u = i, i = i.getParent(), i instanceof t) {
903
+ i = { child: u, parent: i };
1126
904
  break e;
1127
905
  }
1128
- l = null;
906
+ i = null;
1129
907
  }
1130
- if (l !== null) {
1131
- const { child: x, parent: v } = l;
1132
- if (x.is(s)) {
1133
- if (r(v, s), s = x.getNextSiblings(), l = s.length, v.insertAfter(x), l !== 0) {
1134
- o = n(v), x.insertAfter(o);
1135
- for (let g = 0; g < l; g++)
1136
- o.append(s[g]);
908
+ if (i !== null) {
909
+ const { child: f, parent: a } = i;
910
+ if (f.is(r)) {
911
+ if (o(a, r), r = f.getNextSiblings(), i = r.length, a.insertAfter(f), i !== 0) {
912
+ u = n(a), f.insertAfter(u);
913
+ for (let h = 0; h < i; h++)
914
+ u.append(r[h]);
1137
915
  }
1138
- v.canBeEmpty() || v.getChildrenSize() !== 0 || v.remove();
916
+ a.canBeEmpty() || a.getChildrenSize() !== 0 || a.remove();
1139
917
  }
1140
918
  }
1141
919
  });
1142
- }, D.removeClassNamesFromElement = function(e, ...t) {
920
+ }, R.removeClassNamesFromElement = function(e, ...t) {
1143
921
  t.forEach((n) => {
1144
922
  typeof n == "string" && e.classList.remove(...n.split(" "));
1145
923
  });
1146
- }, D;
924
+ }, R;
1147
925
  }
1148
- var Ee, He;
1149
- function at() {
1150
- return He || (He = 1, Ee = process.env.NODE_ENV === "development" ? Ht() : zt()), Ee;
926
+ var X, ye;
927
+ function Ie() {
928
+ return ye || (ye = 1, X = process.env.NODE_ENV === "development" ? Lt() : yt()), X;
1151
929
  }
1152
- var ve = {}, ze;
1153
- function Vt() {
1154
- if (ze)
1155
- return ve;
1156
- ze = 1;
1157
- var c = Y;
1158
- function i(h) {
1159
- const L = window.location.origin, p = (m) => {
1160
- if (m.origin !== L)
930
+ var Z = {}, Te;
931
+ function Tt() {
932
+ if (Te)
933
+ return Z;
934
+ Te = 1;
935
+ var l = A;
936
+ function s(g) {
937
+ const C = window.location.origin, d = (p) => {
938
+ if (p.origin !== C)
1161
939
  return;
1162
- const a = h.getRootElement();
1163
- if (document.activeElement !== a)
940
+ const e = g.getRootElement();
941
+ if (document.activeElement !== e)
1164
942
  return;
1165
- const u = m.data;
1166
- if (typeof u == "string") {
1167
- let e;
943
+ const t = p.data;
944
+ if (typeof t == "string") {
945
+ let n;
1168
946
  try {
1169
- e = JSON.parse(u);
947
+ n = JSON.parse(t);
1170
948
  } catch {
1171
949
  return;
1172
950
  }
1173
- if (e && e.protocol === "nuanria_messaging" && e.type === "request") {
1174
- const t = e.payload;
1175
- if (t && t.functionId === "makeChanges") {
1176
- const n = t.args;
1177
- if (n) {
1178
- const [r, s, l, o, x, v] = n;
1179
- h.update(() => {
1180
- const g = c.$getSelection();
1181
- if (c.$isRangeSelection(g)) {
1182
- const S = g.anchor;
1183
- let T = S.getNode(), y = 0, w = 0;
1184
- if (c.$isTextNode(T) && r >= 0 && s >= 0 && (y = r, w = r + s, g.setTextNodeRange(T, y, T, w)), (y !== w || l !== "") && (g.insertRawText(l), T = S.getNode()), c.$isTextNode(T)) {
1185
- y = o, w = o + x;
1186
- const R = T.getTextContentSize();
1187
- y = y > R ? R : y, w = w > R ? R : w, g.setTextNodeRange(T, y, T, w);
951
+ if (n && n.protocol === "nuanria_messaging" && n.type === "request") {
952
+ const o = n.payload;
953
+ if (o && o.functionId === "makeChanges") {
954
+ const r = o.args;
955
+ if (r) {
956
+ const [i, u, f, a, h, v] = r;
957
+ g.update(() => {
958
+ const E = l.$getSelection();
959
+ if (l.$isRangeSelection(E)) {
960
+ const $ = E.anchor;
961
+ let c = $.getNode(), m = 0, x = 0;
962
+ if (l.$isTextNode(c) && i >= 0 && u >= 0 && (m = i, x = i + u, E.setTextNodeRange(c, m, c, x)), (m !== x || f !== "") && (E.insertRawText(f), c = $.getNode()), l.$isTextNode(c)) {
963
+ m = a, x = a + h;
964
+ const y = c.getTextContentSize();
965
+ m = m > y ? y : m, x = x > y ? y : x, E.setTextNodeRange(c, m, c, x);
1188
966
  }
1189
- m.stopImmediatePropagation();
967
+ p.stopImmediatePropagation();
1190
968
  }
1191
969
  });
1192
970
  }
@@ -1194,459 +972,459 @@ function Vt() {
1194
972
  }
1195
973
  }
1196
974
  };
1197
- return window.addEventListener("message", p, !0), () => {
1198
- window.removeEventListener("message", p, !0);
975
+ return window.addEventListener("message", d, !0), () => {
976
+ window.removeEventListener("message", d, !0);
1199
977
  };
1200
978
  }
1201
- return ve.registerDragonSupport = i, ve;
979
+ return Z.registerDragonSupport = s, Z;
1202
980
  }
1203
- var Ce = {}, Ve;
1204
- function Wt() {
1205
- if (Ve)
1206
- return Ce;
1207
- Ve = 1;
1208
- var c = Y;
1209
- return Ce.registerDragonSupport = function(i) {
1210
- let h = window.location.origin, L = (p) => {
1211
- if (p.origin === h) {
1212
- var m = i.getRootElement();
1213
- if (document.activeElement === m && (m = p.data, typeof m == "string")) {
981
+ var ee = {}, be;
982
+ function bt() {
983
+ if (be)
984
+ return ee;
985
+ be = 1;
986
+ var l = A;
987
+ return ee.registerDragonSupport = function(s) {
988
+ let g = window.location.origin, C = (d) => {
989
+ if (d.origin === g) {
990
+ var p = s.getRootElement();
991
+ if (document.activeElement === p && (p = d.data, typeof p == "string")) {
1214
992
  try {
1215
- var a = JSON.parse(m);
993
+ var e = JSON.parse(p);
1216
994
  } catch {
1217
995
  return;
1218
996
  }
1219
- if (a && a.protocol === "nuanria_messaging" && a.type === "request" && (a = a.payload) && a.functionId === "makeChanges" && (a = a.args)) {
1220
- const [u, e, t, n, r] = a;
1221
- i.update(() => {
1222
- const s = c.$getSelection();
1223
- if (c.$isRangeSelection(s)) {
1224
- var l = s.anchor;
1225
- let o = l.getNode(), x = 0, v = 0;
1226
- c.$isTextNode(o) && 0 <= u && 0 <= e && (x = u, v = u + e, s.setTextNodeRange(o, x, o, v)), (x !== v || t !== "") && (s.insertRawText(t), o = l.getNode()), c.$isTextNode(o) && (x = n, v = n + r, l = o.getTextContentSize(), x = x > l ? l : x, v = v > l ? l : v, s.setTextNodeRange(o, x, o, v)), p.stopImmediatePropagation();
997
+ if (e && e.protocol === "nuanria_messaging" && e.type === "request" && (e = e.payload) && e.functionId === "makeChanges" && (e = e.args)) {
998
+ const [t, n, o, r, i] = e;
999
+ s.update(() => {
1000
+ const u = l.$getSelection();
1001
+ if (l.$isRangeSelection(u)) {
1002
+ var f = u.anchor;
1003
+ let a = f.getNode(), h = 0, v = 0;
1004
+ l.$isTextNode(a) && 0 <= t && 0 <= n && (h = t, v = t + n, u.setTextNodeRange(a, h, a, v)), (h !== v || o !== "") && (u.insertRawText(o), a = f.getNode()), l.$isTextNode(a) && (h = r, v = r + i, f = a.getTextContentSize(), h = h > f ? f : h, v = v > f ? f : v, u.setTextNodeRange(a, h, a, v)), d.stopImmediatePropagation();
1227
1005
  }
1228
1006
  });
1229
1007
  }
1230
1008
  }
1231
1009
  }
1232
1010
  };
1233
- return window.addEventListener("message", L, !0), () => {
1234
- window.removeEventListener("message", L, !0);
1011
+ return window.addEventListener("message", C, !0), () => {
1012
+ window.removeEventListener("message", C, !0);
1235
1013
  };
1236
- }, Ce;
1014
+ }, ee;
1237
1015
  }
1238
- var ye, We;
1239
- function ct() {
1240
- return We || (We = 1, ye = process.env.NODE_ENV === "development" ? Vt() : Wt()), ye;
1016
+ var te, Ne;
1017
+ function Ue() {
1018
+ return Ne || (Ne = 1, te = process.env.NODE_ENV === "development" ? Tt() : bt()), te;
1241
1019
  }
1242
- var Je;
1243
- function Jt() {
1244
- if (Je)
1245
- return pe;
1246
- Je = 1;
1247
- var c = Q(), i = lt(), h = U, L = st(), p = at(), m = it, a = ct(), u = nt, n = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? h.useLayoutEffect : h.useEffect;
1248
- function r(g) {
1249
- return g.getEditorState().read(L.$canShowPlaceholderCurry(g.isComposing()));
1250
- }
1251
- function s(g) {
1252
- const [S, T] = h.useState(() => r(g));
1253
- return n(() => {
1254
- function y() {
1255
- const w = r(g);
1256
- T(w);
1020
+ var $e;
1021
+ function Nt() {
1022
+ if ($e)
1023
+ return W;
1024
+ $e = 1;
1025
+ var l = M(), s = Me(), g = q, C = Be(), d = Ie(), p = Ae, e = Ue(), t = Oe, r = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? g.useLayoutEffect : g.useEffect;
1026
+ function i(E) {
1027
+ return E.getEditorState().read(C.$canShowPlaceholderCurry(E.isComposing()));
1028
+ }
1029
+ function u(E) {
1030
+ const [$, c] = g.useState(() => i(E));
1031
+ return r(() => {
1032
+ function m() {
1033
+ const x = i(E);
1034
+ c(x);
1257
1035
  }
1258
- return y(), p.mergeRegister(g.registerUpdateListener(() => {
1259
- y();
1260
- }), g.registerEditableListener(() => {
1261
- y();
1036
+ return m(), d.mergeRegister(E.registerUpdateListener(() => {
1037
+ m();
1038
+ }), E.registerEditableListener(() => {
1039
+ m();
1262
1040
  }));
1263
- }, [g]), S;
1041
+ }, [E]), $;
1264
1042
  }
1265
- function l(g, S) {
1266
- const [T, y] = h.useState(() => g.getDecorators());
1267
- return n(() => g.registerDecoratorListener((w) => {
1268
- m.flushSync(() => {
1269
- y(w);
1043
+ function f(E, $) {
1044
+ const [c, m] = g.useState(() => E.getDecorators());
1045
+ return r(() => E.registerDecoratorListener((x) => {
1046
+ p.flushSync(() => {
1047
+ m(x);
1270
1048
  });
1271
- }), [g]), h.useEffect(() => {
1272
- y(g.getDecorators());
1273
- }, [g]), h.useMemo(() => {
1274
- const w = [], R = Object.keys(T);
1275
- for (let d = 0; d < R.length; d++) {
1276
- const E = R[d], f = /* @__PURE__ */ h.createElement(S, {
1277
- onError: (C) => g._onError(C)
1278
- }, /* @__PURE__ */ h.createElement(h.Suspense, {
1049
+ }), [E]), g.useEffect(() => {
1050
+ m(E.getDecorators());
1051
+ }, [E]), g.useMemo(() => {
1052
+ const x = [], y = Object.keys(c);
1053
+ for (let T = 0; T < y.length; T++) {
1054
+ const L = y[T], w = /* @__PURE__ */ g.createElement($, {
1055
+ onError: (N) => E._onError(N)
1056
+ }, /* @__PURE__ */ g.createElement(g.Suspense, {
1279
1057
  fallback: null
1280
- }, T[E])), N = g.getElementByKey(E);
1281
- N !== null && w.push(/* @__PURE__ */ m.createPortal(f, N, E));
1058
+ }, c[L])), b = E.getElementByKey(L);
1059
+ b !== null && x.push(/* @__PURE__ */ p.createPortal(w, b, L));
1282
1060
  }
1283
- return w;
1284
- }, [S, T, g]);
1061
+ return x;
1062
+ }, [$, c, E]);
1285
1063
  }
1286
- function o(g) {
1287
- n(() => p.mergeRegister(u.registerRichText(g), a.registerDragonSupport(g)), [g]);
1064
+ function a(E) {
1065
+ r(() => d.mergeRegister(t.registerRichText(E), e.registerDragonSupport(E)), [E]);
1288
1066
  }
1289
- function x({
1290
- contentEditable: g,
1291
- placeholder: S,
1292
- ErrorBoundary: T
1067
+ function h({
1068
+ contentEditable: E,
1069
+ placeholder: $,
1070
+ ErrorBoundary: c
1293
1071
  }) {
1294
- const [y] = c.useLexicalComposerContext(), w = l(y, T);
1295
- return o(y), /* @__PURE__ */ h.createElement(h.Fragment, null, g, /* @__PURE__ */ h.createElement(v, {
1296
- content: S
1297
- }), w);
1072
+ const [m] = l.useLexicalComposerContext(), x = f(m, c);
1073
+ return a(m), /* @__PURE__ */ g.createElement(g.Fragment, null, E, /* @__PURE__ */ g.createElement(v, {
1074
+ content: $
1075
+ }), x);
1298
1076
  }
1299
1077
  function v({
1300
- content: g
1078
+ content: E
1301
1079
  }) {
1302
- const [S] = c.useLexicalComposerContext(), T = s(S), y = i();
1303
- return T ? typeof g == "function" ? g(y) : g : null;
1080
+ const [$] = l.useLexicalComposerContext(), c = u($), m = s();
1081
+ return c ? typeof E == "function" ? E(m) : E : null;
1304
1082
  }
1305
- return pe.RichTextPlugin = x, pe;
1083
+ return W.RichTextPlugin = h, W;
1306
1084
  }
1307
- var Ne = {}, Ge;
1308
- function Gt() {
1309
- if (Ge)
1310
- return Ne;
1311
- Ge = 1;
1312
- var c = Q(), i = lt(), h = U, L = st(), p = at(), m = it, a = ct(), u = nt, e = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? h.useLayoutEffect : h.useEffect;
1313
- function t(o) {
1314
- return o.getEditorState().read(L.$canShowPlaceholderCurry(o.isComposing()));
1315
- }
1316
- function n(o) {
1317
- let [x, v] = h.useState(() => t(o));
1318
- return e(() => {
1319
- function g() {
1320
- let S = t(o);
1321
- v(S);
1085
+ var re = {}, we;
1086
+ function $t() {
1087
+ if (we)
1088
+ return re;
1089
+ we = 1;
1090
+ var l = M(), s = Me(), g = q, C = Be(), d = Ie(), p = Ae, e = Ue(), t = Oe, n = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? g.useLayoutEffect : g.useEffect;
1091
+ function o(a) {
1092
+ return a.getEditorState().read(C.$canShowPlaceholderCurry(a.isComposing()));
1093
+ }
1094
+ function r(a) {
1095
+ let [h, v] = g.useState(() => o(a));
1096
+ return n(() => {
1097
+ function E() {
1098
+ let $ = o(a);
1099
+ v($);
1322
1100
  }
1323
- return g(), p.mergeRegister(o.registerUpdateListener(() => {
1324
- g();
1325
- }), o.registerEditableListener(() => {
1326
- g();
1101
+ return E(), d.mergeRegister(a.registerUpdateListener(() => {
1102
+ E();
1103
+ }), a.registerEditableListener(() => {
1104
+ E();
1327
1105
  }));
1328
- }, [o]), x;
1106
+ }, [a]), h;
1329
1107
  }
1330
- function r(o, x) {
1331
- let [v, g] = h.useState(() => o.getDecorators());
1332
- return e(() => o.registerDecoratorListener((S) => {
1333
- m.flushSync(() => {
1334
- g(S);
1108
+ function i(a, h) {
1109
+ let [v, E] = g.useState(() => a.getDecorators());
1110
+ return n(() => a.registerDecoratorListener(($) => {
1111
+ p.flushSync(() => {
1112
+ E($);
1335
1113
  });
1336
- }), [o]), h.useEffect(() => {
1337
- g(o.getDecorators());
1338
- }, [o]), h.useMemo(() => {
1339
- let S = [], T = Object.keys(v);
1340
- for (let y = 0; y < T.length; y++) {
1341
- let w = T[y], R = h.createElement(x, { onError: (E) => o._onError(E) }, h.createElement(h.Suspense, { fallback: null }, v[w])), d = o.getElementByKey(w);
1342
- d !== null && S.push(m.createPortal(R, d, w));
1114
+ }), [a]), g.useEffect(() => {
1115
+ E(a.getDecorators());
1116
+ }, [a]), g.useMemo(() => {
1117
+ let $ = [], c = Object.keys(v);
1118
+ for (let m = 0; m < c.length; m++) {
1119
+ let x = c[m], y = g.createElement(h, { onError: (L) => a._onError(L) }, g.createElement(g.Suspense, { fallback: null }, v[x])), T = a.getElementByKey(x);
1120
+ T !== null && $.push(p.createPortal(y, T, x));
1343
1121
  }
1344
- return S;
1345
- }, [x, v, o]);
1346
- }
1347
- function s(o) {
1348
- e(() => p.mergeRegister(u.registerRichText(o), a.registerDragonSupport(o)), [o]);
1349
- }
1350
- function l({ content: o }) {
1351
- var [x] = c.useLexicalComposerContext();
1352
- x = n(x);
1353
- let v = i();
1354
- return x ? typeof o == "function" ? o(v) : o : null;
1355
- }
1356
- return Ne.RichTextPlugin = function({ contentEditable: o, placeholder: x, ErrorBoundary: v }) {
1357
- let [g] = c.useLexicalComposerContext();
1358
- return v = r(g, v), s(g), h.createElement(h.Fragment, null, o, h.createElement(l, { content: x }), v);
1359
- }, Ne;
1122
+ return $;
1123
+ }, [h, v, a]);
1124
+ }
1125
+ function u(a) {
1126
+ n(() => d.mergeRegister(t.registerRichText(a), e.registerDragonSupport(a)), [a]);
1127
+ }
1128
+ function f({ content: a }) {
1129
+ var [h] = l.useLexicalComposerContext();
1130
+ h = r(h);
1131
+ let v = s();
1132
+ return h ? typeof a == "function" ? a(v) : a : null;
1133
+ }
1134
+ return re.RichTextPlugin = function({ contentEditable: a, placeholder: h, ErrorBoundary: v }) {
1135
+ let [E] = l.useLexicalComposerContext();
1136
+ return v = i(E, v), u(E), g.createElement(g.Fragment, null, a, g.createElement(f, { content: h }), v);
1137
+ }, re;
1360
1138
  }
1361
- const Yt = process.env.NODE_ENV === "development" ? Jt() : Gt();
1362
- var Qt = Yt, Le = {}, Ye;
1363
- function Xt() {
1364
- if (Ye)
1365
- return Le;
1366
- Ye = 1;
1367
- var c = Q(), i = U;
1368
- function h() {
1369
- return h = Object.assign ? Object.assign.bind() : function(u) {
1370
- for (var e = 1; e < arguments.length; e++) {
1371
- var t = arguments[e];
1372
- for (var n in t)
1373
- Object.prototype.hasOwnProperty.call(t, n) && (u[n] = t[n]);
1139
+ const wt = process.env.NODE_ENV === "development" ? Nt() : $t();
1140
+ var St = wt, ne = {}, Se;
1141
+ function _t() {
1142
+ if (Se)
1143
+ return ne;
1144
+ Se = 1;
1145
+ var l = M(), s = q;
1146
+ function g() {
1147
+ return g = Object.assign ? Object.assign.bind() : function(t) {
1148
+ for (var n = 1; n < arguments.length; n++) {
1149
+ var o = arguments[n];
1150
+ for (var r in o)
1151
+ Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r]);
1374
1152
  }
1375
- return u;
1376
- }, h.apply(this, arguments);
1377
- }
1378
- var m = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
1379
- function a({
1380
- ariaActiveDescendant: u,
1381
- ariaAutoComplete: e,
1382
- ariaControls: t,
1383
- ariaDescribedBy: n,
1384
- ariaExpanded: r,
1385
- ariaLabel: s,
1386
- ariaLabelledBy: l,
1387
- ariaMultiline: o,
1388
- ariaOwns: x,
1153
+ return t;
1154
+ }, g.apply(this, arguments);
1155
+ }
1156
+ var p = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
1157
+ function e({
1158
+ ariaActiveDescendant: t,
1159
+ ariaAutoComplete: n,
1160
+ ariaControls: o,
1161
+ ariaDescribedBy: r,
1162
+ ariaExpanded: i,
1163
+ ariaLabel: u,
1164
+ ariaLabelledBy: f,
1165
+ ariaMultiline: a,
1166
+ ariaOwns: h,
1389
1167
  ariaRequired: v,
1390
- autoCapitalize: g,
1391
- className: S,
1392
- id: T,
1393
- role: y = "textbox",
1394
- spellCheck: w = !0,
1395
- style: R,
1396
- tabIndex: d,
1397
- "data-testid": E,
1398
- ...f
1168
+ autoCapitalize: E,
1169
+ className: $,
1170
+ id: c,
1171
+ role: m = "textbox",
1172
+ spellCheck: x = !0,
1173
+ style: y,
1174
+ tabIndex: T,
1175
+ "data-testid": L,
1176
+ ...w
1399
1177
  }) {
1400
- const [N] = c.useLexicalComposerContext(), [C, b] = i.useState(!1), _ = i.useCallback(($) => {
1401
- N.setRootElement($);
1402
- }, [N]);
1403
- return m(() => (b(N.isEditable()), N.registerEditableListener(($) => {
1404
- b($);
1405
- })), [N]), /* @__PURE__ */ i.createElement("div", h({}, f, {
1406
- "aria-activedescendant": C ? u : void 0,
1407
- "aria-autocomplete": C ? e : "none",
1408
- "aria-controls": C ? t : void 0,
1409
- "aria-describedby": n,
1410
- "aria-expanded": C && y === "combobox" ? !!r : void 0,
1411
- "aria-label": s,
1412
- "aria-labelledby": l,
1413
- "aria-multiline": o,
1414
- "aria-owns": C ? x : void 0,
1415
- "aria-readonly": C ? void 0 : !0,
1178
+ const [b] = l.useLexicalComposerContext(), [N, S] = s.useState(!1), P = s.useCallback((D) => {
1179
+ b.setRootElement(D);
1180
+ }, [b]);
1181
+ return p(() => (S(b.isEditable()), b.registerEditableListener((D) => {
1182
+ S(D);
1183
+ })), [b]), /* @__PURE__ */ s.createElement("div", g({}, w, {
1184
+ "aria-activedescendant": N ? t : void 0,
1185
+ "aria-autocomplete": N ? n : "none",
1186
+ "aria-controls": N ? o : void 0,
1187
+ "aria-describedby": r,
1188
+ "aria-expanded": N && m === "combobox" ? !!i : void 0,
1189
+ "aria-label": u,
1190
+ "aria-labelledby": f,
1191
+ "aria-multiline": a,
1192
+ "aria-owns": N ? h : void 0,
1193
+ "aria-readonly": N ? void 0 : !0,
1416
1194
  "aria-required": v,
1417
- autoCapitalize: g,
1418
- className: S,
1419
- contentEditable: C,
1420
- "data-testid": E,
1421
- id: T,
1422
- ref: _,
1423
- role: y,
1424
- spellCheck: w,
1425
- style: R,
1426
- tabIndex: d
1195
+ autoCapitalize: E,
1196
+ className: $,
1197
+ contentEditable: N,
1198
+ "data-testid": L,
1199
+ id: c,
1200
+ ref: P,
1201
+ role: m,
1202
+ spellCheck: x,
1203
+ style: y,
1204
+ tabIndex: T
1427
1205
  }));
1428
1206
  }
1429
- return Le.ContentEditable = a, Le;
1207
+ return ne.ContentEditable = e, ne;
1430
1208
  }
1431
- var Te = {}, Qe;
1432
- function Zt() {
1433
- if (Qe)
1434
- return Te;
1435
- Qe = 1;
1436
- var c = Q(), i = U;
1437
- function h() {
1438
- return h = Object.assign ? Object.assign.bind() : function(p) {
1439
- for (var m = 1; m < arguments.length; m++) {
1440
- var a = arguments[m], u;
1441
- for (u in a)
1442
- Object.prototype.hasOwnProperty.call(a, u) && (p[u] = a[u]);
1209
+ var oe = {}, _e;
1210
+ function Rt() {
1211
+ if (_e)
1212
+ return oe;
1213
+ _e = 1;
1214
+ var l = M(), s = q;
1215
+ function g() {
1216
+ return g = Object.assign ? Object.assign.bind() : function(d) {
1217
+ for (var p = 1; p < arguments.length; p++) {
1218
+ var e = arguments[p], t;
1219
+ for (t in e)
1220
+ Object.prototype.hasOwnProperty.call(e, t) && (d[t] = e[t]);
1443
1221
  }
1444
- return p;
1445
- }, h.apply(this, arguments);
1446
- }
1447
- var L = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
1448
- return Te.ContentEditable = function({ ariaActiveDescendant: p, ariaAutoComplete: m, ariaControls: a, ariaDescribedBy: u, ariaExpanded: e, ariaLabel: t, ariaLabelledBy: n, ariaMultiline: r, ariaOwns: s, ariaRequired: l, autoCapitalize: o, className: x, id: v, role: g = "textbox", spellCheck: S = !0, style: T, tabIndex: y, "data-testid": w, ...R }) {
1449
- let [d] = c.useLexicalComposerContext(), [E, f] = i.useState(!1), N = i.useCallback((C) => {
1450
- d.setRootElement(C);
1451
- }, [d]);
1452
- return L(() => (f(d.isEditable()), d.registerEditableListener((C) => {
1453
- f(C);
1454
- })), [d]), i.createElement(
1222
+ return d;
1223
+ }, g.apply(this, arguments);
1224
+ }
1225
+ var C = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? s.useLayoutEffect : s.useEffect;
1226
+ return oe.ContentEditable = function({ ariaActiveDescendant: d, ariaAutoComplete: p, ariaControls: e, ariaDescribedBy: t, ariaExpanded: n, ariaLabel: o, ariaLabelledBy: r, ariaMultiline: i, ariaOwns: u, ariaRequired: f, autoCapitalize: a, className: h, id: v, role: E = "textbox", spellCheck: $ = !0, style: c, tabIndex: m, "data-testid": x, ...y }) {
1227
+ let [T] = l.useLexicalComposerContext(), [L, w] = s.useState(!1), b = s.useCallback((N) => {
1228
+ T.setRootElement(N);
1229
+ }, [T]);
1230
+ return C(() => (w(T.isEditable()), T.registerEditableListener((N) => {
1231
+ w(N);
1232
+ })), [T]), s.createElement(
1455
1233
  "div",
1456
- h({}, R, { "aria-activedescendant": E ? p : void 0, "aria-autocomplete": E ? m : "none", "aria-controls": E ? a : void 0, "aria-describedby": u, "aria-expanded": E && g === "combobox" ? !!e : void 0, "aria-label": t, "aria-labelledby": n, "aria-multiline": r, "aria-owns": E ? s : void 0, "aria-readonly": E ? void 0 : !0, "aria-required": l, autoCapitalize: o, className: x, contentEditable: E, "data-testid": w, id: v, ref: N, role: g, spellCheck: S, style: T, tabIndex: y })
1234
+ g({}, y, { "aria-activedescendant": L ? d : void 0, "aria-autocomplete": L ? p : "none", "aria-controls": L ? e : void 0, "aria-describedby": t, "aria-expanded": L && E === "combobox" ? !!n : void 0, "aria-label": o, "aria-labelledby": r, "aria-multiline": i, "aria-owns": L ? u : void 0, "aria-readonly": L ? void 0 : !0, "aria-required": f, autoCapitalize: a, className: h, contentEditable: L, "data-testid": x, id: v, ref: b, role: E, spellCheck: $, style: c, tabIndex: m })
1457
1235
  );
1458
- }, Te;
1236
+ }, oe;
1459
1237
  }
1460
- const en = process.env.NODE_ENV === "development" ? Xt() : Zt();
1461
- var tn = en, be, Xe;
1462
- function nn() {
1463
- if (Xe)
1464
- return be;
1465
- Xe = 1;
1466
- var c = U;
1467
- function i(u, e) {
1468
- return i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
1469
- return n.__proto__ = r, n;
1470
- }, i(u, e);
1471
- }
1472
- function h(u, e) {
1473
- u.prototype = Object.create(e.prototype), u.prototype.constructor = u, i(u, e);
1474
- }
1475
- var L = function(e, t) {
1476
- return e === void 0 && (e = []), t === void 0 && (t = []), e.length !== t.length || e.some(function(n, r) {
1477
- return !Object.is(n, t[r]);
1238
+ const Pt = process.env.NODE_ENV === "development" ? _t() : Rt();
1239
+ var Dt = Pt, ie, Re;
1240
+ function qt() {
1241
+ if (Re)
1242
+ return ie;
1243
+ Re = 1;
1244
+ var l = q;
1245
+ function s(t, n) {
1246
+ return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
1247
+ return r.__proto__ = i, r;
1248
+ }, s(t, n);
1249
+ }
1250
+ function g(t, n) {
1251
+ t.prototype = Object.create(n.prototype), t.prototype.constructor = t, s(t, n);
1252
+ }
1253
+ var C = function(n, o) {
1254
+ return n === void 0 && (n = []), o === void 0 && (o = []), n.length !== o.length || n.some(function(r, i) {
1255
+ return !Object.is(r, o[i]);
1478
1256
  });
1479
- }, p = {
1257
+ }, d = {
1480
1258
  error: null
1481
- }, m = /* @__PURE__ */ function(u) {
1482
- h(e, u);
1483
- function e() {
1484
- for (var n, r = arguments.length, s = new Array(r), l = 0; l < r; l++)
1485
- s[l] = arguments[l];
1486
- return n = u.call.apply(u, [this].concat(s)) || this, n.state = p, n.resetErrorBoundary = function() {
1487
- for (var o, x = arguments.length, v = new Array(x), g = 0; g < x; g++)
1488
- v[g] = arguments[g];
1489
- n.props.onReset == null || (o = n.props).onReset.apply(o, v), n.reset();
1490
- }, n;
1259
+ }, p = /* @__PURE__ */ function(t) {
1260
+ g(n, t);
1261
+ function n() {
1262
+ for (var r, i = arguments.length, u = new Array(i), f = 0; f < i; f++)
1263
+ u[f] = arguments[f];
1264
+ return r = t.call.apply(t, [this].concat(u)) || this, r.state = d, r.resetErrorBoundary = function() {
1265
+ for (var a, h = arguments.length, v = new Array(h), E = 0; E < h; E++)
1266
+ v[E] = arguments[E];
1267
+ r.props.onReset == null || (a = r.props).onReset.apply(a, v), r.reset();
1268
+ }, r;
1491
1269
  }
1492
- e.getDerivedStateFromError = function(r) {
1270
+ n.getDerivedStateFromError = function(i) {
1493
1271
  return {
1494
- error: r
1272
+ error: i
1495
1273
  };
1496
1274
  };
1497
- var t = e.prototype;
1498
- return t.reset = function() {
1499
- this.setState(p);
1500
- }, t.componentDidCatch = function(r, s) {
1501
- var l, o;
1502
- (l = (o = this.props).onError) == null || l.call(o, r, s);
1503
- }, t.componentDidUpdate = function(r, s) {
1504
- var l = this.state.error, o = this.props.resetKeys;
1505
- if (l !== null && s.error !== null && L(r.resetKeys, o)) {
1506
- var x, v;
1507
- (x = (v = this.props).onResetKeysChange) == null || x.call(v, r.resetKeys, o), this.reset();
1275
+ var o = n.prototype;
1276
+ return o.reset = function() {
1277
+ this.setState(d);
1278
+ }, o.componentDidCatch = function(i, u) {
1279
+ var f, a;
1280
+ (f = (a = this.props).onError) == null || f.call(a, i, u);
1281
+ }, o.componentDidUpdate = function(i, u) {
1282
+ var f = this.state.error, a = this.props.resetKeys;
1283
+ if (f !== null && u.error !== null && C(i.resetKeys, a)) {
1284
+ var h, v;
1285
+ (h = (v = this.props).onResetKeysChange) == null || h.call(v, i.resetKeys, a), this.reset();
1508
1286
  }
1509
- }, t.render = function() {
1510
- var r = this.state.error, s = this.props, l = s.fallbackRender, o = s.FallbackComponent, x = s.fallback;
1511
- if (r !== null) {
1287
+ }, o.render = function() {
1288
+ var i = this.state.error, u = this.props, f = u.fallbackRender, a = u.FallbackComponent, h = u.fallback;
1289
+ if (i !== null) {
1512
1290
  var v = {
1513
- error: r,
1291
+ error: i,
1514
1292
  resetErrorBoundary: this.resetErrorBoundary
1515
1293
  };
1516
- if (/* @__PURE__ */ c.isValidElement(x))
1517
- return x;
1518
- if (typeof l == "function")
1519
- return l(v);
1520
- if (o)
1521
- return /* @__PURE__ */ c.createElement(o, v);
1294
+ if (/* @__PURE__ */ l.isValidElement(h))
1295
+ return h;
1296
+ if (typeof f == "function")
1297
+ return f(v);
1298
+ if (a)
1299
+ return /* @__PURE__ */ l.createElement(a, v);
1522
1300
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
1523
1301
  }
1524
1302
  return this.props.children;
1525
- }, e;
1526
- }(c.Component);
1527
- function a({
1528
- children: u,
1529
- onError: e
1303
+ }, n;
1304
+ }(l.Component);
1305
+ function e({
1306
+ children: t,
1307
+ onError: n
1530
1308
  }) {
1531
- return /* @__PURE__ */ c.createElement(m, {
1532
- fallback: /* @__PURE__ */ c.createElement("div", {
1309
+ return /* @__PURE__ */ l.createElement(p, {
1310
+ fallback: /* @__PURE__ */ l.createElement("div", {
1533
1311
  style: {
1534
1312
  border: "1px solid #f00",
1535
1313
  color: "#f00",
1536
1314
  padding: "8px"
1537
1315
  }
1538
1316
  }, "An error was thrown."),
1539
- onError: e
1540
- }, u);
1317
+ onError: n
1318
+ }, t);
1541
1319
  }
1542
- return be = a, be;
1320
+ return ie = e, ie;
1543
1321
  }
1544
- var $e, Ze;
1545
- function rn() {
1546
- if (Ze)
1547
- return $e;
1548
- Ze = 1;
1549
- var c = U;
1550
- function i(a, u) {
1551
- return i = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
1552
- return e.__proto__ = t, e;
1553
- }, i(a, u);
1554
- }
1555
- function h(a, u) {
1556
- a.prototype = Object.create(u.prototype), a.prototype.constructor = a, i(a, u);
1557
- }
1558
- function L(a, u) {
1559
- return a === void 0 && (a = []), u === void 0 && (u = []), a.length !== u.length || a.some(function(e, t) {
1560
- return !Object.is(e, u[t]);
1322
+ var se, Pe;
1323
+ function Ot() {
1324
+ if (Pe)
1325
+ return se;
1326
+ Pe = 1;
1327
+ var l = q;
1328
+ function s(e, t) {
1329
+ return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, o) {
1330
+ return n.__proto__ = o, n;
1331
+ }, s(e, t);
1332
+ }
1333
+ function g(e, t) {
1334
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, s(e, t);
1335
+ }
1336
+ function C(e, t) {
1337
+ return e === void 0 && (e = []), t === void 0 && (t = []), e.length !== t.length || e.some(function(n, o) {
1338
+ return !Object.is(n, t[o]);
1561
1339
  });
1562
1340
  }
1563
- var p = { error: null }, m = function(a) {
1564
- function u() {
1565
- for (var t, n = arguments.length, r = Array(n), s = 0; s < n; s++)
1566
- r[s] = arguments[s];
1567
- return t = a.call.apply(a, [this].concat(r)) || this, t.state = p, t.resetErrorBoundary = function() {
1568
- for (var l, o = arguments.length, x = Array(o), v = 0; v < o; v++)
1569
- x[v] = arguments[v];
1570
- t.props.onReset == null || (l = t.props).onReset.apply(l, x), t.reset();
1571
- }, t;
1341
+ var d = { error: null }, p = function(e) {
1342
+ function t() {
1343
+ for (var o, r = arguments.length, i = Array(r), u = 0; u < r; u++)
1344
+ i[u] = arguments[u];
1345
+ return o = e.call.apply(e, [this].concat(i)) || this, o.state = d, o.resetErrorBoundary = function() {
1346
+ for (var f, a = arguments.length, h = Array(a), v = 0; v < a; v++)
1347
+ h[v] = arguments[v];
1348
+ o.props.onReset == null || (f = o.props).onReset.apply(f, h), o.reset();
1349
+ }, o;
1572
1350
  }
1573
- h(u, a), u.getDerivedStateFromError = function(t) {
1574
- return { error: t };
1351
+ g(t, e), t.getDerivedStateFromError = function(o) {
1352
+ return { error: o };
1575
1353
  };
1576
- var e = u.prototype;
1577
- return e.reset = function() {
1578
- this.setState(p);
1579
- }, e.componentDidCatch = function(t, n) {
1580
- var r, s;
1581
- (r = (s = this.props).onError) == null || r.call(s, t, n);
1582
- }, e.componentDidUpdate = function(t, n) {
1583
- var r = this.props.resetKeys;
1584
- if (this.state.error !== null && n.error !== null && L(t.resetKeys, r)) {
1585
- var s, l;
1586
- (s = (l = this.props).onResetKeysChange) == null || s.call(l, t.resetKeys, r), this.reset();
1354
+ var n = t.prototype;
1355
+ return n.reset = function() {
1356
+ this.setState(d);
1357
+ }, n.componentDidCatch = function(o, r) {
1358
+ var i, u;
1359
+ (i = (u = this.props).onError) == null || i.call(u, o, r);
1360
+ }, n.componentDidUpdate = function(o, r) {
1361
+ var i = this.props.resetKeys;
1362
+ if (this.state.error !== null && r.error !== null && C(o.resetKeys, i)) {
1363
+ var u, f;
1364
+ (u = (f = this.props).onResetKeysChange) == null || u.call(f, o.resetKeys, i), this.reset();
1587
1365
  }
1588
- }, e.render = function() {
1589
- var t = this.state.error, n = this.props, r = n.fallbackRender, s = n.FallbackComponent;
1590
- if (n = n.fallback, t !== null) {
1591
- if (t = { error: t, resetErrorBoundary: this.resetErrorBoundary }, c.isValidElement(n))
1592
- return n;
1593
- if (typeof r == "function")
1594
- return r(t);
1595
- if (s)
1596
- return c.createElement(s, t);
1366
+ }, n.render = function() {
1367
+ var o = this.state.error, r = this.props, i = r.fallbackRender, u = r.FallbackComponent;
1368
+ if (r = r.fallback, o !== null) {
1369
+ if (o = { error: o, resetErrorBoundary: this.resetErrorBoundary }, l.isValidElement(r))
1370
+ return r;
1371
+ if (typeof i == "function")
1372
+ return i(o);
1373
+ if (u)
1374
+ return l.createElement(u, o);
1597
1375
  throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
1598
1376
  }
1599
1377
  return this.props.children;
1600
- }, u;
1601
- }(c.Component);
1602
- return $e = function({ children: a, onError: u }) {
1603
- return c.createElement(m, { fallback: c.createElement("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" } }, "An error was thrown."), onError: u }, a);
1604
- }, $e;
1378
+ }, t;
1379
+ }(l.Component);
1380
+ return se = function({ children: e, onError: t }) {
1381
+ return l.createElement(p, { fallback: l.createElement("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" } }, "An error was thrown."), onError: t }, e);
1382
+ }, se;
1605
1383
  }
1606
- const on = process.env.NODE_ENV === "development" ? nn() : rn();
1607
- var ln = on;
1608
- const sn = oe({
1384
+ const Ft = process.env.NODE_ENV === "development" ? qt() : Ot();
1385
+ var kt = Ft;
1386
+ const At = U({
1609
1387
  fontWeight: "bold"
1610
- }), an = oe({
1388
+ }), Mt = U({
1611
1389
  fontStyle: "italic"
1612
- }), cn = oe({
1390
+ }), Bt = U({
1613
1391
  textDecoration: "underline"
1614
- }), un = oe({
1392
+ }), It = U({
1615
1393
  listStyleType: "none"
1616
- }), dn = oe({
1394
+ }), Ut = U({
1617
1395
  borderLeft: "4px solid #ccc",
1618
1396
  color: "#666",
1619
1397
  fontStyle: "italic",
1620
1398
  margin: "1.5em 10px",
1621
1399
  padding: "0.5em 10px"
1622
- }), fn = {
1623
- quote: dn().className,
1400
+ }), jt = {
1401
+ quote: Ut().className,
1624
1402
  text: {
1625
- bold: sn().className,
1626
- italic: an().className,
1627
- underline: cn().className
1403
+ bold: At().className,
1404
+ italic: Mt().className,
1405
+ underline: Bt().className
1628
1406
  },
1629
1407
  list: {
1630
1408
  nested: {
1631
- listitem: un().className
1409
+ listitem: It().className
1632
1410
  }
1633
1411
  }
1634
- }, pn = St(!1), gn = ({ onBlur: c }) => {
1635
- const [i, h] = Rt(!1), L = _t(null), p = _e(() => {
1636
- h(!0), L.current && window.clearTimeout(L.current);
1637
- }, []), m = _e(() => {
1638
- L.current = window.setTimeout(() => {
1639
- h(!1), c == null || c();
1412
+ }, Vt = it(!1), zt = ({ onBlur: l }) => {
1413
+ const [s, g] = st(!1), C = lt(null), d = ae(() => {
1414
+ g(!0), C.current && window.clearTimeout(C.current);
1415
+ }, []), p = ae(() => {
1416
+ C.current = window.setTimeout(() => {
1417
+ g(!1), l == null || l();
1640
1418
  }, 0);
1641
- }, [c]);
1419
+ }, [l]);
1642
1420
  return {
1643
- hasFocus: i,
1421
+ hasFocus: s,
1644
1422
  attributes: {
1645
- onFocus: p,
1646
- onBlur: m
1423
+ onFocus: d,
1424
+ onBlur: p
1647
1425
  }
1648
1426
  };
1649
- }, mn = rt("div", {
1427
+ }, Ht = Fe("div", {
1650
1428
  border: "1px solid $borderDarker",
1651
1429
  borderRadius: "$md",
1652
1430
  position: "relative",
@@ -1676,7 +1454,7 @@ const sn = oe({
1676
1454
  }
1677
1455
  }
1678
1456
  ]
1679
- }), xn = rt(tn.ContentEditable, {}, {
1457
+ }), Kt = Fe(Dt.ContentEditable, {}, {
1680
1458
  padding: "0 $4",
1681
1459
  overflowY: "auto",
1682
1460
  maxHeight: "30rem",
@@ -1700,55 +1478,55 @@ const sn = oe({
1700
1478
  color: "$gray500"
1701
1479
  }
1702
1480
  }
1703
- }), hn = ({
1704
- isLoading: c
1705
- }) => /* @__PURE__ */ j.jsx(
1706
- ot,
1481
+ }), Wt = ({
1482
+ isLoading: l
1483
+ }) => /* @__PURE__ */ O.jsx(
1484
+ ke,
1707
1485
  {
1708
1486
  css: {
1709
- visibility: c ? "visible" : "hidden",
1487
+ visibility: l ? "visible" : "hidden",
1710
1488
  position: "absolute",
1711
1489
  bottom: "1rem",
1712
1490
  right: "1rem",
1713
1491
  display: "flex"
1714
1492
  },
1715
- children: /* @__PURE__ */ j.jsx(wt, {})
1716
- }
1717
- ), Pn = ({
1718
- isLoading: c,
1719
- children: i,
1720
- placeholderText: h,
1721
- nodes: L,
1722
- plugins: p,
1723
- toolbar: m,
1724
- refs: a
1493
+ children: /* @__PURE__ */ O.jsx(ot, {})
1494
+ }
1495
+ ), ar = ({
1496
+ isLoading: l,
1497
+ children: s,
1498
+ placeholderText: g,
1499
+ nodes: C,
1500
+ plugins: d,
1501
+ toolbar: p,
1502
+ refs: e
1725
1503
  }) => {
1726
- const { hasFocus: u, attributes: e } = gn({});
1727
- return /* @__PURE__ */ j.jsx(pn.Provider, { value: u, children: /* @__PURE__ */ j.jsxs(
1728
- At.LexicalComposer,
1504
+ const { hasFocus: t, attributes: n } = zt({});
1505
+ return /* @__PURE__ */ O.jsx(Vt.Provider, { value: t, children: /* @__PURE__ */ O.jsxs(
1506
+ xt.LexicalComposer,
1729
1507
  {
1730
1508
  initialConfig: {
1731
1509
  namespace: "CommentEditor",
1732
- onError: (t) => {
1733
- console.error(t);
1510
+ onError: (o) => {
1511
+ console.error(o);
1734
1512
  },
1735
- theme: fn,
1736
- nodes: L,
1513
+ theme: jt,
1514
+ nodes: C,
1737
1515
  editable: !0
1738
1516
  },
1739
1517
  children: [
1740
- /* @__PURE__ */ j.jsxs(
1741
- mn,
1518
+ /* @__PURE__ */ O.jsxs(
1519
+ Ht,
1742
1520
  {
1743
- ref: a ? $t(a) : void 0,
1744
- hasFocus: u,
1745
- ...e,
1521
+ ref: e ? nt(e) : void 0,
1522
+ hasFocus: t,
1523
+ ...n,
1746
1524
  children: [
1747
- /* @__PURE__ */ j.jsx(
1748
- Qt.RichTextPlugin,
1525
+ /* @__PURE__ */ O.jsx(
1526
+ St.RichTextPlugin,
1749
1527
  {
1750
- contentEditable: /* @__PURE__ */ j.jsx(
1751
- xn,
1528
+ contentEditable: /* @__PURE__ */ O.jsx(
1529
+ Kt,
1752
1530
  {
1753
1531
  css: {
1754
1532
  paddingTop: 16,
@@ -1756,8 +1534,8 @@ const sn = oe({
1756
1534
  }
1757
1535
  }
1758
1536
  ),
1759
- placeholder: h ? /* @__PURE__ */ j.jsx(
1760
- ot,
1537
+ placeholder: g ? /* @__PURE__ */ O.jsx(
1538
+ ke,
1761
1539
  {
1762
1540
  css: {
1763
1541
  position: "absolute",
@@ -1767,26 +1545,26 @@ const sn = oe({
1767
1545
  pointerEvents: "none",
1768
1546
  fontSize: "$sm"
1769
1547
  },
1770
- children: h
1548
+ children: g
1771
1549
  }
1772
1550
  ) : null,
1773
- ErrorBoundary: ln
1551
+ ErrorBoundary: kt
1774
1552
  }
1775
1553
  ),
1776
- p,
1777
- /* @__PURE__ */ j.jsx(hn, { isLoading: c }),
1778
- m
1554
+ d,
1555
+ /* @__PURE__ */ O.jsx(Wt, { isLoading: l }),
1556
+ p
1779
1557
  ]
1780
1558
  }
1781
1559
  ),
1782
- /* @__PURE__ */ j.jsx(j.Fragment, { children: i })
1560
+ /* @__PURE__ */ O.jsx(O.Fragment, { children: s })
1783
1561
  ]
1784
1562
  }
1785
1563
  ) });
1786
1564
  };
1787
1565
  export {
1788
- Pn as RichTextEditor,
1789
- On as defaultNodes,
1790
- Dt as isJSON,
1791
- _n as stateToHTML
1566
+ ar as RichTextEditor,
1567
+ lr as defaultNodes,
1568
+ ut as isJSON,
1569
+ sr as stateToHTML
1792
1570
  };