@humain/ui 2.1.62 → 2.1.65

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 (160) hide show
  1. package/dist/components/organisms/ai/AIToolCall/AIToolCall.d.ts +9 -3
  2. package/dist/components/organisms/ai/AIToolRun/index.d.ts +1 -1
  3. package/dist/components/organisms/ai/AIToolRun/validation.d.ts +24 -3
  4. package/dist/components/organisms/ai/_shared/format-ai-duration.d.ts +1 -0
  5. package/dist/components/organisms/ai/_shared/workflow-step-renderer.d.ts +1 -0
  6. package/dist/index.js +52 -52
  7. package/dist/index151.js +1 -1
  8. package/dist/index174.js +10 -333
  9. package/dist/index174.js.map +1 -1
  10. package/dist/index175.js +310 -137
  11. package/dist/index175.js.map +1 -1
  12. package/dist/index176.js +148 -174
  13. package/dist/index176.js.map +1 -1
  14. package/dist/index177.js +186 -78
  15. package/dist/index177.js.map +1 -1
  16. package/dist/index178.js +74 -124
  17. package/dist/index178.js.map +1 -1
  18. package/dist/index179.js +133 -1
  19. package/dist/index179.js.map +1 -0
  20. package/dist/index180.js +2 -201
  21. package/dist/index181.js +201 -0
  22. package/dist/{index180.js.map → index181.js.map} +1 -1
  23. package/dist/index183.js +130 -166
  24. package/dist/index183.js.map +1 -1
  25. package/dist/index184.js +195 -983
  26. package/dist/index184.js.map +1 -1
  27. package/dist/index185.js +1069 -369
  28. package/dist/index185.js.map +1 -1
  29. package/dist/index186.js +395 -197
  30. package/dist/index186.js.map +1 -1
  31. package/dist/index187.js +198 -243
  32. package/dist/index187.js.map +1 -1
  33. package/dist/index188.js +263 -3
  34. package/dist/index188.js.map +1 -1
  35. package/dist/index189.js +3 -209
  36. package/dist/index189.js.map +1 -1
  37. package/dist/index190.js +190 -777
  38. package/dist/index190.js.map +1 -1
  39. package/dist/index191.js +771 -252
  40. package/dist/index191.js.map +1 -1
  41. package/dist/index192.js +250 -65
  42. package/dist/index192.js.map +1 -1
  43. package/dist/index193.js +72 -523
  44. package/dist/index193.js.map +1 -1
  45. package/dist/index194.js +537 -144
  46. package/dist/index194.js.map +1 -1
  47. package/dist/index195.js +139 -720
  48. package/dist/index195.js.map +1 -1
  49. package/dist/index196.js +707 -167
  50. package/dist/index196.js.map +1 -1
  51. package/dist/index197.js +175 -151
  52. package/dist/index197.js.map +1 -1
  53. package/dist/index198.js +152 -487
  54. package/dist/index198.js.map +1 -1
  55. package/dist/index199.js +472 -225
  56. package/dist/index199.js.map +1 -1
  57. package/dist/index200.js +236 -260
  58. package/dist/index200.js.map +1 -1
  59. package/dist/index201.js +265 -215
  60. package/dist/index201.js.map +1 -1
  61. package/dist/index202.js +207 -307
  62. package/dist/index202.js.map +1 -1
  63. package/dist/index203.js +302 -135
  64. package/dist/index203.js.map +1 -1
  65. package/dist/index204.js +140 -271
  66. package/dist/index204.js.map +1 -1
  67. package/dist/index205.js +263 -253
  68. package/dist/index205.js.map +1 -1
  69. package/dist/index206.js +244 -137
  70. package/dist/index206.js.map +1 -1
  71. package/dist/index207.js +100 -238
  72. package/dist/index207.js.map +1 -1
  73. package/dist/index208.js +278 -74
  74. package/dist/index208.js.map +1 -1
  75. package/dist/index209.js +56 -97
  76. package/dist/index209.js.map +1 -1
  77. package/dist/index210.js +142 -47
  78. package/dist/index210.js.map +1 -1
  79. package/dist/index211.js +38 -84
  80. package/dist/index211.js.map +1 -1
  81. package/dist/index212.js +72 -252
  82. package/dist/index212.js.map +1 -1
  83. package/dist/index213.js +274 -26
  84. package/dist/index213.js.map +1 -1
  85. package/dist/index214.js +29 -94
  86. package/dist/index214.js.map +1 -1
  87. package/dist/index215.js +98 -25
  88. package/dist/index215.js.map +1 -1
  89. package/dist/index216.js +20 -565
  90. package/dist/index216.js.map +1 -1
  91. package/dist/index217.js +564 -17
  92. package/dist/index217.js.map +1 -1
  93. package/dist/index218.js +20 -23
  94. package/dist/index218.js.map +1 -1
  95. package/dist/index219.js +20 -95
  96. package/dist/index219.js.map +1 -1
  97. package/dist/index220.js +92 -88
  98. package/dist/index220.js.map +1 -1
  99. package/dist/index221.js +97 -29
  100. package/dist/index221.js.map +1 -1
  101. package/dist/index222.js +24 -470
  102. package/dist/index222.js.map +1 -1
  103. package/dist/index223.js +446 -196
  104. package/dist/index223.js.map +1 -1
  105. package/dist/index224.js +199 -729
  106. package/dist/index224.js.map +1 -1
  107. package/dist/index225.js +750 -61
  108. package/dist/index225.js.map +1 -1
  109. package/dist/index226.js +58 -181
  110. package/dist/index226.js.map +1 -1
  111. package/dist/index227.js +175 -259
  112. package/dist/index227.js.map +1 -1
  113. package/dist/index228.js +246 -172
  114. package/dist/index228.js.map +1 -1
  115. package/dist/index229.js +195 -32
  116. package/dist/index229.js.map +1 -1
  117. package/dist/index230.js +12 -40
  118. package/dist/index230.js.map +1 -1
  119. package/dist/index231.js +23 -26
  120. package/dist/index231.js.map +1 -1
  121. package/dist/index232.js +45 -22
  122. package/dist/index232.js.map +1 -1
  123. package/dist/index233.js +27 -48
  124. package/dist/index233.js.map +1 -1
  125. package/dist/index234.js +52 -26
  126. package/dist/index234.js.map +1 -1
  127. package/dist/index235.js +40 -225
  128. package/dist/index235.js.map +1 -1
  129. package/dist/index236.js +217 -39
  130. package/dist/index236.js.map +1 -1
  131. package/dist/index237.js +50 -0
  132. package/dist/index237.js.map +1 -0
  133. package/dist/styles.css +1 -1
  134. package/dist/wc/AIToolCall.js +218 -0
  135. package/dist/wc/AIToolCall.js.map +1 -0
  136. package/dist/wc/hf-ai-tool-call.js +34 -219
  137. package/dist/wc/hf-ai-tool-call.js.map +1 -1
  138. package/dist/wc/hf-ai-tool-run.js +673 -576
  139. package/dist/wc/hf-ai-tool-run.js.map +1 -1
  140. package/dist/wc/workflow-step-renderer.js +94 -86
  141. package/dist/wc/workflow-step-renderer.js.map +1 -1
  142. package/dist/wc-react/AIToolCall.js +218 -0
  143. package/dist/wc-react/AIToolCall.js.map +1 -0
  144. package/dist/wc-react/hf-ai-tool-call.js +32 -217
  145. package/dist/wc-react/hf-ai-tool-call.js.map +1 -1
  146. package/dist/wc-react/hf-ai-tool-run.js +698 -601
  147. package/dist/wc-react/hf-ai-tool-run.js.map +1 -1
  148. package/dist/wc-react/workflow-step-renderer.js +76 -68
  149. package/dist/wc-react/workflow-step-renderer.js.map +1 -1
  150. package/package.json +1 -1
  151. package/skills/humain-ui/SKILL.md +1 -1
  152. package/skills/humain-ui-wc/SKILL.md +1 -1
  153. package/skills/humain-ui-wc.skill +0 -0
  154. package/skills/humain-ui.skill +0 -0
  155. package/dist/index182.js +0 -143
  156. package/dist/index182.js.map +0 -1
  157. package/dist/wc/wrench.js +0 -10
  158. package/dist/wc/wrench.js.map +0 -1
  159. package/dist/wc-react/wrench.js +0 -10
  160. package/dist/wc-react/wrench.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import { a as q } from "./rolldown-runtime.js";
2
- import { i as A, t as L } from "./vendor/react.js";
2
+ import { i as L, t as $ } from "./vendor/react.js";
3
3
  import { n as f, t as R } from "./utils.js";
4
4
  import { t as W } from "./createLucideIcon.js";
5
- import { t as V } from "./check.js";
6
- import { t as P } from "./chevron-down.js";
7
- import { t as F } from "./chevron-right.js";
8
- import { t as E } from "./circle-alert.js";
9
- import { t as $ } from "./react.js";
10
- import { t as B } from "./AnimatePresence.js";
5
+ import { t as A } from "./check.js";
6
+ import { t as V } from "./chevron-down.js";
7
+ import { t as P } from "./chevron-right.js";
8
+ import { t as M } from "./circle-alert.js";
9
+ import { t as B } from "./react.js";
10
+ import { t as F } from "./AnimatePresence.js";
11
11
  import { t as K } from "./use-reduced-motion.js";
12
- import { t as _ } from "./dist.js";
12
+ import { t as E } from "./dist.js";
13
13
  var O = [
14
14
  ["path", {
15
15
  d: "M12 2v4",
@@ -57,25 +57,30 @@ var O = [
57
57
  height: "18",
58
58
  rx: "1",
59
59
  key: "1wsw3u"
60
- }]], G = W("pause", U), l = /* @__PURE__ */ q(A(), 1), t = L(), H = {
60
+ }]], G = W("pause", U), l = /* @__PURE__ */ q(L(), 1);
61
+ function H(e) {
62
+ const r = Math.max(0, Math.round(e / 1e3)), a = Math.floor(r / 3600), n = Math.floor(r % 3600 / 60), o = r % 60;
63
+ return a > 0 ? [a ? `${a}h` : "", n ? `${n}m` : ""].filter(Boolean).join(" ") : n > 0 ? `${n}m${o ? ` ${o}s` : ""}` : `${r}s`;
64
+ }
65
+ var t = $(), J = {
61
66
  pending: "text-muted-foreground",
62
67
  running: "text-primary",
63
68
  suspended: "text-warning",
64
69
  completed: "text-success",
65
70
  error: "text-destructive"
66
- }, J = {
71
+ }, Q = {
67
72
  pending: "bg-accent text-muted-foreground",
68
73
  running: "bg-primary/20 text-primary",
69
74
  suspended: "bg-warning/20 text-warning",
70
75
  completed: "bg-success/20 text-success",
71
76
  error: "bg-destructive/20 text-destructive"
72
- }, I = _("flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none", {
73
- variants: { status: H },
74
- defaultVariants: { status: "pending" }
75
- }), Q = _("size-5 shrink-0 flex items-center justify-center rounded-full", {
77
+ }, I = E("flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none", {
76
78
  variants: { status: J },
77
79
  defaultVariants: { status: "pending" }
78
- }), X = {
80
+ }), X = E("size-5 shrink-0 flex items-center justify-center rounded-full", {
81
+ variants: { status: Q },
82
+ defaultVariants: { status: "pending" }
83
+ }), Y = {
79
84
  contained: {
80
85
  rootClassName: "relative",
81
86
  hasDivider: !0,
@@ -92,15 +97,12 @@ var O = [
92
97
  hasConnector: !0
93
98
  }
94
99
  };
95
- function C(e, r) {
96
- const s = new Set(e);
97
- return r.flatMap((n) => s.has(n.id) ? [n.id] : []);
100
+ function j(e, r) {
101
+ const a = new Set(e);
102
+ return r.flatMap((n) => a.has(n.id) ? [n.id] : []);
98
103
  }
99
- function Y(e, r) {
100
- return e.length === r.length && e.every((s, n) => s === r[n]);
101
- }
102
- function Z(e) {
103
- return e < 1e3 ? `${e}ms` : `${(e / 1e3).toFixed(1)}s`;
104
+ function Z(e, r) {
105
+ return e.length === r.length && e.every((a, n) => a === r[n]);
104
106
  }
105
107
  function ee(e) {
106
108
  return typeof e == "object" && e !== null && Symbol.iterator in e && typeof e[Symbol.iterator] == "function";
@@ -110,16 +112,16 @@ function te(e) {
110
112
  }
111
113
  var z = /* @__PURE__ */ new WeakMap();
112
114
  function re(e, r) {
113
- const s = [];
114
- let n = !1, d = !Array.isArray(e);
115
+ const a = [];
116
+ let n = !1, o = !Array.isArray(e);
115
117
  for (let c = r.next(); !c.done; c = r.next()) {
116
118
  const u = S(c.value);
117
- s.push(u.content), n ||= u.hasRenderableContent, d ||= u.changed;
119
+ a.push(u.content), n ||= u.hasRenderableContent, o ||= u.changed;
118
120
  }
119
121
  return {
120
- content: d ? s : e,
122
+ content: o ? a : e,
121
123
  hasRenderableContent: n,
122
- changed: d
124
+ changed: o
123
125
  };
124
126
  }
125
127
  function S(e) {
@@ -147,13 +149,13 @@ function S(e) {
147
149
  };
148
150
  }
149
151
  if (ee(e)) {
150
- const r = e[Symbol.iterator](), s = te(r) ? r : null;
151
- if (s !== null) {
152
- const d = z.get(s);
153
- if (d !== void 0) return d;
152
+ const r = e[Symbol.iterator](), a = te(r) ? r : null;
153
+ if (a !== null) {
154
+ const o = z.get(a);
155
+ if (o !== void 0) return o;
154
156
  }
155
157
  const n = re(e, r);
156
- return s !== null && z.set(s, n), n;
158
+ return a !== null && z.set(a, n), n;
157
159
  }
158
160
  return {
159
161
  content: e,
@@ -164,7 +166,7 @@ function S(e) {
164
166
  function ne(e) {
165
167
  return e?.trim() ? e : void 0;
166
168
  }
167
- function se(e) {
169
+ function ae(e) {
168
170
  switch (e) {
169
171
  case "pending":
170
172
  return "Pending";
@@ -180,8 +182,8 @@ function se(e) {
180
182
  return R(e);
181
183
  }
182
184
  }
183
- function D({ status: e, index: r, className: s }) {
184
- const n = f(Q({ status: e }), s);
185
+ function _({ status: e, index: r, className: a }) {
186
+ const n = f(X({ status: e }), a);
185
187
  switch (e) {
186
188
  case "pending":
187
189
  return /* @__PURE__ */ (0, t.jsx)("div", {
@@ -208,41 +210,46 @@ function D({ status: e, index: r, className: s }) {
208
210
  return /* @__PURE__ */ (0, t.jsx)("div", {
209
211
  "data-slot": "workflow-step-icon",
210
212
  className: f(n, "delight-check-bounce motion-reduce:!animate-none"),
211
- children: /* @__PURE__ */ (0, t.jsx)(V, { className: "size-3" })
213
+ children: /* @__PURE__ */ (0, t.jsx)(A, { className: "size-3" })
212
214
  });
213
215
  case "error":
214
216
  return /* @__PURE__ */ (0, t.jsx)("div", {
215
217
  "data-slot": "workflow-step-icon",
216
218
  className: f(n, "delight-shake motion-reduce:!animate-none"),
217
- children: /* @__PURE__ */ (0, t.jsx)(E, { className: "size-3" })
219
+ children: /* @__PURE__ */ (0, t.jsx)(M, { className: "size-3" })
218
220
  });
219
221
  default:
220
222
  return R(e);
221
223
  }
222
224
  }
223
- D.displayName = "WorkflowStepStatusIcon";
224
- function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot: d = "workflow-step-item", expandable: c = !0, expanded: u, active: b = !1, onExpandedChange: j }) {
225
- const k = l.useId(), i = l.useId(), p = S(e.content), y = p.hasRenderableContent, h = ne(e.error), m = h !== void 0, x = y || m, v = x && c, N = K(), g = X[n], o = { duration: N ? 0 : 0.2 }, a = /* @__PURE__ */ (0, t.jsxs)(t.Fragment, { children: [
226
- /* @__PURE__ */ (0, t.jsx)(D, {
225
+ _.displayName = "WorkflowStepStatusIcon";
226
+ function D({ step: e, index: r, isLast: a, appearance: n = "contained", itemSlot: o = "workflow-step-item", expandable: c = !0, expanded: u, active: b = !1, onExpandedChange: C }) {
227
+ const k = l.useId(), d = l.useId(), p = S(e.content), y = p.hasRenderableContent, h = ne(e.error), m = h !== void 0, x = y || m, v = x && c, N = K(), g = Y[n], i = { duration: N ? 0 : 0.2 }, s = /* @__PURE__ */ (0, t.jsxs)(t.Fragment, { children: [
228
+ /* @__PURE__ */ (0, t.jsx)(_, {
227
229
  status: e.status,
228
230
  index: r
229
231
  }),
230
232
  /* @__PURE__ */ (0, t.jsxs)("div", {
231
233
  className: "min-w-0 flex-1 text-start",
232
234
  children: [/* @__PURE__ */ (0, t.jsxs)("div", {
233
- className: "flex items-center gap-2",
235
+ className: "flex flex-wrap items-center gap-2",
234
236
  children: [
237
+ e.contextLabel && /* @__PURE__ */ (0, t.jsx)("span", {
238
+ "data-slot": "workflow-step-context",
239
+ className: "rounded-full border border-border px-2 py-0.5 text-[0.6875rem] font-medium leading-none text-secondary-foreground",
240
+ children: e.contextLabel
241
+ }),
235
242
  /* @__PURE__ */ (0, t.jsx)("span", {
236
243
  className: f("text-sm font-medium", e.status === "pending" ? "text-text-quaternary" : "text-foreground"),
237
244
  children: e.title
238
245
  }),
239
246
  /* @__PURE__ */ (0, t.jsx)("span", {
240
247
  className: "text-xs text-secondary-foreground",
241
- children: se(e.status)
248
+ children: ae(e.status)
242
249
  }),
243
250
  e.durationMs !== void 0 && /* @__PURE__ */ (0, t.jsx)("span", {
244
251
  className: "text-xs text-muted-foreground",
245
- children: Z(e.durationMs)
252
+ children: H(e.durationMs)
246
253
  })
247
254
  ]
248
255
  }), e.description && /* @__PURE__ */ (0, t.jsx)("p", {
@@ -252,33 +259,33 @@ function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot
252
259
  }),
253
260
  v && /* @__PURE__ */ (0, t.jsx)("div", {
254
261
  className: "shrink-0",
255
- children: u ? /* @__PURE__ */ (0, t.jsx)(P, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ (0, t.jsx)(F, { className: "size-4 text-muted-foreground rtl:rotate-180" })
262
+ children: u ? /* @__PURE__ */ (0, t.jsx)(V, { className: "size-4 text-muted-foreground" }) : /* @__PURE__ */ (0, t.jsx)(P, { className: "size-4 text-muted-foreground rtl:rotate-180" })
256
263
  })
257
264
  ] });
258
265
  return /* @__PURE__ */ (0, t.jsxs)("div", {
259
- "data-slot": d,
266
+ "data-slot": o,
260
267
  "data-step-status": e.status,
261
268
  "data-appearance": n,
262
- className: f(g.rootClassName, g.hasDivider && !s && "border-b border-border"),
269
+ className: f(g.rootClassName, g.hasDivider && !a && "border-b border-border"),
263
270
  children: [
264
271
  v ? /* @__PURE__ */ (0, t.jsx)("button", {
265
272
  type: "button",
266
- onClick: j,
273
+ onClick: C,
267
274
  "aria-current": b ? "step" : void 0,
268
275
  "aria-expanded": u,
269
276
  "aria-controls": k,
270
- "aria-describedby": m ? i : void 0,
277
+ "aria-describedby": m ? d : void 0,
271
278
  className: f(I({ status: e.status }), "w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring"),
272
- children: a
279
+ children: s
273
280
  }) : /* @__PURE__ */ (0, t.jsx)("div", {
274
281
  "aria-current": b ? "step" : void 0,
275
- "aria-describedby": m ? i : void 0,
282
+ "aria-describedby": m ? d : void 0,
276
283
  className: f(I({ status: e.status }), "w-full"),
277
- children: a
284
+ children: s
278
285
  }),
279
- /* @__PURE__ */ (0, t.jsx)(B, {
286
+ /* @__PURE__ */ (0, t.jsx)(F, {
280
287
  initial: !1,
281
- children: u && x && /* @__PURE__ */ (0, t.jsx)($.div, {
288
+ children: u && x && /* @__PURE__ */ (0, t.jsx)(B.div, {
282
289
  id: k,
283
290
  "data-slot": "workflow-step-panel",
284
291
  initial: {
@@ -293,7 +300,7 @@ function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot
293
300
  height: 0,
294
301
  opacity: 0
295
302
  },
296
- transition: o,
303
+ transition: i,
297
304
  className: "overflow-hidden motion-reduce:transition-none",
298
305
  children: /* @__PURE__ */ (0, t.jsxs)("div", {
299
306
  className: "px-4 pb-3 ps-12",
@@ -301,7 +308,7 @@ function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot
301
308
  className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3",
302
309
  children: /* @__PURE__ */ (0, t.jsxs)("div", {
303
310
  className: "flex items-start gap-2",
304
- children: [/* @__PURE__ */ (0, t.jsx)(E, { className: "mt-0.5 size-4 shrink-0 text-destructive" }), /* @__PURE__ */ (0, t.jsx)("p", {
311
+ children: [/* @__PURE__ */ (0, t.jsx)(M, { className: "mt-0.5 size-4 shrink-0 text-destructive" }), /* @__PURE__ */ (0, t.jsx)("p", {
305
312
  className: "text-sm text-destructive",
306
313
  children: h
307
314
  })]
@@ -314,11 +321,11 @@ function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot
314
321
  })
315
322
  }),
316
323
  m && /* @__PURE__ */ (0, t.jsx)("span", {
317
- id: i,
324
+ id: d,
318
325
  className: "sr-only",
319
326
  children: h
320
327
  }),
321
- g.hasConnector && !s && /* @__PURE__ */ (0, t.jsx)("div", {
328
+ g.hasConnector && !a && /* @__PURE__ */ (0, t.jsx)("div", {
322
329
  "data-slot": "workflow-step-connector",
323
330
  "aria-hidden": "true",
324
331
  className: "absolute top-8 -bottom-3 start-6 w-px bg-border"
@@ -326,46 +333,47 @@ function M({ step: e, index: r, isLast: s, appearance: n = "contained", itemSlot
326
333
  ]
327
334
  });
328
335
  }
329
- M.displayName = "WorkflowStepItem";
330
- function ae({ steps: e, appearance: r = "contained", itemSlot: s = "workflow-step-item", expandable: n = !0, activeStepId: d, expandedStepIds: c, defaultExpandedStepIds: u = [], onExpandedStepIdsChange: b, className: j, renderItems: k = !0 }) {
331
- const i = c !== void 0, p = i ? [...c] : void 0, [y, h] = l.useState(() => C(u, e)), m = l.useRef(p ?? []), x = l.useRef(i), v = C(i ? c : y, e), N = new Set(v);
336
+ D.displayName = "WorkflowStepItem";
337
+ function se({ steps: e, appearance: r = "contained", itemSlot: a = "workflow-step-item", expandable: n = !0, activeStepId: o, expandedStepIds: c, defaultExpandedStepIds: u = [], onExpandedStepIdsChange: b, className: C, renderItems: k = !0 }) {
338
+ const d = c !== void 0, p = d ? [...c] : void 0, [y, h] = l.useState(() => j(u, e)), m = l.useRef(p ?? []), x = l.useRef(d), v = j(d ? c : y, e), N = new Set(v);
332
339
  l.useLayoutEffect(() => {
333
340
  p !== void 0 && (m.current = p);
334
341
  }, [p]), l.useLayoutEffect(() => {
335
- const o = x.current;
336
- x.current = i, !i && h((a) => {
337
- const w = C(o ? m.current : a, e);
338
- return Y(w, a) ? a : w;
342
+ const i = x.current;
343
+ x.current = d, !d && h((s) => {
344
+ const w = j(i ? m.current : s, e);
345
+ return Z(w, s) ? s : w;
339
346
  });
340
- }, [i, e]);
341
- const g = (o) => {
342
- const a = new Set(v);
343
- a.has(o) ? a.delete(o) : a.add(o);
344
- const w = C([...a], e);
345
- i || h([...w]), b?.([...w]);
347
+ }, [d, e]);
348
+ const g = (i) => {
349
+ const s = new Set(v);
350
+ s.has(i) ? s.delete(i) : s.add(i);
351
+ const w = j([...s], e);
352
+ d || h([...w]), b?.([...w]);
346
353
  };
347
354
  return k ? /* @__PURE__ */ (0, t.jsx)("ol", {
348
355
  "data-slot": "workflow-step-list",
349
356
  "data-appearance": r,
350
- className: f("m-0 list-none p-0", j),
351
- children: e.map((o, a) => /* @__PURE__ */ (0, t.jsx)("li", { children: /* @__PURE__ */ (0, t.jsx)(M, {
352
- step: o,
353
- index: a,
354
- isLast: a === e.length - 1,
357
+ className: f("m-0 list-none p-0", C),
358
+ children: e.map((i, s) => /* @__PURE__ */ (0, t.jsx)("li", { children: /* @__PURE__ */ (0, t.jsx)(D, {
359
+ step: i,
360
+ index: s,
361
+ isLast: s === e.length - 1,
355
362
  appearance: r,
356
- itemSlot: s,
363
+ itemSlot: a,
357
364
  expandable: n,
358
- expanded: N.has(o.id),
359
- active: d === o.id,
360
- onExpandedChange: () => g(o.id)
361
- }) }, o.id))
365
+ expanded: N.has(i.id),
366
+ active: o === i.id,
367
+ onExpandedChange: () => g(i.id)
368
+ }) }, i.id))
362
369
  }) : null;
363
370
  }
364
- ae.displayName = "WorkflowStepRenderer";
371
+ se.displayName = "WorkflowStepRenderer";
365
372
  export {
366
- ae as n,
367
- D as r,
368
- M as t
373
+ H as i,
374
+ se as n,
375
+ _ as r,
376
+ D as t
369
377
  };
370
378
 
371
379
  //# sourceMappingURL=workflow-step-renderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-step-renderer.js","names":["__iconNode"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/loader.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/pause.mjs","../../src/components/organisms/ai/_shared/workflow-step-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m16.2 7.8 2.9-2.9\", key: \"r700ao\" }],\n [\"path\", { d: \"M18 12h4\", key: \"wj9ykh\" }],\n [\"path\", { d: \"m16.2 16.2 2.9 2.9\", key: \"1bxg5t\" }],\n [\"path\", { d: \"M12 18v4\", key: \"jadmvz\" }],\n [\"path\", { d: \"m4.9 19.1 2.9-2.9\", key: \"bwix9q\" }],\n [\"path\", { d: \"M2 12h4\", key: \"j09sii\" }],\n [\"path\", { d: \"m4.9 4.9 2.9 2.9\", key: \"giyufr\" }]\n];\nconst Loader = createLucideIcon(\"loader\", __iconNode);\n\nexport { __iconNode, Loader as default };\n//# sourceMappingURL=loader.mjs.map\n","/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.mjs.map\n","import { cva } from 'class-variance-authority';\nimport {\n AlertCircle,\n Check,\n ChevronDown,\n ChevronRight,\n Loader,\n Pause,\n} from 'lucide-react';\nimport { AnimatePresence, motion, useReducedMotion } from 'motion/react';\nimport * as React from 'react';\nimport { assertNever, cn } from '@/lib/utils';\n\nexport type WorkflowStepStatus =\n | 'pending'\n | 'running'\n | 'suspended'\n | 'completed'\n | 'error';\n\nexport type WorkflowStepAppearance = 'contained' | 'embedded' | 'timeline';\n\nexport interface WorkflowStepViewModel {\n id: string;\n title: string;\n description?: string;\n status: WorkflowStepStatus;\n content?: React.ReactNode;\n durationMs?: number;\n error?: string;\n}\n\nexport interface WorkflowStepRendererProps {\n steps: readonly WorkflowStepViewModel[];\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n activeStepId?: string;\n expandedStepIds?: readonly string[];\n defaultExpandedStepIds?: readonly string[];\n onExpandedStepIdsChange?: (ids: readonly string[]) => void;\n className?: string;\n}\n\ninterface PrivateWorkflowStepRendererProps extends WorkflowStepRendererProps {\n renderItems?: boolean;\n}\n\nconst workflowStepItemStatusClasses = {\n pending: 'text-muted-foreground',\n running: 'text-primary',\n suspended: 'text-warning',\n completed: 'text-success',\n error: 'text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nconst workflowStepIconStatusClasses = {\n pending: 'bg-accent text-muted-foreground',\n running: 'bg-primary/20 text-primary',\n suspended: 'bg-warning/20 text-warning',\n completed: 'bg-success/20 text-success',\n error: 'bg-destructive/20 text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nexport const workflowStepItemVariants = cva(\n 'flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none',\n {\n variants: {\n status: workflowStepItemStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nexport const workflowStepIconVariants = cva(\n 'size-5 shrink-0 flex items-center justify-center rounded-full',\n {\n variants: {\n status: workflowStepIconStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nconst workflowStepAppearanceConfig = {\n contained: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n embedded: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n timeline: {\n rootClassName: 'relative',\n hasDivider: false,\n hasConnector: true,\n },\n} as const satisfies Record<\n WorkflowStepAppearance,\n { rootClassName: string; hasDivider: boolean; hasConnector: boolean }\n>;\n\nexport function normalizeExpandedWorkflowStepIds(\n ids: readonly string[],\n steps: readonly WorkflowStepViewModel[],\n): string[] {\n const requested = new Set(ids);\n return steps.flatMap((step) => (requested.has(step.id) ? [step.id] : []));\n}\n\nfunction areWorkflowStepIdsEqual(\n left: readonly string[],\n right: readonly string[],\n): boolean {\n return (\n left.length === right.length &&\n left.every((id, index) => id === right[index])\n );\n}\n\nfunction formatWorkflowStepDuration(durationMs: number): string {\n if (durationMs < 1000) return `${durationMs}ms`;\n return `${(durationMs / 1000).toFixed(1)}s`;\n}\n\nfunction isIterableWorkflowStepContent(\n content: React.ReactNode,\n): content is Iterable<React.ReactNode> {\n return (\n typeof content === 'object' &&\n content !== null &&\n Symbol.iterator in content &&\n typeof (content as Iterable<React.ReactNode>)[Symbol.iterator] ===\n 'function'\n );\n}\n\nfunction isIteratorWorkflowStepContent(\n content: unknown,\n): content is Iterator<React.ReactNode> {\n return (\n typeof (content as Partial<Iterator<React.ReactNode>>).next === 'function'\n );\n}\n\ninterface NormalizedWorkflowStepContent {\n content: React.ReactNode;\n hasRenderableContent: boolean;\n changed: boolean;\n}\n\nconst normalizedOneShotWorkflowStepContent = new WeakMap<\n object,\n NormalizedWorkflowStepContent\n>();\n\nfunction normalizeIterableWorkflowStepContent(\n content: Iterable<React.ReactNode>,\n iterator: Iterator<React.ReactNode>,\n): NormalizedWorkflowStepContent {\n const normalizedChildren: React.ReactNode[] = [];\n let hasRenderableContent = false;\n let changed = !Array.isArray(content);\n\n for (let result = iterator.next(); !result.done; result = iterator.next()) {\n const normalizedChild = normalizeWorkflowStepContent(result.value);\n normalizedChildren.push(normalizedChild.content);\n hasRenderableContent ||= normalizedChild.hasRenderableContent;\n changed ||= normalizedChild.changed;\n }\n\n return {\n content: changed ? normalizedChildren : content,\n hasRenderableContent,\n changed,\n };\n}\n\nfunction normalizeWorkflowStepContent(\n content: React.ReactNode,\n): NormalizedWorkflowStepContent {\n if (\n content === null ||\n content === undefined ||\n typeof content === 'boolean' ||\n content === ''\n ) {\n return { content, hasRenderableContent: false, changed: false };\n }\n\n if (\n typeof content === 'string' ||\n typeof content === 'number' ||\n typeof content === 'bigint'\n ) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n if (React.isValidElement<{ children?: React.ReactNode }>(content)) {\n if (content.type !== React.Fragment) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n const normalizedChildren = normalizeWorkflowStepContent(\n content.props.children,\n );\n return {\n content: normalizedChildren.changed\n ? React.cloneElement(content, undefined, normalizedChildren.content)\n : content,\n hasRenderableContent: normalizedChildren.hasRenderableContent,\n changed: normalizedChildren.changed,\n };\n }\n\n if (isIterableWorkflowStepContent(content)) {\n const iterator = content[Symbol.iterator]();\n const oneShotCacheKey = isIteratorWorkflowStepContent(iterator)\n ? (iterator as object)\n : null;\n\n if (oneShotCacheKey !== null) {\n const cached = normalizedOneShotWorkflowStepContent.get(oneShotCacheKey);\n if (cached !== undefined) return cached;\n }\n\n const normalized = normalizeIterableWorkflowStepContent(content, iterator);\n if (oneShotCacheKey !== null) {\n normalizedOneShotWorkflowStepContent.set(oneShotCacheKey, normalized);\n }\n return normalized;\n }\n\n return { content, hasRenderableContent: true, changed: false };\n}\n\nfunction getNonBlankWorkflowStepError(\n error: string | undefined,\n): string | undefined {\n return error?.trim() ? error : undefined;\n}\n\nfunction getWorkflowStepStatusLabel(status: WorkflowStepStatus): string {\n switch (status) {\n case 'pending':\n return 'Pending';\n case 'running':\n return 'Running';\n case 'suspended':\n return 'Paused';\n case 'completed':\n return 'Completed';\n case 'error':\n return 'Error';\n default:\n return assertNever(status);\n }\n}\n\nexport interface WorkflowStepStatusIconProps {\n status: WorkflowStepStatus;\n index: number;\n className?: string;\n}\n\nexport function WorkflowStepStatusIcon({\n status,\n index,\n className,\n}: WorkflowStepStatusIconProps) {\n const iconClass = cn(workflowStepIconVariants({ status }), className);\n\n switch (status) {\n case 'pending':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <span className=\"text-xs font-medium\">{index + 1}</span>\n </div>\n );\n case 'running':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-status-pulse motion-reduce:!animate-none',\n )}\n >\n <Loader className=\"size-3 animate-spin motion-reduce:animate-none\" />\n </div>\n );\n case 'suspended':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <Pause className=\"size-3\" />\n </div>\n );\n case 'completed':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-check-bounce motion-reduce:!animate-none',\n )}\n >\n <Check className=\"size-3\" />\n </div>\n );\n case 'error':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(iconClass, 'delight-shake motion-reduce:!animate-none')}\n >\n <AlertCircle className=\"size-3\" />\n </div>\n );\n default:\n return assertNever(status);\n }\n}\n\nWorkflowStepStatusIcon.displayName = 'WorkflowStepStatusIcon';\n\nexport interface WorkflowStepItemProps {\n step: WorkflowStepViewModel;\n index: number;\n isLast: boolean;\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n expanded: boolean;\n active?: boolean;\n onExpandedChange: () => void;\n}\n\nexport function WorkflowStepItem({\n step,\n index,\n isLast,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n expanded,\n active = false,\n onExpandedChange,\n}: WorkflowStepItemProps) {\n const contentId = React.useId();\n const errorDescriptionId = React.useId();\n const normalizedContent = normalizeWorkflowStepContent(step.content);\n const hasContent = normalizedContent.hasRenderableContent;\n const error = getNonBlankWorkflowStepError(step.error);\n const hasError = error !== undefined;\n const hasExpandableDetails = hasContent || hasError;\n const isDisclosureControl = hasExpandableDetails && expandable;\n const prefersReducedMotion = useReducedMotion();\n const appearanceConfig = workflowStepAppearanceConfig[appearance];\n const disclosureTransition = {\n duration: prefersReducedMotion ? 0 : 0.2,\n };\n const stepContent = (\n <>\n <WorkflowStepStatusIcon status={step.status} index={index} />\n\n <div className=\"min-w-0 flex-1 text-start\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\n 'text-sm font-medium',\n step.status === 'pending'\n ? 'text-text-quaternary'\n : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n <span className=\"text-xs text-secondary-foreground\">\n {getWorkflowStepStatusLabel(step.status)}\n </span>\n {step.durationMs !== undefined && (\n <span className=\"text-xs text-muted-foreground\">\n {formatWorkflowStepDuration(step.durationMs)}\n </span>\n )}\n </div>\n {step.description && (\n <p className=\"mt-0.5 text-xs text-text-quaternary\">\n {step.description}\n </p>\n )}\n </div>\n\n {isDisclosureControl && (\n <div className=\"shrink-0\">\n {expanded ? (\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRight className=\"size-4 text-muted-foreground rtl:rotate-180\" />\n )}\n </div>\n )}\n </>\n );\n\n return (\n <div\n data-slot={itemSlot}\n data-step-status={step.status}\n data-appearance={appearance}\n className={cn(\n appearanceConfig.rootClassName,\n appearanceConfig.hasDivider && !isLast && 'border-b border-border',\n )}\n >\n {isDisclosureControl ? (\n <button\n type=\"button\"\n onClick={onExpandedChange}\n aria-current={active ? 'step' : undefined}\n aria-expanded={expanded}\n aria-controls={contentId}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring',\n )}\n >\n {stepContent}\n </button>\n ) : (\n <div\n aria-current={active ? 'step' : undefined}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full',\n )}\n >\n {stepContent}\n </div>\n )}\n\n <AnimatePresence initial={false}>\n {expanded && hasExpandableDetails && (\n <motion.div\n id={contentId}\n data-slot=\"workflow-step-panel\"\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={disclosureTransition}\n className=\"overflow-hidden motion-reduce:transition-none\"\n >\n <div className=\"px-4 pb-3 ps-12\">\n {hasError && (\n <div className=\"rounded-lg border border-destructive/50 bg-destructive/10 p-3\">\n <div className=\"flex items-start gap-2\">\n <AlertCircle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n </div>\n )}\n {hasContent && (\n <div className={hasError ? 'mt-3' : undefined}>\n {normalizedContent.content}\n </div>\n )}\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {hasError && (\n <span id={errorDescriptionId} className=\"sr-only\">\n {error}\n </span>\n )}\n\n {appearanceConfig.hasConnector && !isLast && (\n <div\n data-slot=\"workflow-step-connector\"\n aria-hidden=\"true\"\n className=\"absolute top-8 -bottom-3 start-6 w-px bg-border\"\n />\n )}\n </div>\n );\n}\n\nWorkflowStepItem.displayName = 'WorkflowStepItem';\n\nexport function WorkflowStepRenderer({\n steps,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n activeStepId,\n expandedStepIds: controlledExpandedStepIds,\n defaultExpandedStepIds = [],\n onExpandedStepIdsChange,\n className,\n renderItems = true,\n}: PrivateWorkflowStepRendererProps) {\n const isControlled = controlledExpandedStepIds !== undefined;\n const controlledSnapshot = isControlled\n ? [...controlledExpandedStepIds]\n : undefined;\n const [uncontrolledExpandedStepIds, setUncontrolledExpandedStepIds] =\n React.useState<readonly string[]>(() =>\n normalizeExpandedWorkflowStepIds(defaultExpandedStepIds, steps),\n );\n const lastControlledExpandedStepIdsRef = React.useRef<readonly string[]>(\n controlledSnapshot ?? [],\n );\n const wasControlledRef = React.useRef(isControlled);\n const rawExpandedStepIds = isControlled\n ? controlledExpandedStepIds\n : uncontrolledExpandedStepIds;\n const visibleExpandedStepIds = normalizeExpandedWorkflowStepIds(\n rawExpandedStepIds,\n steps,\n );\n const expandedSet = new Set(visibleExpandedStepIds);\n\n React.useLayoutEffect(() => {\n if (controlledSnapshot !== undefined) {\n lastControlledExpandedStepIdsRef.current = controlledSnapshot;\n }\n }, [controlledSnapshot]);\n\n React.useLayoutEffect(() => {\n const wasControlled = wasControlledRef.current;\n wasControlledRef.current = isControlled;\n if (isControlled) return;\n\n setUncontrolledExpandedStepIds((current) => {\n const source = wasControlled\n ? lastControlledExpandedStepIdsRef.current\n : current;\n const reconciled = normalizeExpandedWorkflowStepIds(source, steps);\n return areWorkflowStepIdsEqual(reconciled, current)\n ? current\n : reconciled;\n });\n }, [isControlled, steps]);\n\n const toggleStep = (id: string) => {\n const next = new Set(visibleExpandedStepIds);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n const normalizedNext = normalizeExpandedWorkflowStepIds([...next], steps);\n if (!isControlled) {\n setUncontrolledExpandedStepIds([...normalizedNext]);\n }\n onExpandedStepIdsChange?.([...normalizedNext]);\n };\n\n if (!renderItems) return null;\n\n return (\n <ol\n data-slot=\"workflow-step-list\"\n data-appearance={appearance}\n className={cn('m-0 list-none p-0', className)}\n >\n {steps.map((step, index) => (\n <li key={step.id}>\n <WorkflowStepItem\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n appearance={appearance}\n itemSlot={itemSlot}\n expandable={expandable}\n expanded={expandedSet.has(step.id)}\n active={activeStepId === step.id}\n onExpandedChange={() => toggleStep(step.id)}\n />\n </li>\n ))}\n </ol>\n );\n}\n\nWorkflowStepRenderer.displayName = 'WorkflowStepRenderer';\n"],"x_google_ignore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;AAAA,IACjB,WAAW,EAAG,qBAAqB,CAAS;AAAA,cAE3C,EAAM,IAAA,CAAK,GAAM,MAChB,oBAAA,EAAA,KAAC,MAAD,EAAA,UACE,oBAAA,EAAA,KAAC,GAAD;AAAA,MACQ,MAAA;AAAA,MACC,OAAA;AAAA,MACP,QAAQ,MAAU,EAAM,SAAS;AAAA,MACrB,YAAA;AAAA,MACF,UAAA;AAAA,MACE,YAAA;AAAA,MACZ,UAAU,EAAY,IAAI,EAAK,EAAE;AAAA,MACjC,QAAQ,MAAiB,EAAK;AAAA,MAC9B,kBAAA,MAAwB,EAAW,EAAK,EAAE;AAAA,IAC3C,CAAA,EACC,GAZK,EAAK,EAYV,CACL;AAAA,EACC,CAAA,IAvBmB;AAyB3B;AAEA,GAAqB,cAAc"}
1
+ {"version":3,"file":"workflow-step-renderer.js","names":["__iconNode"],"sources":["../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/loader.mjs","../../../../../../../../../../../Users/akarim/Documents/test/humain_foundation_ui/node_modules/.bun/lucide-react@1.25.0+0f58469d5b3bd39f/node_modules/lucide-react/dist/esm/icons/pause.mjs","../../src/components/organisms/ai/_shared/format-ai-duration.ts","../../src/components/organisms/ai/_shared/workflow-step-renderer.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m16.2 7.8 2.9-2.9\", key: \"r700ao\" }],\n [\"path\", { d: \"M18 12h4\", key: \"wj9ykh\" }],\n [\"path\", { d: \"m16.2 16.2 2.9 2.9\", key: \"1bxg5t\" }],\n [\"path\", { d: \"M12 18v4\", key: \"jadmvz\" }],\n [\"path\", { d: \"m4.9 19.1 2.9-2.9\", key: \"bwix9q\" }],\n [\"path\", { d: \"M2 12h4\", key: \"j09sii\" }],\n [\"path\", { d: \"m4.9 4.9 2.9 2.9\", key: \"giyufr\" }]\n];\nconst Loader = createLucideIcon(\"loader\", __iconNode);\n\nexport { __iconNode, Loader as default };\n//# sourceMappingURL=loader.mjs.map\n","/**\n * @license lucide-react v1.25.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"kaeet6\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\", key: \"1wsw3u\" }]\n];\nconst Pause = createLucideIcon(\"pause\", __iconNode);\n\nexport { __iconNode, Pause as default };\n//# sourceMappingURL=pause.mjs.map\n","export function formatAIDuration(durationMs: number): string {\n const totalSeconds = Math.max(0, Math.round(durationMs / 1000));\n const hours = Math.floor(totalSeconds / 3600);\n const minutes = Math.floor((totalSeconds % 3600) / 60);\n const seconds = totalSeconds % 60;\n\n if (hours > 0) {\n return [hours ? `${hours}h` : '', minutes ? `${minutes}m` : '']\n .filter(Boolean)\n .join(' ');\n }\n if (minutes > 0) {\n return `${minutes}m${seconds ? ` ${seconds}s` : ''}`;\n }\n return `${totalSeconds}s`;\n}\n","import { cva } from 'class-variance-authority';\nimport {\n AlertCircle,\n Check,\n ChevronDown,\n ChevronRight,\n Loader,\n Pause,\n} from 'lucide-react';\nimport { AnimatePresence, motion, useReducedMotion } from 'motion/react';\nimport * as React from 'react';\nimport { assertNever, cn } from '@/lib/utils';\nimport { formatAIDuration } from './format-ai-duration';\n\nexport type WorkflowStepStatus =\n | 'pending'\n | 'running'\n | 'suspended'\n | 'completed'\n | 'error';\n\nexport type WorkflowStepAppearance = 'contained' | 'embedded' | 'timeline';\n\nexport interface WorkflowStepViewModel {\n id: string;\n title: string;\n description?: string;\n contextLabel?: string;\n status: WorkflowStepStatus;\n content?: React.ReactNode;\n durationMs?: number;\n error?: string;\n}\n\nexport interface WorkflowStepRendererProps {\n steps: readonly WorkflowStepViewModel[];\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n activeStepId?: string;\n expandedStepIds?: readonly string[];\n defaultExpandedStepIds?: readonly string[];\n onExpandedStepIdsChange?: (ids: readonly string[]) => void;\n className?: string;\n}\n\ninterface PrivateWorkflowStepRendererProps extends WorkflowStepRendererProps {\n renderItems?: boolean;\n}\n\nconst workflowStepItemStatusClasses = {\n pending: 'text-muted-foreground',\n running: 'text-primary',\n suspended: 'text-warning',\n completed: 'text-success',\n error: 'text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nconst workflowStepIconStatusClasses = {\n pending: 'bg-accent text-muted-foreground',\n running: 'bg-primary/20 text-primary',\n suspended: 'bg-warning/20 text-warning',\n completed: 'bg-success/20 text-success',\n error: 'bg-destructive/20 text-destructive',\n} as const satisfies Record<WorkflowStepStatus, string>;\n\nexport const workflowStepItemVariants = cva(\n 'flex items-start gap-3 px-4 py-3 transition-colors motion-reduce:transition-none',\n {\n variants: {\n status: workflowStepItemStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nexport const workflowStepIconVariants = cva(\n 'size-5 shrink-0 flex items-center justify-center rounded-full',\n {\n variants: {\n status: workflowStepIconStatusClasses,\n },\n defaultVariants: {\n status: 'pending',\n },\n },\n);\n\nconst workflowStepAppearanceConfig = {\n contained: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n embedded: {\n rootClassName: 'relative',\n hasDivider: true,\n hasConnector: false,\n },\n timeline: {\n rootClassName: 'relative',\n hasDivider: false,\n hasConnector: true,\n },\n} as const satisfies Record<\n WorkflowStepAppearance,\n { rootClassName: string; hasDivider: boolean; hasConnector: boolean }\n>;\n\nexport function normalizeExpandedWorkflowStepIds(\n ids: readonly string[],\n steps: readonly WorkflowStepViewModel[],\n): string[] {\n const requested = new Set(ids);\n return steps.flatMap((step) => (requested.has(step.id) ? [step.id] : []));\n}\n\nfunction areWorkflowStepIdsEqual(\n left: readonly string[],\n right: readonly string[],\n): boolean {\n return (\n left.length === right.length &&\n left.every((id, index) => id === right[index])\n );\n}\n\nfunction isIterableWorkflowStepContent(\n content: React.ReactNode,\n): content is Iterable<React.ReactNode> {\n return (\n typeof content === 'object' &&\n content !== null &&\n Symbol.iterator in content &&\n typeof (content as Iterable<React.ReactNode>)[Symbol.iterator] ===\n 'function'\n );\n}\n\nfunction isIteratorWorkflowStepContent(\n content: unknown,\n): content is Iterator<React.ReactNode> {\n return (\n typeof (content as Partial<Iterator<React.ReactNode>>).next === 'function'\n );\n}\n\ninterface NormalizedWorkflowStepContent {\n content: React.ReactNode;\n hasRenderableContent: boolean;\n changed: boolean;\n}\n\nconst normalizedOneShotWorkflowStepContent = new WeakMap<\n object,\n NormalizedWorkflowStepContent\n>();\n\nfunction normalizeIterableWorkflowStepContent(\n content: Iterable<React.ReactNode>,\n iterator: Iterator<React.ReactNode>,\n): NormalizedWorkflowStepContent {\n const normalizedChildren: React.ReactNode[] = [];\n let hasRenderableContent = false;\n let changed = !Array.isArray(content);\n\n for (let result = iterator.next(); !result.done; result = iterator.next()) {\n const normalizedChild = normalizeWorkflowStepContent(result.value);\n normalizedChildren.push(normalizedChild.content);\n hasRenderableContent ||= normalizedChild.hasRenderableContent;\n changed ||= normalizedChild.changed;\n }\n\n return {\n content: changed ? normalizedChildren : content,\n hasRenderableContent,\n changed,\n };\n}\n\nfunction normalizeWorkflowStepContent(\n content: React.ReactNode,\n): NormalizedWorkflowStepContent {\n if (\n content === null ||\n content === undefined ||\n typeof content === 'boolean' ||\n content === ''\n ) {\n return { content, hasRenderableContent: false, changed: false };\n }\n\n if (\n typeof content === 'string' ||\n typeof content === 'number' ||\n typeof content === 'bigint'\n ) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n if (React.isValidElement<{ children?: React.ReactNode }>(content)) {\n if (content.type !== React.Fragment) {\n return { content, hasRenderableContent: true, changed: false };\n }\n\n const normalizedChildren = normalizeWorkflowStepContent(\n content.props.children,\n );\n return {\n content: normalizedChildren.changed\n ? React.cloneElement(content, undefined, normalizedChildren.content)\n : content,\n hasRenderableContent: normalizedChildren.hasRenderableContent,\n changed: normalizedChildren.changed,\n };\n }\n\n if (isIterableWorkflowStepContent(content)) {\n const iterator = content[Symbol.iterator]();\n const oneShotCacheKey = isIteratorWorkflowStepContent(iterator)\n ? (iterator as object)\n : null;\n\n if (oneShotCacheKey !== null) {\n const cached = normalizedOneShotWorkflowStepContent.get(oneShotCacheKey);\n if (cached !== undefined) return cached;\n }\n\n const normalized = normalizeIterableWorkflowStepContent(content, iterator);\n if (oneShotCacheKey !== null) {\n normalizedOneShotWorkflowStepContent.set(oneShotCacheKey, normalized);\n }\n return normalized;\n }\n\n return { content, hasRenderableContent: true, changed: false };\n}\n\nfunction getNonBlankWorkflowStepError(\n error: string | undefined,\n): string | undefined {\n return error?.trim() ? error : undefined;\n}\n\nfunction getWorkflowStepStatusLabel(status: WorkflowStepStatus): string {\n switch (status) {\n case 'pending':\n return 'Pending';\n case 'running':\n return 'Running';\n case 'suspended':\n return 'Paused';\n case 'completed':\n return 'Completed';\n case 'error':\n return 'Error';\n default:\n return assertNever(status);\n }\n}\n\nexport interface WorkflowStepStatusIconProps {\n status: WorkflowStepStatus;\n index: number;\n className?: string;\n}\n\nexport function WorkflowStepStatusIcon({\n status,\n index,\n className,\n}: WorkflowStepStatusIconProps) {\n const iconClass = cn(workflowStepIconVariants({ status }), className);\n\n switch (status) {\n case 'pending':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <span className=\"text-xs font-medium\">{index + 1}</span>\n </div>\n );\n case 'running':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-status-pulse motion-reduce:!animate-none',\n )}\n >\n <Loader className=\"size-3 animate-spin motion-reduce:animate-none\" />\n </div>\n );\n case 'suspended':\n return (\n <div data-slot=\"workflow-step-icon\" className={iconClass}>\n <Pause className=\"size-3\" />\n </div>\n );\n case 'completed':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(\n iconClass,\n 'delight-check-bounce motion-reduce:!animate-none',\n )}\n >\n <Check className=\"size-3\" />\n </div>\n );\n case 'error':\n return (\n <div\n data-slot=\"workflow-step-icon\"\n className={cn(iconClass, 'delight-shake motion-reduce:!animate-none')}\n >\n <AlertCircle className=\"size-3\" />\n </div>\n );\n default:\n return assertNever(status);\n }\n}\n\nWorkflowStepStatusIcon.displayName = 'WorkflowStepStatusIcon';\n\nexport interface WorkflowStepItemProps {\n step: WorkflowStepViewModel;\n index: number;\n isLast: boolean;\n appearance?: WorkflowStepAppearance;\n itemSlot?: string;\n expandable?: boolean;\n expanded: boolean;\n active?: boolean;\n onExpandedChange: () => void;\n}\n\nexport function WorkflowStepItem({\n step,\n index,\n isLast,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n expanded,\n active = false,\n onExpandedChange,\n}: WorkflowStepItemProps) {\n const contentId = React.useId();\n const errorDescriptionId = React.useId();\n const normalizedContent = normalizeWorkflowStepContent(step.content);\n const hasContent = normalizedContent.hasRenderableContent;\n const error = getNonBlankWorkflowStepError(step.error);\n const hasError = error !== undefined;\n const hasExpandableDetails = hasContent || hasError;\n const isDisclosureControl = hasExpandableDetails && expandable;\n const prefersReducedMotion = useReducedMotion();\n const appearanceConfig = workflowStepAppearanceConfig[appearance];\n const disclosureTransition = {\n duration: prefersReducedMotion ? 0 : 0.2,\n };\n const stepContent = (\n <>\n <WorkflowStepStatusIcon status={step.status} index={index} />\n\n <div className=\"min-w-0 flex-1 text-start\">\n <div className=\"flex flex-wrap items-center gap-2\">\n {step.contextLabel && (\n <span\n data-slot=\"workflow-step-context\"\n className=\"rounded-full border border-border px-2 py-0.5 text-[0.6875rem] font-medium leading-none text-secondary-foreground\"\n >\n {step.contextLabel}\n </span>\n )}\n <span\n className={cn(\n 'text-sm font-medium',\n step.status === 'pending'\n ? 'text-text-quaternary'\n : 'text-foreground',\n )}\n >\n {step.title}\n </span>\n <span className=\"text-xs text-secondary-foreground\">\n {getWorkflowStepStatusLabel(step.status)}\n </span>\n {step.durationMs !== undefined && (\n <span className=\"text-xs text-muted-foreground\">\n {formatAIDuration(step.durationMs)}\n </span>\n )}\n </div>\n {step.description && (\n <p className=\"mt-0.5 text-xs text-text-quaternary\">\n {step.description}\n </p>\n )}\n </div>\n\n {isDisclosureControl && (\n <div className=\"shrink-0\">\n {expanded ? (\n <ChevronDown className=\"size-4 text-muted-foreground\" />\n ) : (\n <ChevronRight className=\"size-4 text-muted-foreground rtl:rotate-180\" />\n )}\n </div>\n )}\n </>\n );\n\n return (\n <div\n data-slot={itemSlot}\n data-step-status={step.status}\n data-appearance={appearance}\n className={cn(\n appearanceConfig.rootClassName,\n appearanceConfig.hasDivider && !isLast && 'border-b border-border',\n )}\n >\n {isDisclosureControl ? (\n <button\n type=\"button\"\n onClick={onExpandedChange}\n aria-current={active ? 'step' : undefined}\n aria-expanded={expanded}\n aria-controls={contentId}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full cursor-pointer hover:bg-muted focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring',\n )}\n >\n {stepContent}\n </button>\n ) : (\n <div\n aria-current={active ? 'step' : undefined}\n aria-describedby={hasError ? errorDescriptionId : undefined}\n className={cn(\n workflowStepItemVariants({ status: step.status }),\n 'w-full',\n )}\n >\n {stepContent}\n </div>\n )}\n\n <AnimatePresence initial={false}>\n {expanded && hasExpandableDetails && (\n <motion.div\n id={contentId}\n data-slot=\"workflow-step-panel\"\n initial={{ height: 0, opacity: 0 }}\n animate={{ height: 'auto', opacity: 1 }}\n exit={{ height: 0, opacity: 0 }}\n transition={disclosureTransition}\n className=\"overflow-hidden motion-reduce:transition-none\"\n >\n <div className=\"px-4 pb-3 ps-12\">\n {hasError && (\n <div className=\"rounded-lg border border-destructive/50 bg-destructive/10 p-3\">\n <div className=\"flex items-start gap-2\">\n <AlertCircle className=\"mt-0.5 size-4 shrink-0 text-destructive\" />\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n </div>\n )}\n {hasContent && (\n <div className={hasError ? 'mt-3' : undefined}>\n {normalizedContent.content}\n </div>\n )}\n </div>\n </motion.div>\n )}\n </AnimatePresence>\n\n {hasError && (\n <span id={errorDescriptionId} className=\"sr-only\">\n {error}\n </span>\n )}\n\n {appearanceConfig.hasConnector && !isLast && (\n <div\n data-slot=\"workflow-step-connector\"\n aria-hidden=\"true\"\n className=\"absolute top-8 -bottom-3 start-6 w-px bg-border\"\n />\n )}\n </div>\n );\n}\n\nWorkflowStepItem.displayName = 'WorkflowStepItem';\n\nexport function WorkflowStepRenderer({\n steps,\n appearance = 'contained',\n itemSlot = 'workflow-step-item',\n expandable = true,\n activeStepId,\n expandedStepIds: controlledExpandedStepIds,\n defaultExpandedStepIds = [],\n onExpandedStepIdsChange,\n className,\n renderItems = true,\n}: PrivateWorkflowStepRendererProps) {\n const isControlled = controlledExpandedStepIds !== undefined;\n const controlledSnapshot = isControlled\n ? [...controlledExpandedStepIds]\n : undefined;\n const [uncontrolledExpandedStepIds, setUncontrolledExpandedStepIds] =\n React.useState<readonly string[]>(() =>\n normalizeExpandedWorkflowStepIds(defaultExpandedStepIds, steps),\n );\n const lastControlledExpandedStepIdsRef = React.useRef<readonly string[]>(\n controlledSnapshot ?? [],\n );\n const wasControlledRef = React.useRef(isControlled);\n const rawExpandedStepIds = isControlled\n ? controlledExpandedStepIds\n : uncontrolledExpandedStepIds;\n const visibleExpandedStepIds = normalizeExpandedWorkflowStepIds(\n rawExpandedStepIds,\n steps,\n );\n const expandedSet = new Set(visibleExpandedStepIds);\n\n React.useLayoutEffect(() => {\n if (controlledSnapshot !== undefined) {\n lastControlledExpandedStepIdsRef.current = controlledSnapshot;\n }\n }, [controlledSnapshot]);\n\n React.useLayoutEffect(() => {\n const wasControlled = wasControlledRef.current;\n wasControlledRef.current = isControlled;\n if (isControlled) return;\n\n setUncontrolledExpandedStepIds((current) => {\n const source = wasControlled\n ? lastControlledExpandedStepIdsRef.current\n : current;\n const reconciled = normalizeExpandedWorkflowStepIds(source, steps);\n return areWorkflowStepIdsEqual(reconciled, current)\n ? current\n : reconciled;\n });\n }, [isControlled, steps]);\n\n const toggleStep = (id: string) => {\n const next = new Set(visibleExpandedStepIds);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n const normalizedNext = normalizeExpandedWorkflowStepIds([...next], steps);\n if (!isControlled) {\n setUncontrolledExpandedStepIds([...normalizedNext]);\n }\n onExpandedStepIdsChange?.([...normalizedNext]);\n };\n\n if (!renderItems) return null;\n\n return (\n <ol\n data-slot=\"workflow-step-list\"\n data-appearance={appearance}\n className={cn('m-0 list-none p-0', className)}\n >\n {steps.map((step, index) => (\n <li key={step.id}>\n <WorkflowStepItem\n step={step}\n index={index}\n isLast={index === steps.length - 1}\n appearance={appearance}\n itemSlot={itemSlot}\n expandable={expandable}\n expanded={expandedSet.has(step.id)}\n active={activeStepId === step.id}\n onExpandedChange={() => toggleStep(step.id)}\n />\n </li>\n ))}\n </ol>\n );\n}\n\nWorkflowStepRenderer.displayName = 'WorkflowStepRenderer';\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;;;;;;;AASA,IAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAW,KAAK;AAAA,EAAS,CAAC;AAAA,EACxC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAqB,KAAK;AAAA,EAAS,CAAC;AAAA,EAClD,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAY,KAAK;AAAA,EAAS,CAAC;AAAA,EACzC,CAAC,QAAQ;AAAA,IAAE,GAAG;AAAA,IAAsB,KAAK;AAAA,EAAS,CAAC;AAAA,E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