@arkitektbedriftene/fe-lib 0.4.29 → 0.4.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,58 +1,58 @@
1
- var Ft = Object.defineProperty;
2
- var Ht = (t, r, e) => r in t ? Ft(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var it = (t, r, e) => (Ht(t, typeof r != "symbol" ? r + "" : r, e), e);
1
+ var Ht = Object.defineProperty;
2
+ var Ut = (t, e, r) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var lt = (t, e, r) => (Ut(t, typeof e != "symbol" ? e + "" : e, r), r);
4
4
  import { createHeadlessEditor as Wt } from "@lexical/headless";
5
- import { $generateHtmlFromNodes as Ut } from "@lexical/html";
6
- import { $getRoot as U, ParagraphNode as jt, $createParagraphNode as j, $createTextNode as A, $setSelection as ft, SELECTION_CHANGE_COMMAND as P, $getSelection as T, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as L, $isRootOrShadowRoot as Kt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as qt, KEY_ARROW_UP_COMMAND as Yt, KEY_ESCAPE_COMMAND as mt, KEY_SPACE_COMMAND as Gt, $getNearestNodeFromDOMNode as Q, KEY_ARROW_LEFT_COMMAND as Xt, $isElementNode as Qt, COMMAND_PRIORITY_NORMAL as Jt, $isParagraphNode as Vt, COMMAND_PRIORITY_HIGH as Zt } from "lexical";
7
- import { trimTextContentFromAnchor as te, $setBlocksType as Y, $isAtNodeEnd as at } from "@lexical/selection";
8
- import { AutoLinkNode as ee, LinkNode as kt, $isLinkNode as H, TOGGLE_LINK_COMMAND as J } from "@lexical/link";
9
- import { ListNode as bt, ListItemNode as re, $isListNode as V, INSERT_UNORDERED_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as oe, INSERT_CHECK_LIST_COMMAND as vt, insertList as ie, $isListItemNode as z } from "@lexical/list";
10
- import { HeadingNode as ae, QuoteNode as le, $isHeadingNode as se, $createHeadingNode as ce, $createQuoteNode as de } from "@lexical/rich-text";
11
- import { TableNode as ue, TableRowNode as he, TableCellNode as pe, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as lt, $insertTableRow__EXPERIMENTAL as st } from "@lexical/table";
12
- import { jsx as n, jsxs as g, Fragment as K } from "react/jsx-runtime";
13
- import { createContext as be, useState as b, useRef as Z, useCallback as v, useContext as ve, useEffect as x, useMemo as Mt, useLayoutEffect as Me } from "react";
14
- import { s as Ct, D as tt, T as Tt, a as C, B as D, b as Lt, c as I, u as et, d as xt, e as Ce, f as Te, o as yt, g as Le, h as Nt, i as St, F as Et, O as wt, j as xe, k as ye, S as Ne, l as Se, m as O, n as _, p as ct, q as Ee, N as we, r as dt, t as Re, v as Rt, C as _e, w as Ie, x as ze } from "./Checkbox-0c1030b1.js";
5
+ import { $generateHtmlFromNodes as jt } from "@lexical/html";
6
+ import { $getRoot as K, ParagraphNode as Kt, $createParagraphNode as q, $createTextNode as D, $setSelection as kt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as qt, FORMAT_TEXT_COMMAND as A, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as Yt, KEY_ARROW_UP_COMMAND as Gt, KEY_ESCAPE_COMMAND as bt, KEY_SPACE_COMMAND as Jt, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as Xt, $isElementNode as Qt, COMMAND_PRIORITY_NORMAL as Vt, $isParagraphNode as Zt, COMMAND_PRIORITY_HIGH as te } from "lexical";
7
+ import { trimTextContentFromAnchor as ee, $setBlocksType as J, $isAtNodeEnd as st } from "@lexical/selection";
8
+ import { LinkNode as B, AutoLinkNode as re, $isLinkNode as U, TOGGLE_LINK_COMMAND as Z } from "@lexical/link";
9
+ import { ListNode as vt, ListItemNode as ne, $isListNode as tt, INSERT_UNORDERED_LIST_COMMAND as oe, INSERT_ORDERED_LIST_COMMAND as ie, INSERT_CHECK_LIST_COMMAND as Mt, insertList as ae, $isListItemNode as z } from "@lexical/list";
10
+ import { HeadingNode as le, QuoteNode as se, $isHeadingNode as ce, $createHeadingNode as de, $createQuoteNode as ue } from "@lexical/rich-text";
11
+ import { TableNode as he, TableRowNode as pe, TableCellNode as ge, INSERT_TABLE_COMMAND as fe, $getTableCellNodeFromLexicalNode as me, $deleteTableColumn__EXPERIMENTAL as ke, $deleteTableRow__EXPERIMENTAL as be, $insertTableColumn__EXPERIMENTAL as ct, $insertTableRow__EXPERIMENTAL as dt } from "@lexical/table";
12
+ import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
13
+ import { createContext as ve, useState as b, useRef as et, useCallback as v, useContext as Me, useEffect as x, useMemo as Ct, useLayoutEffect as Ce } from "react";
14
+ import { s as Tt, D as rt, T as Lt, a as C, B as P, b as xt, c as I, u as nt, d as yt, e as Te, f as Le, o as Nt, g as xe, h as St, i as wt, F as Et, O as _t, j as ye, k as Ne, S as Se, l as we, m as O, n as R, p as ut, q as Ee, N as _e, r as ht, t as Re, v as Rt, C as Ie, w as ze, x as Oe } from "./Checkbox-0c1030b1.js";
15
15
  import "react-select";
16
- import { LexicalComposer as Oe } from "@lexical/react/LexicalComposer.js";
17
- import { RichTextPlugin as $e } from "@lexical/react/LexicalRichTextPlugin.js";
18
- import Be from "@lexical/react/LexicalErrorBoundary.js";
16
+ import { LexicalComposer as $e } from "@lexical/react/LexicalComposer.js";
17
+ import { RichTextPlugin as Ae } from "@lexical/react/LexicalRichTextPlugin.js";
18
+ import De from "@lexical/react/LexicalErrorBoundary.js";
19
19
  import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Ae, $findMatchingParent as _t, mergeRegister as rt, isHTMLElement as ut } from "@lexical/utils";
21
- import { G as h, f as De } from "./index.esm-3266b7f8.js";
22
- import { ListPlugin as Pe } from "@lexical/react/LexicalListPlugin.js";
23
- import { HistoryPlugin as Fe } from "@lexical/react/LexicalHistoryPlugin.js";
24
- import { TablePlugin as He } from "@lexical/react/LexicalTablePlugin.js";
20
+ import { $getNearestNodeOfType as Be, $findMatchingParent as It, mergeRegister as ot, isHTMLElement as pt } from "@lexical/utils";
21
+ import { G as h, f as Pe } from "./index.esm-3266b7f8.js";
22
+ import { ListPlugin as Fe } from "@lexical/react/LexicalListPlugin.js";
23
+ import { HistoryPlugin as He } from "@lexical/react/LexicalHistoryPlugin.js";
24
+ import { TablePlugin as Ue } from "@lexical/react/LexicalTablePlugin.js";
25
25
  import { TabIndentationPlugin as We } from "@lexical/react/LexicalTabIndentationPlugin.js";
26
26
  import "react-dom";
27
27
  import "@radix-ui/react-toolbar";
28
28
  import "@radix-ui/react-dialog";
29
29
  import "@radix-ui/react-dropdown-menu";
30
30
  import "@radix-ui/react-checkbox";
31
- const Ue = ({
31
+ const je = ({
32
32
  text: t,
33
- maxChars: r,
34
- maxLines: e
33
+ maxChars: e,
34
+ maxLines: r
35
35
  }) => {
36
36
  if (t.length === 0)
37
37
  return 0;
38
- const o = typeof e == "number", i = typeof r == "number";
38
+ const o = typeof r == "number", i = typeof e == "number";
39
39
  if (!o && !i)
40
40
  return t.length;
41
41
  let l = 0, a = 0;
42
- for (; a < t.length && (!o || l < e) && (!i || a < r); )
42
+ for (; a < t.length && (!o || l < r) && (!i || a < e); )
43
43
  t[a] === `
44
44
  ` && l++, a++;
45
45
  return t.slice(0, a).length;
46
- }, je = ({
46
+ }, Ke = ({
47
47
  editor: t,
48
- maxChars: r,
49
- maxLines: e
48
+ maxChars: e,
49
+ maxLines: r
50
50
  }) => {
51
- const o = U(), i = o.getTextContent(), l = Ue({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = o.select().anchor;
52
- te(t, d, a);
51
+ const o = K(), i = o.getTextContent(), l = je({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
52
+ ee(t, d, a);
53
53
  const c = o.getLastChild();
54
- return c instanceof jt && c.getChildrenSize() === 0 && c.remove(), a;
55
- }, It = {
54
+ return c instanceof Kt && c.getChildrenSize() === 0 && c.remove(), a;
55
+ }, zt = {
56
56
  quote: "ain-rich-text-quote",
57
57
  text: {
58
58
  bold: "ain-rich-text-bold",
@@ -64,49 +64,49 @@ const Ue = ({
64
64
  listitem: "ain-rich-text-nested-list-item"
65
65
  }
66
66
  }
67
- }, zt = (t) => t[0] === "{", Ke = (t) => t !== null && typeof t == "object" && "isEmpty" in t, qe = (t, r) => {
67
+ }, Ot = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, e) => {
68
68
  t.update(
69
69
  () => {
70
- const e = U();
71
- e.clear();
72
- const o = j();
73
- o.append(A("")), e.append(o), ft(null);
70
+ const r = K();
71
+ r.clear();
72
+ const o = q();
73
+ o.append(D("")), r.append(o), kt(null);
74
74
  },
75
75
  {
76
- tag: r
76
+ tag: e
77
77
  }
78
78
  );
79
- }, Ye = (t, r, e) => {
80
- r.update(
79
+ }, Ge = (t, e, r) => {
80
+ e.update(
81
81
  () => {
82
- const o = U();
82
+ const o = K();
83
83
  o.clear();
84
- const i = j();
85
- i.append(A(t.trim())), o.append(i), ft(null);
84
+ const i = q();
85
+ i.append(D(t.trim())), o.append(i), kt(null);
86
86
  },
87
87
  {
88
- tag: e
88
+ tag: r
89
89
  }
90
- ), r.blur();
91
- }, sn = (t, r, e) => {
90
+ ), e.blur();
91
+ }, dn = (t, e, r) => {
92
92
  let o = 0;
93
93
  const i = Wt({
94
- nodes: r,
94
+ nodes: e,
95
95
  editable: !1,
96
- theme: It
96
+ theme: zt
97
97
  });
98
98
  if (t)
99
99
  try {
100
- if (typeof t == "string" && !zt(t))
100
+ if (typeof t == "string" && !Ot(t))
101
101
  i.update(() => {
102
- const a = U(), s = j();
103
- s.append(A(t.trim())), a.append(s);
102
+ const a = K(), s = q();
103
+ s.append(D(t.trim())), a.append(s);
104
104
  });
105
105
  else {
106
106
  const a = i.parseEditorState(t, () => {
107
- (e == null ? void 0 : e.maxLines) !== void 0 && (o = je({
107
+ (r == null ? void 0 : r.maxLines) !== void 0 && (o = Ke({
108
108
  editor: i,
109
- maxLines: e.maxLines
109
+ maxLines: r.maxLines
110
110
  }));
111
111
  });
112
112
  a.isEmpty() || i.setEditorState(a);
@@ -117,92 +117,126 @@ const Ue = ({
117
117
  let l = "";
118
118
  return i.update(() => {
119
119
  var a;
120
- e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = Ut(i);
120
+ r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = jt(i);
121
121
  }), { html: l, trimCount: o };
122
- }, cn = [
123
- ae,
122
+ };
123
+ class W extends B {
124
+ static getType() {
125
+ return "target-link";
126
+ }
127
+ static clone(e) {
128
+ return new W(
129
+ e.__url,
130
+ { rel: e.__rel, target: e.__target, title: e.__title },
131
+ e.__key
132
+ );
133
+ }
134
+ createDOM(e) {
135
+ const r = super.createDOM(e);
136
+ return r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r;
137
+ }
138
+ exportJSON() {
139
+ return super.exportJSON();
140
+ }
141
+ static importJSON(e) {
142
+ return B.importJSON(e);
143
+ }
144
+ }
145
+ const Je = [
124
146
  le,
125
- bt,
147
+ se,
148
+ vt,
149
+ ne,
126
150
  re,
127
- ee,
128
- kt,
129
- ue,
151
+ B,
130
152
  he,
131
- pe
132
- ], Ot = be({ hasFocus: !1, editorRef: { current: null } }), Ge = ({ onBlur: t }) => {
133
- const [r, e] = b(!1), o = Z(null), i = v(() => {
134
- e(!0), o.current && window.clearTimeout(o.current);
153
+ pe,
154
+ ge
155
+ ], un = [
156
+ ...Je,
157
+ W,
158
+ {
159
+ replace: B,
160
+ with: (t) => new W(
161
+ t.getURL(),
162
+ { rel: t.__rel, target: t.__target, title: t.__title },
163
+ t.getKey()
164
+ )
165
+ }
166
+ ], $t = ve({ hasFocus: !1, editorRef: { current: null } }), Xe = ({ onBlur: t }) => {
167
+ const [e, r] = b(!1), o = et(null), i = v(() => {
168
+ r(!0), o.current && window.clearTimeout(o.current);
135
169
  }, []), l = v(() => {
136
170
  o.current = window.setTimeout(() => {
137
- e(!1), t == null || t();
171
+ r(!1), t == null || t();
138
172
  }, 0);
139
173
  }, [t]);
140
174
  return {
141
- hasFocus: r,
175
+ hasFocus: e,
142
176
  attributes: {
143
177
  onFocus: i,
144
178
  onBlur: l
145
179
  }
146
180
  };
147
- }, nt = () => ve(Ot);
148
- function Xe(t) {
181
+ }, it = () => Me($t);
182
+ function Qe(t) {
149
183
  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);
150
184
  }
151
- function Qe(t) {
185
+ function Ve(t) {
152
186
  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);
153
187
  }
154
- function Je(t) {
188
+ function Ze(t) {
155
189
  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);
156
190
  }
157
- function Ve(t) {
191
+ function tr(t) {
158
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: "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);
159
193
  }
160
- function Ze(t) {
194
+ function er(t) {
161
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: "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);
162
196
  }
163
- function tr(t) {
197
+ function rr(t) {
164
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: "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);
165
199
  }
166
- function er(t) {
200
+ function nr(t) {
167
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 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);
168
202
  }
169
- function rr(t) {
203
+ function or(t) {
170
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 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);
171
205
  }
172
- function nr(t) {
206
+ function ir(t) {
173
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: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
174
208
  }
175
- function or(t) {
209
+ function ar(t) {
176
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.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);
177
211
  }
178
- function ir(t) {
212
+ function lr(t) {
179
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: "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);
180
214
  }
181
- function ar(t) {
215
+ function sr(t) {
182
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: "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);
183
217
  }
184
- function lr(t) {
218
+ function cr(t) {
185
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: "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);
186
220
  }
187
- function sr(t) {
221
+ function dr(t) {
188
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: "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);
189
223
  }
190
- function cr(t) {
224
+ function ur(t) {
191
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: "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);
192
226
  }
193
- function dr(t) {
227
+ function hr(t) {
194
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: "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);
195
229
  }
196
- function ur(t) {
230
+ function pr(t) {
197
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: "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);
198
232
  }
199
- function hr(t) {
233
+ function gr(t) {
200
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: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
201
235
  }
202
- const pr = Ct("div", {
236
+ const fr = Tt("div", {
203
237
  width: "10rem",
204
238
  display: "flex"
205
- }), $t = {
239
+ }), At = {
206
240
  bullet: "Punktliste",
207
241
  h1: "Overskrift 1",
208
242
  h2: "Overskrift 2",
@@ -214,24 +248,24 @@ const pr = Ct("div", {
214
248
  paragraph: "Normal",
215
249
  quote: "Sitat",
216
250
  check: "Avkrysningsliste"
217
- }, gr = {
218
- bullet: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
219
- h1: /* @__PURE__ */ n(Je, { size: "1.25rem" }),
220
- h2: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
221
- h3: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
222
- h4: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
223
- h5: /* @__PURE__ */ n(er, { size: "1.25rem" }),
224
- h6: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
225
- number: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
226
- check: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
227
- paragraph: /* @__PURE__ */ n(or, { size: "1.25rem" }),
228
- quote: /* @__PURE__ */ n(cr, { size: "1.25rem" })
251
+ }, mr = {
252
+ bullet: /* @__PURE__ */ n(dr, { size: "1.25rem" }),
253
+ h1: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
254
+ h2: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
255
+ h3: /* @__PURE__ */ n(er, { size: "1.25rem" }),
256
+ h4: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
257
+ h5: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
258
+ h6: /* @__PURE__ */ n(or, { size: "1.25rem" }),
259
+ number: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
260
+ check: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
261
+ paragraph: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
262
+ quote: /* @__PURE__ */ n(ur, { size: "1.25rem" })
229
263
  }, M = ({
230
264
  blockType: t
231
- }) => /* @__PURE__ */ g(K, { children: [
232
- /* @__PURE__ */ n(D, { css: { display: "flex", flex: "0 0 auto" }, children: gr[t] }),
265
+ }) => /* @__PURE__ */ g(Y, { children: [
266
+ /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: mr[t] }),
233
267
  /* @__PURE__ */ n(
234
- D,
268
+ P,
235
269
  {
236
270
  css: {
237
271
  flex: "1 1 auto",
@@ -239,69 +273,69 @@ const pr = Ct("div", {
239
273
  textOverflow: "ellipsis",
240
274
  whiteSpace: "nowrap"
241
275
  },
242
- children: $t[t]
276
+ children: At[t]
243
277
  }
244
278
  )
245
- ] }), fr = (t) => {
279
+ ] }), kr = (t) => {
246
280
  if (!L(t))
247
281
  return null;
248
- const r = t.anchor.getNode();
249
- let e = r.getKey() === "root" ? r : _t(r, (o) => {
282
+ const e = t.anchor.getNode();
283
+ let r = e.getKey() === "root" ? e : It(e, (o) => {
250
284
  const i = o.getParent();
251
- return i !== null && Kt(i);
285
+ return i !== null && qt(i);
252
286
  });
253
- return e === null && (e = r.getTopLevelElementOrThrow()), {
254
- anchorNode: r,
255
- element: e
287
+ return r === null && (r = e.getTopLevelElementOrThrow()), {
288
+ anchorNode: e,
289
+ element: r
256
290
  };
257
- }, mr = () => {
258
- const [t] = y(), [r, e] = b("paragraph");
291
+ }, br = () => {
292
+ const [t] = y(), [e, r] = b("paragraph");
259
293
  x(() => t.registerCommand(
260
- P,
294
+ F,
261
295
  () => {
262
- const c = T(), f = fr(c);
296
+ const c = T(), f = kr(c);
263
297
  if (!f)
264
298
  return !1;
265
- const { element: u, anchorNode: m } = f, E = u.getKey();
266
- if (t.getElementByKey(E) !== null)
267
- if (V(u)) {
268
- const k = Ae(
299
+ const { element: u, anchorNode: m } = f, w = u.getKey();
300
+ if (t.getElementByKey(w) !== null)
301
+ if (tt(u)) {
302
+ const k = Be(
269
303
  m,
270
- bt
304
+ vt
271
305
  ), S = k ? k.getListType() : u.getListType();
272
- e(S);
306
+ r(S);
273
307
  } else {
274
- const k = se(u) ? u.getTag() : u.getType();
275
- k in $t && e(k);
308
+ const k = ce(u) ? u.getTag() : u.getType();
309
+ k in At && r(k);
276
310
  }
277
311
  return !1;
278
312
  },
279
- X
313
+ Q
280
314
  ), [t]);
281
315
  const o = (c) => {
282
- r !== c && t.update(() => {
316
+ e !== c && t.update(() => {
283
317
  const f = T();
284
- L(f) && (Y(f, () => ce(c)), e(c));
318
+ L(f) && (J(f, () => de(c)), r(c));
285
319
  });
286
320
  };
287
- return /* @__PURE__ */ n(pr, { children: /* @__PURE__ */ g(
288
- tt,
321
+ return /* @__PURE__ */ n(fr, { children: /* @__PURE__ */ g(
322
+ rt,
289
323
  {
290
324
  trigger: /* @__PURE__ */ n(
291
- Tt,
325
+ Lt,
292
326
  {
293
327
  dropdown: !0,
294
328
  css: { display: "flex", width: "100%", overflow: "hidden" },
295
- children: /* @__PURE__ */ n(M, { blockType: r })
329
+ children: /* @__PURE__ */ n(M, { blockType: e })
296
330
  }
297
331
  ),
298
332
  side: "bottom",
299
333
  align: "start",
300
334
  children: [
301
335
  /* @__PURE__ */ n(C, { onClick: () => {
302
- r !== "paragraph" && t.update(() => {
336
+ e !== "paragraph" && t.update(() => {
303
337
  const c = T();
304
- L(c) && (Y(c, () => j()), e("paragraph"));
338
+ L(c) && (J(c, () => q()), r("paragraph"));
305
339
  });
306
340
  }, children: /* @__PURE__ */ n(M, { blockType: "paragraph" }) }),
307
341
  /* @__PURE__ */ n(C, { onClick: () => o("h1"), children: /* @__PURE__ */ n(M, { blockType: "h1" }) }),
@@ -311,33 +345,33 @@ const pr = Ct("div", {
311
345
  /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
312
346
  /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
313
347
  /* @__PURE__ */ n(C, { onClick: () => {
314
- r !== "bullet" && (t.dispatchCommand(ne, void 0), e("bullet"));
348
+ e !== "bullet" && (t.dispatchCommand(oe, void 0), r("bullet"));
315
349
  }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
316
350
  /* @__PURE__ */ n(C, { onClick: () => {
317
- r !== "number" && (t.dispatchCommand(oe, void 0), e("number"));
351
+ e !== "number" && (t.dispatchCommand(ie, void 0), r("number"));
318
352
  }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
319
353
  /* @__PURE__ */ n(C, { onClick: () => {
320
- r !== "check" && (t.dispatchCommand(vt, void 0), e("check"));
354
+ e !== "check" && (t.dispatchCommand(Mt, void 0), r("check"));
321
355
  }, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
322
356
  /* @__PURE__ */ n(C, { onClick: () => {
323
- r !== "quote" && t.update(() => {
357
+ e !== "quote" && t.update(() => {
324
358
  const c = T();
325
- L(c) && (Y(c, () => de()), e("quote"));
359
+ L(c) && (J(c, () => ue()), r("quote"));
326
360
  });
327
361
  }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
328
362
  ]
329
363
  }
330
364
  ) });
331
- }, kr = () => {
332
- const [t] = y(), [r, e] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
365
+ }, vr = () => {
366
+ 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(() => {
333
367
  const p = T();
334
- L(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
368
+ L(p) && (r(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
335
369
  }, []);
336
- x(() => rt(
370
+ x(() => ot(
337
371
  t.registerCommand(
338
- P,
372
+ F,
339
373
  () => (u(), !1),
340
- X
374
+ Q
341
375
  ),
342
376
  t.registerUpdateListener(({ editorState: p }) => {
343
377
  p.read(() => {
@@ -346,26 +380,26 @@ const pr = Ct("div", {
346
380
  })
347
381
  ), [t, u]);
348
382
  const m = v(
349
- () => t.dispatchCommand(B, "bold"),
383
+ () => t.dispatchCommand(A, "bold"),
350
384
  [t]
351
- ), E = v(
352
- () => t.dispatchCommand(B, "italic"),
385
+ ), w = v(
386
+ () => t.dispatchCommand(A, "italic"),
353
387
  [t]
354
388
  ), N = v(
355
- () => t.dispatchCommand(B, "underline"),
389
+ () => t.dispatchCommand(A, "underline"),
356
390
  [t]
357
391
  ), k = v(
358
- () => t.dispatchCommand(B, "code"),
392
+ () => t.dispatchCommand(A, "code"),
359
393
  [t]
360
394
  ), S = v(
361
- () => t.dispatchCommand(B, "superscript"),
395
+ () => t.dispatchCommand(A, "superscript"),
362
396
  [t]
363
- ), $ = Mt(() => {
397
+ ), $ = Ct(() => {
364
398
  const p = [];
365
- return r && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
366
- }, [r, o, l, s, c]);
399
+ return e && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
400
+ }, [e, o, l, s, c]);
367
401
  return /* @__PURE__ */ g(
368
- Lt,
402
+ xt,
369
403
  {
370
404
  type: "multiple",
371
405
  "aria-label": "Tekstformattering",
@@ -377,16 +411,16 @@ const pr = Ct("div", {
377
411
  onClick: m,
378
412
  title: "Fet tekst",
379
413
  value: "bold",
380
- children: /* @__PURE__ */ n(Xe, { size: "1.25rem" })
414
+ children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
381
415
  }
382
416
  ),
383
417
  /* @__PURE__ */ n(
384
418
  I,
385
419
  {
386
- onClick: E,
420
+ onClick: w,
387
421
  title: "Kursiv tekst",
388
422
  value: "italic",
389
- children: /* @__PURE__ */ n(nr, { size: "1.25rem" })
423
+ children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
390
424
  }
391
425
  ),
392
426
  /* @__PURE__ */ n(
@@ -395,7 +429,7 @@ const pr = Ct("div", {
395
429
  onClick: N,
396
430
  title: "Understreket tekst",
397
431
  value: "underline",
398
- children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
432
+ children: /* @__PURE__ */ n(gr, { size: "1.25rem" })
399
433
  }
400
434
  ),
401
435
  /* @__PURE__ */ n(
@@ -404,7 +438,7 @@ const pr = Ct("div", {
404
438
  onClick: k,
405
439
  title: "Kode",
406
440
  value: "code",
407
- children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
441
+ children: /* @__PURE__ */ n(Ve, { size: "1.25rem" })
408
442
  }
409
443
  ),
410
444
  /* @__PURE__ */ n(
@@ -413,46 +447,46 @@ const pr = Ct("div", {
413
447
  onClick: S,
414
448
  title: "Superscript",
415
449
  value: "superscript",
416
- children: /* @__PURE__ */ n(dr, { size: "1.25rem" })
450
+ children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
417
451
  }
418
452
  )
419
453
  ]
420
454
  }
421
455
  );
422
- }, br = ({ children: t }) => {
423
- const { hasFocus: r, editorRef: e } = nt(), o = r, [i, l] = b(o);
424
- Me(() => {
456
+ }, Mr = ({ children: t }) => {
457
+ const { hasFocus: e, editorRef: r } = it(), o = e, [i, l] = b(o);
458
+ Ce(() => {
425
459
  l(o);
426
460
  }, [o]);
427
- const { context: a, refs: s, floatingStyles: d } = et({
461
+ const { context: a, refs: s, floatingStyles: d } = nt({
428
462
  placement: "top",
429
- whileElementsMounted: xt,
463
+ whileElementsMounted: yt,
430
464
  middleware: [
431
- Ce({
465
+ Te({
432
466
  apply: ({ rects: f, elements: u }) => {
433
467
  u.floating.style.minWidth = `${f.reference.width}px`;
434
468
  }
435
469
  }),
436
- Te(),
437
- yt({
470
+ Le(),
471
+ Nt({
438
472
  mainAxis: 8
439
473
  }),
440
- Le({
474
+ xe({
441
475
  padding: 8
442
476
  })
443
477
  ],
444
478
  open: i,
445
479
  onOpenChange: l,
446
480
  elements: {
447
- reference: e.current
481
+ reference: r.current
448
482
  }
449
- }), { getFloatingProps: c } = Nt([
450
- St(a, {
483
+ }), { getFloatingProps: c } = St([
484
+ wt(a, {
451
485
  role: "dialog"
452
486
  })
453
487
  ]);
454
488
  return i ? /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ n(
455
- wt,
489
+ _t,
456
490
  {
457
491
  ref: s.setFloating,
458
492
  style: d,
@@ -463,187 +497,187 @@ const pr = Ct("div", {
463
497
  overflow: "hidden",
464
498
  boxShadow: "$md"
465
499
  },
466
- children: /* @__PURE__ */ n(vr, { children: t })
500
+ children: /* @__PURE__ */ n(Cr, { children: t })
467
501
  }
468
502
  ) }) : null;
469
- }, vr = ({
503
+ }, Cr = ({
470
504
  children: t,
471
- ...r
472
- }) => /* @__PURE__ */ g(xe, { "aria-label": "Formattering", ...r, children: [
473
- /* @__PURE__ */ n(mr, {}),
474
- /* @__PURE__ */ n(ye, {}),
475
- /* @__PURE__ */ n(kr, {}),
505
+ ...e
506
+ }) => /* @__PURE__ */ g(ye, { "aria-label": "Formattering", ...e, children: [
507
+ /* @__PURE__ */ n(br, {}),
508
+ /* @__PURE__ */ n(Ne, {}),
509
+ /* @__PURE__ */ n(vr, {}),
476
510
  t
477
511
  ] });
478
- function Mr() {
512
+ function Tr() {
479
513
  const [t] = y();
480
- return x(() => rt(
514
+ return x(() => ot(
481
515
  t.registerCommand(
482
- vt,
483
- () => (ie(t, "check"), !0),
484
- w
516
+ Mt,
517
+ () => (ae(t, "check"), !0),
518
+ E
485
519
  ),
486
520
  t.registerCommand(
487
- qt,
488
- (r) => gt(r, t, !1),
489
- w
521
+ Yt,
522
+ (e) => mt(e, t, !1),
523
+ E
490
524
  ),
491
525
  t.registerCommand(
492
- Yt,
493
- (r) => gt(r, t, !0),
494
- w
526
+ Gt,
527
+ (e) => mt(e, t, !0),
528
+ E
495
529
  ),
496
530
  t.registerCommand(
497
- mt,
498
- (r) => {
499
- if (G() != null) {
531
+ bt,
532
+ (e) => {
533
+ if (X() != null) {
500
534
  const o = t.getRootElement();
501
535
  return o != null && o.focus(), !0;
502
536
  }
503
537
  return !1;
504
538
  },
505
- w
539
+ E
506
540
  ),
507
541
  t.registerCommand(
508
- Gt,
509
- (r) => {
510
- const e = G();
511
- return e != null && t.isEditable() ? (t.update(() => {
512
- const o = Q(e);
513
- z(o) && (r.preventDefault(), o.toggleChecked());
542
+ Jt,
543
+ (e) => {
544
+ const r = X();
545
+ return r != null && t.isEditable() ? (t.update(() => {
546
+ const o = V(r);
547
+ z(o) && (e.preventDefault(), o.toggleChecked());
514
548
  }), !0) : !1;
515
549
  },
516
- w
550
+ E
517
551
  ),
518
552
  t.registerCommand(
519
553
  Xt,
520
- (r) => t.getEditorState().read(() => {
521
- const e = T();
522
- if (L(e) && e.isCollapsed()) {
523
- const { anchor: o } = e, i = o.type === "element";
554
+ (e) => t.getEditorState().read(() => {
555
+ const r = T();
556
+ if (L(r) && r.isCollapsed()) {
557
+ const { anchor: o } = r, i = o.type === "element";
524
558
  if (i || o.offset === 0) {
525
- const l = o.getNode(), a = _t(
559
+ const l = o.getNode(), a = It(
526
560
  l,
527
561
  (s) => Qt(s) && !s.isInline()
528
562
  );
529
563
  if (z(a)) {
530
564
  const s = a.getParent();
531
- if (V(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
565
+ if (tt(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
532
566
  const d = t.getElementByKey(a.__key);
533
567
  if (d != null && document.activeElement !== d)
534
- return d.focus(), r.preventDefault(), !0;
568
+ return d.focus(), e.preventDefault(), !0;
535
569
  }
536
570
  }
537
571
  }
538
572
  }
539
573
  return !1;
540
574
  }),
541
- w
575
+ E
542
576
  ),
543
- t.registerRootListener((r, e) => {
544
- r !== null && (r.addEventListener("click", ht), r.addEventListener("pointerdown", pt)), e !== null && (e.removeEventListener("click", ht), e.removeEventListener("pointerdown", pt));
577
+ t.registerRootListener((e, r) => {
578
+ e !== null && (e.addEventListener("click", gt), e.addEventListener("pointerdown", ft)), r !== null && (r.removeEventListener("click", gt), r.removeEventListener("pointerdown", ft));
545
579
  })
546
580
  ), [t]), null;
547
581
  }
548
- function Bt(t, r) {
549
- const e = t.target;
550
- if (e === null || !ut(e))
582
+ function Dt(t, e) {
583
+ const r = t.target;
584
+ if (r === null || !pt(r))
551
585
  return;
552
- const o = e.firstChild;
553
- if (o != null && ut(o) && (o.tagName === "UL" || o.tagName === "OL"))
586
+ const o = r.firstChild;
587
+ if (o != null && pt(o) && (o.tagName === "UL" || o.tagName === "OL"))
554
588
  return;
555
- const i = e.parentNode;
589
+ const i = r.parentNode;
556
590
  if (!i || i.__lexicalListType !== "check")
557
591
  return;
558
- const l = t.pageX, a = e.getBoundingClientRect();
559
- (e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
592
+ const l = t.pageX, a = r.getBoundingClientRect();
593
+ (r.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && e();
560
594
  }
561
- function ht(t) {
562
- Bt(t, () => {
563
- const r = t.target, e = Cr(r);
564
- e != null && e.isEditable() && e.update(() => {
595
+ function gt(t) {
596
+ Dt(t, () => {
597
+ const e = t.target, r = Lr(e);
598
+ r != null && r.isEditable() && r.update(() => {
565
599
  if (t.target) {
566
- const o = Q(r);
567
- z(o) && (r.focus(), o.toggleChecked());
600
+ const o = V(e);
601
+ z(o) && (e.focus(), o.toggleChecked());
568
602
  }
569
603
  });
570
604
  });
571
605
  }
572
- function pt(t) {
573
- Bt(t, () => {
606
+ function ft(t) {
607
+ Dt(t, () => {
574
608
  t.preventDefault();
575
609
  });
576
610
  }
577
- function Cr(t) {
578
- let r = t;
579
- for (; r; ) {
580
- if (r.__lexicalEditor)
581
- return r.__lexicalEditor;
582
- r = r.parentNode;
611
+ function Lr(t) {
612
+ let e = t;
613
+ for (; e; ) {
614
+ if (e.__lexicalEditor)
615
+ return e.__lexicalEditor;
616
+ e = e.parentNode;
583
617
  }
584
618
  return null;
585
619
  }
586
- function G() {
620
+ function X() {
587
621
  const t = document.activeElement;
588
622
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
589
623
  t.parentNode.__lexicalListType === "check" ? t : null;
590
624
  }
591
- function Tr(t, r) {
592
- let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
593
- for (; e == null && z(o); )
594
- o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
595
- for (; z(e); ) {
596
- const i = r ? e.getLastChild() : e.getFirstChild();
597
- if (!V(i))
598
- return e;
599
- e = r ? i.getLastChild() : i.getFirstChild();
625
+ function xr(t, e) {
626
+ let r = e ? t.getPreviousSibling() : t.getNextSibling(), o = t;
627
+ for (; r == null && z(o); )
628
+ o = o.getParentOrThrow().getParent(), o != null && (r = e ? o.getPreviousSibling() : o.getNextSibling());
629
+ for (; z(r); ) {
630
+ const i = e ? r.getLastChild() : r.getFirstChild();
631
+ if (!tt(i))
632
+ return r;
633
+ r = e ? i.getLastChild() : i.getFirstChild();
600
634
  }
601
635
  return null;
602
636
  }
603
- function gt(t, r, e) {
604
- const o = G();
605
- return o != null && r.update(() => {
606
- const i = Q(o);
637
+ function mt(t, e, r) {
638
+ const o = X();
639
+ return o != null && e.update(() => {
640
+ const i = V(o);
607
641
  if (!z(i))
608
642
  return;
609
- const l = Tr(i, e);
643
+ const l = xr(i, r);
610
644
  if (l != null) {
611
645
  l.selectStart();
612
- const a = r.getElementByKey(l.__key);
646
+ const a = e.getElementByKey(l.__key);
613
647
  a != null && (t.preventDefault(), setTimeout(() => {
614
648
  a.focus();
615
649
  }, 0));
616
650
  }
617
651
  }), !1;
618
652
  }
619
- const Lr = () => /* @__PURE__ */ g(K, { children: [
620
- /* @__PURE__ */ n(Pe, {}),
621
- /* @__PURE__ */ n(He, {}),
653
+ const yr = () => /* @__PURE__ */ g(Y, { children: [
622
654
  /* @__PURE__ */ n(Fe, {}),
623
- /* @__PURE__ */ n(Mr, {}),
655
+ /* @__PURE__ */ n(Ue, {}),
656
+ /* @__PURE__ */ n(He, {}),
657
+ /* @__PURE__ */ n(Tr, {}),
624
658
  /* @__PURE__ */ n(We, {})
625
- ] }), xr = ({
659
+ ] }), Nr = ({
626
660
  state: t
627
661
  }) => {
628
- const [r] = y();
662
+ const [e] = y();
629
663
  return x(() => {
630
664
  if (t)
631
665
  try {
632
- if (Ke(t)) {
633
- t.isEmpty() ? qe(r) : r.setEditorState(t);
666
+ if (qe(t)) {
667
+ t.isEmpty() ? Ye(e) : e.setEditorState(t);
634
668
  return;
635
669
  }
636
- if (typeof t == "string" && !zt(t)) {
637
- Ye(t, r);
670
+ if (typeof t == "string" && !Ot(t)) {
671
+ Ge(t, e);
638
672
  return;
639
673
  }
640
- const e = r.parseEditorState(t);
641
- e.isEmpty() || r.setEditorState(e);
642
- } catch (e) {
643
- console.error("Could not parse"), console.error(e);
674
+ const r = e.parseEditorState(t);
675
+ r.isEmpty() || e.setEditorState(r);
676
+ } catch (r) {
677
+ console.error("Could not parse"), console.error(r);
644
678
  }
645
679
  }, []), null;
646
- }, yr = Ct("div", {
680
+ }, Sr = Tt("div", {
647
681
  border: "1px solid $borderDarker",
648
682
  borderRadius: "$md",
649
683
  position: "relative",
@@ -680,10 +714,10 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
680
714
  }
681
715
  }
682
716
  ]
683
- }), Nr = ({
717
+ }), wr = ({
684
718
  isLoading: t
685
719
  }) => /* @__PURE__ */ n(
686
- D,
720
+ P,
687
721
  {
688
722
  css: {
689
723
  visibility: t ? "visible" : "hidden",
@@ -692,12 +726,12 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
692
726
  right: "1rem",
693
727
  display: "flex"
694
728
  },
695
- children: /* @__PURE__ */ n(Ne, {})
729
+ children: /* @__PURE__ */ n(Se, {})
696
730
  }
697
- ), dn = ({
731
+ ), hn = ({
698
732
  isLoading: t,
699
- children: r,
700
- placeholderText: e,
733
+ children: e,
734
+ placeholderText: r,
701
735
  nodes: o,
702
736
  plugins: i,
703
737
  toolbar: l,
@@ -708,36 +742,36 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
708
742
  defaultState: f,
709
743
  css: u
710
744
  }) => {
711
- const { hasFocus: m, attributes: E } = Ge({ onBlur: c }), N = Z(null), k = Mt(() => ({ hasFocus: m, editorRef: N }), [m]);
712
- return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */ g(
713
- Oe,
745
+ const { hasFocus: m, attributes: w } = Xe({ onBlur: c }), N = et(null), k = Ct(() => ({ hasFocus: m, editorRef: N }), [m]);
746
+ return /* @__PURE__ */ n($t.Provider, { value: k, children: /* @__PURE__ */ g(
747
+ $e,
714
748
  {
715
749
  initialConfig: {
716
750
  namespace: "ain-rich-text",
717
751
  onError: (S) => {
718
752
  console.error(S);
719
753
  },
720
- theme: It,
754
+ theme: zt,
721
755
  nodes: o,
722
756
  editable: !0
723
757
  },
724
758
  children: [
725
759
  /* @__PURE__ */ g(
726
- yr,
760
+ Sr,
727
761
  {
728
762
  ref: N,
729
763
  hasFocus: m,
730
764
  hideBorder: d,
731
765
  css: u,
732
- ...E,
766
+ ...w,
733
767
  children: [
734
768
  l,
735
769
  /* @__PURE__ */ n(
736
- $e,
770
+ Ae,
737
771
  {
738
772
  contentEditable: s,
739
- placeholder: e ? /* @__PURE__ */ n(
740
- D,
773
+ placeholder: r ? /* @__PURE__ */ n(
774
+ P,
741
775
  {
742
776
  css: {
743
777
  position: "absolute",
@@ -747,25 +781,25 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
747
781
  pointerEvents: "none",
748
782
  fontSize: "$sm"
749
783
  },
750
- children: e
784
+ children: r
751
785
  }
752
786
  ) : null,
753
- ErrorBoundary: Be
787
+ ErrorBoundary: De
754
788
  }
755
789
  ),
756
- /* @__PURE__ */ n(Lr, {}),
790
+ /* @__PURE__ */ n(yr, {}),
757
791
  i,
758
- /* @__PURE__ */ n(Nr, { isLoading: t }),
759
- !l && /* @__PURE__ */ n(br, { children: a })
792
+ /* @__PURE__ */ n(wr, { isLoading: t }),
793
+ !l && /* @__PURE__ */ n(Mr, { children: a })
760
794
  ]
761
795
  }
762
796
  ),
763
- /* @__PURE__ */ n(xr, { state: f }),
764
- /* @__PURE__ */ n(K, { children: r })
797
+ /* @__PURE__ */ n(Nr, { state: f }),
798
+ /* @__PURE__ */ n(Y, { children: e })
765
799
  ]
766
800
  }
767
801
  ) });
768
- }, Sr = {
802
+ }, Er = {
769
803
  fontSize: "1rem",
770
804
  lineHeight: "1.5",
771
805
  "h1, h2, h3, h4, h5, h6": {
@@ -955,81 +989,81 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
955
989
  defaultVariants: {
956
990
  size: "md"
957
991
  }
958
- }, un = Se(Sr), hn = () => {
959
- const [t] = y(), r = v(() => {
960
- t.dispatchCommand(ge, {
992
+ }, pn = we(Er), gn = () => {
993
+ const [t] = y(), e = v(() => {
994
+ t.dispatchCommand(fe, {
961
995
  rows: "3",
962
996
  columns: "3",
963
997
  includeHeaders: !1
964
998
  });
965
999
  }, [t]);
966
1000
  return /* @__PURE__ */ n(
967
- tt,
1001
+ rt,
968
1002
  {
969
- trigger: /* @__PURE__ */ n(Tt, { dropdown: !0, children: "Sett inn" }),
1003
+ trigger: /* @__PURE__ */ n(Lt, { dropdown: !0, children: "Sett inn" }),
970
1004
  side: "bottom",
971
1005
  align: "end",
972
- children: /* @__PURE__ */ g(C, { onClick: r, children: [
973
- /* @__PURE__ */ n(ur, { size: "1.25rem" }),
1006
+ children: /* @__PURE__ */ g(C, { onClick: e, children: [
1007
+ /* @__PURE__ */ n(pr, { size: "1.25rem" }),
974
1008
  " Tabell"
975
1009
  ] })
976
1010
  }
977
1011
  );
978
1012
  };
979
- function Er(t) {
1013
+ function _r(t) {
980
1014
  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);
981
1015
  }
982
- const pn = () => {
983
- const [t] = y(), [r, e] = b(null), { hasFocus: o } = nt();
1016
+ const fn = () => {
1017
+ const [t] = y(), [e, r] = b(null), { hasFocus: o } = it();
984
1018
  x(() => {
985
- !o && r && e(null);
986
- }, [o, r]);
987
- const { refs: i, floatingStyles: l } = et({
1019
+ !o && e && r(null);
1020
+ }, [o, e]);
1021
+ const { refs: i, floatingStyles: l } = nt({
988
1022
  placement: "top-end",
989
- open: !!r,
1023
+ open: !!e,
990
1024
  elements: {
991
- reference: r
1025
+ reference: e
992
1026
  },
993
- middleware: [yt({ mainAxis: -20, crossAxis: -2 })]
1027
+ middleware: [Nt({ mainAxis: -20, crossAxis: -2 })]
994
1028
  });
995
1029
  x(() => t.registerCommand(
996
- P,
1030
+ F,
997
1031
  () => {
998
1032
  const s = T();
999
1033
  if (L(s)) {
1000
- const d = s.anchor.getNode(), c = fe(d);
1001
- e(c ? t.getElementByKey(c.getKey()) : null);
1034
+ const d = s.anchor.getNode(), c = me(d);
1035
+ r(c ? t.getElementByKey(c.getKey()) : null);
1002
1036
  }
1003
1037
  return !1;
1004
1038
  },
1005
- Jt
1039
+ Vt
1006
1040
  ), [t]);
1007
1041
  const a = (s) => () => {
1008
1042
  t.update(() => {
1009
1043
  switch (s) {
1010
1044
  case "add-row-over":
1011
- st(!1);
1045
+ dt(!1);
1012
1046
  break;
1013
1047
  case "add-row-under":
1014
- st(!0);
1048
+ dt(!0);
1015
1049
  break;
1016
1050
  case "add-column-left":
1017
- lt(!1);
1051
+ ct(!1);
1018
1052
  break;
1019
1053
  case "add-column-right":
1020
- lt(!0);
1054
+ ct(!0);
1021
1055
  break;
1022
1056
  case "delete-row":
1023
- ke();
1057
+ be();
1024
1058
  break;
1025
1059
  case "delete-column":
1026
- me();
1060
+ ke();
1027
1061
  break;
1028
1062
  }
1029
1063
  });
1030
1064
  };
1031
- return r ? /* @__PURE__ */ g(
1032
- tt,
1065
+ return e ? /* @__PURE__ */ g(
1066
+ rt,
1033
1067
  {
1034
1068
  trigger: /* @__PURE__ */ n(
1035
1069
  O,
@@ -1040,44 +1074,44 @@ const pn = () => {
1040
1074
  ref: i.setFloating,
1041
1075
  style: l,
1042
1076
  css: { padding: "2px", width: "18px", height: "18px" },
1043
- children: /* @__PURE__ */ n(Er, {})
1077
+ children: /* @__PURE__ */ n(_r, {})
1044
1078
  }
1045
1079
  ),
1046
1080
  children: [
1047
- /* @__PURE__ */ n(_, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1048
- /* @__PURE__ */ n(_, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1049
- /* @__PURE__ */ n(ct, {}),
1050
- /* @__PURE__ */ n(_, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1051
- /* @__PURE__ */ n(_, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1052
- /* @__PURE__ */ n(ct, {}),
1053
- /* @__PURE__ */ n(_, { onClick: a("delete-row"), children: "Fjern rad" }),
1054
- /* @__PURE__ */ n(_, { onClick: a("delete-column"), children: "Fjern kolonne" })
1081
+ /* @__PURE__ */ n(R, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1082
+ /* @__PURE__ */ n(R, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1083
+ /* @__PURE__ */ n(ut, {}),
1084
+ /* @__PURE__ */ n(R, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1085
+ /* @__PURE__ */ n(R, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1086
+ /* @__PURE__ */ n(ut, {}),
1087
+ /* @__PURE__ */ n(R, { onClick: a("delete-row"), children: "Fjern rad" }),
1088
+ /* @__PURE__ */ n(R, { onClick: a("delete-column"), children: "Fjern kolonne" })
1055
1089
  ]
1056
1090
  }
1057
1091
  ) : null;
1058
1092
  };
1059
- function At(t) {
1060
- let r = t;
1061
- const e = /^(?:(?: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;
1062
- return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
1093
+ function Bt(t) {
1094
+ let e = t;
1095
+ 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;
1096
+ return e = String(e).trim(), e.match(r) || e.match(o) ? e : "https://";
1063
1097
  }
1064
- function Dt(t) {
1065
- const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1066
- return o === i ? o : t.isBackward() ? at(e) ? o : i : at(r) ? o : i;
1098
+ function Pt(t) {
1099
+ const e = t.anchor, r = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1100
+ return o === i ? o : t.isBackward() ? st(r) ? o : i : st(e) ? o : i;
1067
1101
  }
1068
- const gn = (t) => (R.baseURL = t, R), W = class extends kt {
1102
+ const mn = (t) => (_.baseURL = t, _), j = class extends B {
1069
1103
  static getType() {
1070
1104
  return "rutine_link";
1071
1105
  }
1072
- static clone(r) {
1073
- return new W(r.__url, {}, r.__key);
1106
+ static clone(e) {
1107
+ return new j(e.__url, {}, e.__key);
1074
1108
  }
1075
- createDOM(r) {
1076
- const e = super.createDOM(r);
1077
- return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
1109
+ createDOM(e) {
1110
+ const r = super.createDOM(e);
1111
+ return r.setAttribute("href", this.getURL()), r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r.classList.add("rutine-link"), r;
1078
1112
  }
1079
- static importJSON(r) {
1080
- return Pt(r.url);
1113
+ static importJSON(e) {
1114
+ return Ft(e.url);
1081
1115
  }
1082
1116
  exportJSON() {
1083
1117
  return {
@@ -1089,38 +1123,38 @@ const gn = (t) => (R.baseURL = t, R), W = class extends kt {
1089
1123
  }
1090
1124
  getURL() {
1091
1125
  try {
1092
- return new URL(this.__url, W.baseURL).toString();
1126
+ return new URL(this.__url, j.baseURL).toString();
1093
1127
  } catch {
1094
1128
  return "";
1095
1129
  }
1096
1130
  }
1097
1131
  };
1098
- let R = W;
1099
- it(R, "baseURL", "");
1100
- function Pt(t) {
1101
- return new R(t);
1132
+ let _ = j;
1133
+ lt(_, "baseURL", "");
1134
+ function Ft(t) {
1135
+ return new _(t);
1102
1136
  }
1103
- function wr(t) {
1104
- return t instanceof R;
1137
+ function Rr(t) {
1138
+ return t instanceof _;
1105
1139
  }
1106
- const Rr = ({ onClose: t }) => {
1107
- const [r] = y(), e = v(
1140
+ const Ir = ({ onClose: t }) => {
1141
+ const [e] = y(), r = v(
1108
1142
  (i) => {
1109
- r.update(() => {
1143
+ e.update(() => {
1110
1144
  const l = T();
1111
1145
  if (L(l) && l.isCollapsed()) {
1112
1146
  const a = l.getNodes();
1113
1147
  if (a.length === 1) {
1114
1148
  const s = a[0];
1115
- Vt(s) && s.getChildren().length === 0 && l.insertText(i);
1149
+ Zt(s) && s.getChildren().length === 0 && l.insertText(i);
1116
1150
  }
1117
1151
  }
1118
- }), r.dispatchCommand(J, At(i));
1152
+ }), e.dispatchCommand(Z, Bt(i));
1119
1153
  },
1120
- [r]
1154
+ [e]
1121
1155
  );
1122
1156
  return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1123
- e(i.target.url.value), t();
1157
+ r(i.target.url.value), t();
1124
1158
  }, children: [
1125
1159
  /* @__PURE__ */ n(Re, { name: "url", label: "URL", type: "url", required: !0 }),
1126
1160
  /* @__PURE__ */ g(Rt, { children: [
@@ -1128,25 +1162,25 @@ const Rr = ({ onClose: t }) => {
1128
1162
  /* @__PURE__ */ n(O, { type: "submit", variant: "primary", children: "Lagre" })
1129
1163
  ] })
1130
1164
  ] });
1131
- }, _r = ({ onClose: t, getDocs: r }) => {
1132
- const [e] = y(), [o, i] = b([]), l = r(), a = v(
1165
+ }, zr = ({ onClose: t, getDocs: e }) => {
1166
+ const [r] = y(), [o, i] = b([]), l = e(), a = v(
1133
1167
  (s) => {
1134
- e.update(() => {
1168
+ r.update(() => {
1135
1169
  const d = T();
1136
1170
  if (L(d)) {
1137
1171
  const c = [];
1138
1172
  for (const [f, u] of s.entries()) {
1139
- const m = Pt(u.value);
1140
- m.append(A(u.label)), c.push(m), f !== s.length - 1 && c.push(A(" "));
1173
+ const m = Ft(u.value);
1174
+ m.append(D(u.label)), c.push(m), f !== s.length - 1 && c.push(D(" "));
1141
1175
  }
1142
1176
  d.insertNodes(c);
1143
1177
  }
1144
1178
  });
1145
1179
  },
1146
- [e]
1180
+ [r]
1147
1181
  );
1148
- return /* @__PURE__ */ g(K, { children: [
1149
- /* @__PURE__ */ n(_e, { isMulti: !0, options: l, onChange: i }),
1182
+ return /* @__PURE__ */ g(Y, { children: [
1183
+ /* @__PURE__ */ n(Ie, { isMulti: !0, options: l, onChange: i }),
1150
1184
  /* @__PURE__ */ g(Rt, { children: [
1151
1185
  /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1152
1186
  /* @__PURE__ */ n(
@@ -1161,48 +1195,48 @@ const Rr = ({ onClose: t }) => {
1161
1195
  )
1162
1196
  ] })
1163
1197
  ] });
1164
- }, Ir = ({
1198
+ }, Or = ({
1165
1199
  open: t,
1166
- onOpenChange: r,
1167
- getDocs: e
1200
+ onOpenChange: e,
1201
+ getDocs: r
1168
1202
  }) => {
1169
1203
  const [o, i] = b("url"), l = () => {
1170
- r(!1);
1204
+ e(!1);
1171
1205
  };
1172
- return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
1173
- /* @__PURE__ */ g(we, { css: { marginBottom: "$8" }, children: [
1174
- /* @__PURE__ */ n(dt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1175
- /* @__PURE__ */ n(dt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1206
+ return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
1207
+ /* @__PURE__ */ g(_e, { css: { marginBottom: "$8" }, children: [
1208
+ /* @__PURE__ */ n(ht, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1209
+ /* @__PURE__ */ n(ht, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1176
1210
  ] }),
1177
- o === "url" && /* @__PURE__ */ n(Rr, { onClose: l }),
1178
- o === "rutine" && /* @__PURE__ */ n(_r, { onClose: l, getDocs: e })
1211
+ o === "url" && /* @__PURE__ */ n(Ir, { onClose: l }),
1212
+ o === "rutine" && /* @__PURE__ */ n(zr, { onClose: l, getDocs: r })
1179
1213
  ] });
1180
- }, fn = ({ getDocs: t }) => {
1181
- const [r] = y(), [e, o] = b(!1), [i, l] = b(!1), a = v(() => {
1214
+ }, kn = ({ getDocs: t }) => {
1215
+ const [e] = y(), [r, o] = b(!1), [i, l] = b(!1), a = v(() => {
1182
1216
  const s = T();
1183
1217
  if (L(s)) {
1184
- const d = Dt(s), c = d.getParent();
1185
- o(H(c) || H(d));
1218
+ const d = Pt(s), c = d.getParent();
1219
+ o(U(c) || U(d));
1186
1220
  }
1187
1221
  }, []);
1188
- return x(() => r.registerCommand(
1189
- P,
1222
+ return x(() => e.registerCommand(
1223
+ F,
1190
1224
  () => (a(), !1),
1191
- X
1192
- ), [r, a]), /* @__PURE__ */ g(Lt, { type: "single", value: e ? "link" : "", children: [
1225
+ Q
1226
+ ), [e, a]), /* @__PURE__ */ g(xt, { type: "single", value: r ? "link" : "", children: [
1193
1227
  /* @__PURE__ */ n(
1194
1228
  I,
1195
1229
  {
1196
1230
  onClick: () => {
1197
- e ? r.dispatchCommand(J, null) : l(!0);
1231
+ r ? e.dispatchCommand(Z, null) : l(!0);
1198
1232
  },
1199
1233
  title: "Lenke",
1200
1234
  value: "link",
1201
- children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
1235
+ children: /* @__PURE__ */ n(lr, { size: "1.25rem" })
1202
1236
  }
1203
1237
  ),
1204
1238
  /* @__PURE__ */ n(
1205
- Ir,
1239
+ Or,
1206
1240
  {
1207
1241
  open: i,
1208
1242
  onOpenChange: l,
@@ -1210,67 +1244,67 @@ const Rr = ({ onClose: t }) => {
1210
1244
  }
1211
1245
  )
1212
1246
  ] });
1213
- }, mn = () => {
1214
- const [t] = y(), r = Z(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = nt();
1247
+ }, bn = () => {
1248
+ const [t] = y(), e = et(null), [r, o] = b(null), [i, l] = b(""), { hasFocus: a } = it();
1215
1249
  x(() => {
1216
- e ? t.update(() => {
1217
- l(e.getURL());
1250
+ r ? t.update(() => {
1251
+ l(r.getURL());
1218
1252
  }) : l("");
1219
- }, [t, e]);
1220
- const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = et({
1253
+ }, [t, r]);
1254
+ const s = !!(r && i && a), { refs: d, floatingStyles: c, context: f } = nt({
1221
1255
  placement: "top",
1222
1256
  strategy: "fixed",
1223
1257
  open: s,
1224
- whileElementsMounted: xt,
1258
+ whileElementsMounted: yt,
1225
1259
  elements: {
1226
- reference: r.current
1260
+ reference: e.current
1227
1261
  },
1228
- middleware: [Ie()]
1229
- }), { getFloatingProps: u } = Nt([
1230
- St(f),
1231
- ze(f)
1262
+ middleware: [ze()]
1263
+ }), { getFloatingProps: u } = St([
1264
+ wt(f),
1265
+ Oe(f)
1232
1266
  ]), m = v(() => {
1233
1267
  var S;
1234
1268
  const k = T();
1235
1269
  if (L(k)) {
1236
- const $ = Dt(k), p = $.getParent();
1237
- let F = null;
1238
- if (H(p) ? F = p : H($) && (F = $), F) {
1239
- const q = window.getSelection(), ot = t.getRootElement();
1240
- k !== null && q !== null && ot !== null && ot.contains(q.anchorNode) && t.isEditable() && (r.current = ((S = q.focusNode) == null ? void 0 : S.parentElement) ?? null);
1270
+ const $ = Pt(k), p = $.getParent();
1271
+ let H = null;
1272
+ if (U(p) ? H = p : U($) && (H = $), H) {
1273
+ const G = window.getSelection(), at = t.getRootElement();
1274
+ k !== null && G !== null && at !== null && at.contains(G.anchorNode) && t.isEditable() && (e.current = ((S = G.focusNode) == null ? void 0 : S.parentElement) ?? null);
1241
1275
  }
1242
- o(F);
1276
+ o(H);
1243
1277
  }
1244
- }, [t]), E = v(() => {
1245
- e && wr(e) && t.update(() => {
1246
- e.remove();
1247
- }), t.dispatchCommand(J, null);
1248
- }, [t, e]);
1278
+ }, [t]), w = v(() => {
1279
+ r && Rr(r) && t.update(() => {
1280
+ r.remove();
1281
+ }), t.dispatchCommand(Z, null);
1282
+ }, [t, r]);
1249
1283
  if (x(() => {
1250
1284
  t.getEditorState().read(() => {
1251
1285
  m();
1252
1286
  });
1253
- }, [t, m]), x(() => rt(
1287
+ }, [t, m]), x(() => ot(
1254
1288
  t.registerUpdateListener(({ editorState: k }) => {
1255
1289
  k.read(() => {
1256
1290
  m();
1257
1291
  });
1258
1292
  }),
1259
1293
  t.registerCommand(
1260
- P,
1294
+ F,
1261
1295
  () => (m(), !0),
1262
- w
1296
+ E
1263
1297
  ),
1264
1298
  t.registerCommand(
1265
- mt,
1266
- () => e ? (o(null), !0) : !1,
1267
- Zt
1299
+ bt,
1300
+ () => r ? (o(null), !0) : !1,
1301
+ te
1268
1302
  )
1269
- ), [t, m, e]), !s)
1303
+ ), [t, m, r]), !s)
1270
1304
  return null;
1271
- const N = At(i);
1305
+ const N = Bt(i);
1272
1306
  return /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ g(
1273
- wt,
1307
+ _t,
1274
1308
  {
1275
1309
  ref: d.setFloating,
1276
1310
  css: {
@@ -1284,7 +1318,7 @@ const Rr = ({ onClose: t }) => {
1284
1318
  ...u(),
1285
1319
  children: [
1286
1320
  /* @__PURE__ */ n(
1287
- D,
1321
+ P,
1288
1322
  {
1289
1323
  as: "a",
1290
1324
  css: {
@@ -1301,32 +1335,33 @@ const Rr = ({ onClose: t }) => {
1301
1335
  children: i
1302
1336
  }
1303
1337
  ),
1304
- /* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(De, { size: 24 }) })
1338
+ /* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Pe, { size: 24 }) })
1305
1339
  ]
1306
1340
  }
1307
1341
  ) });
1308
1342
  };
1309
1343
  export {
1310
- Pt as $createRutineLinkNode,
1311
- wr as $isRutineLinkNode,
1312
- br as FloatingToolbar,
1313
- hn as InsertSelector,
1314
- mn as LinkEditPlugin,
1315
- fn as LinkToolbarButton,
1316
- dn as RichTextEditor,
1317
- vr as RichTextToolbar,
1318
- R as RutineLinkNode,
1319
- gn as RutineLinkNodeInit,
1320
- pn as TableEditPlugin,
1321
- qe as clearEditorState,
1322
- cn as defaultNodes,
1323
- Ke as isEditorState,
1324
- zt as isJSON,
1325
- Ot as richTextContext,
1326
- un as richTextCss,
1327
- Sr as richTextStyleObj,
1328
- Ye as setStateFromPlainText,
1329
- sn as stateToHTML,
1330
- Ge as useHasFocusWithin,
1331
- nt as useRichTextContext
1344
+ Ft as $createRutineLinkNode,
1345
+ Rr as $isRutineLinkNode,
1346
+ Mr as FloatingToolbar,
1347
+ gn as InsertSelector,
1348
+ bn as LinkEditPlugin,
1349
+ kn as LinkToolbarButton,
1350
+ hn as RichTextEditor,
1351
+ Cr as RichTextToolbar,
1352
+ _ as RutineLinkNode,
1353
+ mn as RutineLinkNodeInit,
1354
+ fn as TableEditPlugin,
1355
+ Ye as clearEditorState,
1356
+ Je as defaultNodes,
1357
+ un as defaultViewNodes,
1358
+ qe as isEditorState,
1359
+ Ot as isJSON,
1360
+ $t as richTextContext,
1361
+ pn as richTextCss,
1362
+ Er as richTextStyleObj,
1363
+ Ge as setStateFromPlainText,
1364
+ dn as stateToHTML,
1365
+ Xe as useHasFocusWithin,
1366
+ it as useRichTextContext
1332
1367
  };