@arkitektbedriftene/fe-lib 0.4.37 → 0.4.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,54 +1,47 @@
1
- var Yt = Object.defineProperty;
2
- var Gt = (t, e, r) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var st = (t, e, r) => (Gt(t, typeof e != "symbol" ? e + "" : e, r), r);
4
- import { createHeadlessEditor as Jt } from "@lexical/headless";
5
- import { $generateHtmlFromNodes as Xt } from "@lexical/html";
6
- import { $getRoot as K, ParagraphNode as Qt, $createParagraphNode as q, $createTextNode as D, $setSelection as bt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as Vt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as Zt, KEY_ARROW_UP_COMMAND as te, KEY_ESCAPE_COMMAND as vt, KEY_SPACE_COMMAND as ee, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as re, $isElementNode as ne, COMMAND_PRIORITY_NORMAL as oe, $isParagraphNode as ie, COMMAND_PRIORITY_HIGH as ae } from "lexical";
7
- import { trimTextContentFromAnchor as le, $setBlocksType as J, $isAtNodeEnd as ct } from "@lexical/selection";
8
- import { LinkNode as z, AutoLinkNode as Mt, $isLinkNode as U, TOGGLE_LINK_COMMAND as Z } from "@lexical/link";
9
- import { ListNode as tt, ListItemNode as Ct, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as se, INSERT_ORDERED_LIST_COMMAND as ce, INSERT_CHECK_LIST_COMMAND as Tt, insertList as de, $isListItemNode as O } from "@lexical/list";
10
- import { HeadingNode as Lt, QuoteNode as xt, $isHeadingNode as ue, $createHeadingNode as he, $createQuoteNode as pe } from "@lexical/rich-text";
11
- import { TableNode as yt, TableRowNode as Nt, TableCellNode as St, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as dt, $insertTableRow__EXPERIMENTAL as ut } from "@lexical/table";
12
- import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
13
- import { createContext as be, useState as b, useRef as rt, useCallback as v, useContext as ve, useEffect as x, useMemo as wt, useLayoutEffect as Me } from "react";
14
- import { DropdownMenu as nt, ToolbarButton as Et, DropdownMenuIconItem as C, Box as P, ToolbarToggleGroup as _t, ToolbarToggleItem as I, OverlayCard as Rt, Toolbar as Ce, ToolbarSeparator as Te, styled as Le, Spinner as xe, Button as $, DropdownMenuItem as R, DropdownMenuSeparator as ht, Dialog as ye, NavBar as Ne, NavBarItem as pt, TextInput as Se, DialogActions as It, Combobox as we } from "./ui.es.js";
15
- import { LexicalComposer as Ee } from "@lexical/react/LexicalComposer.js";
16
- import { RichTextPlugin as _e } from "@lexical/react/LexicalRichTextPlugin.js";
17
- import Re from "@lexical/react/LexicalErrorBoundary.js";
18
- import { s as Ie, u as ot, a as zt, b as ze, f as Oe, o as Ot, c as $e, d as $t, e as At, F as Bt, g as Ae, i as Be, h as De } from "./stitches.config-543644f4.js";
19
- import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Pe, $findMatchingParent as Dt, mergeRegister as it, isHTMLElement as gt } from "@lexical/utils";
21
- import { G as h, e as Fe } from "./index.esm-e4db0c1f.js";
22
- import { ListPlugin as He } from "@lexical/react/LexicalListPlugin.js";
23
- import { HistoryPlugin as Ue } from "@lexical/react/LexicalHistoryPlugin.js";
24
- import { TablePlugin as We } from "@lexical/react/LexicalTablePlugin.js";
25
- import { TabIndentationPlugin as je } from "@lexical/react/LexicalTabIndentationPlugin.js";
26
- import "react-dom";
27
- const Ke = ({
1
+ var Ur = Object.defineProperty;
2
+ var Kr = (t, e, i) => e in t ? Ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
+ var Nt = (t, e, i) => (Kr(t, typeof e != "symbol" ? e + "" : e, i), i);
4
+ import { createHeadlessEditor as Wr } from "@lexical/headless";
5
+ import { $generateHtmlFromNodes as jr } from "@lexical/html";
6
+ import W, { $getRoot as Ae, ParagraphNode as Yr, $createParagraphNode as Pe, $createTextNode as ve, $setSelection as ir, SELECTION_CHANGE_COMMAND as Le, $getSelection as ee, COMMAND_PRIORITY_CRITICAL as at, $isRangeSelection as te, $isRootOrShadowRoot as Vr, FORMAT_TEXT_COMMAND as Ee, COMMAND_PRIORITY_LOW as de, KEY_ARROW_DOWN_COMMAND as Gr, KEY_ARROW_UP_COMMAND as Jr, KEY_ESCAPE_COMMAND as lr, KEY_SPACE_COMMAND as Xr, $getNearestNodeFromDOMNode as ct, KEY_ARROW_LEFT_COMMAND as Qr, $isElementNode as Zr, COMMAND_PRIORITY_NORMAL as en, $isParagraphNode as tn, COMMAND_PRIORITY_HIGH as rn } from "lexical";
7
+ import sr, { trimTextContentFromAnchor as nn, $setBlocksType as qe, $isAtNodeEnd as Tt } from "@lexical/selection";
8
+ import { LinkNode as me, AutoLinkNode as ar, $isLinkNode as $e, TOGGLE_LINK_COMMAND as ut } from "@lexical/link";
9
+ import cr, { ListNode as dt, ListItemNode as ur, $isListNode as ft, INSERT_UNORDERED_LIST_COMMAND as on, INSERT_ORDERED_LIST_COMMAND as ln, INSERT_CHECK_LIST_COMMAND as dr, insertList as sn, $isListItemNode as xe } from "@lexical/list";
10
+ import fr, { HeadingNode as gr, QuoteNode as pr, $isHeadingNode as an, $createHeadingNode as cn, $createQuoteNode as un } from "@lexical/rich-text";
11
+ import hr, { TableNode as mr, TableRowNode as xr, TableCellNode as Cr, INSERT_TABLE_COMMAND as dn, $getTableCellNodeFromLexicalNode as fn, $deleteTableColumn__EXPERIMENTAL as gn, $deleteTableRow__EXPERIMENTAL as pn, $insertTableColumn__EXPERIMENTAL as vt, $insertTableRow__EXPERIMENTAL as _t } from "@lexical/table";
12
+ import { jsx as _, jsxs as K, Fragment as Ie } from "react/jsx-runtime";
13
+ import q, { createContext as hn, useState as Y, useRef as gt, useCallback as J, useContext as mn, useEffect as oe, useMemo as Er, useLayoutEffect as xn } from "react";
14
+ import { DropdownMenu as pt, ToolbarButton as Nr, DropdownMenuIconItem as Z, Box as _e, ToolbarToggleGroup as Tr, ToolbarToggleItem as he, OverlayCard as vr, Toolbar as Cn, ToolbarSeparator as En, styled as Nn, Spinner as Tn, Button as Ce, DropdownMenuItem as pe, DropdownMenuSeparator as Lt, Dialog as vn, NavBar as _n, NavBarItem as yt, TextInput as Ln, DialogActions as _r, Combobox as yn } from "./ui.es.js";
15
+ import Lr from "react-dom";
16
+ import { useFloating as ht, autoUpdate as yr, size as Mn, flip as Rn, offset as Mr, shift as bn, useInteractions as Rr, useRole as br, FloatingPortal as Sr, inline as Sn, useDismiss as kn } from "@floating-ui/react";
17
+ import { G as F, e as On } from "./index.esm-67eba761.js";
18
+ import { s as $n, c as Dn } from "./stitches.config-00c23cdb.js";
19
+ import "@stitches/react";
20
+ const wn = ({
28
21
  text: t,
29
22
  maxChars: e,
30
- maxLines: r
23
+ maxLines: i
31
24
  }) => {
32
25
  if (t.length === 0)
33
26
  return 0;
34
- const o = typeof r == "number", i = typeof e == "number";
35
- if (!o && !i)
27
+ const d = typeof i == "number", s = typeof e == "number";
28
+ if (!d && !s)
36
29
  return t.length;
37
- let l = 0, a = 0;
38
- for (; a < t.length && (!o || l < r) && (!i || a < e); )
39
- t[a] === `
40
- ` && l++, a++;
41
- return t.slice(0, a).length;
42
- }, qe = ({
30
+ let u = 0, l = 0;
31
+ for (; l < t.length && (!d || u < i) && (!s || l < e); )
32
+ t[l] === `
33
+ ` && u++, l++;
34
+ return t.slice(0, l).length;
35
+ }, An = ({
43
36
  editor: t,
44
37
  maxChars: e,
45
- maxLines: r
38
+ maxLines: i
46
39
  }) => {
47
- const o = K(), i = o.getTextContent(), l = Ke({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
48
- le(t, d, a);
49
- const c = o.getLastChild();
50
- return c instanceof Qt && c.getChildrenSize() === 0 && c.remove(), a;
51
- }, Pt = {
40
+ const d = Ae(), s = d.getTextContent(), u = wn({ text: s, maxChars: e, maxLines: i }), l = s.length - u, o = d.select().anchor;
41
+ nn(t, o, l);
42
+ const n = d.getLastChild();
43
+ return n instanceof Yr && n.getChildrenSize() === 0 && n.remove(), l;
44
+ }, kr = {
52
45
  quote: "ain-rich-text-quote",
53
46
  text: {
54
47
  bold: "ain-rich-text-bold",
@@ -60,78 +53,78 @@ const Ke = ({
60
53
  listitem: "ain-rich-text-nested-list-item"
61
54
  }
62
55
  }
63
- }, Ft = (t) => t[0] === "{", Ye = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ge = (t, e) => {
56
+ }, Or = (t) => t[0] === "{", Pn = (t) => t !== null && typeof t == "object" && "isEmpty" in t, In = (t, e) => {
64
57
  t.update(
65
58
  () => {
66
- const r = K();
67
- r.clear();
68
- const o = q();
69
- o.append(D("")), r.append(o), bt(null);
59
+ const i = Ae();
60
+ i.clear();
61
+ const d = Pe();
62
+ d.append(ve("")), i.append(d), ir(null);
70
63
  },
71
64
  {
72
65
  tag: e
73
66
  }
74
67
  );
75
- }, Je = (t, e, r) => {
68
+ }, Bn = (t, e, i) => {
76
69
  e.update(
77
70
  () => {
78
- const o = K();
79
- o.clear();
80
- const i = q();
81
- i.append(D(t.trim())), o.append(i), bt(null);
71
+ const d = Ae();
72
+ d.clear();
73
+ const s = Pe();
74
+ s.append(ve(t.trim())), d.append(s), ir(null);
82
75
  },
83
76
  {
84
- tag: r
77
+ tag: i
85
78
  }
86
79
  ), e.blur();
87
- }, an = (t, e, r) => {
88
- let o = 0;
89
- const i = Jt({
80
+ }, ki = (t, e, i) => {
81
+ let d = 0;
82
+ const s = Wr({
90
83
  nodes: e,
91
84
  editable: !1,
92
- theme: Pt
85
+ theme: kr
93
86
  });
94
87
  if (t)
95
88
  try {
96
- if (typeof t == "string" && !Ft(t))
97
- i.update(() => {
98
- const a = K(), s = q();
99
- s.append(D(t.trim())), a.append(s);
89
+ if (typeof t == "string" && !Or(t))
90
+ s.update(() => {
91
+ const l = Ae(), c = Pe();
92
+ c.append(ve(t.trim())), l.append(c);
100
93
  });
101
94
  else {
102
- const a = i.parseEditorState(t, () => {
103
- (r == null ? void 0 : r.maxLines) !== void 0 && (o = qe({
104
- editor: i,
105
- maxLines: r.maxLines
95
+ const l = s.parseEditorState(t, () => {
96
+ (i == null ? void 0 : i.maxLines) !== void 0 && (d = An({
97
+ editor: s,
98
+ maxLines: i.maxLines
106
99
  }));
107
100
  });
108
- a.isEmpty() || i.setEditorState(a);
101
+ l.isEmpty() || s.setEditorState(l);
109
102
  }
110
- } catch (a) {
111
- console.error(a);
103
+ } catch (l) {
104
+ console.error(l);
112
105
  }
113
- let l = "";
114
- return i.update(() => {
115
- var a;
116
- r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = Xt(i);
117
- }), { html: l, trimCount: o };
106
+ let u = "";
107
+ return s.update(() => {
108
+ var l;
109
+ i != null && i.updateFn && ((l = i.updateFn) == null || l.call(i)), u = jr(s);
110
+ }), { html: u, trimCount: d };
118
111
  };
119
- class W extends z {
112
+ class De extends me {
120
113
  static getType() {
121
114
  return "target-link";
122
115
  }
123
- constructor(e, r, o) {
124
- let i = !1;
125
- const l = { ...r };
116
+ constructor(e, i, d) {
117
+ let s = !1;
118
+ const u = { ...i };
126
119
  try {
127
- const a = new URL(e);
128
- window.location.hostname !== a.hostname && (i = !0);
120
+ const l = new URL(e);
121
+ window.location.hostname !== l.hostname && (s = !0);
129
122
  } catch {
130
123
  }
131
- i && (l.target = "_blank", l.rel = "noopener noreferrer"), super(e, l, o);
124
+ s && (u.target = "_blank", u.rel = "noopener noreferrer"), super(e, u, d);
132
125
  }
133
126
  static clone(e) {
134
- return new W(
127
+ return new De(
135
128
  e.__url,
136
129
  { rel: e.__rel, target: e.__target, title: e.__title },
137
130
  e.__key
@@ -141,111 +134,1538 @@ class W extends z {
141
134
  return super.exportJSON();
142
135
  }
143
136
  static importJSON(e) {
144
- return z.importJSON(e);
137
+ return me.importJSON(e);
145
138
  }
146
139
  }
147
- const ln = [
148
- Lt,
149
- xt,
150
- tt,
151
- Ct,
152
- Mt,
153
- z,
154
- yt,
155
- Nt,
156
- St
157
- ], sn = [
158
- Lt,
159
- xt,
160
- tt,
161
- Ct,
162
- Mt,
163
- z,
164
- yt,
165
- Nt,
166
- St,
167
- W,
140
+ const Oi = [
141
+ gr,
142
+ pr,
143
+ dt,
144
+ ur,
145
+ ar,
146
+ me,
147
+ mr,
148
+ xr,
149
+ Cr
150
+ ], $i = [
151
+ gr,
152
+ pr,
153
+ dt,
154
+ ur,
155
+ ar,
156
+ me,
157
+ mr,
158
+ xr,
159
+ Cr,
160
+ De,
168
161
  {
169
- replace: z,
170
- with: (t) => new W(
162
+ replace: me,
163
+ with: (t) => new De(
171
164
  t.getURL(),
172
165
  { rel: t.__rel, target: t.__target, title: t.__title }
173
166
  )
174
167
  }
175
- ], Ht = be({ hasFocus: !1, editorRef: { current: null } }), Xe = ({ onBlur: t }) => {
176
- const [e, r] = b(!1), o = rt(null), i = v(() => {
177
- r(!0), o.current && window.clearTimeout(o.current);
178
- }, []), l = v(() => {
179
- o.current = window.setTimeout(() => {
180
- r(!1), t == null || t();
168
+ ];
169
+ var Ue = {}, Ne = {}, Mt;
170
+ function Hn() {
171
+ if (Mt)
172
+ return Ne;
173
+ Mt = 1;
174
+ var t = q;
175
+ const e = /* @__PURE__ */ t.createContext(null);
176
+ function i(s, u) {
177
+ let l = null;
178
+ s != null && (l = s[1]);
179
+ function c() {
180
+ return u ?? (l != null ? l.getTheme() : null);
181
+ }
182
+ return {
183
+ getTheme: c
184
+ };
185
+ }
186
+ function d() {
187
+ const s = t.useContext(e);
188
+ if (s == null)
189
+ throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");
190
+ return s;
191
+ }
192
+ return Ne.LexicalComposerContext = e, Ne.createLexicalComposerContext = i, Ne.useLexicalComposerContext = d, Ne;
193
+ }
194
+ var Te = {}, Rt;
195
+ function Fn() {
196
+ if (Rt)
197
+ return Te;
198
+ Rt = 1;
199
+ var t = q;
200
+ function e(d) {
201
+ let s = new URLSearchParams();
202
+ s.append("code", d);
203
+ for (let u = 1; u < arguments.length; u++)
204
+ s.append("v", arguments[u]);
205
+ throw Error(`Minified Lexical error #${d}; visit https://lexical.dev/docs/error?${s} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
206
+ }
207
+ let i = t.createContext(null);
208
+ return Te.LexicalComposerContext = i, Te.createLexicalComposerContext = function(d, s) {
209
+ let u = null;
210
+ return d != null && (u = d[1]), { getTheme: function() {
211
+ return s ?? (u != null ? u.getTheme() : null);
212
+ } };
213
+ }, Te.useLexicalComposerContext = function() {
214
+ let d = t.useContext(i);
215
+ return d == null && e(8), d;
216
+ }, Te;
217
+ }
218
+ const zn = process.env.NODE_ENV === "development" ? Hn() : Fn();
219
+ var P = zn, bt;
220
+ function qn() {
221
+ if (bt)
222
+ return Ue;
223
+ bt = 1;
224
+ var t = P, e = W, i = q;
225
+ const d = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
226
+ var u = d ? i.useLayoutEffect : i.useEffect;
227
+ const l = {
228
+ tag: "history-merge"
229
+ };
230
+ function c({
231
+ initialConfig: n,
232
+ children: r
233
+ }) {
234
+ const a = i.useMemo(
235
+ () => {
236
+ const {
237
+ theme: g,
238
+ namespace: f,
239
+ editor__DEPRECATED: p,
240
+ nodes: h,
241
+ onError: x,
242
+ editorState: C,
243
+ html: L
244
+ } = n, E = t.createLexicalComposerContext(null, g);
245
+ let T = p || null;
246
+ if (T === null) {
247
+ const M = e.createEditor({
248
+ editable: n.editable,
249
+ html: L,
250
+ namespace: f,
251
+ nodes: h,
252
+ onError: (b) => x(b, M),
253
+ theme: g
254
+ });
255
+ o(M, C), T = M;
256
+ }
257
+ return [T, E];
258
+ },
259
+ // We only do this for init
260
+ // eslint-disable-next-line react-hooks/exhaustive-deps
261
+ []
262
+ );
263
+ return u(() => {
264
+ const g = n.editable, [f] = a;
265
+ f.setEditable(g !== void 0 ? g : !0);
266
+ }, []), /* @__PURE__ */ i.createElement(t.LexicalComposerContext.Provider, {
267
+ value: a
268
+ }, r);
269
+ }
270
+ function o(n, r) {
271
+ if (r !== null) {
272
+ if (r === void 0)
273
+ n.update(() => {
274
+ const a = e.$getRoot();
275
+ if (a.isEmpty()) {
276
+ const g = e.$createParagraphNode();
277
+ a.append(g);
278
+ const f = d ? document.activeElement : null;
279
+ (e.$getSelection() !== null || f !== null && f === n.getRootElement()) && g.select();
280
+ }
281
+ }, l);
282
+ else if (r !== null)
283
+ switch (typeof r) {
284
+ case "string": {
285
+ const a = n.parseEditorState(r);
286
+ n.setEditorState(a, l);
287
+ break;
288
+ }
289
+ case "object": {
290
+ n.setEditorState(r, l);
291
+ break;
292
+ }
293
+ case "function": {
294
+ n.update(() => {
295
+ e.$getRoot().isEmpty() && r(n);
296
+ }, l);
297
+ break;
298
+ }
299
+ }
300
+ }
301
+ }
302
+ return Ue.LexicalComposer = c, Ue;
303
+ }
304
+ var Ke = {}, St;
305
+ function Un() {
306
+ if (St)
307
+ return Ke;
308
+ St = 1;
309
+ var t = P, e = W, i = q;
310
+ let d = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
311
+ var s = d ? i.useLayoutEffect : i.useEffect;
312
+ let u = { tag: "history-merge" };
313
+ function l(c, o) {
314
+ if (o !== null) {
315
+ if (o === void 0)
316
+ c.update(() => {
317
+ var n = e.$getRoot();
318
+ if (n.isEmpty()) {
319
+ let r = e.$createParagraphNode();
320
+ n.append(r), n = d ? document.activeElement : null, (e.$getSelection() !== null || n !== null && n === c.getRootElement()) && r.select();
321
+ }
322
+ }, u);
323
+ else if (o !== null)
324
+ switch (typeof o) {
325
+ case "string":
326
+ let n = c.parseEditorState(o);
327
+ c.setEditorState(n, u);
328
+ break;
329
+ case "object":
330
+ c.setEditorState(o, u);
331
+ break;
332
+ case "function":
333
+ c.update(() => {
334
+ e.$getRoot().isEmpty() && o(c);
335
+ }, u);
336
+ }
337
+ }
338
+ }
339
+ return Ke.LexicalComposer = function({ initialConfig: c, children: o }) {
340
+ let n = i.useMemo(() => {
341
+ const { theme: r, namespace: a, editor__DEPRECATED: g, nodes: f, onError: p, editorState: h, html: x } = c, C = t.createLexicalComposerContext(null, r);
342
+ let L = g || null;
343
+ if (L === null) {
344
+ const E = e.createEditor({ editable: c.editable, html: x, namespace: a, nodes: f, onError: (T) => p(T, E), theme: r });
345
+ l(E, h), L = E;
346
+ }
347
+ return [L, C];
348
+ }, []);
349
+ return s(() => {
350
+ let r = c.editable, [a] = n;
351
+ a.setEditable(r !== void 0 ? r : !0);
352
+ }, []), i.createElement(
353
+ t.LexicalComposerContext.Provider,
354
+ { value: n },
355
+ o
356
+ );
357
+ }, Ke;
358
+ }
359
+ const Kn = process.env.NODE_ENV === "development" ? qn() : Un();
360
+ var Wn = Kn, We = {}, je, kt;
361
+ function jn() {
362
+ if (kt)
363
+ return je;
364
+ kt = 1;
365
+ var t = P, e = q, s = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? e.useLayoutEffect : e.useEffect;
366
+ function u(o) {
367
+ const [n] = t.useLexicalComposerContext(), r = e.useMemo(() => o(n), [n, o]), a = e.useRef(r.initialValueFn()), [g, f] = e.useState(a.current);
368
+ return s(() => {
369
+ const {
370
+ initialValueFn: p,
371
+ subscribe: h
372
+ } = r, x = p();
373
+ return a.current !== x && (a.current = x, f(x)), h((C) => {
374
+ a.current = C, f(C);
375
+ });
376
+ }, [r, o]), g;
377
+ }
378
+ function l(o) {
379
+ return {
380
+ initialValueFn: () => o.isEditable(),
381
+ subscribe: (n) => o.registerEditableListener(n)
382
+ };
383
+ }
384
+ function c() {
385
+ return u(l);
386
+ }
387
+ return je = c, je;
388
+ }
389
+ var Ye, Ot;
390
+ function Yn() {
391
+ if (Ot)
392
+ return Ye;
393
+ Ot = 1;
394
+ var t = P, e = q, i = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? e.useLayoutEffect : e.useEffect;
395
+ function d(u) {
396
+ let [l] = t.useLexicalComposerContext(), c = e.useMemo(() => u(l), [l, u]), o = e.useRef(c.initialValueFn()), [n, r] = e.useState(o.current);
397
+ return i(() => {
398
+ let { initialValueFn: a, subscribe: g } = c, f = a();
399
+ return o.current !== f && (o.current = f, r(f)), g((p) => {
400
+ o.current = p, r(p);
401
+ });
402
+ }, [c, u]), n;
403
+ }
404
+ function s(u) {
405
+ return { initialValueFn: () => u.isEditable(), subscribe: (l) => u.registerEditableListener(l) };
406
+ }
407
+ return Ye = function() {
408
+ return d(s);
409
+ }, Ye;
410
+ }
411
+ var Ve, $t;
412
+ function $r() {
413
+ return $t || ($t = 1, Ve = process.env.NODE_ENV === "development" ? jn() : Yn()), Ve;
414
+ }
415
+ var le = {}, Dt;
416
+ function Vn() {
417
+ if (Dt)
418
+ return le;
419
+ Dt = 1;
420
+ var t = W;
421
+ function e(o, n) {
422
+ let r = o.getFirstChild(), a = 0;
423
+ e:
424
+ for (; r !== null; ) {
425
+ if (t.$isElementNode(r)) {
426
+ const p = r.getFirstChild();
427
+ if (p !== null) {
428
+ r = p;
429
+ continue;
430
+ }
431
+ } else if (t.$isTextNode(r)) {
432
+ const p = r.getTextContentSize();
433
+ if (a + p > n)
434
+ return {
435
+ node: r,
436
+ offset: n - a
437
+ };
438
+ a += p;
439
+ }
440
+ const g = r.getNextSibling();
441
+ if (g !== null) {
442
+ r = g;
443
+ continue;
444
+ }
445
+ let f = r.getParent();
446
+ for (; f !== null; ) {
447
+ const p = f.getNextSibling();
448
+ if (p !== null) {
449
+ r = p;
450
+ continue e;
451
+ }
452
+ f = f.getParent();
453
+ }
454
+ break;
455
+ }
456
+ return null;
457
+ }
458
+ function i(o, n = !0) {
459
+ if (o)
460
+ return !1;
461
+ let r = s();
462
+ return n && (r = r.trim()), r === "";
463
+ }
464
+ function d(o, n) {
465
+ return () => i(o, n);
466
+ }
467
+ function s() {
468
+ return t.$getRoot().getTextContent();
469
+ }
470
+ function u(o) {
471
+ if (!i(o, !1))
472
+ return !1;
473
+ const r = t.$getRoot().getChildren(), a = r.length;
474
+ if (a > 1)
475
+ return !1;
476
+ for (let g = 0; g < a; g++) {
477
+ const f = r[g];
478
+ if (t.$isDecoratorNode(f))
479
+ return !1;
480
+ if (t.$isElementNode(f)) {
481
+ if (!t.$isParagraphNode(f) || f.__indent !== 0)
482
+ return !1;
483
+ const p = f.getChildren(), h = p.length;
484
+ for (let x = 0; x < h; x++) {
485
+ const C = p[g];
486
+ if (!t.$isTextNode(C))
487
+ return !1;
488
+ }
489
+ }
490
+ }
491
+ return !0;
492
+ }
493
+ function l(o) {
494
+ return () => u(o);
495
+ }
496
+ function c(o, n, r, a) {
497
+ const g = (E) => E instanceof r, f = (E) => {
498
+ const T = t.$createTextNode(E.getTextContent());
499
+ T.setFormat(E.getFormat()), E.replace(T);
500
+ }, p = (E) => E.getLatest().__mode, h = (E) => {
501
+ if (!E.isSimpleText())
502
+ return;
503
+ const T = E.getPreviousSibling();
504
+ let M = E.getTextContent(), b = E, m;
505
+ if (t.$isTextNode(T)) {
506
+ const v = T.getTextContent(), N = v + M, y = n(N);
507
+ if (g(T))
508
+ if (y === null || p(T) !== 0) {
509
+ f(T);
510
+ return;
511
+ } else {
512
+ const R = y.end - v.length;
513
+ if (R > 0) {
514
+ const S = M.slice(0, R), O = v + S;
515
+ if (T.select(), T.setTextContent(O), R === M.length)
516
+ E.remove();
517
+ else {
518
+ const k = M.slice(R);
519
+ E.setTextContent(k);
520
+ }
521
+ return;
522
+ }
523
+ }
524
+ else if (y === null || y.start < v.length)
525
+ return;
526
+ }
527
+ for (; ; ) {
528
+ m = n(M);
529
+ let v = m === null ? "" : M.slice(m.end);
530
+ if (M = v, v === "") {
531
+ const R = b.getNextSibling();
532
+ if (t.$isTextNode(R)) {
533
+ v = b.getTextContent() + R.getTextContent();
534
+ const S = n(v);
535
+ if (S === null) {
536
+ g(R) ? f(R) : R.markDirty();
537
+ return;
538
+ } else if (S.start !== 0)
539
+ return;
540
+ }
541
+ } else {
542
+ const R = n(v);
543
+ if (R !== null && R.start === 0)
544
+ return;
545
+ }
546
+ if (m === null)
547
+ return;
548
+ if (m.start === 0 && t.$isTextNode(T) && T.isTextEntity())
549
+ continue;
550
+ let N;
551
+ m.start === 0 ? [N, b] = b.splitText(m.end) : [, N, b] = b.splitText(m.start, m.end);
552
+ const y = a(N);
553
+ if (y.setFormat(N.getFormat()), N.replace(y), b == null)
554
+ return;
555
+ }
556
+ }, x = (E) => {
557
+ const T = E.getTextContent(), M = n(T);
558
+ if (M === null || M.start !== 0) {
559
+ f(E);
560
+ return;
561
+ }
562
+ if (T.length > M.end) {
563
+ E.splitText(M.end);
564
+ return;
565
+ }
566
+ const b = E.getPreviousSibling();
567
+ t.$isTextNode(b) && b.isTextEntity() && (f(b), f(E));
568
+ const m = E.getNextSibling();
569
+ t.$isTextNode(m) && m.isTextEntity() && (f(m), g(E) && f(E));
570
+ }, C = o.registerNodeTransform(t.TextNode, h), L = o.registerNodeTransform(r, x);
571
+ return [C, L];
572
+ }
573
+ return le.$canShowPlaceholder = u, le.$canShowPlaceholderCurry = l, le.$findTextIntersectionFromCharacters = e, le.$isRootTextContentEmpty = i, le.$isRootTextContentEmptyCurry = d, le.$rootTextContent = s, le.registerLexicalTextEntity = c, le;
574
+ }
575
+ var se = {}, wt;
576
+ function Gn() {
577
+ if (wt)
578
+ return se;
579
+ wt = 1;
580
+ var t = W;
581
+ function e(s, u = !0) {
582
+ return s ? !1 : (s = i(), u && (s = s.trim()), s === "");
583
+ }
584
+ function i() {
585
+ return t.$getRoot().getTextContent();
586
+ }
587
+ function d(s) {
588
+ if (!e(s, !1))
589
+ return !1;
590
+ s = t.$getRoot().getChildren();
591
+ let u = s.length;
592
+ if (1 < u)
593
+ return !1;
594
+ for (let c = 0; c < u; c++) {
595
+ var l = s[c];
596
+ if (t.$isDecoratorNode(l))
597
+ return !1;
598
+ if (t.$isElementNode(l)) {
599
+ if (!t.$isParagraphNode(l) || l.__indent !== 0)
600
+ return !1;
601
+ l = l.getChildren();
602
+ let o = l.length;
603
+ for (let n = 0; n < o; n++)
604
+ if (!t.$isTextNode(l[c]))
605
+ return !1;
606
+ }
607
+ }
608
+ return !0;
609
+ }
610
+ return se.$canShowPlaceholder = d, se.$canShowPlaceholderCurry = function(s) {
611
+ return () => d(s);
612
+ }, se.$findTextIntersectionFromCharacters = function(s, u) {
613
+ var l = s.getFirstChild();
614
+ s = 0;
615
+ e:
616
+ for (; l !== null; ) {
617
+ if (t.$isElementNode(l)) {
618
+ var c = l.getFirstChild();
619
+ if (c !== null) {
620
+ l = c;
621
+ continue;
622
+ }
623
+ } else if (t.$isTextNode(l)) {
624
+ if (c = l.getTextContentSize(), s + c > u)
625
+ return { node: l, offset: u - s };
626
+ s += c;
627
+ }
628
+ if (c = l.getNextSibling(), c !== null)
629
+ l = c;
630
+ else {
631
+ for (l = l.getParent(); l !== null; ) {
632
+ if (c = l.getNextSibling(), c !== null) {
633
+ l = c;
634
+ continue e;
635
+ }
636
+ l = l.getParent();
637
+ }
638
+ break;
639
+ }
640
+ }
641
+ return null;
642
+ }, se.$isRootTextContentEmpty = e, se.$isRootTextContentEmptyCurry = function(s, u) {
643
+ return () => e(s, u);
644
+ }, se.$rootTextContent = i, se.registerLexicalTextEntity = function(s, u, l, c) {
645
+ let o = (r) => {
646
+ const a = t.$createTextNode(r.getTextContent());
647
+ a.setFormat(r.getFormat()), r.replace(a);
648
+ }, n = s.registerNodeTransform(t.TextNode, (r) => {
649
+ if (r.isSimpleText()) {
650
+ var a = r.getPreviousSibling(), g = r.getTextContent(), f = r;
651
+ if (t.$isTextNode(a)) {
652
+ var p = a.getTextContent(), h = u(p + g);
653
+ if (a instanceof l) {
654
+ if (h === null || a.getLatest().__mode !== 0) {
655
+ o(a);
656
+ return;
657
+ }
658
+ if (h = h.end - p.length, 0 < h) {
659
+ f = g.slice(0, h), f = p + f, a.select(), a.setTextContent(f), h === g.length ? r.remove() : (a = g.slice(h), r.setTextContent(a));
660
+ return;
661
+ }
662
+ } else if (h === null || h.start < p.length)
663
+ return;
664
+ }
665
+ for (; ; ) {
666
+ if (r = u(g), g = h = r === null ? "" : g.slice(r.end), h === "") {
667
+ if (p = f.getNextSibling(), t.$isTextNode(p)) {
668
+ if (h = f.getTextContent() + p.getTextContent(), h = u(h), h === null) {
669
+ p instanceof l ? o(p) : p.markDirty();
670
+ break;
671
+ } else if (h.start !== 0)
672
+ break;
673
+ }
674
+ } else if (p = u(h), p !== null && p.start === 0)
675
+ break;
676
+ if (r === null)
677
+ break;
678
+ if (r.start === 0 && t.$isTextNode(a) && a.isTextEntity())
679
+ continue;
680
+ let x;
681
+ if (r.start === 0 ? [x, f] = f.splitText(r.end) : [, x, f] = f.splitText(r.start, r.end), r = c(x), r.setFormat(x.getFormat()), x.replace(r), f == null)
682
+ break;
683
+ }
684
+ }
685
+ });
686
+ return s = s.registerNodeTransform(l, (r) => {
687
+ var a = r.getTextContent();
688
+ const g = u(a);
689
+ g === null || g.start !== 0 ? o(r) : a.length > g.end ? r.splitText(g.end) : (a = r.getPreviousSibling(), t.$isTextNode(a) && a.isTextEntity() && (o(a), o(r)), a = r.getNextSibling(), t.$isTextNode(a) && a.isTextEntity() && (o(a), r instanceof l && o(r)));
690
+ }), [n, s];
691
+ }, se;
692
+ }
693
+ var Ge, At;
694
+ function Dr() {
695
+ return At || (At = 1, Ge = process.env.NODE_ENV === "development" ? Vn() : Gn()), Ge;
696
+ }
697
+ var I = {}, Pt;
698
+ function Jn() {
699
+ if (Pt)
700
+ return I;
701
+ Pt = 1;
702
+ var t = sr, e = W;
703
+ function i(...m) {
704
+ return () => {
705
+ m.forEach((v) => v());
706
+ };
707
+ }
708
+ function d(m) {
709
+ return `${m}px`;
710
+ }
711
+ const s = {
712
+ attributes: !0,
713
+ characterData: !0,
714
+ childList: !0,
715
+ subtree: !0
716
+ };
717
+ function u(m, v, N) {
718
+ let y = null, R = null, S = null, O = [];
719
+ const k = document.createElement("div");
720
+ function $() {
721
+ if (y === null)
722
+ throw Error("Unexpected null rootDOMNode");
723
+ if (R === null)
724
+ throw Error("Unexpected null parentDOMNode");
725
+ const {
726
+ left: A,
727
+ top: j
728
+ } = y.getBoundingClientRect(), U = R, V = t.createRectsFromDOMRange(m, v);
729
+ k.isConnected || U.append(k);
730
+ let X = !1;
731
+ for (let re = 0; re < V.length; re++) {
732
+ const ae = V[re], ne = O[re] || document.createElement("div"), ie = ne.style;
733
+ ie.position !== "absolute" && (ie.position = "absolute", X = !0);
734
+ const ye = d(ae.left - A);
735
+ ie.left !== ye && (ie.left = ye, X = !0);
736
+ const ce = d(ae.top - j);
737
+ ie.top !== ce && (ne.style.top = ce, X = !0);
738
+ const ue = d(ae.width);
739
+ ie.width !== ue && (ne.style.width = ue, X = !0);
740
+ const ge = d(ae.height);
741
+ ie.height !== ge && (ne.style.height = ge, X = !0), ne.parentNode !== k && (k.append(ne), X = !0), O[re] = ne;
742
+ }
743
+ for (; O.length > V.length; )
744
+ O.pop();
745
+ X && N(O);
746
+ }
747
+ function D() {
748
+ R = null, y = null, S !== null && S.disconnect(), S = null, k.remove();
749
+ for (const A of O)
750
+ A.remove();
751
+ O = [];
752
+ }
753
+ function w() {
754
+ const A = m.getRootElement();
755
+ if (A === null)
756
+ return D();
757
+ const j = A.parentElement;
758
+ if (!(j instanceof HTMLElement))
759
+ return D();
760
+ D(), y = A, R = j, S = new MutationObserver((U) => {
761
+ const V = m.getRootElement(), X = V && V.parentElement;
762
+ if (V !== y || X !== R)
763
+ return w();
764
+ for (const re of U)
765
+ if (!k.contains(re.target))
766
+ return $();
767
+ }), S.observe(j, s), $();
768
+ }
769
+ const H = m.registerRootListener(w);
770
+ return () => {
771
+ H(), D();
772
+ };
773
+ }
774
+ function l(m, v) {
775
+ let N = null, y = null, R = null, S = null, O = () => {
776
+ };
777
+ function k($) {
778
+ $.read(() => {
779
+ const D = e.$getSelection();
780
+ if (!e.$isRangeSelection(D)) {
781
+ N = null, y = null, R = null, S = null, O(), O = () => {
782
+ };
783
+ return;
784
+ }
785
+ const {
786
+ anchor: w,
787
+ focus: H
788
+ } = D, A = w.getNode(), j = A.getKey(), U = w.offset, V = H.getNode(), X = V.getKey(), re = H.offset, ae = m.getElementByKey(j), ne = m.getElementByKey(X), ie = N === null || ae === null || U !== y || j !== N.getKey() || A !== N && (!(N instanceof e.TextNode) || A.updateDOM(N, ae, m._config)), ye = R === null || ne === null || re !== S || X !== R.getKey() || V !== R && (!(R instanceof e.TextNode) || V.updateDOM(R, ne, m._config));
789
+ if (ie || ye) {
790
+ const ce = m.getElementByKey(w.getNode().getKey()), ue = m.getElementByKey(H.getNode().getKey());
791
+ if (ce !== null && ue !== null && ce.tagName === "SPAN" && ue.tagName === "SPAN") {
792
+ const ge = document.createRange();
793
+ let Be, He, Fe, ze;
794
+ H.isBefore(w) ? (Be = ue, He = H.offset, Fe = ce, ze = w.offset) : (Be = ce, He = w.offset, Fe = ue, ze = H.offset);
795
+ const xt = Be.firstChild;
796
+ if (xt === null)
797
+ throw Error("Expected text node to be first child of span");
798
+ const Ct = Fe.firstChild;
799
+ if (Ct === null)
800
+ throw Error("Expected text node to be first child of span");
801
+ ge.setStart(xt, He), ge.setEnd(Ct, ze), O(), O = u(m, ge, (Et) => {
802
+ for (const qr of Et) {
803
+ const G = qr.style;
804
+ G.background !== "Highlight" && (G.background = "Highlight"), G.color !== "HighlightText" && (G.color = "HighlightText"), G.zIndex !== "-1" && (G.zIndex = "-1"), G.pointerEvents !== "none" && (G.pointerEvents = "none"), G.marginTop !== d(-1.5) && (G.marginTop = d(-1.5)), G.paddingTop !== d(4) && (G.paddingTop = d(4)), G.paddingBottom !== d(0) && (G.paddingBottom = d(0));
805
+ }
806
+ v !== void 0 && v(Et);
807
+ });
808
+ }
809
+ }
810
+ N = A, y = U, R = V, S = re;
811
+ });
812
+ }
813
+ return k(m.getEditorState()), i(m.registerUpdateListener(({
814
+ editorState: $
815
+ }) => k($)), O, () => {
816
+ O();
817
+ });
818
+ }
819
+ function c(m, ...v) {
820
+ v.forEach((N) => {
821
+ if (typeof N == "string") {
822
+ const y = N.split(" ").filter((R) => R !== "");
823
+ m.classList.add(...y);
824
+ }
825
+ });
826
+ }
827
+ function o(m, ...v) {
828
+ v.forEach((N) => {
829
+ typeof N == "string" && m.classList.remove(...N.split(" "));
830
+ });
831
+ }
832
+ function n(m, v) {
833
+ for (const N of v)
834
+ if (m.type.startsWith(N))
835
+ return !0;
836
+ return !1;
837
+ }
838
+ function r(m, v) {
839
+ const N = m[Symbol.iterator]();
840
+ return new Promise((y, R) => {
841
+ const S = [], O = () => {
842
+ const {
843
+ done: k,
844
+ value: $
845
+ } = N.next();
846
+ if (k)
847
+ return y(S);
848
+ const D = new FileReader();
849
+ D.addEventListener("error", R), D.addEventListener("load", () => {
850
+ const w = D.result;
851
+ typeof w == "string" && S.push({
852
+ file: $,
853
+ result: w
854
+ }), O();
855
+ }), n($, v) ? D.readAsDataURL($) : O();
856
+ };
857
+ O();
858
+ });
859
+ }
860
+ function a(m, v) {
861
+ const N = [], y = (m || e.$getRoot()).getLatest(), R = v || (e.$isElementNode(y) ? y.getLastDescendant() : y);
862
+ let S = y, O = g(S);
863
+ for (; S !== null && !S.is(R); )
864
+ if (N.push({
865
+ depth: O,
866
+ node: S
867
+ }), e.$isElementNode(S) && S.getChildrenSize() > 0)
868
+ S = S.getFirstChild(), O++;
869
+ else {
870
+ let k = null;
871
+ for (; k === null && S !== null; )
872
+ k = S.getNextSibling(), k === null ? (S = S.getParent(), O--) : S = k;
873
+ }
874
+ return S !== null && S.is(R) && N.push({
875
+ depth: O,
876
+ node: S
877
+ }), N;
878
+ }
879
+ function g(m) {
880
+ let v = m, N = 0;
881
+ for (; (v = v.getParent()) !== null; )
882
+ N++;
883
+ return N;
884
+ }
885
+ function f(m, v) {
886
+ let N = m;
887
+ for (; N != null; ) {
888
+ if (N instanceof v)
889
+ return N;
890
+ N = N.getParent();
891
+ }
892
+ return null;
893
+ }
894
+ function p(m) {
895
+ const v = h(m, (N) => e.$isElementNode(N) && !N.isInline());
896
+ if (!e.$isElementNode(v))
897
+ throw Error(`Expected node ${m.__key} to have closest block element node.`);
898
+ return v;
899
+ }
900
+ const h = (m, v) => {
901
+ let N = m;
902
+ for (; N !== e.$getRoot() && N != null; ) {
903
+ if (v(N))
904
+ return N;
905
+ N = N.getParent();
906
+ }
907
+ return null;
908
+ };
909
+ function x(m, v, N, y) {
910
+ const R = (k) => k instanceof v, S = (k) => {
911
+ const $ = k.getChildren();
912
+ for (let H = 0; H < $.length; H++) {
913
+ const A = $[H];
914
+ if (R(A))
915
+ return null;
916
+ }
917
+ let D = k, w = k;
918
+ for (; D !== null; )
919
+ if (w = D, D = D.getParent(), R(D))
920
+ return {
921
+ child: w,
922
+ parent: D
923
+ };
924
+ return null;
925
+ }, O = (k) => {
926
+ const $ = S(k);
927
+ if ($ !== null) {
928
+ const {
929
+ child: D,
930
+ parent: w
931
+ } = $;
932
+ if (D.is(k)) {
933
+ y(w, k);
934
+ const H = D.getNextSiblings(), A = H.length;
935
+ if (w.insertAfter(D), A !== 0) {
936
+ const j = N(w);
937
+ D.insertAfter(j);
938
+ for (let U = 0; U < A; U++)
939
+ j.append(H[U]);
940
+ }
941
+ !w.canBeEmpty() && w.getChildrenSize() === 0 && w.remove();
942
+ }
943
+ }
944
+ };
945
+ return m.registerNodeTransform(v, O);
946
+ }
947
+ function C(m, v) {
948
+ const y = /* @__PURE__ */ new Map(), R = m._pendingEditorState;
949
+ for (const [O, k] of v._nodeMap) {
950
+ const $ = t.$cloneWithProperties(k);
951
+ if (e.$isTextNode($)) {
952
+ if (!e.$isTextNode(k))
953
+ throw Error("Expected node be a TextNode");
954
+ $.__text = k.__text;
955
+ }
956
+ y.set(O, $);
957
+ }
958
+ R && (R._nodeMap = y), m._dirtyType = 2;
959
+ const S = v._selection;
960
+ e.$setSelection(S === null ? null : S.clone());
961
+ }
962
+ function L(m) {
963
+ const v = e.$getSelection() || e.$getPreviousSelection();
964
+ if (e.$isRangeSelection(v)) {
965
+ const {
966
+ focus: N
967
+ } = v, y = N.getNode(), R = N.offset;
968
+ if (e.$isRootOrShadowRoot(y)) {
969
+ const S = y.getChildAtIndex(R);
970
+ S == null ? y.append(m) : S.insertBefore(m), m.selectNext();
971
+ } else {
972
+ let S, O;
973
+ e.$isTextNode(y) ? (S = y.getParentOrThrow(), O = y.getIndexWithinParent(), R > 0 && (O += 1, y.splitText(R))) : (S = y, O = R);
974
+ const [, k] = e.$splitNode(S, O);
975
+ k.insertBefore(m), k.selectStart();
976
+ }
977
+ } else {
978
+ if (v != null) {
979
+ const y = v.getNodes();
980
+ y[y.length - 1].getTopLevelElementOrThrow().insertAfter(m);
981
+ } else
982
+ e.$getRoot().append(m);
983
+ const N = e.$createParagraphNode();
984
+ m.insertAfter(N), N.select();
985
+ }
986
+ return m.getLatest();
987
+ }
988
+ function E(m, v) {
989
+ const N = v();
990
+ return m.replace(N), N.append(m), N;
991
+ }
992
+ function T(m, v) {
993
+ return m !== null ? Object.getPrototypeOf(m).constructor.name === v.name : !1;
994
+ }
995
+ function M(m, v) {
996
+ const N = [];
997
+ for (let y = 0; y < m.length; y++) {
998
+ const R = v(m[y]);
999
+ R !== null && N.push(R);
1000
+ }
1001
+ return N;
1002
+ }
1003
+ function b(m, v) {
1004
+ const N = m.getFirstChild();
1005
+ N !== null ? N.insertBefore(v) : m.append(v);
1006
+ }
1007
+ return I.$splitNode = e.$splitNode, I.isHTMLAnchorElement = e.isHTMLAnchorElement, I.isHTMLElement = e.isHTMLElement, I.$dfs = a, I.$filter = M, I.$findMatchingParent = h, I.$getNearestBlockElementAncestorOrThrow = p, I.$getNearestNodeOfType = f, I.$insertFirst = b, I.$insertNodeToNearestRoot = L, I.$restoreEditorState = C, I.$wrapNodeInElement = E, I.addClassNamesToElement = c, I.isMimeType = n, I.markSelection = l, I.mediaFileReader = r, I.mergeRegister = i, I.objectKlassEquals = T, I.positionNodeOnRange = u, I.registerNestedElementResolver = x, I.removeClassNamesFromElement = o, I;
1008
+ }
1009
+ var B = {}, It;
1010
+ function Xn() {
1011
+ if (It)
1012
+ return B;
1013
+ It = 1;
1014
+ var t = sr, e = W;
1015
+ function i(o) {
1016
+ let n = new URLSearchParams();
1017
+ n.append("code", o);
1018
+ for (let r = 1; r < arguments.length; r++)
1019
+ n.append("v", arguments[r]);
1020
+ throw Error(`Minified Lexical error #${o}; visit https://lexical.dev/docs/error?${n} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
1021
+ }
1022
+ function d(...o) {
1023
+ return () => {
1024
+ o.forEach((n) => n());
1025
+ };
1026
+ }
1027
+ let s = { attributes: !0, characterData: !0, childList: !0, subtree: !0 };
1028
+ function u(o, n, r) {
1029
+ function a() {
1030
+ if (p === null)
1031
+ throw Error("Unexpected null rootDOMNode");
1032
+ if (h === null)
1033
+ throw Error("Unexpected null parentDOMNode");
1034
+ let { left: T, top: M } = p.getBoundingClientRect();
1035
+ var b = h;
1036
+ let m = t.createRectsFromDOMRange(o, n);
1037
+ L.isConnected || b.append(L), b = !1;
1038
+ for (let y = 0; y < m.length; y++) {
1039
+ var v = m[y];
1040
+ let R = C[y] || document.createElement("div"), S = R.style;
1041
+ S.position !== "absolute" && (S.position = "absolute", b = !0);
1042
+ var N = `${v.left - T}px`;
1043
+ S.left !== N && (S.left = N, b = !0), N = `${v.top - M}px`, S.top !== N && (R.style.top = N, b = !0), N = `${v.width}px`, S.width !== N && (R.style.width = N, b = !0), v = `${v.height}px`, S.height !== v && (R.style.height = v, b = !0), R.parentNode !== L && (L.append(R), b = !0), C[y] = R;
1044
+ }
1045
+ for (; C.length > m.length; )
1046
+ C.pop();
1047
+ b && r(C);
1048
+ }
1049
+ function g() {
1050
+ p = h = null, x !== null && x.disconnect(), x = null, L.remove();
1051
+ for (let T of C)
1052
+ T.remove();
1053
+ C = [];
1054
+ }
1055
+ function f() {
1056
+ let T = o.getRootElement();
1057
+ if (T === null)
1058
+ return g();
1059
+ let M = T.parentElement;
1060
+ if (!(M instanceof HTMLElement))
1061
+ return g();
1062
+ g(), p = T, h = M, x = new MutationObserver((b) => {
1063
+ let m = o.getRootElement(), v = m && m.parentElement;
1064
+ if (m !== p || v !== h)
1065
+ return f();
1066
+ for (let N of b)
1067
+ if (!L.contains(N.target))
1068
+ return a();
1069
+ }), x.observe(M, s), a();
1070
+ }
1071
+ let p = null, h = null, x = null, C = [], L = document.createElement("div"), E = o.registerRootListener(f);
1072
+ return () => {
1073
+ E(), g();
1074
+ };
1075
+ }
1076
+ function l(o, n) {
1077
+ for (let r of n)
1078
+ if (o.type.startsWith(r))
1079
+ return !0;
1080
+ return !1;
1081
+ }
1082
+ let c = (o, n) => {
1083
+ for (; o !== e.$getRoot() && o != null; ) {
1084
+ if (n(o))
1085
+ return o;
1086
+ o = o.getParent();
1087
+ }
1088
+ return null;
1089
+ };
1090
+ return B.$splitNode = e.$splitNode, B.isHTMLAnchorElement = e.isHTMLAnchorElement, B.isHTMLElement = e.isHTMLElement, B.$dfs = function(o, n) {
1091
+ let r = [];
1092
+ o = (o || e.$getRoot()).getLatest(), n = n || (e.$isElementNode(o) ? o.getLastDescendant() : o);
1093
+ for (var a = o, g = 0; (a = a.getParent()) !== null; )
1094
+ g++;
1095
+ for (a = g; o !== null && !o.is(n); )
1096
+ if (r.push({ depth: a, node: o }), e.$isElementNode(o) && 0 < o.getChildrenSize())
1097
+ o = o.getFirstChild(), a++;
1098
+ else
1099
+ for (g = null; g === null && o !== null; )
1100
+ g = o.getNextSibling(), g === null ? (o = o.getParent(), a--) : o = g;
1101
+ return o !== null && o.is(n) && r.push({ depth: a, node: o }), r;
1102
+ }, B.$filter = function(o, n) {
1103
+ let r = [];
1104
+ for (let a = 0; a < o.length; a++) {
1105
+ let g = n(o[a]);
1106
+ g !== null && r.push(g);
1107
+ }
1108
+ return r;
1109
+ }, B.$findMatchingParent = c, B.$getNearestBlockElementAncestorOrThrow = function(o) {
1110
+ let n = c(o, (r) => e.$isElementNode(r) && !r.isInline());
1111
+ return e.$isElementNode(n) || i(4, o.__key), n;
1112
+ }, B.$getNearestNodeOfType = function(o, n) {
1113
+ for (; o != null; ) {
1114
+ if (o instanceof n)
1115
+ return o;
1116
+ o = o.getParent();
1117
+ }
1118
+ return null;
1119
+ }, B.$insertFirst = function(o, n) {
1120
+ let r = o.getFirstChild();
1121
+ r !== null ? r.insertBefore(n) : o.append(n);
1122
+ }, B.$insertNodeToNearestRoot = function(o) {
1123
+ var n = e.$getSelection() || e.$getPreviousSelection();
1124
+ if (e.$isRangeSelection(n)) {
1125
+ var { focus: r } = n;
1126
+ if (n = r.getNode(), r = r.offset, e.$isRootOrShadowRoot(n))
1127
+ r = n.getChildAtIndex(r), r == null ? n.append(o) : r.insertBefore(o), o.selectNext();
1128
+ else {
1129
+ let a, g;
1130
+ e.$isTextNode(n) ? (a = n.getParentOrThrow(), g = n.getIndexWithinParent(), 0 < r && (g += 1, n.splitText(r))) : (a = n, g = r), [, n] = e.$splitNode(a, g), n.insertBefore(o), n.selectStart();
1131
+ }
1132
+ } else
1133
+ n != null ? (n = n.getNodes(), n[n.length - 1].getTopLevelElementOrThrow().insertAfter(o)) : e.$getRoot().append(o), n = e.$createParagraphNode(), o.insertAfter(n), n.select();
1134
+ return o.getLatest();
1135
+ }, B.$restoreEditorState = function(o, n) {
1136
+ let r = /* @__PURE__ */ new Map(), a = o._pendingEditorState;
1137
+ for (let [g, f] of n._nodeMap) {
1138
+ let p = t.$cloneWithProperties(f);
1139
+ if (e.$isTextNode(p)) {
1140
+ if (!e.$isTextNode(f))
1141
+ throw Error("Expected node be a TextNode");
1142
+ p.__text = f.__text;
1143
+ }
1144
+ r.set(g, p);
1145
+ }
1146
+ a && (a._nodeMap = r), o._dirtyType = 2, o = n._selection, e.$setSelection(o === null ? null : o.clone());
1147
+ }, B.$wrapNodeInElement = function(o, n) {
1148
+ return n = n(), o.replace(n), n.append(o), n;
1149
+ }, B.addClassNamesToElement = function(o, ...n) {
1150
+ n.forEach((r) => {
1151
+ typeof r == "string" && (r = r.split(" ").filter((a) => a !== ""), o.classList.add(...r));
1152
+ });
1153
+ }, B.isMimeType = l, B.markSelection = function(o, n) {
1154
+ function r(x) {
1155
+ x.read(() => {
1156
+ var C = e.$getSelection();
1157
+ if (e.$isRangeSelection(C)) {
1158
+ var { anchor: L, focus: E } = C;
1159
+ C = L.getNode();
1160
+ var T = C.getKey(), M = L.offset, b = E.getNode(), m = b.getKey(), v = E.offset, N = o.getElementByKey(T), y = o.getElementByKey(m);
1161
+ if (T = a === null || N === null || M !== g || T !== a.getKey() || C !== a && (!(a instanceof e.TextNode) || C.updateDOM(a, N, o._config)), m = f === null || y === null || v !== p || m !== f.getKey() || b !== f && (!(f instanceof e.TextNode) || b.updateDOM(f, y, o._config)), T || m) {
1162
+ N = o.getElementByKey(L.getNode().getKey());
1163
+ var R = o.getElementByKey(E.getNode().getKey());
1164
+ if (N !== null && R !== null && N.tagName === "SPAN" && R.tagName === "SPAN") {
1165
+ if (m = document.createRange(), E.isBefore(L) ? (T = R, y = E.offset, R = N, N = L.offset) : (T = N, y = L.offset, N = E.offset), T = T.firstChild, T === null || (R = R.firstChild, R === null))
1166
+ throw Error("Expected text node to be first child of span");
1167
+ m.setStart(T, y), m.setEnd(R, N), h(), h = u(o, m, (S) => {
1168
+ for (let O of S) {
1169
+ let k = O.style;
1170
+ 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 !== "-1.5px" && (k.marginTop = "-1.5px"), k.paddingTop !== "4px" && (k.paddingTop = "4px"), k.paddingBottom !== "0px" && (k.paddingBottom = "0px");
1171
+ }
1172
+ n !== void 0 && n(S);
1173
+ });
1174
+ }
1175
+ }
1176
+ a = C, g = M, f = b, p = v;
1177
+ } else
1178
+ p = f = g = a = null, h(), h = () => {
1179
+ };
1180
+ });
1181
+ }
1182
+ let a = null, g = null, f = null, p = null, h = () => {
1183
+ };
1184
+ return r(o.getEditorState()), d(o.registerUpdateListener(({ editorState: x }) => r(x)), h, () => {
1185
+ h();
1186
+ });
1187
+ }, B.mediaFileReader = function(o, n) {
1188
+ let r = o[Symbol.iterator]();
1189
+ return new Promise((a, g) => {
1190
+ let f = [], p = () => {
1191
+ const { done: h, value: x } = r.next();
1192
+ if (h)
1193
+ return a(f);
1194
+ const C = new FileReader();
1195
+ C.addEventListener("error", g), C.addEventListener("load", () => {
1196
+ const L = C.result;
1197
+ typeof L == "string" && f.push({ file: x, result: L }), p();
1198
+ }), l(x, n) ? C.readAsDataURL(x) : p();
1199
+ };
1200
+ p();
1201
+ });
1202
+ }, B.mergeRegister = d, B.objectKlassEquals = function(o, n) {
1203
+ return o !== null ? Object.getPrototypeOf(o).constructor.name === n.name : !1;
1204
+ }, B.positionNodeOnRange = u, B.registerNestedElementResolver = function(o, n, r, a) {
1205
+ return o.registerNodeTransform(n, (g) => {
1206
+ e: {
1207
+ for (var f = g.getChildren(), p = 0; p < f.length; p++)
1208
+ if (f[p] instanceof n) {
1209
+ f = null;
1210
+ break e;
1211
+ }
1212
+ for (f = g; f !== null; )
1213
+ if (p = f, f = f.getParent(), f instanceof n) {
1214
+ f = { child: p, parent: f };
1215
+ break e;
1216
+ }
1217
+ f = null;
1218
+ }
1219
+ if (f !== null) {
1220
+ const { child: h, parent: x } = f;
1221
+ if (h.is(g)) {
1222
+ if (a(x, g), g = h.getNextSiblings(), f = g.length, x.insertAfter(h), f !== 0) {
1223
+ p = r(x), h.insertAfter(p);
1224
+ for (let C = 0; C < f; C++)
1225
+ p.append(g[C]);
1226
+ }
1227
+ x.canBeEmpty() || x.getChildrenSize() !== 0 || x.remove();
1228
+ }
1229
+ }
1230
+ });
1231
+ }, B.removeClassNamesFromElement = function(o, ...n) {
1232
+ n.forEach((r) => {
1233
+ typeof r == "string" && o.classList.remove(...r.split(" "));
1234
+ });
1235
+ }, B;
1236
+ }
1237
+ const Qn = process.env.NODE_ENV === "development" ? Jn() : Xn();
1238
+ var z = Qn, Je = {}, Bt;
1239
+ function Zn() {
1240
+ if (Bt)
1241
+ return Je;
1242
+ Bt = 1;
1243
+ var t = W;
1244
+ function e(i) {
1245
+ const d = window.location.origin, s = (u) => {
1246
+ if (u.origin !== d)
1247
+ return;
1248
+ const l = i.getRootElement();
1249
+ if (document.activeElement !== l)
1250
+ return;
1251
+ const c = u.data;
1252
+ if (typeof c == "string") {
1253
+ let o;
1254
+ try {
1255
+ o = JSON.parse(c);
1256
+ } catch {
1257
+ return;
1258
+ }
1259
+ if (o && o.protocol === "nuanria_messaging" && o.type === "request") {
1260
+ const n = o.payload;
1261
+ if (n && n.functionId === "makeChanges") {
1262
+ const r = n.args;
1263
+ if (r) {
1264
+ const [a, g, f, p, h, x] = r;
1265
+ i.update(() => {
1266
+ const C = t.$getSelection();
1267
+ if (t.$isRangeSelection(C)) {
1268
+ const L = C.anchor;
1269
+ let E = L.getNode(), T = 0, M = 0;
1270
+ if (t.$isTextNode(E) && a >= 0 && g >= 0 && (T = a, M = a + g, C.setTextNodeRange(E, T, E, M)), (T !== M || f !== "") && (C.insertRawText(f), E = L.getNode()), t.$isTextNode(E)) {
1271
+ T = p, M = p + h;
1272
+ const b = E.getTextContentSize();
1273
+ T = T > b ? b : T, M = M > b ? b : M, C.setTextNodeRange(E, T, E, M);
1274
+ }
1275
+ u.stopImmediatePropagation();
1276
+ }
1277
+ });
1278
+ }
1279
+ }
1280
+ }
1281
+ }
1282
+ };
1283
+ return window.addEventListener("message", s, !0), () => {
1284
+ window.removeEventListener("message", s, !0);
1285
+ };
1286
+ }
1287
+ return Je.registerDragonSupport = e, Je;
1288
+ }
1289
+ var Xe = {}, Ht;
1290
+ function eo() {
1291
+ if (Ht)
1292
+ return Xe;
1293
+ Ht = 1;
1294
+ var t = W;
1295
+ return Xe.registerDragonSupport = function(e) {
1296
+ let i = window.location.origin, d = (s) => {
1297
+ if (s.origin === i) {
1298
+ var u = e.getRootElement();
1299
+ if (document.activeElement === u && (u = s.data, typeof u == "string")) {
1300
+ try {
1301
+ var l = JSON.parse(u);
1302
+ } catch {
1303
+ return;
1304
+ }
1305
+ if (l && l.protocol === "nuanria_messaging" && l.type === "request" && (l = l.payload) && l.functionId === "makeChanges" && (l = l.args)) {
1306
+ const [c, o, n, r, a] = l;
1307
+ e.update(() => {
1308
+ const g = t.$getSelection();
1309
+ if (t.$isRangeSelection(g)) {
1310
+ var f = g.anchor;
1311
+ let p = f.getNode(), h = 0, x = 0;
1312
+ t.$isTextNode(p) && 0 <= c && 0 <= o && (h = c, x = c + o, g.setTextNodeRange(p, h, p, x)), (h !== x || n !== "") && (g.insertRawText(n), p = f.getNode()), t.$isTextNode(p) && (h = r, x = r + a, f = p.getTextContentSize(), h = h > f ? f : h, x = x > f ? f : x, g.setTextNodeRange(p, h, p, x)), s.stopImmediatePropagation();
1313
+ }
1314
+ });
1315
+ }
1316
+ }
1317
+ }
1318
+ };
1319
+ return window.addEventListener("message", d, !0), () => {
1320
+ window.removeEventListener("message", d, !0);
1321
+ };
1322
+ }, Xe;
1323
+ }
1324
+ var Qe, Ft;
1325
+ function wr() {
1326
+ return Ft || (Ft = 1, Qe = process.env.NODE_ENV === "development" ? Zn() : eo()), Qe;
1327
+ }
1328
+ var zt;
1329
+ function to() {
1330
+ if (zt)
1331
+ return We;
1332
+ zt = 1;
1333
+ var t = P, e = $r(), i = q, d = Dr(), s = z, u = Lr, l = wr(), c = fr, r = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
1334
+ function a(C) {
1335
+ return C.getEditorState().read(d.$canShowPlaceholderCurry(C.isComposing()));
1336
+ }
1337
+ function g(C) {
1338
+ const [L, E] = i.useState(() => a(C));
1339
+ return r(() => {
1340
+ function T() {
1341
+ const M = a(C);
1342
+ E(M);
1343
+ }
1344
+ return T(), s.mergeRegister(C.registerUpdateListener(() => {
1345
+ T();
1346
+ }), C.registerEditableListener(() => {
1347
+ T();
1348
+ }));
1349
+ }, [C]), L;
1350
+ }
1351
+ function f(C, L) {
1352
+ const [E, T] = i.useState(() => C.getDecorators());
1353
+ return r(() => C.registerDecoratorListener((M) => {
1354
+ u.flushSync(() => {
1355
+ T(M);
1356
+ });
1357
+ }), [C]), i.useEffect(() => {
1358
+ T(C.getDecorators());
1359
+ }, [C]), i.useMemo(() => {
1360
+ const M = [], b = Object.keys(E);
1361
+ for (let m = 0; m < b.length; m++) {
1362
+ const v = b[m], N = /* @__PURE__ */ i.createElement(L, {
1363
+ onError: (R) => C._onError(R)
1364
+ }, /* @__PURE__ */ i.createElement(i.Suspense, {
1365
+ fallback: null
1366
+ }, E[v])), y = C.getElementByKey(v);
1367
+ y !== null && M.push(/* @__PURE__ */ u.createPortal(N, y, v));
1368
+ }
1369
+ return M;
1370
+ }, [L, E, C]);
1371
+ }
1372
+ function p(C) {
1373
+ r(() => s.mergeRegister(c.registerRichText(C), l.registerDragonSupport(C)), [C]);
1374
+ }
1375
+ function h({
1376
+ contentEditable: C,
1377
+ placeholder: L,
1378
+ ErrorBoundary: E
1379
+ }) {
1380
+ const [T] = t.useLexicalComposerContext(), M = f(T, E);
1381
+ return p(T), /* @__PURE__ */ i.createElement(i.Fragment, null, C, /* @__PURE__ */ i.createElement(x, {
1382
+ content: L
1383
+ }), M);
1384
+ }
1385
+ function x({
1386
+ content: C
1387
+ }) {
1388
+ const [L] = t.useLexicalComposerContext(), E = g(L), T = e();
1389
+ return E ? typeof C == "function" ? C(T) : C : null;
1390
+ }
1391
+ return We.RichTextPlugin = h, We;
1392
+ }
1393
+ var Ze = {}, qt;
1394
+ function ro() {
1395
+ if (qt)
1396
+ return Ze;
1397
+ qt = 1;
1398
+ var t = P, e = $r(), i = q, d = Dr(), s = z, u = Lr, l = wr(), c = fr, o = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u" ? i.useLayoutEffect : i.useEffect;
1399
+ function n(p) {
1400
+ return p.getEditorState().read(d.$canShowPlaceholderCurry(p.isComposing()));
1401
+ }
1402
+ function r(p) {
1403
+ let [h, x] = i.useState(() => n(p));
1404
+ return o(() => {
1405
+ function C() {
1406
+ let L = n(p);
1407
+ x(L);
1408
+ }
1409
+ return C(), s.mergeRegister(p.registerUpdateListener(() => {
1410
+ C();
1411
+ }), p.registerEditableListener(() => {
1412
+ C();
1413
+ }));
1414
+ }, [p]), h;
1415
+ }
1416
+ function a(p, h) {
1417
+ let [x, C] = i.useState(() => p.getDecorators());
1418
+ return o(() => p.registerDecoratorListener((L) => {
1419
+ u.flushSync(() => {
1420
+ C(L);
1421
+ });
1422
+ }), [p]), i.useEffect(() => {
1423
+ C(p.getDecorators());
1424
+ }, [p]), i.useMemo(() => {
1425
+ let L = [], E = Object.keys(x);
1426
+ for (let T = 0; T < E.length; T++) {
1427
+ let M = E[T], b = i.createElement(h, { onError: (v) => p._onError(v) }, i.createElement(i.Suspense, { fallback: null }, x[M])), m = p.getElementByKey(M);
1428
+ m !== null && L.push(u.createPortal(b, m, M));
1429
+ }
1430
+ return L;
1431
+ }, [h, x, p]);
1432
+ }
1433
+ function g(p) {
1434
+ o(() => s.mergeRegister(c.registerRichText(p), l.registerDragonSupport(p)), [p]);
1435
+ }
1436
+ function f({ content: p }) {
1437
+ var [h] = t.useLexicalComposerContext();
1438
+ h = r(h);
1439
+ let x = e();
1440
+ return h ? typeof p == "function" ? p(x) : p : null;
1441
+ }
1442
+ return Ze.RichTextPlugin = function({ contentEditable: p, placeholder: h, ErrorBoundary: x }) {
1443
+ let [C] = t.useLexicalComposerContext();
1444
+ return x = a(C, x), g(C), i.createElement(i.Fragment, null, p, i.createElement(f, { content: h }), x);
1445
+ }, Ze;
1446
+ }
1447
+ const no = process.env.NODE_ENV === "development" ? to() : ro();
1448
+ var oo = no, et, Ut;
1449
+ function io() {
1450
+ if (Ut)
1451
+ return et;
1452
+ Ut = 1;
1453
+ var t = q;
1454
+ function e(c, o) {
1455
+ return e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, a) {
1456
+ return r.__proto__ = a, r;
1457
+ }, e(c, o);
1458
+ }
1459
+ function i(c, o) {
1460
+ c.prototype = Object.create(o.prototype), c.prototype.constructor = c, e(c, o);
1461
+ }
1462
+ var d = function(o, n) {
1463
+ return o === void 0 && (o = []), n === void 0 && (n = []), o.length !== n.length || o.some(function(r, a) {
1464
+ return !Object.is(r, n[a]);
1465
+ });
1466
+ }, s = {
1467
+ error: null
1468
+ }, u = /* @__PURE__ */ function(c) {
1469
+ i(o, c);
1470
+ function o() {
1471
+ for (var r, a = arguments.length, g = new Array(a), f = 0; f < a; f++)
1472
+ g[f] = arguments[f];
1473
+ return r = c.call.apply(c, [this].concat(g)) || this, r.state = s, r.resetErrorBoundary = function() {
1474
+ for (var p, h = arguments.length, x = new Array(h), C = 0; C < h; C++)
1475
+ x[C] = arguments[C];
1476
+ r.props.onReset == null || (p = r.props).onReset.apply(p, x), r.reset();
1477
+ }, r;
1478
+ }
1479
+ o.getDerivedStateFromError = function(a) {
1480
+ return {
1481
+ error: a
1482
+ };
1483
+ };
1484
+ var n = o.prototype;
1485
+ return n.reset = function() {
1486
+ this.setState(s);
1487
+ }, n.componentDidCatch = function(a, g) {
1488
+ var f, p;
1489
+ (f = (p = this.props).onError) == null || f.call(p, a, g);
1490
+ }, n.componentDidUpdate = function(a, g) {
1491
+ var f = this.state.error, p = this.props.resetKeys;
1492
+ if (f !== null && g.error !== null && d(a.resetKeys, p)) {
1493
+ var h, x;
1494
+ (h = (x = this.props).onResetKeysChange) == null || h.call(x, a.resetKeys, p), this.reset();
1495
+ }
1496
+ }, n.render = function() {
1497
+ var a = this.state.error, g = this.props, f = g.fallbackRender, p = g.FallbackComponent, h = g.fallback;
1498
+ if (a !== null) {
1499
+ var x = {
1500
+ error: a,
1501
+ resetErrorBoundary: this.resetErrorBoundary
1502
+ };
1503
+ if (/* @__PURE__ */ t.isValidElement(h))
1504
+ return h;
1505
+ if (typeof f == "function")
1506
+ return f(x);
1507
+ if (p)
1508
+ return /* @__PURE__ */ t.createElement(p, x);
1509
+ throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
1510
+ }
1511
+ return this.props.children;
1512
+ }, o;
1513
+ }(t.Component);
1514
+ function l({
1515
+ children: c,
1516
+ onError: o
1517
+ }) {
1518
+ return /* @__PURE__ */ t.createElement(u, {
1519
+ fallback: /* @__PURE__ */ t.createElement("div", {
1520
+ style: {
1521
+ border: "1px solid #f00",
1522
+ color: "#f00",
1523
+ padding: "8px"
1524
+ }
1525
+ }, "An error was thrown."),
1526
+ onError: o
1527
+ }, c);
1528
+ }
1529
+ return et = l, et;
1530
+ }
1531
+ var tt, Kt;
1532
+ function lo() {
1533
+ if (Kt)
1534
+ return tt;
1535
+ Kt = 1;
1536
+ var t = q;
1537
+ function e(l, c) {
1538
+ return e = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, n) {
1539
+ return o.__proto__ = n, o;
1540
+ }, e(l, c);
1541
+ }
1542
+ function i(l, c) {
1543
+ l.prototype = Object.create(c.prototype), l.prototype.constructor = l, e(l, c);
1544
+ }
1545
+ function d(l, c) {
1546
+ return l === void 0 && (l = []), c === void 0 && (c = []), l.length !== c.length || l.some(function(o, n) {
1547
+ return !Object.is(o, c[n]);
1548
+ });
1549
+ }
1550
+ var s = { error: null }, u = function(l) {
1551
+ function c() {
1552
+ for (var n, r = arguments.length, a = Array(r), g = 0; g < r; g++)
1553
+ a[g] = arguments[g];
1554
+ return n = l.call.apply(l, [this].concat(a)) || this, n.state = s, n.resetErrorBoundary = function() {
1555
+ for (var f, p = arguments.length, h = Array(p), x = 0; x < p; x++)
1556
+ h[x] = arguments[x];
1557
+ n.props.onReset == null || (f = n.props).onReset.apply(f, h), n.reset();
1558
+ }, n;
1559
+ }
1560
+ i(c, l), c.getDerivedStateFromError = function(n) {
1561
+ return { error: n };
1562
+ };
1563
+ var o = c.prototype;
1564
+ return o.reset = function() {
1565
+ this.setState(s);
1566
+ }, o.componentDidCatch = function(n, r) {
1567
+ var a, g;
1568
+ (a = (g = this.props).onError) == null || a.call(g, n, r);
1569
+ }, o.componentDidUpdate = function(n, r) {
1570
+ var a = this.props.resetKeys;
1571
+ if (this.state.error !== null && r.error !== null && d(n.resetKeys, a)) {
1572
+ var g, f;
1573
+ (g = (f = this.props).onResetKeysChange) == null || g.call(f, n.resetKeys, a), this.reset();
1574
+ }
1575
+ }, o.render = function() {
1576
+ var n = this.state.error, r = this.props, a = r.fallbackRender, g = r.FallbackComponent;
1577
+ if (r = r.fallback, n !== null) {
1578
+ if (n = { error: n, resetErrorBoundary: this.resetErrorBoundary }, t.isValidElement(r))
1579
+ return r;
1580
+ if (typeof a == "function")
1581
+ return a(n);
1582
+ if (g)
1583
+ return t.createElement(g, n);
1584
+ throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
1585
+ }
1586
+ return this.props.children;
1587
+ }, c;
1588
+ }(t.Component);
1589
+ return tt = function({ children: l, onError: c }) {
1590
+ return t.createElement(u, { fallback: t.createElement("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" } }, "An error was thrown."), onError: c }, l);
1591
+ }, tt;
1592
+ }
1593
+ const so = process.env.NODE_ENV === "development" ? io() : lo();
1594
+ var ao = so;
1595
+ const Ar = hn({ hasFocus: !1, editorRef: { current: null } }), co = ({ onBlur: t }) => {
1596
+ const [e, i] = Y(!1), d = gt(null), s = J(() => {
1597
+ i(!0), d.current && window.clearTimeout(d.current);
1598
+ }, []), u = J(() => {
1599
+ d.current = window.setTimeout(() => {
1600
+ i(!1), t == null || t();
181
1601
  }, 0);
182
1602
  }, [t]);
183
1603
  return {
184
1604
  hasFocus: e,
185
1605
  attributes: {
186
- onFocus: i,
187
- onBlur: l
1606
+ onFocus: s,
1607
+ onBlur: u
188
1608
  }
189
1609
  };
190
- }, at = () => ve(Ht);
191
- function Qe(t) {
192
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
1610
+ }, mt = () => mn(Ar);
1611
+ function uo(t) {
1612
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
193
1613
  }
194
- function Ve(t) {
195
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
1614
+ function fo(t) {
1615
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
196
1616
  }
197
- function Ze(t) {
198
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1617
+ function go(t) {
1618
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
199
1619
  }
200
- function tr(t) {
201
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1620
+ function po(t) {
1621
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
202
1622
  }
203
- function er(t) {
204
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1623
+ function ho(t) {
1624
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
205
1625
  }
206
- function rr(t) {
207
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1626
+ function mo(t) {
1627
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
208
1628
  }
209
- function nr(t) {
210
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1629
+ function xo(t) {
1630
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
211
1631
  }
212
- function or(t) {
213
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
1632
+ function Co(t) {
1633
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
214
1634
  }
215
- function ir(t) {
216
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
1635
+ function Eo(t) {
1636
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
217
1637
  }
218
- function ar(t) {
219
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
1638
+ function No(t) {
1639
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
220
1640
  }
221
- function lr(t) {
222
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
1641
+ function To(t) {
1642
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
223
1643
  }
224
- function sr(t) {
225
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
1644
+ function vo(t) {
1645
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
226
1646
  }
227
- function cr(t) {
228
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
1647
+ function _o(t) {
1648
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
229
1649
  }
230
- function dr(t) {
231
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
1650
+ function Lo(t) {
1651
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
232
1652
  }
233
- function ur(t) {
234
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
1653
+ function yo(t) {
1654
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
235
1655
  }
236
- function hr(t) {
237
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
1656
+ function Mo(t) {
1657
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
238
1658
  }
239
- function pr(t) {
240
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
1659
+ function Ro(t) {
1660
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
241
1661
  }
242
- function gr(t) {
243
- return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
1662
+ function bo(t) {
1663
+ return F({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
244
1664
  }
245
- const fr = Ie("div", {
1665
+ const So = $n("div", {
246
1666
  width: "10rem",
247
1667
  display: "flex"
248
- }), Ut = {
1668
+ }), Pr = {
249
1669
  bullet: "Punktliste",
250
1670
  h1: "Overskrift 1",
251
1671
  h2: "Overskrift 2",
@@ -257,24 +1677,24 @@ const fr = Ie("div", {
257
1677
  paragraph: "Normal",
258
1678
  quote: "Sitat",
259
1679
  check: "Avkrysningsliste"
260
- }, mr = {
261
- bullet: /* @__PURE__ */ n(dr, { size: "1.25rem" }),
262
- h1: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
263
- h2: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
264
- h3: /* @__PURE__ */ n(er, { size: "1.25rem" }),
265
- h4: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
266
- h5: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
267
- h6: /* @__PURE__ */ n(or, { size: "1.25rem" }),
268
- number: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
269
- check: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
270
- paragraph: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
271
- quote: /* @__PURE__ */ n(ur, { size: "1.25rem" })
272
- }, M = ({
1680
+ }, ko = {
1681
+ bullet: /* @__PURE__ */ _(Lo, { size: "1.25rem" }),
1682
+ h1: /* @__PURE__ */ _(go, { size: "1.25rem" }),
1683
+ h2: /* @__PURE__ */ _(po, { size: "1.25rem" }),
1684
+ h3: /* @__PURE__ */ _(ho, { size: "1.25rem" }),
1685
+ h4: /* @__PURE__ */ _(mo, { size: "1.25rem" }),
1686
+ h5: /* @__PURE__ */ _(xo, { size: "1.25rem" }),
1687
+ h6: /* @__PURE__ */ _(Co, { size: "1.25rem" }),
1688
+ number: /* @__PURE__ */ _(_o, { size: "1.25rem" }),
1689
+ check: /* @__PURE__ */ _(vo, { size: "1.25rem" }),
1690
+ paragraph: /* @__PURE__ */ _(No, { size: "1.25rem" }),
1691
+ quote: /* @__PURE__ */ _(yo, { size: "1.25rem" })
1692
+ }, Q = ({
273
1693
  blockType: t
274
- }) => /* @__PURE__ */ g(Y, { children: [
275
- /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: mr[t] }),
276
- /* @__PURE__ */ n(
277
- P,
1694
+ }) => /* @__PURE__ */ K(Ie, { children: [
1695
+ /* @__PURE__ */ _(_e, { css: { display: "flex", flex: "0 0 auto" }, children: ko[t] }),
1696
+ /* @__PURE__ */ _(
1697
+ _e,
278
1698
  {
279
1699
  css: {
280
1700
  flex: "1 1 auto",
@@ -282,326 +1702,872 @@ const fr = Ie("div", {
282
1702
  textOverflow: "ellipsis",
283
1703
  whiteSpace: "nowrap"
284
1704
  },
285
- children: Ut[t]
1705
+ children: Pr[t]
286
1706
  }
287
1707
  )
288
- ] }), kr = (t) => {
289
- if (!L(t))
1708
+ ] }), Oo = (t) => {
1709
+ if (!te(t))
290
1710
  return null;
291
1711
  const e = t.anchor.getNode();
292
- let r = e.getKey() === "root" ? e : Dt(e, (o) => {
293
- const i = o.getParent();
294
- return i !== null && Vt(i);
1712
+ let i = e.getKey() === "root" ? e : z.$findMatchingParent(e, (d) => {
1713
+ const s = d.getParent();
1714
+ return s !== null && Vr(s);
295
1715
  });
296
- return r === null && (r = e.getTopLevelElementOrThrow()), {
1716
+ return i === null && (i = e.getTopLevelElementOrThrow()), {
297
1717
  anchorNode: e,
298
- element: r
1718
+ element: i
299
1719
  };
300
- }, br = () => {
301
- const [t] = y(), [e, r] = b("paragraph");
302
- x(() => t.registerCommand(
303
- F,
1720
+ }, $o = () => {
1721
+ const [t] = P.useLexicalComposerContext(), [e, i] = Y("paragraph");
1722
+ oe(() => t.registerCommand(
1723
+ Le,
304
1724
  () => {
305
- const c = T(), f = kr(c);
306
- if (!f)
1725
+ const n = ee(), r = Oo(n);
1726
+ if (!r)
307
1727
  return !1;
308
- const { element: u, anchorNode: m } = f, w = u.getKey();
309
- if (t.getElementByKey(w) !== null)
310
- if (et(u)) {
311
- const k = Pe(
312
- m,
313
- tt
314
- ), S = k ? k.getListType() : u.getListType();
315
- r(S);
1728
+ const { element: a, anchorNode: g } = r, f = a.getKey();
1729
+ if (t.getElementByKey(f) !== null)
1730
+ if (ft(a)) {
1731
+ const h = z.$getNearestNodeOfType(
1732
+ g,
1733
+ dt
1734
+ ), x = h ? h.getListType() : a.getListType();
1735
+ i(x);
316
1736
  } else {
317
- const k = ue(u) ? u.getTag() : u.getType();
318
- k in Ut && r(k);
1737
+ const h = an(a) ? a.getTag() : a.getType();
1738
+ h in Pr && i(h);
319
1739
  }
320
1740
  return !1;
321
1741
  },
322
- Q
1742
+ at
323
1743
  ), [t]);
324
- const o = (c) => {
325
- e !== c && t.update(() => {
326
- const f = T();
327
- L(f) && (J(f, () => he(c)), r(c));
1744
+ const d = (n) => {
1745
+ e !== n && t.update(() => {
1746
+ const r = ee();
1747
+ te(r) && (qe(r, () => cn(n)), i(n));
328
1748
  });
329
1749
  };
330
- return /* @__PURE__ */ n(fr, { children: /* @__PURE__ */ g(
331
- nt,
1750
+ return /* @__PURE__ */ _(So, { children: /* @__PURE__ */ K(
1751
+ pt,
332
1752
  {
333
- trigger: /* @__PURE__ */ n(
334
- Et,
1753
+ trigger: /* @__PURE__ */ _(
1754
+ Nr,
335
1755
  {
336
1756
  dropdown: !0,
337
1757
  css: { display: "flex", width: "100%", overflow: "hidden" },
338
- children: /* @__PURE__ */ n(M, { blockType: e })
1758
+ children: /* @__PURE__ */ _(Q, { blockType: e })
339
1759
  }
340
1760
  ),
341
1761
  side: "bottom",
342
1762
  align: "start",
343
1763
  children: [
344
- /* @__PURE__ */ n(C, { onClick: () => {
1764
+ /* @__PURE__ */ _(Z, { onClick: () => {
345
1765
  e !== "paragraph" && t.update(() => {
346
- const c = T();
347
- L(c) && (J(c, () => q()), r("paragraph"));
1766
+ const n = ee();
1767
+ te(n) && (qe(n, () => Pe()), i("paragraph"));
348
1768
  });
349
- }, children: /* @__PURE__ */ n(M, { blockType: "paragraph" }) }),
350
- /* @__PURE__ */ n(C, { onClick: () => o("h1"), children: /* @__PURE__ */ n(M, { blockType: "h1" }) }),
351
- /* @__PURE__ */ n(C, { onClick: () => o("h2"), children: /* @__PURE__ */ n(M, { blockType: "h2" }) }),
352
- /* @__PURE__ */ n(C, { onClick: () => o("h3"), children: /* @__PURE__ */ n(M, { blockType: "h3" }) }),
353
- /* @__PURE__ */ n(C, { onClick: () => o("h4"), children: /* @__PURE__ */ n(M, { blockType: "h4" }) }),
354
- /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
355
- /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
356
- /* @__PURE__ */ n(C, { onClick: () => {
357
- e !== "bullet" && (t.dispatchCommand(se, void 0), r("bullet"));
358
- }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
359
- /* @__PURE__ */ n(C, { onClick: () => {
360
- e !== "number" && (t.dispatchCommand(ce, void 0), r("number"));
361
- }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
362
- /* @__PURE__ */ n(C, { onClick: () => {
363
- e !== "check" && (t.dispatchCommand(Tt, void 0), r("check"));
364
- }, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
365
- /* @__PURE__ */ n(C, { onClick: () => {
1769
+ }, children: /* @__PURE__ */ _(Q, { blockType: "paragraph" }) }),
1770
+ /* @__PURE__ */ _(Z, { onClick: () => d("h1"), children: /* @__PURE__ */ _(Q, { blockType: "h1" }) }),
1771
+ /* @__PURE__ */ _(Z, { onClick: () => d("h2"), children: /* @__PURE__ */ _(Q, { blockType: "h2" }) }),
1772
+ /* @__PURE__ */ _(Z, { onClick: () => d("h3"), children: /* @__PURE__ */ _(Q, { blockType: "h3" }) }),
1773
+ /* @__PURE__ */ _(Z, { onClick: () => d("h4"), children: /* @__PURE__ */ _(Q, { blockType: "h4" }) }),
1774
+ /* @__PURE__ */ _(Z, { onClick: () => d("h5"), children: /* @__PURE__ */ _(Q, { blockType: "h5" }) }),
1775
+ /* @__PURE__ */ _(Z, { onClick: () => d("h6"), children: /* @__PURE__ */ _(Q, { blockType: "h6" }) }),
1776
+ /* @__PURE__ */ _(Z, { onClick: () => {
1777
+ e !== "bullet" && (t.dispatchCommand(on, void 0), i("bullet"));
1778
+ }, children: /* @__PURE__ */ _(Q, { blockType: "bullet" }) }),
1779
+ /* @__PURE__ */ _(Z, { onClick: () => {
1780
+ e !== "number" && (t.dispatchCommand(ln, void 0), i("number"));
1781
+ }, children: /* @__PURE__ */ _(Q, { blockType: "number" }) }),
1782
+ /* @__PURE__ */ _(Z, { onClick: () => {
1783
+ e !== "check" && (t.dispatchCommand(dr, void 0), i("check"));
1784
+ }, children: /* @__PURE__ */ _(Q, { blockType: "check" }) }),
1785
+ /* @__PURE__ */ _(Z, { onClick: () => {
366
1786
  e !== "quote" && t.update(() => {
367
- const c = T();
368
- L(c) && (J(c, () => pe()), r("quote"));
1787
+ const n = ee();
1788
+ te(n) && (qe(n, () => un()), i("quote"));
369
1789
  });
370
- }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
1790
+ }, children: /* @__PURE__ */ _(Q, { blockType: "quote" }) })
371
1791
  ]
372
1792
  }
373
1793
  ) });
374
- }, vr = () => {
375
- const [t] = y(), [e, r] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
376
- const p = T();
377
- L(p) && (r(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
1794
+ }, Do = () => {
1795
+ const [t] = P.useLexicalComposerContext(), [e, i] = Y(!1), [d, s] = Y(!1), [u, l] = Y(!1), [c, o] = Y(!1), [n, r] = Y(!1), a = J(() => {
1796
+ const L = ee();
1797
+ te(L) && (i(L.hasFormat("bold")), s(L.hasFormat("italic")), l(L.hasFormat("underline")), o(L.hasFormat("code")), r(L.hasFormat("superscript")));
378
1798
  }, []);
379
- x(() => it(
1799
+ oe(() => z.mergeRegister(
380
1800
  t.registerCommand(
381
- F,
382
- () => (u(), !1),
383
- Q
1801
+ Le,
1802
+ () => (a(), !1),
1803
+ at
384
1804
  ),
385
- t.registerUpdateListener(({ editorState: p }) => {
386
- p.read(() => {
387
- u();
1805
+ t.registerUpdateListener(({ editorState: L }) => {
1806
+ L.read(() => {
1807
+ a();
388
1808
  });
389
1809
  })
390
- ), [t, u]);
391
- const m = v(
392
- () => t.dispatchCommand(B, "bold"),
1810
+ ), [t, a]);
1811
+ const g = J(
1812
+ () => t.dispatchCommand(Ee, "bold"),
393
1813
  [t]
394
- ), w = v(
395
- () => t.dispatchCommand(B, "italic"),
1814
+ ), f = J(
1815
+ () => t.dispatchCommand(Ee, "italic"),
396
1816
  [t]
397
- ), N = v(
398
- () => t.dispatchCommand(B, "underline"),
1817
+ ), p = J(
1818
+ () => t.dispatchCommand(Ee, "underline"),
399
1819
  [t]
400
- ), k = v(
401
- () => t.dispatchCommand(B, "code"),
1820
+ ), h = J(
1821
+ () => t.dispatchCommand(Ee, "code"),
402
1822
  [t]
403
- ), S = v(
404
- () => t.dispatchCommand(B, "superscript"),
1823
+ ), x = J(
1824
+ () => t.dispatchCommand(Ee, "superscript"),
405
1825
  [t]
406
- ), A = wt(() => {
407
- const p = [];
408
- return e && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
409
- }, [e, o, l, s, c]);
410
- return /* @__PURE__ */ g(
411
- _t,
1826
+ ), C = Er(() => {
1827
+ const L = [];
1828
+ return e && L.push("bold"), d && L.push("italic"), u && L.push("underline"), c && L.push("code"), n && L.push("superscript"), L;
1829
+ }, [e, d, u, c, n]);
1830
+ return /* @__PURE__ */ K(
1831
+ Tr,
412
1832
  {
413
1833
  type: "multiple",
414
1834
  "aria-label": "Tekstformattering",
415
- value: A,
1835
+ value: C,
416
1836
  children: [
417
- /* @__PURE__ */ n(I, { onClick: m, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ n(Qe, { size: "1.25rem" }) }),
418
- /* @__PURE__ */ n(
419
- I,
1837
+ /* @__PURE__ */ _(he, { onClick: g, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ _(uo, { size: "1.25rem" }) }),
1838
+ /* @__PURE__ */ _(
1839
+ he,
420
1840
  {
421
- onClick: w,
1841
+ onClick: f,
422
1842
  title: "Kursiv tekst",
423
1843
  value: "italic",
424
- children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
1844
+ children: /* @__PURE__ */ _(Eo, { size: "1.25rem" })
425
1845
  }
426
1846
  ),
427
- /* @__PURE__ */ n(
428
- I,
1847
+ /* @__PURE__ */ _(
1848
+ he,
429
1849
  {
430
- onClick: N,
1850
+ onClick: p,
431
1851
  title: "Understreket tekst",
432
1852
  value: "underline",
433
- children: /* @__PURE__ */ n(gr, { size: "1.25rem" })
1853
+ children: /* @__PURE__ */ _(bo, { size: "1.25rem" })
434
1854
  }
435
1855
  ),
436
- /* @__PURE__ */ n(I, { onClick: k, title: "Kode", value: "code", children: /* @__PURE__ */ n(Ve, { size: "1.25rem" }) }),
437
- /* @__PURE__ */ n(
438
- I,
1856
+ /* @__PURE__ */ _(he, { onClick: h, title: "Kode", value: "code", children: /* @__PURE__ */ _(fo, { size: "1.25rem" }) }),
1857
+ /* @__PURE__ */ _(
1858
+ he,
439
1859
  {
440
- onClick: S,
1860
+ onClick: x,
441
1861
  title: "Superscript",
442
1862
  value: "superscript",
443
- children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
1863
+ children: /* @__PURE__ */ _(Mo, { size: "1.25rem" })
444
1864
  }
445
1865
  )
446
1866
  ]
447
1867
  }
448
1868
  );
449
- }, Mr = ({ children: t }) => {
450
- const { hasFocus: e, editorRef: r } = at(), o = e, [i, l] = b(o);
451
- Me(() => {
452
- l(o);
453
- }, [o]);
454
- const { context: a, refs: s, floatingStyles: d } = ot({
1869
+ }, wo = ({ children: t }) => {
1870
+ const { hasFocus: e, editorRef: i } = mt(), d = e, [s, u] = Y(d);
1871
+ xn(() => {
1872
+ u(d);
1873
+ }, [d]);
1874
+ const { context: l, refs: c, floatingStyles: o } = ht({
455
1875
  placement: "top",
456
- whileElementsMounted: zt,
1876
+ whileElementsMounted: yr,
457
1877
  middleware: [
458
- ze({
459
- apply: ({ rects: f, elements: u }) => {
460
- u.floating.style.minWidth = `${f.reference.width}px`;
1878
+ Mn({
1879
+ apply: ({ rects: r, elements: a }) => {
1880
+ a.floating.style.minWidth = `${r.reference.width}px`;
461
1881
  }
462
1882
  }),
463
- Oe(),
464
- Ot({
1883
+ Rn(),
1884
+ Mr({
465
1885
  mainAxis: 8
466
1886
  }),
467
- $e({
1887
+ bn({
468
1888
  padding: 8
469
1889
  })
470
1890
  ],
471
- open: i,
472
- onOpenChange: l,
1891
+ open: s,
1892
+ onOpenChange: u,
473
1893
  elements: {
474
- reference: r.current
1894
+ reference: i.current
475
1895
  }
476
- }), { getFloatingProps: c } = $t([
477
- At(a, {
1896
+ }), { getFloatingProps: n } = Rr([
1897
+ br(l, {
478
1898
  role: "dialog"
479
1899
  })
480
1900
  ]);
481
- return i ? /* @__PURE__ */ n(Bt, { children: /* @__PURE__ */ n(
482
- Rt,
1901
+ return s ? /* @__PURE__ */ _(Sr, { children: /* @__PURE__ */ _(
1902
+ vr,
483
1903
  {
484
- ref: s.setFloating,
485
- style: d,
486
- ...c,
1904
+ ref: c.setFloating,
1905
+ style: o,
1906
+ ...n,
487
1907
  css: {
488
1908
  border: "1px solid $border",
489
1909
  borderRadius: "$md",
490
1910
  overflow: "hidden",
491
1911
  boxShadow: "$md"
492
1912
  },
493
- children: /* @__PURE__ */ n(Cr, { children: t })
1913
+ children: /* @__PURE__ */ _(Ao, { children: t })
494
1914
  }
495
1915
  ) }) : null;
496
- }, Cr = ({
1916
+ }, Ao = ({
497
1917
  children: t,
498
1918
  ...e
499
- }) => /* @__PURE__ */ g(Ce, { "aria-label": "Formattering", ...e, children: [
500
- /* @__PURE__ */ n(br, {}),
501
- /* @__PURE__ */ n(Te, {}),
502
- /* @__PURE__ */ n(vr, {}),
1919
+ }) => /* @__PURE__ */ K(Cn, { "aria-label": "Formattering", ...e, children: [
1920
+ /* @__PURE__ */ _($o, {}),
1921
+ /* @__PURE__ */ _(En, {}),
1922
+ /* @__PURE__ */ _(Do, {}),
503
1923
  t
504
1924
  ] });
505
- function Tr() {
506
- const [t] = y();
507
- return x(() => it(
1925
+ var rt = {}, Wt;
1926
+ function Po() {
1927
+ if (Wt)
1928
+ return rt;
1929
+ Wt = 1;
1930
+ var t = cr, e = P, i = q, d = z, s = W;
1931
+ function u(c) {
1932
+ i.useEffect(() => d.mergeRegister(c.registerCommand(t.INSERT_ORDERED_LIST_COMMAND, () => (t.insertList(c, "number"), !0), s.COMMAND_PRIORITY_LOW), c.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND, () => (t.insertList(c, "bullet"), !0), s.COMMAND_PRIORITY_LOW), c.registerCommand(t.REMOVE_LIST_COMMAND, () => (t.removeList(c), !0), s.COMMAND_PRIORITY_LOW), c.registerCommand(s.INSERT_PARAGRAPH_COMMAND, () => !!t.$handleListInsertParagraph(), s.COMMAND_PRIORITY_LOW)), [c]);
1933
+ }
1934
+ function l() {
1935
+ const [c] = e.useLexicalComposerContext();
1936
+ return i.useEffect(() => {
1937
+ if (!c.hasNodes([t.ListNode, t.ListItemNode]))
1938
+ throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
1939
+ }, [c]), u(c), null;
1940
+ }
1941
+ return rt.ListPlugin = l, rt;
1942
+ }
1943
+ var nt = {}, jt;
1944
+ function Io() {
1945
+ if (jt)
1946
+ return nt;
1947
+ jt = 1;
1948
+ var t = cr, e = P, i = q, d = z, s = W;
1949
+ function u(l) {
1950
+ i.useEffect(() => d.mergeRegister(l.registerCommand(t.INSERT_ORDERED_LIST_COMMAND, () => (t.insertList(l, "number"), !0), s.COMMAND_PRIORITY_LOW), l.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND, () => (t.insertList(l, "bullet"), !0), s.COMMAND_PRIORITY_LOW), l.registerCommand(t.REMOVE_LIST_COMMAND, () => (t.removeList(l), !0), s.COMMAND_PRIORITY_LOW), l.registerCommand(s.INSERT_PARAGRAPH_COMMAND, () => !!t.$handleListInsertParagraph(), s.COMMAND_PRIORITY_LOW)), [l]);
1951
+ }
1952
+ return nt.ListPlugin = function() {
1953
+ let [l] = e.useLexicalComposerContext();
1954
+ return i.useEffect(() => {
1955
+ if (!l.hasNodes([t.ListNode, t.ListItemNode]))
1956
+ throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
1957
+ }, [l]), u(l), null;
1958
+ }, nt;
1959
+ }
1960
+ const Bo = process.env.NODE_ENV === "development" ? Po() : Io();
1961
+ var Ho = Bo, Me = {}, Re = {}, Yt;
1962
+ function Fo() {
1963
+ if (Yt)
1964
+ return Re;
1965
+ Yt = 1;
1966
+ var t = z, e = W;
1967
+ const i = 0, d = 1, s = 2, u = 0, l = 1, c = 2, o = 3, n = 4;
1968
+ function r(E, T, M) {
1969
+ const b = E._nodeMap, m = [];
1970
+ for (const v of T) {
1971
+ const N = b.get(v);
1972
+ N !== void 0 && m.push(N);
1973
+ }
1974
+ for (const [v, N] of M) {
1975
+ if (!N)
1976
+ continue;
1977
+ const y = b.get(v);
1978
+ y !== void 0 && !e.$isRootNode(y) && m.push(y);
1979
+ }
1980
+ return m;
1981
+ }
1982
+ function a(E, T, M, b, m) {
1983
+ if (E === null || M.size === 0 && b.size === 0 && !m)
1984
+ return u;
1985
+ const v = T._selection, N = E._selection;
1986
+ if (m)
1987
+ return l;
1988
+ if (!e.$isRangeSelection(v) || !e.$isRangeSelection(N) || !N.isCollapsed() || !v.isCollapsed())
1989
+ return u;
1990
+ const y = r(T, M, b);
1991
+ if (y.length === 0)
1992
+ return u;
1993
+ if (y.length > 1) {
1994
+ const j = T._nodeMap, U = j.get(v.anchor.key), V = j.get(N.anchor.key);
1995
+ return U && V && !E._nodeMap.has(U.__key) && e.$isTextNode(U) && U.__text.length === 1 && v.anchor.offset === 1 ? c : u;
1996
+ }
1997
+ const R = y[0], S = E._nodeMap.get(R.__key);
1998
+ if (!e.$isTextNode(S) || !e.$isTextNode(R) || S.__mode !== R.__mode)
1999
+ return u;
2000
+ const O = S.__text, k = R.__text;
2001
+ if (O === k)
2002
+ return u;
2003
+ const $ = v.anchor, D = N.anchor;
2004
+ if ($.key !== D.key || $.type !== "text")
2005
+ return u;
2006
+ const w = $.offset, H = D.offset, A = k.length - O.length;
2007
+ return A === 1 && H === w - 1 ? c : A === -1 && H === w + 1 ? o : A === -1 && H === w ? n : u;
2008
+ }
2009
+ function g(E, T, M) {
2010
+ const b = T._nodeMap.get(E), m = M._nodeMap.get(E), v = T._selection, N = M._selection;
2011
+ let y = !1;
2012
+ return e.$isRangeSelection(v) && e.$isRangeSelection(N) && (y = v.anchor.type === "element" && v.focus.type === "element" && N.anchor.type === "text" && N.focus.type === "text"), !y && e.$isTextNode(b) && e.$isTextNode(m) ? b.__type === m.__type && b.__text === m.__text && b.__mode === m.__mode && b.__detail === m.__detail && b.__style === m.__style && b.__format === m.__format && b.__parent === m.__parent : !1;
2013
+ }
2014
+ function f(E, T) {
2015
+ let M = Date.now(), b = u;
2016
+ return (m, v, N, y, R, S) => {
2017
+ const O = Date.now();
2018
+ if (S.has("historic"))
2019
+ return b = u, M = O, s;
2020
+ const k = a(m, v, y, R, E.isComposing()), $ = (() => {
2021
+ const D = N === null || N.editor === E, w = S.has("history-push");
2022
+ if (!w && D && S.has("history-merge"))
2023
+ return i;
2024
+ if (m === null)
2025
+ return d;
2026
+ const A = v._selection;
2027
+ if (!(y.size > 0 || R.size > 0))
2028
+ return A !== null ? i : s;
2029
+ if (w === !1 && k !== u && k === b && O < M + T && D)
2030
+ return i;
2031
+ if (y.size === 1) {
2032
+ const U = Array.from(y)[0];
2033
+ if (g(U, m, v))
2034
+ return i;
2035
+ }
2036
+ return d;
2037
+ })();
2038
+ return M = O, b = k, $;
2039
+ };
2040
+ }
2041
+ function p(E, T) {
2042
+ const M = T.redoStack, b = T.undoStack;
2043
+ if (M.length !== 0) {
2044
+ const m = T.current;
2045
+ m !== null && (b.push(m), E.dispatchCommand(e.CAN_UNDO_COMMAND, !0));
2046
+ const v = M.pop();
2047
+ M.length === 0 && E.dispatchCommand(e.CAN_REDO_COMMAND, !1), T.current = v || null, v && v.editor.setEditorState(v.editorState, {
2048
+ tag: "historic"
2049
+ });
2050
+ }
2051
+ }
2052
+ function h(E, T) {
2053
+ const M = T.redoStack, b = T.undoStack;
2054
+ if (b.length !== 0) {
2055
+ const v = T.current, N = b.pop();
2056
+ v !== null && (M.push(v), E.dispatchCommand(e.CAN_REDO_COMMAND, !0)), b.length === 0 && E.dispatchCommand(e.CAN_UNDO_COMMAND, !1), T.current = N || null, N && N.editor.setEditorState(N.editorState, {
2057
+ tag: "historic"
2058
+ });
2059
+ }
2060
+ }
2061
+ function x(E) {
2062
+ E.undoStack = [], E.redoStack = [], E.current = null;
2063
+ }
2064
+ function C(E, T, M) {
2065
+ const b = f(E, M), m = ({
2066
+ editorState: y,
2067
+ prevEditorState: R,
2068
+ dirtyLeaves: S,
2069
+ dirtyElements: O,
2070
+ tags: k
2071
+ }) => {
2072
+ const $ = T.current, D = T.redoStack, w = T.undoStack, H = $ === null ? null : $.editorState;
2073
+ if ($ !== null && y === H)
2074
+ return;
2075
+ const A = b(R, y, $, S, O, k);
2076
+ if (A === d)
2077
+ D.length !== 0 && (T.redoStack = [], E.dispatchCommand(e.CAN_REDO_COMMAND, !1)), $ !== null && (w.push({
2078
+ ...$
2079
+ }), E.dispatchCommand(e.CAN_UNDO_COMMAND, !0));
2080
+ else if (A === s)
2081
+ return;
2082
+ T.current = {
2083
+ editor: E,
2084
+ editorState: y
2085
+ };
2086
+ }, v = t.mergeRegister(E.registerCommand(e.UNDO_COMMAND, () => (h(E, T), !0), e.COMMAND_PRIORITY_EDITOR), E.registerCommand(e.REDO_COMMAND, () => (p(E, T), !0), e.COMMAND_PRIORITY_EDITOR), E.registerCommand(e.CLEAR_EDITOR_COMMAND, () => (x(T), !1), e.COMMAND_PRIORITY_EDITOR), E.registerCommand(e.CLEAR_HISTORY_COMMAND, () => (x(T), E.dispatchCommand(e.CAN_REDO_COMMAND, !1), E.dispatchCommand(e.CAN_UNDO_COMMAND, !1), !0), e.COMMAND_PRIORITY_EDITOR), E.registerUpdateListener(m)), N = E.registerUpdateListener(m);
2087
+ return () => {
2088
+ v(), N();
2089
+ };
2090
+ }
2091
+ function L() {
2092
+ return {
2093
+ current: null,
2094
+ redoStack: [],
2095
+ undoStack: []
2096
+ };
2097
+ }
2098
+ return Re.createEmptyHistoryState = L, Re.registerHistory = C, Re;
2099
+ }
2100
+ var be = {}, Vt;
2101
+ function zo() {
2102
+ if (Vt)
2103
+ return be;
2104
+ Vt = 1;
2105
+ var t = z, e = W;
2106
+ function i(s, u, l, c, o) {
2107
+ if (s === null || l.size === 0 && c.size === 0 && !o)
2108
+ return 0;
2109
+ var n = u._selection, r = s._selection;
2110
+ if (o)
2111
+ return 1;
2112
+ if (!(e.$isRangeSelection(n) && e.$isRangeSelection(r) && r.isCollapsed() && n.isCollapsed()))
2113
+ return 0;
2114
+ o = u._nodeMap;
2115
+ let a = [];
2116
+ for (let g of l)
2117
+ l = o.get(g), l !== void 0 && a.push(l);
2118
+ for (let [g, f] of c)
2119
+ f && (c = o.get(g), c === void 0 || e.$isRootNode(c) || a.push(c));
2120
+ return a.length === 0 ? 0 : 1 < a.length ? (c = u._nodeMap, u = c.get(n.anchor.key), r = c.get(r.anchor.key), u && r && !s._nodeMap.has(u.__key) && e.$isTextNode(u) && u.__text.length === 1 && n.anchor.offset === 1 ? 2 : 0) : (u = a[0], s = s._nodeMap.get(u.__key), !e.$isTextNode(s) || !e.$isTextNode(u) || s.__mode !== u.__mode || (s = s.__text, u = u.__text, s === u) || (n = n.anchor, r = r.anchor, n.key !== r.key || n.type !== "text") ? 0 : (n = n.offset, r = r.offset, s = u.length - s.length, s === 1 && r === n - 1 ? 2 : s === -1 && r === n + 1 ? 3 : s === -1 && r === n ? 4 : 0));
2121
+ }
2122
+ function d(s, u) {
2123
+ let l = Date.now(), c = 0;
2124
+ return (o, n, r, a, g, f) => {
2125
+ let p = Date.now();
2126
+ if (f.has("historic"))
2127
+ return c = 0, l = p, 2;
2128
+ let h = i(o, n, a, g, s.isComposing()), x = (() => {
2129
+ var C = r === null || r.editor === s, L = f.has("history-push");
2130
+ if (!L && C && f.has("history-merge"))
2131
+ return 0;
2132
+ if (o === null)
2133
+ return 1;
2134
+ var E = n._selection;
2135
+ if (!(0 < a.size || 0 < g.size))
2136
+ return E !== null ? 0 : 2;
2137
+ if (L === !1 && h !== 0 && h === c && p < l + u && C)
2138
+ return 0;
2139
+ if (a.size === 1) {
2140
+ {
2141
+ L = Array.from(a)[0], C = o._nodeMap.get(L), L = n._nodeMap.get(L), E = o._selection;
2142
+ let T = n._selection, M = !1;
2143
+ e.$isRangeSelection(E) && e.$isRangeSelection(T) && (M = E.anchor.type === "element" && E.focus.type === "element" && T.anchor.type === "text" && T.focus.type === "text"), C = !M && e.$isTextNode(C) && e.$isTextNode(L) ? C.__type === L.__type && C.__text === L.__text && C.__mode === L.__mode && C.__detail === L.__detail && C.__style === L.__style && C.__format === L.__format && C.__parent === L.__parent : !1;
2144
+ }
2145
+ if (C)
2146
+ return 0;
2147
+ }
2148
+ return 1;
2149
+ })();
2150
+ return l = p, c = h, x;
2151
+ };
2152
+ }
2153
+ return be.createEmptyHistoryState = function() {
2154
+ return { current: null, redoStack: [], undoStack: [] };
2155
+ }, be.registerHistory = function(s, u, l) {
2156
+ let c = d(s, l);
2157
+ l = ({ editorState: r, prevEditorState: a, dirtyLeaves: g, dirtyElements: f, tags: p }) => {
2158
+ const h = u.current, x = u.redoStack, C = u.undoStack, L = h === null ? null : h.editorState;
2159
+ if (h === null || r !== L) {
2160
+ if (a = c(a, r, h, g, f, p), a === 1)
2161
+ x.length !== 0 && (u.redoStack = [], s.dispatchCommand(e.CAN_REDO_COMMAND, !1)), h !== null && (C.push({ ...h }), s.dispatchCommand(e.CAN_UNDO_COMMAND, !0));
2162
+ else if (a === 2)
2163
+ return;
2164
+ u.current = { editor: s, editorState: r };
2165
+ }
2166
+ };
2167
+ let o = t.mergeRegister(s.registerCommand(
2168
+ e.UNDO_COMMAND,
2169
+ () => {
2170
+ let r = u.redoStack, a = u.undoStack;
2171
+ if (a.length !== 0) {
2172
+ let g = u.current, f = a.pop();
2173
+ g !== null && (r.push(g), s.dispatchCommand(e.CAN_REDO_COMMAND, !0)), a.length === 0 && s.dispatchCommand(e.CAN_UNDO_COMMAND, !1), u.current = f || null, f && f.editor.setEditorState(f.editorState, { tag: "historic" });
2174
+ }
2175
+ return !0;
2176
+ },
2177
+ e.COMMAND_PRIORITY_EDITOR
2178
+ ), s.registerCommand(e.REDO_COMMAND, () => {
2179
+ let r = u.redoStack;
2180
+ var a = u.undoStack;
2181
+ if (r.length !== 0) {
2182
+ let g = u.current;
2183
+ g !== null && (a.push(g), s.dispatchCommand(e.CAN_UNDO_COMMAND, !0)), a = r.pop(), r.length === 0 && s.dispatchCommand(e.CAN_REDO_COMMAND, !1), u.current = a || null, a && a.editor.setEditorState(a.editorState, { tag: "historic" });
2184
+ }
2185
+ return !0;
2186
+ }, e.COMMAND_PRIORITY_EDITOR), s.registerCommand(e.CLEAR_EDITOR_COMMAND, () => (u.undoStack = [], u.redoStack = [], u.current = null, !1), e.COMMAND_PRIORITY_EDITOR), s.registerCommand(e.CLEAR_HISTORY_COMMAND, () => (u.undoStack = [], u.redoStack = [], u.current = null, s.dispatchCommand(e.CAN_REDO_COMMAND, !1), s.dispatchCommand(e.CAN_UNDO_COMMAND, !1), !0), e.COMMAND_PRIORITY_EDITOR), s.registerUpdateListener(l)), n = s.registerUpdateListener(l);
2187
+ return () => {
2188
+ o(), n();
2189
+ };
2190
+ }, be;
2191
+ }
2192
+ var ot, Gt;
2193
+ function Ir() {
2194
+ return Gt || (Gt = 1, ot = process.env.NODE_ENV === "development" ? Fo() : zo()), ot;
2195
+ }
2196
+ var Jt;
2197
+ function qo() {
2198
+ if (Jt)
2199
+ return Me;
2200
+ Jt = 1;
2201
+ var t = P, e = Ir(), i = q;
2202
+ function d(u, l, c = 1e3) {
2203
+ const o = i.useMemo(() => l || e.createEmptyHistoryState(), [l]);
2204
+ i.useEffect(() => e.registerHistory(u, o, c), [c, u, o]);
2205
+ }
2206
+ function s({
2207
+ externalHistoryState: u
2208
+ }) {
2209
+ const [l] = t.useLexicalComposerContext();
2210
+ return d(l, u), null;
2211
+ }
2212
+ return Me.createEmptyHistoryState = e.createEmptyHistoryState, Me.HistoryPlugin = s, Me;
2213
+ }
2214
+ var Se = {}, Xt;
2215
+ function Uo() {
2216
+ if (Xt)
2217
+ return Se;
2218
+ Xt = 1;
2219
+ var t = P, e = Ir(), i = q;
2220
+ function d(s, u, l = 1e3) {
2221
+ let c = i.useMemo(() => u || e.createEmptyHistoryState(), [u]);
2222
+ i.useEffect(() => e.registerHistory(s, c, l), [l, s, c]);
2223
+ }
2224
+ return Se.createEmptyHistoryState = e.createEmptyHistoryState, Se.HistoryPlugin = function({ externalHistoryState: s }) {
2225
+ let [u] = t.useLexicalComposerContext();
2226
+ return d(u, s), null;
2227
+ }, Se;
2228
+ }
2229
+ const Ko = process.env.NODE_ENV === "development" ? qo() : Uo();
2230
+ var Wo = Ko, it = {}, Qt;
2231
+ function jo() {
2232
+ if (Qt)
2233
+ return it;
2234
+ Qt = 1;
2235
+ var t = P, e = hr, i = z, d = W, s = q;
2236
+ function u({
2237
+ hasCellMerge: l = !0,
2238
+ hasCellBackgroundColor: c = !0,
2239
+ hasTabHandler: o = !0
2240
+ }) {
2241
+ const [n] = t.useLexicalComposerContext();
2242
+ return s.useEffect(() => {
2243
+ if (!n.hasNodes([e.TableNode, e.TableCellNode, e.TableRowNode]))
2244
+ throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");
2245
+ return n.registerCommand(e.INSERT_TABLE_COMMAND, ({
2246
+ columns: r,
2247
+ rows: a,
2248
+ includeHeaders: g
2249
+ }) => {
2250
+ const f = e.$createTableNodeWithDimensions(Number(a), Number(r), g);
2251
+ i.$insertNodeToNearestRoot(f);
2252
+ const p = f.getFirstDescendant();
2253
+ return d.$isTextNode(p) && p.select(), !0;
2254
+ }, d.COMMAND_PRIORITY_EDITOR);
2255
+ }, [n]), s.useEffect(() => {
2256
+ const r = /* @__PURE__ */ new Map(), a = (f) => {
2257
+ const p = f.getKey(), h = n.getElementByKey(p);
2258
+ if (h && !r.has(p)) {
2259
+ const x = e.applyTableHandlers(f, h, n, o);
2260
+ r.set(p, x);
2261
+ }
2262
+ };
2263
+ n.getEditorState().read(() => {
2264
+ const f = d.$nodesOfType(e.TableNode);
2265
+ for (const p of f)
2266
+ e.$isTableNode(p) && a(p);
2267
+ });
2268
+ const g = n.registerMutationListener(e.TableNode, (f) => {
2269
+ for (const [p, h] of f)
2270
+ if (h === "created")
2271
+ n.getEditorState().read(() => {
2272
+ const x = d.$getNodeByKey(p);
2273
+ e.$isTableNode(x) && a(x);
2274
+ });
2275
+ else if (h === "destroyed") {
2276
+ const x = r.get(p);
2277
+ x !== void 0 && (x.removeListeners(), r.delete(p));
2278
+ }
2279
+ });
2280
+ return () => {
2281
+ g();
2282
+ for (const [, f] of r)
2283
+ f.removeListeners();
2284
+ };
2285
+ }, [n, o]), s.useEffect(() => {
2286
+ if (!l)
2287
+ return n.registerNodeTransform(e.TableCellNode, (r) => {
2288
+ if (r.getColSpan() > 1 || r.getRowSpan() > 1) {
2289
+ const [, , a] = d.DEPRECATED_$getNodeTriplet(r), [g] = d.DEPRECATED_$computeGridMap(a, r, r), f = g.length, p = g[0].length;
2290
+ let h = a.getFirstChild();
2291
+ if (!d.DEPRECATED_$isGridRowNode(h))
2292
+ throw Error("Expected TableNode first child to be a RowNode");
2293
+ const x = [];
2294
+ for (let C = 0; C < f; C++) {
2295
+ if (C !== 0 && (h = h.getNextSibling(), !d.DEPRECATED_$isGridRowNode(h)))
2296
+ throw Error("Expected TableNode first child to be a RowNode");
2297
+ let L = null;
2298
+ for (let E = 0; E < p; E++) {
2299
+ const T = g[C][E], M = T.cell;
2300
+ if (T.startRow === C && T.startColumn === E)
2301
+ L = M, x.push(M);
2302
+ else if (M.getColSpan() > 1 || M.getRowSpan() > 1) {
2303
+ if (!e.$isTableCellNode(M))
2304
+ throw Error("Expected TableNode cell to be a TableCellNode");
2305
+ const b = e.$createTableCellNode(M.__headerState);
2306
+ L !== null ? L.insertAfter(b) : i.$insertFirst(h, b);
2307
+ }
2308
+ }
2309
+ }
2310
+ for (const C of x)
2311
+ C.setColSpan(1), C.setRowSpan(1);
2312
+ }
2313
+ });
2314
+ }, [n, l]), s.useEffect(() => {
2315
+ if (!c)
2316
+ return n.registerNodeTransform(e.TableCellNode, (r) => {
2317
+ r.getBackgroundColor() !== null && r.setBackgroundColor(null);
2318
+ });
2319
+ }, [n, c, l]), null;
2320
+ }
2321
+ return it.TablePlugin = u, it;
2322
+ }
2323
+ var lt = {}, Zt;
2324
+ function Yo() {
2325
+ if (Zt)
2326
+ return lt;
2327
+ Zt = 1;
2328
+ var t = P, e = hr, i = z, d = W, s = q;
2329
+ function u(l) {
2330
+ let c = new URLSearchParams();
2331
+ c.append("code", l);
2332
+ for (let o = 1; o < arguments.length; o++)
2333
+ c.append("v", arguments[o]);
2334
+ throw Error(`Minified Lexical error #${l}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
2335
+ }
2336
+ return lt.TablePlugin = function({ hasCellMerge: l = !0, hasCellBackgroundColor: c = !0, hasTabHandler: o = !0 }) {
2337
+ let [n] = t.useLexicalComposerContext();
2338
+ return s.useEffect(() => (n.hasNodes([e.TableNode, e.TableCellNode, e.TableRowNode]) || u(10), n.registerCommand(e.INSERT_TABLE_COMMAND, ({ columns: r, rows: a, includeHeaders: g }) => (r = e.$createTableNodeWithDimensions(Number(a), Number(r), g), i.$insertNodeToNearestRoot(r), r = r.getFirstDescendant(), d.$isTextNode(r) && r.select(), !0), d.COMMAND_PRIORITY_EDITOR)), [n]), s.useEffect(
2339
+ () => {
2340
+ let r = /* @__PURE__ */ new Map(), a = (f) => {
2341
+ const p = f.getKey(), h = n.getElementByKey(p);
2342
+ h && !r.has(p) && (f = e.applyTableHandlers(f, h, n, o), r.set(p, f));
2343
+ };
2344
+ n.getEditorState().read(() => {
2345
+ let f = d.$nodesOfType(e.TableNode);
2346
+ for (let p of f)
2347
+ e.$isTableNode(p) && a(p);
2348
+ });
2349
+ let g = n.registerMutationListener(e.TableNode, (f) => {
2350
+ for (const [p, h] of f)
2351
+ h === "created" ? n.getEditorState().read(() => {
2352
+ const x = d.$getNodeByKey(p);
2353
+ e.$isTableNode(x) && a(x);
2354
+ }) : h === "destroyed" && (f = r.get(p), f !== void 0 && (f.removeListeners(), r.delete(p)));
2355
+ });
2356
+ return () => {
2357
+ g();
2358
+ for (let [, f] of r)
2359
+ f.removeListeners();
2360
+ };
2361
+ },
2362
+ [n, o]
2363
+ ), s.useEffect(() => {
2364
+ if (!l)
2365
+ return n.registerNodeTransform(e.TableCellNode, (r) => {
2366
+ if (1 < r.getColSpan() || 1 < r.getRowSpan()) {
2367
+ var [, , a] = d.DEPRECATED_$getNodeTriplet(r);
2368
+ [r] = d.DEPRECATED_$computeGridMap(a, r, r);
2369
+ let f = r.length, p = r[0].length;
2370
+ if (a = a.getFirstChild(), !d.DEPRECATED_$isGridRowNode(a))
2371
+ throw Error("Expected TableNode first child to be a RowNode");
2372
+ let h = [];
2373
+ for (let x = 0; x < f; x++) {
2374
+ if (x !== 0 && (a = a.getNextSibling(), !d.DEPRECATED_$isGridRowNode(a)))
2375
+ throw Error("Expected TableNode first child to be a RowNode");
2376
+ let C = null;
2377
+ for (let L = 0; L < p; L++) {
2378
+ var g = r[x][L];
2379
+ let E = g.cell;
2380
+ if (g.startRow === x && g.startColumn === L)
2381
+ C = E, h.push(E);
2382
+ else if (1 < E.getColSpan() || 1 < E.getRowSpan()) {
2383
+ if (!e.$isTableCellNode(E))
2384
+ throw Error("Expected TableNode cell to be a TableCellNode");
2385
+ g = e.$createTableCellNode(E.__headerState), C !== null ? C.insertAfter(g) : i.$insertFirst(a, g);
2386
+ }
2387
+ }
2388
+ }
2389
+ for (let x of h)
2390
+ x.setColSpan(1), x.setRowSpan(1);
2391
+ }
2392
+ });
2393
+ }, [n, l]), s.useEffect(
2394
+ () => {
2395
+ if (!c)
2396
+ return n.registerNodeTransform(e.TableCellNode, (r) => {
2397
+ r.getBackgroundColor() !== null && r.setBackgroundColor(null);
2398
+ });
2399
+ },
2400
+ [n, c, l]
2401
+ ), null;
2402
+ }, lt;
2403
+ }
2404
+ const Vo = process.env.NODE_ENV === "development" ? jo() : Yo();
2405
+ var Go = Vo, ke = {}, er;
2406
+ function Jo() {
2407
+ if (er)
2408
+ return ke;
2409
+ er = 1;
2410
+ var t = P, e = z, i = W, d = q;
2411
+ function s(c) {
2412
+ const o = c.getNodes();
2413
+ if (e.$filter(o, (h) => i.$isBlockElementNode(h) && h.canIndent() ? h : null).length > 0)
2414
+ return !0;
2415
+ const r = c.anchor, a = c.focus, g = a.isBefore(r) ? a : r, f = g.getNode(), p = e.$getNearestBlockElementAncestorOrThrow(f);
2416
+ if (p.canIndent()) {
2417
+ const h = p.getKey();
2418
+ let x = i.$createRangeSelection();
2419
+ if (x.anchor.set(h, 0, "element"), x.focus.set(h, 0, "element"), x = i.$normalizeSelection__EXPERIMENTAL(x), x.anchor.is(g))
2420
+ return !0;
2421
+ }
2422
+ return !1;
2423
+ }
2424
+ function u(c) {
2425
+ return c.registerCommand(i.KEY_TAB_COMMAND, (o) => {
2426
+ const n = i.$getSelection();
2427
+ if (!i.$isRangeSelection(n))
2428
+ return !1;
2429
+ o.preventDefault();
2430
+ const r = s(n) ? o.shiftKey ? i.OUTDENT_CONTENT_COMMAND : i.INDENT_CONTENT_COMMAND : i.INSERT_TAB_COMMAND;
2431
+ return c.dispatchCommand(r, void 0);
2432
+ }, i.COMMAND_PRIORITY_EDITOR);
2433
+ }
2434
+ function l() {
2435
+ const [c] = t.useLexicalComposerContext();
2436
+ return d.useEffect(() => u(c)), null;
2437
+ }
2438
+ return ke.TabIndentationPlugin = l, ke.registerTabIndentation = u, ke;
2439
+ }
2440
+ var Oe = {}, tr;
2441
+ function Xo() {
2442
+ if (tr)
2443
+ return Oe;
2444
+ tr = 1;
2445
+ var t = P, e = z, i = W, d = q;
2446
+ function s(l) {
2447
+ var c = l.getNodes();
2448
+ if (0 < e.$filter(c, (o) => i.$isBlockElementNode(o) && o.canIndent() ? o : null).length)
2449
+ return !0;
2450
+ if (c = l.anchor, l = l.focus, l = l.isBefore(c) ? l : c, c = l.getNode(), c = e.$getNearestBlockElementAncestorOrThrow(c), c.canIndent()) {
2451
+ c = c.getKey();
2452
+ let o = i.$createRangeSelection();
2453
+ if (o.anchor.set(c, 0, "element"), o.focus.set(c, 0, "element"), o = i.$normalizeSelection__EXPERIMENTAL(o), o.anchor.is(l))
2454
+ return !0;
2455
+ }
2456
+ return !1;
2457
+ }
2458
+ function u(l) {
2459
+ return l.registerCommand(i.KEY_TAB_COMMAND, (c) => {
2460
+ let o = i.$getSelection();
2461
+ return i.$isRangeSelection(o) ? (c.preventDefault(), c = s(o) ? c.shiftKey ? i.OUTDENT_CONTENT_COMMAND : i.INDENT_CONTENT_COMMAND : i.INSERT_TAB_COMMAND, l.dispatchCommand(c, void 0)) : !1;
2462
+ }, i.COMMAND_PRIORITY_EDITOR);
2463
+ }
2464
+ return Oe.TabIndentationPlugin = function() {
2465
+ let [l] = t.useLexicalComposerContext();
2466
+ return d.useEffect(() => u(l)), null;
2467
+ }, Oe.registerTabIndentation = u, Oe;
2468
+ }
2469
+ const Qo = process.env.NODE_ENV === "development" ? Jo() : Xo();
2470
+ var Zo = Qo;
2471
+ function ei() {
2472
+ const [t] = P.useLexicalComposerContext();
2473
+ return oe(() => z.mergeRegister(
508
2474
  t.registerCommand(
509
- Tt,
510
- () => (de(t, "check"), !0),
511
- E
2475
+ dr,
2476
+ () => (sn(t, "check"), !0),
2477
+ de
512
2478
  ),
513
2479
  t.registerCommand(
514
- Zt,
515
- (e) => kt(e, t, !1),
516
- E
2480
+ Gr,
2481
+ (e) => or(e, t, !1),
2482
+ de
517
2483
  ),
518
2484
  t.registerCommand(
519
- te,
520
- (e) => kt(e, t, !0),
521
- E
2485
+ Jr,
2486
+ (e) => or(e, t, !0),
2487
+ de
522
2488
  ),
523
2489
  t.registerCommand(
524
- vt,
2490
+ lr,
525
2491
  (e) => {
526
- if (X() != null) {
527
- const o = t.getRootElement();
528
- return o != null && o.focus(), !0;
2492
+ if (st() != null) {
2493
+ const d = t.getRootElement();
2494
+ return d != null && d.focus(), !0;
529
2495
  }
530
2496
  return !1;
531
2497
  },
532
- E
2498
+ de
533
2499
  ),
534
2500
  t.registerCommand(
535
- ee,
2501
+ Xr,
536
2502
  (e) => {
537
- const r = X();
538
- return r != null && t.isEditable() ? (t.update(() => {
539
- const o = V(r);
540
- O(o) && (e.preventDefault(), o.toggleChecked());
2503
+ const i = st();
2504
+ return i != null && t.isEditable() ? (t.update(() => {
2505
+ const d = ct(i);
2506
+ xe(d) && (e.preventDefault(), d.toggleChecked());
541
2507
  }), !0) : !1;
542
2508
  },
543
- E
2509
+ de
544
2510
  ),
545
2511
  t.registerCommand(
546
- re,
2512
+ Qr,
547
2513
  (e) => t.getEditorState().read(() => {
548
- const r = T();
549
- if (L(r) && r.isCollapsed()) {
550
- const { anchor: o } = r, i = o.type === "element";
551
- if (i || o.offset === 0) {
552
- const l = o.getNode(), a = Dt(
553
- l,
554
- (s) => ne(s) && !s.isInline()
2514
+ const i = ee();
2515
+ if (te(i) && i.isCollapsed()) {
2516
+ const { anchor: d } = i, s = d.type === "element";
2517
+ if (s || d.offset === 0) {
2518
+ const u = d.getNode(), l = z.$findMatchingParent(
2519
+ u,
2520
+ (c) => Zr(c) && !c.isInline()
555
2521
  );
556
- if (O(a)) {
557
- const s = a.getParent();
558
- if (et(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
559
- const d = t.getElementByKey(a.__key);
560
- if (d != null && document.activeElement !== d)
561
- return d.focus(), e.preventDefault(), !0;
2522
+ if (xe(l)) {
2523
+ const c = l.getParent();
2524
+ if (ft(c) && c.getListType() === "check" && (s || l.getFirstDescendant() === u)) {
2525
+ const o = t.getElementByKey(l.__key);
2526
+ if (o != null && document.activeElement !== o)
2527
+ return o.focus(), e.preventDefault(), !0;
562
2528
  }
563
2529
  }
564
2530
  }
565
2531
  }
566
2532
  return !1;
567
2533
  }),
568
- E
2534
+ de
569
2535
  ),
570
- t.registerRootListener((e, r) => {
571
- e !== null && (e.addEventListener("click", ft), e.addEventListener("pointerdown", mt)), r !== null && (r.removeEventListener("click", ft), r.removeEventListener("pointerdown", mt));
2536
+ t.registerRootListener((e, i) => {
2537
+ e !== null && (e.addEventListener("click", rr), e.addEventListener("pointerdown", nr)), i !== null && (i.removeEventListener("click", rr), i.removeEventListener("pointerdown", nr));
572
2538
  })
573
2539
  ), [t]), null;
574
2540
  }
575
- function Wt(t, e) {
576
- const r = t.target;
577
- if (r === null || !gt(r))
2541
+ function Br(t, e) {
2542
+ const i = t.target;
2543
+ if (i === null || !z.isHTMLElement(i))
578
2544
  return;
579
- const o = r.firstChild;
580
- if (o != null && gt(o) && (o.tagName === "UL" || o.tagName === "OL"))
2545
+ const d = i.firstChild;
2546
+ if (d != null && z.isHTMLElement(d) && (d.tagName === "UL" || d.tagName === "OL"))
581
2547
  return;
582
- const i = r.parentNode;
583
- if (!i || i.__lexicalListType !== "check")
2548
+ const s = i.parentNode;
2549
+ if (!s || s.__lexicalListType !== "check")
584
2550
  return;
585
- const l = t.pageX, a = r.getBoundingClientRect();
586
- (r.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && e();
2551
+ const u = t.pageX, l = i.getBoundingClientRect();
2552
+ (i.dir === "rtl" ? u < l.right && u > l.right - 20 : u > l.left && u < l.left + 20) && e();
587
2553
  }
588
- function ft(t) {
589
- Wt(t, () => {
590
- const e = t.target, r = Lr(e);
591
- r != null && r.isEditable() && r.update(() => {
2554
+ function rr(t) {
2555
+ Br(t, () => {
2556
+ const e = t.target, i = ti(e);
2557
+ i != null && i.isEditable() && i.update(() => {
592
2558
  if (t.target) {
593
- const o = V(e);
594
- O(o) && (e.focus(), o.toggleChecked());
2559
+ const d = ct(e);
2560
+ xe(d) && (e.focus(), d.toggleChecked());
595
2561
  }
596
2562
  });
597
2563
  });
598
2564
  }
599
- function mt(t) {
600
- Wt(t, () => {
2565
+ function nr(t) {
2566
+ Br(t, () => {
601
2567
  t.preventDefault();
602
2568
  });
603
2569
  }
604
- function Lr(t) {
2570
+ function ti(t) {
605
2571
  let e = t;
606
2572
  for (; e; ) {
607
2573
  if (e.__lexicalEditor)
@@ -610,67 +2576,67 @@ function Lr(t) {
610
2576
  }
611
2577
  return null;
612
2578
  }
613
- function X() {
2579
+ function st() {
614
2580
  const t = document.activeElement;
615
2581
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
616
2582
  t.parentNode.__lexicalListType === "check" ? t : null;
617
2583
  }
618
- function xr(t, e) {
619
- let r = e ? t.getPreviousSibling() : t.getNextSibling(), o = t;
620
- for (; r == null && O(o); )
621
- o = o.getParentOrThrow().getParent(), o != null && (r = e ? o.getPreviousSibling() : o.getNextSibling());
622
- for (; O(r); ) {
623
- const i = e ? r.getLastChild() : r.getFirstChild();
624
- if (!et(i))
625
- return r;
626
- r = e ? i.getLastChild() : i.getFirstChild();
2584
+ function ri(t, e) {
2585
+ let i = e ? t.getPreviousSibling() : t.getNextSibling(), d = t;
2586
+ for (; i == null && xe(d); )
2587
+ d = d.getParentOrThrow().getParent(), d != null && (i = e ? d.getPreviousSibling() : d.getNextSibling());
2588
+ for (; xe(i); ) {
2589
+ const s = e ? i.getLastChild() : i.getFirstChild();
2590
+ if (!ft(s))
2591
+ return i;
2592
+ i = e ? s.getLastChild() : s.getFirstChild();
627
2593
  }
628
2594
  return null;
629
2595
  }
630
- function kt(t, e, r) {
631
- const o = X();
632
- return o != null && e.update(() => {
633
- const i = V(o);
634
- if (!O(i))
2596
+ function or(t, e, i) {
2597
+ const d = st();
2598
+ return d != null && e.update(() => {
2599
+ const s = ct(d);
2600
+ if (!xe(s))
635
2601
  return;
636
- const l = xr(i, r);
637
- if (l != null) {
638
- l.selectStart();
639
- const a = e.getElementByKey(l.__key);
640
- a != null && (t.preventDefault(), setTimeout(() => {
641
- a.focus();
2602
+ const u = ri(s, i);
2603
+ if (u != null) {
2604
+ u.selectStart();
2605
+ const l = e.getElementByKey(u.__key);
2606
+ l != null && (t.preventDefault(), setTimeout(() => {
2607
+ l.focus();
642
2608
  }, 0));
643
2609
  }
644
2610
  }), !1;
645
2611
  }
646
- const yr = () => /* @__PURE__ */ g(Y, { children: [
647
- /* @__PURE__ */ n(He, {}),
648
- /* @__PURE__ */ n(We, {}),
649
- /* @__PURE__ */ n(Ue, {}),
650
- /* @__PURE__ */ n(Tr, {}),
651
- /* @__PURE__ */ n(je, {})
652
- ] }), Nr = ({
2612
+ const ni = () => /* @__PURE__ */ K(Ie, { children: [
2613
+ /* @__PURE__ */ _(Ho.ListPlugin, {}),
2614
+ /* @__PURE__ */ _(Go.TablePlugin, {}),
2615
+ /* @__PURE__ */ _(Wo.HistoryPlugin, {}),
2616
+ /* @__PURE__ */ _(ei, {}),
2617
+ /* @__PURE__ */ _(Zo.TabIndentationPlugin, {})
2618
+ ] }), oi = ({
653
2619
  state: t
654
2620
  }) => {
655
- const [e] = y();
656
- return x(() => {
2621
+ const [e] = P.useLexicalComposerContext();
2622
+ return oe(() => {
657
2623
  if (t)
658
2624
  try {
659
- if (Ye(t)) {
660
- t.isEmpty() ? Ge(e) : e.setEditorState(t);
2625
+ if (Pn(t)) {
2626
+ t.isEmpty() ? In(e) : e.setEditorState(t);
661
2627
  return;
662
2628
  }
663
- if (typeof t == "string" && !Ft(t)) {
664
- Je(t, e);
2629
+ if (typeof t == "string" && !Or(t)) {
2630
+ Bn(t, e);
665
2631
  return;
666
2632
  }
667
- const r = e.parseEditorState(t);
668
- r.isEmpty() || e.setEditorState(r);
669
- } catch (r) {
670
- console.error("Could not parse"), console.error(r);
2633
+ const i = e.parseEditorState(t);
2634
+ i.isEmpty() || e.setEditorState(i);
2635
+ } catch (i) {
2636
+ console.error("Could not parse"), console.error(i);
671
2637
  }
672
2638
  }, []), null;
673
- }, Sr = Le("div", {
2639
+ }, ii = Nn("div", {
674
2640
  border: "1px solid $borderDarker",
675
2641
  borderRadius: "$md",
676
2642
  position: "relative",
@@ -707,10 +2673,10 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
707
2673
  }
708
2674
  }
709
2675
  ]
710
- }), wr = ({
2676
+ }), li = ({
711
2677
  isLoading: t
712
- }) => /* @__PURE__ */ n(
713
- P,
2678
+ }) => /* @__PURE__ */ _(
2679
+ _e,
714
2680
  {
715
2681
  css: {
716
2682
  visibility: t ? "visible" : "hidden",
@@ -719,52 +2685,52 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
719
2685
  right: "1rem",
720
2686
  display: "flex"
721
2687
  },
722
- children: /* @__PURE__ */ n(xe, {})
2688
+ children: /* @__PURE__ */ _(Tn, {})
723
2689
  }
724
- ), cn = ({
2690
+ ), Di = ({
725
2691
  isLoading: t,
726
2692
  children: e,
727
- placeholderText: r,
728
- nodes: o,
729
- plugins: i,
730
- toolbar: l,
731
- toolbarContent: a,
732
- content: s,
733
- hideBorder: d,
734
- onBlur: c,
735
- defaultState: f,
736
- css: u
2693
+ placeholderText: i,
2694
+ nodes: d,
2695
+ plugins: s,
2696
+ toolbar: u,
2697
+ toolbarContent: l,
2698
+ content: c,
2699
+ hideBorder: o,
2700
+ onBlur: n,
2701
+ defaultState: r,
2702
+ css: a
737
2703
  }) => {
738
- const { hasFocus: m, attributes: w } = Xe({ onBlur: c }), N = rt(null), k = wt(() => ({ hasFocus: m, editorRef: N }), [m]);
739
- return /* @__PURE__ */ n(Ht.Provider, { value: k, children: /* @__PURE__ */ g(
740
- Ee,
2704
+ const { hasFocus: g, attributes: f } = co({ onBlur: n }), p = gt(null), h = Er(() => ({ hasFocus: g, editorRef: p }), [g]);
2705
+ return /* @__PURE__ */ _(Ar.Provider, { value: h, children: /* @__PURE__ */ K(
2706
+ Wn.LexicalComposer,
741
2707
  {
742
2708
  initialConfig: {
743
2709
  namespace: "ain-rich-text",
744
- onError: (S) => {
745
- console.error(S);
2710
+ onError: (x) => {
2711
+ console.error(x);
746
2712
  },
747
- theme: Pt,
748
- nodes: o,
2713
+ theme: kr,
2714
+ nodes: d,
749
2715
  editable: !0
750
2716
  },
751
2717
  children: [
752
- /* @__PURE__ */ g(
753
- Sr,
2718
+ /* @__PURE__ */ K(
2719
+ ii,
754
2720
  {
755
- ref: N,
756
- hasFocus: m,
757
- hideBorder: d,
758
- css: u,
759
- ...w,
2721
+ ref: p,
2722
+ hasFocus: g,
2723
+ hideBorder: o,
2724
+ css: a,
2725
+ ...f,
760
2726
  children: [
761
- l,
762
- /* @__PURE__ */ n(
763
- _e,
2727
+ u,
2728
+ /* @__PURE__ */ _(
2729
+ oo.RichTextPlugin,
764
2730
  {
765
- contentEditable: s,
766
- placeholder: r ? /* @__PURE__ */ n(
767
- P,
2731
+ contentEditable: c,
2732
+ placeholder: i ? /* @__PURE__ */ _(
2733
+ _e,
768
2734
  {
769
2735
  css: {
770
2736
  position: "absolute",
@@ -774,25 +2740,25 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
774
2740
  pointerEvents: "none",
775
2741
  fontSize: "$sm"
776
2742
  },
777
- children: r
2743
+ children: i
778
2744
  }
779
2745
  ) : null,
780
- ErrorBoundary: Re
2746
+ ErrorBoundary: ao
781
2747
  }
782
2748
  ),
783
- /* @__PURE__ */ n(yr, {}),
784
- i,
785
- /* @__PURE__ */ n(wr, { isLoading: t }),
786
- !l && /* @__PURE__ */ n(Mr, { children: a })
2749
+ /* @__PURE__ */ _(ni, {}),
2750
+ s,
2751
+ /* @__PURE__ */ _(li, { isLoading: t }),
2752
+ !u && /* @__PURE__ */ _(wo, { children: l })
787
2753
  ]
788
2754
  }
789
2755
  ),
790
- /* @__PURE__ */ n(Nr, { state: f }),
791
- /* @__PURE__ */ n(Y, { children: e })
2756
+ /* @__PURE__ */ _(oi, { state: r }),
2757
+ /* @__PURE__ */ _(Ie, { children: e })
792
2758
  ]
793
2759
  }
794
2760
  ) });
795
- }, Er = {
2761
+ }, si = {
796
2762
  fontSize: "1rem",
797
2763
  lineHeight: "1.5",
798
2764
  "h1, h2, h3, h4, h5, h6": {
@@ -982,129 +2948,129 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
982
2948
  defaultVariants: {
983
2949
  size: "md"
984
2950
  }
985
- }, dn = Ae(Er), un = () => {
986
- const [t] = y(), e = v(() => {
987
- t.dispatchCommand(ge, {
2951
+ }, wi = Dn(si), Ai = () => {
2952
+ const [t] = P.useLexicalComposerContext(), e = J(() => {
2953
+ t.dispatchCommand(dn, {
988
2954
  rows: "3",
989
2955
  columns: "3",
990
2956
  includeHeaders: !1
991
2957
  });
992
2958
  }, [t]);
993
- return /* @__PURE__ */ n(
994
- nt,
2959
+ return /* @__PURE__ */ _(
2960
+ pt,
995
2961
  {
996
- trigger: /* @__PURE__ */ n(Et, { dropdown: !0, children: "Sett inn" }),
2962
+ trigger: /* @__PURE__ */ _(Nr, { dropdown: !0, children: "Sett inn" }),
997
2963
  side: "bottom",
998
2964
  align: "end",
999
- children: /* @__PURE__ */ g(C, { onClick: e, children: [
1000
- /* @__PURE__ */ n(pr, { size: "1.25rem" }),
2965
+ children: /* @__PURE__ */ K(Z, { onClick: e, children: [
2966
+ /* @__PURE__ */ _(Ro, { size: "1.25rem" }),
1001
2967
  " Tabell"
1002
2968
  ] })
1003
2969
  }
1004
2970
  );
1005
2971
  };
1006
- function _r(t) {
1007
- return h({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
2972
+ function ai(t) {
2973
+ return F({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
1008
2974
  }
1009
- const hn = () => {
1010
- const [t] = y(), [e, r] = b(null), { hasFocus: o } = at();
1011
- x(() => {
1012
- !o && e && r(null);
1013
- }, [o, e]);
1014
- const { refs: i, floatingStyles: l } = ot({
2975
+ const Pi = () => {
2976
+ const [t] = P.useLexicalComposerContext(), [e, i] = Y(null), { hasFocus: d } = mt();
2977
+ oe(() => {
2978
+ !d && e && i(null);
2979
+ }, [d, e]);
2980
+ const { refs: s, floatingStyles: u } = ht({
1015
2981
  placement: "top-end",
1016
2982
  open: !!e,
1017
2983
  elements: {
1018
2984
  reference: e
1019
2985
  },
1020
- middleware: [Ot({ mainAxis: -20, crossAxis: -2 })]
2986
+ middleware: [Mr({ mainAxis: -20, crossAxis: -2 })]
1021
2987
  });
1022
- x(() => t.registerCommand(
1023
- F,
2988
+ oe(() => t.registerCommand(
2989
+ Le,
1024
2990
  () => {
1025
- const s = T();
1026
- if (L(s)) {
1027
- const d = s.anchor.getNode(), c = fe(d);
1028
- r(c ? t.getElementByKey(c.getKey()) : null);
2991
+ const c = ee();
2992
+ if (te(c)) {
2993
+ const o = c.anchor.getNode(), n = fn(o);
2994
+ i(n ? t.getElementByKey(n.getKey()) : null);
1029
2995
  }
1030
2996
  return !1;
1031
2997
  },
1032
- oe
2998
+ en
1033
2999
  ), [t]);
1034
- const a = (s) => () => {
3000
+ const l = (c) => () => {
1035
3001
  t.update(() => {
1036
- switch (s) {
3002
+ switch (c) {
1037
3003
  case "add-row-over":
1038
- ut(!1);
3004
+ _t(!1);
1039
3005
  break;
1040
3006
  case "add-row-under":
1041
- ut(!0);
3007
+ _t(!0);
1042
3008
  break;
1043
3009
  case "add-column-left":
1044
- dt(!1);
3010
+ vt(!1);
1045
3011
  break;
1046
3012
  case "add-column-right":
1047
- dt(!0);
3013
+ vt(!0);
1048
3014
  break;
1049
3015
  case "delete-row":
1050
- ke();
3016
+ pn();
1051
3017
  break;
1052
3018
  case "delete-column":
1053
- me();
3019
+ gn();
1054
3020
  break;
1055
3021
  }
1056
3022
  });
1057
3023
  };
1058
- return e ? /* @__PURE__ */ g(
1059
- nt,
3024
+ return e ? /* @__PURE__ */ K(
3025
+ pt,
1060
3026
  {
1061
- trigger: /* @__PURE__ */ n(
1062
- $,
3027
+ trigger: /* @__PURE__ */ _(
3028
+ Ce,
1063
3029
  {
1064
3030
  icon: !0,
1065
3031
  variant: "primary",
1066
3032
  color: "secondary",
1067
- ref: i.setFloating,
1068
- style: l,
3033
+ ref: s.setFloating,
3034
+ style: u,
1069
3035
  css: { padding: "2px", width: "18px", height: "18px" },
1070
- children: /* @__PURE__ */ n(_r, {})
3036
+ children: /* @__PURE__ */ _(ai, {})
1071
3037
  }
1072
3038
  ),
1073
3039
  children: [
1074
- /* @__PURE__ */ n(R, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1075
- /* @__PURE__ */ n(R, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1076
- /* @__PURE__ */ n(ht, {}),
1077
- /* @__PURE__ */ n(R, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1078
- /* @__PURE__ */ n(R, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1079
- /* @__PURE__ */ n(ht, {}),
1080
- /* @__PURE__ */ n(R, { onClick: a("delete-row"), children: "Fjern rad" }),
1081
- /* @__PURE__ */ n(R, { onClick: a("delete-column"), children: "Fjern kolonne" })
3040
+ /* @__PURE__ */ _(pe, { onClick: l("add-row-over"), children: "Legg til rad over" }),
3041
+ /* @__PURE__ */ _(pe, { onClick: l("add-row-under"), children: "Legg til rad under" }),
3042
+ /* @__PURE__ */ _(Lt, {}),
3043
+ /* @__PURE__ */ _(pe, { onClick: l("add-column-left"), children: "Legg til kolonne venstre" }),
3044
+ /* @__PURE__ */ _(pe, { onClick: l("add-column-right"), children: "Legg til kolonne høyre" }),
3045
+ /* @__PURE__ */ _(Lt, {}),
3046
+ /* @__PURE__ */ _(pe, { onClick: l("delete-row"), children: "Fjern rad" }),
3047
+ /* @__PURE__ */ _(pe, { onClick: l("delete-column"), children: "Fjern kolonne" })
1082
3048
  ]
1083
3049
  }
1084
3050
  ) : null;
1085
3051
  };
1086
- function jt(t) {
3052
+ function Hr(t) {
1087
3053
  let e = t;
1088
- const r = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1089
- return e = String(e).trim(), e.match(r) || e.match(o) ? e : "https://";
3054
+ const i = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, d = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
3055
+ return e = String(e).trim(), e.match(i) || e.match(d) ? e : "https://";
1090
3056
  }
1091
- function Kt(t) {
1092
- const e = t.anchor, r = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1093
- return o === i ? o : t.isBackward() ? ct(r) ? o : i : ct(e) ? o : i;
3057
+ function Fr(t) {
3058
+ const e = t.anchor, i = t.focus, d = t.anchor.getNode(), s = t.focus.getNode();
3059
+ return d === s ? d : t.isBackward() ? Tt(i) ? d : s : Tt(e) ? d : s;
1094
3060
  }
1095
- const pn = (t) => (_.baseURL = t, _), j = class extends z {
3061
+ const Ii = (t) => (fe.baseURL = t, fe), we = class extends me {
1096
3062
  static getType() {
1097
3063
  return "rutine_link";
1098
3064
  }
1099
3065
  static clone(e) {
1100
- return new j(e.__url, {}, e.__key);
3066
+ return new we(e.__url, {}, e.__key);
1101
3067
  }
1102
3068
  createDOM(e) {
1103
- const r = super.createDOM(e);
1104
- return r.setAttribute("href", this.getURL()), r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r.classList.add("rutine-link"), r;
3069
+ const i = super.createDOM(e);
3070
+ return i.setAttribute("href", this.getURL()), i.setAttribute("target", "_blank"), i.setAttribute("rel", "noopener noreferrer"), i.classList.add("rutine-link"), i;
1105
3071
  }
1106
3072
  static importJSON(e) {
1107
- return qt(e.url);
3073
+ return zr(e.url);
1108
3074
  }
1109
3075
  exportJSON() {
1110
3076
  return {
@@ -1116,190 +3082,190 @@ const pn = (t) => (_.baseURL = t, _), j = class extends z {
1116
3082
  }
1117
3083
  getURL() {
1118
3084
  try {
1119
- return new URL(this.__url, j.baseURL).toString();
3085
+ return new URL(this.__url, we.baseURL).toString();
1120
3086
  } catch {
1121
3087
  return "";
1122
3088
  }
1123
3089
  }
1124
3090
  };
1125
- let _ = j;
1126
- st(_, "baseURL", "");
1127
- function qt(t) {
1128
- return new _(t);
3091
+ let fe = we;
3092
+ Nt(fe, "baseURL", "");
3093
+ function zr(t) {
3094
+ return new fe(t);
1129
3095
  }
1130
- function Rr(t) {
1131
- return t instanceof _;
3096
+ function ci(t) {
3097
+ return t instanceof fe;
1132
3098
  }
1133
- const Ir = ({ onClose: t }) => {
1134
- const [e] = y(), r = v(
1135
- (i) => {
3099
+ const ui = ({ onClose: t }) => {
3100
+ const [e] = P.useLexicalComposerContext(), i = J(
3101
+ (s) => {
1136
3102
  e.update(() => {
1137
- const l = T();
1138
- if (L(l) && l.isCollapsed()) {
1139
- const a = l.getNodes();
1140
- if (a.length === 1) {
1141
- const s = a[0];
1142
- ie(s) && s.getChildren().length === 0 && l.insertText(i);
3103
+ const u = ee();
3104
+ if (te(u) && u.isCollapsed()) {
3105
+ const l = u.getNodes();
3106
+ if (l.length === 1) {
3107
+ const c = l[0];
3108
+ tn(c) && c.getChildren().length === 0 && u.insertText(s);
1143
3109
  }
1144
3110
  }
1145
- }), e.dispatchCommand(Z, jt(i));
3111
+ }), e.dispatchCommand(ut, Hr(s));
1146
3112
  },
1147
3113
  [e]
1148
3114
  );
1149
- return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1150
- r(i.target.url.value), t();
3115
+ return /* @__PURE__ */ K("form", { onSubmit: (s) => {
3116
+ i(s.target.url.value), t();
1151
3117
  }, children: [
1152
- /* @__PURE__ */ n(Se, { name: "url", label: "URL", type: "url", required: !0 }),
1153
- /* @__PURE__ */ g(It, { children: [
1154
- /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1155
- /* @__PURE__ */ n($, { type: "submit", variant: "primary", children: "Lagre" })
3118
+ /* @__PURE__ */ _(Ln, { name: "url", label: "URL", type: "url", required: !0 }),
3119
+ /* @__PURE__ */ K(_r, { children: [
3120
+ /* @__PURE__ */ _(Ce, { onClick: t, children: "Avbryt" }),
3121
+ /* @__PURE__ */ _(Ce, { type: "submit", variant: "primary", children: "Lagre" })
1156
3122
  ] })
1157
3123
  ] });
1158
- }, zr = ({ onClose: t, getDocs: e }) => {
1159
- const [r] = y(), [o, i] = b([]), l = e(), a = v(
1160
- (s) => {
1161
- r.update(() => {
1162
- const d = T();
1163
- if (L(d)) {
1164
- const c = [];
1165
- for (const [f, u] of s.entries()) {
1166
- const m = qt(u.value);
1167
- m.append(D(u.label)), c.push(m), f !== s.length - 1 && c.push(D(" "));
3124
+ }, di = ({ onClose: t, getDocs: e }) => {
3125
+ const [i] = P.useLexicalComposerContext(), [d, s] = Y([]), u = e(), l = J(
3126
+ (c) => {
3127
+ i.update(() => {
3128
+ const o = ee();
3129
+ if (te(o)) {
3130
+ const n = [];
3131
+ for (const [r, a] of c.entries()) {
3132
+ const g = zr(a.value);
3133
+ g.append(ve(a.label)), n.push(g), r !== c.length - 1 && n.push(ve(" "));
1168
3134
  }
1169
- d.insertNodes(c);
3135
+ o.insertNodes(n);
1170
3136
  }
1171
3137
  });
1172
3138
  },
1173
- [r]
3139
+ [i]
1174
3140
  );
1175
- return /* @__PURE__ */ g(Y, { children: [
1176
- /* @__PURE__ */ n(we, { isMulti: !0, options: l, onChange: i }),
1177
- /* @__PURE__ */ g(It, { children: [
1178
- /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1179
- /* @__PURE__ */ n(
1180
- $,
3141
+ return /* @__PURE__ */ K(Ie, { children: [
3142
+ /* @__PURE__ */ _(yn, { isMulti: !0, options: u, onChange: s }),
3143
+ /* @__PURE__ */ K(_r, { children: [
3144
+ /* @__PURE__ */ _(Ce, { onClick: t, children: "Avbryt" }),
3145
+ /* @__PURE__ */ _(
3146
+ Ce,
1181
3147
  {
1182
3148
  variant: "primary",
1183
3149
  onClick: () => {
1184
- a(o), t();
3150
+ l(d), t();
1185
3151
  },
1186
3152
  children: "Lagre"
1187
3153
  }
1188
3154
  )
1189
3155
  ] })
1190
3156
  ] });
1191
- }, Or = ({
3157
+ }, fi = ({
1192
3158
  open: t,
1193
3159
  onOpenChange: e,
1194
- getDocs: r
3160
+ getDocs: i
1195
3161
  }) => {
1196
- const [o, i] = b("url"), l = () => {
3162
+ const [d, s] = Y("url"), u = () => {
1197
3163
  e(!1);
1198
3164
  };
1199
- return /* @__PURE__ */ g(ye, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
1200
- /* @__PURE__ */ g(Ne, { css: { marginBottom: "$8" }, children: [
1201
- /* @__PURE__ */ n(pt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1202
- /* @__PURE__ */ n(pt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
3165
+ return /* @__PURE__ */ K(vn, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
3166
+ /* @__PURE__ */ K(_n, { css: { marginBottom: "$8" }, children: [
3167
+ /* @__PURE__ */ _(yt, { active: d === "url", onClick: () => s("url"), children: "URL" }),
3168
+ /* @__PURE__ */ _(yt, { active: d === "rutine", onClick: () => s("rutine"), children: "Rutine" })
1203
3169
  ] }),
1204
- o === "url" && /* @__PURE__ */ n(Ir, { onClose: l }),
1205
- o === "rutine" && /* @__PURE__ */ n(zr, { onClose: l, getDocs: r })
3170
+ d === "url" && /* @__PURE__ */ _(ui, { onClose: u }),
3171
+ d === "rutine" && /* @__PURE__ */ _(di, { onClose: u, getDocs: i })
1206
3172
  ] });
1207
- }, gn = ({ getDocs: t }) => {
1208
- const [e] = y(), [r, o] = b(!1), [i, l] = b(!1), a = v(() => {
1209
- const s = T();
1210
- if (L(s)) {
1211
- const d = Kt(s), c = d.getParent();
1212
- o(U(c) || U(d));
3173
+ }, Bi = ({ getDocs: t }) => {
3174
+ const [e] = P.useLexicalComposerContext(), [i, d] = Y(!1), [s, u] = Y(!1), l = J(() => {
3175
+ const c = ee();
3176
+ if (te(c)) {
3177
+ const o = Fr(c), n = o.getParent();
3178
+ d($e(n) || $e(o));
1213
3179
  }
1214
3180
  }, []);
1215
- return x(() => e.registerCommand(
1216
- F,
1217
- () => (a(), !1),
1218
- Q
1219
- ), [e, a]), /* @__PURE__ */ g(_t, { type: "single", value: r ? "link" : "", children: [
1220
- /* @__PURE__ */ n(
1221
- I,
3181
+ return oe(() => e.registerCommand(
3182
+ Le,
3183
+ () => (l(), !1),
3184
+ at
3185
+ ), [e, l]), /* @__PURE__ */ K(Tr, { type: "single", value: i ? "link" : "", children: [
3186
+ /* @__PURE__ */ _(
3187
+ he,
1222
3188
  {
1223
3189
  onClick: () => {
1224
- r ? e.dispatchCommand(Z, null) : l(!0);
3190
+ i ? e.dispatchCommand(ut, null) : u(!0);
1225
3191
  },
1226
3192
  title: "Lenke",
1227
3193
  value: "link",
1228
- children: /* @__PURE__ */ n(lr, { size: "1.25rem" })
3194
+ children: /* @__PURE__ */ _(To, { size: "1.25rem" })
1229
3195
  }
1230
3196
  ),
1231
- /* @__PURE__ */ n(
1232
- Or,
3197
+ /* @__PURE__ */ _(
3198
+ fi,
1233
3199
  {
1234
- open: i,
1235
- onOpenChange: l,
3200
+ open: s,
3201
+ onOpenChange: u,
1236
3202
  getDocs: t
1237
3203
  }
1238
3204
  )
1239
3205
  ] });
1240
- }, fn = () => {
1241
- const [t] = y(), e = rt(null), [r, o] = b(null), [i, l] = b(""), { hasFocus: a } = at();
1242
- x(() => {
1243
- r ? t.update(() => {
1244
- l(r.getURL());
1245
- }) : l("");
1246
- }, [t, r]);
1247
- const s = !!(r && i && a), { refs: d, floatingStyles: c, context: f } = ot({
3206
+ }, Hi = () => {
3207
+ const [t] = P.useLexicalComposerContext(), e = gt(null), [i, d] = Y(null), [s, u] = Y(""), { hasFocus: l } = mt();
3208
+ oe(() => {
3209
+ i ? t.update(() => {
3210
+ u(i.getURL());
3211
+ }) : u("");
3212
+ }, [t, i]);
3213
+ const c = !!(i && s && l), { refs: o, floatingStyles: n, context: r } = ht({
1248
3214
  placement: "top",
1249
3215
  strategy: "fixed",
1250
- open: s,
1251
- whileElementsMounted: zt,
3216
+ open: c,
3217
+ whileElementsMounted: yr,
1252
3218
  elements: {
1253
3219
  reference: e.current
1254
3220
  },
1255
- middleware: [Be()]
1256
- }), { getFloatingProps: u } = $t([
1257
- At(f),
1258
- De(f)
1259
- ]), m = v(() => {
1260
- var S;
1261
- const k = T();
1262
- if (L(k)) {
1263
- const A = Kt(k), p = A.getParent();
1264
- let H = null;
1265
- if (U(p) ? H = p : U(A) && (H = A), H) {
1266
- const G = window.getSelection(), lt = t.getRootElement();
1267
- k !== null && G !== null && lt !== null && lt.contains(G.anchorNode) && t.isEditable() && (e.current = ((S = G.focusNode) == null ? void 0 : S.parentElement) ?? null);
3221
+ middleware: [Sn()]
3222
+ }), { getFloatingProps: a } = Rr([
3223
+ br(r),
3224
+ kn(r)
3225
+ ]), g = J(() => {
3226
+ var x;
3227
+ const h = ee();
3228
+ if (te(h)) {
3229
+ const C = Fr(h), L = C.getParent();
3230
+ let E = null;
3231
+ if ($e(L) ? E = L : $e(C) && (E = C), E) {
3232
+ const T = window.getSelection(), M = t.getRootElement();
3233
+ h !== null && T !== null && M !== null && M.contains(T.anchorNode) && t.isEditable() && (e.current = ((x = T.focusNode) == null ? void 0 : x.parentElement) ?? null);
1268
3234
  }
1269
- o(H);
3235
+ d(E);
1270
3236
  }
1271
- }, [t]), w = v(() => {
1272
- r && Rr(r) && t.update(() => {
1273
- r.remove();
1274
- }), t.dispatchCommand(Z, null);
1275
- }, [t, r]);
1276
- if (x(() => {
3237
+ }, [t]), f = J(() => {
3238
+ i && ci(i) && t.update(() => {
3239
+ i.remove();
3240
+ }), t.dispatchCommand(ut, null);
3241
+ }, [t, i]);
3242
+ if (oe(() => {
1277
3243
  t.getEditorState().read(() => {
1278
- m();
3244
+ g();
1279
3245
  });
1280
- }, [t, m]), x(() => it(
1281
- t.registerUpdateListener(({ editorState: k }) => {
1282
- k.read(() => {
1283
- m();
3246
+ }, [t, g]), oe(() => z.mergeRegister(
3247
+ t.registerUpdateListener(({ editorState: h }) => {
3248
+ h.read(() => {
3249
+ g();
1284
3250
  });
1285
3251
  }),
1286
3252
  t.registerCommand(
1287
- F,
1288
- () => (m(), !0),
1289
- E
3253
+ Le,
3254
+ () => (g(), !0),
3255
+ de
1290
3256
  ),
1291
3257
  t.registerCommand(
1292
- vt,
1293
- () => r ? (o(null), !0) : !1,
1294
- ae
3258
+ lr,
3259
+ () => i ? (d(null), !0) : !1,
3260
+ rn
1295
3261
  )
1296
- ), [t, m, r]), !s)
3262
+ ), [t, g, i]), !c)
1297
3263
  return null;
1298
- const N = jt(i);
1299
- return /* @__PURE__ */ n(Bt, { children: /* @__PURE__ */ g(
1300
- Rt,
3264
+ const p = Hr(s);
3265
+ return /* @__PURE__ */ _(Sr, { children: /* @__PURE__ */ K(
3266
+ vr,
1301
3267
  {
1302
- ref: d.setFloating,
3268
+ ref: o.setFloating,
1303
3269
  css: {
1304
3270
  padding: "$2 $4",
1305
3271
  // Make sure this renders above the toolbar
@@ -1307,11 +3273,11 @@ const Ir = ({ onClose: t }) => {
1307
3273
  display: "flex",
1308
3274
  alignItems: "center"
1309
3275
  },
1310
- style: c,
1311
- ...u(),
3276
+ style: n,
3277
+ ...a(),
1312
3278
  children: [
1313
- /* @__PURE__ */ n(
1314
- P,
3279
+ /* @__PURE__ */ _(
3280
+ _e,
1315
3281
  {
1316
3282
  as: "a",
1317
3283
  css: {
@@ -1321,41 +3287,41 @@ const Ir = ({ onClose: t }) => {
1321
3287
  textOverflow: "ellipsis",
1322
3288
  marginRight: "$4"
1323
3289
  },
1324
- href: N,
1325
- title: N,
3290
+ href: p,
3291
+ title: p,
1326
3292
  target: "_blank",
1327
3293
  rel: "noreferrer",
1328
- children: i
3294
+ children: s
1329
3295
  }
1330
3296
  ),
1331
- /* @__PURE__ */ n($, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Fe, { size: 24 }) })
3297
+ /* @__PURE__ */ _(Ce, { color: "danger", icon: !0, size: "sm", onClick: f, children: /* @__PURE__ */ _(On, { size: 24 }) })
1332
3298
  ]
1333
3299
  }
1334
3300
  ) });
1335
3301
  };
1336
3302
  export {
1337
- qt as $createRutineLinkNode,
1338
- Rr as $isRutineLinkNode,
1339
- Mr as FloatingToolbar,
1340
- un as InsertSelector,
1341
- fn as LinkEditPlugin,
1342
- W as LinkTargetNode,
1343
- gn as LinkToolbarButton,
1344
- cn as RichTextEditor,
1345
- Cr as RichTextToolbar,
1346
- _ as RutineLinkNode,
1347
- pn as RutineLinkNodeInit,
1348
- hn as TableEditPlugin,
1349
- Ge as clearEditorState,
1350
- ln as defaultNodes,
1351
- sn as defaultViewNodes,
1352
- Ye as isEditorState,
1353
- Ft as isJSON,
1354
- Ht as richTextContext,
1355
- dn as richTextCss,
1356
- Er as richTextStyleObj,
1357
- Je as setStateFromPlainText,
1358
- an as stateToHTML,
1359
- Xe as useHasFocusWithin,
1360
- at as useRichTextContext
3303
+ zr as $createRutineLinkNode,
3304
+ ci as $isRutineLinkNode,
3305
+ wo as FloatingToolbar,
3306
+ Ai as InsertSelector,
3307
+ Hi as LinkEditPlugin,
3308
+ De as LinkTargetNode,
3309
+ Bi as LinkToolbarButton,
3310
+ Di as RichTextEditor,
3311
+ Ao as RichTextToolbar,
3312
+ fe as RutineLinkNode,
3313
+ Ii as RutineLinkNodeInit,
3314
+ Pi as TableEditPlugin,
3315
+ In as clearEditorState,
3316
+ Oi as defaultNodes,
3317
+ $i as defaultViewNodes,
3318
+ Pn as isEditorState,
3319
+ Or as isJSON,
3320
+ Ar as richTextContext,
3321
+ wi as richTextCss,
3322
+ si as richTextStyleObj,
3323
+ Bn as setStateFromPlainText,
3324
+ ki as stateToHTML,
3325
+ co as useHasFocusWithin,
3326
+ mt as useRichTextContext
1361
3327
  };