@loopstack/loopstack-studio 0.26.1 → 0.28.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.
@@ -59,12 +59,12 @@ const CodeBlock = (l) => {
59
59
  d[14] === p ? D = d[15] : (D = cn("group bg-background text-foreground relative w-full overflow-hidden rounded-md border", p), d[14] = p, d[15] = D);
60
60
  let O;
61
61
  d[16] === y ? O = d[17] : (O = /* @__PURE__ */ jsx("div", {
62
- className: "[&>pre]:bg-background! [&>pre]:text-foreground! overflow-hidden dark:hidden [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
62
+ className: "[&>pre]:bg-background! [&>pre]:text-foreground! overflow-x-auto dark:hidden [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
63
63
  dangerouslySetInnerHTML: { __html: y }
64
64
  }), d[16] = y, d[17] = O);
65
65
  let k;
66
66
  d[18] === x ? k = d[19] : (k = /* @__PURE__ */ jsx("div", {
67
- className: "[&>pre]:bg-background! [&>pre]:text-foreground! hidden overflow-hidden dark:block [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
67
+ className: "[&>pre]:bg-background! [&>pre]:text-foreground! hidden overflow-x-auto dark:block [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
68
68
  dangerouslySetInnerHTML: { __html: x }
69
69
  }), d[18] = x, d[19] = k);
70
70
  let A;
@@ -124,7 +124,16 @@ const ToolHeader = (i) => {
124
124
  ...l,
125
125
  children: [f, m]
126
126
  }), a[11] = l, a[12] = u, a[13] = m, a[14] = h) : h = a[14], h;
127
- }, ToolOutput = (i) => {
127
+ };
128
+ var VALUE_PREVIEW_CHARS = 150, truncateForDisplay = (e) => {
129
+ if (typeof e == "string") return e.length > VALUE_PREVIEW_CHARS ? e.slice(0, VALUE_PREVIEW_CHARS) + "..." : e;
130
+ if (Array.isArray(e)) {
131
+ let i = e.slice(0, 5).map(truncateForDisplay);
132
+ return e.length > 5 && i.push(`... (${e.length - 5} more)`), i;
133
+ }
134
+ return e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, i]) => [e, truncateForDisplay(i)])) : e;
135
+ };
136
+ const ToolOutput = (i) => {
128
137
  let a = c(30), o, s, l, u;
129
138
  if (a[0] === i ? (o = a[1], s = a[2], l = a[3], u = a[4]) : ({className: o, output: l, errorText: s, ...u} = i, a[0] = i, a[1] = o, a[2] = s, a[3] = l, a[4] = u), !(l || s)) return null;
130
139
  let p = l, m;
@@ -132,18 +141,18 @@ const ToolHeader = (i) => {
132
141
  let h = m;
133
142
  if (typeof l == "object" && !isValidElement(l)) {
134
143
  let e;
135
- a[7] === l ? e = a[8] : (e = JSON.stringify(l, null, 2), a[7] = l, a[8] = e);
144
+ a[7] === l ? e = a[8] : (e = JSON.stringify(truncateForDisplay(l), null, 2), a[7] = l, a[8] = e);
136
145
  let i;
137
146
  a[9] === e ? i = a[10] : (i = /* @__PURE__ */ jsx(CodeBlock, {
138
147
  code: e,
139
148
  language: "json"
140
149
  }), a[9] = e, a[10] = i), h = i;
141
150
  } else if (typeof l == "string") {
142
- let e;
143
- a[11] === l ? e = a[12] : (e = /* @__PURE__ */ jsx(CodeBlock, {
144
- code: l,
151
+ let e = l.length > VALUE_PREVIEW_CHARS ? l.slice(0, VALUE_PREVIEW_CHARS) + "..." : l, i;
152
+ a[11] === e ? i = a[12] : (i = /* @__PURE__ */ jsx(CodeBlock, {
153
+ code: e,
145
154
  language: "json"
146
- }), a[11] = l, a[12] = e), h = e;
155
+ }), a[11] = e, a[12] = i), h = i;
147
156
  }
148
157
  let g;
149
158
  a[13] === o ? g = a[14] : (g = cn("space-y-2 py-2", o), a[13] = o, a[14] = g);
@@ -161,11 +170,11 @@ const ToolHeader = (i) => {
161
170
  className: b,
162
171
  children: [x, h]
163
172
  }), a[21] = h, a[22] = b, a[23] = x, a[24] = S) : S = a[24];
164
- let C;
165
- return a[25] !== u || a[26] !== g || a[27] !== v || a[28] !== S ? (C = /* @__PURE__ */ jsxs("div", {
173
+ let T;
174
+ return a[25] !== u || a[26] !== g || a[27] !== v || a[28] !== S ? (T = /* @__PURE__ */ jsxs("div", {
166
175
  className: g,
167
176
  ...u,
168
177
  children: [v, S]
169
- }), a[25] = u, a[26] = g, a[27] = v, a[28] = S, a[29] = C) : C = a[29], C;
178
+ }), a[25] = u, a[26] = g, a[27] = v, a[28] = S, a[29] = T) : T = a[29], T;
170
179
  };
171
180
  export { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput };
@@ -7,25 +7,27 @@ var UiActions_default = (i) => {
7
7
  if (a[0] !== o || a[1] !== s || a[2] !== l || a[3] !== u || a[4] !== f || a[5] !== d) {
8
8
  let r;
9
9
  a[7] !== s || a[8] !== l || a[9] !== u || a[10] !== f || a[11] !== d ? (r = (r, i) => {
10
- let { enabledWhen: a } = r, o = r.options?.transition, p = u || a !== void 0 && (!l || !a.includes(l)) || o !== void 0 && !s.includes(o);
10
+ let { enabledWhen: a, showWhen: o } = r, p = r.options?.transition;
11
+ if (o !== void 0 && (!l || !o.includes(l))) return null;
12
+ let m = u || a !== void 0 && (!l || !a.includes(l)) || p !== void 0 && !s.includes(p);
11
13
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UiWidget_default, {
12
14
  config: r,
13
15
  onSubmit: (e) => {
14
16
  if (console.log("[UiActions] handleSubmit called", {
15
- transition: o,
17
+ transition: p,
16
18
  data: e,
17
- isDisabled: p,
19
+ isDisabled: m,
18
20
  currentPlace: l,
19
21
  availableTransitions: s
20
- }), !o) {
22
+ }), !p) {
21
23
  console.error(`[UiActions] Widget "${r.widget}" has no transition configured.`);
22
24
  return;
23
25
  }
24
- d(o, e);
26
+ d(p, e);
25
27
  },
26
- disabled: p,
28
+ disabled: m,
27
29
  isLoading: f
28
- }) }, `ui-widget-${i}-${o ?? r.widget}`);
30
+ }) }, `ui-widget-${i}-${p ?? r.widget}`);
29
31
  }, a[7] = s, a[8] = l, a[9] = u, a[10] = f, a[11] = d, a[12] = r) : r = a[12], p = o.map(r), a[0] = o, a[1] = s, a[2] = l, a[3] = u, a[4] = f, a[5] = d, a[6] = p;
30
32
  } else p = a[6];
31
33
  let m;
@@ -5,13 +5,13 @@ import OAuthPromptRenderer_default from "../oauth/OAuthPromptRenderer.js";
5
5
  import "../oauth/index.js";
6
6
  import AiMessage_default from "./renderers/AiMessage.js";
7
7
  import ChoicesRenderer_default from "./renderers/ChoicesRenderer.js";
8
- import ClaudeMessage_default from "./renderers/ClaudeMessage.js";
9
8
  import ConfirmPromptRenderer_default from "./renderers/ConfirmPromptRenderer.js";
10
9
  import DocumentDebugRenderer_default from "./renderers/DocumentDebugRenderer.js";
11
10
  import DocumentFormRenderer_default from "./renderers/DocumentFormRenderer.js";
12
11
  import DocumentMessageRenderer_default from "./renderers/DocumentMessageRenderer.js";
13
12
  import ErrorMessageRenderer_default from "./renderers/ErrorMessageRenderer.js";
14
13
  import LinkMessageRenderer_default from "./renderers/LinkMessageRenderer.js";
14
+ import LlmMessage_default from "./renderers/LlmMessage.js";
15
15
  import MarkdownMessageRenderer_default from "./renderers/MarkdownMessageRenderer.js";
16
16
  import PlainMessageRenderer_default from "./renderers/PlainMessageRenderer.js";
17
17
  import TextPromptRenderer_default from "./renderers/TextPromptRenderer.js";
@@ -23,7 +23,7 @@ var coreRendererRegistry = new Map([
23
23
  document: e,
24
24
  isLastItem: _
25
25
  })],
26
- ["claude-message", ({ document: e, isLastItem: _ }) => /* @__PURE__ */ jsx(ClaudeMessage_default, {
26
+ ["llm-message", ({ document: e, isLastItem: _ }) => /* @__PURE__ */ jsx(LlmMessage_default, {
27
27
  document: e,
28
28
  isLastItem: _
29
29
  })],
@@ -1,55 +1,56 @@
1
+ import MarkdownContent_default from "../../../components/dynamic-form/MarkdownContent.js";
1
2
  import { c } from "react/compiler-runtime";
2
3
  import React from "react";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
- var getDataUrl = (e, n) => e instanceof URL ? e.toString() : typeof e == "string" ? `data:${n || "application/octet-stream"};base64,${e}` : "#", TextPartRenderer = (n) => {
5
- let r = c(2), { part: i } = n, a;
6
- return r[0] === i.text ? a = r[1] : (a = /* @__PURE__ */ jsx("div", {
5
+ var getDataUrl = (e, r) => e instanceof URL ? e.toString() : typeof e == "string" ? `data:${r || "application/octet-stream"};base64,${e}` : "#", TextPartRenderer = (e) => {
6
+ let i = c(2), { part: a } = e, o;
7
+ return i[0] === a.text ? o = i[1] : (o = /* @__PURE__ */ jsx("div", {
7
8
  className: "text-sm leading-relaxed whitespace-pre-wrap",
8
- children: i.text
9
- }), r[0] = i.text, r[1] = a), a;
10
- }, ImagePartRenderer = (n) => {
11
- let a = c(11), { part: o } = n, s;
12
- a[0] !== o.image || a[1] !== o.mediaType ? (s = getDataUrl(o.image, o.mediaType), a[0] = o.image, a[1] = o.mediaType, a[2] = s) : s = a[2];
13
- let l;
14
- a[3] === Symbol.for("react.memo_cache_sentinel") ? (l = { maxHeight: "400px" }, a[3] = l) : l = a[3];
9
+ children: a.text
10
+ }), i[0] = a.text, i[1] = o), o;
11
+ }, ImagePartRenderer = (e) => {
12
+ let i = c(11), { part: s } = e, l;
13
+ i[0] !== s.image || i[1] !== s.mediaType ? (l = getDataUrl(s.image, s.mediaType), i[0] = s.image, i[1] = s.mediaType, i[2] = l) : l = i[2];
15
14
  let u;
16
- a[4] === s ? u = a[5] : (u = /* @__PURE__ */ jsx("img", {
17
- src: s,
15
+ i[3] === Symbol.for("react.memo_cache_sentinel") ? (u = { maxHeight: "400px" }, i[3] = u) : u = i[3];
16
+ let d;
17
+ i[4] === l ? d = i[5] : (d = /* @__PURE__ */ jsx("img", {
18
+ src: l,
18
19
  alt: "Uploaded image",
19
20
  className: "h-auto max-w-full rounded-lg border shadow-sm",
20
- style: l
21
- }), a[4] = s, a[5] = u);
22
- let d;
23
- a[6] === o.mediaType ? d = a[7] : (d = o.mediaType && /* @__PURE__ */ jsxs("div", {
24
- className: "mt-1 text-xs text-gray-500",
25
- children: ["Type: ", o.mediaType]
26
- }), a[6] = o.mediaType, a[7] = d);
21
+ style: u
22
+ }), i[4] = l, i[5] = d);
27
23
  let f;
28
- return a[8] !== u || a[9] !== d ? (f = /* @__PURE__ */ jsxs("div", { children: [u, d] }), a[8] = u, a[9] = d, a[10] = f) : f = a[10], f;
29
- }, FilePartRenderer = (n) => {
30
- let i = c(8), { part: a } = n, o;
31
- i[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ jsx("div", {
24
+ i[6] === s.mediaType ? f = i[7] : (f = s.mediaType && /* @__PURE__ */ jsxs("div", {
25
+ className: "mt-1 text-xs text-gray-500",
26
+ children: ["Type: ", s.mediaType]
27
+ }), i[6] = s.mediaType, i[7] = f);
28
+ let p;
29
+ return i[8] !== d || i[9] !== f ? (p = /* @__PURE__ */ jsxs("div", { children: [d, f] }), i[8] = d, i[9] = f, i[10] = p) : p = i[10], p;
30
+ }, FilePartRenderer = (e) => {
31
+ let i = c(8), { part: o } = e, s;
32
+ i[0] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ jsx("div", {
32
33
  className: "text-2xl",
33
34
  children: "📎"
34
- }), i[0] = o) : o = i[0];
35
- let s = a.filename || "Unnamed file", l;
36
- i[1] === s ? l = i[2] : (l = /* @__PURE__ */ jsx("div", {
35
+ }), i[0] = s) : s = i[0];
36
+ let l = o.filename || "Unnamed file", u;
37
+ i[1] === l ? u = i[2] : (u = /* @__PURE__ */ jsx("div", {
37
38
  className: "text-sm font-medium",
38
- children: s
39
- }), i[1] = s, i[2] = l);
40
- let u;
41
- i[3] === a.mediaType ? u = i[4] : (u = /* @__PURE__ */ jsx("div", {
42
- className: "text-xs text-gray-500",
43
- children: a.mediaType
44
- }), i[3] = a.mediaType, i[4] = u);
39
+ children: l
40
+ }), i[1] = l, i[2] = u);
45
41
  let d;
46
- return i[5] !== l || i[6] !== u ? (d = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", {
42
+ i[3] === o.mediaType ? d = i[4] : (d = /* @__PURE__ */ jsx("div", {
43
+ className: "text-xs text-gray-500",
44
+ children: o.mediaType
45
+ }), i[3] = o.mediaType, i[4] = d);
46
+ let f;
47
+ return i[5] !== u || i[6] !== d ? (f = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", {
47
48
  className: "flex items-center space-x-2",
48
- children: [o, /* @__PURE__ */ jsxs("div", { children: [l, u] })]
49
- }) }), i[5] = l, i[6] = u, i[7] = d) : d = i[7], d;
50
- }, ReasoningPartRenderer = (n) => {
51
- let i = c(2), { part: a } = n, o;
52
- return i[0] === a.text ? o = i[1] : (o = a.text ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
49
+ children: [s, /* @__PURE__ */ jsxs("div", { children: [u, d] })]
50
+ }) }), i[5] = u, i[6] = d, i[7] = f) : f = i[7], f;
51
+ }, ReasoningPartRenderer = (e) => {
52
+ let i = c(2), { part: o } = e, s;
53
+ return i[0] === o.text ? s = i[1] : (s = o.text ? /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
53
54
  className: "mb-2 flex items-center space-x-2",
54
55
  children: /* @__PURE__ */ jsx("div", {
55
56
  className: "text-sm font-medium text-purple-600",
@@ -57,118 +58,115 @@ var getDataUrl = (e, n) => e instanceof URL ? e.toString() : typeof e == "string
57
58
  })
58
59
  }), /* @__PURE__ */ jsx("div", {
59
60
  className: "text-sm whitespace-pre-wrap text-purple-800",
60
- children: a.text
61
- })] }) : "", i[0] = a.text, i[1] = o), o;
62
- }, ToolCallPartRenderer = (n) => {
63
- let i = c(17), { part: a } = n, o;
64
- i[0] === a.toolName ? o = i[1] : (o = /* @__PURE__ */ jsx("div", {
61
+ children: o.text
62
+ })] }) : "", i[0] = o.text, i[1] = s), s;
63
+ }, ToolCallPartRenderer = (e) => {
64
+ let i = c(17), { part: o } = e, s;
65
+ i[0] === o.toolName ? s = i[1] : (s = /* @__PURE__ */ jsx("div", {
65
66
  className: "text-sm font-medium",
66
- children: a.toolName
67
- }), i[0] = a.toolName, i[1] = o);
68
- let s;
69
- i[2] === a.providerExecuted ? s = i[3] : (s = a.providerExecuted && /* @__PURE__ */ jsx("span", {
67
+ children: o.toolName
68
+ }), i[0] = o.toolName, i[1] = s);
69
+ let l;
70
+ i[2] === o.providerExecuted ? l = i[3] : (l = o.providerExecuted && /* @__PURE__ */ jsx("span", {
70
71
  className: "rounded bg-green-100 px-2 py-1 text-xs text-green-800",
71
72
  children: "Executed"
72
- }), i[2] = a.providerExecuted, i[3] = s);
73
- let l;
74
- i[4] !== o || i[5] !== s ? (l = /* @__PURE__ */ jsxs("div", {
75
- className: "flex items-center space-x-2",
76
- children: [o, s]
77
- }), i[4] = o, i[5] = s, i[6] = l) : l = i[6];
73
+ }), i[2] = o.providerExecuted, i[3] = l);
78
74
  let u;
79
- i[7] === a.toolCallId ? u = i[8] : (u = /* @__PURE__ */ jsxs("div", {
80
- className: "ml-5 font-mono text-xs text-gray-500",
81
- children: ["ID: ", a.toolCallId]
82
- }), i[7] = a.toolCallId, i[8] = u);
75
+ i[4] !== s || i[5] !== l ? (u = /* @__PURE__ */ jsxs("div", {
76
+ className: "flex items-center space-x-2",
77
+ children: [s, l]
78
+ }), i[4] = s, i[5] = l, i[6] = u) : u = i[6];
83
79
  let d;
84
- i[9] !== l || i[10] !== u ? (d = /* @__PURE__ */ jsxs("div", {
85
- className: "mb-2 flex items-center justify-between",
86
- children: [l, u]
87
- }), i[9] = l, i[10] = u, i[11] = d) : d = i[11];
80
+ i[7] === o.toolCallId ? d = i[8] : (d = /* @__PURE__ */ jsxs("div", {
81
+ className: "ml-5 font-mono text-xs text-gray-500",
82
+ children: ["ID: ", o.toolCallId]
83
+ }), i[7] = o.toolCallId, i[8] = d);
88
84
  let f;
89
- i[12] === a.input ? f = i[13] : (f = a.input ? /* @__PURE__ */ jsxs("div", {
85
+ i[9] !== u || i[10] !== d ? (f = /* @__PURE__ */ jsxs("div", {
86
+ className: "mb-2 flex items-center justify-between",
87
+ children: [u, d]
88
+ }), i[9] = u, i[10] = d, i[11] = f) : f = i[11];
89
+ let p;
90
+ i[12] === o.input ? p = i[13] : (p = o.input ? /* @__PURE__ */ jsxs("div", {
90
91
  className: "rounded border bg-white p-2 text-xs",
91
92
  children: [/* @__PURE__ */ jsx("div", {
92
93
  className: "mb-1 text-gray-600",
93
94
  children: "Input:"
94
95
  }), /* @__PURE__ */ jsx("pre", {
95
96
  className: "overflow-x-auto whitespace-pre-wrap",
96
- children: JSON.stringify(a.input, null, 2)
97
+ children: JSON.stringify(o.input, null, 2)
97
98
  })]
98
- }) : "", i[12] = a.input, i[13] = f);
99
- let p;
100
- return i[14] !== d || i[15] !== f ? (p = /* @__PURE__ */ jsxs("div", { children: [d, f] }), i[14] = d, i[15] = f, i[16] = p) : p = i[16], p;
101
- }, ToolResultPartRenderer = (n) => {
102
- let i = c(14), { part: a } = n, o;
103
- i[0] === a.toolName ? o = i[1] : (o = /* @__PURE__ */ jsxs("div", {
99
+ }) : "", i[12] = o.input, i[13] = p);
100
+ let m;
101
+ return i[14] !== f || i[15] !== p ? (m = /* @__PURE__ */ jsxs("div", { children: [f, p] }), i[14] = f, i[15] = p, i[16] = m) : m = i[16], m;
102
+ }, ToolResultPartRenderer = (e) => {
103
+ let i = c(14), { part: o } = e, s;
104
+ i[0] === o.toolName ? s = i[1] : (s = /* @__PURE__ */ jsxs("div", {
104
105
  className: "text-sm font-medium",
105
- children: [a.toolName, " Result"]
106
- }), i[0] = a.toolName, i[1] = o);
107
- let s;
108
- i[2] === a.toolCallId ? s = i[3] : (s = /* @__PURE__ */ jsxs("div", {
109
- className: "ml-5 font-mono text-xs text-gray-500",
110
- children: ["ID: ", a.toolCallId]
111
- }), i[2] = a.toolCallId, i[3] = s);
106
+ children: [o.toolName, " Result"]
107
+ }), i[0] = o.toolName, i[1] = s);
112
108
  let l;
113
- i[4] !== o || i[5] !== s ? (l = /* @__PURE__ */ jsxs("div", {
114
- className: "mb-2 flex items-center justify-between",
115
- children: [o, s]
116
- }), i[4] = o, i[5] = s, i[6] = l) : l = i[6];
109
+ i[2] === o.toolCallId ? l = i[3] : (l = /* @__PURE__ */ jsxs("div", {
110
+ className: "ml-5 font-mono text-xs text-gray-500",
111
+ children: ["ID: ", o.toolCallId]
112
+ }), i[2] = o.toolCallId, i[3] = l);
117
113
  let u;
118
- i[7] === a.output ? u = i[8] : (u = JSON.stringify(a.output, null, 2), i[7] = a.output, i[8] = u);
114
+ i[4] !== s || i[5] !== l ? (u = /* @__PURE__ */ jsxs("div", {
115
+ className: "mb-2 flex items-center justify-between",
116
+ children: [s, l]
117
+ }), i[4] = s, i[5] = l, i[6] = u) : u = i[6];
119
118
  let d;
120
- i[9] === u ? d = i[10] : (d = /* @__PURE__ */ jsx("div", {
119
+ i[7] === o.output ? d = i[8] : (d = JSON.stringify(o.output, null, 2), i[7] = o.output, i[8] = d);
120
+ let f;
121
+ i[9] === d ? f = i[10] : (f = /* @__PURE__ */ jsx("div", {
121
122
  className: "rounded border bg-white p-2 text-xs",
122
123
  children: /* @__PURE__ */ jsx("pre", {
123
124
  className: "overflow-x-auto whitespace-pre-wrap",
124
- children: u
125
+ children: d
125
126
  })
126
- }), i[9] = u, i[10] = d);
127
- let f;
128
- return i[11] !== l || i[12] !== d ? (f = /* @__PURE__ */ jsxs("div", { children: [l, d] }), i[11] = l, i[12] = d, i[13] = f) : f = i[13], f;
129
- }, AiMessageContent_default = (n) => {
130
- let i = c(4), { message: o } = n, s = _temp, l;
131
- i[0] === o ? l = i[1] : (l = () => {
132
- if (o.role === "system") return /* @__PURE__ */ jsxs("div", {
127
+ }), i[9] = d, i[10] = f);
128
+ let p;
129
+ return i[11] !== u || i[12] !== f ? (p = /* @__PURE__ */ jsxs("div", { children: [u, f] }), i[11] = u, i[12] = f, i[13] = p) : p = i[13], p;
130
+ }, AiMessageContent_default = (i) => {
131
+ let o = c(4), { message: s } = i, l = _temp, u;
132
+ o[0] === s ? u = o[1] : (u = () => {
133
+ if (s.role === "system") return /* @__PURE__ */ jsxs("div", {
133
134
  className: "rounded-lg border-l-4 border-gray-400 bg-gray-50 p-3 text-sm text-gray-600 italic",
134
135
  children: [/* @__PURE__ */ jsx("div", {
135
136
  className: "mb-1 font-medium",
136
137
  children: "System"
137
138
  }), /* @__PURE__ */ jsx("div", {
138
139
  className: "whitespace-pre-wrap",
139
- children: o.content
140
+ children: s.content
140
141
  })]
141
142
  });
142
- let { content: e } = o;
143
- return typeof e == "string" ? /* @__PURE__ */ jsx(TextPartRenderer, { part: {
144
- type: "text",
145
- text: e
146
- } }) : Array.isArray(e) ? /* @__PURE__ */ jsx("div", {
143
+ let { content: r } = s;
144
+ return typeof r == "string" ? /* @__PURE__ */ jsx(MarkdownContent_default, { content: r }) : Array.isArray(r) ? /* @__PURE__ */ jsx("div", {
147
145
  className: "space-y-2",
148
- children: e.map((e, n) => s(e, n))
146
+ children: r.map((e, r) => l(e, r))
149
147
  }) : /* @__PURE__ */ jsx("div", {
150
148
  className: "text-sm text-red-600",
151
149
  children: "Invalid content format"
152
150
  });
153
- }, i[0] = o, i[1] = l);
154
- let u = l, d;
155
- return i[2] === u ? d = i[3] : (d = /* @__PURE__ */ jsx("div", {
151
+ }, o[0] = s, o[1] = u);
152
+ let d = u, f;
153
+ return o[2] === d ? f = o[3] : (f = /* @__PURE__ */ jsx("div", {
156
154
  className: "message-content",
157
- children: u()
158
- }), i[2] = u, i[3] = d), d;
155
+ children: d()
156
+ }), o[2] = d, o[3] = f), f;
159
157
  };
160
- function _temp(e, n) {
158
+ function _temp(e, r) {
161
159
  switch (e.type) {
162
- case "text": return /* @__PURE__ */ jsx(TextPartRenderer, { part: e }, n);
163
- case "image": return /* @__PURE__ */ jsx(ImagePartRenderer, { part: e }, n);
164
- case "file": return /* @__PURE__ */ jsx(FilePartRenderer, { part: e }, n);
165
- case "reasoning": return /* @__PURE__ */ jsx(ReasoningPartRenderer, { part: e }, n);
166
- case "tool-call": return /* @__PURE__ */ jsx(ToolCallPartRenderer, { part: e }, n);
167
- case "tool-result": return /* @__PURE__ */ jsx(ToolResultPartRenderer, { part: e }, n);
160
+ case "text": return /* @__PURE__ */ jsx(TextPartRenderer, { part: e }, r);
161
+ case "image": return /* @__PURE__ */ jsx(ImagePartRenderer, { part: e }, r);
162
+ case "file": return /* @__PURE__ */ jsx(FilePartRenderer, { part: e }, r);
163
+ case "reasoning": return /* @__PURE__ */ jsx(ReasoningPartRenderer, { part: e }, r);
164
+ case "tool-call": return /* @__PURE__ */ jsx(ToolCallPartRenderer, { part: e }, r);
165
+ case "tool-result": return /* @__PURE__ */ jsx(ToolResultPartRenderer, { part: e }, r);
168
166
  default: return /* @__PURE__ */ jsxs("div", {
169
167
  className: "rounded bg-gray-100 p-2 text-sm",
170
168
  children: ["Unknown content type: ", e.type]
171
- }, n);
169
+ }, r);
172
170
  }
173
171
  }
174
172
  export { AiMessageContent_default as default };
@@ -0,0 +1,89 @@
1
+ import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
2
+ import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
3
+ import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/loopstack-elements/tool.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { Fragment } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { CopyIcon } from "lucide-react";
8
+ var LlmMessage_default = (y) => {
9
+ let b = c(15), { document: x } = y, S = x.content, C = S.id ?? x.id;
10
+ if (typeof S.content == "string") {
11
+ let m;
12
+ b[0] === S.content ? m = b[1] : (m = /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: S.content }) }), b[0] = S.content, b[1] = m);
13
+ let h;
14
+ b[2] !== S.content || b[3] !== S.role ? (h = S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
15
+ onClick: () => void navigator.clipboard.writeText(S.content),
16
+ label: "Copy",
17
+ children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
18
+ }) }), b[2] = S.content, b[3] = S.role, b[4] = h) : h = b[4];
19
+ let g;
20
+ return b[5] !== S.role || b[6] !== m || b[7] !== h ? (g = /* @__PURE__ */ jsxs(Message, {
21
+ from: S.role,
22
+ children: [m, h]
23
+ }), b[5] = S.role, b[6] = m, b[7] = h, b[8] = g) : g = b[8], g;
24
+ }
25
+ let w = S.content, T;
26
+ b[9] !== w || b[10] !== S.role || b[11] !== C ? (T = w.map((_, v) => {
27
+ switch (_.type) {
28
+ case "text": return /* @__PURE__ */ jsxs(Message, {
29
+ from: S.role,
30
+ children: [/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: _.text }) }), S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
31
+ onClick: () => void navigator.clipboard.writeText(_.text),
32
+ label: "Copy",
33
+ children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
34
+ }) })]
35
+ }, `${C}-${v}`);
36
+ case "thinking": return /* @__PURE__ */ jsxs(Reasoning, {
37
+ className: "w-full",
38
+ isStreaming: !1,
39
+ children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children: _.text })]
40
+ }, `${C}-${v}`);
41
+ case "tool_call": return /* @__PURE__ */ jsx(Message, {
42
+ from: "assistant",
43
+ children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
44
+ state: "input-available",
45
+ title: _.name,
46
+ type: "tool-call"
47
+ }), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolInput, { input: _.args }) })] })
48
+ }, `${C}-${v}`);
49
+ case "tool_result": {
50
+ let p;
51
+ try {
52
+ p = JSON.parse(_.content);
53
+ } catch {
54
+ p = _.content;
55
+ }
56
+ return /* @__PURE__ */ jsx(Message, {
57
+ from: "assistant",
58
+ children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
59
+ state: _.isError ? "output-error" : "output-available",
60
+ title: "Tool Result",
61
+ type: "tool-call"
62
+ }), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolOutput, {
63
+ output: p,
64
+ errorText: _.isError ? _.content : ""
65
+ }) })] })
66
+ }, `${C}-${v}`);
67
+ }
68
+ case "server_tool_use": {
69
+ let p = w.find((e) => e.type === "server_tool_result" && e.toolUseId === _.id);
70
+ return /* @__PURE__ */ jsx(Message, {
71
+ from: "assistant",
72
+ children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
73
+ state: p ? "output-available" : "input-available",
74
+ title: _.name,
75
+ type: "tool-call"
76
+ }), /* @__PURE__ */ jsxs(ToolContent, { children: [/* @__PURE__ */ jsx(ToolInput, { input: _.input }), p && /* @__PURE__ */ jsx(ToolOutput, {
77
+ output: p.content,
78
+ errorText: ""
79
+ })] })] })
80
+ }, `${C}-${v}`);
81
+ }
82
+ case "server_tool_result": return null;
83
+ default: return null;
84
+ }
85
+ }), b[9] = w, b[10] = S.role, b[11] = C, b[12] = T) : T = b[12];
86
+ let E;
87
+ return b[13] === T ? E = b[14] : (E = /* @__PURE__ */ jsx(Fragment, { children: T }), b[13] = T, b[14] = E), E;
88
+ };
89
+ export { LlmMessage_default as default };
@@ -1,7 +1,9 @@
1
1
  import { cn } from "../../lib/utils.js";
2
+ import { Button } from "../../components/ui/button.js";
2
3
  import LoadingCentered_default from "../../components/feedback/LoadingCentered.js";
3
4
  import ErrorSnackbar_default from "../../components/feedback/ErrorSnackbar.js";
4
- import ErrorAlert_default from "../../components/feedback/ErrorAlert.js";
5
+ import { require_enums } from "../../packages/contracts/dist/enums/index.js";
6
+ import { useRunWorkflow } from "../../hooks/useProcessor.js";
5
7
  import DocumentList_default from "../documents/components/DocumentList.js";
6
8
  import "../documents/index.js";
7
9
  import WorkflowForms_default from "./components/WorkflowForms.js";
@@ -10,64 +12,94 @@ import { c } from "react/compiler-runtime";
10
12
  import React, { useEffect } from "react";
11
13
  import { jsx, jsxs } from "react/jsx-runtime";
12
14
  import { useParams } from "react-router-dom";
13
- var WorkflowItem_default = (p) => {
14
- let m = c(46), { workflow: h, workflowId: g, scrollTo: _, settings: v, embed: y } = p, { workflowId: b, clickId: x } = useParams(), S;
15
- m[0] !== v.showFullMessageHistory || m[1] !== g ? (S = {
16
- workflowId: g,
17
- showFullMessageHistory: v.showFullMessageHistory
18
- }, m[0] = v.showFullMessageHistory, m[1] = g, m[2] = S) : S = m[2];
19
- let { workflow: C, workflowLoading: w, workflowReady: T, workflowError: E, documents: D, documentsLoading: O, documentsReady: k, documentsError: A, isLoading: j, handleRun: M } = useWorkflowData(S), N;
20
- m[3] !== k || m[4] !== b || m[5] !== _ || m[6] !== g || m[7] !== T ? (N = () => {
21
- b === g && T && k && _(g);
22
- }, m[3] = k, m[4] = b, m[5] = _, m[6] = g, m[7] = T, m[8] = N) : N = m[8];
23
- let P;
24
- m[9] !== x || m[10] !== k || m[11] !== b || m[12] !== _ || m[13] !== g || m[14] !== T ? (P = [
25
- T,
26
- k,
27
- g,
28
- b,
29
- x,
30
- _
31
- ], m[9] = x, m[10] = k, m[11] = b, m[12] = _, m[13] = g, m[14] = T, m[15] = P) : P = m[15], useEffect(N, P);
32
- let F = y ? "p-0" : "p-4", I;
33
- m[16] === F ? I = m[17] : (I = cn("flex flex-col", F), m[16] = F, m[17] = I);
34
- let L = w || O, R;
35
- m[18] === L ? R = m[19] : (R = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: L }), m[18] = L, m[19] = R);
36
- let z;
37
- m[20] === A ? z = m[21] : (z = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: A }), m[20] = A, m[21] = z);
38
- let B;
39
- m[22] === E ? B = m[23] : (B = /* @__PURE__ */ jsx(ErrorAlert_default, { error: E }), m[22] = E, m[23] = B);
40
- let V;
41
- m[24] !== C || m[25] !== D || m[26] !== j || m[27] !== _ || m[28] !== v || m[29] !== h || m[30] !== T ? (V = T && C && /* @__PURE__ */ jsx(DocumentList_default, {
42
- workflow: h,
43
- childWorkflow: C,
44
- documents: D,
45
- scrollTo: _,
46
- settings: v,
47
- isLoading: j
48
- }), m[24] = C, m[25] = D, m[26] = j, m[27] = _, m[28] = v, m[29] = h, m[30] = T, m[31] = V) : V = m[31];
49
- let H;
50
- m[32] === j ? H = m[33] : (H = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: j }), m[32] = j, m[33] = H);
51
- let U;
52
- m[34] !== C || m[35] !== M || m[36] !== h ? (U = !!C && /* @__PURE__ */ jsx("div", {
15
+ import { AlertCircle, RefreshCw } from "lucide-react";
16
+ var import_enums = require_enums(), WorkflowItem_default = (h) => {
17
+ let g = c(55), { workflow: _, workflowId: v, scrollTo: y, settings: b, embed: x } = h, { workflowId: S, clickId: C } = useParams(), w = useRunWorkflow(), T;
18
+ g[0] !== b.showFullMessageHistory || g[1] !== v ? (T = {
19
+ workflowId: v,
20
+ showFullMessageHistory: b.showFullMessageHistory
21
+ }, g[0] = b.showFullMessageHistory, g[1] = v, g[2] = T) : T = g[2];
22
+ let { workflow: E, workflowLoading: D, workflowReady: O, workflowError: k, documents: A, documentsLoading: j, documentsReady: M, documentsError: N, isLoading: P, handleRun: F } = useWorkflowData(T), I;
23
+ g[3] !== M || g[4] !== S || g[5] !== y || g[6] !== v || g[7] !== O ? (I = () => {
24
+ S === v && O && M && y(v);
25
+ }, g[3] = M, g[4] = S, g[5] = y, g[6] = v, g[7] = O, g[8] = I) : I = g[8];
26
+ let L;
27
+ g[9] !== C || g[10] !== M || g[11] !== S || g[12] !== y || g[13] !== v || g[14] !== O ? (L = [
28
+ O,
29
+ M,
30
+ v,
31
+ S,
32
+ C,
33
+ y
34
+ ], g[9] = C, g[10] = M, g[11] = S, g[12] = y, g[13] = v, g[14] = O, g[15] = L) : L = g[15], useEffect(I, L);
35
+ let R;
36
+ g[16] === E?.availableTransitions ? R = g[17] : (R = E?.availableTransitions?.some(_temp), g[16] = E?.availableTransitions, g[17] = R);
37
+ let z = R, B = E?.hasError && E.status === import_enums.WorkflowState.Waiting, V = E?.hasError && !B && z !== !1, H;
38
+ g[18] !== w || g[19] !== v ? (H = () => {
39
+ w.mutate({
40
+ workflowId: v,
41
+ runWorkflowPayloadDto: {},
42
+ force: !0
43
+ });
44
+ }, g[18] = w, g[19] = v, g[20] = H) : H = g[20];
45
+ let U = H, W = x ? "p-0" : "p-4", G;
46
+ g[21] === W ? G = g[22] : (G = cn("flex flex-col", W), g[21] = W, g[22] = G);
47
+ let K = D || j, q;
48
+ g[23] === K ? q = g[24] : (q = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: K }), g[23] = K, g[24] = q);
49
+ let J;
50
+ g[25] === N ? J = g[26] : (J = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: N }), g[25] = N, g[26] = J);
51
+ let Y;
52
+ g[27] !== E || g[28] !== A || g[29] !== P || g[30] !== y || g[31] !== b || g[32] !== _ || g[33] !== O ? (Y = O && E && /* @__PURE__ */ jsx(DocumentList_default, {
53
+ workflow: _,
54
+ childWorkflow: E,
55
+ documents: A,
56
+ scrollTo: y,
57
+ settings: b,
58
+ isLoading: P
59
+ }), g[27] = E, g[28] = A, g[29] = P, g[30] = y, g[31] = b, g[32] = _, g[33] = O, g[34] = Y) : Y = g[34];
60
+ let X;
61
+ g[35] === P ? X = g[36] : (X = /* @__PURE__ */ jsx(LoadingCentered_default, { loading: P }), g[35] = P, g[36] = X);
62
+ let Z;
63
+ g[37] !== V || g[38] !== E?.hasError || g[39] !== U || g[40] !== w.isPending || g[41] !== k ? (Z = k && E?.hasError && /* @__PURE__ */ jsxs("div", {
64
+ className: "mt-3 flex items-center gap-2 px-1",
65
+ children: [
66
+ /* @__PURE__ */ jsx(AlertCircle, { className: "text-destructive h-4 w-4 shrink-0" }),
67
+ /* @__PURE__ */ jsx("span", {
68
+ className: "text-destructive flex-1 text-sm",
69
+ children: k
70
+ }),
71
+ V && /* @__PURE__ */ jsxs(Button, {
72
+ variant: "outline",
73
+ size: "sm",
74
+ disabled: w.isPending,
75
+ onClick: U,
76
+ children: [w.isPending ? /* @__PURE__ */ jsx("div", { className: "mr-1 h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(RefreshCw, { className: "mr-1 h-3.5 w-3.5" }), "Retry"]
77
+ })
78
+ ]
79
+ }), g[37] = V, g[38] = E?.hasError, g[39] = U, g[40] = w.isPending, g[41] = k, g[42] = Z) : Z = g[42];
80
+ let Q;
81
+ g[43] !== E || g[44] !== F || g[45] !== _ ? (Q = !!E && /* @__PURE__ */ jsx("div", {
53
82
  className: "mt-6",
54
83
  children: /* @__PURE__ */ jsx(WorkflowForms_default, {
55
- workflow: C,
56
- parentWorkflow: h,
57
- onSubmit: M
84
+ workflow: E,
85
+ parentWorkflow: _,
86
+ onSubmit: F
58
87
  })
59
- }), m[34] = C, m[35] = M, m[36] = h, m[37] = U) : U = m[37];
60
- let W;
61
- return m[38] !== V || m[39] !== H || m[40] !== U || m[41] !== I || m[42] !== R || m[43] !== z || m[44] !== B ? (W = /* @__PURE__ */ jsxs("div", {
62
- className: I,
88
+ }), g[43] = E, g[44] = F, g[45] = _, g[46] = Q) : Q = g[46];
89
+ let $;
90
+ return g[47] !== J || g[48] !== Y || g[49] !== X || g[50] !== Z || g[51] !== Q || g[52] !== G || g[53] !== q ? ($ = /* @__PURE__ */ jsxs("div", {
91
+ className: G,
63
92
  children: [
64
- R,
65
- z,
66
- B,
67
- V,
68
- H,
69
- U
93
+ q,
94
+ J,
95
+ Y,
96
+ X,
97
+ Z,
98
+ Q
70
99
  ]
71
- }), m[38] = V, m[39] = H, m[40] = U, m[41] = I, m[42] = R, m[43] = z, m[44] = B, m[45] = W) : W = m[45], W;
100
+ }), g[47] = J, g[48] = Y, g[49] = X, g[50] = Z, g[51] = Q, g[52] = G, g[53] = q, g[54] = $) : $ = g[54], $;
72
101
  };
102
+ function _temp(t) {
103
+ return t.trigger !== "manual";
104
+ }
73
105
  export { WorkflowItem_default as default };
@@ -124,7 +124,7 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
124
124
  "annotation-xml",
125
125
  "mprescripts",
126
126
  "none"
127
- ]), text = freeze(["#text"]), html = freeze(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot".split(".")), svg = freeze(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), mathMl = freeze(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnsalign.columnlines.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lspace.lquote.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), xml = freeze([
127
+ ]), text = freeze(["#text"]), html = freeze(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns.slot".split(".")), svg = freeze(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), mathMl = freeze(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), xml = freeze([
128
128
  "xlink:href",
129
129
  "xml:id",
130
130
  "xlink:title",
@@ -144,17 +144,10 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
144
144
  TMPLIT_EXPR
145
145
  }), NODE_TYPE = {
146
146
  element: 1,
147
- attribute: 2,
148
147
  text: 3,
149
- cdataSection: 4,
150
- entityReference: 5,
151
- entityNode: 6,
152
148
  progressingInstruction: 7,
153
149
  comment: 8,
154
- document: 9,
155
- documentType: 10,
156
- documentFragment: 11,
157
- notation: 12
150
+ document: 9
158
151
  }, getGlobal = function() {
159
152
  return typeof window > "u" ? null : window;
160
153
  }, _createTrustedTypesPolicy = function(e, t) {
@@ -189,7 +182,7 @@ var html$1 = freeze(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.a
189
182
  };
190
183
  function createDOMPurify() {
191
184
  let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal(), n = (e) => createDOMPurify(e);
192
- if (n.version = "3.3.3", n.removed = [], !t || !t.document || t.document.nodeType !== NODE_TYPE.document || !t.Element) return n.isSupported = !1, n;
185
+ if (n.version = "3.4.0", n.removed = [], !t || !t.document || t.document.nodeType !== NODE_TYPE.document || !t.Element) return n.isSupported = !1, n;
193
186
  let { document: r } = t, i = r, o = i.currentScript, { DocumentFragment: c, HTMLTemplateElement: l, Node: d, Element: Fe, NodeFilter: f, NamedNodeMap: Ie = t.NamedNodeMap || t.MozNamedAttrMap, HTMLFormElement: Le, DOMParser: Re, trustedTypes: p } = t, m = Fe.prototype, ze = lookupGetter(m, "cloneNode"), Be = lookupGetter(m, "remove"), Ve = lookupGetter(m, "nextSibling"), He = lookupGetter(m, "childNodes"), h = lookupGetter(m, "parentNode");
194
187
  if (typeof l == "function") {
195
188
  let e = r.createElement("template");
@@ -240,7 +233,7 @@ function createDOMPurify() {
240
233
  enumerable: !0,
241
234
  value: null
242
235
  }
243
- })), tt = !0, k = !0, nt = !1, rt = !0, A = !1, j = !0, M = !1, N = !1, it = !1, P = !1, F = !1, I = !1, at = !0, ot = !1, L = !0, R = !1, z = {}, B = null, V = addToSet({}, [
236
+ })), tt = !0, k = !0, nt = !1, rt = !0, A = !1, j = !0, M = !1, N = !1, P = !1, F = !1, I = !1, L = !1, it = !0, at = !1, ot = !0, R = !1, z = {}, B = null, st = addToSet({}, [
244
237
  "annotation-xml",
245
238
  "audio",
246
239
  "colgroup",
@@ -266,14 +259,14 @@ function createDOMPurify() {
266
259
  "title",
267
260
  "video",
268
261
  "xmp"
269
- ]), st = null, ct = addToSet({}, [
262
+ ]), ct = null, lt = addToSet({}, [
270
263
  "audio",
271
264
  "video",
272
265
  "img",
273
266
  "source",
274
267
  "image",
275
268
  "track"
276
- ]), lt = null, ut = addToSet({}, [
269
+ ]), ut = null, dt = addToSet({}, [
277
270
  "alt",
278
271
  "class",
279
272
  "for",
@@ -288,28 +281,28 @@ function createDOMPurify() {
288
281
  "value",
289
282
  "style",
290
283
  "xmlns"
291
- ]), H = "http://www.w3.org/1998/Math/MathML", U = "http://www.w3.org/2000/svg", W = "http://www.w3.org/1999/xhtml", G = W, dt = !1, ft = null, pt = addToSet({}, [
284
+ ]), V = "http://www.w3.org/1998/Math/MathML", H = "http://www.w3.org/2000/svg", U = "http://www.w3.org/1999/xhtml", W = U, ft = !1, pt = null, mt = addToSet({}, [
285
+ V,
292
286
  H,
293
- U,
294
- W
295
- ], stringToString), K = addToSet({}, [
287
+ U
288
+ ], stringToString), G = addToSet({}, [
296
289
  "mi",
297
290
  "mo",
298
291
  "mn",
299
292
  "ms",
300
293
  "mtext"
301
- ]), q = addToSet({}, ["annotation-xml"]), mt = addToSet({}, [
294
+ ]), K = addToSet({}, ["annotation-xml"]), ht = addToSet({}, [
302
295
  "title",
303
296
  "style",
304
297
  "font",
305
298
  "a",
306
299
  "script"
307
- ]), J = null, ht = ["application/xhtml+xml", "text/html"], Y = null, X = null, gt = r.createElement("form"), _t = function(e) {
300
+ ]), q = null, gt = ["application/xhtml+xml", "text/html"], J = null, Y = null, _t = r.createElement("form"), vt = function(e) {
308
301
  return e instanceof RegExp || e instanceof Function;
309
- }, vt = function() {
302
+ }, yt = function() {
310
303
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
311
- if (!(X && X === e)) {
312
- if ((!e || typeof e != "object") && (e = {}), e = clone(e), J = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, Y = J === "application/xhtml+xml" ? stringToString : stringToLowerCase, C = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, Y) : $e, w = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, Y) : et, ft = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : pt, lt = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(ut), e.ADD_URI_SAFE_ATTR, Y) : ut, st = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(ct), e.ADD_DATA_URI_TAGS, Y) : ct, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, Y) : V, E = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, Y) : clone({}), D = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, Y) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, k = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, A = e.SAFE_FOR_TEMPLATES || !1, j = e.SAFE_FOR_XML !== !1, M = e.WHOLE_DOCUMENT || !1, P = e.RETURN_DOM || !1, F = e.RETURN_DOM_FRAGMENT || !1, I = e.RETURN_TRUSTED_TYPE || !1, it = e.FORCE_BODY || !1, at = e.SANITIZE_DOM !== !1, ot = e.SANITIZE_NAMED_PROPS || !1, L = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, Qe = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, G = e.NAMESPACE || W, K = e.MATHML_TEXT_INTEGRATION_POINTS || K, q = e.HTML_INTEGRATION_POINTS || q, T = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (T.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && _t(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (T.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), A && (k = !1), F && (P = !0), z && (C = addToSet({}, text), w = create(null), z.html === !0 && (addToSet(C, html$1), addToSet(w, html)), z.svg === !0 && (addToSet(C, svg$1), addToSet(w, svg), addToSet(w, xml)), z.svgFilters === !0 && (addToSet(C, svgFilters), addToSet(w, svg), addToSet(w, xml)), z.mathMl === !0 && (addToSet(C, mathMl$1), addToSet(w, mathMl), addToSet(w, xml))), objectHasOwnProperty(e, "ADD_TAGS") || (O.tagCheck = null), objectHasOwnProperty(e, "ADD_ATTR") || (O.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? O.tagCheck = e.ADD_TAGS : (C === $e && (C = clone(C)), addToSet(C, e.ADD_TAGS, Y))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? O.attributeCheck = e.ADD_ATTR : (w === et && (w = clone(w)), addToSet(w, e.ADD_ATTR, Y))), e.ADD_URI_SAFE_ATTR && addToSet(lt, e.ADD_URI_SAFE_ATTR, Y), e.FORBID_CONTENTS && (B === V && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, Y)), e.ADD_FORBID_CONTENTS && (B === V && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, Y)), L && (C["#text"] = !0), M && addToSet(C, [
304
+ if (!(Y && Y === e)) {
305
+ if ((!e || typeof e != "object") && (e = {}), e = clone(e), q = gt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, J = q === "application/xhtml+xml" ? stringToString : stringToLowerCase, C = objectHasOwnProperty(e, "ALLOWED_TAGS") ? addToSet({}, e.ALLOWED_TAGS, J) : $e, w = objectHasOwnProperty(e, "ALLOWED_ATTR") ? addToSet({}, e.ALLOWED_ATTR, J) : et, pt = objectHasOwnProperty(e, "ALLOWED_NAMESPACES") ? addToSet({}, e.ALLOWED_NAMESPACES, stringToString) : mt, ut = objectHasOwnProperty(e, "ADD_URI_SAFE_ATTR") ? addToSet(clone(dt), e.ADD_URI_SAFE_ATTR, J) : dt, ct = objectHasOwnProperty(e, "ADD_DATA_URI_TAGS") ? addToSet(clone(lt), e.ADD_DATA_URI_TAGS, J) : lt, B = objectHasOwnProperty(e, "FORBID_CONTENTS") ? addToSet({}, e.FORBID_CONTENTS, J) : st, E = objectHasOwnProperty(e, "FORBID_TAGS") ? addToSet({}, e.FORBID_TAGS, J) : clone({}), D = objectHasOwnProperty(e, "FORBID_ATTR") ? addToSet({}, e.FORBID_ATTR, J) : clone({}), z = objectHasOwnProperty(e, "USE_PROFILES") ? e.USE_PROFILES : !1, tt = e.ALLOW_ARIA_ATTR !== !1, k = e.ALLOW_DATA_ATTR !== !1, nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, A = e.SAFE_FOR_TEMPLATES || !1, j = e.SAFE_FOR_XML !== !1, M = e.WHOLE_DOCUMENT || !1, F = e.RETURN_DOM || !1, I = e.RETURN_DOM_FRAGMENT || !1, L = e.RETURN_TRUSTED_TYPE || !1, P = e.FORCE_BODY || !1, it = e.SANITIZE_DOM !== !1, at = e.SANITIZE_NAMED_PROPS || !1, ot = e.KEEP_CONTENT !== !1, R = e.IN_PLACE || !1, Qe = e.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, W = e.NAMESPACE || U, G = e.MATHML_TEXT_INTEGRATION_POINTS || G, K = e.HTML_INTEGRATION_POINTS || K, T = e.CUSTOM_ELEMENT_HANDLING || create(null), e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (T.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && vt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (T.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), A && (k = !1), I && (F = !0), z && (C = addToSet({}, text), w = create(null), z.html === !0 && (addToSet(C, html$1), addToSet(w, html)), z.svg === !0 && (addToSet(C, svg$1), addToSet(w, svg), addToSet(w, xml)), z.svgFilters === !0 && (addToSet(C, svgFilters), addToSet(w, svg), addToSet(w, xml)), z.mathMl === !0 && (addToSet(C, mathMl$1), addToSet(w, mathMl), addToSet(w, xml))), O.tagCheck = null, O.attributeCheck = null, e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? O.tagCheck = e.ADD_TAGS : (C === $e && (C = clone(C)), addToSet(C, e.ADD_TAGS, J))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? O.attributeCheck = e.ADD_ATTR : (w === et && (w = clone(w)), addToSet(w, e.ADD_ATTR, J))), e.ADD_URI_SAFE_ATTR && addToSet(ut, e.ADD_URI_SAFE_ATTR, J), e.FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.FORBID_CONTENTS, J)), e.ADD_FORBID_CONTENTS && (B === st && (B = clone(B)), addToSet(B, e.ADD_FORBID_CONTENTS, J)), ot && (C["#text"] = !0), M && addToSet(C, [
313
306
  "html",
314
307
  "head",
315
308
  "body"
@@ -318,28 +311,28 @@ function createDOMPurify() {
318
311
  if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw typeErrorCreate("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
319
312
  g = e.TRUSTED_TYPES_POLICY, _ = g.createHTML("");
320
313
  } else g === void 0 && (g = _createTrustedTypesPolicy(p, o)), g !== null && typeof _ == "string" && (_ = g.createHTML(""));
321
- freeze && freeze(e), X = e;
314
+ freeze && freeze(e), Y = e;
322
315
  }
323
- }, yt = addToSet({}, [
316
+ }, bt = addToSet({}, [
324
317
  ...svg$1,
325
318
  ...svgFilters,
326
319
  ...svgDisallowed
327
- ]), bt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), xt = function(e) {
320
+ ]), xt = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), St = function(e) {
328
321
  let t = h(e);
329
322
  (!t || !t.tagName) && (t = {
330
- namespaceURI: G,
323
+ namespaceURI: W,
331
324
  tagName: "template"
332
325
  });
333
326
  let n = stringToLowerCase(e.tagName), r = stringToLowerCase(t.tagName);
334
- return ft[e.namespaceURI] ? e.namespaceURI === U ? t.namespaceURI === W ? n === "svg" : t.namespaceURI === H ? n === "svg" && (r === "annotation-xml" || K[r]) : !!yt[n] : e.namespaceURI === H ? t.namespaceURI === W ? n === "math" : t.namespaceURI === U ? n === "math" && q[r] : !!bt[n] : e.namespaceURI === W ? t.namespaceURI === U && !q[r] || t.namespaceURI === H && !K[r] ? !1 : !bt[n] && (mt[n] || !yt[n]) : !!(J === "application/xhtml+xml" && ft[e.namespaceURI]) : !1;
335
- }, Z = function(e) {
327
+ return pt[e.namespaceURI] ? e.namespaceURI === H ? t.namespaceURI === U ? n === "svg" : t.namespaceURI === V ? n === "svg" && (r === "annotation-xml" || G[r]) : !!bt[n] : e.namespaceURI === V ? t.namespaceURI === U ? n === "math" : t.namespaceURI === H ? n === "math" && K[r] : !!xt[n] : e.namespaceURI === U ? t.namespaceURI === H && !K[r] || t.namespaceURI === V && !G[r] ? !1 : !xt[n] && (ht[n] || !bt[n]) : !!(q === "application/xhtml+xml" && pt[e.namespaceURI]) : !1;
328
+ }, X = function(e) {
336
329
  arrayPush(n.removed, { element: e });
337
330
  try {
338
331
  h(e).removeChild(e);
339
332
  } catch {
340
333
  Be(e);
341
334
  }
342
- }, Q = function(e, t) {
335
+ }, Z = function(e, t) {
343
336
  try {
344
337
  arrayPush(n.removed, {
345
338
  attribute: t.getAttributeNode(e),
@@ -351,55 +344,55 @@ function createDOMPurify() {
351
344
  from: t
352
345
  });
353
346
  }
354
- if (t.removeAttribute(e), e === "is") if (P || F) try {
355
- Z(t);
347
+ if (t.removeAttribute(e), e === "is") if (F || I) try {
348
+ X(t);
356
349
  } catch {}
357
350
  else try {
358
351
  t.setAttribute(e, "");
359
352
  } catch {}
360
- }, St = function(e) {
353
+ }, Ct = function(e) {
361
354
  let t = null, n = null;
362
- if (it) e = "<remove></remove>" + e;
355
+ if (P) e = "<remove></remove>" + e;
363
356
  else {
364
357
  let t = stringMatch(e, /^[\r\n\t ]+/);
365
358
  n = t && t[0];
366
359
  }
367
- J === "application/xhtml+xml" && G === W && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
360
+ q === "application/xhtml+xml" && W === U && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
368
361
  let i = g ? g.createHTML(e) : e;
369
- if (G === W) try {
370
- t = new Re().parseFromString(i, J);
362
+ if (W === U) try {
363
+ t = new Re().parseFromString(i, q);
371
364
  } catch {}
372
365
  if (!t || !t.documentElement) {
373
- t = v.createDocument(G, "template", null);
366
+ t = v.createDocument(W, "template", null);
374
367
  try {
375
- t.documentElement.innerHTML = dt ? _ : i;
368
+ t.documentElement.innerHTML = ft ? _ : i;
376
369
  } catch {}
377
370
  }
378
371
  let a = t.body || t.documentElement;
379
- return e && n && a.insertBefore(r.createTextNode(n), a.childNodes[0] || null), G === W ? Ge.call(t, M ? "html" : "body")[0] : M ? t.documentElement : a;
380
- }, Ct = function(e) {
381
- return Ue.call(e.ownerDocument || e, e, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
372
+ return e && n && a.insertBefore(r.createTextNode(n), a.childNodes[0] || null), W === U ? Ge.call(t, M ? "html" : "body")[0] : M ? t.documentElement : a;
382
373
  }, wt = function(e) {
383
- return e instanceof Le && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Ie) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
374
+ return Ue.call(e.ownerDocument || e, e, f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION, null);
384
375
  }, Tt = function(e) {
376
+ return e instanceof Le && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Ie) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
377
+ }, Q = function(e) {
385
378
  return typeof d == "function" && e instanceof d;
386
379
  };
387
380
  function $(e, t, r) {
388
381
  arrayForEach(e, (e) => {
389
- e.call(n, t, r, X);
382
+ e.call(n, t, r, Y);
390
383
  });
391
384
  }
392
385
  let Et = function(e) {
393
386
  let t = null;
394
- if ($(y.beforeSanitizeElements, e, null), wt(e)) return Z(e), !0;
395
- let r = Y(e.nodeName);
387
+ if ($(y.beforeSanitizeElements, e, null), Tt(e)) return X(e), !0;
388
+ let r = J(e.nodeName);
396
389
  if ($(y.uponSanitizeElement, e, {
397
390
  tagName: r,
398
391
  allowedTags: C
399
- }), j && e.hasChildNodes() && !Tt(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || e.nodeType === NODE_TYPE.progressingInstruction || j && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return Z(e), !0;
400
- if (!(O.tagCheck instanceof Function && O.tagCheck(r)) && (!C[r] || E[r])) {
392
+ }), j && e.hasChildNodes() && !Q(e.firstElementChild) && regExpTest(/<[/\w!]/g, e.innerHTML) && regExpTest(/<[/\w!]/g, e.textContent) || j && e.namespaceURI === U && r === "style" && Q(e.firstElementChild) || e.nodeType === NODE_TYPE.progressingInstruction || j && e.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, e.data)) return X(e), !0;
393
+ if (E[r] || !(O.tagCheck instanceof Function && O.tagCheck(r)) && !C[r]) {
401
394
  if (!E[r] && Ot(r) && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, r) || T.tagNameCheck instanceof Function && T.tagNameCheck(r))) return !1;
402
- if (L && !B[r]) {
395
+ if (ot && !B[r]) {
403
396
  let t = h(e) || e.parentNode, n = He(e) || e.childNodes;
404
397
  if (n && t) {
405
398
  let r = n.length;
@@ -409,9 +402,9 @@ function createDOMPurify() {
409
402
  }
410
403
  }
411
404
  }
412
- return Z(e), !0;
405
+ return X(e), !0;
413
406
  }
414
- return e instanceof Fe && !xt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Z(e), !0) : (A && e.nodeType === NODE_TYPE.text && (t = e.textContent, arrayForEach([
407
+ return e instanceof Fe && !St(e) || (r === "noscript" || r === "noembed" || r === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, e.innerHTML) ? (X(e), !0) : (A && e.nodeType === NODE_TYPE.text && (t = e.textContent, arrayForEach([
415
408
  b,
416
409
  x,
417
410
  S
@@ -419,11 +412,11 @@ function createDOMPurify() {
419
412
  t = stringReplace(t, e, " ");
420
413
  }), e.textContent !== t && (arrayPush(n.removed, { element: e.cloneNode() }), e.textContent = t)), $(y.afterSanitizeElements, e, null), !1);
421
414
  }, Dt = function(e, t, n) {
422
- if (D[t] || at && (t === "id" || t === "name") && (n in r || n in gt)) return !1;
415
+ if (D[t] || it && (t === "id" || t === "name") && (n in r || n in _t)) return !1;
423
416
  if (!(k && !D[t] && regExpTest(qe, t)) && !(tt && regExpTest(Je, t)) && !(O.attributeCheck instanceof Function && O.attributeCheck(t, e))) {
424
417
  if (!w[t] || D[t]) {
425
418
  if (!(Ot(e) && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, e) || T.tagNameCheck instanceof Function && T.tagNameCheck(e)) && (T.attributeNameCheck instanceof RegExp && regExpTest(T.attributeNameCheck, t) || T.attributeNameCheck instanceof Function && T.attributeNameCheck(t, e)) || t === "is" && T.allowCustomizedBuiltInElements && (T.tagNameCheck instanceof RegExp && regExpTest(T.tagNameCheck, n) || T.tagNameCheck instanceof Function && T.tagNameCheck(n)))) return !1;
426
- } else if (!lt[t] && !regExpTest(Qe, stringReplace(n, Xe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(n, "data:") === 0 && st[e]) && !(nt && !regExpTest(Ye, stringReplace(n, Xe, ""))) && n) return !1;
419
+ } else if (!ut[t] && !regExpTest(Qe, stringReplace(n, Xe, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && stringIndexOf(n, "data:") === 0 && ct[e]) && !(nt && !regExpTest(Ye, stringReplace(n, Xe, ""))) && n) return !1;
427
420
  }
428
421
  return !0;
429
422
  }, Ot = function(e) {
@@ -431,7 +424,7 @@ function createDOMPurify() {
431
424
  }, kt = function(e) {
432
425
  $(y.beforeSanitizeAttributes, e, null);
433
426
  let { attributes: t } = e;
434
- if (!t || wt(e)) return;
427
+ if (!t || Tt(e)) return;
435
428
  let r = {
436
429
  attrName: "",
437
430
  attrValue: "",
@@ -440,22 +433,22 @@ function createDOMPurify() {
440
433
  forceKeepAttr: void 0
441
434
  }, i = t.length;
442
435
  for (; i--;) {
443
- let { name: a, namespaceURI: o, value: s } = t[i], c = Y(a), l = s, u = a === "value" ? l : stringTrim(l);
444
- if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(y.uponSanitizeAttribute, e, r), u = r.attrValue, ot && (c === "id" || c === "name") && (Q(a, e), u = "user-content-" + u), j && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
445
- Q(a, e);
436
+ let { name: a, namespaceURI: o, value: s } = t[i], c = J(a), l = s, u = a === "value" ? l : stringTrim(l);
437
+ if (r.attrName = c, r.attrValue = u, r.keepAttr = !0, r.forceKeepAttr = void 0, $(y.uponSanitizeAttribute, e, r), u = r.attrValue, at && (c === "id" || c === "name") && (Z(a, e), u = "user-content-" + u), j && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, u)) {
438
+ Z(a, e);
446
439
  continue;
447
440
  }
448
441
  if (c === "attributename" && stringMatch(u, "href")) {
449
- Q(a, e);
442
+ Z(a, e);
450
443
  continue;
451
444
  }
452
445
  if (r.forceKeepAttr) continue;
453
446
  if (!r.keepAttr) {
454
- Q(a, e);
447
+ Z(a, e);
455
448
  continue;
456
449
  }
457
450
  if (!rt && regExpTest(/\/>/i, u)) {
458
- Q(a, e);
451
+ Z(a, e);
459
452
  continue;
460
453
  }
461
454
  A && arrayForEach([
@@ -465,9 +458,9 @@ function createDOMPurify() {
465
458
  ], (e) => {
466
459
  u = stringReplace(u, e, " ");
467
460
  });
468
- let Pe = Y(e.nodeName);
461
+ let Pe = J(e.nodeName);
469
462
  if (!Dt(Pe, c, u)) {
470
- Q(a, e);
463
+ Z(a, e);
471
464
  continue;
472
465
  }
473
466
  if (g && typeof p == "object" && typeof p.getAttributeType == "function" && !o) switch (p.getAttributeType(Pe, c)) {
@@ -479,39 +472,50 @@ function createDOMPurify() {
479
472
  break;
480
473
  }
481
474
  if (u !== l) try {
482
- o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), wt(e) ? Z(e) : arrayPop(n.removed);
475
+ o ? e.setAttributeNS(o, a, u) : e.setAttribute(a, u), Tt(e) ? X(e) : arrayPop(n.removed);
483
476
  } catch {
484
- Q(a, e);
477
+ Z(a, e);
485
478
  }
486
479
  }
487
480
  $(y.afterSanitizeAttributes, e, null);
488
- }, At = function e(t) {
489
- let n = null, r = Ct(t);
490
- for ($(y.beforeSanitizeShadowDOM, t, null); n = r.nextNode();) $(y.uponSanitizeShadowNode, n, null), Et(n), kt(n), n.content instanceof c && e(n.content);
491
- $(y.afterSanitizeShadowDOM, t, null);
481
+ }, At = function(e) {
482
+ let t = null, n = wt(e);
483
+ for ($(y.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) $(y.uponSanitizeShadowNode, t, null), Et(t), kt(t), t.content instanceof c && At(t.content);
484
+ $(y.afterSanitizeShadowDOM, e, null);
492
485
  };
493
486
  return n.sanitize = function(e) {
494
487
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = null, a = null, o = null, s = null;
495
- if (dt = !e, dt && (e = "<!-->"), typeof e != "string" && !Tt(e)) if (typeof e.toString == "function") {
488
+ if (ft = !e, ft && (e = "<!-->"), typeof e != "string" && !Q(e)) if (typeof e.toString == "function") {
496
489
  if (e = e.toString(), typeof e != "string") throw typeErrorCreate("dirty is not a string, aborting");
497
490
  } else throw typeErrorCreate("toString is not a function");
498
491
  if (!n.isSupported) return e;
499
- if (N || vt(t), n.removed = [], typeof e == "string" && (R = !1), R) {
492
+ if (N || yt(t), n.removed = [], typeof e == "string" && (R = !1), R) {
500
493
  if (e.nodeName) {
501
- let t = Y(e.nodeName);
494
+ let t = J(e.nodeName);
502
495
  if (!C[t] || E[t]) throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
503
496
  }
504
- } else if (e instanceof d) r = St("<!---->"), a = r.ownerDocument.importNode(e, !0), a.nodeType === NODE_TYPE.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? r = a : r.appendChild(a);
497
+ } else if (e instanceof d) r = Ct("<!---->"), a = r.ownerDocument.importNode(e, !0), a.nodeType === NODE_TYPE.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? r = a : r.appendChild(a);
505
498
  else {
506
- if (!P && !A && !M && e.indexOf("<") === -1) return g && I ? g.createHTML(e) : e;
507
- if (r = St(e), !r) return P ? null : I ? _ : "";
499
+ if (!F && !A && !M && e.indexOf("<") === -1) return g && L ? g.createHTML(e) : e;
500
+ if (r = Ct(e), !r) return F ? null : L ? _ : "";
508
501
  }
509
- r && it && Z(r.firstChild);
510
- let l = Ct(R ? e : r);
502
+ r && P && X(r.firstChild);
503
+ let l = wt(R ? e : r);
511
504
  for (; o = l.nextNode();) Et(o), kt(o), o.content instanceof c && At(o.content);
512
505
  if (R) return e;
513
- if (P) {
514
- if (F) for (s = We.call(r.ownerDocument); r.firstChild;) s.appendChild(r.firstChild);
506
+ if (F) {
507
+ if (A) {
508
+ r.normalize();
509
+ let e = r.innerHTML;
510
+ arrayForEach([
511
+ b,
512
+ x,
513
+ S
514
+ ], (t) => {
515
+ e = stringReplace(e, t, " ");
516
+ }), r.innerHTML = e;
517
+ }
518
+ if (I) for (s = We.call(r.ownerDocument); r.firstChild;) s.appendChild(r.firstChild);
515
519
  else s = r;
516
520
  return (w.shadowroot || w.shadowrootmode) && (s = Ke.call(i, s, !0)), s;
517
521
  }
@@ -522,13 +526,13 @@ function createDOMPurify() {
522
526
  S
523
527
  ], (e) => {
524
528
  u = stringReplace(u, e, " ");
525
- }), g && I ? g.createHTML(u) : u;
529
+ }), g && L ? g.createHTML(u) : u;
526
530
  }, n.setConfig = function() {
527
- vt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), N = !0;
531
+ yt(arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}), N = !0;
528
532
  }, n.clearConfig = function() {
529
- X = null, N = !1;
533
+ Y = null, N = !1;
530
534
  }, n.isValidAttribute = function(e, t, n) {
531
- return X || vt({}), Dt(Y(e), Y(t), n);
535
+ return Y || yt({}), Dt(J(e), J(t), n);
532
536
  }, n.addHook = function(e, t) {
533
537
  typeof t == "function" && arrayPush(y[e], t);
534
538
  }, n.removeHook = function(e, t) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopstack/loopstack-studio",
3
- "version": "0.26.1",
3
+ "version": "0.28.0",
4
4
  "repository": "loopstack-ai/loopstack-studio",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@fontsource/roboto": "^5.2.10",
28
28
  "@hookform/resolvers": "^5.2.2",
29
- "@loopstack/contracts": "^0.27.0",
29
+ "@loopstack/contracts": "^0.29.0",
30
30
  "@radix-ui/react-accordion": "^1.2.12",
31
31
  "@radix-ui/react-alert-dialog": "^1.1.15",
32
32
  "@radix-ui/react-avatar": "^1.1.11",
@@ -1,96 +0,0 @@
1
- import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
2
- import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
3
- import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/loopstack-elements/tool.js";
4
- import { c } from "react/compiler-runtime";
5
- import { Fragment } from "react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
- import { CopyIcon } from "lucide-react";
8
- var ClaudeMessage_default = (y) => {
9
- let b = c(19), { document: x } = y, S = x.content, C = S.id ?? x.id, w, T, E;
10
- if (b[0] !== S.content || b[1] !== S.role || b[2] !== S.toolResults || b[3] !== C) {
11
- E = Symbol.for("react.early_return_sentinel");
12
- bb0: {
13
- let _ = /* @__PURE__ */ new Map();
14
- if (S.toolResults) for (let n of S.toolResults) _.set(n.tool_use_id, n);
15
- if (typeof S.content == "string") {
16
- let m;
17
- b[7] === S.content ? m = b[8] : (m = /* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: S.content }) }), b[7] = S.content, b[8] = m);
18
- let h;
19
- b[9] !== S.content || b[10] !== S.role ? (h = S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
20
- onClick: () => void navigator.clipboard.writeText(S.content),
21
- label: "Copy",
22
- children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
23
- }) }), b[9] = S.content, b[10] = S.role, b[11] = h) : h = b[11];
24
- let g;
25
- b[12] !== S.role || b[13] !== m || b[14] !== h ? (g = /* @__PURE__ */ jsxs(Message, {
26
- from: S.role,
27
- children: [m, h]
28
- }), b[12] = S.role, b[13] = m, b[14] = h, b[15] = g) : g = b[15], E = g;
29
- break bb0;
30
- }
31
- let y = S.content;
32
- w = Fragment, T = y.map((v, y) => {
33
- switch (v.type) {
34
- case "text": return /* @__PURE__ */ jsxs(Message, {
35
- from: S.role,
36
- children: [/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: v.text }) }), S.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
37
- onClick: () => void navigator.clipboard.writeText(v.text),
38
- label: "Copy",
39
- children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
40
- }) })]
41
- }, `${C}-${y}`);
42
- case "thinking": return /* @__PURE__ */ jsxs(Reasoning, {
43
- className: "w-full",
44
- isStreaming: !1,
45
- children: [/* @__PURE__ */ jsx(ReasoningTrigger, {}), /* @__PURE__ */ jsx(ReasoningContent, { children: v.thinking })]
46
- }, `${C}-${y}`);
47
- case "tool_use": {
48
- let f = _.get(v.id), p;
49
- if (f) try {
50
- p = JSON.parse(f.content);
51
- } catch {
52
- p = f.content;
53
- }
54
- return /* @__PURE__ */ jsx(Message, {
55
- from: "assistant",
56
- children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
57
- state: f ? f.is_error ? "output-error" : "output-available" : "input-available",
58
- title: v.name,
59
- type: "tool-call"
60
- }), /* @__PURE__ */ jsxs(ToolContent, { children: [/* @__PURE__ */ jsx(ToolInput, { input: v.input }), f && /* @__PURE__ */ jsx(ToolOutput, {
61
- output: p,
62
- errorText: f.is_error ? f.content : ""
63
- })] })] })
64
- }, `${C}-${y}`);
65
- }
66
- case "tool_result": {
67
- if (_.size > 0) return null;
68
- let f;
69
- try {
70
- f = JSON.parse(v.content);
71
- } catch {
72
- f = v.content;
73
- }
74
- return /* @__PURE__ */ jsx(Message, {
75
- from: "assistant",
76
- children: /* @__PURE__ */ jsxs(Tool, { children: [/* @__PURE__ */ jsx(ToolHeader, {
77
- state: v.is_error ? "output-error" : "output-available",
78
- title: "Tool Result",
79
- type: "tool-result"
80
- }), /* @__PURE__ */ jsx(ToolContent, { children: /* @__PURE__ */ jsx(ToolOutput, {
81
- output: f,
82
- errorText: v.is_error ? v.content : ""
83
- }) })] })
84
- }, `${C}-${y}`);
85
- }
86
- default: return null;
87
- }
88
- });
89
- }
90
- b[0] = S.content, b[1] = S.role, b[2] = S.toolResults, b[3] = C, b[4] = w, b[5] = T, b[6] = E;
91
- } else w = b[4], T = b[5], E = b[6];
92
- if (E !== Symbol.for("react.early_return_sentinel")) return E;
93
- let D;
94
- return b[16] !== w || b[17] !== T ? (D = /* @__PURE__ */ jsx(w, { children: T }), b[16] = w, b[17] = T, b[18] = D) : D = b[18], D;
95
- };
96
- export { ClaudeMessage_default as default };