@pstdio/ui 0.16.0 → 0.18.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 (210) hide show
  1. package/dist/{MermaidComponent-BCMQqPqu.js → MermaidComponent-BPiVFNYK.js} +2 -2
  2. package/dist/{MermaidComponent-BCMQqPqu.js.map → MermaidComponent-BPiVFNYK.js.map} +1 -1
  3. package/dist/chat-ui.js +1618 -1102
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/{checkbox-D5AzFRlb.js → checkbox-B2zYVemL.js} +28 -28
  6. package/dist/checkbox-B2zYVemL.js.map +1 -0
  7. package/dist/components/chat-ui/components/chat-input-actions.d.ts +1 -0
  8. package/dist/components/chat-ui/components/chat-input.d.ts +8 -2
  9. package/dist/components/chat-ui/components/chat-panel.d.ts +11 -5
  10. package/dist/components/chat-ui/components/composer-constants.d.ts +1 -0
  11. package/dist/components/chat-ui/components/conversation-browse.d.ts +22 -0
  12. package/dist/components/chat-ui/components/message-types.d.ts +14 -0
  13. package/dist/components/chat-ui/components/queued-follow-up-list-state.d.ts +4 -0
  14. package/dist/components/chat-ui/components/queued-follow-up-list.d.ts +11 -0
  15. package/dist/components/chat-ui/components/timeline.d.ts +5 -0
  16. package/dist/components/chat-ui/components/working-indicator.d.ts +9 -0
  17. package/dist/components/chat-ui/components/workspace-hub.d.ts +8 -1
  18. package/dist/components/chat-ui/index.d.ts +4 -2
  19. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
  20. package/dist/components/chat-ui/tool-rendering/question-prompt.d.ts +9 -0
  21. package/dist/components/data-table/build-columns.d.ts +13 -2
  22. package/dist/components/data-table/categorical-color-cell.d.ts +8 -0
  23. package/dist/components/data-table/color-cell-style.d.ts +13 -0
  24. package/dist/components/data-table/color-scale-cell.d.ts +7 -0
  25. package/dist/components/data-table/data-table-column-menu.d.ts +15 -0
  26. package/dist/components/data-table/data-table-header.d.ts +10 -0
  27. package/dist/components/data-table/data-table-stat-chart.d.ts +21 -0
  28. package/dist/components/data-table/data-table-state.d.ts +27 -0
  29. package/dist/components/data-table/data-table-stats-row.d.ts +11 -0
  30. package/dist/components/data-table/data-table-stats.d.ts +19 -0
  31. package/dist/components/data-table/data-table-table-parts.d.ts +21 -0
  32. package/dist/components/data-table/data-table.story-descriptions.d.ts +6 -0
  33. package/dist/components/data-table/data-table.story-fixtures.d.ts +6 -0
  34. package/dist/components/data-table/editable-cells-story.d.ts +9 -0
  35. package/dist/components/data-table/friendly-json-display.d.ts +31 -0
  36. package/dist/components/data-table/index.d.ts +3 -1
  37. package/dist/components/data-table/json-cell.d.ts +6 -0
  38. package/dist/components/data-table/pagination-footer.d.ts +4 -1
  39. package/dist/components/data-table/selection-toolbar.d.ts +3 -1
  40. package/dist/components/data-table/types.d.ts +72 -0
  41. package/dist/components/diff-viewer/code-editor.d.ts +2 -0
  42. package/dist/components/diff-viewer/index.d.ts +1 -1
  43. package/dist/components/diff-viewer/monaco-browser.d.ts +1 -0
  44. package/dist/components/{data-renderer → kanban-renderer}/display-menu.d.ts +4 -4
  45. package/dist/components/{data-renderer → kanban-renderer}/filter-menu.d.ts +3 -3
  46. package/dist/components/kanban-renderer/index.d.ts +19 -0
  47. package/dist/components/kanban-renderer/kanban-renderer-attribute-badge.d.ts +7 -0
  48. package/dist/components/{data-renderer/data-renderer-board-column-header.d.ts → kanban-renderer/kanban-renderer-board-column-header.d.ts} +2 -2
  49. package/dist/components/{data-renderer/data-renderer-board-group-section.d.ts → kanban-renderer/kanban-renderer-board-group-section.d.ts} +2 -2
  50. package/dist/components/{data-renderer/data-renderer-board-move.d.ts → kanban-renderer/kanban-renderer-board-move.d.ts} +3 -3
  51. package/dist/components/{data-renderer/data-renderer-board.d.ts → kanban-renderer/kanban-renderer-board.d.ts} +15 -14
  52. package/dist/components/{data-renderer/data-renderer-card.d.ts → kanban-renderer/kanban-renderer-card.d.ts} +4 -3
  53. package/dist/components/{data-renderer/data-renderer-content.d.ts → kanban-renderer/kanban-renderer-content.d.ts} +8 -8
  54. package/dist/components/kanban-renderer/kanban-renderer-create-dialog.d.ts +12 -0
  55. package/dist/components/kanban-renderer/kanban-renderer-create-field.d.ts +10 -0
  56. package/dist/components/kanban-renderer/kanban-renderer-grouping.d.ts +23 -0
  57. package/dist/components/{data-renderer/data-renderer-helpers.d.ts → kanban-renderer/kanban-renderer-helpers.d.ts} +15 -15
  58. package/dist/components/kanban-renderer/kanban-renderer-list-items.d.ts +25 -0
  59. package/dist/components/kanban-renderer/kanban-renderer-list.d.ts +43 -0
  60. package/dist/components/{data-renderer/data-renderer-story-fixtures.d.ts → kanban-renderer/kanban-renderer-story-fixtures.d.ts} +3 -2
  61. package/dist/components/kanban-renderer/kanban-renderer-toolbar.d.ts +15 -0
  62. package/dist/components/kanban-renderer/kanban-renderer-view-bar.d.ts +14 -0
  63. package/dist/components/kanban-renderer/kanban-renderer-views.d.ts +12 -0
  64. package/dist/components/{data-renderer/data-renderer.d.ts → kanban-renderer/kanban-renderer.d.ts} +11 -8
  65. package/dist/components/{data-renderer → kanban-renderer}/types.d.ts +51 -8
  66. package/dist/components/kanban-renderer/use-kanban-renderer-store.d.ts +78 -0
  67. package/dist/components/layout/index.d.ts +1 -0
  68. package/dist/components/layout/panel-header.constants.d.ts +2 -0
  69. package/dist/components/layout/resizable-split-layout.d.ts +3 -2
  70. package/dist/components/layout/resizable-split-layout.geometry.d.ts +56 -0
  71. package/dist/components/layout/resizable-split-layout.handle.d.ts +6 -2
  72. package/dist/components/layout/resizable-split-layout.panels.d.ts +25 -0
  73. package/dist/components/list-row/list-row-actions.d.ts +1 -0
  74. package/dist/components/list-row/list-row-content.d.ts +7 -0
  75. package/dist/components/list-row/list-row.types.d.ts +4 -1
  76. package/dist/components/overlays/attached-menu.d.ts +6 -0
  77. package/dist/components/overlays/attachment-chip.d.ts +13 -0
  78. package/dist/components/overlays/index.d.ts +6 -2
  79. package/dist/components/overlays/resource-context-menu.d.ts +13 -1
  80. package/dist/components/overlays/searchable-menu-input.d.ts +9 -0
  81. package/dist/components/param-editor/index.d.ts +6 -2
  82. package/dist/components/param-editor/inputs/action-input.d.ts +1 -0
  83. package/dist/components/param-editor/inputs/boolean-input.d.ts +13 -0
  84. package/dist/components/param-editor/inputs/color-input.d.ts +1 -0
  85. package/dist/components/param-editor/inputs/date-input.d.ts +1 -0
  86. package/dist/components/param-editor/inputs/file-upload-input.d.ts +15 -0
  87. package/dist/components/param-editor/inputs/file-upload-value.d.ts +7 -0
  88. package/dist/components/param-editor/inputs/horizontal-text-input.d.ts +1 -0
  89. package/dist/components/param-editor/inputs/markdown-input.d.ts +13 -0
  90. package/dist/components/param-editor/inputs/number-input.d.ts +1 -0
  91. package/dist/components/param-editor/inputs/range-input.d.ts +1 -0
  92. package/dist/components/param-editor/inputs/resource-input.d.ts +2 -0
  93. package/dist/components/param-editor/inputs/segmented-input.d.ts +1 -0
  94. package/dist/components/param-editor/inputs/selection-input.d.ts +7 -6
  95. package/dist/components/param-editor/inputs/selection-menu.d.ts +33 -0
  96. package/dist/components/param-editor/inputs/text-input.d.ts +1 -0
  97. package/dist/components/param-editor/param-editor-advanced-field.d.ts +14 -0
  98. package/dist/components/param-editor/param-editor-control-fixtures.d.ts +24 -0
  99. package/dist/components/param-editor/param-editor-field.d.ts +2 -0
  100. package/dist/components/param-editor/param-editor-horizontal.d.ts +3 -2
  101. package/dist/components/param-editor/param-editor-label.d.ts +1 -0
  102. package/dist/components/param-editor/param-editor-presentation.d.ts +3 -0
  103. package/dist/components/param-editor/param-editor-read-only-field.d.ts +9 -0
  104. package/dist/components/param-editor/param-editor-section.d.ts +1 -0
  105. package/dist/components/param-editor/param-editor.d.ts +1 -0
  106. package/dist/components/param-editor/param-editor.types.d.ts +59 -18
  107. package/dist/components/param-editor/resolve-param-value.d.ts +2 -0
  108. package/dist/components/primitives/chip.d.ts +4 -0
  109. package/dist/components/primitives/index.d.ts +2 -0
  110. package/dist/components/primitives/resource-badge.d.ts +12 -10
  111. package/dist/components/rich-text/index.d.ts +1 -0
  112. package/dist/components/rich-text/lazy-markdown-editor.d.ts +2 -0
  113. package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/ReferenceMenuPlugin.d.ts +2 -1
  114. package/dist/components/rich-text/prompt-input/plugins/ReferenceMenuPlugin/hooks/useContextLookup.d.ts +2 -1
  115. package/dist/components/rich-text/prompt-input/plugins/ReferencePlugin/ReferencePlugin.d.ts +2 -1
  116. package/dist/components/rich-text/prompt-input/prompt-input.d.ts +3 -2
  117. package/dist/components/rich-text/types.d.ts +1 -1
  118. package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
  119. package/dist/components/{sidebar/sidebar-footer.d.ts → sidenav/sidenav-footer.d.ts} +2 -2
  120. package/dist/components/{sidebar/sidebar-header.d.ts → sidenav/sidenav-header.d.ts} +2 -2
  121. package/dist/components/sidenav/sidenav.d.ts +2 -0
  122. package/dist/components/sidenav/sidenav.store.d.ts +49 -0
  123. package/dist/components/{sidebar/sidebar.types.d.ts → sidenav/sidenav.types.d.ts} +5 -5
  124. package/dist/components/tab-strip/tab-visibility-filter.d.ts +1 -0
  125. package/dist/components/terminal/terminal.d.ts +11 -0
  126. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +0 -1
  127. package/dist/components/tree-list/tree-list.d.ts +1 -1
  128. package/dist/components/tree-list/tree-list.types.d.ts +4 -0
  129. package/dist/data-table.js +1321 -0
  130. package/dist/data-table.js.map +1 -0
  131. package/dist/diff.js +370 -366
  132. package/dist/diff.js.map +1 -1
  133. package/dist/font/css/prompt-studio-icons.css +690 -0
  134. package/dist/font/prompt-studio-icons.eot +0 -0
  135. package/dist/font/prompt-studio-icons.svg +1 -0
  136. package/dist/font/prompt-studio-icons.ttf +0 -0
  137. package/dist/font/prompt-studio-icons.woff +0 -0
  138. package/dist/font/prompt-studio-icons.woff2 +0 -0
  139. package/dist/index.d.ts +3 -3
  140. package/dist/index.js +1854 -3381
  141. package/dist/index.js.map +1 -1
  142. package/dist/kanban-renderer-toolbar-Db1mIWWd.js +1318 -0
  143. package/dist/kanban-renderer-toolbar-Db1mIWWd.js.map +1 -0
  144. package/dist/kanban-renderer.js +1101 -0
  145. package/dist/kanban-renderer.js.map +1 -0
  146. package/dist/lazy-markdown-editor-DwhqQ-NN.js +26 -0
  147. package/dist/lazy-markdown-editor-DwhqQ-NN.js.map +1 -0
  148. package/dist/list-row-BYWwcbGK.js +823 -0
  149. package/dist/list-row-BYWwcbGK.js.map +1 -0
  150. package/dist/markdown-DDd2ESoH.js +743 -0
  151. package/dist/markdown-DDd2ESoH.js.map +1 -0
  152. package/dist/markdown-editor-CYVkzt8t.js +741 -0
  153. package/dist/markdown-editor-CYVkzt8t.js.map +1 -0
  154. package/dist/monaco-browser-CO0NxK_Z.js +19 -0
  155. package/dist/monaco-browser-CO0NxK_Z.js.map +1 -0
  156. package/dist/param-editor-BCZOw5Gt.js +140 -0
  157. package/dist/param-editor-BCZOw5Gt.js.map +1 -0
  158. package/dist/param-editor-field-ZzZwgjZ_.js +2094 -0
  159. package/dist/param-editor-field-ZzZwgjZ_.js.map +1 -0
  160. package/dist/resource-badge-CuItchgL.js +98 -0
  161. package/dist/resource-badge-CuItchgL.js.map +1 -0
  162. package/dist/rich-message--eRzjWYK.js +730 -0
  163. package/dist/rich-message--eRzjWYK.js.map +1 -0
  164. package/dist/rich-text.js +114 -827
  165. package/dist/rich-text.js.map +1 -1
  166. package/dist/style.css +1 -1
  167. package/dist/terminal.js +197 -177
  168. package/dist/terminal.js.map +1 -1
  169. package/dist/theme/primitives/fonts.d.ts +3 -0
  170. package/dist/theme/primitives/sizes.d.ts +23 -0
  171. package/dist/theme/recipes/badge.d.ts +8 -0
  172. package/dist/theme/recipes/button.d.ts +6 -0
  173. package/dist/theme/recipes/color-picker.d.ts +18 -1
  174. package/dist/theme/recipes/switch.d.ts +17 -0
  175. package/dist/theme/recipes/tabs.d.ts +4 -4
  176. package/dist/theme/tokens/colors.d.ts +18 -24
  177. package/dist/{theme-CJBYBJaA.js → theme-poQlUgt0.js} +414 -240
  178. package/dist/theme-poQlUgt0.js.map +1 -0
  179. package/dist/theme.js +1 -1
  180. package/dist/tree-list-BAja2eXU.js +1033 -0
  181. package/dist/tree-list-BAja2eXU.js.map +1 -0
  182. package/package.json +11 -4
  183. package/dist/checkbox-D5AzFRlb.js.map +0 -1
  184. package/dist/components/data-renderer/card-interaction-guard.d.ts +0 -2
  185. package/dist/components/data-renderer/data-renderer-attribute-badge.d.ts +0 -7
  186. package/dist/components/data-renderer/data-renderer-grouping.d.ts +0 -23
  187. package/dist/components/data-renderer/data-renderer-list.d.ts +0 -39
  188. package/dist/components/data-renderer/data-renderer-toolbar.d.ts +0 -12
  189. package/dist/components/data-renderer/index.d.ts +0 -18
  190. package/dist/components/data-renderer/use-data-renderer-store.d.ts +0 -59
  191. package/dist/components/param-editor/inputs/file-accept.d.ts +0 -22
  192. package/dist/components/param-editor/inputs/file-drop-input.d.ts +0 -14
  193. package/dist/components/sidebar/sidebar.d.ts +0 -2
  194. package/dist/components/sidebar/sidebar.store.d.ts +0 -49
  195. package/dist/data-renderer.js +0 -1669
  196. package/dist/data-renderer.js.map +0 -1
  197. package/dist/list-row-mi3Hn-Um.js +0 -740
  198. package/dist/list-row-mi3Hn-Um.js.map +0 -1
  199. package/dist/resource-badge-qCWHP-wQ.js +0 -99
  200. package/dist/resource-badge-qCWHP-wQ.js.map +0 -1
  201. package/dist/rich-message-DBf_5YlW.js +0 -1450
  202. package/dist/rich-message-DBf_5YlW.js.map +0 -1
  203. package/dist/theme-CJBYBJaA.js.map +0 -1
  204. package/dist/tree-list-CcuZMLS5.js +0 -930
  205. package/dist/tree-list-CcuZMLS5.js.map +0 -1
  206. package/dist/workspace-badge-Fuo-1zPj.js +0 -314
  207. package/dist/workspace-badge-Fuo-1zPj.js.map +0 -1
  208. /package/dist/components/{data-renderer/data-renderer-badge-helpers.d.ts → kanban-renderer/kanban-renderer-badge-helpers.d.ts} +0 -0
  209. /package/dist/components/{data-renderer/data-renderer-enum-helpers.d.ts → kanban-renderer/kanban-renderer-enum-helpers.d.ts} +0 -0
  210. /package/dist/components/{data-renderer → kanban-renderer}/use-resolved-attributes.d.ts +0 -0
@@ -1,1450 +0,0 @@
1
- import { jsx as l, jsxs as F, Fragment as be } from "react/jsx-runtime";
2
- import { c as N } from "react/compiler-runtime";
3
- import { chakra as ut, Box as A, Table as W, Text as P, Textarea as ft, Tooltip as te, Flex as fe, Kbd as mt } from "@chakra-ui/react";
4
- import { MarkNode as pt } from "@lexical/mark";
5
- import { LexicalComposer as Re } from "@lexical/react/LexicalComposer";
6
- import { LexicalErrorBoundary as Ie } from "@lexical/react/LexicalErrorBoundary";
7
- import { HistoryPlugin as ht } from "@lexical/react/LexicalHistoryPlugin";
8
- import { OnChangePlugin as we } from "@lexical/react/LexicalOnChangePlugin";
9
- import { RichTextPlugin as Oe } from "@lexical/react/LexicalRichTextPlugin";
10
- import { DecoratorNode as Q, $applyNodeReplacement as _t, ElementNode as ve, TextNode as ne, $createTextNode as V, $nodesOfType as gt, createCommand as Le, isHTMLElement as xt, $createParagraphNode as ce, COMMAND_PRIORITY_LOW as Me, $getSelection as bt, $isRangeSelection as Et, $isElementNode as yt, KEY_DOWN_COMMAND as St, COMMAND_PRIORITY_HIGH as Tt, $getRoot as Ae } from "lexical";
11
- import * as kt from "react";
12
- import { Suspense as Pe, lazy as Ct, useEffect as B, useImperativeHandle as Nt, useState as $t, forwardRef as Rt, useRef as It } from "react";
13
- import { useLexicalComposerContext as D } from "@lexical/react/LexicalComposerContext";
14
- import { $setBlocksType as wt } from "@lexical/selection";
15
- import { addClassNamesToElement as De, mergeRegister as me } from "@lexical/utils";
16
- import { LexicalTypeaheadMenuPlugin as Ot } from "@lexical/react/LexicalTypeaheadMenuPlugin";
17
- import * as vt from "react-dom";
18
- import { S as oe } from "./scroll-area-BMbg1WcD.js";
19
- import { LinkNode as pe, AutoLinkNode as he, $createLinkNode as Lt, $isLinkNode as Mt, $isAutoLinkNode as Fe, $createAutoLinkNode as At } from "@lexical/link";
20
- import { ListNode as Be, ListItemNode as qe } from "@lexical/list";
21
- import { CHECK_LIST as Pt, TRANSFORMERS as Dt, LINK as Ft, $convertFromMarkdownString as He, $convertToMarkdownString as Bt } from "@lexical/markdown";
22
- import { ClickableLinkPlugin as qt } from "@lexical/react/LexicalClickableLinkPlugin";
23
- import { HorizontalRulePlugin as Ht } from "@lexical/react/LexicalHorizontalRulePlugin";
24
- import { LinkPlugin as Wt } from "@lexical/react/LexicalLinkPlugin";
25
- import { ListPlugin as zt } from "@lexical/react/LexicalListPlugin";
26
- import { TabIndentationPlugin as Jt } from "@lexical/react/LexicalTabIndentationPlugin";
27
- import { QuoteNode as We, HeadingNode as ze } from "@lexical/rich-text";
28
- import { ContentEditable as jt } from "@lexical/react/LexicalContentEditable";
29
- import { CodeNode as _e, CodeHighlightNode as Je, registerCodeHighlighting as Ut } from "@lexical/code";
30
- import Kt from "katex";
31
- import { R as je } from "./resource-badge-qCWHP-wQ.js";
32
- import { TreeView as Gt } from "@lexical/react/LexicalTreeView";
33
- const Vt = ut(jt);
34
- function Ue(n) {
35
- const e = N(11), {
36
- onRef: t,
37
- fullWidth: r,
38
- padding: o,
39
- isRichMessage: i,
40
- scrollable: s
41
- } = n, c = r === void 0 ? !1 : r, a = i === void 0 ? !1 : i, m = s === void 0 ? !0 : s, u = c ? "100%" : "45rem", h = c ? "0" : "auto";
42
- let f;
43
- e[0] !== u || e[1] !== h ? (f = /* @__PURE__ */ l(Vt, { "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] = f) : f = e[2];
44
- let d;
45
- e[3] !== t || e[4] !== o || e[5] !== f ? (d = /* @__PURE__ */ l(A, { 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 p = d;
47
- if (!m)
48
- return p;
49
- const _ = a ? "true" : void 0;
50
- let b;
51
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = {
52
- width: "100%",
53
- minH: "100%"
54
- }, e[7] = b) : b = e[7];
55
- let g;
56
- return e[8] !== p || e[9] !== _ ? (g = /* @__PURE__ */ l(oe, { className: "rich-text", "data-rich-message": _, height: "100%", minH: "0", position: "relative", contentProps: b, children: p }), e[8] = p, e[9] = _, e[10] = g) : g = e[10], g;
57
- }
58
- let ie = class ae extends Q {
59
- __href;
60
- __label;
61
- static getType() {
62
- return "reference-link";
63
- }
64
- static clone(e) {
65
- return new ae(e.__href, e.__label, e.__key);
66
- }
67
- constructor(e, t, r) {
68
- super(r), this.__href = e, this.__label = t;
69
- }
70
- createDOM(e, t) {
71
- return document.createElement("span");
72
- }
73
- updateDOM(e, t, r) {
74
- return !1;
75
- }
76
- getTextContent() {
77
- return `{{link('${this.__label ?? this.__href}')}}`;
78
- }
79
- exportJSON() {
80
- return {
81
- type: ae.getType(),
82
- version: 1,
83
- href: this.__href,
84
- label: this.__label
85
- };
86
- }
87
- static importJSON(e) {
88
- return Ke(e.href, e.label);
89
- }
90
- decorate(e, t) {
91
- const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
92
- return /* @__PURE__ */ l(A, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
93
- if (s)
94
- window.open(r, "_blank", "noopener,noreferrer");
95
- else if (c) {
96
- const a = r.replace(/^#?\$PROJECT\//i, ""), m = new CustomEvent("ui:open-project-file", {
97
- detail: a
98
- });
99
- window.dispatchEvent(m);
100
- } else
101
- window.location.assign(r);
102
- } }) });
103
- }
104
- };
105
- function Ke(n, e) {
106
- return new ie(n, e);
107
- }
108
- function Xt(n) {
109
- return n instanceof ie;
110
- }
111
- const Ee = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, Yt = {
112
- dependencies: [ie],
113
- export: (n) => {
114
- if (Xt(n)) {
115
- const e = n.__href, t = n.__label ?? e;
116
- return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
117
- }
118
- return null;
119
- },
120
- regExp: Ee,
121
- importRegExp: Ee,
122
- replace: (n, e) => {
123
- const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
124
- n.replace(Ke(o, i));
125
- },
126
- type: "text-match"
127
- }, ge = {
128
- code: "rich-text__code",
129
- codeHighlight: {
130
- atrule: "rich-text__tokenAttr",
131
- attr: "rich-text__tokenAttr",
132
- boolean: "rich-text__tokenProperty",
133
- builtin: "rich-text__tokenSelector",
134
- cdata: "rich-text__tokenComment",
135
- char: "rich-text__tokenSelector",
136
- class: "rich-text__tokenFunction",
137
- "class-name": "rich-text__tokenFunction",
138
- comment: "rich-text__tokenComment",
139
- constant: "rich-text__tokenProperty",
140
- deleted: "rich-text__tokenProperty",
141
- doctype: "rich-text__tokenComment",
142
- entity: "rich-text__tokenOperator",
143
- function: "rich-text__tokenFunction",
144
- important: "rich-text__tokenVariable",
145
- inserted: "rich-text__tokenSelector",
146
- keyword: "rich-text__tokenAttr",
147
- namespace: "rich-text__tokenVariable",
148
- number: "rich-text__tokenProperty",
149
- operator: "rich-text__tokenOperator",
150
- prolog: "rich-text__tokenComment",
151
- property: "rich-text__tokenProperty",
152
- punctuation: "rich-text__tokenPunctuation",
153
- regex: "rich-text__tokenVariable",
154
- selector: "rich-text__tokenSelector",
155
- string: "rich-text__tokenSelector",
156
- symbol: "rich-text__tokenProperty",
157
- tag: "rich-text__tokenProperty",
158
- url: "rich-text__tokenOperator",
159
- variable: "rich-text__tokenVariable"
160
- },
161
- embedBlock: {
162
- base: "rich-text__embedBlock",
163
- focus: "rich-text__embedBlockFocus"
164
- },
165
- list: {
166
- checklist: "rich-text__checklist",
167
- listitem: "rich-text__listItem",
168
- listitemChecked: "rich-text__listItemChecked",
169
- listitemUnchecked: "rich-text__listItemUnchecked",
170
- nested: {
171
- listitem: "rich-text__nestedListItem"
172
- },
173
- olDepth: ["rich-text__ol1", "rich-text__ol2", "rich-text__ol3", "rich-text__ol4", "rich-text__ol5"],
174
- ol: "rich-text__ol",
175
- ul: "rich-text__ul"
176
- },
177
- heading: {
178
- h1: "rich-text__h1",
179
- h2: "rich-text__h2",
180
- h3: "rich-text__h3"
181
- },
182
- paragraph: "rich-text__p",
183
- text: {
184
- underline: "rich-text__textUnderline",
185
- italic: "rich-text__textItalic",
186
- code: "rich-text__textCode"
187
- },
188
- link: "rich-text__link",
189
- quote: "rich-text__quote",
190
- reference: "rich-text__reference",
191
- table: "rich-text__table",
192
- tableCell: "rich-text__tableCell",
193
- tableRow: "rich-text__tableRow",
194
- tableCellHeader: "rich-text__tableCellHeader",
195
- layoutContainer: "rich-text__layoutContainer",
196
- layoutItem: "rich-text__layoutItem",
197
- draggableBlockDemo: {
198
- row: "rich-text__row",
199
- content: "rich-text__content"
200
- }
201
- }, X = "calc(var(--chakra-font-sizes-sm) * var(--rich-text-font-scale))", Qt = (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), Yr = (n) => {
202
- const e = N(8), {
203
- defaultCode: t,
204
- isEditable: r,
205
- showLineNumbers: o,
206
- disableScroll: i
207
- } = n, s = t === void 0 ? "" : t, c = r === void 0 ? !1 : r, a = o === void 0 ? !1 : o, m = i === void 0 ? !1 : i;
208
- if (c) {
209
- let d;
210
- return e[0] !== s ? (d = /* @__PURE__ */ l(ft, { defaultValue: s, fontFamily: "mono", fontSize: X, resize: "vertical", minHeight: "100%" }), e[0] = s, e[1] = d) : d = e[1], d;
211
- }
212
- let u;
213
- if (e[2] !== s || e[3] !== m || e[4] !== a) {
214
- const d = a ? s.split(`
215
- `) : [s];
216
- u = /* @__PURE__ */ l(A, { as: "pre", margin: 0, padding: "sm", fontFamily: "mono", fontSize: X, lineHeight: "1.5", background: "bg.code", borderRadius: "md", width: "100%", overflowY: m ? "hidden" : void 0, children: a ? /* @__PURE__ */ l(A, { as: "code", display: "grid", gridTemplateColumns: "auto 1fr", columnGap: "sm", children: d.map(en) }) : /* @__PURE__ */ l(A, { as: "code", children: s }) }), e[2] = s, e[3] = m, e[4] = a, e[5] = u;
217
- } else
218
- u = e[5];
219
- const h = u;
220
- if (m)
221
- return h;
222
- let f;
223
- return e[6] !== h ? (f = /* @__PURE__ */ l(oe, { width: "100%", background: "bg.code", borderRadius: "md", showHorizontalScrollbar: !0, children: h }), e[6] = h, e[7] = f) : f = e[7], f;
224
- }, Zt = (n) => {
225
- const e = N(26), {
226
- data: t,
227
- fullWidth: r,
228
- noBorder: o,
229
- hiddenColumns: i
230
- } = n, s = r === void 0 ? !1 : r, c = o === void 0 ? !1 : o;
231
- let a;
232
- e[0] !== i ? (a = i === void 0 ? [] : i, e[0] = i, e[1] = a) : a = e[1];
233
- const m = a;
234
- if (!t.length) {
235
- const y = c ? "0" : "1px";
236
- let C;
237
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ l(P, { textStyle: "label/S/regular", fontSize: X, color: "fg.muted", children: "No data" }), e[2] = C) : C = e[2];
238
- let S;
239
- return e[3] !== y ? (S = /* @__PURE__ */ l(A, { padding: "sm", borderWidth: y, borderColor: "border.subtle", children: C }), e[3] = y, e[4] = S) : S = e[4], S;
240
- }
241
- let u;
242
- e[5] !== m ? (u = new Set(m), e[5] = m, e[6] = u) : u = e[6];
243
- const h = u;
244
- let f;
245
- e[7] !== t[0] ? (f = Object.keys(t[0] ?? {}), e[7] = t[0], e[8] = f) : f = e[8];
246
- let d;
247
- e[9] !== h || e[10] !== f ? (d = f.filter((y) => !h.has(y)), e[9] = h, e[10] = f, e[11] = d) : d = e[11];
248
- const p = d, _ = s ? "100%" : "fit-content", b = c ? "0" : "1px";
249
- let g;
250
- e[12] !== p ? (g = /* @__PURE__ */ l(W.Header, { children: /* @__PURE__ */ l(W.Row, { background: "bg.muted", children: p.map(tn) }) }), e[12] = p, e[13] = g) : g = e[13];
251
- let T;
252
- if (e[14] !== p || e[15] !== t) {
253
- let y;
254
- e[17] !== p ? (y = (C, S) => /* @__PURE__ */ l(W.Row, { children: p.map((x) => /* @__PURE__ */ l(W.Cell, { paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(P, { textStyle: "paragraph/S/regular", fontSize: X, children: Qt(C[x]) }) }, `${S}-${x}`)) }, `${S}-${p.join("-")}`), e[17] = p, e[18] = y) : y = e[18], T = t.map(y), e[14] = p, e[15] = t, e[16] = T;
255
- } else
256
- T = e[16];
257
- let E;
258
- e[19] !== T ? (E = /* @__PURE__ */ l(W.Body, { children: T }), e[19] = T, e[20] = E) : E = e[20];
259
- let k;
260
- return e[21] !== E || e[22] !== _ || e[23] !== b || e[24] !== g ? (k = /* @__PURE__ */ l(oe, { maxWidth: "100%", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ F(W.Root, { size: "sm", width: _, borderWidth: b, borderColor: "border.subtle", children: [
261
- g,
262
- E
263
- ] }) }), e[21] = E, e[22] = _, e[23] = b, e[24] = g, e[25] = k) : k = e[25], k;
264
- };
265
- function en(n, e) {
266
- return /* @__PURE__ */ F(A, { as: "span", display: "contents", children: [
267
- /* @__PURE__ */ l(P, { as: "span", color: "fg.muted", textAlign: "right", fontSize: "inherit", children: e + 1 }),
268
- /* @__PURE__ */ l(P, { as: "span", fontSize: "inherit", children: n.length ? n : " " })
269
- ] }, `${e}-${n}`);
270
- }
271
- function tn(n) {
272
- return /* @__PURE__ */ l(W.ColumnHeader, { textTransform: "none", paddingX: "xs", paddingY: "2xs", children: /* @__PURE__ */ l(P, { textStyle: "label/S/medium", fontSize: X, children: n }) }, n);
273
- }
274
- class z extends Q {
275
- __data;
276
- static getType() {
277
- return "data_table";
278
- }
279
- static clone(e) {
280
- return new z(e.__data, e.__key);
281
- }
282
- constructor(e, t) {
283
- super(t), this.__data = e;
284
- }
285
- getData() {
286
- return this.__data;
287
- }
288
- createDOM() {
289
- return document.createElement("div");
290
- }
291
- updateDOM() {
292
- return !1;
293
- }
294
- decorate() {
295
- return /* @__PURE__ */ l(Zt, { fullWidth: !0, isReadOnly: !0, data: this.__data });
296
- }
297
- exportJSON() {
298
- return {
299
- type: "data_table",
300
- version: 1,
301
- data: this.__data
302
- };
303
- }
304
- static importJSON(e) {
305
- return new z(e.data);
306
- }
307
- getTextContent() {
308
- if (!this.__data.length) return "";
309
- const e = Object.keys(this.__data[0]), t = e.join(" | "), r = e.map(() => "---").join(" | "), o = this.__data.map((i) => e.map((s) => String(i[s] || "")).join(" | "));
310
- return [t, r, ...o].join(`
311
- `);
312
- }
313
- }
314
- function ye(n) {
315
- return new z(n);
316
- }
317
- function Se(n) {
318
- return n instanceof z;
319
- }
320
- const nn = kt.lazy(() => import("./EquationComponent-DeDYHvqY.js"));
321
- function Te(n) {
322
- let e = n.getAttribute("data-lexical-equation");
323
- const t = n.getAttribute("data-lexical-inline") === "true";
324
- return e = atob(e || ""), e ? {
325
- node: se(e, t)
326
- } : null;
327
- }
328
- class H extends Q {
329
- __equation;
330
- __inline;
331
- static getType() {
332
- return "equation";
333
- }
334
- static clone(e) {
335
- return new H(e.__equation, e.__inline, e.__key);
336
- }
337
- constructor(e, t, r) {
338
- super(r), this.__equation = e, this.__inline = t ?? !1;
339
- }
340
- static importJSON(e) {
341
- return se(e.equation, e.inline);
342
- }
343
- exportJSON() {
344
- return {
345
- equation: this.getEquation(),
346
- inline: this.__inline,
347
- type: "equation",
348
- version: 1
349
- };
350
- }
351
- createDOM(e) {
352
- const t = document.createElement(this.__inline ? "span" : "div");
353
- return t.className = "editor-equation", t;
354
- }
355
- exportDOM() {
356
- const e = document.createElement(this.__inline ? "span" : "div"), t = btoa(this.__equation);
357
- return e.setAttribute("data-lexical-equation", t), e.setAttribute("data-lexical-inline", `${this.__inline}`), Kt.render(this.__equation, e, {
358
- displayMode: !this.__inline,
359
- // true === block display //
360
- errorColor: "#cc0000",
361
- output: "html",
362
- strict: "warn",
363
- throwOnError: !1,
364
- trust: !1
365
- }), {
366
- element: e
367
- };
368
- }
369
- static importDOM() {
370
- return {
371
- div: (e) => e.hasAttribute("data-lexical-equation") ? {
372
- conversion: Te,
373
- priority: 2
374
- } : null,
375
- span: (e) => e.hasAttribute("data-lexical-equation") ? {
376
- conversion: Te,
377
- priority: 1
378
- } : null
379
- };
380
- }
381
- updateDOM(e) {
382
- return this.__inline !== e.__inline;
383
- }
384
- getTextContent() {
385
- return this.__equation;
386
- }
387
- getEquation() {
388
- return this.__equation;
389
- }
390
- setEquation(e) {
391
- const t = this.getWritable();
392
- t.__equation = e;
393
- }
394
- isInline() {
395
- return this.__inline;
396
- }
397
- decorate() {
398
- return /* @__PURE__ */ l(Pe, { fallback: null, children: /* @__PURE__ */ l(nn, { equation: this.__equation, inline: this.__inline }) });
399
- }
400
- }
401
- function se(n = "", e = !1) {
402
- const t = new H(n, e);
403
- return _t(t);
404
- }
405
- function Ge(n) {
406
- return n instanceof H;
407
- }
408
- const rn = {
409
- dependencies: [H],
410
- export: (n) => Ge(n) && n.isInline() ? `\\( ${n.getEquation().trim()} \\)` : null,
411
- importRegExp: /\\\((.*?)\\\)/,
412
- regExp: /\\\((.*?)\\\)/,
413
- replace: (n, e) => {
414
- const t = se(e[1].trim(), !0);
415
- n.replace(t);
416
- },
417
- type: "text-match"
418
- }, on = {
419
- dependencies: [H],
420
- regExpStart: /\\\[/,
421
- regExpEnd: /\\]/,
422
- export: (n) => Ge(n) && !n.isInline() ? `\\[ ${n.getEquation().trim()} \\]` : null,
423
- replace: (n, e, t, r, o) => o ? (n.append(se(o.join(" "), !1)), !0) : !1,
424
- type: "multiline-element"
425
- };
426
- function sn() {
427
- return null;
428
- }
429
- class U extends ve {
430
- static getType() {
431
- return "hr";
432
- }
433
- static clone(e) {
434
- return new U(e?.__key);
435
- }
436
- static importJSON(e) {
437
- return Ve();
438
- }
439
- exportJSON() {
440
- return {
441
- ...super.exportJSON()
442
- };
443
- }
444
- createDOM(e, t) {
445
- const r = document.createElement("hr");
446
- return r.style = "margin: 2rem 0;", r;
447
- }
448
- updateDOM(e, t, r) {
449
- return !1;
450
- }
451
- decorate(e) {
452
- return null;
453
- }
454
- }
455
- function Ve() {
456
- return new U();
457
- }
458
- function ln(n) {
459
- return n instanceof U;
460
- }
461
- const cn = Ct(() => import("./MermaidComponent-BCMQqPqu.js"));
462
- class J extends Q {
463
- __code;
464
- static getType() {
465
- return "mermaid";
466
- }
467
- static clone(e) {
468
- return new J(e.__code, e.__key);
469
- }
470
- constructor(e, t) {
471
- super(t), this.__code = e;
472
- }
473
- createDOM() {
474
- return document.createElement("div");
475
- }
476
- updateDOM() {
477
- return !1;
478
- }
479
- static importJSON(e) {
480
- return new J(e.code);
481
- }
482
- exportJSON() {
483
- return {
484
- type: "mermaid",
485
- code: this.__code,
486
- version: 1
487
- };
488
- }
489
- getTextContent() {
490
- return `\`\`\`mermaid
491
- ${this.__code}
492
- \`\`\``;
493
- }
494
- getCode() {
495
- return this.__code;
496
- }
497
- setCode(e) {
498
- const t = this.getWritable();
499
- t.__code = e;
500
- }
501
- decorate() {
502
- return /* @__PURE__ */ l(Pe, { fallback: null, children: /* @__PURE__ */ l(cn, { code: this.__code, nodeKey: this.__key }) });
503
- }
504
- }
505
- function Qr(n) {
506
- return n instanceof J;
507
- }
508
- const an = {
509
- dependencies: [U],
510
- export: (n) => ln(n) ? "***" : null,
511
- regExp: /^(---|\*\*\*|___)\s?$/,
512
- replace: (n) => {
513
- const e = Ve();
514
- n.replace(e);
515
- },
516
- type: "element"
517
- }, dn = {
518
- dependencies: [],
519
- export: (n, e) => {
520
- if (Se(n)) {
521
- const t = n.getData();
522
- if (!t.length) return "";
523
- const r = Object.keys(t[0]), o = r.join(" | "), i = r.map(() => "---").join(" | "), s = t.map((c) => r.map((a) => String(c[a] || "")).join(" | "));
524
- return [`| ${o} |`, `| ${i} |`, ...s.map((c) => `| ${c} |`)].join(`
525
- `);
526
- }
527
- return null;
528
- },
529
- regExp: /^\s*(\|.+\|)\s*$/,
530
- replace: (n, e, t, r) => {
531
- const o = n.getPreviousSibling();
532
- if (/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/gm.test(t[0])) {
533
- n.remove();
534
- return;
535
- }
536
- const s = t[0].split("|").slice(1, -1).map((c) => c.trim());
537
- if (o?.getType() === "data_table" && Se(o)) {
538
- const c = o.getData(), a = {}, m = c.length === 1 && Object.values(c[0]).every((d) => d === ""), u = c.length > 0 ? Object.keys(c[0]) : s.map((d, p) => `col_${p}`);
539
- s.forEach((d, p) => {
540
- const _ = u[p] || `col_${p}`;
541
- a[_] = d;
542
- });
543
- const h = m ? [a] : [...c, a], f = ye(h);
544
- o.replace(f), n.remove();
545
- } else {
546
- const c = {};
547
- s.forEach((m, u) => {
548
- c[m || `col_${u}`] = "";
549
- });
550
- const a = ye([c]);
551
- n.replace(a);
552
- }
553
- },
554
- type: "element"
555
- }, un = {
556
- dependencies: [ne],
557
- export: (n, e) => {
558
- if (n instanceof ne) {
559
- let t = n.getTextContent();
560
- if (n.hasFormat("bold"))
561
- t = `**${t}**`;
562
- else if (n.hasFormat("italic"))
563
- t = `*${t}*`;
564
- else if (n.hasFormat("underline"))
565
- t = `<ins>${t}</ins>`;
566
- else
567
- return null;
568
- return t;
569
- }
570
- return null;
571
- },
572
- regExp: /<ins>(.*)<\/ins>/,
573
- importRegExp: /<ins>(.*)<\/ins>/,
574
- replace: (n, e) => {
575
- const t = V(e[1]);
576
- t.toggleFormat("underline"), n.replace(t);
577
- },
578
- type: "text-match"
579
- }, fn = {
580
- dependencies: [ne],
581
- export: (n, e) => null,
582
- regExp: /<u>(.*)<\/u>/,
583
- importRegExp: /<u>(.*)<\/u>/,
584
- replace: (n, e) => {
585
- const t = V(e[1]);
586
- t.toggleFormat("underline"), n.replace(t);
587
- },
588
- type: "text-match"
589
- }, ke = /https?:\/\/[^\s<>"']*[^\s<>"'.,:;"')\]}]/, G = (n) => n.replace(/\\([*_`~\\])/g, "$1"), mn = (n) => n.replace(/\\/g, "\\\\").replace(/"/g, '\\"'), pn = (n) => n?.replace(/\\(["\\])/g, "$1"), Xe = (n, e, t) => {
590
- if (n !== e)
591
- return t;
592
- const r = e.replace(/([*_`~\\])/g, "\\$1");
593
- return t.replace(r, e);
594
- }, hn = {
595
- dependencies: [pe],
596
- export: (n, e) => {
597
- if (!Mt(n) || Fe(n))
598
- return null;
599
- const t = n.getTitle(), r = G(n.getURL()), o = Xe(n.getTextContent(), r, e(n));
600
- return t != null ? `[${o}](${r} "${mn(t)}")` : `[${o}](${r})`;
601
- },
602
- importRegExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,
603
- regExp: /(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,
604
- replace: (n, e) => {
605
- const [, t, r, o] = e, i = G(r), s = Lt(i, {
606
- title: pn(o)
607
- }), c = t.split("[").length - 1, a = t.split("]").length - 1;
608
- let m = t, u = "";
609
- if (c < a)
610
- return;
611
- if (c > a) {
612
- const d = t.split("[");
613
- u = `[${d[0]}`, m = d.slice(1).join("[");
614
- }
615
- const h = G(m), f = V(h === i ? i : h);
616
- return f.setFormat(n.getFormat()), s.append(f), n.replace(s), u && s.insertBefore(V(u)), f;
617
- },
618
- trigger: ")",
619
- type: "text-match"
620
- }, _n = {
621
- dependencies: [he],
622
- export: (n, e) => {
623
- if (!Fe(n))
624
- return null;
625
- const t = G(n.getURL());
626
- return Xe(n.getTextContent(), t, e(n));
627
- },
628
- regExp: ke,
629
- importRegExp: ke,
630
- replace: (n, e) => {
631
- const t = G(e[0]), r = At(t), o = V(t);
632
- o.setFormat(n.getFormat()), r.append(o), n.replace(r);
633
- },
634
- type: "text-match"
635
- }, gn = [dn, an, un, fn, hn, _n], Zr = [We, pe, he, z, ze, Be, qe, _e, Je, J, H, U, ie], Ye = [Pt, ...Dt.filter((n) => n !== Ft), ...gn, rn, on], eo = [...Ye, Yt], to = ge;
636
- function xn(n) {
637
- return n.trim().toLowerCase() === "mermaid";
638
- }
639
- function bn(n) {
640
- const e = n.getLanguage() ?? "plaintext";
641
- return xn(e) ? (n.replace(new J(n.getTextContent())), !0) : !1;
642
- }
643
- function En() {
644
- const n = N(3), [e] = D();
645
- let t, r;
646
- return n[0] !== e ? (t = () => {
647
- e.update(yn);
648
- }, r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
649
- }
650
- function yn() {
651
- const n = gt(_e);
652
- for (const e of n)
653
- bn(e);
654
- }
655
- function Sn() {
656
- const n = N(3), [e] = D();
657
- let t, r;
658
- return n[0] !== e ? (t = () => Ut(e), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
659
- }
660
- function Qe(n) {
661
- const e = N(4), {
662
- isEditable: t
663
- } = n, [r] = D();
664
- let o, i;
665
- return e[0] !== r || e[1] !== t ? (o = () => {
666
- r.setEditable(t);
667
- }, 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;
668
- }
669
- function Ze() {
670
- const n = N(2), [e] = D();
671
- let t;
672
- return n[0] !== e ? (t = /* @__PURE__ */ l(A, { fontSize: "xs", color: "fg.muted", padding: "4", children: /* @__PURE__ */ l(Gt, { 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;
673
- }
674
- const Tn = /^---\s*\n([\s\S]*?)\n---\s*(?:\n|$)/, kn = /^```/, Cn = /^([ \t]*)((?:[-*+])|(?:\d+\.))\s+/, Nn = /^([ \t]+)/;
675
- function et(n) {
676
- let e = 0;
677
- for (const t of n)
678
- e += t === " " ? 4 : 1;
679
- return e;
680
- }
681
- function $n(n, e) {
682
- return [...n].reverse().find((t) => t.sourceIndentWidth < e);
683
- }
684
- function de(n, e, t) {
685
- return e === t && !n.includes(" ") ? n : " ".repeat(e);
686
- }
687
- function Rn(n, e) {
688
- const t = n.match(Nn);
689
- if (!t)
690
- return n.trim() !== "" && (e.length = 0), n;
691
- const r = et(t[1]), o = $n(e, r);
692
- if (!o) return n;
693
- const i = r + (o.normalizedIndentWidth - o.sourceIndentWidth), s = de(t[1], i, r);
694
- return s === t[1] ? n : `${s}${n.slice(t[1].length)}`;
695
- }
696
- function In(n, e, t) {
697
- const r = et(e[1]);
698
- for (; t.length && t.at(-1).sourceIndentWidth > r; )
699
- t.pop();
700
- const o = t.at(-1);
701
- if (o?.sourceIndentWidth === r)
702
- return `${de(e[1], o.normalizedIndentWidth, r)}${n.slice(e[1].length)}`;
703
- const i = t.at(-1), s = r - (i?.sourceIndentWidth ?? 0);
704
- let c = r;
705
- return i && s === 2 && !e[1].includes(" ") && (c = i.normalizedIndentWidth + 4), t.push({
706
- normalizedIndentWidth: c,
707
- sourceIndentWidth: r
708
- }), `${de(e[1], c, r)}${n.slice(e[1].length)}`;
709
- }
710
- function wn(n, e) {
711
- if (kn.test(n.trimStart()))
712
- return e.isInCodeFence = !e.isInCodeFence, n;
713
- if (e.isInCodeFence) return n;
714
- const t = n.match(Cn);
715
- return t ? In(n, t, e.activeListIndents) : Rn(n, e.activeListIndents);
716
- }
717
- function tt(n) {
718
- const e = n.split(`
719
- `), t = {
720
- isInCodeFence: !1,
721
- activeListIndents: []
722
- };
723
- return e.map((r) => wn(r, t)).join(`
724
- `);
725
- }
726
- function On(n) {
727
- const e = n.match(Tn);
728
- return e ? {
729
- frontmatter: e[0],
730
- body: n.slice(e[0].length)
731
- } : {
732
- frontmatter: "",
733
- body: n
734
- };
735
- }
736
- const vn = "INSERT_REFERENCE", Ln = "INSERT_BLOCK", nt = Le(vn), Mn = Le(Ln);
737
- function An(n) {
738
- const e = re();
739
- return n.style !== null && e.setFormat(n.style.textAlign), {
740
- node: e
741
- };
742
- }
743
- class Z extends ve {
744
- static getType() {
745
- return "comment";
746
- }
747
- static clone(e) {
748
- return new Z(e.__key);
749
- }
750
- createDOM(e) {
751
- const t = document.createElement("blockquote");
752
- return De(t, e.theme.comment), t;
753
- }
754
- updateDOM() {
755
- return !1;
756
- }
757
- static importDOM() {
758
- return {
759
- blockquote: () => ({
760
- conversion: An,
761
- priority: 0
762
- })
763
- };
764
- }
765
- exportDOM(e) {
766
- const {
767
- element: t
768
- } = super.exportDOM(e);
769
- if (t && xt(t)) {
770
- this.isEmpty() && t.append(document.createElement("br"));
771
- const r = this.getFormatType();
772
- t.style.textAlign = r;
773
- const o = this.getDirection();
774
- o && (t.dir = o);
775
- }
776
- return {
777
- element: t
778
- };
779
- }
780
- static importJSON(e) {
781
- const t = re();
782
- return t.setFormat(e.format), t.setIndent(e.indent), t.setDirection(e.direction), t;
783
- }
784
- exportJSON() {
785
- return {
786
- ...super.exportJSON(),
787
- type: "comment"
788
- };
789
- }
790
- getTextContent() {
791
- return `{{! ${super.getTextContent().replace(/([{}])/g, "\\$1")} }}`;
792
- }
793
- // mutation
794
- insertNewAfter(e, t) {
795
- const r = ce(), o = this.getDirection();
796
- return r.setDirection(o), this.insertAfter(r, t), r;
797
- }
798
- collapseAtStart() {
799
- const e = ce();
800
- return this.getChildren().forEach((r) => {
801
- e.append(r);
802
- }), this.replace(e), !0;
803
- }
804
- }
805
- function re() {
806
- return new Z();
807
- }
808
- const Pn = (n, e) => {
809
- const t = bt(), r = re();
810
- if (e) {
811
- e.getParent()?.replace(r, !0), e.remove(), r.selectEnd();
812
- return;
813
- }
814
- Et(t) && wt(t, re);
815
- };
816
- function Dn() {
817
- const n = N(3), [e] = D();
818
- let t, r;
819
- return n[0] !== e ? (t = () => me(e.registerCommand(Mn, Fn, Me)), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r), null;
820
- }
821
- function Fn(n) {
822
- const {
823
- optionId: e,
824
- nodeToReplace: t
825
- } = n;
826
- return Pn(e, t), !1;
827
- }
828
- const Bn = () => {
829
- const n = N(3), [e] = D();
830
- let t, r;
831
- n[0] !== e ? (t = () => me(e.registerNodeTransform(Z, (o) => {
832
- const s = o.getChildren().filter(qn);
833
- s.length > 0 && e.update(() => {
834
- s.forEach(Hn);
835
- });
836
- })), r = [e], n[0] = e, n[1] = t, n[2] = r) : (t = n[1], r = n[2]), B(t, r);
837
- };
838
- function qn(n) {
839
- return n.getType() === "comment";
840
- }
841
- function Hn(n) {
842
- n.replace(ce(), !0);
843
- }
844
- function Wn() {
845
- return Bn(), Dn(), null;
846
- }
847
- const zn = (n) => {
848
- let e = "";
849
- const t = n.getChildren(), r = t.length;
850
- for (let o = 0; o < r; o++) {
851
- const i = t[o];
852
- e += i.getTextContent(), yt(i) && o !== r - 1 && !i.isInline() && (e += `
853
- `);
854
- }
855
- return e;
856
- }, Jn = (n) => n.type !== "reference" ? null : `#${n.name ?? n.referenceId ?? ""}`, jn = (n) => n.type === "paragraph" && !!n.children?.length, rt = (n) => {
857
- if (n.type === "comment")
858
- return "";
859
- const e = Jn(n);
860
- if (e !== null)
861
- return e;
862
- let t = typeof n.text == "string" ? n.text : "";
863
- const r = n.children;
864
- if (!Array.isArray(r)) return t;
865
- const o = r.length;
866
- for (let i = 0; i < o; i += 1) {
867
- const s = r[i];
868
- if (s.type === "comment") {
869
- i !== o - 1 && (t += `
870
- `);
871
- continue;
872
- }
873
- t += rt(s), jn(s) && (t += `
874
- `);
875
- }
876
- return t;
877
- }, ot = (n) => {
878
- try {
879
- const e = JSON.parse(n);
880
- return rt(e.root ?? {});
881
- } catch {
882
- return "";
883
- }
884
- }, Un = {
885
- root: {
886
- direction: "ltr",
887
- format: "",
888
- indent: 0,
889
- type: "root",
890
- version: 1,
891
- children: [{
892
- type: "paragraph",
893
- version: 1,
894
- format: "",
895
- indent: 0,
896
- textFormat: void 0,
897
- direction: null,
898
- children: []
899
- }]
900
- }
901
- };
902
- function Kn(n = "") {
903
- return n.trim() ? {
904
- root: {
905
- direction: "ltr",
906
- format: "",
907
- indent: 0,
908
- type: "root",
909
- version: 1,
910
- children: n.split(/\r?\n/).map((r) => ({
911
- type: "paragraph",
912
- version: 1,
913
- format: "",
914
- indent: 0,
915
- textFormat: void 0,
916
- direction: null,
917
- children: r ? [{
918
- type: "text",
919
- version: 1,
920
- text: r,
921
- format: "",
922
- detail: 0,
923
- mode: "normal",
924
- style: ""
925
- }] : []
926
- }))
927
- }
928
- } : JSON.parse(JSON.stringify(Un));
929
- }
930
- function Gn(n) {
931
- const e = N(4), {
932
- editorRef: t,
933
- previousTextRef: r
934
- } = n, [o] = D();
935
- let i, s;
936
- return e[0] !== o || e[1] !== r ? (i = () => ({
937
- setEditorValue: (c) => {
938
- const a = o.parseEditorState(JSON.stringify(Kn(c)));
939
- o.setEditorState(a), r.current = ot(c), o.focus(void 0, {
940
- defaultSelection: "rootEnd"
941
- });
942
- }
943
- }), s = [o, r], e[0] = o, e[1] = r, e[2] = i, e[3] = s) : (i = e[2], s = e[3]), Nt(t, i, s), null;
944
- }
945
- const Vn = (n) => n.key !== "Enter" ? !1 : !n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey;
946
- function Xn(n) {
947
- const e = N(4), {
948
- onSubmit: t
949
- } = n, [r] = D();
950
- let o, i;
951
- return e[0] !== r || e[1] !== t ? (o = () => r.registerCommand(St, (s) => Vn(s) ? (s.preventDefault(), t?.(), !0) : !1, Tt), 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;
952
- }
953
- const Ce = ["table", "connector"], Yn = (n) => n.sort((r, o) => Ce.indexOf(r.group) - Ce.indexOf(o.group)).map((r, o) => ({
954
- ...r,
955
- index: o
956
- })).reduce((r, o) => {
957
- const i = r[o.group] ?? [];
958
- return i.push(o), r[o.group] = i, r;
959
- }, {});
960
- function Ne(n) {
961
- const e = N(22), {
962
- id: t,
963
- isSelected: r,
964
- onClick: o,
965
- onMouseEnter: i,
966
- setRefElement: s,
967
- secondaryLabel: c,
968
- primaryLabel: a,
969
- tabIndex: m
970
- } = n, u = m === void 0 ? -1 : m, h = r ? "bg.active" : "transparent", f = r ? "bg.active" : "bg.hover";
971
- let d;
972
- e[0] !== f ? (d = {
973
- bg: f
974
- }, e[0] = f, e[1] = d) : d = e[1];
975
- let p;
976
- e[2] !== a ? (p = /* @__PURE__ */ l(te.Trigger, { children: /* @__PURE__ */ l(P, { mt: "1px", lineClamp: 1, textOverflow: "ellipsis", textStyle: "label/M/regular", children: a }) }), e[2] = a, e[3] = p) : p = e[3];
977
- let _;
978
- e[4] !== a ? (_ = /* @__PURE__ */ l(te.Positioner, { children: /* @__PURE__ */ l(te.Content, { children: a }) }), e[4] = a, e[5] = _) : _ = e[5];
979
- let b;
980
- e[6] !== p || e[7] !== _ ? (b = /* @__PURE__ */ F(te.Root, { children: [
981
- p,
982
- _
983
- ] }), e[6] = p, e[7] = _, e[8] = b) : b = e[8];
984
- let g;
985
- e[9] !== c ? (g = c && /* @__PURE__ */ l(P, { lineClamp: 2, textOverflow: "ellipsis", textStyle: "label/S/regular", color: "fg.muted", children: c }), e[9] = c, e[10] = g) : g = e[10];
986
- let T;
987
- return e[11] !== t || e[12] !== r || e[13] !== o || e[14] !== i || e[15] !== s || e[16] !== h || e[17] !== d || e[18] !== b || e[19] !== g || e[20] !== u ? (T = /* @__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: [
988
- b,
989
- g
990
- ] }), e[11] = t, e[12] = r, e[13] = o, e[14] = i, e[15] = s, e[16] = h, e[17] = d, e[18] = b, e[19] = g, e[20] = u, e[21] = T) : T = e[21], T;
991
- }
992
- const Qn = (n) => {
993
- const e = N(12), {
994
- options: t,
995
- selectedIndex: r,
996
- onSelectItem: o,
997
- onMouseEnterItem: i
998
- } = n, {
999
- table: s,
1000
- connector: c
1001
- } = Yn(t), a = s === void 0 ? [] : s, m = c === void 0 ? [] : c, u = [...a, ...m].length;
1002
- let h, f;
1003
- e[0] !== r ? (h = () => {
1004
- document.getElementById(`typeahead-item-${r}`)?.scrollIntoView({
1005
- behavior: "instant",
1006
- block: "nearest"
1007
- });
1008
- }, f = [r], e[0] = r, e[1] = h, e[2] = f) : (h = e[1], f = e[2]), B(h, f);
1009
- const d = oe, p = "1000", _ = "absolute", b = "modal", g = "24rem", T = !1;
1010
- let E;
1011
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = {
1012
- base: "100vw",
1013
- md: "264px"
1014
- }, e[3] = E) : E = e[3];
1015
- let k;
1016
- e[4] !== u ? (k = !u && /* @__PURE__ */ l(P, { children: "No results" }), e[4] = u, e[5] = k) : k = e[5];
1017
- const y = !!a.length && /* @__PURE__ */ F(be, { children: [
1018
- /* @__PURE__ */ l(P, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Tables" }),
1019
- /* @__PURE__ */ l(A, { children: a.map((x) => /* @__PURE__ */ l(Ne, { id: `typeahead-item-${x.index}`, isSelected: r === x.index, onClick: () => o(x, x.index), onMouseEnter: () => i(x.index), primaryLabel: x.name, secondaryLabel: x.description, setRefElement: x.setRefElement, tabIndex: -1 }, x.id)) })
1020
- ] }), C = !!m.length && /* @__PURE__ */ F(be, { children: [
1021
- /* @__PURE__ */ l(P, { paddingTop: "xs", paddingBottom: "2xs", paddingX: "sm", color: "fg.muted", textStyle: "label/S/medium", children: "Data Sources" }),
1022
- /* @__PURE__ */ l(A, { children: m.map((x) => /* @__PURE__ */ l(Ne, { id: `typeahead-item-${x.index}`, isSelected: r === x.index, onClick: () => o(x, x.index), onMouseEnter: () => i(x.index), primaryLabel: x.name, secondaryLabel: x.description, setRefElement: x.setRefElement, tabIndex: -1 }, x.id)) })
1023
- ] });
1024
- let S;
1025
- return e[6] !== d || e[7] !== k || e[8] !== y || e[9] !== C || e[10] !== E ? (S = /* @__PURE__ */ F(d, { zIndex: p, position: _, layerStyle: b, maxHeight: g, showHorizontalScrollbar: T, minWidth: E, children: [
1026
- k,
1027
- y,
1028
- C
1029
- ] }), e[6] = d, e[7] = k, e[8] = y, e[9] = C, e[10] = E, e[11] = S) : S = e[11], S;
1030
- }, Zn = (n, e) => n.filter((t) => t.name.replace(/ /g, "_").toLowerCase().includes(e.toLowerCase()));
1031
- function er(n, e = []) {
1032
- const t = e.map((r, o) => ({
1033
- id: r.resourceId,
1034
- key: r.resourceId,
1035
- index: o,
1036
- group: r.resourceType,
1037
- name: r.name,
1038
- description: r.description,
1039
- setRefElement: () => {
1040
- }
1041
- }));
1042
- return n == null || n === "" ? t : Zn(t, n);
1043
- }
1044
- const it = "\\.\\-<>_:", xe = ["#"].join(""), st = `[^${xe}${it}\\s]`, tr = `(?:[${it}]|)`, lt = 75, nr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}${tr}){0,${lt}}))$`), rr = new RegExp(`(^|\\s|\\()([${xe}]((?:${st}){0,${lt}}))$`);
1045
- function or(n, e) {
1046
- let t = nr.exec(n);
1047
- if (t === null && (t = rr.exec(n)), t !== null) {
1048
- const r = t[1], o = t[3];
1049
- if (o.length >= e)
1050
- return {
1051
- leadOffset: t.index + r.length,
1052
- matchingString: o,
1053
- replaceableString: t[2]
1054
- };
1055
- }
1056
- return null;
1057
- }
1058
- const ir = 20;
1059
- function sr(n) {
1060
- const e = N(9), {
1061
- items: t
1062
- } = n;
1063
- let r;
1064
- e[0] !== t ? (r = t === void 0 ? [] : t, e[0] = t, e[1] = r) : r = e[1];
1065
- const o = r, [i, s] = $t(null), [c] = D(), a = er(i, o);
1066
- let m;
1067
- e[2] !== c ? (m = (_, b, g) => {
1068
- c.update(() => {
1069
- b && (c.dispatchCommand(nt, {
1070
- resourceId: _.id,
1071
- resourceType: _.group,
1072
- name: _.name,
1073
- nodeToReplace: b
1074
- }), g());
1075
- });
1076
- }, e[2] = c, e[3] = m) : m = e[3];
1077
- const u = m, h = cr;
1078
- let f;
1079
- e[4] !== a ? (f = a.slice(0, ir), e[4] = a, e[5] = f) : f = e[5];
1080
- const d = f;
1081
- let p;
1082
- return e[6] !== d || e[7] !== u ? (p = /* @__PURE__ */ l(Ot, { onQueryChange: s, onSelectOption: u, triggerFn: h, options: d, menuRenderFn: lr }), e[6] = d, e[7] = u, e[8] = p) : p = e[8], p;
1083
- }
1084
- function lr(n, e) {
1085
- const {
1086
- options: t,
1087
- selectedIndex: r,
1088
- selectOptionAndCleanUp: o,
1089
- setHighlightedIndex: i
1090
- } = e;
1091
- return n.current ? vt.createPortal(/* @__PURE__ */ l(Qn, { options: t, selectedIndex: r, onSelectItem: (s, c) => {
1092
- i(c), o(s);
1093
- }, onMouseEnterItem: (s) => {
1094
- i(s);
1095
- } }), n.current) : null;
1096
- }
1097
- function cr(n) {
1098
- return or(n, 0);
1099
- }
1100
- class Y extends ne {
1101
- __referenceId;
1102
- __name;
1103
- static getType() {
1104
- return "reference";
1105
- }
1106
- static clone(e) {
1107
- return new Y(e.__referenceId, e.__name, e.__key);
1108
- }
1109
- constructor(e, t, r) {
1110
- super(t, r), this.__referenceId = e, this.__name = t;
1111
- }
1112
- isKeyboardSelectable() {
1113
- return !1;
1114
- }
1115
- canBeEmpty() {
1116
- return !1;
1117
- }
1118
- canInsertTextAfter() {
1119
- return !1;
1120
- }
1121
- canInsertTextBefore() {
1122
- return !1;
1123
- }
1124
- createDOM(e) {
1125
- const t = document.createElement("span");
1126
- return De(t, e.theme.reference), t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, t;
1127
- }
1128
- updateDOM(e, t) {
1129
- 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;
1130
- }
1131
- exportDOM(e) {
1132
- const t = document.createElement("span");
1133
- return t.setAttribute("data-reference-id", this.__referenceId), t.setAttribute("data-name", this.__name), t.textContent = `#${this.__name}`, {
1134
- element: t
1135
- };
1136
- }
1137
- static importDOM() {
1138
- return {
1139
- span: (e) => !e.hasAttribute("data-reference-id") || !e.hasAttribute("data-name") ? null : {
1140
- conversion: ar,
1141
- priority: 1
1142
- }
1143
- };
1144
- }
1145
- static importJSON(e) {
1146
- return new Y(e.referenceId, e.name);
1147
- }
1148
- exportJSON() {
1149
- return {
1150
- ...super.exportJSON(),
1151
- type: "reference",
1152
- referenceId: this.__referenceId,
1153
- name: this.__name
1154
- };
1155
- }
1156
- getTextContent() {
1157
- return `#${this.__name}`;
1158
- }
1159
- }
1160
- function ar(n) {
1161
- const e = n.getAttribute("data-reference-id"), t = n.getAttribute("data-name");
1162
- return !e || !t ? null : {
1163
- node: ct(e, t)
1164
- };
1165
- }
1166
- function ct(n, e) {
1167
- return new Y(n, e);
1168
- }
1169
- const dr = (n, e, t) => {
1170
- const r = ct(e, t);
1171
- if (n) {
1172
- n?.replace(r), n.remove(), r.selectEnd();
1173
- return;
1174
- }
1175
- };
1176
- function ur(n) {
1177
- const e = N(4), {
1178
- onAddReference: t
1179
- } = n, [r] = D();
1180
- let o, i;
1181
- return e[0] !== r || e[1] !== t ? (o = () => me(r.registerCommand(nt, (s) => {
1182
- const {
1183
- resourceId: c,
1184
- resourceType: a,
1185
- name: m,
1186
- nodeToReplace: u
1187
- } = s;
1188
- return r.update(() => {
1189
- dr(u, c, m);
1190
- }), t?.(c, a), !0;
1191
- }, Me)), 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;
1192
- }
1193
- const fr = {
1194
- ...ge,
1195
- // Override paragraph class to remove margins specifically for prompt input
1196
- paragraph: "rich-text__p rich-text__p--no-margin"
1197
- }, mr = [Z, pt, Y], pr = (n, e) => {
1198
- const t = N(39), {
1199
- defaultState: r,
1200
- debug: o,
1201
- isEditable: i,
1202
- placeholder: s
1203
- } = n, c = o === void 0 ? !1 : o, a = i === void 0 ? !0 : i, {
1204
- onChange: m,
1205
- onError: u,
1206
- onSubmit: h,
1207
- references: f,
1208
- onAddReference: d
1209
- } = n, p = u === void 0 ? hr : u;
1210
- let _;
1211
- t[0] !== f ? (_ = f === void 0 ? [] : f, t[0] = f, t[1] = _) : _ = t[1];
1212
- const b = _;
1213
- let g;
1214
- t[2] !== r || t[3] !== a || t[4] !== p ? (g = {
1215
- namespace: "PROMPT_EDITOR",
1216
- nodes: mr,
1217
- editorState: r,
1218
- editable: a,
1219
- onError: p,
1220
- theme: fr
1221
- }, t[2] = r, t[3] = a, t[4] = p, t[5] = g) : g = t[5];
1222
- const T = g;
1223
- let E;
1224
- t[6] !== r ? (E = ot(r), t[6] = r, t[7] = E) : E = t[7];
1225
- const k = It(E);
1226
- let y;
1227
- t[8] !== s ? (y = s ?? /* @__PURE__ */ F(P, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: [
1228
- "Type your query here or press ",
1229
- /* @__PURE__ */ l(mt, { color: "fg.subtle", children: "#" }),
1230
- " to add a reference."
1231
- ] }), t[8] = s, t[9] = y) : y = t[9];
1232
- const C = y;
1233
- let S;
1234
- t[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ l(ht, {}), t[10] = S) : S = t[10];
1235
- let x;
1236
- t[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ l(Ue, { fullWidth: !0 }), t[11] = x) : x = t[11];
1237
- let w;
1238
- t[12] !== C ? (w = /* @__PURE__ */ l(Oe, { contentEditable: x, placeholder: C, ErrorBoundary: Ie }), t[12] = C, t[13] = w) : w = t[13];
1239
- let O;
1240
- t[14] !== m ? (O = /* @__PURE__ */ l(we, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (ee) => {
1241
- ee.read(() => {
1242
- const dt = Ae(), le = zn(dt);
1243
- le !== k.current && (k.current = le, m?.(le, ee.toJSON()));
1244
- });
1245
- } }), t[14] = m, t[15] = O) : O = t[15];
1246
- let v;
1247
- t[16] !== e ? (v = /* @__PURE__ */ l(Gn, { editorRef: e, previousTextRef: k }), t[16] = e, t[17] = v) : v = t[17];
1248
- let $;
1249
- t[18] !== a ? ($ = /* @__PURE__ */ l(Qe, { isEditable: a }), t[18] = a, t[19] = $) : $ = t[19];
1250
- let L;
1251
- t[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ l(Wn, {}), t[20] = L) : L = t[20];
1252
- let R;
1253
- t[21] !== h ? (R = /* @__PURE__ */ l(Xn, { onSubmit: h }), t[21] = h, t[22] = R) : R = t[22];
1254
- let I;
1255
- t[23] !== b ? (I = /* @__PURE__ */ l(sr, { items: b }), t[23] = b, t[24] = I) : I = t[24];
1256
- let M;
1257
- t[25] !== d ? (M = /* @__PURE__ */ l(ur, { onAddReference: d }), t[25] = d, t[26] = M) : M = t[26];
1258
- let q;
1259
- t[27] !== c ? (q = c ? /* @__PURE__ */ l(Ze, {}) : "", t[27] = c, t[28] = q) : q = t[28];
1260
- let K;
1261
- return t[29] !== T || t[30] !== w || t[31] !== O || t[32] !== v || t[33] !== $ || t[34] !== R || t[35] !== I || t[36] !== M || t[37] !== q ? (K = /* @__PURE__ */ l(fe, { direction: "column", justifyContent: "space-between", width: "100%", position: "relative", children: /* @__PURE__ */ F(Re, { initialConfig: T, children: [
1262
- S,
1263
- w,
1264
- O,
1265
- v,
1266
- $,
1267
- L,
1268
- R,
1269
- I,
1270
- M,
1271
- q
1272
- ] }) }), t[29] = T, t[30] = w, t[31] = O, t[32] = v, t[33] = $, t[34] = R, t[35] = I, t[36] = M, t[37] = q, t[38] = K) : K = t[38], K;
1273
- }, no = Rt(pr);
1274
- function hr() {
1275
- }
1276
- function _r(n) {
1277
- const e = N(5), {
1278
- value: t,
1279
- onUpdate: r
1280
- } = n, [o] = D();
1281
- let i, s;
1282
- return e[0] !== o || e[1] !== r || e[2] !== t ? (i = () => {
1283
- o && o.update(() => r(t), {
1284
- tag: "history-merge"
1285
- });
1286
- }, 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;
1287
- }
1288
- class j extends Q {
1289
- __href;
1290
- __label;
1291
- static getType() {
1292
- return "reference-link";
1293
- }
1294
- static clone(e) {
1295
- return new j(e.__href, e.__label, e.__key);
1296
- }
1297
- constructor(e, t, r) {
1298
- super(r), this.__href = e, this.__label = t;
1299
- }
1300
- createDOM(e, t) {
1301
- return document.createElement("span");
1302
- }
1303
- updateDOM(e, t, r) {
1304
- return !1;
1305
- }
1306
- getTextContent() {
1307
- return `{{link('${this.__label ?? this.__href}')}}`;
1308
- }
1309
- exportJSON() {
1310
- return {
1311
- type: j.getType(),
1312
- version: 1,
1313
- href: this.__href,
1314
- label: this.__label
1315
- };
1316
- }
1317
- static importJSON(e) {
1318
- return at(e.href, e.label);
1319
- }
1320
- decorate(e, t) {
1321
- const r = this.__href, i = r.split("/").pop() || "unknown", s = /^https?:\/\//i.test(r), c = /^#?\$PROJECT\//i.test(r);
1322
- return /* @__PURE__ */ l(A, { width: "fit-content", display: "inline-block", children: /* @__PURE__ */ l(je, { fileName: i, onSelect: () => {
1323
- if (s)
1324
- window.open(r, "_blank", "noopener,noreferrer");
1325
- else if (c) {
1326
- const a = r.replace(/^#?\$PROJECT\//i, ""), m = new CustomEvent("ui:open-project-file", {
1327
- detail: a
1328
- });
1329
- window.dispatchEvent(m);
1330
- } else
1331
- window.location.assign(r);
1332
- } }) });
1333
- }
1334
- }
1335
- function at(n, e) {
1336
- return new j(n, e);
1337
- }
1338
- function gr(n) {
1339
- return n instanceof j;
1340
- }
1341
- const $e = /\{\{\s*link\((['"])([^'"\s]+)\1\)\s*\}\}/, xr = {
1342
- dependencies: [j],
1343
- export: (n) => {
1344
- if (gr(n)) {
1345
- const e = n.__href, t = n.__label ?? e;
1346
- return t ? `{{link('${t}')}}` : `{{link('${e}')}}`;
1347
- }
1348
- return null;
1349
- },
1350
- regExp: $e,
1351
- importRegExp: $e,
1352
- replace: (n, e) => {
1353
- const t = e[2], o = /^(https?:\/\/|\/)/i.test(t) ? t : `#${t}`, i = t;
1354
- n.replace(at(o, i));
1355
- },
1356
- type: "text-match"
1357
- }, ue = [...Ye, xr];
1358
- function ro(n) {
1359
- const e = N(37), {
1360
- debug: t,
1361
- defaultState: r,
1362
- fullWidth: o,
1363
- isEditable: i,
1364
- onChange: s
1365
- } = n, c = t === void 0 ? !1 : t, a = r === void 0 ? "" : r, m = o === void 0 ? !1 : o, u = i === void 0 ? !1 : i;
1366
- let h;
1367
- e[0] !== a ? (h = On(a), e[0] = a, e[1] = h) : h = e[1];
1368
- const {
1369
- frontmatter: f,
1370
- body: d
1371
- } = h, p = u && !!s;
1372
- let _;
1373
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = [We, pe, he, z, ze, Be, qe, _e, Je, J, H, U, j], e[2] = _) : _ = e[2];
1374
- let b;
1375
- e[3] !== d ? (b = () => He(tt(d), ue, void 0, !1), e[3] = d, e[4] = b) : b = e[4];
1376
- let g;
1377
- e[5] !== u || e[6] !== b ? (g = {
1378
- namespace: "RICH_MESSAGE",
1379
- nodes: _,
1380
- editorState: b,
1381
- onError: Er,
1382
- editable: u,
1383
- theme: ge
1384
- }, e[5] = u, e[6] = b, e[7] = g) : g = e[7];
1385
- const T = g;
1386
- let E;
1387
- e[8] !== d ? (E = /* @__PURE__ */ l(_r, { value: d, onUpdate: br }), e[8] = d, e[9] = E) : E = e[9];
1388
- let k, y, C;
1389
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ l(Wt, {}), k = /* @__PURE__ */ l(qt, { newTab: !0 }), y = /* @__PURE__ */ l(zt, {}), e[10] = k, e[11] = y, e[12] = C) : (k = e[10], y = e[11], C = e[12]);
1390
- let S;
1391
- e[13] !== u ? (S = u ? /* @__PURE__ */ l(Jt, { maxIndent: 7 }) : null, e[13] = u, e[14] = S) : S = e[14];
1392
- let x, w, O, v;
1393
- e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ l(Ht, {}), w = /* @__PURE__ */ l(Sn, {}), O = /* @__PURE__ */ l(En, {}), v = /* @__PURE__ */ l(sn, {}), e[15] = x, e[16] = w, e[17] = O, e[18] = v) : (x = e[15], w = e[16], O = e[17], v = e[18]);
1394
- let $;
1395
- e[19] !== m ? ($ = /* @__PURE__ */ l(Oe, { contentEditable: /* @__PURE__ */ l(Ue, { fullWidth: m, isRichMessage: !0 }), ErrorBoundary: Ie }), e[19] = m, e[20] = $) : $ = e[20];
1396
- let L;
1397
- e[21] !== f || e[22] !== s || e[23] !== p ? (L = p ? /* @__PURE__ */ l(we, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (q) => {
1398
- q.read(() => {
1399
- const K = Ae(), ee = Bt(ue, K);
1400
- s?.(f + ee);
1401
- });
1402
- } }) : null, e[21] = f, e[22] = s, e[23] = p, e[24] = L) : L = e[24];
1403
- let R;
1404
- e[25] !== u ? (R = /* @__PURE__ */ l(Qe, { isEditable: u }), e[25] = u, e[26] = R) : R = e[26];
1405
- let I;
1406
- e[27] !== c ? (I = c && /* @__PURE__ */ l(Ze, {}), e[27] = c, e[28] = I) : I = e[28];
1407
- let M;
1408
- return e[29] !== T || e[30] !== S || e[31] !== $ || e[32] !== L || e[33] !== R || e[34] !== I || e[35] !== E ? (M = /* @__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(Re, { initialConfig: T, children: [
1409
- E,
1410
- C,
1411
- k,
1412
- y,
1413
- S,
1414
- x,
1415
- w,
1416
- O,
1417
- v,
1418
- $,
1419
- L,
1420
- R,
1421
- I
1422
- ] }) }), e[29] = T, e[30] = S, e[31] = $, e[32] = L, e[33] = R, e[34] = I, e[35] = E, e[36] = M) : M = e[36], M;
1423
- }
1424
- function br(n) {
1425
- He(tt(n), ue, void 0, !1);
1426
- }
1427
- function Er(n) {
1428
- return console.error(n);
1429
- }
1430
- export {
1431
- Qr as $,
1432
- Sn as C,
1433
- Yr as D,
1434
- sn as E,
1435
- En as I,
1436
- no as P,
1437
- ro as R,
1438
- Qe as T,
1439
- Zr as a,
1440
- Ue as b,
1441
- eo as c,
1442
- Ze as d,
1443
- to as e,
1444
- Zt as f,
1445
- Kn as g,
1446
- ot as h,
1447
- tt as n,
1448
- On as s
1449
- };
1450
- //# sourceMappingURL=rich-message-DBf_5YlW.js.map