@pstdio/ui 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/{MermaidComponent-x3aKzNXm.js → MermaidComponent-D7Baqkwx.js} +2 -2
  2. package/dist/{MermaidComponent-x3aKzNXm.js.map → MermaidComponent-D7Baqkwx.js.map} +1 -1
  3. package/dist/chat-ui.js +744 -726
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/activity/activity-avatar.d.ts +9 -0
  6. package/dist/components/activity/activity-comment.d.ts +19 -0
  7. package/dist/components/activity/activity-composer.d.ts +18 -0
  8. package/dist/components/activity/activity-event.d.ts +12 -0
  9. package/dist/components/activity/activity-root.d.ts +15 -0
  10. package/dist/components/activity/activity-timeline.d.ts +6 -0
  11. package/dist/components/activity/activity.types.d.ts +5 -0
  12. package/dist/components/activity/index.d.ts +25 -0
  13. package/dist/components/app-shell/app-shell.d.ts +1 -0
  14. package/dist/components/app-shell/command-palette.d.ts +16 -0
  15. package/dist/components/app-shell/file-tree.d.ts +7 -0
  16. package/dist/components/app-shell/mock-chat.d.ts +2 -0
  17. package/dist/components/app-shell/mock-data.d.ts +37 -0
  18. package/dist/components/app-shell/pages/project-list-page.d.ts +7 -0
  19. package/dist/components/app-shell/pages/sessions-page.d.ts +6 -0
  20. package/dist/components/app-shell/pages/settings-page.d.ts +5 -0
  21. package/dist/components/app-shell/pages/ticket-details-page.d.ts +7 -0
  22. package/dist/components/app-shell/pages/tickets-page.d.ts +7 -0
  23. package/dist/components/app-shell/pages/workspace-page.d.ts +1 -0
  24. package/dist/components/app-shell/resizable-panel.d.ts +13 -0
  25. package/dist/components/chat-ui/components/ai-conversation.d.ts +4 -4
  26. package/dist/components/chat-ui/components/ai-message.d.ts +7 -5
  27. package/dist/components/chat-ui/components/chat-input.d.ts +1 -0
  28. package/dist/components/chat-ui/components/chat-panel.d.ts +1 -0
  29. package/dist/components/chat-ui/mocks/library/index.d.ts +10 -0
  30. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
  31. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  32. package/dist/components/content-placeholder.d.ts +1 -0
  33. package/dist/components/header.d.ts +7 -0
  34. package/dist/components/list-row/list-row-actions.d.ts +10 -0
  35. package/dist/components/list-row/list-row.d.ts +2 -0
  36. package/dist/components/list-row/list-row.types.d.ts +85 -0
  37. package/dist/components/{sidebar-tree → list-row}/searchable-action-menu.d.ts +2 -2
  38. package/dist/components/panel-header.constants.d.ts +1 -1
  39. package/dist/components/resource-context-menu.d.ts +1 -2
  40. package/dist/components/rich-text/shared/editor-config.d.ts +1 -0
  41. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/floating-toolbar-buttons.d.ts +16 -0
  42. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/commands.d.ts +2 -0
  43. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/index.d.ts +3 -0
  44. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/link-editor-content.d.ts +18 -0
  45. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/link-edit-state.d.ts +1 -0
  46. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/selection-link-url.d.ts +2 -0
  47. package/dist/components/rich-text/shared/plugins/LinkEditorPlugin/utils/setFloatingElemPos.d.ts +1 -1
  48. package/dist/components/rich-text/shared/transformers/markdown-transformers-test-utils.d.ts +3 -0
  49. package/dist/components/rich-text/shared/transformers/markdown-transformers.d.ts +1 -0
  50. package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -3
  51. package/dist/components/sidebar/sidebar.store.d.ts +2 -0
  52. package/dist/components/sidebar/sidebar.types.d.ts +10 -4
  53. package/dist/components/tickets/tickets-workspace.d.ts +1 -0
  54. package/dist/components/tree-list/tree-list.d.ts +18 -0
  55. package/dist/components/tree-list/tree-list.types.d.ts +29 -0
  56. package/dist/index.d.ts +10 -5
  57. package/dist/index.js +2697 -2343
  58. package/dist/index.js.map +1 -1
  59. package/dist/{rich-message-CoXTd5kw.js → rich-message-33DPxuWJ.js} +502 -464
  60. package/dist/rich-message-33DPxuWJ.js.map +1 -0
  61. package/dist/rich-text.js +738 -414
  62. package/dist/rich-text.js.map +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist/theme/custom/index.d.ts +3 -0
  65. package/dist/theme/custom/monokai.json.d.ts +80 -0
  66. package/dist/theme/index.d.ts +1 -0
  67. package/dist/theme/primitives/colors.d.ts +6 -0
  68. package/dist/theme/recipes/alert.d.ts +1 -1
  69. package/dist/theme/recipes/button.d.ts +28 -0
  70. package/dist/theme/recipes/dialog.d.ts +1 -1
  71. package/dist/theme/recipes/drawer.d.ts +1 -1
  72. package/dist/theme/recipes/kbd.d.ts +41 -0
  73. package/dist/theme/recipes/menu.d.ts +1 -1
  74. package/dist/theme/recipes/popover.d.ts +1 -1
  75. package/dist/theme/tokens/borders.d.ts +6 -24
  76. package/dist/theme/tokens/colors.d.ts +180 -168
  77. package/dist/theme/tokens/shadows.d.ts +5 -5
  78. package/dist/{theme-BLGUwVOD.js → theme-0SQvHr1t.js} +331 -243
  79. package/dist/theme-0SQvHr1t.js.map +1 -0
  80. package/dist/theme.js +4 -2
  81. package/dist/utils/apply-theme-preference.d.ts +20 -2
  82. package/dist/utils/theme-preference.d.ts +4 -2
  83. package/package.json +1 -2
  84. package/dist/components/drawer-inline.d.ts +0 -24
  85. package/dist/components/file-selector.d.ts +0 -12
  86. package/dist/components/menu-item.d.ts +0 -42
  87. package/dist/components/pstdio-logo.d.ts +0 -2
  88. package/dist/components/sidebar-tree/sidebar-node-content.d.ts +0 -9
  89. package/dist/components/sidebar-tree/sidebar-tree.d.ts +0 -13
  90. package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +0 -68
  91. package/dist/rich-message-CoXTd5kw.js.map +0 -1
  92. package/dist/theme-BLGUwVOD.js.map +0 -1
@@ -1,51 +1,51 @@
1
- import { CodeNode as ue, CodeHighlightNode as Ie, registerCodeHighlighting as ut } from "@lexical/code";
2
- import { AutoLinkNode as me, $createAutoLinkNode as mt, $isAutoLinkNode as ft, LinkNode as Oe } from "@lexical/link";
3
- import { ListNode as ke, ListItemNode as $e } from "@lexical/list";
4
- import { CHECK_LIST as ht, TRANSFORMERS as ve, $convertFromMarkdownString as we, $convertToMarkdownString as pt } from "@lexical/markdown";
5
- import { QuoteNode as Pe, HeadingNode as Le } from "@lexical/rich-text";
6
- import { jsx as l, jsxs as F, Fragment as Ee } from "react/jsx-runtime";
7
- import { chakra as se, Box as w, Text as P, Spacer as _t, IconButton as gt, Table as B, Textarea as Et, Tooltip as ee, Flex as fe, Kbd as xt } from "@chakra-ui/react";
8
- import { DecoratorNode as Y, $applyNodeReplacement as bt, ElementNode as Me, TextNode as te, $createTextNode as he, $nodesOfType as St, createCommand as I, isHTMLElement as yt, $createParagraphNode as le, COMMAND_PRIORITY_LOW as Ae, $getSelection as Tt, $isRangeSelection as Rt, $isElementNode as Nt, KEY_DOWN_COMMAND as Ct, COMMAND_PRIORITY_HIGH as It, $getRoot as De } from "lexical";
1
+ import { DecoratorNode as Z, $applyNodeReplacement as ut, ElementNode as $e, TextNode as re, $createTextNode as X, $nodesOfType as mt, createCommand as I, isHTMLElement as ft, $createParagraphNode as ce, COMMAND_PRIORITY_LOW as Oe, $getSelection as pt, $isRangeSelection as ht, $isElementNode as _t, KEY_DOWN_COMMAND as gt, COMMAND_PRIORITY_HIGH as Et, $getRoot as Le } from "lexical";
2
+ import { jsx as l, jsxs as F, Fragment as be } from "react/jsx-runtime";
9
3
  import { c as C } from "react/compiler-runtime";
10
- import { MarkNode as Ot } from "@lexical/mark";
11
- import { LexicalComposer as Fe } from "@lexical/react/LexicalComposer";
12
- import { LexicalErrorBoundary as He } from "@lexical/react/LexicalErrorBoundary";
13
- import { HistoryPlugin as kt } from "@lexical/react/LexicalHistoryPlugin";
14
- import { OnChangePlugin as qe } from "@lexical/react/LexicalOnChangePlugin";
15
- import { RichTextPlugin as ze } from "@lexical/react/LexicalRichTextPlugin";
16
- import * as $t from "react";
17
- import { Suspense as Be, lazy as vt, useEffect as q, useImperativeHandle as wt, useState as Pt, forwardRef as Lt, useRef as Mt } from "react";
4
+ import { chakra as ae, Box as v, Text as w, Spacer as xt, IconButton as bt, Table as z, Textarea as Tt, Tooltip as ne, Flex as fe, Kbd as St } from "@chakra-ui/react";
5
+ import { MarkNode as yt } from "@lexical/mark";
6
+ import { LexicalComposer as ve } from "@lexical/react/LexicalComposer";
7
+ import { LexicalErrorBoundary as we } from "@lexical/react/LexicalErrorBoundary";
8
+ import { HistoryPlugin as Rt } from "@lexical/react/LexicalHistoryPlugin";
9
+ import { OnChangePlugin as Pe } from "@lexical/react/LexicalOnChangePlugin";
10
+ import { RichTextPlugin as Me } from "@lexical/react/LexicalRichTextPlugin";
11
+ import * as Nt from "react";
12
+ import { Suspense as Ae, lazy as Ct, useEffect as B, useImperativeHandle as It, useState as kt, forwardRef as $t, useRef as Ot } from "react";
18
13
  import { useLexicalComposerContext as H } from "@lexical/react/LexicalComposerContext";
19
- import { $setBlocksType as At } from "@lexical/selection";
20
- import { addClassNamesToElement as We, mergeRegister as pe } from "@lexical/utils";
21
- import { LexicalTypeaheadMenuPlugin as Dt } from "@lexical/react/LexicalTypeaheadMenuPlugin";
22
- import * as Ft from "react-dom";
23
- import { ClickableLinkPlugin as Ht } from "@lexical/react/LexicalClickableLinkPlugin";
14
+ import { $setBlocksType as Lt } from "@lexical/selection";
15
+ import { addClassNamesToElement as De, mergeRegister as pe } from "@lexical/utils";
16
+ import { LexicalTypeaheadMenuPlugin as vt } from "@lexical/react/LexicalTypeaheadMenuPlugin";
17
+ import * as wt from "react-dom";
18
+ import { CodeNode as he, CodeHighlightNode as Fe, registerCodeHighlighting as Pt } from "@lexical/code";
19
+ import { LinkNode as _e, AutoLinkNode as ge, $createLinkNode as Mt, $isLinkNode as At, $isAutoLinkNode as He, $createAutoLinkNode as Dt } from "@lexical/link";
20
+ import { ListNode as Be, ListItemNode as Ue } from "@lexical/list";
21
+ import { CHECK_LIST as Ft, TRANSFORMERS as Ht, LINK as Bt, $convertFromMarkdownString as ze, $convertToMarkdownString as Ut } from "@lexical/markdown";
22
+ import { ClickableLinkPlugin as zt } from "@lexical/react/LexicalClickableLinkPlugin";
24
23
  import { HorizontalRulePlugin as qt } from "@lexical/react/LexicalHorizontalRulePlugin";
25
- import { LinkPlugin as zt } from "@lexical/react/LexicalLinkPlugin";
26
- import { ListPlugin as Bt } from "@lexical/react/LexicalListPlugin";
27
- import { TabIndentationPlugin as Wt } from "@lexical/react/LexicalTabIndentationPlugin";
28
- import { ContentEditable as Ut } from "@lexical/react/LexicalContentEditable";
29
- import { S as Jt, g as jt, T as Kt } from "./get-file-type-icon-Bwqf1WXA.js";
30
- import Vt from "katex";
31
- import { TreeView as Xt } from "@lexical/react/LexicalTreeView";
32
- import { X as Gt } from "lucide-react";
33
- const Yt = se(Ut);
34
- function Ue(n) {
24
+ import { LinkPlugin as Wt } from "@lexical/react/LexicalLinkPlugin";
25
+ import { ListPlugin as Jt } from "@lexical/react/LexicalListPlugin";
26
+ import { TabIndentationPlugin as jt } from "@lexical/react/LexicalTabIndentationPlugin";
27
+ import { QuoteNode as qe, HeadingNode as We } from "@lexical/rich-text";
28
+ import { ContentEditable as Kt } from "@lexical/react/LexicalContentEditable";
29
+ import { S as Gt, g as Vt, T as Xt } from "./get-file-type-icon-Bwqf1WXA.js";
30
+ import { X as Yt } from "lucide-react";
31
+ import Qt from "katex";
32
+ import { TreeView as Zt } from "@lexical/react/LexicalTreeView";
33
+ const en = ae(Kt);
34
+ function Je(n) {
35
35
  const e = C(11), {
36
36
  onRef: t,
37
37
  fullWidth: r,
38
38
  padding: o,
39
39
  isRichMessage: i,
40
40
  scrollable: s
41
- } = n, c = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i, h = s === void 0 ? !0 : s, u = c ? "100%" : "720px", p = c ? "0" : "auto";
42
- let f;
43
- e[0] !== u || e[1] !== p ? (f = /* @__PURE__ */ l(Yt, { "data-testid": "content-editable", height: "fit-content", minH: "100%", width: "100%", maxWidth: u, marginInline: p, textStyle: "paragraph/M/regular", fontSize: "calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))", position: "relative", outline: "none" }), e[0] = u, e[1] = p, e[2] = f) : f = e[2];
41
+ } = n, c = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i, p = s === void 0 ? !0 : s, u = c ? "100%" : "720px", h = c ? "0" : "auto";
42
+ let m;
43
+ e[0] !== u || e[1] !== h ? (m = /* @__PURE__ */ l(en, { "data-testid": "content-editable", height: "fit-content", minH: "100%", width: "100%", maxWidth: u, marginInline: h, textStyle: "paragraph/M/regular", fontSize: "calc(var(--chakra-font-sizes-md) * var(--rich-text-font-scale))", position: "relative", outline: "none" }), e[0] = u, e[1] = h, e[2] = m) : m = e[2];
44
44
  let d;
45
- e[3] !== t || e[4] !== o || e[5] !== f ? (d = /* @__PURE__ */ l(w, { ref: t, width: "100%", minH: "100%", padding: o, children: f }), e[3] = t, e[4] = o, e[5] = f, e[6] = d) : d = e[6];
46
- const m = d;
47
- if (!h)
48
- return m;
45
+ e[3] !== t || e[4] !== o || e[5] !== m ? (d = /* @__PURE__ */ l(v, { ref: t, width: "100%", minH: "100%", padding: o, children: m }), e[3] = t, e[4] = o, e[5] = m, e[6] = d) : d = e[6];
46
+ const f = d;
47
+ if (!p)
48
+ return f;
49
49
  const x = a ? "true" : void 0;
50
50
  let g;
51
51
  e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = {
@@ -53,9 +53,9 @@ function Ue(n) {
53
53
  minH: "100%"
54
54
  }, e[7] = g) : g = e[7];
55
55
  let _;
56
- return e[8] !== m || e[9] !== x ? (_ = /* @__PURE__ */ l(Jt, { className: "rich-text", "data-rich-message": x, height: "100%", minH: "0", position: "relative", contentProps: g, children: m }), e[8] = m, e[9] = x, e[10] = _) : _ = e[10], _;
56
+ return e[8] !== f || e[9] !== x ? (_ = /* @__PURE__ */ l(Gt, { className: "rich-text", "data-rich-message": x, height: "100%", minH: "0", position: "relative", contentProps: g, children: f }), e[8] = f, e[9] = x, e[10] = _) : _ = e[10], _;
57
57
  }
58
- const Qt = {
58
+ const tn = {
59
59
  sm: {
60
60
  container: {
61
61
  height: "20px",
@@ -78,7 +78,7 @@ const Qt = {
78
78
  iconSize: 14,
79
79
  textStyle: "sm"
80
80
  }
81
- }, Zt = {
81
+ }, nn = {
82
82
  neutral: {
83
83
  color: "color.primary",
84
84
  bg: "bg.muted",
@@ -93,7 +93,7 @@ const Qt = {
93
93
  bg: "var(--schub-accent-subtle)"
94
94
  }
95
95
  }
96
- }, en = "md", tn = "neutral", Je = (n) => {
96
+ }, rn = "md", on = "neutral", je = (n) => {
97
97
  const e = C(39);
98
98
  let t, r, o, i, s, c, a;
99
99
  e[0] !== n ? ({
@@ -105,50 +105,50 @@ const Qt = {
105
105
  icon: r,
106
106
  ...s
107
107
  } = n, e[0] = n, e[1] = t, e[2] = r, e[3] = o, e[4] = i, e[5] = s, e[6] = c, e[7] = a) : (t = e[1], r = e[2], o = e[3], i = e[4], s = e[5], c = e[6], a = e[7]);
108
- const h = c === void 0 ? en : c, u = a === void 0 ? tn : a;
109
- let p;
110
- e[8] !== t ? (p = jt(t), e[8] = t, e[9] = p) : p = e[9];
111
- const f = p, d = Qt[h], m = Zt[u], x = i ? "pointer" : "default";
108
+ const p = c === void 0 ? rn : c, u = a === void 0 ? on : a;
109
+ let h;
110
+ e[8] !== t ? (h = Vt(t), e[8] = t, e[9] = h) : h = e[9];
111
+ const m = h, d = tn[p], f = nn[u], x = i ? "pointer" : "default";
112
112
  let g;
113
- e[10] !== t || e[11] !== i ? (g = (O) => {
114
- O.stopPropagation(), i?.(t);
113
+ e[10] !== t || e[11] !== i ? (g = (k) => {
114
+ k.stopPropagation(), i?.(t);
115
115
  }, e[10] = t, e[11] = i, e[12] = g) : g = e[12];
116
116
  let _;
117
- e[13] !== f || e[14] !== r || e[15] !== d.iconSize ? (_ = r ?? /* @__PURE__ */ l(f, { size: d.iconSize }), e[13] = f, e[14] = r, e[15] = d.iconSize, e[16] = _) : _ = e[16];
118
- let T;
119
- e[17] !== _ ? (T = /* @__PURE__ */ l(se.span, { mr: "xs", display: "inline-flex", children: _ }), e[17] = _, e[18] = T) : T = e[18];
117
+ e[13] !== m || e[14] !== r || e[15] !== d.iconSize ? (_ = r ?? /* @__PURE__ */ l(m, { size: d.iconSize }), e[13] = m, e[14] = r, e[15] = d.iconSize, e[16] = _) : _ = e[16];
120
118
  let y;
121
- e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = {
119
+ e[17] !== _ ? (y = /* @__PURE__ */ l(ae.span, { mr: "xs", display: "inline-flex", children: _ }), e[17] = _, e[18] = y) : y = e[18];
120
+ let S;
121
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
122
122
  base: "14rem"
123
- }, e[19] = y) : y = e[19];
123
+ }, e[19] = S) : S = e[19];
124
124
  let R;
125
- e[20] !== t || e[21] !== d.textStyle ? (R = /* @__PURE__ */ l(P, { maxW: y, textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden", textStyle: d.textStyle, children: t }), e[20] = t, e[21] = d.textStyle, e[22] = R) : R = e[22];
125
+ e[20] !== t || e[21] !== d.textStyle ? (R = /* @__PURE__ */ l(w, { maxW: S, textOverflow: "ellipsis", whiteSpace: "nowrap", overflow: "hidden", textStyle: d.textStyle, children: t }), e[20] = t, e[21] = d.textStyle, e[22] = R) : R = e[22];
126
126
  let b;
127
- e[23] !== t || e[24] !== R ? (b = /* @__PURE__ */ l(Kt, { content: t, children: R }), e[23] = t, e[24] = R, e[25] = b) : b = e[25];
127
+ e[23] !== t || e[24] !== R ? (b = /* @__PURE__ */ l(Xt, { content: t, children: R }), e[23] = t, e[24] = R, e[25] = b) : b = e[25];
128
128
  let N;
129
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(_t, {}), e[26] = N) : N = e[26];
130
- let S;
131
- e[27] !== t || e[28] !== o ? (S = o && /* @__PURE__ */ l(gt, { "aria-label": "Remove reference", size: "2xs", ml: "xs", variant: "ghost", _hover: {
129
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(xt, {}), e[26] = N) : N = e[26];
130
+ let T;
131
+ e[27] !== t || e[28] !== o ? (T = o && /* @__PURE__ */ l(bt, { "aria-label": "Remove reference", size: "2xs", ml: "xs", variant: "ghost", _hover: {
132
132
  bg: "transparent"
133
- }, onClick: (O) => {
134
- O.stopPropagation(), o?.(t);
135
- }, children: /* @__PURE__ */ l(Gt, { size: 12 }) }), e[27] = t, e[28] = o, e[29] = S) : S = e[29];
133
+ }, onClick: (k) => {
134
+ k.stopPropagation(), o?.(t);
135
+ }, children: /* @__PURE__ */ l(Yt, { size: 12 }) }), e[27] = t, e[28] = o, e[29] = T) : T = e[29];
136
136
  let E;
137
- return e[30] !== s || e[31] !== d.container || e[32] !== S || e[33] !== x || e[34] !== g || e[35] !== T || e[36] !== b || e[37] !== m ? (E = /* @__PURE__ */ F(se.span, { display: "flex", flexDirection: "row", alignItems: "center", borderRadius: "xs", gap: "2xs", cursor: x, ...m, ...d.container, onClick: g, ...s, children: [
138
- T,
137
+ return e[30] !== s || e[31] !== d.container || e[32] !== T || e[33] !== x || e[34] !== g || e[35] !== y || e[36] !== b || e[37] !== f ? (E = /* @__PURE__ */ F(ae.span, { display: "flex", flexDirection: "row", alignItems: "center", borderRadius: "xs", gap: "2xs", cursor: x, ...f, ...d.container, onClick: g, ...s, children: [
138
+ y,
139
139
  b,
140
140
  N,
141
- S
142
- ] }), e[30] = s, e[31] = d.container, e[32] = S, e[33] = x, e[34] = g, e[35] = T, e[36] = b, e[37] = m, e[38] = E) : E = e[38], E;
141
+ T
142
+ ] }), e[30] = s, e[31] = d.container, e[32] = T, e[33] = x, e[34] = g, e[35] = y, e[36] = b, e[37] = f, e[38] = E) : E = e[38], E;
143
143
  };
144
- let re = class ce extends Y {
144
+ let ie = class de extends Z {
145
145
  __href;
146
146
  __label;
147
147
  static getType() {
148
148
  return "reference-link";
149
149
  }
150
150
  static clone(e) {
151
- return new ce(e.__href, e.__label, e.__key);
151
+ return new de(e.__href, e.__label, e.__key);
152
152
  }
153
153
  constructor(e, t, r) {
154
154
  super(r), this.__href = e, this.__label = t;
@@ -164,53 +164,53 @@ let re = class ce extends Y {
164
164
  }
165
165
  exportJSON() {
166
166
  return {
167
- type: ce.getType(),
167
+ type: de.getType(),
168
168
  version: 1,
169
169
  href: this.__href,
170
170
  label: this.__label
171
171
  };
172
172
  }
173
173
  static importJSON(e) {
174
- return je(e.href, e.label);
174
+ return Ke(e.href, e.label);
175
175
  }
176
176
  decorate(e, t) {
177
177
  const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
178
- return /* @__PURE__ */ l(w, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(Je, { fileName: i, onSelect: () => {
178
+ return /* @__PURE__ */ l(v, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
179
179
  if (s)
180
180
  window.open(r, "_blank", "noopener,noreferrer");
181
181
  else if (c) {
182
- const a = r.replace(/^#?\$PROJECT\//i, ""), h = new CustomEvent("ui:open-project-file", {
182
+ const a = r.replace(/^#?\$PROJECT\//i, ""), p = new CustomEvent("ui:open-project-file", {
183
183
  detail: a
184
184
  });
185
- window.dispatchEvent(h);
185
+ window.dispatchEvent(p);
186
186
  } else
187
187
  window.location.assign(r);
188
188
  } }) });
189
189
  }
190
190
  };
191
- function je(n, e) {
192
- return new re(n, e);
191
+ function Ke(n, e) {
192
+ return new ie(n, e);
193
193
  }
194
- function nn(n) {
195
- return n instanceof re;
194
+ function sn(n) {
195
+ return n instanceof ie;
196
196
  }
197
- const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
198
- dependencies: [re],
197
+ const Te = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, ln = {
198
+ dependencies: [ie],
199
199
  export: (n) => {
200
- if (nn(n)) {
200
+ if (sn(n)) {
201
201
  const e = n.__href, t = n.__label ?? e;
202
202
  return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
203
203
  }
204
204
  return null;
205
205
  },
206
- regExp: xe,
207
- importRegExp: xe,
206
+ regExp: Te,
207
+ importRegExp: Te,
208
208
  replace: (n, e) => {
209
209
  const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
210
- n.replace(je(o, i));
210
+ n.replace(Ke(o, i));
211
211
  },
212
212
  type: "text-match"
213
- }, _e = {
213
+ }, Ee = {
214
214
  code: "rich-text__code",
215
215
  codeHighlight: {
216
216
  atrule: "rich-text__tokenAttr",
@@ -284,26 +284,26 @@ const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
284
284
  row: "rich-text__row",
285
285
  content: "rich-text__content"
286
286
  }
287
- }, X = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", on = (n) => n == null ? "-" : typeof n == "string" ? n.length ? n : "-" : typeof n == "number" || typeof n == "boolean" ? String(n).toUpperCase() : n instanceof Date ? n.toISOString() : JSON.stringify(n), mo = (n) => {
287
+ }, Y = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", cn = (n) => n == null ? "-" : typeof n == "string" ? n.length ? n : "-" : typeof n == "number" || typeof n == "boolean" ? String(n).toUpperCase() : n instanceof Date ? n.toISOString() : JSON.stringify(n), To = (n) => {
288
288
  const e = C(6), {
289
289
  defaultCode: t,
290
290
  isEditable: r,
291
291
  showLineNumbers: o,
292
292
  disableScroll: i
293
- } = n, s = t === void 0 ? "" : t, c = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o, h = i === void 0 ? !1 : i;
293
+ } = n, s = t === void 0 ? "" : t, c = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o, p = i === void 0 ? !1 : i;
294
294
  if (c) {
295
- let p;
296
- return e[0] !== s ? (p = /* @__PURE__ */ l(Et, { defaultValue: s, fontFamily: "mono", fontSize: X, resize: "vertical", minHeight: "100%" }), e[0] = s, e[1] = p) : p = e[1], p;
295
+ let h;
296
+ return e[0] !== s ? (h = /* @__PURE__ */ l(Tt, { defaultValue: s, fontFamily: "mono", fontSize: Y, resize: "vertical", minHeight: "100%" }), e[0] = s, e[1] = h) : h = e[1], h;
297
297
  }
298
298
  let u;
299
- if (e[2] !== s || e[3] !== h || e[4] !== a) {
300
- const p = a ? s.split(`
299
+ if (e[2] !== s || e[3] !== p || e[4] !== a) {
300
+ const h = a ? s.split(`
301
301
  `) : [s];
302
- u = /* @__PURE__ */ l(w, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: X, lineHeight: "1.5", overflowY: h ? "hidden" : "auto", background: "bg.muted", borderRadius: "md", width: "100%", children: a ? /* @__PURE__ */ l(w, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: p.map(ln) }) : /* @__PURE__ */ l(w, { as: "code", children: s }) }), e[2] = s, e[3] = h, e[4] = a, e[5] = u;
302
+ u = /* @__PURE__ */ l(v, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: Y, lineHeight: "1.5", overflowY: p ? "hidden" : "auto", background: "bg.code", borderRadius: "md", width: "100%", children: a ? /* @__PURE__ */ l(v, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: h.map(dn) }) : /* @__PURE__ */ l(v, { as: "code", children: s }) }), e[2] = s, e[3] = p, e[4] = a, e[5] = u;
303
303
  } else
304
304
  u = e[5];
305
305
  return u;
306
- }, sn = (n) => {
306
+ }, an = (n) => {
307
307
  const e = C(26), {
308
308
  data: t,
309
309
  fullWidth: r,
@@ -312,54 +312,54 @@ const xe = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, rn = {
312
312
  } = n, s = r === void 0 ? !1 : r, c = o === void 0 ? !1 : o;
313
313
  let a;
314
314
  e[0] !== i ? (a = i === void 0 ? [] : i, e[0] = i, e[1] = a) : a = e[1];
315
- const h = a;
315
+ const p = a;
316
316
  if (!t.length) {
317
317
  const b = c ? "0" : "1px";
318
318
  let N;
319
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(P, { textStyle: "label/S/regular", fontSize: X, color: "fg.muted", children: "No data" }), e[2] = N) : N = e[2];
320
- let S;
321
- return e[3] !== b ? (S = /* @__PURE__ */ l(w, { padding: "sm", borderWidth: b, borderColor: "border.muted", children: N }), e[3] = b, e[4] = S) : S = e[4], S;
319
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(w, { textStyle: "label/S/regular", fontSize: Y, color: "fg.muted", children: "No data" }), e[2] = N) : N = e[2];
320
+ let T;
321
+ return e[3] !== b ? (T = /* @__PURE__ */ l(v, { padding: "sm", borderWidth: b, borderColor: "border.muted", children: N }), e[3] = b, e[4] = T) : T = e[4], T;
322
322
  }
323
323
  let u;
324
- e[5] !== h ? (u = new Set(h), e[5] = h, e[6] = u) : u = e[6];
325
- const p = u;
326
- let f;
327
- e[7] !== t[0] ? (f = Object.keys(t[0] ?? {}), e[7] = t[0], e[8] = f) : f = e[8];
324
+ e[5] !== p ? (u = new Set(p), e[5] = p, e[6] = u) : u = e[6];
325
+ const h = u;
326
+ let m;
327
+ e[7] !== t[0] ? (m = Object.keys(t[0] ?? {}), e[7] = t[0], e[8] = m) : m = e[8];
328
328
  let d;
329
- e[9] !== p || e[10] !== f ? (d = f.filter((b) => !p.has(b)), e[9] = p, e[10] = f, e[11] = d) : d = e[11];
330
- const m = d, x = s ? "100%" : "fit-content", g = c ? "0" : "1px";
329
+ e[9] !== h || e[10] !== m ? (d = m.filter((b) => !h.has(b)), e[9] = h, e[10] = m, e[11] = d) : d = e[11];
330
+ const f = d, x = s ? "100%" : "fit-content", g = c ? "0" : "1px";
331
331
  let _;
332
- e[12] !== m ? (_ = /* @__PURE__ */ l(B.Header, { children: /* @__PURE__ */ l(B.Row, { background: "bg.muted", children: m.map(cn) }) }), e[12] = m, e[13] = _) : _ = e[13];
333
- let T;
334
- if (e[14] !== m || e[15] !== t) {
332
+ e[12] !== f ? (_ = /* @__PURE__ */ l(z.Header, { children: /* @__PURE__ */ l(z.Row, { background: "bg.muted", children: f.map(un) }) }), e[12] = f, e[13] = _) : _ = e[13];
333
+ let y;
334
+ if (e[14] !== f || e[15] !== t) {
335
335
  let b;
336
- e[17] !== m ? (b = (N, S) => /* @__PURE__ */ l(B.Row, { children: m.map((E) => /* @__PURE__ */ l(B.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(P, { textStyle: "paragraph/S/regular", fontSize: X, children: on(N[E]) }) }, `${S}-${E}`)) }, `${S}-${m.join("-")}`), e[17] = m, e[18] = b) : b = e[18], T = t.map(b), e[14] = m, e[15] = t, e[16] = T;
336
+ e[17] !== f ? (b = (N, T) => /* @__PURE__ */ l(z.Row, { children: f.map((E) => /* @__PURE__ */ l(z.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(w, { textStyle: "paragraph/S/regular", fontSize: Y, children: cn(N[E]) }) }, `${T}-${E}`)) }, `${T}-${f.join("-")}`), e[17] = f, e[18] = b) : b = e[18], y = t.map(b), e[14] = f, e[15] = t, e[16] = y;
337
337
  } else
338
- T = e[16];
339
- let y;
340
- e[19] !== T ? (y = /* @__PURE__ */ l(B.Body, { children: T }), e[19] = T, e[20] = y) : y = e[20];
338
+ y = e[16];
339
+ let S;
340
+ e[19] !== y ? (S = /* @__PURE__ */ l(z.Body, { children: y }), e[19] = y, e[20] = S) : S = e[20];
341
341
  let R;
342
- return e[21] !== y || e[22] !== x || e[23] !== g || e[24] !== _ ? (R = /* @__PURE__ */ l(B.ScrollArea, { overflowX: "auto", maxWidth: "100%", children: /* @__PURE__ */ F(B.Root, { size: "sm", width: x, borderWidth: g, borderColor: "border.muted", children: [
342
+ return e[21] !== S || e[22] !== x || e[23] !== g || e[24] !== _ ? (R = /* @__PURE__ */ l(z.ScrollArea, { overflowX: "auto", maxWidth: "100%", children: /* @__PURE__ */ F(z.Root, { size: "sm", width: x, borderWidth: g, borderColor: "border.muted", children: [
343
343
  _,
344
- y
345
- ] }) }), e[21] = y, e[22] = x, e[23] = g, e[24] = _, e[25] = R) : R = e[25], R;
344
+ S
345
+ ] }) }), e[21] = S, e[22] = x, e[23] = g, e[24] = _, e[25] = R) : R = e[25], R;
346
346
  };
347
- function ln(n, e) {
348
- return /* @__PURE__ */ F(w, { as: "span", display: "contents", children: [
349
- /* @__PURE__ */ l(P, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
350
- /* @__PURE__ */ l(P, { as: "span", fontSize: "inherit", children: n.length ? n : " " })
347
+ function dn(n, e) {
348
+ return /* @__PURE__ */ F(v, { as: "span", display: "contents", children: [
349
+ /* @__PURE__ */ l(w, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
350
+ /* @__PURE__ */ l(w, { as: "span", fontSize: "inherit", children: n.length ? n : " " })
351
351
  ] }, `${e}-${n}`);
352
352
  }
353
- function cn(n) {
354
- return /* @__PURE__ */ l(B.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(P, { textStyle: "label/S/medium", fontSize: X, children: n }) }, n);
353
+ function un(n) {
354
+ return /* @__PURE__ */ l(z.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(w, { textStyle: "label/S/medium", fontSize: Y, children: n }) }, n);
355
355
  }
356
- class U extends Y {
356
+ class W extends Z {
357
357
  __data;
358
358
  static getType() {
359
359
  return "data_table";
360
360
  }
361
361
  static clone(e) {
362
- return new U(e.__data, e.__key);
362
+ return new W(e.__data, e.__key);
363
363
  }
364
364
  constructor(e, t) {
365
365
  super(t), this.__data = e;
@@ -374,7 +374,7 @@ class U extends Y {
374
374
  return !1;
375
375
  }
376
376
  decorate() {
377
- return /* @__PURE__ */ l(sn, { fullWidth: !0, isReadOnly: !0, data: this.__data });
377
+ return /* @__PURE__ */ l(an, { fullWidth: !0, isReadOnly: !0, data: this.__data });
378
378
  }
379
379
  exportJSON() {
380
380
  return {
@@ -384,7 +384,7 @@ class U extends Y {
384
384
  };
385
385
  }
386
386
  static importJSON(e) {
387
- return new U(e.data);
387
+ return new W(e.data);
388
388
  }
389
389
  getTextContent() {
390
390
  if (!this.__data.length) return "";
@@ -393,34 +393,34 @@ class U extends Y {
393
393
  `);
394
394
  }
395
395
  }
396
- function be(n) {
397
- return new U(n);
398
- }
399
396
  function Se(n) {
400
- return n instanceof U;
397
+ return new W(n);
401
398
  }
402
- const an = $t.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
403
399
  function ye(n) {
400
+ return n instanceof W;
401
+ }
402
+ const mn = Nt.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
403
+ function Re(n) {
404
404
  let e = n.getAttribute("data-lexical-equation");
405
405
  const t = n.getAttribute("data-lexical-inline") === "true";
406
406
  return e = atob(e || ""), e ? {
407
- node: oe(e, t)
407
+ node: se(e, t)
408
408
  } : null;
409
409
  }
410
- class W extends Y {
410
+ class q extends Z {
411
411
  __equation;
412
412
  __inline;
413
413
  static getType() {
414
414
  return "equation";
415
415
  }
416
416
  static clone(e) {
417
- return new W(e.__equation, e.__inline, e.__key);
417
+ return new q(e.__equation, e.__inline, e.__key);
418
418
  }
419
419
  constructor(e, t, r) {
420
420
  super(r), this.__equation = e, this.__inline = t ?? !1;
421
421
  }
422
422
  static importJSON(e) {
423
- return oe(e.equation, e.inline);
423
+ return se(e.equation, e.inline);
424
424
  }
425
425
  exportJSON() {
426
426
  return {
@@ -436,7 +436,7 @@ class W extends Y {
436
436
  }
437
437
  exportDOM() {
438
438
  const e = document.createElement(this.__inline ? "span" : "div"), t = btoa(this.__equation);
439
- return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`), Vt.render(this.__equation, e, {
439
+ return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`), Qt.render(this.__equation, e, {
440
440
  displayMode: !this.__inline,
441
441
  // true === block display //
442
442
  errorColor: "#cc0000",
@@ -451,11 +451,11 @@ class W extends Y {
451
451
  static importDOM() {
452
452
  return {
453
453
  div: (e) => e.hasAttribute("data-lexical-equation") ? {
454
- conversion: ye,
454
+ conversion: Re,
455
455
  priority: 2
456
456
  } : null,
457
457
  span: (e) => e.hasAttribute("data-lexical-equation") ? {
458
- conversion: ye,
458
+ conversion: Re,
459
459
  priority: 1
460
460
  } : null
461
461
  };
@@ -477,38 +477,38 @@ class W extends Y {
477
477
  return this.__inline;
478
478
  }
479
479
  decorate() {
480
- return /* @__PURE__ */ l(Be, { fallback: null, children: /* @__PURE__ */ l(an, { equation: this.__equation, inline: this.__inline }) });
480
+ return /* @__PURE__ */ l(Ae, { fallback: null, children: /* @__PURE__ */ l(mn, { equation: this.__equation, inline: this.__inline }) });
481
481
  }
482
482
  }
483
- function oe(n = "", e = !1) {
484
- const t = new W(n, e);
485
- return bt(t);
483
+ function se(n = "", e = !1) {
484
+ const t = new q(n, e);
485
+ return ut(t);
486
486
  }
487
- function Ke(n) {
488
- return n instanceof W;
487
+ function Ge(n) {
488
+ return n instanceof q;
489
489
  }
490
- const Ve = {
491
- dependencies: [W],
492
- export: (n) => Ke(n) && n.isInline() ? `\\( ${n.getEquation().trim()} \\)` : null,
490
+ const fn = {
491
+ dependencies: [q],
492
+ export: (n) => Ge(n) && n.isInline() ? `\\( ${n.getEquation().trim()} \\)` : null,
493
493
  importRegExp: /\\\((.*?)\\\)/,
494
494
  regExp: /\\\((.*?)\\\)/,
495
495
  replace: (n, e) => {
496
- const t = oe(e[1].trim(), !0);
496
+ const t = se(e[1].trim(), !0);
497
497
  n.replace(t);
498
498
  },
499
499
  type: "text-match"
500
- }, Xe = {
501
- dependencies: [W],
500
+ }, pn = {
501
+ dependencies: [q],
502
502
  regExpStart: /\\\[/,
503
503
  regExpEnd: /\\]/,
504
- export: (n) => Ke(n) && !n.isInline() ? `\\[ ${n.getEquation().trim()} \\]` : null,
505
- replace: (n, e, t, r, o) => o ? (n.append(oe(o.join(" "), !1)), !0) : !1,
504
+ export: (n) => Ge(n) && !n.isInline() ? `\\[ ${n.getEquation().trim()} \\]` : null,
505
+ replace: (n, e, t, r, o) => o ? (n.append(se(o.join(" "), !1)), !0) : !1,
506
506
  type: "multiline-element"
507
507
  };
508
- function dn() {
508
+ function hn() {
509
509
  return null;
510
510
  }
511
- class K extends Me {
511
+ class K extends $e {
512
512
  static getType() {
513
513
  return "hr";
514
514
  }
@@ -516,7 +516,7 @@ class K extends Me {
516
516
  return new K(e?.__key);
517
517
  }
518
518
  static importJSON(e) {
519
- return Ge();
519
+ return Ve();
520
520
  }
521
521
  exportJSON() {
522
522
  return {
@@ -534,14 +534,14 @@ class K extends Me {
534
534
  return null;
535
535
  }
536
536
  }
537
- function Ge() {
537
+ function Ve() {
538
538
  return new K();
539
539
  }
540
- function un(n) {
540
+ function _n(n) {
541
541
  return n instanceof K;
542
542
  }
543
- const mn = vt(() => import("./MermaidComponent-x3aKzNXm.js"));
544
- class J extends Y {
543
+ const gn = Ct(() => import("./MermaidComponent-D7Baqkwx.js"));
544
+ class J extends Z {
545
545
  __code;
546
546
  static getType() {
547
547
  return "mermaid";
@@ -581,25 +581,25 @@ ${this.__code}
581
581
  t.__code = e;
582
582
  }
583
583
  decorate() {
584
- return /* @__PURE__ */ l(Be, { fallback: null, children: /* @__PURE__ */ l(mn, { code: this.__code, nodeKey: this.__key }) });
584
+ return /* @__PURE__ */ l(Ae, { fallback: null, children: /* @__PURE__ */ l(gn, { code: this.__code, nodeKey: this.__key }) });
585
585
  }
586
586
  }
587
- function fo(n) {
587
+ function So(n) {
588
588
  return n instanceof J;
589
589
  }
590
- const fn = {
590
+ const En = {
591
591
  dependencies: [K],
592
- export: (n) => un(n) ? "***" : null,
592
+ export: (n) => _n(n) ? "***" : null,
593
593
  regExp: /^(---|\*\*\*|___)\s?$/,
594
594
  replace: (n) => {
595
- const e = Ge();
595
+ const e = Ve();
596
596
  n.replace(e);
597
597
  },
598
598
  type: "element"
599
- }, hn = {
599
+ }, xn = {
600
600
  dependencies: [],
601
601
  export: (n, e) => {
602
- if (Se(n)) {
602
+ if (ye(n)) {
603
603
  const t = n.getData();
604
604
  if (!t.length) return "";
605
605
  const r = Object.keys(t[0]), o = r.join(" | "), i = r.map(() => "---").join(" | "), s = t.map((c) => r.map((a) => String(c[a] || "")).join(" | "));
@@ -616,28 +616,28 @@ const fn = {
616
616
  return;
617
617
  }
618
618
  const s = t[0].split("|").slice(1, -1).map((c) => c.trim());
619
- if (o?.getType() === "data_table" && Se(o)) {
620
- const c = o.getData(), a = {}, h = c.length === 1 && Object.values(c[0]).every((d) => d === ""), u = c.length > 0 ? Object.keys(c[0]) : s.map((d, m) => `col_${m}`);
621
- s.forEach((d, m) => {
622
- const x = u[m] || `col_${m}`;
619
+ if (o?.getType() === "data_table" && ye(o)) {
620
+ const c = o.getData(), a = {}, p = c.length === 1 && Object.values(c[0]).every((d) => d === ""), u = c.length > 0 ? Object.keys(c[0]) : s.map((d, f) => `col_${f}`);
621
+ s.forEach((d, f) => {
622
+ const x = u[f] || `col_${f}`;
623
623
  a[x] = d;
624
624
  });
625
- const p = h ? [a] : [...c, a], f = be(p);
626
- o.replace(f), n.remove();
625
+ const h = p ? [a] : [...c, a], m = Se(h);
626
+ o.replace(m), n.remove();
627
627
  } else {
628
628
  const c = {};
629
- s.forEach((h, u) => {
630
- c[h || `col_${u}`] = "";
629
+ s.forEach((p, u) => {
630
+ c[p || `col_${u}`] = "";
631
631
  });
632
- const a = be([c]);
632
+ const a = Se([c]);
633
633
  n.replace(a);
634
634
  }
635
635
  },
636
636
  type: "element"
637
- }, pn = {
638
- dependencies: [te],
637
+ }, bn = {
638
+ dependencies: [re],
639
639
  export: (n, e) => {
640
- if (n instanceof te) {
640
+ if (n instanceof re) {
641
641
  let t = n.getTextContent();
642
642
  if (n.hasFormat("bold"))
643
643
  t = `**${t}**`;
@@ -654,55 +654,92 @@ const fn = {
654
654
  regExp: /<ins>(.*)<\/ins>/,
655
655
  importRegExp: /<ins>(.*)<\/ins>/,
656
656
  replace: (n, e) => {
657
- const t = he(e[1]);
657
+ const t = X(e[1]);
658
658
  t.toggleFormat("underline"), n.replace(t);
659
659
  },
660
660
  type: "text-match"
661
- }, _n = {
662
- dependencies: [te],
661
+ }, Tn = {
662
+ dependencies: [re],
663
663
  export: (n, e) => null,
664
664
  regExp: /<u>(.*)<\/u>/,
665
665
  importRegExp: /<u>(.*)<\/u>/,
666
666
  replace: (n, e) => {
667
- const t = he(e[1]);
667
+ const t = X(e[1]);
668
668
  t.toggleFormat("underline"), n.replace(t);
669
669
  },
670
670
  type: "text-match"
671
- }, Te = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, gn = {
672
- dependencies: [me],
673
- export: (n, e) => ft(n) ? e(n) : null,
674
- regExp: Te,
675
- importRegExp: Te,
671
+ }, Ne = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, V = (n) => n.replace(/\\([*_`~\\])/g, "$1"), Sn = (n) => n.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), yn = (n) => n?.replace(/\\(["\\])/g, "$1"), Xe = (n, e, t) => {
672
+ if (n !== e)
673
+ return t;
674
+ const r = e.replace(/([*_`~\\])/g, "\\$1");
675
+ return t.replace(r, e);
676
+ }, Rn = {
677
+ dependencies: [_e],
678
+ export: (n, e) => {
679
+ if (!At(n) || He(n))
680
+ return null;
681
+ const t = n.getTitle(), r = V(n.getURL()), o = Xe(n.getTextContent(), r, e(n));
682
+ return t != null ? `[${o}](${r} "${Sn(t)}")` : `[${o}](${r})`;
683
+ },
684
+ importRegExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,
685
+ regExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,
686
+ replace: (n, e) => {
687
+ const [, t, r, o] = e, i = V(r), s = Mt(i, {
688
+ title: yn(o)
689
+ }), c = t.split("[").length - 1, a = t.split("]").length - 1;
690
+ let p = t, u = "";
691
+ if (c < a)
692
+ return;
693
+ if (c > a) {
694
+ const d = t.split("[");
695
+ u = `[${d[0]}`, p = d.slice(1).join("[");
696
+ }
697
+ const h = V(p), m = X(h === i ? i : h);
698
+ return m.setFormat(n.getFormat()), s.append(m), n.replace(s), u && s.insertBefore(X(u)), m;
699
+ },
700
+ trigger: ")",
701
+ type: "text-match"
702
+ }, Nn = {
703
+ dependencies: [ge],
704
+ export: (n, e) => {
705
+ if (!He(n))
706
+ return null;
707
+ const t = V(n.getURL());
708
+ return Xe(n.getTextContent(), t, e(n));
709
+ },
710
+ regExp: Ne,
711
+ importRegExp: Ne,
676
712
  replace: (n, e) => {
677
- const t = e[0], r = mt(t), o = he(t);
713
+ const t = V(e[0]), r = Dt(t), o = X(t);
678
714
  o.setFormat(n.getFormat()), r.append(o), n.replace(r);
679
715
  },
680
716
  type: "text-match"
681
- }, Ye = [hn, fn, pn, _n, gn], ho = [Pe, Oe, me, U, Le, ke, $e, ue, Ie, J, W, K, re], po = [ht, ...ve, ...Ye, Ve, Xe, rn], _o = _e;
682
- function En(n) {
717
+ }, Cn = [xn, En, bn, Tn, Rn, Nn], yo = [qe, _e, ge, W, We, Be, Ue, he, Fe, J, q, K, ie], Ye = [Ft, ...Ht.filter((n) => n !== Bt), ...Cn, fn, pn], Ro = [...Ye, ln], No = Ee;
718
+ function In(n) {
683
719
  return n.trim().toLowerCase() === "mermaid";
684
720
  }
685
- function xn(n) {
721
+ function kn(n) {
686
722
  const e = n.getLanguage() ?? "plaintext";
687
- return En(e) ? (n.replace(new J(n.getTextContent())), !0) : !1;
723
+ return In(e) ? (n.replace(new J(n.getTextContent())), !0) : !1;
688
724
  }
689
- function bn() {
725
+ function $n() {
690
726
  const n = C(3), [e] = H();
691
727
  let t, r;
692
728
  return n[0] !== e ? (t = () => {
693
- e.update(Sn);
694
- }, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), q(t, r), null;
729
+ e.update(On);
730
+ }, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
695
731
  }
696
- function Sn() {
697
- const n = St(ue);
732
+ function On() {
733
+ const n = mt(he);
698
734
  for (const e of n)
699
- xn(e);
735
+ kn(e);
700
736
  }
701
- function yn() {
737
+ function Ln() {
702
738
  const n = C(3), [e] = H();
703
739
  let t, r;
704
- return n[0] !== e ? (t = () => ut(e), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), q(t, r), null;
740
+ return n[0] !== e ? (t = () => Pt(e), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
705
741
  }
742
+ const Co = I("TOGGLE_LINK_EDIT_MODE_COMMAND");
706
743
  function Qe(n) {
707
744
  const e = C(4), {
708
745
  isEditable: t
@@ -710,55 +747,55 @@ function Qe(n) {
710
747
  let o, i;
711
748
  return e[0] !== r || e[1] !== t ? (o = () => {
712
749
  r.setEditable(t);
713
- }, i = [t, r], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), q(o, i), null;
750
+ }, i = [t, r], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
714
751
  }
715
752
  function Ze() {
716
753
  const n = C(2), [e] = H();
717
754
  let t;
718
- return n[0] !== e ? (t = /* @__PURE__ */ l(w, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ l(Xt, { treeTypeButtonClassName: "debug-treetype-button", timeTravelButtonClassName: "debug-timetravel-button", timeTravelPanelButtonClassName: "debug-timetravel-button", timeTravelPanelClassName: "debug-timetravel-panel", timeTravelPanelSliderClassName: "debug-timetravel-slider", viewClassName: "tree-view-output", editor: e }) }), n[0] = e, n[1] = t) : t = n[1], t;
755
+ return n[0] !== e ? (t = /* @__PURE__ */ l(v, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ l(Zt, { treeTypeButtonClassName: "debug-treetype-button", timeTravelButtonClassName: "debug-timetravel-button", timeTravelPanelButtonClassName: "debug-timetravel-button", timeTravelPanelClassName: "debug-timetravel-panel", timeTravelPanelSliderClassName: "debug-timetravel-slider", viewClassName: "tree-view-output", editor: e }) }), n[0] = e, n[1] = t) : t = n[1], t;
719
756
  }
720
- const Tn = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/, Rn = /^```/, Nn = /^([ \t]*)((?:[-*+])|(?:\d+\.))\s+/, Cn = /^([ \t]+)/;
757
+ const vn = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/, wn = /^```/, Pn = /^([ \t]*)((?:[-*+])|(?:\d+\.))\s+/, Mn = /^([ \t]+)/;
721
758
  function et(n) {
722
759
  let e = 0;
723
760
  for (const t of n)
724
761
  e += t === " " ? 4 : 1;
725
762
  return e;
726
763
  }
727
- function In(n, e) {
764
+ function An(n, e) {
728
765
  return [...n].reverse().find((t) => t.sourceIndentWidth < e);
729
766
  }
730
- function ae(n, e, t) {
767
+ function ue(n, e, t) {
731
768
  return e === t && !n.includes(" ") ? n : " ".repeat(e);
732
769
  }
733
- function On(n, e) {
734
- const t = n.match(Cn);
770
+ function Dn(n, e) {
771
+ const t = n.match(Mn);
735
772
  if (!t)
736
773
  return n.trim() !== "" && (e.length = 0), n;
737
- const r = et(t[1]), o = In(e, r);
774
+ const r = et(t[1]), o = An(e, r);
738
775
  if (!o) return n;
739
- const i = r + (o.normalizedIndentWidth - o.sourceIndentWidth), s = ae(t[1], i, r);
776
+ const i = r + (o.normalizedIndentWidth - o.sourceIndentWidth), s = ue(t[1], i, r);
740
777
  return s === t[1] ? n : `${s}${n.slice(t[1].length)}`;
741
778
  }
742
- function kn(n, e, t) {
779
+ function Fn(n, e, t) {
743
780
  const r = et(e[1]);
744
781
  for (; t.length && t.at(-1).sourceIndentWidth > r; )
745
782
  t.pop();
746
783
  const o = t.at(-1);
747
784
  if (o?.sourceIndentWidth === r)
748
- return `${ae(e[1], o.normalizedIndentWidth, r)}${n.slice(e[1].length)}`;
785
+ return `${ue(e[1], o.normalizedIndentWidth, r)}${n.slice(e[1].length)}`;
749
786
  const i = t.at(-1), s = r - (i?.sourceIndentWidth ?? 0);
750
787
  let c = r;
751
788
  return i && s === 2 && !e[1].includes(" ") && (c = i.normalizedIndentWidth + 4), t.push({
752
789
  normalizedIndentWidth: c,
753
790
  sourceIndentWidth: r
754
- }), `${ae(e[1], c, r)}${n.slice(e[1].length)}`;
791
+ }), `${ue(e[1], c, r)}${n.slice(e[1].length)}`;
755
792
  }
756
- function $n(n, e) {
757
- if (Rn.test(n.trimStart()))
793
+ function Hn(n, e) {
794
+ if (wn.test(n.trimStart()))
758
795
  return e.isInCodeFence = !e.isInCodeFence, n;
759
796
  if (e.isInCodeFence) return n;
760
- const t = n.match(Nn);
761
- return t ? kn(n, t, e.activeListIndents) : On(n, e.activeListIndents);
797
+ const t = n.match(Pn);
798
+ return t ? Fn(n, t, e.activeListIndents) : Dn(n, e.activeListIndents);
762
799
  }
763
800
  function tt(n) {
764
801
  const e = n.split(`
@@ -766,11 +803,11 @@ function tt(n) {
766
803
  isInCodeFence: !1,
767
804
  activeListIndents: []
768
805
  };
769
- return e.map((r) => $n(r, t)).join(`
806
+ return e.map((r) => Hn(r, t)).join(`
770
807
  `);
771
808
  }
772
- function vn(n) {
773
- const e = n.match(Tn);
809
+ function Bn(n) {
810
+ const e = n.match(vn);
774
811
  return e ? {
775
812
  frontmatter: e[0],
776
813
  body: n.slice(e[0].length)
@@ -779,38 +816,38 @@ function vn(n) {
779
816
  body: n
780
817
  };
781
818
  }
782
- const wn = "UPLOAD_FILE", Pn = "OPEN_CONTEXT", Ln = "RUN_PROMPT", Mn = "UPDATE_FORMAT", An = "UPDATE_BEHAVIOR", Dn = "INSERT_PROMPT", Fn = "RENAME_PROMPT", Hn = "DUPLICATE_PROMPT", qn = "DELETE_PROMPT", zn = "DELETE_REFERENCES", Bn = "RENAME_REFERENCES", Wn = "INSERT_REFERENCE", Un = "INSERT_BLOCK";
783
- I(wn);
784
- I(Pn);
785
- I(Ln);
786
- I(Mn);
787
- I(An);
788
- I(Dn);
789
- I(Fn);
790
- I(Hn);
791
- I(qn);
819
+ const Un = "UPLOAD_FILE", zn = "OPEN_CONTEXT", qn = "RUN_PROMPT", Wn = "UPDATE_FORMAT", Jn = "UPDATE_BEHAVIOR", jn = "INSERT_PROMPT", Kn = "RENAME_PROMPT", Gn = "DUPLICATE_PROMPT", Vn = "DELETE_PROMPT", Xn = "DELETE_REFERENCES", Yn = "RENAME_REFERENCES", Qn = "INSERT_REFERENCE", Zn = "INSERT_BLOCK";
820
+ I(Un);
792
821
  I(zn);
793
- I(Bn);
794
- const nt = I(Wn), Jn = I(Un), jn = "INSERT_NEW_FILE_PLACEHOLDER", Kn = "INSERT_NEW_TEXT_PLACEHOLDER", Vn = "INSERT_PLACEHOLDER_REFERENCE";
822
+ I(qn);
823
+ I(Wn);
824
+ I(Jn);
795
825
  I(jn);
796
826
  I(Kn);
827
+ I(Gn);
797
828
  I(Vn);
798
- function Xn(n) {
799
- const e = ne();
829
+ I(Xn);
830
+ I(Yn);
831
+ const nt = I(Qn), er = I(Zn), tr = "INSERT_NEW_FILE_PLACEHOLDER", nr = "INSERT_NEW_TEXT_PLACEHOLDER", rr = "INSERT_PLACEHOLDER_REFERENCE";
832
+ I(tr);
833
+ I(nr);
834
+ I(rr);
835
+ function or(n) {
836
+ const e = oe();
800
837
  return n.style !== null && e.setFormat(n.style.textAlign), {
801
838
  node: e
802
839
  };
803
840
  }
804
- class Q extends Me {
841
+ class ee extends $e {
805
842
  static getType() {
806
843
  return "comment";
807
844
  }
808
845
  static clone(e) {
809
- return new Q(e.__key);
846
+ return new ee(e.__key);
810
847
  }
811
848
  createDOM(e) {
812
849
  const t = document.createElement("blockquote");
813
- return We(t, e.theme.comment), t;
850
+ return De(t, e.theme.comment), t;
814
851
  }
815
852
  updateDOM() {
816
853
  return !1;
@@ -818,7 +855,7 @@ class Q extends Me {
818
855
  static importDOM() {
819
856
  return {
820
857
  blockquote: () => ({
821
- conversion: Xn,
858
+ conversion: or,
822
859
  priority: 0
823
860
  })
824
861
  };
@@ -827,7 +864,7 @@ class Q extends Me {
827
864
  const {
828
865
  element: t
829
866
  } = super.exportDOM(e);
830
- if (t && yt(t)) {
867
+ if (t && ft(t)) {
831
868
  this.isEmpty() && t.append(document.createElement("br"));
832
869
  const r = this.getFormatType();
833
870
  t.style.textAlign = r;
@@ -839,7 +876,7 @@ class Q extends Me {
839
876
  };
840
877
  }
841
878
  static importJSON(e) {
842
- const t = ne();
879
+ const t = oe();
843
880
  return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
844
881
  }
845
882
  exportJSON() {
@@ -853,71 +890,71 @@ class Q extends Me {
853
890
  }
854
891
  // mutation
855
892
  insertNewAfter(e, t) {
856
- const r = le(), o = this.getDirection();
893
+ const r = ce(), o = this.getDirection();
857
894
  return r.setDirection(o), this.insertAfter(r, t), r;
858
895
  }
859
896
  collapseAtStart() {
860
- const e = le();
897
+ const e = ce();
861
898
  return this.getChildren().forEach((r) => {
862
899
  e.append(r);
863
900
  }), this.replace(e), !0;
864
901
  }
865
902
  }
866
- function ne() {
867
- return new Q();
903
+ function oe() {
904
+ return new ee();
868
905
  }
869
- const Gn = (n, e) => {
870
- const t = Tt(), r = ne();
906
+ const ir = (n, e) => {
907
+ const t = pt(), r = oe();
871
908
  if (e) {
872
909
  e.getParent()?.replace(r, !0), e.remove(), r.selectEnd();
873
910
  return;
874
911
  }
875
- Rt(t) && At(t, ne);
912
+ ht(t) && Lt(t, oe);
876
913
  };
877
- function Yn() {
914
+ function sr() {
878
915
  const n = C(3), [e] = H();
879
916
  let t, r;
880
- return n[0] !== e ? (t = () => pe(e.registerCommand(Jn, Qn, Ae)), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), q(t, r), null;
917
+ return n[0] !== e ? (t = () => pe(e.registerCommand(er, lr, Oe)), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
881
918
  }
882
- function Qn(n) {
919
+ function lr(n) {
883
920
  const {
884
921
  optionId: e,
885
922
  nodeToReplace: t
886
923
  } = n;
887
- return Gn(e, t), !1;
924
+ return ir(e, t), !1;
888
925
  }
889
- const Zn = () => {
926
+ const cr = () => {
890
927
  const n = C(3), [e] = H();
891
928
  let t, r;
892
- n[0] !== e ? (t = () => pe(e.registerNodeTransform(Q, (o) => {
893
- const s = o.getChildren().filter(er);
929
+ n[0] !== e ? (t = () => pe(e.registerNodeTransform(ee, (o) => {
930
+ const s = o.getChildren().filter(ar);
894
931
  s.length > 0 && e.update(() => {
895
- s.forEach(tr);
932
+ s.forEach(dr);
896
933
  });
897
- })), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), q(t, r);
934
+ })), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r);
898
935
  };
899
- function er(n) {
936
+ function ar(n) {
900
937
  return n.getType() === "comment";
901
938
  }
902
- function tr(n) {
903
- n.replace(le(), !0);
939
+ function dr(n) {
940
+ n.replace(ce(), !0);
904
941
  }
905
- function nr() {
906
- return Zn(), Yn(), null;
942
+ function ur() {
943
+ return cr(), sr(), null;
907
944
  }
908
- const rr = (n) => {
945
+ const mr = (n) => {
909
946
  let e = "";
910
947
  const t = n.getChildren(), r = t.length;
911
948
  for (let o = 0; o < r; o++) {
912
949
  const i = t[o];
913
- e += i.getTextContent(), Nt(i) && o !== r - 1 && !i.isInline() && (e += `
950
+ e += i.getTextContent(), _t(i) && o !== r - 1 && !i.isInline() && (e += `
914
951
  `);
915
952
  }
916
953
  return e;
917
- }, or = (n) => n.type !== "reference" ? null : `#${n.name ?? n.referenceId ?? ""}`, ir = (n) => n.type === "paragraph" && !!n.children?.length, rt = (n) => {
954
+ }, fr = (n) => n.type !== "reference" ? null : `#${n.name ?? n.referenceId ?? ""}`, pr = (n) => n.type === "paragraph" && !!n.children?.length, rt = (n) => {
918
955
  if (n.type === "comment")
919
956
  return "";
920
- const e = or(n);
957
+ const e = fr(n);
921
958
  if (e !== null)
922
959
  return e;
923
960
  let t = typeof n.text == "string" ? n.text : "";
@@ -931,7 +968,7 @@ const rr = (n) => {
931
968
  `);
932
969
  continue;
933
970
  }
934
- t += rt(s), ir(s) && (t += `
971
+ t += rt(s), pr(s) && (t += `
935
972
  `);
936
973
  }
937
974
  return t;
@@ -942,7 +979,7 @@ const rr = (n) => {
942
979
  } catch {
943
980
  return "";
944
981
  }
945
- }, sr = {
982
+ }, hr = {
946
983
  root: {
947
984
  direction: "ltr",
948
985
  format: "",
@@ -960,7 +997,7 @@ const rr = (n) => {
960
997
  }]
961
998
  }
962
999
  };
963
- function lr(n = "") {
1000
+ function _r(n = "") {
964
1001
  return n.trim() ? {
965
1002
  root: {
966
1003
  direction: "ltr",
@@ -986,9 +1023,9 @@ function lr(n = "") {
986
1023
  }] : []
987
1024
  }))
988
1025
  }
989
- } : JSON.parse(JSON.stringify(sr));
1026
+ } : JSON.parse(JSON.stringify(hr));
990
1027
  }
991
- function cr(n) {
1028
+ function gr(n) {
992
1029
  const e = C(4), {
993
1030
  editorRef: t,
994
1031
  previousTextRef: r
@@ -996,29 +1033,29 @@ function cr(n) {
996
1033
  let i, s;
997
1034
  return e[0] !== o || e[1] !== r ? (i = () => ({
998
1035
  setEditorValue: (c) => {
999
- const a = o.parseEditorState(JSON.stringify(lr(c)));
1036
+ const a = o.parseEditorState(JSON.stringify(_r(c)));
1000
1037
  o.setEditorState(a), r.current = ot(c), o.focus(void 0, {
1001
1038
  defaultSelection: "rootEnd"
1002
1039
  });
1003
1040
  }
1004
- }), s = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = s) : (i = e[2], s = e[3]), wt(t, i, s), null;
1041
+ }), s = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = s) : (i = e[2], s = e[3]), It(t, i, s), null;
1005
1042
  }
1006
- const ar = (n) => n.key !== "Enter" ? !1 : !n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey;
1007
- function dr(n) {
1043
+ const Er = (n) => n.key !== "Enter" ? !1 : !n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey;
1044
+ function xr(n) {
1008
1045
  const e = C(4), {
1009
1046
  onSubmit: t
1010
1047
  } = n, [r] = H();
1011
1048
  let o, i;
1012
- return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(Ct, (s) => ar(s) ? (s.preventDefault(), t?.(), !0) : !1, It), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), q(o, i), null;
1049
+ return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(gt, (s) => Er(s) ? (s.preventDefault(), t?.(), !0) : !1, Et), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
1013
1050
  }
1014
- const Re = ["table", "connector"], ur = (n) => n.sort((r, o) => Re.indexOf(r.group) - Re.indexOf(o.group)).map((r, o) => ({
1051
+ const Ce = ["table", "connector"], br = (n) => n.sort((r, o) => Ce.indexOf(r.group) - Ce.indexOf(o.group)).map((r, o) => ({
1015
1052
  ...r,
1016
1053
  index: o
1017
1054
  })).reduce((r, o) => {
1018
1055
  const i = r[o.group] ?? [];
1019
1056
  return i.push(o), r[o.group] = i, r;
1020
1057
  }, {});
1021
- function Ne(n) {
1058
+ function Ie(n) {
1022
1059
  const e = C(22), {
1023
1060
  id: t,
1024
1061
  isSelected: r,
@@ -1027,30 +1064,30 @@ function Ne(n) {
1027
1064
  setRefElement: s,
1028
1065
  secondaryLabel: c,
1029
1066
  primaryLabel: a,
1030
- tabIndex: h
1031
- } = n, u = h === void 0 ? -1 : h, p = r ? "bg.active" : "transparent", f = r ? "bg.active" : "bg.hover";
1067
+ tabIndex: p
1068
+ } = n, u = p === void 0 ? -1 : p, h = r ? "bg.active" : "transparent", m = r ? "bg.active" : "bg.hover";
1032
1069
  let d;
1033
- e[0] !== f ? (d = {
1034
- bg: f
1035
- }, e[0] = f, e[1] = d) : d = e[1];
1036
- let m;
1037
- e[2] !== a ? (m = /* @__PURE__ */ l(ee.Trigger, { children: /* @__PURE__ */ l(P, { mt: "1px", lineClamp: 1, textOverflow: "ellipsis", textStyle: "label/M/regular", children: a }) }), e[2] = a, e[3] = m) : m = e[3];
1070
+ e[0] !== m ? (d = {
1071
+ bg: m
1072
+ }, e[0] = m, e[1] = d) : d = e[1];
1073
+ let f;
1074
+ e[2] !== a ? (f = /* @__PURE__ */ l(ne.Trigger, { children: /* @__PURE__ */ l(w, { mt: "1px", lineClamp: 1, textOverflow: "ellipsis", textStyle: "label/M/regular", children: a }) }), e[2] = a, e[3] = f) : f = e[3];
1038
1075
  let x;
1039
- e[4] !== a ? (x = /* @__PURE__ */ l(ee.Positioner, { children: /* @__PURE__ */ l(ee.Content, { children: a }) }), e[4] = a, e[5] = x) : x = e[5];
1076
+ e[4] !== a ? (x = /* @__PURE__ */ l(ne.Positioner, { children: /* @__PURE__ */ l(ne.Content, { children: a }) }), e[4] = a, e[5] = x) : x = e[5];
1040
1077
  let g;
1041
- e[6] !== m || e[7] !== x ? (g = /* @__PURE__ */ F(ee.Root, { children: [
1042
- m,
1078
+ e[6] !== f || e[7] !== x ? (g = /* @__PURE__ */ F(ne.Root, { children: [
1079
+ f,
1043
1080
  x
1044
- ] }), e[6] = m, e[7] = x, e[8] = g) : g = e[8];
1081
+ ] }), e[6] = f, e[7] = x, e[8] = g) : g = e[8];
1045
1082
  let _;
1046
- e[9] !== c ? (_ = c && /* @__PURE__ */ l(P, { lineClamp: 2, textOverflow: "ellipsis", textStyle: "label/S/regular", color: "fg.muted", children: c }), e[9] = c, e[10] = _) : _ = e[10];
1047
- let T;
1048
- return e[11] !== t || e[12] !== r || e[13] !== o || e[14] !== i || e[15] !== s || e[16] !== p || e[17] !== d || e[18] !== g || e[19] !== _ || e[20] !== u ? (T = /* @__PURE__ */ F(fe, { direction: "column", cursor: "pointer", gap: "2xs", padding: "2xs", paddingX: "sm", bg: p, _hover: d, tabIndex: u, ref: s, role: "option", "aria-selected": r, id: t, onMouseEnter: i, onClick: o, children: [
1083
+ e[9] !== c ? (_ = c && /* @__PURE__ */ l(w, { lineClamp: 2, textOverflow: "ellipsis", textStyle: "label/S/regular", color: "fg.muted", children: c }), e[9] = c, e[10] = _) : _ = e[10];
1084
+ let y;
1085
+ return e[11] !== t || e[12] !== r || e[13] !== o || e[14] !== i || e[15] !== s || e[16] !== h || e[17] !== d || e[18] !== g || e[19] !== _ || e[20] !== u ? (y = /* @__PURE__ */ F(fe, { direction: "column", cursor: "pointer", gap: "2xs", padding: "2xs", paddingX: "sm", bg: h, _hover: d, tabIndex: u, ref: s, role: "option", "aria-selected": r, id: t, onMouseEnter: i, onClick: o, children: [
1049
1086
  g,
1050
1087
  _
1051
- ] }), e[11] = t, e[12] = r, e[13] = o, e[14] = i, e[15] = s, e[16] = p, e[17] = d, e[18] = g, e[19] = _, e[20] = u, e[21] = T) : T = e[21], T;
1088
+ ] }), e[11] = t, e[12] = r, e[13] = o, e[14] = i, e[15] = s, e[16] = h, e[17] = d, e[18] = g, e[19] = _, e[20] = u, e[21] = y) : y = e[21], y;
1052
1089
  }
1053
- const mr = (n) => {
1090
+ const Tr = (n) => {
1054
1091
  const e = C(12), {
1055
1092
  options: t,
1056
1093
  selectedIndex: r,
@@ -1059,37 +1096,37 @@ const mr = (n) => {
1059
1096
  } = n, {
1060
1097
  table: s,
1061
1098
  connector: c
1062
- } = ur(t), a = s === void 0 ? [] : s, h = c === void 0 ? [] : c, u = [...a, ...h].length;
1063
- let p, f;
1064
- e[0] !== r ? (p = () => {
1099
+ } = br(t), a = s === void 0 ? [] : s, p = c === void 0 ? [] : c, u = [...a, ...p].length;
1100
+ let h, m;
1101
+ e[0] !== r ? (h = () => {
1065
1102
  document.getElementById(`typeahead-item-${r}`)?.scrollIntoView({
1066
1103
  behavior: "instant",
1067
1104
  block: "nearest"
1068
1105
  });
1069
- }, f = [r], e[0] = r, e[1] = p, e[2] = f) : (p = e[1], f = e[2]), q(p, f);
1070
- const d = w, m = "1000", x = "absolute", g = "modal", _ = "auto", T = "24rem";
1071
- let y;
1072
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = {
1106
+ }, m = [r], e[0] = r, e[1] = h, e[2] = m) : (h = e[1], m = e[2]), B(h, m);
1107
+ const d = v, f = "1000", x = "absolute", g = "modal", _ = "auto", y = "24rem";
1108
+ let S;
1109
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = {
1073
1110
  base: "100vw",
1074
1111
  md: "264px"
1075
- }, e[3] = y) : y = e[3];
1112
+ }, e[3] = S) : S = e[3];
1076
1113
  let R;
1077
- e[4] !== u ? (R = !u && /* @__PURE__ */ l(P, { children: "No results" }), e[4] = u, e[5] = R) : R = e[5];
1078
- const b = !!a.length && /* @__PURE__ */ F(Ee, { children: [
1079
- /* @__PURE__ */ l(P, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Tables" }),
1080
- /* @__PURE__ */ l(w, { children: a.map((E) => /* @__PURE__ */ l(Ne, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
1081
- ] }), N = !!h.length && /* @__PURE__ */ F(Ee, { children: [
1082
- /* @__PURE__ */ l(P, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Data Sources" }),
1083
- /* @__PURE__ */ l(w, { children: h.map((E) => /* @__PURE__ */ l(Ne, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
1114
+ e[4] !== u ? (R = !u && /* @__PURE__ */ l(w, { children: "No results" }), e[4] = u, e[5] = R) : R = e[5];
1115
+ const b = !!a.length && /* @__PURE__ */ F(be, { children: [
1116
+ /* @__PURE__ */ l(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Tables" }),
1117
+ /* @__PURE__ */ l(v, { children: a.map((E) => /* @__PURE__ */ l(Ie, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
1118
+ ] }), N = !!p.length && /* @__PURE__ */ F(be, { children: [
1119
+ /* @__PURE__ */ l(w, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Data Sources" }),
1120
+ /* @__PURE__ */ l(v, { children: p.map((E) => /* @__PURE__ */ l(Ie, { id: `typeahead-item-${E.index}`, isSelected: r === E.index, onClick: () => o(E, E.index), onMouseEnter: () => i(E.index), primaryLabel: E.name, secondaryLabel: E.description, setRefElement: E.setRefElement, tabIndex: -1 }, E.id)) })
1084
1121
  ] });
1085
- let S;
1086
- return e[6] !== d || e[7] !== R || e[8] !== b || e[9] !== N || e[10] !== y ? (S = /* @__PURE__ */ F(d, { zIndex: m, position: x, layerStyle: g, overflow: _, maxHeight: T, minWidth: y, children: [
1122
+ let T;
1123
+ return e[6] !== d || e[7] !== R || e[8] !== b || e[9] !== N || e[10] !== S ? (T = /* @__PURE__ */ F(d, { zIndex: f, position: x, layerStyle: g, overflow: _, maxHeight: y, minWidth: S, children: [
1087
1124
  R,
1088
1125
  b,
1089
1126
  N
1090
- ] }), e[6] = d, e[7] = R, e[8] = b, e[9] = N, e[10] = y, e[11] = S) : S = e[11], S;
1091
- }, fr = (n, e) => n.filter((t) => t.name.replace(/ /g, "_").toLowerCase().includes(e.toLowerCase()));
1092
- function hr(n, e = []) {
1127
+ ] }), e[6] = d, e[7] = R, e[8] = b, e[9] = N, e[10] = S, e[11] = T) : T = e[11], T;
1128
+ }, Sr = (n, e) => n.filter((t) => t.name.replace(/ /g, "_").toLowerCase().includes(e.toLowerCase()));
1129
+ function yr(n, e = []) {
1093
1130
  const t = e.map((r, o) => ({
1094
1131
  id: r.resourceId,
1095
1132
  key: r.resourceId,
@@ -1100,12 +1137,12 @@ function hr(n, e = []) {
1100
1137
  setRefElement: () => {
1101
1138
  }
1102
1139
  }));
1103
- return n == null || n === "" ? t : fr(t, n);
1140
+ return n == null || n === "" ? t : Sr(t, n);
1104
1141
  }
1105
- const it = "\\.\\-<>_:", ge = ["#"].join(""), st = `[^${ge}${it}\\s]`, pr = `(?:[${it}]|)`, lt = 75, _r = new RegExp(`(^|\\s|\\()([${ge}]((?:${st}${pr}){0,${lt}}))$`), gr = new RegExp(`(^|\\s|\\()([${ge}]((?:${st}){0,${lt}}))$`);
1106
- function Er(n, e) {
1107
- let t = _r.exec(n);
1108
- if (t === null && (t = gr.exec(n)), t !== null) {
1142
+ const it = "\\.\\-<>_:", xe = ["#"].join(""), st = `[^${xe}${it}\\s]`, Rr = `(?:[${it}]|)`, lt = 75, Nr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}${Rr}){0,${lt}}))$`), Cr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}){0,${lt}}))$`);
1143
+ function Ir(n, e) {
1144
+ let t = Nr.exec(n);
1145
+ if (t === null && (t = Cr.exec(n)), t !== null) {
1109
1146
  const r = t[1], o = t[3];
1110
1147
  if (o.length >= e)
1111
1148
  return {
@@ -1116,16 +1153,16 @@ function Er(n, e) {
1116
1153
  }
1117
1154
  return null;
1118
1155
  }
1119
- const xr = 20;
1120
- function br(n) {
1156
+ const kr = 20;
1157
+ function $r(n) {
1121
1158
  const e = C(9), {
1122
1159
  items: t
1123
1160
  } = n;
1124
1161
  let r;
1125
1162
  e[0] !== t ? (r = t === void 0 ? [] : t, e[0] = t, e[1] = r) : r = e[1];
1126
- const o = r, [i, s] = Pt(null), [c] = H(), a = hr(i, o);
1127
- let h;
1128
- e[2] !== c ? (h = (x, g, _) => {
1163
+ const o = r, [i, s] = kt(null), [c] = H(), a = yr(i, o);
1164
+ let p;
1165
+ e[2] !== c ? (p = (x, g, _) => {
1129
1166
  c.update(() => {
1130
1167
  g && (c.dispatchCommand(nt, {
1131
1168
  resourceId: x.id,
@@ -1134,38 +1171,38 @@ function br(n) {
1134
1171
  nodeToReplace: g
1135
1172
  }), _());
1136
1173
  });
1137
- }, e[2] = c, e[3] = h) : h = e[3];
1138
- const u = h, p = yr;
1139
- let f;
1140
- e[4] !== a ? (f = a.slice(0, xr), e[4] = a, e[5] = f) : f = e[5];
1141
- const d = f;
1174
+ }, e[2] = c, e[3] = p) : p = e[3];
1175
+ const u = p, h = Lr;
1142
1176
  let m;
1143
- return e[6] !== d || e[7] !== u ? (m = /* @__PURE__ */ l(Dt, { onQueryChange: s, onSelectOption: u, triggerFn: p, options: d, menuRenderFn: Sr }), e[6] = d, e[7] = u, e[8] = m) : m = e[8], m;
1177
+ e[4] !== a ? (m = a.slice(0, kr), e[4] = a, e[5] = m) : m = e[5];
1178
+ const d = m;
1179
+ let f;
1180
+ return e[6] !== d || e[7] !== u ? (f = /* @__PURE__ */ l(vt, { onQueryChange: s, onSelectOption: u, triggerFn: h, options: d, menuRenderFn: Or }), e[6] = d, e[7] = u, e[8] = f) : f = e[8], f;
1144
1181
  }
1145
- function Sr(n, e) {
1182
+ function Or(n, e) {
1146
1183
  const {
1147
1184
  options: t,
1148
1185
  selectedIndex: r,
1149
1186
  selectOptionAndCleanUp: o,
1150
1187
  setHighlightedIndex: i
1151
1188
  } = e;
1152
- return n.current ? Ft.createPortal(/* @__PURE__ */ l(mr, { options: t, selectedIndex: r, onSelectItem: (s, c) => {
1189
+ return n.current ? wt.createPortal(/* @__PURE__ */ l(Tr, { options: t, selectedIndex: r, onSelectItem: (s, c) => {
1153
1190
  i(c), o(s);
1154
1191
  }, onMouseEnterItem: (s) => {
1155
1192
  i(s);
1156
1193
  } }), n.current) : null;
1157
1194
  }
1158
- function yr(n) {
1159
- return Er(n, 0);
1195
+ function Lr(n) {
1196
+ return Ir(n, 0);
1160
1197
  }
1161
- class G extends te {
1198
+ class Q extends re {
1162
1199
  __referenceId;
1163
1200
  __name;
1164
1201
  static getType() {
1165
1202
  return "reference";
1166
1203
  }
1167
1204
  static clone(e) {
1168
- return new G(e.__referenceId, e.__name, e.__key);
1205
+ return new Q(e.__referenceId, e.__name, e.__key);
1169
1206
  }
1170
1207
  constructor(e, t, r) {
1171
1208
  super(t, r), this.__referenceId = e, this.__name = t;
@@ -1184,7 +1221,7 @@ class G extends te {
1184
1221
  }
1185
1222
  createDOM(e) {
1186
1223
  const t = document.createElement("span");
1187
- return We(t, e.theme.reference), t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, t;
1224
+ return De(t, e.theme.reference), t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, t;
1188
1225
  }
1189
1226
  updateDOM(e, t) {
1190
1227
  return (e.__name !== this.__name || e.__referenceId !== this.__referenceId) && (t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`), !1;
@@ -1198,13 +1235,13 @@ class G extends te {
1198
1235
  static importDOM() {
1199
1236
  return {
1200
1237
  span: (e) => !e.hasAttribute("data-reference-id") || !e.hasAttribute("data-name") ? null : {
1201
- conversion: Tr,
1238
+ conversion: vr,
1202
1239
  priority: 1
1203
1240
  }
1204
1241
  };
1205
1242
  }
1206
1243
  static importJSON(e) {
1207
- return new G(e.referenceId, e.name);
1244
+ return new Q(e.referenceId, e.name);
1208
1245
  }
1209
1246
  exportJSON() {
1210
1247
  return {
@@ -1218,23 +1255,23 @@ class G extends te {
1218
1255
  return `#${this.__name}`;
1219
1256
  }
1220
1257
  }
1221
- function Tr(n) {
1258
+ function vr(n) {
1222
1259
  const e = n.getAttribute("data-reference-id"), t = n.getAttribute("data-name");
1223
1260
  return !e || !t ? null : {
1224
1261
  node: ct(e, t)
1225
1262
  };
1226
1263
  }
1227
1264
  function ct(n, e) {
1228
- return new G(n, e);
1265
+ return new Q(n, e);
1229
1266
  }
1230
- const Rr = (n, e, t) => {
1267
+ const wr = (n, e, t) => {
1231
1268
  const r = ct(e, t);
1232
1269
  if (n) {
1233
1270
  n?.replace(r), n.remove(), r.selectEnd();
1234
1271
  return;
1235
1272
  }
1236
1273
  };
1237
- function Nr(n) {
1274
+ function Pr(n) {
1238
1275
  const e = C(4), {
1239
1276
  onAddReference: t
1240
1277
  } = n, [r] = H();
@@ -1243,98 +1280,98 @@ function Nr(n) {
1243
1280
  const {
1244
1281
  resourceId: c,
1245
1282
  resourceType: a,
1246
- name: h,
1283
+ name: p,
1247
1284
  nodeToReplace: u
1248
1285
  } = s;
1249
1286
  return r.update(() => {
1250
- Rr(u, c, h);
1287
+ wr(u, c, p);
1251
1288
  }), t?.(c, a), !0;
1252
- }, Ae)), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), q(o, i), null;
1289
+ }, Oe)), i = [r, t], e[0] = r, e[1] = t, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), B(o, i), null;
1253
1290
  }
1254
- const Cr = {
1255
- ..._e,
1291
+ const Mr = {
1292
+ ...Ee,
1256
1293
  // Override paragraph class to remove margins specifically for prompt input
1257
1294
  paragraph: "rich-text__p rich-text__p--no-margin"
1258
- }, Ir = [Q, Ot, G], Or = (n, e) => {
1295
+ }, Ar = [ee, yt, Q], Dr = (n, e) => {
1259
1296
  const t = C(39), {
1260
1297
  defaultState: r,
1261
1298
  debug: o,
1262
1299
  isEditable: i,
1263
1300
  placeholder: s
1264
1301
  } = n, c = o === void 0 ? !1 : o, a = i === void 0 ? !0 : i, {
1265
- onChange: h,
1302
+ onChange: p,
1266
1303
  onError: u,
1267
- onSubmit: p,
1268
- references: f,
1304
+ onSubmit: h,
1305
+ references: m,
1269
1306
  onAddReference: d
1270
- } = n, m = u === void 0 ? kr : u;
1307
+ } = n, f = u === void 0 ? Fr : u;
1271
1308
  let x;
1272
- t[0] !== f ? (x = f === void 0 ? [] : f, t[0] = f, t[1] = x) : x = t[1];
1309
+ t[0] !== m ? (x = m === void 0 ? [] : m, t[0] = m, t[1] = x) : x = t[1];
1273
1310
  const g = x;
1274
1311
  let _;
1275
- t[2] !== r || t[3] !== a || t[4] !== m ? (_ = {
1312
+ t[2] !== r || t[3] !== a || t[4] !== f ? (_ = {
1276
1313
  namespace: "PROMPT_EDITOR",
1277
- nodes: Ir,
1314
+ nodes: Ar,
1278
1315
  editorState: r,
1279
1316
  editable: a,
1280
- onError: m,
1281
- theme: Cr
1282
- }, t[2] = r, t[3] = a, t[4] = m, t[5] = _) : _ = t[5];
1283
- const T = _;
1284
- let y;
1285
- t[6] !== r ? (y = ot(r), t[6] = r, t[7] = y) : y = t[7];
1286
- const R = Mt(y);
1317
+ onError: f,
1318
+ theme: Mr
1319
+ }, t[2] = r, t[3] = a, t[4] = f, t[5] = _) : _ = t[5];
1320
+ const y = _;
1321
+ let S;
1322
+ t[6] !== r ? (S = ot(r), t[6] = r, t[7] = S) : S = t[7];
1323
+ const R = Ot(S);
1287
1324
  let b;
1288
- t[8] !== s ? (b = s ?? /* @__PURE__ */ F(P, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: [
1325
+ t[8] !== s ? (b = s ?? /* @__PURE__ */ F(w, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: [
1289
1326
  "Type your query here or press ",
1290
- /* @__PURE__ */ l(xt, { color: "fg.subtle", children: "#" }),
1327
+ /* @__PURE__ */ l(St, { color: "fg.subtle", children: "#" }),
1291
1328
  " to add a reference."
1292
1329
  ] }), t[8] = s, t[9] = b) : b = t[9];
1293
1330
  const N = b;
1294
- let S;
1295
- t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(kt, {}), t[10] = S) : S = t[10];
1331
+ let T;
1332
+ t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ l(Rt, {}), t[10] = T) : T = t[10];
1296
1333
  let E;
1297
- t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(Ue, { fullWidth: !0 }), t[11] = E) : E = t[11];
1298
- let O;
1299
- t[12] !== N ? (O = /* @__PURE__ */ l(ze, { contentEditable: E, placeholder: N, ErrorBoundary: He }), t[12] = N, t[13] = O) : O = t[13];
1300
- let L;
1301
- t[14] !== h ? (L = /* @__PURE__ */ l(qe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (Z) => {
1302
- Z.read(() => {
1303
- const dt = De(), ie = rr(dt);
1304
- ie !== R.current && (R.current = ie, h?.(ie, Z.toJSON()));
1334
+ t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(Je, { fullWidth: !0 }), t[11] = E) : E = t[11];
1335
+ let k;
1336
+ t[12] !== N ? (k = /* @__PURE__ */ l(Me, { contentEditable: E, placeholder: N, ErrorBoundary: we }), t[12] = N, t[13] = k) : k = t[13];
1337
+ let P;
1338
+ t[14] !== p ? (P = /* @__PURE__ */ l(Pe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (te) => {
1339
+ te.read(() => {
1340
+ const dt = Le(), le = mr(dt);
1341
+ le !== R.current && (R.current = le, p?.(le, te.toJSON()));
1305
1342
  });
1306
- } }), t[14] = h, t[15] = L) : L = t[15];
1343
+ } }), t[14] = p, t[15] = P) : P = t[15];
1307
1344
  let M;
1308
- t[16] !== e ? (M = /* @__PURE__ */ l(cr, { editorRef: e, previousTextRef: R }), t[16] = e, t[17] = M) : M = t[17];
1309
- let k;
1310
- t[18] !== a ? (k = /* @__PURE__ */ l(Qe, { isEditable: a }), t[18] = a, t[19] = k) : k = t[19];
1311
- let A;
1312
- t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ l(nr, {}), t[20] = A) : A = t[20];
1345
+ t[16] !== e ? (M = /* @__PURE__ */ l(gr, { editorRef: e, previousTextRef: R }), t[16] = e, t[17] = M) : M = t[17];
1313
1346
  let $;
1314
- t[21] !== p ? ($ = /* @__PURE__ */ l(dr, { onSubmit: p }), t[21] = p, t[22] = $) : $ = t[22];
1315
- let v;
1316
- t[23] !== g ? (v = /* @__PURE__ */ l(br, { items: g }), t[23] = g, t[24] = v) : v = t[24];
1347
+ t[18] !== a ? ($ = /* @__PURE__ */ l(Qe, { isEditable: a }), t[18] = a, t[19] = $) : $ = t[19];
1348
+ let A;
1349
+ t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ l(ur, {}), t[20] = A) : A = t[20];
1350
+ let O;
1351
+ t[21] !== h ? (O = /* @__PURE__ */ l(xr, { onSubmit: h }), t[21] = h, t[22] = O) : O = t[22];
1352
+ let L;
1353
+ t[23] !== g ? (L = /* @__PURE__ */ l($r, { items: g }), t[23] = g, t[24] = L) : L = t[24];
1317
1354
  let D;
1318
- t[25] !== d ? (D = /* @__PURE__ */ l(Nr, { onAddReference: d }), t[25] = d, t[26] = D) : D = t[26];
1319
- let z;
1320
- t[27] !== c ? (z = c ? /* @__PURE__ */ l(Ze, {}) : "", t[27] = c, t[28] = z) : z = t[28];
1321
- let V;
1322
- return t[29] !== T || t[30] !== O || t[31] !== L || t[32] !== M || t[33] !== k || t[34] !== $ || t[35] !== v || t[36] !== D || t[37] !== z ? (V = /* @__PURE__ */ l(fe, { direction: "column", justifyContent: "space-between", width: "100%", position: "relative", children: /* @__PURE__ */ F(Fe, { initialConfig: T, children: [
1323
- S,
1324
- O,
1325
- L,
1326
- M,
1355
+ t[25] !== d ? (D = /* @__PURE__ */ l(Pr, { onAddReference: d }), t[25] = d, t[26] = D) : D = t[26];
1356
+ let U;
1357
+ t[27] !== c ? (U = c ? /* @__PURE__ */ l(Ze, {}) : "", t[27] = c, t[28] = U) : U = t[28];
1358
+ let G;
1359
+ return t[29] !== y || t[30] !== k || t[31] !== P || t[32] !== M || t[33] !== $ || t[34] !== O || t[35] !== L || t[36] !== D || t[37] !== U ? (G = /* @__PURE__ */ l(fe, { direction: "column", justifyContent: "space-between", width: "100%", position: "relative", children: /* @__PURE__ */ F(ve, { initialConfig: y, children: [
1360
+ T,
1327
1361
  k,
1328
- A,
1362
+ P,
1363
+ M,
1329
1364
  $,
1330
- v,
1365
+ A,
1366
+ O,
1367
+ L,
1331
1368
  D,
1332
- z
1333
- ] }) }), t[29] = T, t[30] = O, t[31] = L, t[32] = M, t[33] = k, t[34] = $, t[35] = v, t[36] = D, t[37] = z, t[38] = V) : V = t[38], V;
1334
- }, go = Lt(Or);
1335
- function kr() {
1369
+ U
1370
+ ] }) }), t[29] = y, t[30] = k, t[31] = P, t[32] = M, t[33] = $, t[34] = O, t[35] = L, t[36] = D, t[37] = U, t[38] = G) : G = t[38], G;
1371
+ }, Io = $t(Dr);
1372
+ function Fr() {
1336
1373
  }
1337
- function $r(n) {
1374
+ function Hr(n) {
1338
1375
  const e = C(5), {
1339
1376
  value: t,
1340
1377
  onUpdate: r
@@ -1344,9 +1381,9 @@ function $r(n) {
1344
1381
  o && o.update(() => r(t), {
1345
1382
  tag: "history-merge"
1346
1383
  });
1347
- }, s = [t, o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = i, e[4] = s) : (i = e[3], s = e[4]), q(i, s), null;
1384
+ }, s = [t, o, r], e[0] = o, e[1] = r, e[2] = t, e[3] = i, e[4] = s) : (i = e[3], s = e[4]), B(i, s), null;
1348
1385
  }
1349
- class j extends Y {
1386
+ class j extends Z {
1350
1387
  __href;
1351
1388
  __label;
1352
1389
  static getType() {
@@ -1380,14 +1417,14 @@ class j extends Y {
1380
1417
  }
1381
1418
  decorate(e, t) {
1382
1419
  const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
1383
- return /* @__PURE__ */ l(w, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(Je, { fileName: i, onSelect: () => {
1420
+ return /* @__PURE__ */ l(v, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
1384
1421
  if (s)
1385
1422
  window.open(r, "_blank", "noopener,noreferrer");
1386
1423
  else if (c) {
1387
- const a = r.replace(/^#?\$PROJECT\//i, ""), h = new CustomEvent("ui:open-project-file", {
1424
+ const a = r.replace(/^#?\$PROJECT\//i, ""), p = new CustomEvent("ui:open-project-file", {
1388
1425
  detail: a
1389
1426
  });
1390
- window.dispatchEvent(h);
1427
+ window.dispatchEvent(p);
1391
1428
  } else
1392
1429
  window.location.assign(r);
1393
1430
  } }) });
@@ -1396,117 +1433,118 @@ class j extends Y {
1396
1433
  function at(n, e) {
1397
1434
  return new j(n, e);
1398
1435
  }
1399
- function vr(n) {
1436
+ function Br(n) {
1400
1437
  return n instanceof j;
1401
1438
  }
1402
- const Ce = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, wr = {
1439
+ const ke = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Ur = {
1403
1440
  dependencies: [j],
1404
1441
  export: (n) => {
1405
- if (vr(n)) {
1442
+ if (Br(n)) {
1406
1443
  const e = n.__href, t = n.__label ?? e;
1407
1444
  return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
1408
1445
  }
1409
1446
  return null;
1410
1447
  },
1411
- regExp: Ce,
1412
- importRegExp: Ce,
1448
+ regExp: ke,
1449
+ importRegExp: ke,
1413
1450
  replace: (n, e) => {
1414
1451
  const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
1415
1452
  n.replace(at(o, i));
1416
1453
  },
1417
1454
  type: "text-match"
1418
- }, de = [...ve, ...Ye, Ve, Xe, wr];
1419
- function Eo(n) {
1455
+ }, me = [...Ye, Ur];
1456
+ function ko(n) {
1420
1457
  const e = C(37), {
1421
1458
  debug: t,
1422
1459
  defaultState: r,
1423
1460
  fullWidth: o,
1424
1461
  isEditable: i,
1425
1462
  onChange: s
1426
- } = n, c = t === void 0 ? !1 : t, a = r === void 0 ? "" : r, h = o === void 0 ? !1 : o, u = i === void 0 ? !1 : i;
1427
- let p;
1428
- e[0] !== a ? (p = vn(a), e[0] = a, e[1] = p) : p = e[1];
1463
+ } = n, c = t === void 0 ? !1 : t, a = r === void 0 ? "" : r, p = o === void 0 ? !1 : o, u = i === void 0 ? !1 : i;
1464
+ let h;
1465
+ e[0] !== a ? (h = Bn(a), e[0] = a, e[1] = h) : h = e[1];
1429
1466
  const {
1430
- frontmatter: f,
1467
+ frontmatter: m,
1431
1468
  body: d
1432
- } = p, m = u && !!s;
1469
+ } = h, f = u && !!s;
1433
1470
  let x;
1434
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = [Pe, Oe, me, U, Le, ke, $e, ue, Ie, J, W, K, j], e[2] = x) : x = e[2];
1471
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = [qe, _e, ge, W, We, Be, Ue, he, Fe, J, q, K, j], e[2] = x) : x = e[2];
1435
1472
  let g;
1436
- e[3] !== d ? (g = () => we(tt(d), de, void 0, !1), e[3] = d, e[4] = g) : g = e[4];
1473
+ e[3] !== d ? (g = () => ze(tt(d), me, void 0, !1), e[3] = d, e[4] = g) : g = e[4];
1437
1474
  let _;
1438
1475
  e[5] !== u || e[6] !== g ? (_ = {
1439
1476
  namespace: "RICH_MESSAGE",
1440
1477
  nodes: x,
1441
1478
  editorState: g,
1442
- onError: Lr,
1479
+ onError: qr,
1443
1480
  editable: u,
1444
- theme: _e
1481
+ theme: Ee
1445
1482
  }, e[5] = u, e[6] = g, e[7] = _) : _ = e[7];
1446
- const T = _;
1447
- let y;
1448
- e[8] !== d ? (y = /* @__PURE__ */ l($r, { value: d, onUpdate: Pr }), e[8] = d, e[9] = y) : y = e[9];
1449
- let R, b, N;
1450
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(zt, {}), R = /* @__PURE__ */ l(Ht, { newTab: !0 }), b = /* @__PURE__ */ l(Bt, {}), e[10] = R, e[11] = b, e[12] = N) : (R = e[10], b = e[11], N = e[12]);
1483
+ const y = _;
1451
1484
  let S;
1452
- e[13] !== u ? (S = u ? /* @__PURE__ */ l(Wt, { maxIndent: 7 }) : null, e[13] = u, e[14] = S) : S = e[14];
1453
- let E, O, L, M;
1454
- e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(qt, {}), O = /* @__PURE__ */ l(yn, {}), L = /* @__PURE__ */ l(bn, {}), M = /* @__PURE__ */ l(dn, {}), e[15] = E, e[16] = O, e[17] = L, e[18] = M) : (E = e[15], O = e[16], L = e[17], M = e[18]);
1455
- let k;
1456
- e[19] !== h ? (k = /* @__PURE__ */ l(ze, { contentEditable: /* @__PURE__ */ l(Ue, { fullWidth: h, isRichMessage: !0 }), ErrorBoundary: He }), e[19] = h, e[20] = k) : k = e[20];
1485
+ e[8] !== d ? (S = /* @__PURE__ */ l(Hr, { value: d, onUpdate: zr }), e[8] = d, e[9] = S) : S = e[9];
1486
+ let R, b, N;
1487
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ l(Wt, {}), R = /* @__PURE__ */ l(zt, { newTab: !0 }), b = /* @__PURE__ */ l(Jt, {}), e[10] = R, e[11] = b, e[12] = N) : (R = e[10], b = e[11], N = e[12]);
1488
+ let T;
1489
+ e[13] !== u ? (T = u ? /* @__PURE__ */ l(jt, { maxIndent: 7 }) : null, e[13] = u, e[14] = T) : T = e[14];
1490
+ let E, k, P, M;
1491
+ e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ l(qt, {}), k = /* @__PURE__ */ l(Ln, {}), P = /* @__PURE__ */ l($n, {}), M = /* @__PURE__ */ l(hn, {}), e[15] = E, e[16] = k, e[17] = P, e[18] = M) : (E = e[15], k = e[16], P = e[17], M = e[18]);
1492
+ let $;
1493
+ e[19] !== p ? ($ = /* @__PURE__ */ l(Me, { contentEditable: /* @__PURE__ */ l(Je, { fullWidth: p, isRichMessage: !0 }), ErrorBoundary: we }), e[19] = p, e[20] = $) : $ = e[20];
1457
1494
  let A;
1458
- e[21] !== f || e[22] !== s || e[23] !== m ? (A = m ? /* @__PURE__ */ l(qe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (z) => {
1459
- z.read(() => {
1460
- const V = De(), Z = pt(de, V);
1461
- s?.(f + Z);
1495
+ e[21] !== m || e[22] !== s || e[23] !== f ? (A = f ? /* @__PURE__ */ l(Pe, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (U) => {
1496
+ U.read(() => {
1497
+ const G = Le(), te = Ut(me, G);
1498
+ s?.(m + te);
1462
1499
  });
1463
- } }) : null, e[21] = f, e[22] = s, e[23] = m, e[24] = A) : A = e[24];
1464
- let $;
1465
- e[25] !== u ? ($ = /* @__PURE__ */ l(Qe, { isEditable: u }), e[25] = u, e[26] = $) : $ = e[26];
1466
- let v;
1467
- e[27] !== c ? (v = c && /* @__PURE__ */ l(Ze, {}), e[27] = c, e[28] = v) : v = e[28];
1500
+ } }) : null, e[21] = m, e[22] = s, e[23] = f, e[24] = A) : A = e[24];
1501
+ let O;
1502
+ e[25] !== u ? (O = /* @__PURE__ */ l(Qe, { isEditable: u }), e[25] = u, e[26] = O) : O = e[26];
1503
+ let L;
1504
+ e[27] !== c ? (L = c && /* @__PURE__ */ l(Ze, {}), e[27] = c, e[28] = L) : L = e[28];
1468
1505
  let D;
1469
- return e[29] !== T || e[30] !== S || e[31] !== k || e[32] !== A || e[33] !== $ || e[34] !== v || e[35] !== y ? (D = /* @__PURE__ */ l(fe, { className: "rich-text", "data-rich-message": "true", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "hidden", children: /* @__PURE__ */ F(Fe, { initialConfig: T, children: [
1470
- y,
1506
+ return e[29] !== y || e[30] !== T || e[31] !== $ || e[32] !== A || e[33] !== O || e[34] !== L || e[35] !== S ? (D = /* @__PURE__ */ l(fe, { className: "rich-text", "data-rich-message": "true", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "hidden", children: /* @__PURE__ */ F(ve, { initialConfig: y, children: [
1507
+ S,
1471
1508
  N,
1472
1509
  R,
1473
1510
  b,
1474
- S,
1511
+ T,
1475
1512
  E,
1476
- O,
1477
- L,
1478
- M,
1479
1513
  k,
1480
- A,
1514
+ P,
1515
+ M,
1481
1516
  $,
1482
- v
1483
- ] }) }), e[29] = T, e[30] = S, e[31] = k, e[32] = A, e[33] = $, e[34] = v, e[35] = y, e[36] = D) : D = e[36], D;
1517
+ A,
1518
+ O,
1519
+ L
1520
+ ] }) }), e[29] = y, e[30] = T, e[31] = $, e[32] = A, e[33] = O, e[34] = L, e[35] = S, e[36] = D) : D = e[36], D;
1484
1521
  }
1485
- function Pr(n) {
1486
- we(tt(n), de, void 0, !1);
1522
+ function zr(n) {
1523
+ ze(tt(n), me, void 0, !1);
1487
1524
  }
1488
- function Lr(n) {
1525
+ function qr(n) {
1489
1526
  return console.error(n);
1490
1527
  }
1491
1528
  export {
1492
- fo as $,
1493
- yn as C,
1494
- mo as D,
1495
- dn as E,
1496
- bn as I,
1497
- go as P,
1498
- Eo as R,
1499
- Qe as T,
1500
- ho as a,
1501
- Ue as b,
1502
- po as c,
1503
- Ze as d,
1504
- _o as e,
1505
- sn as f,
1506
- lr as g,
1507
- ot as h,
1508
- Je as i,
1529
+ So as $,
1530
+ Ln as C,
1531
+ To as D,
1532
+ hn as E,
1533
+ $n as I,
1534
+ Io as P,
1535
+ ko as R,
1536
+ Co as T,
1537
+ yo as a,
1538
+ Je as b,
1539
+ Ro as c,
1540
+ Qe as d,
1541
+ No as e,
1542
+ Ze as f,
1543
+ an as g,
1544
+ _r as h,
1545
+ ot as i,
1546
+ je as j,
1509
1547
  tt as n,
1510
- vn as s
1548
+ Bn as s
1511
1549
  };
1512
- //# sourceMappingURL=rich-message-CoXTd5kw.js.map
1550
+ //# sourceMappingURL=rich-message-33DPxuWJ.js.map