markdown-flow-ui 0.3.9 → 0.3.11

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 (50) hide show
  1. package/dist/_virtual/index8.cjs +1 -1
  2. package/dist/_virtual/index8.es.js +2 -2
  3. package/dist/_virtual/index9.cjs +1 -1
  4. package/dist/_virtual/index9.es.js +2 -2
  5. package/dist/assets/markdown-flow-ui.css +1 -1
  6. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  7. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  8. package/dist/components/ContentRender/ContentRender.d.ts +2 -0
  9. package/dist/components/ContentRender/ContentRender.es.js +365 -361
  10. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  11. package/dist/components/ContentRender/IframeSandbox.cjs +4 -4
  12. package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
  13. package/dist/components/ContentRender/IframeSandbox.d.ts +2 -0
  14. package/dist/components/ContentRender/IframeSandbox.es.js +286 -287
  15. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  16. package/dist/components/ContentRender/SandboxApp.cjs +2 -2
  17. package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
  18. package/dist/components/ContentRender/SandboxApp.d.ts +3 -2
  19. package/dist/components/ContentRender/SandboxApp.es.js +136 -116
  20. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  21. package/dist/components/ContentRender/locales/contentRender.json.cjs +1 -1
  22. package/dist/components/ContentRender/locales/contentRender.json.d.ts +11 -11
  23. package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -11
  24. package/dist/components/Slide/Player.cjs +1 -1
  25. package/dist/components/Slide/Player.cjs.map +1 -1
  26. package/dist/components/Slide/Player.es.js +319 -321
  27. package/dist/components/Slide/Player.es.js.map +1 -1
  28. package/dist/components/Slide/Slide.cjs +1 -1
  29. package/dist/components/Slide/Slide.cjs.map +1 -1
  30. package/dist/components/Slide/Slide.es.js +446 -452
  31. package/dist/components/Slide/Slide.es.js.map +1 -1
  32. package/dist/components/Slide/useWakePlayerFromIframe.cjs +1 -1
  33. package/dist/components/Slide/useWakePlayerFromIframe.cjs.map +1 -1
  34. package/dist/components/Slide/useWakePlayerFromIframe.es.js +32 -32
  35. package/dist/components/Slide/useWakePlayerFromIframe.es.js.map +1 -1
  36. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
  37. package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
  38. package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +2 -1
  39. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +71 -25
  40. package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
  41. package/dist/markdown-flow-ui.css +1 -1
  42. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  43. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  44. package/dist/node_modules/classnames/index.cjs +1 -1
  45. package/dist/node_modules/classnames/index.es.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +0 -2
  48. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +0 -1
  49. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +0 -20
  50. package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +0 -1
@@ -1,79 +1,79 @@
1
- import { jsx as s, jsxs as We, Fragment as ut } from "react/jsx-runtime";
2
- import { d as ze } from "../../_virtual/index.es.js";
3
- import X, { useMemo as h, useState as Fe, useRef as T, useEffect as ne } from "react";
4
- import { sanitizeInvalidTagName as lt } from "./utils/sanitize-invalid-tag-name.es.js";
5
- import { stripSvgTextLineBreaks as dt } from "./utils/strip-svg-text-line-breaks.es.js";
1
+ import { jsx as s, jsxs as Fe, Fragment as dt } from "react/jsx-runtime";
2
+ import { d as Ge } from "../../_virtual/index.es.js";
3
+ import X, { useMemo as h, useState as _e, useRef as b, useEffect as te } from "react";
4
+ import { sanitizeInvalidTagName as mt } from "./utils/sanitize-invalid-tag-name.es.js";
5
+ import { stripSvgTextLineBreaks as pt } from "./utils/strip-svg-text-line-breaks.es.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import mt, { CodeBlockContext as pt } from "./CodeBlock.es.js";
11
- import ft from "./plugins/CustomVariable.es.js";
12
- import Ce from "./plugins/MermaidChart.es.js";
13
- import { preserveCustomVariableProperties as ht, restoreCustomVariableProperties as gt } from "./utils/custom-variable-props.es.js";
14
- import { subsetLanguages as vt, highlightLanguages as yt } from "./utils/highlight-languages.es.js";
15
- import { parseMarkdownSegments as Ge, mermaidBlockIsComplete as xt } from "./utils/mermaid-parse.es.js";
16
- import { getMarkdownSourceAnalysis as wt, getInlineCodeRanges as Ct } from "./utils/inline-code-ranges.es.js";
17
- import { remarkPlugins as Qe } from "./utils/markdown-plugins.es.js";
18
- import { normalizeInlineHtml as xe } from "./utils/normalize-inline-html.es.js";
19
- import { escapeTypedMarkdownMetadata as ke } from "./utils/escape-typed-metadata.es.js";
20
- import kt from "./IframeSandbox.es.js";
21
- import { getTrailingTypewriterGrapheme as we, appendContentAwareTypewriterQueue as _e, consumeContentAwareTypewriterQueue as Tt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as bt, isContentAwareTypewriterQueueEmpty as St } from "./utils/typewriter-pacing.es.js";
22
- import { normalizeWrappedSandboxContent as Rt, splitContentSegments as Bt } from "./utils/split-content.es.js";
23
- import { getInteractionDefaultValues as Nt } from "../../lib/interaction-defaults.es.js";
24
- import { getMarkdownFlowDirection as Mt, getMarkdownFlowLanguage as Lt } from "../../lib/locale.es.js";
25
- import { getContentRenderLocaleTexts as be } from "./contentRenderI18n.es.js";
26
- import { createVideoMarkdownRunPlan as At, cloneVideoMarkdownSourceTree as Vt, prepareVideoMarkdownRun as $t, projectVideoMarkdownRun as Et, getVideoMarkdownNodeState as Pt } from "./utils/video-markdown-run.es.js";
27
- import { unified as je } from "../../node_modules/unified/lib/index.es.js";
28
- import It from "../../node_modules/remark-rehype/lib/index.es.js";
29
- import Dt from "../../node_modules/rehype-raw/lib/index.es.js";
30
- import Wt from "../../node_modules/rehype-highlight/lib/index.es.js";
31
- import zt from "../../node_modules/rehype-katex/lib/index.es.js";
32
- import { Markdown as Oe } from "../../node_modules/react-markdown/lib/index.es.js";
33
- const Ft = 2, Te = ({
10
+ import ft, { CodeBlockContext as ht } from "./CodeBlock.es.js";
11
+ import gt from "./plugins/CustomVariable.es.js";
12
+ import ke from "./plugins/MermaidChart.es.js";
13
+ import { preserveCustomVariableProperties as vt, restoreCustomVariableProperties as xt } from "./utils/custom-variable-props.es.js";
14
+ import { subsetLanguages as yt, highlightLanguages as wt } from "./utils/highlight-languages.es.js";
15
+ import { parseMarkdownSegments as je, mermaidBlockIsComplete as Ct } from "./utils/mermaid-parse.es.js";
16
+ import { getMarkdownSourceAnalysis as kt, getInlineCodeRanges as Tt } from "./utils/inline-code-ranges.es.js";
17
+ import { remarkPlugins as Ue } from "./utils/markdown-plugins.es.js";
18
+ import { normalizeInlineHtml as we } from "./utils/normalize-inline-html.es.js";
19
+ import { escapeTypedMarkdownMetadata as Te } from "./utils/escape-typed-metadata.es.js";
20
+ import bt from "./IframeSandbox.es.js";
21
+ import { getTrailingTypewriterGrapheme as Ce, appendContentAwareTypewriterQueue as He, consumeContentAwareTypewriterQueue as St, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as Rt, isContentAwareTypewriterQueueEmpty as Bt } from "./utils/typewriter-pacing.es.js";
22
+ import { normalizeWrappedSandboxContent as Nt, splitContentSegments as Lt } from "./utils/split-content.es.js";
23
+ import { getInteractionDefaultValues as Mt } from "../../lib/interaction-defaults.es.js";
24
+ import { getMarkdownFlowDirection as At, getMarkdownFlowLanguage as Vt } from "../../lib/locale.es.js";
25
+ import { getContentRenderLocaleTexts as Se } from "./contentRenderI18n.es.js";
26
+ import { createVideoMarkdownRunPlan as $t, cloneVideoMarkdownSourceTree as Et, prepareVideoMarkdownRun as Pt, projectVideoMarkdownRun as It, getVideoMarkdownNodeState as Dt } from "./utils/video-markdown-run.es.js";
27
+ import { unified as qe } from "../../node_modules/unified/lib/index.es.js";
28
+ import Wt from "../../node_modules/remark-rehype/lib/index.es.js";
29
+ import zt from "../../node_modules/rehype-raw/lib/index.es.js";
30
+ import Ft from "../../node_modules/rehype-highlight/lib/index.es.js";
31
+ import Gt from "../../node_modules/rehype-katex/lib/index.es.js";
32
+ import { Markdown as Ke } from "../../node_modules/react-markdown/lib/index.es.js";
33
+ const _t = 2, be = ({
34
34
  svg: t,
35
35
  inline: r = !1
36
36
  }) => {
37
- const c = T(null), o = r ? "span" : "div";
38
- return ne(() => {
37
+ const c = b(null), o = r ? "span" : "div";
38
+ return te(() => {
39
39
  const u = c.current;
40
40
  if (!u) return;
41
- const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), x = "content-render-svg-style";
42
- let g = m.getElementById(x);
43
- g || (g = document.createElement("style"), g.id = x, g.textContent = `
41
+ const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), y = "content-render-svg-style";
42
+ let g = m.getElementById(y);
43
+ g || (g = document.createElement("style"), g.id = y, g.textContent = `
44
44
  svg { height: auto; display: inline-block; }
45
45
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
46
46
  svg.content-render-svg-el--fixed { max-width: none; }
47
47
  `, m.appendChild(g)), Array.from(m.childNodes).filter(
48
48
  (i) => i !== g
49
49
  ).forEach((i) => m.removeChild(i));
50
- const Q = document.createElement("template"), f = dt(t);
50
+ const Q = document.createElement("template"), f = pt(t);
51
51
  Q.innerHTML = f, m.append(Q.content.cloneNode(!0));
52
- let b = !1, V = !1;
52
+ let S = !1, A = !1;
53
53
  m.querySelectorAll("svg").forEach((i) => {
54
- const $ = i.getAttribute("viewBox");
55
- if (!$) return;
56
- const z = $.trim().split(/[\s,]+/).map((S) => Number(S));
57
- if (z.length !== 4 || z.some(Number.isNaN)) return;
58
- const [, , I, w] = z, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (S) => {
59
- if (!S) return !1;
60
- const N = S.trim().toLowerCase();
61
- return N === "auto" || N.endsWith("%");
62
- }, re = (S) => {
63
- if (!S) return null;
64
- const N = S.trim().toLowerCase();
65
- if (N === "auto" || N.endsWith("%"))
54
+ const V = i.getAttribute("viewBox");
55
+ if (!V) return;
56
+ const W = V.trim().split(/[\s,]+/).map((w) => Number(w));
57
+ if (W.length !== 4 || W.some(Number.isNaN)) return;
58
+ const [, , I, C] = W, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (w) => {
59
+ if (!w) return !1;
60
+ const $ = w.trim().toLowerCase();
61
+ return $ === "auto" || $.endsWith("%");
62
+ }, ne = (w) => {
63
+ if (!w) return null;
64
+ const $ = w.trim().toLowerCase();
65
+ if ($ === "auto" || $.endsWith("%"))
66
66
  return null;
67
- const te = Number.parseFloat(N);
68
- return Number.isNaN(te) ? null : te;
69
- }, de = U(O), me = U(D), oe = !O || O === "0", se = !D || D === "0", ae = re(O), ce = re(D);
70
- if (de || me || oe && se || ae === I && ce === w) {
71
- b = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && w > 0 && (i.style.aspectRatio = `${I} / ${w}`);
67
+ const j = Number.parseFloat($);
68
+ return Number.isNaN(j) ? null : j;
69
+ }, ie = U(O), ue = U(D), re = !O || O === "0", oe = !D || D === "0", le = ne(O), de = ne(D);
70
+ if (ie || ue || re && oe || le === I && de === C) {
71
+ S = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && C > 0 && (i.style.aspectRatio = `${I} / ${C}`);
72
72
  return;
73
73
  }
74
- V = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), oe && I > 0 && i.setAttribute("width", `${I}`), se && w > 0 && i.setAttribute("height", `${w}`);
74
+ A = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), re && I > 0 && i.setAttribute("width", `${I}`), oe && C > 0 && i.setAttribute("height", `${C}`);
75
75
  });
76
- const l = b && !V;
76
+ const l = S && !A;
77
77
  u.classList.toggle("content-render-svg--responsive", l), u.classList.toggle("content-render-svg--fixed", !l);
78
78
  }, [t]), /* @__PURE__ */ s(o, { className: "content-render-svg-scroll", children: /* @__PURE__ */ s(
79
79
  o,
@@ -84,23 +84,23 @@ const Ft = 2, Te = ({
84
84
  }
85
85
  }
86
86
  ) });
87
- }, le = X.createContext(
87
+ }, ce = X.createContext(
88
88
  null
89
- ), Ue = (t) => {
90
- const { receivedTree: r, ...c } = t, o = X.useContext(le), u = X.useContext(pt);
89
+ ), Ye = (t) => {
90
+ const { receivedTree: r, ...c } = t, o = X.useContext(ce), u = X.useContext(ht);
91
91
  if (!o)
92
92
  throw new Error("Markdown code renderer requires ContentRender context.");
93
- const { className: m, children: x, ...g } = c;
93
+ const { className: m, children: y, ...g } = c;
94
94
  if (/language-(\w+)/.exec(m || "")?.[1] === "mermaid") {
95
- const f = x?.toString().replace(/\n$/, "") || "", b = xt(
95
+ const f = y?.toString().replace(/\n$/, "") || "", S = Ct(
96
96
  o.current.renderContent,
97
97
  f
98
98
  );
99
99
  return /* @__PURE__ */ s(
100
- Ce,
100
+ ke,
101
101
  {
102
102
  chart: f,
103
- frozen: r ? !b : b,
103
+ frozen: r ? !S : S,
104
104
  messages: o.current.mermaidMessages
105
105
  }
106
106
  );
@@ -111,123 +111,123 @@ const Ft = 2, Te = ({
111
111
  className: m,
112
112
  ...g,
113
113
  dir: g.dir ?? (u ? void 0 : "ltr"),
114
- children: x
114
+ children: y
115
115
  }
116
116
  );
117
- }, Ke = [
118
- ht,
119
- Dt,
120
- lt,
121
- gt
122
- ], Ye = [
123
- [Wt, { languages: yt, subset: vt }],
124
- zt
125
- ], Gt = [
126
- ...Ke,
127
- ...Ye
128
- ], He = ({ content: t, components: r, locale: c }) => {
129
- const o = be(c);
117
+ }, Xe = [
118
+ vt,
119
+ zt,
120
+ mt,
121
+ xt
122
+ ], Ze = [
123
+ [Ft, { languages: wt, subset: yt }],
124
+ Gt
125
+ ], jt = [
126
+ ...Xe,
127
+ ...Ze
128
+ ], Qe = ({ content: t, components: r, locale: c }) => {
129
+ const o = Se(c);
130
130
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
131
- Oe,
131
+ Ke,
132
132
  {
133
- remarkPlugins: Qe,
134
- rehypePlugins: Gt,
133
+ remarkPlugins: Ue,
134
+ rehypePlugins: jt,
135
135
  remarkRehypeOptions: {
136
136
  footnoteLabel: o.footnoteLabel,
137
137
  footnoteBackLabel: (u, m) => {
138
- const x = String(u + 1) + (m > 1 ? `-${m}` : "");
139
- return o.footnoteBackLabel.replace("{reference}", x);
138
+ const y = String(u + 1) + (m > 1 ? `-${m}` : "");
139
+ return o.footnoteBackLabel.replace("{reference}", y);
140
140
  }
141
141
  },
142
142
  components: r,
143
143
  children: t
144
144
  }
145
145
  ) });
146
- }, _t = function() {
146
+ }, Ht = function() {
147
147
  this.parser = () => ({ type: "root", children: [] });
148
- }, jt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
148
+ }, qt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
149
149
  const u = h(() => {
150
- const f = be(o), b = je().use(Qe).use(It, {
150
+ const f = Se(o), S = qe().use(Ue).use(Wt, {
151
151
  allowDangerousHtml: !0,
152
152
  footnoteLabel: f.footnoteLabel,
153
- footnoteBackLabel: (i, $) => f.footnoteBackLabel.replace(
153
+ footnoteBackLabel: (i, V) => f.footnoteBackLabel.replace(
154
154
  "{reference}",
155
- String(i + 1) + ($ > 1 ? `-${$}` : "")
155
+ String(i + 1) + (V > 1 ? `-${V}` : "")
156
156
  )
157
- }).use(Ke), V = je().use(Ye), l = b.runSync(
158
- Vt(t),
157
+ }).use(Xe), A = qe().use(Ze), l = S.runSync(
158
+ Et(t),
159
159
  t.markdownSource
160
160
  );
161
- return $t(
161
+ return Pt(
162
162
  t,
163
163
  l,
164
- (i) => V.runSync(i, t.fullSource)
164
+ (i) => A.runSync(i, t.fullSource)
165
165
  );
166
166
  }, [t, o]), m = h(
167
- () => Et(u, r),
167
+ () => It(u, r),
168
168
  [u, r]
169
- ), x = T(c);
170
- x.current = c;
171
- const g = T(
169
+ ), y = b(c);
170
+ y.current = c;
171
+ const g = b(
172
172
  /* @__PURE__ */ new Map()
173
173
  ), J = h(() => {
174
- const f = /* @__PURE__ */ new Set(), b = (l) => {
175
- l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(b);
174
+ const f = /* @__PURE__ */ new Set(), S = (l) => {
175
+ l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(S);
176
176
  };
177
- b(u.tree);
178
- const V = {};
177
+ S(u.tree);
178
+ const A = {};
179
179
  for (const l of f) {
180
180
  if (!g.current.has(l)) {
181
181
  const i = ({
182
- node: $,
183
- children: z,
182
+ node: V,
183
+ children: W,
184
184
  ...I
185
185
  }) => {
186
- const w = Pt($);
187
- if (w?.svg)
188
- return w.svgSource ? /* @__PURE__ */ s(Te, { svg: w.svgSource, inline: !0 }) : null;
189
- if (w?.atomic)
190
- return w.active ? /* @__PURE__ */ s(ut, { children: z }) : null;
191
- if (w?.active === !1 && l !== "a") return null;
192
- const D = x.current[l], U = w?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
186
+ const C = Dt(V);
187
+ if (C?.svg)
188
+ return C.svgSource ? /* @__PURE__ */ s(be, { svg: C.svgSource, inline: !0 }) : null;
189
+ if (C?.atomic)
190
+ return C.active ? /* @__PURE__ */ s(dt, { children: W }) : null;
191
+ if (C?.active === !1 && l !== "a") return null;
192
+ const D = y.current[l], U = C?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
193
193
  return D ? X.createElement(
194
194
  D,
195
195
  {
196
196
  ...U,
197
- node: $,
198
- ...D === Ue ? { receivedTree: !0 } : {}
197
+ node: V,
198
+ ...D === Ye ? { receivedTree: !0 } : {}
199
199
  },
200
- z
201
- ) : X.createElement(l, U, z);
200
+ W
201
+ ) : X.createElement(l, U, W);
202
202
  };
203
203
  i.displayName = `StableMarkdown(${l})`, g.current.set(l, i);
204
204
  }
205
- V[l] = g.current.get(l);
205
+ A[l] = g.current.get(l);
206
206
  }
207
- return V;
207
+ return A;
208
208
  }, [u]), Q = h(
209
209
  () => [() => () => m],
210
210
  [m]
211
211
  );
212
212
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
213
- Oe,
213
+ Ke,
214
214
  {
215
- remarkPlugins: [_t],
215
+ remarkPlugins: [Ht],
216
216
  rehypePlugins: Q,
217
217
  components: J,
218
218
  children: ""
219
219
  }
220
220
  ) });
221
- }, j = (t) => t.type === "markdown" && t.immediate === !0, Ht = (t) => {
221
+ }, _ = (t) => t.type === "markdown" && t.immediate === !0, Qt = (t) => {
222
222
  if (t.length <= 1) return t;
223
223
  const r = [];
224
224
  return t.forEach((c) => {
225
- if (c.type === "sandbox" || j(c)) {
225
+ if (c.type === "sandbox" || _(c)) {
226
226
  r.push(c);
227
227
  return;
228
228
  }
229
229
  const o = r[r.length - 1];
230
- if (o && o.type !== "sandbox" && !j(o)) {
230
+ if (o && o.type !== "sandbox" && !_(o)) {
231
231
  r[r.length - 1] = {
232
232
  type: "markdown",
233
233
  value: `${o.value}${c.value}`
@@ -236,10 +236,10 @@ const Ft = 2, Te = ({
236
236
  }
237
237
  r.push({ type: "markdown", value: c.value });
238
238
  }), r;
239
- }, qt = (t, r, c) => {
239
+ }, Ot = (t, r, c) => {
240
240
  if (t.length >= r.length) return t;
241
241
  const o = c.find(
242
- ({ start: x, end: g }) => x < t.length && t.length < g
242
+ ({ start: y, end: g }) => y < t.length && t.length < g
243
243
  );
244
244
  if (!o) return t;
245
245
  const u = /^`+/.exec(r.slice(o.start))?.[0];
@@ -247,81 +247,83 @@ const Ft = 2, Te = ({
247
247
  return t;
248
248
  const m = o.end - u.length;
249
249
  return t.length > m ? t + u.slice(t.length - m) : t + (t.endsWith("`") ? " " : "") + u;
250
- }, qe = (t, r, c, o, u = 0) => {
251
- const m = qt(t, r, c);
252
- return ke(t, o, u) + m.slice(t.length);
253
- }, Qt = (t, r) => {
250
+ }, Oe = (t, r, c, o, u = 0) => {
251
+ const m = Ot(t, r, c);
252
+ return Te(t, o, u) + m.slice(t.length);
253
+ }, Ut = (t, r) => {
254
254
  const c = Math.max(1, r), o = Array.from(t);
255
255
  return {
256
256
  chunk: o.slice(0, c).join(""),
257
257
  rest: o.slice(c).join("")
258
258
  };
259
- }, Ot = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Ut = (t) => {
260
- const r = T(t);
261
- return Ot(r.current, t) || (r.current = t), r.current;
262
- }, Ln = ({
259
+ }, Kt = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Yt = (t) => {
260
+ const r = b(t);
261
+ return Kt(r.current, t) || (r.current = t), r.current;
262
+ }, Vn = ({
263
263
  onPlaceholderAccepted: t,
264
264
  content: r,
265
265
  contentType: c,
266
266
  locale: o,
267
267
  lang: u,
268
268
  dir: m,
269
- customRenderBar: x,
269
+ customRenderBar: y,
270
270
  onSend: g,
271
271
  typingSpeed: J = 30,
272
272
  enableTypewriter: Q = !1,
273
273
  typewriterPacing: f = "fixed",
274
- onTypeFinished: b,
275
- onTypewriterStateChange: V,
274
+ onTypeFinished: S,
275
+ onTypewriterStateChange: A,
276
276
  userInput: l,
277
277
  interactionDefaultValueOptions: i,
278
- defaultButtonText: $,
279
- defaultInputText: z,
278
+ defaultButtonText: V,
279
+ defaultInputText: W,
280
280
  defaultSelectedValues: I,
281
- readonly: w = !1,
281
+ readonly: C = !1,
282
282
  confirmButtonText: O,
283
283
  copyButtonText: D,
284
284
  copiedButtonText: U,
285
- sandboxLoadingText: re,
286
- disableSandboxLoadingOverlay: de = !1,
287
- sandboxFullscreenButtonText: me,
288
- sandboxExitFullscreenButtonText: oe,
289
- sandboxMode: se = "content",
290
- onClickCustomButtonAfterContent: ae,
291
- beforeSend: ce
285
+ sandboxLoadingText: ne,
286
+ sandboxStyleLoadingText: ie,
287
+ sandboxScriptLoadingText: ue,
288
+ disableSandboxLoadingOverlay: re = !1,
289
+ sandboxFullscreenButtonText: oe,
290
+ sandboxExitFullscreenButtonText: le,
291
+ sandboxMode: de = "content",
292
+ onClickCustomButtonAfterContent: me,
293
+ beforeSend: pe
292
294
  }) => {
293
- const W = be(o), ee = h(
295
+ const w = Se(o), $ = h(
294
296
  () => ({
295
- loading: W.mermaidLoadingText,
296
- emptyChart: W.mermaidEmptyChartText,
297
- error: W.mermaidErrorText
297
+ loading: w.mermaidLoadingText,
298
+ emptyChart: w.mermaidEmptyChartText,
299
+ error: w.mermaidErrorText
298
300
  }),
299
- [W]
300
- ), S = m ?? Mt(o), N = u ?? Lt(o), te = O || W.confirmButtonText, Se = D || W.copyButtonText, Re = U || W.copiedButtonText, Xe = me || W.sandboxFullscreenButtonText, Ze = oe || W.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
301
- () => Rt(r),
301
+ [w]
302
+ ), j = m ?? At(o), ee = u ?? Vt(o), Re = O || w.confirmButtonText, Be = D || w.copyButtonText, Ne = U || w.copiedButtonText, Je = oe || w.sandboxFullscreenButtonText, et = le || w.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
303
+ () => Nt(r),
302
304
  [r]
303
- ), M = h(
304
- () => wt(R),
305
+ ), N = h(
306
+ () => kt(R),
305
307
  [R]
306
- ), C = h(() => {
307
- const e = Ht(
308
- Bt(R, !0, !0, M)
308
+ ), k = h(() => {
309
+ const e = Qt(
310
+ Lt(R, !0, !0, N)
309
311
  );
310
- return R !== r && e.length && (e[0].type === "sandbox" || j(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
311
- }, [r, R, M]), K = C.some(
312
- (e) => e.type === "sandbox" || j(e)
313
- ), v = K ? C.filter(
314
- (e) => e.type !== "sandbox" && !j(e)
315
- ).map((e) => e.value).join("") : R, Be = Math.max(0, J), Je = f === "fixed" ? v : void 0, [E, Ne] = Fe(
312
+ return R !== r && e.length && (e[0].type === "sandbox" || _(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
313
+ }, [r, R, N]), K = k.some(
314
+ (e) => e.type === "sandbox" || _(e)
315
+ ), v = K ? k.filter(
316
+ (e) => e.type !== "sandbox" && !_(e)
317
+ ).map((e) => e.value).join("") : R, Le = Math.max(0, J), tt = f === "fixed" ? v : void 0, [E, Me] = _e(
316
318
  () => p ? "" : v
317
- ), ie = T(E), L = T(""), P = T({
319
+ ), se = b(E), L = b(""), P = b({
318
320
  tokens: [],
319
321
  head: 0,
320
322
  trailingGrapheme: ""
321
- }), H = T(0), Me = T(p), Le = T(f), Ae = T(v), pe = T(r), fe = T(!1), [et, tt] = Fe(0);
322
- ne(() => {
323
- const e = Me.current, n = Le.current, a = Ae.current, d = !!L.current, k = pe.current !== r, ye = k && r.startsWith(pe.current);
324
- pe.current = r, Me.current = p, Le.current = f, Ae.current = v, (k || p !== e) && (fe.current = !1);
323
+ }), H = b(0), Ae = b(p), Ve = b(f), $e = b(v), fe = b(r), he = b(!1), [nt, rt] = _e(0);
324
+ te(() => {
325
+ const e = Ae.current, n = Ve.current, a = $e.current, d = !!L.current, T = fe.current !== r, ye = T && r.startsWith(fe.current);
326
+ fe.current = r, Ae.current = p, Ve.current = f, $e.current = v, (T || p !== e) && (he.current = !1);
325
327
  const Y = () => {
326
328
  L.current = "", P.current = {
327
329
  tokens: [],
@@ -329,61 +331,61 @@ const Ft = 2, Te = ({
329
331
  trailingGrapheme: ""
330
332
  }, H.current = 0;
331
333
  }, Z = (B) => {
332
- ie.current = B, Ne(B);
334
+ se.current = B, Me(B);
333
335
  };
334
336
  if (!p) {
335
337
  Y(), Z(v);
336
338
  return;
337
339
  }
338
340
  e || (Y(), Z(""));
339
- let A = e ? ie.current : "";
340
- if (!v.startsWith(A)) {
341
+ let M = e ? se.current : "";
342
+ if (!v.startsWith(M)) {
341
343
  if (Y(), !ye) {
342
344
  Z(v), f === "content-aware" && (P.current = {
343
345
  tokens: [],
344
346
  head: 0,
345
- trailingGrapheme: we(v)
347
+ trailingGrapheme: Ce(v)
346
348
  });
347
349
  return;
348
350
  }
349
351
  let B = 0;
350
- for (; B < A.length && B < v.length && A[B] === v[B]; )
352
+ for (; B < M.length && B < v.length && M[B] === v[B]; )
351
353
  B += 1;
352
- A = A.slice(0, B), Z(A);
354
+ M = M.slice(0, B), Z(M);
353
355
  }
354
- let q = v.slice(A.length);
356
+ let q = v.slice(M.length);
355
357
  if (!q) {
356
358
  L.current = "", H.current = 0, P.current = f === "content-aware" ? {
357
359
  tokens: [],
358
360
  head: 0,
359
- trailingGrapheme: we(A)
361
+ trailingGrapheme: Ce(M)
360
362
  } : { tokens: [], head: 0, trailingGrapheme: "" };
361
363
  return;
362
364
  }
363
365
  if (f === "content-aware") {
364
366
  const B = a.slice(
365
- A.length
367
+ M.length
366
368
  );
367
369
  if (e && n === "content-aware" && v.startsWith(a) && L.current === B) {
368
- const _ = _e(
370
+ const G = He(
369
371
  P.current,
370
372
  v.slice(a.length)
371
373
  );
372
- P.current = _.queue, _.immediateChunk && (q = q.slice(
373
- _.immediateChunk.length
374
- ), Z(`${A}${_.immediateChunk}`));
374
+ P.current = G.queue, G.immediateChunk && (q = q.slice(
375
+ G.immediateChunk.length
376
+ ), Z(`${M}${G.immediateChunk}`));
375
377
  } else {
376
- const _ = _e(
378
+ const G = He(
377
379
  {
378
380
  tokens: [],
379
381
  head: 0,
380
- trailingGrapheme: we(A)
382
+ trailingGrapheme: Ce(M)
381
383
  },
382
384
  q
383
385
  );
384
- P.current = _.queue, _.immediateChunk && (q = q.slice(
385
- _.immediateChunk.length
386
- ), Z(`${A}${_.immediateChunk}`)), H.current = 0;
386
+ P.current = G.queue, G.immediateChunk && (q = q.slice(
387
+ G.immediateChunk.length
388
+ ), Z(`${M}${G.immediateChunk}`)), H.current = 0;
387
389
  }
388
390
  } else
389
391
  P.current = {
@@ -391,16 +393,16 @@ const Ft = 2, Te = ({
391
393
  head: 0,
392
394
  trailingGrapheme: ""
393
395
  }, H.current = 0;
394
- L.current = q, !d && q && tt((B) => B + 1);
395
- }, [r, v, p, f]), ne(() => {
396
- p && (fe.current || L.current || E !== v || (fe.current = !0, b?.()));
396
+ L.current = q, !d && q && rt((B) => B + 1);
397
+ }, [r, v, p, f]), te(() => {
398
+ p && (he.current || L.current || E !== v || (he.current = !0, S?.()));
397
399
  }, [
398
400
  r,
399
401
  v,
400
402
  E,
401
403
  p,
402
- b
403
- ]), ne(() => {
404
+ S
405
+ ]), te(() => {
404
406
  if (!p || !L.current)
405
407
  return;
406
408
  const e = window.setTimeout(() => {
@@ -408,15 +410,15 @@ const Ft = 2, Te = ({
408
410
  return;
409
411
  let n = "";
410
412
  if (f === "content-aware") {
411
- const d = Tt(
413
+ const d = St(
412
414
  P.current,
413
- H.current + bt
415
+ H.current + Rt
414
416
  );
415
- n = d.chunk, P.current = d.queue, St(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
417
+ n = d.chunk, P.current = d.queue, Bt(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
416
418
  } else
417
- n = Qt(
419
+ n = Ut(
418
420
  L.current,
419
- Ft
421
+ _t
420
422
  ).chunk;
421
423
  if (!n)
422
424
  return;
@@ -425,23 +427,23 @@ const Ft = 2, Te = ({
425
427
  head: 0,
426
428
  trailingGrapheme: P.current.trailingGrapheme
427
429
  } : { tokens: [], head: 0, trailingGrapheme: "" }, H.current = 0);
428
- const a = `${ie.current}${n}`;
429
- ie.current = a, Ne(a);
430
- }, Be);
430
+ const a = `${se.current}${n}`;
431
+ se.current = a, Me(a);
432
+ }, Le);
431
433
  return () => window.clearTimeout(e);
432
434
  }, [
433
435
  E,
434
- Je,
436
+ tt,
435
437
  p,
436
438
  f,
437
- Be,
438
- et
439
+ Le,
440
+ nt
439
441
  ]);
440
- const F = h(() => {
442
+ const z = h(() => {
441
443
  let e = 0;
442
- return C.map((n) => {
444
+ return k.map((n) => {
443
445
  if (!p) return n;
444
- if (n.type === "sandbox" || j(n))
446
+ if (n.type === "sandbox" || _(n))
445
447
  return E.length >= e ? n : { ...n, value: "" };
446
448
  const a = E.slice(
447
449
  e,
@@ -449,13 +451,13 @@ const Ft = 2, Te = ({
449
451
  );
450
452
  return e += n.value.length, { ...n, value: a };
451
453
  });
452
- }, [C, E, p]), Ve = h(
454
+ }, [k, E, p]), Ee = h(
453
455
  () => ({
454
456
  isTypewriterEnabled: p,
455
457
  isTyping: p && E !== v,
456
458
  isComplete: E === v,
457
- renderedLength: r.length - C.reduce(
458
- (e, n, a) => e + n.value.length - F[a].value.length,
459
+ renderedLength: r.length - k.reduce(
460
+ (e, n, a) => e + n.value.length - z[a].value.length,
459
461
  0
460
462
  ),
461
463
  totalLength: r.length
@@ -465,134 +467,134 @@ const Ft = 2, Te = ({
465
467
  v,
466
468
  E,
467
469
  p,
468
- C,
469
- F
470
+ k,
471
+ z
470
472
  ]
471
473
  );
472
- ne(() => {
473
- V?.(Ve);
474
- }, [V, Ve]);
475
- const he = h(() => {
474
+ te(() => {
475
+ A?.(Ee);
476
+ }, [A, Ee]);
477
+ const ge = h(() => {
476
478
  let e = 0;
477
- return C.map((n) => {
479
+ return k.map((n) => {
478
480
  const a = e;
479
481
  return e += n.value.length, a;
480
482
  });
481
- }, [C]), ue = h(
482
- () => p ? C.map(
483
- (e) => e.type === "sandbox" || j(e) ? [] : e.value === R ? M.inline : Ct(e.value)
483
+ }, [k]), ae = h(
484
+ () => p ? k.map(
485
+ (e) => e.type === "sandbox" || _(e) ? [] : e.value === R ? N.inline : Tt(e.value)
484
486
  ) : [],
485
- [p, C, R, M]
486
- ), nt = h(
487
- () => K ? F.map(
488
- (e, n) => e.type === "sandbox" || j(e) ? e.value : p ? qe(
487
+ [p, k, R, N]
488
+ ), ot = h(
489
+ () => K ? z.map(
490
+ (e, n) => e.type === "sandbox" || _(e) ? e.value : p ? Oe(
489
491
  e.value,
490
- C[n].value,
491
- ue[n] ?? [],
492
- M.metadata,
493
- he[n]
494
- ) : ke(
492
+ k[n].value,
493
+ ae[n] ?? [],
494
+ N.metadata,
495
+ ge[n]
496
+ ) : Te(
495
497
  e.value,
496
- M.metadata,
497
- he[n]
498
+ N.metadata,
499
+ ge[n]
498
500
  )
499
501
  ) : [],
500
502
  [
501
503
  K,
502
504
  p,
503
- F,
504
- ue,
505
- C,
506
- M.metadata,
507
- he
505
+ z,
506
+ ae,
507
+ k,
508
+ N.metadata,
509
+ ge
508
510
  ]
509
- ), rt = h(() => {
511
+ ), st = h(() => {
510
512
  const e = [];
511
- C.forEach((n, a) => {
513
+ k.forEach((n, a) => {
512
514
  const d = e.at(-1);
513
515
  n.type !== "sandbox" && d && !d.sandbox ? d.indices.push(a) : e.push({ indices: [a], sandbox: n.type === "sandbox" });
514
516
  });
515
517
  for (const n of e)
516
- if (!n.sandbox && n.indices.some((a) => j(C[a]))) {
517
- const a = n.indices.map((k) => C[k]), d = a.map((k) => k.value).join("");
518
- n.plan = At(
518
+ if (!n.sandbox && n.indices.some((a) => _(k[a]))) {
519
+ const a = n.indices.map((T) => k[T]), d = a.map((T) => T.value).join("");
520
+ n.plan = $t(
519
521
  a,
520
- d === R ? M : void 0
522
+ d === R ? N : void 0
521
523
  );
522
524
  }
523
525
  return e;
524
- }, [C, R, M]), G = K ? F.map((e) => e.value).join("") : p ? E : R, ot = h(
525
- () => x ? xe(G) : "",
526
- [x, G]
527
- ), $e = h(
528
- () => K ? "" : xe(
529
- p ? qe(
530
- G,
526
+ }, [k, R, N]), F = K ? z.map((e) => e.value).join("") : p ? E : R, at = h(
527
+ () => y ? we(F) : "",
528
+ [y, F]
529
+ ), Pe = h(
530
+ () => K ? "" : we(
531
+ p ? Oe(
532
+ F,
531
533
  R,
532
- ue[0] ?? [],
533
- M.metadata
534
- ) : ke(
535
- G,
536
- M.metadata
534
+ ae[0] ?? [],
535
+ N.metadata
536
+ ) : Te(
537
+ F,
538
+ N.metadata
537
539
  )
538
540
  ),
539
541
  [
540
542
  R,
541
543
  K,
542
544
  p,
543
- G,
544
- ue,
545
- M.metadata
545
+ F,
546
+ ae,
547
+ N.metadata
546
548
  ]
547
- ), ge = h(
548
- () => Nt(
549
- G,
549
+ ), ve = h(
550
+ () => Mt(
551
+ F,
550
552
  l,
551
553
  i
552
554
  ),
553
- [i, G, l]
554
- ), Ee = ($ ? ze.trimVariablePadding($) : void 0) || ge.buttonText, Pe = z?.trim() || ge.inputText, st = h(
555
- () => l ? l.split(",").map((e) => ze.trimVariablePadding(e)).filter(Boolean) : void 0,
555
+ [i, F, l]
556
+ ), Ie = (V ? Ge.trimVariablePadding(V) : void 0) || ve.buttonText, De = W?.trim() || ve.inputText, ct = h(
557
+ () => l ? l.split(",").map((e) => Ge.trimVariablePadding(e)).filter(Boolean) : void 0,
556
558
  [l]
557
- ), at = I?.length ? I : ge.selectedValues || st, Ie = Ut(
558
- at
559
- ), y = T({
559
+ ), it = I?.length ? I : ve.selectedValues || ct, We = Yt(
560
+ it
561
+ ), x = b({
560
562
  onPlaceholderAccepted: t,
561
- direction: S,
562
- language: N,
563
- mermaidMessages: ee,
564
- beforeSend: ce,
563
+ direction: j,
564
+ language: ee,
565
+ mermaidMessages: $,
566
+ beforeSend: pe,
565
567
  locale: o,
566
- onClickCustomButtonAfterContent: ae,
568
+ onClickCustomButtonAfterContent: me,
567
569
  onSend: g,
568
- readonly: w,
569
- renderContent: G,
570
- resolvedConfirmButtonText: te,
571
- resolvedCopiedButtonText: Re,
572
- resolvedCopyButtonText: Se,
573
- resolvedDefaultButtonText: Ee,
574
- resolvedDefaultInputText: Pe,
575
- resolvedDefaultSelectedValues: Ie
570
+ readonly: C,
571
+ renderContent: F,
572
+ resolvedConfirmButtonText: Re,
573
+ resolvedCopiedButtonText: Ne,
574
+ resolvedCopyButtonText: Be,
575
+ resolvedDefaultButtonText: Ie,
576
+ resolvedDefaultInputText: De,
577
+ resolvedDefaultSelectedValues: We
576
578
  });
577
- y.current = {
579
+ x.current = {
578
580
  onPlaceholderAccepted: t,
579
- direction: S,
580
- language: N,
581
- mermaidMessages: ee,
582
- beforeSend: ce,
581
+ direction: j,
582
+ language: ee,
583
+ mermaidMessages: $,
584
+ beforeSend: pe,
583
585
  locale: o,
584
- onClickCustomButtonAfterContent: ae,
586
+ onClickCustomButtonAfterContent: me,
585
587
  onSend: g,
586
- readonly: w,
587
- renderContent: G,
588
- resolvedConfirmButtonText: te,
589
- resolvedCopiedButtonText: Re,
590
- resolvedCopyButtonText: Se,
591
- resolvedDefaultButtonText: Ee,
592
- resolvedDefaultInputText: Pe,
593
- resolvedDefaultSelectedValues: Ie
588
+ readonly: C,
589
+ renderContent: F,
590
+ resolvedConfirmButtonText: Re,
591
+ resolvedCopiedButtonText: Ne,
592
+ resolvedCopyButtonText: Be,
593
+ resolvedDefaultButtonText: Ie,
594
+ resolvedDefaultInputText: De,
595
+ resolvedDefaultSelectedValues: We
594
596
  };
595
- const ve = h(
597
+ const xe = h(
596
598
  () => ({
597
599
  "custom-button-after-content": ({
598
600
  children: e
@@ -600,28 +602,28 @@ const Ft = 2, Te = ({
600
602
  "button",
601
603
  {
602
604
  className: "content-render-custom-button-after-content",
603
- onClick: y.current.onClickCustomButtonAfterContent,
605
+ onClick: x.current.onClickCustomButtonAfterContent,
604
606
  children: /* @__PURE__ */ s("span", { className: "content-render-custom-button-after-content-inner", children: e })
605
607
  }
606
608
  ),
607
609
  "custom-variable": (e) => /* @__PURE__ */ s(
608
- ft,
610
+ gt,
609
611
  {
610
612
  ...e,
611
- readonly: y.current.readonly,
612
- defaultButtonText: y.current.resolvedDefaultButtonText,
613
- defaultInputText: y.current.resolvedDefaultInputText,
614
- defaultSelectedValues: y.current.resolvedDefaultSelectedValues,
615
- onSend: y.current.onSend,
616
- onPlaceholderAccepted: y.current.onPlaceholderAccepted,
617
- beforeSend: y.current.beforeSend,
618
- locale: y.current.locale,
619
- dir: y.current.direction,
620
- lang: y.current.language,
621
- confirmButtonText: y.current.resolvedConfirmButtonText
613
+ readonly: x.current.readonly,
614
+ defaultButtonText: x.current.resolvedDefaultButtonText,
615
+ defaultInputText: x.current.resolvedDefaultInputText,
616
+ defaultSelectedValues: x.current.resolvedDefaultSelectedValues,
617
+ onSend: x.current.onSend,
618
+ onPlaceholderAccepted: x.current.onPlaceholderAccepted,
619
+ beforeSend: x.current.beforeSend,
620
+ locale: x.current.locale,
621
+ dir: x.current.direction,
622
+ lang: x.current.language,
623
+ confirmButtonText: x.current.resolvedConfirmButtonText
622
624
  }
623
625
  ),
624
- code: Ue,
626
+ code: Ye,
625
627
  table: ({ ...e }) => /* @__PURE__ */ s("div", { className: "content-render-table-container", children: /* @__PURE__ */ s("table", { className: "content-render-table", ...e }) }),
626
628
  th: ({ ...e }) => /* @__PURE__ */ s("th", { className: "content-render-th", ...e }),
627
629
  td: ({ ...e }) => /* @__PURE__ */ s("td", { className: "content-render-td", ...e }),
@@ -643,120 +645,122 @@ const Ft = 2, Te = ({
643
645
  ) : /* @__PURE__ */ s("input", { ...e }),
644
646
  a: ({ children: e, ...n }) => /* @__PURE__ */ s("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
645
647
  pre: (e) => /* @__PURE__ */ s(
646
- mt,
648
+ ft,
647
649
  {
648
650
  ...e,
649
- copyButtonText: y.current.resolvedCopyButtonText,
650
- copiedButtonText: y.current.resolvedCopiedButtonText
651
+ copyButtonText: x.current.resolvedCopyButtonText,
652
+ copiedButtonText: x.current.resolvedCopiedButtonText
651
653
  }
652
654
  )
653
655
  }),
654
656
  []
655
- ), ct = h(
656
- () => Ge($e),
657
- [$e]
658
- ), it = (e, n) => {
659
- const a = xe(e);
660
- return Ge(a).map((k, ye) => {
661
- const Y = `${n}-${k.type}-${ye}`;
662
- return k.type === "text" ? /* @__PURE__ */ s(
663
- le.Provider,
657
+ ), ut = h(
658
+ () => je(Pe),
659
+ [Pe]
660
+ ), lt = (e, n) => {
661
+ const a = we(e);
662
+ return je(a).map((T, ye) => {
663
+ const Y = `${n}-${T.type}-${ye}`;
664
+ return T.type === "text" ? /* @__PURE__ */ s(
665
+ ce.Provider,
664
666
  {
665
- value: y,
667
+ value: x,
666
668
  children: /* @__PURE__ */ s(
667
- He,
669
+ Qe,
668
670
  {
669
671
  locale: o,
670
- components: ve,
671
- content: k.value
672
+ components: xe,
673
+ content: T.value
672
674
  }
673
675
  )
674
676
  },
675
677
  Y
676
- ) : k.type === "mermaid" ? /* @__PURE__ */ s(
677
- Ce,
678
+ ) : T.type === "mermaid" ? /* @__PURE__ */ s(
679
+ ke,
678
680
  {
679
- chart: k.value,
680
- frozen: !k.complete,
681
- messages: ee
681
+ chart: T.value,
682
+ frozen: !T.complete,
683
+ messages: $
682
684
  },
683
685
  Y
684
- ) : k.type === "svg" ? /* @__PURE__ */ s(Te, { svg: k.value }, Y) : null;
686
+ ) : T.type === "svg" ? /* @__PURE__ */ s(be, { svg: T.value }, Y) : null;
685
687
  });
686
- }, De = x ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(x, {
688
+ }, ze = y ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(y, {
687
689
  content: r,
688
- displayContent: ot,
690
+ displayContent: at,
689
691
  onSend: g
690
692
  }) }) : null;
691
- return K ? /* @__PURE__ */ We(
693
+ return K ? /* @__PURE__ */ Fe(
692
694
  "div",
693
695
  {
694
696
  className: "content-render markdown-body",
695
- dir: S,
696
- lang: N,
697
+ dir: j,
698
+ lang: ee,
697
699
  children: [
698
- rt.map((e) => {
699
- const n = e.indices[0], a = F[n];
700
+ st.map((e) => {
701
+ const n = e.indices[0], a = z[n];
700
702
  return e.sandbox ? a.type === "sandbox" && a.value && !a.pending ? /* @__PURE__ */ s(
701
- kt,
703
+ bt,
702
704
  {
703
705
  hideFullScreen: !0,
704
706
  type: "sandbox",
705
707
  content: a.value,
706
708
  className: "content-render-iframe",
707
709
  locale: o,
708
- dir: S,
709
- lang: N,
710
- loadingText: re,
711
- disableLoadingOverlay: de,
712
- fullScreenButtonText: Xe,
713
- exitFullScreenButtonText: Ze,
714
- mode: se
710
+ dir: j,
711
+ lang: ee,
712
+ loadingText: ne,
713
+ styleLoadingText: ie,
714
+ scriptLoadingText: ue,
715
+ disableLoadingOverlay: re,
716
+ fullScreenButtonText: Je,
717
+ exitFullScreenButtonText: et,
718
+ mode: de
715
719
  },
716
720
  `sandbox-${n}`
717
721
  ) : null : e.plan ? /* @__PURE__ */ s(
718
- le.Provider,
722
+ ce.Provider,
719
723
  {
720
- value: y,
724
+ value: x,
721
725
  children: /* @__PURE__ */ s(
722
- jt,
726
+ qt,
723
727
  {
724
728
  locale: o,
725
- components: ve,
729
+ components: xe,
726
730
  plan: e.plan,
727
731
  renderedSegments: e.indices.map(
728
- (d) => F[d]
732
+ (d) => z[d]
729
733
  )
730
734
  }
731
735
  )
732
736
  },
733
737
  `md-${n}`
734
- ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: F[d].type === "markdown" && F[d].pending ? null : it(
735
- nt[d],
738
+ ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: z[d].type === "markdown" && z[d].pending ? null : lt(
739
+ ot[d],
736
740
  `md-${d}`
737
741
  ) }, `md-${d}`));
738
742
  }),
739
- De
743
+ ze
740
744
  ]
741
745
  }
742
- ) : /* @__PURE__ */ We(
746
+ ) : /* @__PURE__ */ Fe(
743
747
  "div",
744
748
  {
745
749
  className: "content-render markdown-body",
746
- dir: S,
747
- lang: N,
750
+ dir: j,
751
+ lang: ee,
748
752
  children: [
749
- ct.map((e, n) => {
753
+ ut.map((e, n) => {
750
754
  if (e.type === "text")
751
755
  return /* @__PURE__ */ s(
752
- le.Provider,
756
+ ce.Provider,
753
757
  {
754
- value: y,
758
+ value: x,
755
759
  children: /* @__PURE__ */ s(
756
- He,
760
+ Qe,
757
761
  {
758
762
  locale: o,
759
- components: ve,
763
+ components: xe,
760
764
  content: e.value
761
765
  }
762
766
  )
@@ -765,24 +769,24 @@ const Ft = 2, Te = ({
765
769
  );
766
770
  if (e.type === "mermaid")
767
771
  return /* @__PURE__ */ s(
768
- Ce,
772
+ ke,
769
773
  {
770
774
  chart: e.value,
771
775
  frozen: !e.complete,
772
- messages: ee
776
+ messages: $
773
777
  },
774
778
  n
775
779
  );
776
780
  if (e.type === "svg")
777
- return /* @__PURE__ */ s(Te, { svg: e.value }, n);
781
+ return /* @__PURE__ */ s(be, { svg: e.value }, n);
778
782
  }),
779
- De
783
+ ze
780
784
  ]
781
785
  }
782
786
  );
783
787
  };
784
788
  export {
785
- He as MarkdownRenderer,
786
- Ln as default
789
+ Qe as MarkdownRenderer,
790
+ Vn as default
787
791
  };
788
792
  //# sourceMappingURL=ContentRender.es.js.map