@logicplanes/kaeso-ui 0.7.0 → 0.7.1

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 (172) hide show
  1. package/LICENSE-Apache-2.0.txt +202 -0
  2. package/NOTICE.md +11 -1
  3. package/ai/component-guides.md +36 -2
  4. package/ai/component-registry.json +74 -5
  5. package/ai/component-registry.md +21 -6
  6. package/ai/icons.md +2 -2
  7. package/ai/tokens.md +1 -1
  8. package/dist/chunks/{app-frame-DibcP3SK.js → app-frame-tZReKtCM.js} +3 -3
  9. package/dist/chunks/{app-frame-DibcP3SK.js.map → app-frame-tZReKtCM.js.map} +1 -1
  10. package/dist/chunks/badge-DC-RFkFg.js +27 -0
  11. package/dist/chunks/badge-DC-RFkFg.js.map +1 -0
  12. package/dist/chunks/collapsible-BdwAesRa.js +53 -0
  13. package/dist/chunks/collapsible-BdwAesRa.js.map +1 -0
  14. package/dist/chunks/combobox-BdgWE05R.js +366 -0
  15. package/dist/chunks/combobox-BdgWE05R.js.map +1 -0
  16. package/dist/chunks/command-list-DFd-joEV.js +455 -0
  17. package/dist/chunks/command-list-DFd-joEV.js.map +1 -0
  18. package/dist/chunks/{command-palette-BEIK_hv9.js → command-palette-QsmneiR8.js} +2 -2
  19. package/dist/chunks/{command-palette-BEIK_hv9.js.map → command-palette-QsmneiR8.js.map} +1 -1
  20. package/dist/chunks/{core-B8c9Bty0.js → core-DSGLmc13.js} +19 -18
  21. package/dist/chunks/core-DSGLmc13.js.map +1 -0
  22. package/dist/chunks/{dashboard-Cuv86JNj.js → dashboard-B7ltvQ3f.js} +9 -8
  23. package/dist/chunks/dashboard-B7ltvQ3f.js.map +1 -0
  24. package/dist/chunks/data-table-BFzel_vu.js +682 -0
  25. package/dist/chunks/data-table-BFzel_vu.js.map +1 -0
  26. package/dist/chunks/{de-QtAgHLnQ.js → de-K_t_sSKN.js} +4 -1
  27. package/dist/chunks/de-K_t_sSKN.js.map +1 -0
  28. package/dist/chunks/{display-options-DZqFG-ly.js → display-options-Cw7rD12V.js} +2 -2
  29. package/dist/chunks/{display-options-DZqFG-ly.js.map → display-options-Cw7rD12V.js.map} +1 -1
  30. package/dist/chunks/{domain-BqNtp2rQ.js → domain-DLRk0kME.js} +2 -2
  31. package/dist/chunks/{domain-BqNtp2rQ.js.map → domain-DLRk0kME.js.map} +1 -1
  32. package/dist/chunks/figures-D_Tsrwwj.js +22 -0
  33. package/dist/chunks/figures-D_Tsrwwj.js.map +1 -0
  34. package/dist/chunks/{filter-chip-KMkD6acL.js → filter-chip-BMytSUWo.js} +4 -4
  35. package/dist/chunks/{filter-chip-KMkD6acL.js.map → filter-chip-BMytSUWo.js.map} +1 -1
  36. package/dist/chunks/icon-BMsYY158.js +110 -0
  37. package/dist/chunks/icon-BMsYY158.js.map +1 -0
  38. package/dist/chunks/{identity-DCNUQgql.js → identity-BEHDLa0i.js} +783 -160
  39. package/dist/chunks/identity-BEHDLa0i.js.map +1 -0
  40. package/dist/chunks/kaeso-DSqL9sIX.js +649 -0
  41. package/dist/chunks/kaeso-DSqL9sIX.js.map +1 -0
  42. package/dist/chunks/{link-DXFn_hKF.js → link-ouHMlBU8.js} +2 -2
  43. package/dist/chunks/link-ouHMlBU8.js.map +1 -0
  44. package/dist/chunks/{list-Bhtqsv9E.js → list-0pRnkcpL.js} +155 -154
  45. package/dist/chunks/list-0pRnkcpL.js.map +1 -0
  46. package/dist/chunks/{markdown-CLMrgRju.js → markdown-D3FY-DA8.js} +2 -2
  47. package/dist/chunks/{markdown-CLMrgRju.js.map → markdown-D3FY-DA8.js.map} +1 -1
  48. package/dist/chunks/menu-BMry4pQ-.js +461 -0
  49. package/dist/chunks/menu-BMry4pQ-.js.map +1 -0
  50. package/dist/chunks/{meter-YuCR1Pjd.js → meter-D2ynBSmy.js} +2 -2
  51. package/dist/chunks/{meter-YuCR1Pjd.js.map → meter-D2ynBSmy.js.map} +1 -1
  52. package/dist/chunks/{nav-sheet-CQfZ7w_q.js → nav-sheet-B0o-icmO.js} +2 -2
  53. package/dist/chunks/{nav-sheet-CQfZ7w_q.js.map → nav-sheet-B0o-icmO.js.map} +1 -1
  54. package/dist/chunks/{page-header-C92GBvns.js → page-header-DiH555lF.js} +2 -2
  55. package/dist/chunks/{page-header-C92GBvns.js.map → page-header-DiH555lF.js.map} +1 -1
  56. package/dist/chunks/{picker-popover-icF27914.js → picker-popover-DAnkZmge.js} +3 -3
  57. package/dist/chunks/{picker-popover-icF27914.js.map → picker-popover-DAnkZmge.js.map} +1 -1
  58. package/dist/chunks/{rights-C44EtmsG.js → rights-C6gfyqsY.js} +3 -3
  59. package/dist/chunks/{rights-C44EtmsG.js.map → rights-C6gfyqsY.js.map} +1 -1
  60. package/dist/chunks/{select-B3eoWXfR.js → select-DQzn7_Fs.js} +2 -2
  61. package/dist/chunks/{select-B3eoWXfR.js.map → select-DQzn7_Fs.js.map} +1 -1
  62. package/dist/chunks/{sidebar-BnIqRDVN.js → sidebar-Bbm__0Nk.js} +2 -2
  63. package/dist/chunks/{sidebar-BnIqRDVN.js.map → sidebar-Bbm__0Nk.js.map} +1 -1
  64. package/dist/chunks/{sidebar-menu-CSElX37g.js → sidebar-menu-CycUvTPc.js} +2 -2
  65. package/dist/chunks/{sidebar-menu-CSElX37g.js.map → sidebar-menu-CycUvTPc.js.map} +1 -1
  66. package/dist/chunks/stat-CtOxD2Jk.js +240 -0
  67. package/dist/chunks/stat-CtOxD2Jk.js.map +1 -0
  68. package/dist/chunks/{status-Bi2tSKCj.js → status-BuZz3nIH.js} +2 -2
  69. package/dist/chunks/{status-Bi2tSKCj.js.map → status-BuZz3nIH.js.map} +1 -1
  70. package/dist/chunks/{styles-CklJ8C7c.js → styles-CN0ovMB2.js} +2 -2
  71. package/dist/chunks/{styles-CklJ8C7c.js.map → styles-CN0ovMB2.js.map} +1 -1
  72. package/dist/chunks/{swap-value-TlZecHRF.js → swap-value-ClhwTe97.js} +2 -2
  73. package/dist/chunks/swap-value-ClhwTe97.js.map +1 -0
  74. package/dist/chunks/{theme-menu-BgltuBqB.js → theme-menu-DmEo4nXz.js} +2 -2
  75. package/dist/chunks/{theme-menu-BgltuBqB.js.map → theme-menu-DmEo4nXz.js.map} +1 -1
  76. package/dist/chunks/{timeseries-h7XdvYTo.js → timeseries-CrpFP8va.js} +4 -4
  77. package/dist/chunks/{timeseries-h7XdvYTo.js.map → timeseries-CrpFP8va.js.map} +1 -1
  78. package/dist/chunks/{tooltip-OySqu0Bq.js → tooltip-DdZgOME7.js} +35 -35
  79. package/dist/chunks/tooltip-DdZgOME7.js.map +1 -0
  80. package/dist/chunks/vendor-marks-DF2Thhge.js +2052 -0
  81. package/dist/chunks/vendor-marks-DF2Thhge.js.map +1 -0
  82. package/dist/chunks/{zh-CN-8ZWE79zI.js → zh-CN-By8VGCbn.js} +4 -1
  83. package/dist/chunks/zh-CN-By8VGCbn.js.map +1 -0
  84. package/dist/components/app-frame.js +1 -1
  85. package/dist/components/badge.js +1 -1
  86. package/dist/components/charts/bar.js +3 -3
  87. package/dist/components/charts/donut.js +2 -2
  88. package/dist/components/charts/heatmap.js +2 -2
  89. package/dist/components/charts/sankey.js +3 -3
  90. package/dist/components/charts/sparkline.js +1 -1
  91. package/dist/components/charts/timeseries.js +1 -1
  92. package/dist/components/charts.js +2 -2
  93. package/dist/components/collapsible.js +1 -1
  94. package/dist/components/combobox.js +1 -1
  95. package/dist/components/command-palette.js +1 -1
  96. package/dist/components/dashboard/legend.js +22 -20
  97. package/dist/components/dashboard/legend.js.map +1 -1
  98. package/dist/components/dashboard/metric-tabs.js +66 -65
  99. package/dist/components/dashboard/metric-tabs.js.map +1 -1
  100. package/dist/components/dashboard/model-card.js +37 -36
  101. package/dist/components/dashboard/model-card.js.map +1 -1
  102. package/dist/components/dashboard/rank-list.js +1 -1
  103. package/dist/components/dashboard/rank-list.js.map +1 -1
  104. package/dist/components/dashboard.js +1 -1
  105. package/dist/components/data-table.js +1 -1
  106. package/dist/components/display-options.js +1 -1
  107. package/dist/components/filter-chip.js +1 -1
  108. package/dist/components/flow-canvas.js +2 -2
  109. package/dist/components/icon.js +1 -1
  110. package/dist/components/kaeso/conversation.js +3 -3
  111. package/dist/components/kaeso/identity.js +1 -1
  112. package/dist/components/kaeso/rights.js +1 -1
  113. package/dist/components/kaeso/usage.js +4 -4
  114. package/dist/components/kaeso.js +7 -7
  115. package/dist/components/link.js +1 -1
  116. package/dist/components/list.js +1 -1
  117. package/dist/components/markdown.js +1 -1
  118. package/dist/components/menu.js +2 -2
  119. package/dist/components/meter.js +1 -1
  120. package/dist/components/page-header.js +1 -1
  121. package/dist/components/playground.js +662 -657
  122. package/dist/components/playground.js.map +1 -1
  123. package/dist/components/select.js +1 -1
  124. package/dist/components/sidebar.js +1 -1
  125. package/dist/components/stat.js +1 -1
  126. package/dist/components/status.js +1 -1
  127. package/dist/components/theme-menu.js +1 -1
  128. package/dist/i18n-provider.js +1 -1
  129. package/dist/index.js +30 -30
  130. package/dist/styles.css +1 -1
  131. package/dist/types/components/charts/marks.d.ts +0 -1
  132. package/dist/types/components/dashboard/swap-value.d.ts +0 -1
  133. package/dist/types/components/kaeso/client-button.d.ts +3 -1
  134. package/dist/types/components/kaeso/docs.d.ts +11 -0
  135. package/dist/types/components/kaeso/identity.d.ts +29 -4
  136. package/dist/types/components/kaeso/index.d.ts +8 -2
  137. package/dist/types/components/kaeso/model-makers.d.ts +545 -0
  138. package/dist/types/components/kaeso/source-badge.d.ts +52 -0
  139. package/dist/types/components/kaeso/vendor-marks.d.ts +2 -0
  140. package/dist/types/components/menu/styles.d.ts +1 -1
  141. package/dist/types/icons/groups.d.ts +1 -1
  142. package/dist/types/icons/vocabulary.d.ts +10 -0
  143. package/dist/types/utils/figures.d.ts +3 -0
  144. package/foundations/typography.md +1 -1
  145. package/package.json +4 -3
  146. package/dist/chunks/badge-C6H9NlNw.js +0 -26
  147. package/dist/chunks/badge-C6H9NlNw.js.map +0 -1
  148. package/dist/chunks/collapsible-BFoDXP0y.js +0 -52
  149. package/dist/chunks/collapsible-BFoDXP0y.js.map +0 -1
  150. package/dist/chunks/combobox-B8GjFlO4.js +0 -365
  151. package/dist/chunks/combobox-B8GjFlO4.js.map +0 -1
  152. package/dist/chunks/command-list-ttU7YLEl.js +0 -454
  153. package/dist/chunks/command-list-ttU7YLEl.js.map +0 -1
  154. package/dist/chunks/core-B8c9Bty0.js.map +0 -1
  155. package/dist/chunks/dashboard-Cuv86JNj.js.map +0 -1
  156. package/dist/chunks/data-table-BMopFMG6.js +0 -641
  157. package/dist/chunks/data-table-BMopFMG6.js.map +0 -1
  158. package/dist/chunks/de-QtAgHLnQ.js.map +0 -1
  159. package/dist/chunks/icon-UqUodbsN.js +0 -108
  160. package/dist/chunks/icon-UqUodbsN.js.map +0 -1
  161. package/dist/chunks/identity-DCNUQgql.js.map +0 -1
  162. package/dist/chunks/kaeso-C-E-8Dxz.js +0 -506
  163. package/dist/chunks/kaeso-C-E-8Dxz.js.map +0 -1
  164. package/dist/chunks/link-DXFn_hKF.js.map +0 -1
  165. package/dist/chunks/list-Bhtqsv9E.js.map +0 -1
  166. package/dist/chunks/menu-Bl7vzB52.js +0 -460
  167. package/dist/chunks/menu-Bl7vzB52.js.map +0 -1
  168. package/dist/chunks/stat-DuWKmxGr.js +0 -239
  169. package/dist/chunks/stat-DuWKmxGr.js.map +0 -1
  170. package/dist/chunks/swap-value-TlZecHRF.js.map +0 -1
  171. package/dist/chunks/tooltip-OySqu0Bq.js.map +0 -1
  172. package/dist/chunks/zh-CN-8ZWE79zI.js.map +0 -1
@@ -6,7 +6,7 @@ import { r as i } from "../chunks/tag-o9BCsRkO.js";
6
6
  import { r as a } from "../chunks/thumbnail-DmFBC3Rf.js";
7
7
  import { t as o } from "../chunks/use-controllable-rN5Fg5EJ.js";
8
8
  import { t as s } from "../chunks/formatters-Be5AdLB2.js";
9
- import { r as c } from "../chunks/markdown-CLMrgRju.js";
9
+ import { r as c } from "../chunks/markdown-D3FY-DA8.js";
10
10
  import { t as l } from "../chunks/copy-button-59YLQ_oG.js";
11
11
  import { t as u } from "../chunks/reasoning-frame-BCoFYqgO.js";
12
12
  import { t as d } from "../chunks/use-truncated-CVim8MP9.js";
@@ -15,45 +15,46 @@ import { t as p } from "../chunks/input-DpGqfw1G.js";
15
15
  import { o as m, r as h } from "../chunks/textarea-BP6I9yrU.js";
16
16
  import { r as g } from "../chunks/popover-BFvV60-L.js";
17
17
  import { r as _ } from "../chunks/segmented-1WSOvDjT.js";
18
- import { n as v, r as y } from "../chunks/select-B3eoWXfR.js";
18
+ import { n as v, r as y } from "../chunks/select-DQzn7_Fs.js";
19
19
  import { r as b } from "../chunks/slider-CSLWsGYq.js";
20
- import { r as x, t as S } from "../chunks/command-list-ttU7YLEl.js";
21
- import { n as C, t as w } from "../chunks/picker-popover-icF27914.js";
22
- import { r as T } from "../chunks/combobox-B8GjFlO4.js";
23
- import { r as E } from "../chunks/switch-C0sNr969.js";
24
- import { a as D, o as O, s as k } from "../chunks/field-BJoH_7Mc.js";
25
- import { c as A, d as j, s as M, t as N } from "../chunks/identity-DCNUQgql.js";
26
- import { r as ee } from "../chunks/separator-CAxDTLUL.js";
27
- import { Children as te, createContext as ne, forwardRef as P, isValidElement as re, useCallback as F, useContext as ie, useEffect as I, useId as L, useLayoutEffect as R, useMemo as z, useRef as B, useState as V, useSyncExternalStore as ae } from "react";
28
- import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
29
- import { Add01Icon as oe, ArrowExpand01Icon as G, ArrowLeft01Icon as K, ArrowReloadHorizontalIcon as q, ArrowRight01Icon as J, ArrowShrink02Icon as se, ArrowUp02Icon as Y, Attachment01Icon as ce, AudioWave01Icon as X, Cancel01Icon as le, Delete02Icon as ue, Download01Icon as de, File01Icon as fe, Pdf01Icon as Z, StopIcon as pe } from "@hugeicons/core-free-icons";
20
+ import { t as x } from "../chunks/figures-D_Tsrwwj.js";
21
+ import { r as S, t as C } from "../chunks/command-list-DFd-joEV.js";
22
+ import { n as w, t as T } from "../chunks/picker-popover-DAnkZmge.js";
23
+ import { r as E } from "../chunks/combobox-BdgWE05R.js";
24
+ import { r as D } from "../chunks/switch-C0sNr969.js";
25
+ import { a as O, o as ee, s as k } from "../chunks/field-BJoH_7Mc.js";
26
+ import { c as A, f as j, l as M, t as te } from "../chunks/identity-BEHDLa0i.js";
27
+ import { r as ne } from "../chunks/separator-CAxDTLUL.js";
28
+ import { Children as re, createContext as N, forwardRef as P, isValidElement as ie, useCallback as F, useContext as ae, useEffect as I, useId as L, useLayoutEffect as oe, useMemo as R, useRef as z, useState as B, useSyncExternalStore as se } from "react";
29
+ import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
30
+ import { Add01Icon as W, ArrowExpand01Icon as G, ArrowLeft01Icon as K, ArrowReloadHorizontalIcon as q, ArrowRight01Icon as ce, ArrowShrink02Icon as J, ArrowUp02Icon as le, Attachment01Icon as ue, AudioWave01Icon as de, Cancel01Icon as fe, Delete02Icon as pe, Download01Icon as Y, File01Icon as X, Pdf01Icon as Z, StopIcon as me } from "@hugeicons/core-free-icons";
30
31
  // src/components/playground/attachments.tsx
31
- var me = { align: {
32
+ var he = { align: {
32
33
  start: { classes: "justify-start" },
33
34
  end: { classes: "justify-end" }
34
- } }, he = { align: "start" }, ge = (e) => e.type.startsWith("image/") && !!e.src, _e = /* @__PURE__ */ P(function({ items: n, onRemove: o, align: s = "start", "aria-label": c, className: l }, u) {
35
+ } }, ge = { align: "start" }, _e = (e) => e.type.startsWith("image/") && !!e.src, ve = /* @__PURE__ */ P(function({ items: n, onRemove: o, align: s = "start", "aria-label": c, className: l }, u) {
35
36
  let d = t();
36
- return n.length === 0 ? null : /* @__PURE__ */ U("ul", {
37
+ return n.length === 0 ? null : /* @__PURE__ */ H("ul", {
37
38
  ref: u,
38
39
  "aria-label": c ?? d("attachments.label", "Attachments"),
39
- className: e("flex min-w-0 flex-wrap items-center gap-8", me.align[s].classes, l),
40
+ className: e("flex min-w-0 flex-wrap items-center gap-8", he.align[s].classes, l),
40
41
  children: n.map((e) => {
41
42
  let t = d("attachments.remove", "Remove {name}", { name: e.name });
42
- return /* @__PURE__ */ U("li", {
43
+ return /* @__PURE__ */ H("li", {
43
44
  className: "relative flex min-w-0",
44
- children: ge(e) ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(a, {
45
+ children: _e(e) ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(a, {
45
46
  src: e.src ?? "",
46
47
  alt: e.name,
47
48
  size: "sm"
48
- }), o && /* @__PURE__ */ U(r, {
49
+ }), o && /* @__PURE__ */ H(r, {
49
50
  size: "xs",
50
51
  variant: "secondary",
51
- icon: le,
52
+ icon: fe,
52
53
  "aria-label": t,
53
54
  onClick: () => o(e.id),
54
55
  className: "absolute top-4 right-4 controls-on-picture"
55
- })] }) : /* @__PURE__ */ U(i, {
56
- icon: e.type === "application/pdf" ? Z : e.type.startsWith("audio/") ? X : fe,
56
+ })] }) : /* @__PURE__ */ H(i, {
57
+ icon: e.type === "application/pdf" ? Z : e.type.startsWith("audio/") ? de : X,
57
58
  ...o ? {
58
59
  onRemove: () => o(e.id),
59
60
  removeLabel: t
@@ -65,111 +66,111 @@ var me = { align: {
65
66
  })
66
67
  });
67
68
  });
68
- process.env.NODE_ENV !== "production" && (_e.displayName = "Attachments");
69
+ process.env.NODE_ENV !== "production" && (ve.displayName = "Attachments");
69
70
  // src/components/playground/composer.tsx
70
- var ve = { size: {
71
+ var ye = { size: {
71
72
  md: { classes: "rounded-frame" },
72
73
  sm: { classes: "rounded-frame" }
73
- } }, ye = { size: "md" }, be = "(pointer: coarse)";
74
- function xe(e) {
74
+ } }, be = { size: "md" }, xe = "(pointer: coarse)";
75
+ function Q(e) {
75
76
  if (typeof window > "u" || !window.matchMedia) return () => {};
76
- let t = window.matchMedia(be);
77
+ let t = window.matchMedia(xe);
77
78
  return t.addEventListener?.("change", e), () => t.removeEventListener?.("change", e);
78
79
  }
79
- var Q = () => typeof window < "u" && !!window.matchMedia?.(be).matches, Se = () => ae(xe, Q, () => !1), Ce = (e) => e ? Array.from(e) : [], we = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), Te = /* @__PURE__ */ P(function({ value: n, defaultValue: i = "", onValueChange: a, onSubmit: s, onStop: c, submitOn: l = "enter", streaming: u = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, attachments: C = [], onAttach: w, onRemoveAttachment: T, accept: E, attachLabel: D, "data-force": O, className: k }, A) {
80
- let j = t(), M = m ?? j("composer.placeholder", "Write a prompt"), N = h ?? j("composer.prompt", "Prompt"), ee = y ?? j("composer.send", "Send"), te = b ?? j("composer.stop", "Stop"), ne = D ?? j("composer.attach", "Attach files"), [P, re] = o(n, i, a), ie = B(null), [I, z] = V(!1), ae = !!w && !f, oe = L(), G = B(null), K = _ === "sm" ? 1 : 2, q = F(() => {
81
- let e = G.current;
80
+ var Se = () => typeof window < "u" && !!window.matchMedia?.(xe).matches, Ce = () => se(Q, Se, () => !1), we = (e) => e ? Array.from(e) : [], Te = (e) => Array.from(e.dataTransfer?.types ?? []).includes("Files"), Ee = /* @__PURE__ */ P(function({ value: n, defaultValue: i = "", onValueChange: a, onSubmit: s, onStop: c, submitOn: l = "enter", streaming: u = !1, loading: d = !1, disabled: f = !1, clearOnSubmit: p = !0, placeholder: m, "aria-label": h, maxRows: g = 10, size: _ = "md", actions: v, submitLabel: y, stopLabel: b, autoFocus: x, name: S, attachments: C = [], onAttach: w, onRemoveAttachment: T, accept: E, attachLabel: D, "data-force": O, className: ee }, k) {
81
+ let A = t(), j = m ?? A("composer.placeholder", "Write a prompt"), M = h ?? A("composer.prompt", "Prompt"), te = y ?? A("composer.send", "Send"), ne = b ?? A("composer.stop", "Stop"), re = D ?? A("composer.attach", "Attach files"), [N, P] = o(n, i, a), ie = z(null), [ae, I] = B(!1), R = !!w && !f, se = L(), W = z(null), G = _ === "sm" ? 1 : 2, K = F(() => {
82
+ let e = W.current;
82
83
  e && (e.style.setProperty("--scroll-area-overflow-y-start", `${Math.max(0, e.scrollTop)}px`), e.style.setProperty("--scroll-area-overflow-y-end", `${Math.max(0, e.scrollHeight - e.clientHeight - e.scrollTop)}px`));
83
- }, []), J = F(() => {
84
- let e = G.current;
85
- e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, K * 20 + 16), g * 20 + 16)}px`, q());
84
+ }, []), q = F(() => {
85
+ let e = W.current;
86
+ e && (e.style.height = "auto", e.style.height = `${Math.min(Math.max(e.scrollHeight, G * 20 + 16), g * 20 + 16)}px`, K());
86
87
  }, [
87
88
  g,
88
- K,
89
- q
89
+ G,
90
+ K
90
91
  ]);
91
- R(J, [J, P]);
92
- let se = P.trim() === "" && C.length === 0, X = !f && !u && !d && !se, le = () => {
93
- X && (s?.(P), p && n === void 0 && re(""));
94
- }, ue = Se(), de = l === "enter" && !ue, fe = (e) => {
95
- e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || de && !e.shiftKey && !e.altKey) && (e.preventDefault(), le()));
92
+ oe(q, [q, N]);
93
+ let ce = N.trim() === "" && C.length === 0, J = !f && !u && !d && !ce, de = () => {
94
+ J && (s?.(N), p && n === void 0 && P(""));
95
+ }, fe = Ce(), pe = l === "enter" && !fe, Y = (e) => {
96
+ e.key === "Enter" && (e.nativeEvent.isComposing || e.keyCode === 229 || (e.metaKey || e.ctrlKey || pe && !e.shiftKey && !e.altKey) && (e.preventDefault(), de()));
97
+ }, X = (e) => {
98
+ e.preventDefault(), de();
96
99
  }, Z = (e) => {
97
- e.preventDefault(), le();
98
- }, me = (e) => {
99
- let t = Ce(e.clipboardData?.files);
100
- ae && t.length !== 0 && (e.clipboardData.getData("text/plain") || e.preventDefault(), w?.(t));
100
+ let t = we(e.clipboardData?.files);
101
+ R && t.length !== 0 && (e.clipboardData.getData("text/plain") || e.preventDefault(), w?.(t));
101
102
  };
102
- return /* @__PURE__ */ W("form", {
103
- onSubmit: Z,
103
+ return /* @__PURE__ */ U("form", {
104
+ onSubmit: X,
104
105
  onMouseDown: (e) => {
105
106
  if (f || e.button !== 0 || !e.currentTarget.contains(e.target)) return;
106
107
  let t = e.target.closest("textarea, button, a, input, select, label, [role], [tabindex]");
107
- t && e.currentTarget.contains(t) || (e.preventDefault(), G.current?.focus());
108
+ t && e.currentTarget.contains(t) || (e.preventDefault(), W.current?.focus());
108
109
  },
109
- ...ae ? {
110
+ ...R ? {
110
111
  onDragEnter: (e) => {
111
- we(e) && z(!0);
112
+ Te(e) && I(!0);
112
113
  },
113
114
  onDragOver: (e) => {
114
- we(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
115
+ Te(e) && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
115
116
  },
116
117
  onDragLeave: (e) => {
117
- e.currentTarget.contains(e.relatedTarget) || z(!1);
118
+ e.currentTarget.contains(e.relatedTarget) || I(!1);
118
119
  },
119
120
  onDrop: (e) => {
120
- z(!1);
121
- let t = Ce(e.dataTransfer?.files);
121
+ I(!1);
122
+ let t = we(e.dataTransfer?.files);
122
123
  t.length !== 0 && (e.preventDefault(), w?.(t));
123
124
  }
124
125
  } : {},
125
126
  ...O ? { "data-force": O } : {},
126
127
  ...f ? { "data-disabled": "" } : {},
127
- ...I && ae ? { "data-drop": "" } : {},
128
- className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", ve.size[_].classes, f && "cursor-not-allowed", k),
128
+ ...ae && R ? { "data-drop": "" } : {},
129
+ className: e("flex min-w-0 cursor-text flex-col material-composer transition-control", ye.size[_].classes, f && "cursor-not-allowed", ee),
129
130
  children: [
130
- C.length > 0 && /* @__PURE__ */ U(_e, {
131
+ C.length > 0 && /* @__PURE__ */ H(ve, {
131
132
  items: C,
132
133
  onRemove: f ? void 0 : T,
133
134
  className: "px-8 pt-8"
134
135
  }),
135
- /* @__PURE__ */ U("textarea", {
136
+ /* @__PURE__ */ H("textarea", {
136
137
  ref: (e) => {
137
- G.current = e, typeof A == "function" ? A(e) : A && (A.current = e);
138
+ W.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
138
139
  },
139
- rows: K,
140
- value: P,
141
- onChange: (e) => re(e.target.value),
142
- onKeyDown: fe,
143
- onPaste: me,
144
- onScroll: q,
140
+ rows: G,
141
+ value: N,
142
+ onChange: (e) => P(e.target.value),
143
+ onKeyDown: Y,
144
+ onPaste: Z,
145
+ onScroll: K,
145
146
  disabled: f,
146
- placeholder: M,
147
- "aria-label": N,
148
- ...u && !se ? { "aria-describedby": oe } : {},
149
- "aria-keyshortcuts": de ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
150
- ...de ? { enterKeyHint: "send" } : {},
147
+ placeholder: j,
148
+ "aria-label": M,
149
+ ...u && !ce ? { "aria-describedby": se } : {},
150
+ "aria-keyshortcuts": pe ? "Enter Meta+Enter Control+Enter" : "Meta+Enter Control+Enter",
151
+ ...pe ? { enterKeyHint: "send" } : {},
151
152
  autoFocus: x,
152
153
  ...S ? { name: S } : {},
153
154
  className: "block w-full min-w-0 resize-none bg-transparent px-16 pt-12 pb-4 text-body text-fg outline-none scrollbar-quiet scroll-fade-y placeholder:text-fg-tertiary disabled:cursor-not-allowed disabled:text-fg-disabled disabled:placeholder:text-fg-disabled"
154
155
  }),
155
- /* @__PURE__ */ U("span", {
156
- id: oe,
156
+ /* @__PURE__ */ H("span", {
157
+ id: se,
157
158
  className: "sr-only",
158
- children: j("composer.stopToSend", "A response is arriving; stop it to send this prompt.")
159
+ children: A("composer.stopToSend", "A response is arriving; stop it to send this prompt.")
159
160
  }),
160
- /* @__PURE__ */ W("div", {
161
+ /* @__PURE__ */ U("div", {
161
162
  className: "flex min-w-0 items-center gap-8 p-8 pt-4 controls-on-fill",
162
- children: [/* @__PURE__ */ W("div", {
163
+ children: [/* @__PURE__ */ U("div", {
163
164
  className: "flex min-w-0 flex-1 items-center gap-4",
164
- children: [w && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(r, {
165
+ children: [w && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(r, {
165
166
  type: "button",
166
167
  size: "sm",
167
168
  variant: "ghost",
168
- icon: ce,
169
- "aria-label": ne,
169
+ icon: ue,
170
+ "aria-label": re,
170
171
  disabled: f,
171
172
  onClick: () => ie.current?.click()
172
- }), /* @__PURE__ */ U("input", {
173
+ }), /* @__PURE__ */ H("input", {
173
174
  ref: ie,
174
175
  type: "file",
175
176
  multiple: !0,
@@ -177,64 +178,64 @@ var Q = () => typeof window < "u" && !!window.matchMedia?.(be).matches, Se = ()
177
178
  tabIndex: -1,
178
179
  ...E ? { accept: E } : {},
179
180
  onChange: (e) => {
180
- let t = Ce(e.currentTarget.files);
181
+ let t = we(e.currentTarget.files);
181
182
  e.currentTarget.value = "", t.length && w?.(t);
182
183
  }
183
184
  })] }), v]
184
- }), u ? /* @__PURE__ */ U(r, {
185
+ }), u ? /* @__PURE__ */ H(r, {
185
186
  type: "button",
186
187
  size: "sm",
187
188
  variant: "secondary",
188
- icon: pe,
189
- "aria-label": te,
189
+ icon: me,
190
+ "aria-label": ne,
190
191
  onClick: () => c?.(),
191
192
  disabled: f
192
- }) : /* @__PURE__ */ U(r, {
193
+ }) : /* @__PURE__ */ H(r, {
193
194
  type: "submit",
194
195
  size: "sm",
195
196
  variant: "primary",
196
- icon: Y,
197
- "aria-label": ee,
197
+ icon: le,
198
+ "aria-label": te,
198
199
  loading: d,
199
- disabled: !X && !d
200
+ disabled: !J && !d
200
201
  })]
201
202
  })
202
203
  ]
203
204
  });
204
205
  });
205
- process.env.NODE_ENV !== "production" && (Te.displayName = "Composer");
206
+ process.env.NODE_ENV !== "production" && (Ee.displayName = "Composer");
206
207
  // src/components/playground/media-response.tsx
207
- var Ee = { kind: {
208
+ var De = { kind: {
208
209
  image: { classes: "" },
209
210
  audio: { classes: "" },
210
211
  video: { classes: "" }
211
- } }, De = { kind: "image" }, Oe = "relative min-w-0 overflow-hidden rounded-well bg-fill-1 image-outline", ke = "animate-pulse-quiet reduced:animate-none", Ae = { aspectRatio: "16 / 9" };
212
- function je({ item: e, label: t }) {
213
- return /* @__PURE__ */ U(r, {
212
+ } }, Oe = { kind: "image" }, ke = "relative min-w-0 overflow-hidden rounded-well bg-fill-1 image-outline", Ae = "animate-pulse-quiet reduced:animate-none", je = { aspectRatio: "16 / 9" };
213
+ function Me({ item: e, label: t }) {
214
+ return /* @__PURE__ */ H(r, {
214
215
  size: "sm",
215
216
  variant: "secondary",
216
- icon: de,
217
+ icon: Y,
217
218
  "aria-label": t,
218
219
  href: e.src,
219
220
  download: e.name
220
221
  });
221
222
  }
222
- function Me({ items: t, expected: n, waiting: r, t: i }) {
223
+ function Ne({ items: t, expected: n, waiting: r, t: i }) {
223
224
  let a = r ? Math.max(1, n) : t.length;
224
- return /* @__PURE__ */ U("ul", {
225
+ return /* @__PURE__ */ H("ul", {
225
226
  className: e("grid gap-8", a > 1 ? "grid-cols-2" : "max-w-480 grid-cols-1"),
226
227
  children: Array.from({ length: a }, (n, a) => {
227
228
  let o = r ? void 0 : t[a];
228
- return /* @__PURE__ */ U("li", {
229
- className: e(Oe, "aspect-square", !o && ke),
230
- children: o && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("img", {
229
+ return /* @__PURE__ */ H("li", {
230
+ className: e(ke, "aspect-square", !o && Ae),
231
+ children: o && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("img", {
231
232
  src: o.src,
232
233
  alt: o.alt ?? o.label ?? o.name,
233
234
  decoding: "async",
234
235
  className: "size-full object-contain"
235
- }), /* @__PURE__ */ U("span", {
236
+ }), /* @__PURE__ */ H("span", {
236
237
  className: "absolute right-8 bottom-8",
237
- children: /* @__PURE__ */ U(je, {
238
+ children: /* @__PURE__ */ H(Me, {
238
239
  item: o,
239
240
  label: i("mediaResponse.download", "Download {name}", { name: o.label ?? o.name })
240
241
  })
@@ -243,8 +244,8 @@ function Me({ items: t, expected: n, waiting: r, t: i }) {
243
244
  })
244
245
  });
245
246
  }
246
- function Ne(e) {
247
- let [t, n] = V(0);
247
+ function Pe(e) {
248
+ let [t, n] = B(0);
248
249
  return I(() => {
249
250
  if (!e) return;
250
251
  let t = Date.now();
@@ -253,8 +254,8 @@ function Ne(e) {
253
254
  return () => clearInterval(r);
254
255
  }, [e]), t;
255
256
  }
256
- var Pe = /* @__PURE__ */ P(function({ kind: n = "image", status: i = "done", items: a = [], expected: o = 1, progress: l, onCancel: u, error: d, onRetry: f, footer: p, "aria-label": m, className: h }, g) {
257
- let _ = t(), { formatNumber: v } = s(), y = m ?? _("responseView.response", "Response"), b = i === "pending" || i === "running", x = L(), S = Ne(b && n === "video"), C = B(i), [w, T] = V("");
257
+ var Fe = /* @__PURE__ */ P(function({ kind: n = "image", status: i = "done", items: a = [], expected: o = 1, progress: l, onCancel: u, error: d, onRetry: f, footer: p, "aria-label": m, className: h }, g) {
258
+ let _ = t(), { formatNumber: v } = s(), y = m ?? _("responseView.response", "Response"), b = i === "pending" || i === "running", x = L(), S = Pe(b && n === "video"), C = z(i), [w, T] = B("");
258
259
  I(() => {
259
260
  let e = C.current;
260
261
  C.current = i, b ? T("") : (e === "pending" || e === "running") && i === "done" && T(_("responseView.endedDone", "{label} finished", { label: y }));
@@ -264,137 +265,137 @@ var Pe = /* @__PURE__ */ P(function({ kind: n = "image", status: i = "done", ite
264
265
  y,
265
266
  _
266
267
  ]);
267
- let E = typeof l == "number" && Number.isFinite(l) ? Math.max(0, Math.min(100, l)) : null, D = n === "image" ? _("mediaResponse.makingImages", "Making the image") : n === "audio" ? _("mediaResponse.makingAudio", "Making the audio") : i === "pending" || E === null || E === 0 ? _("mediaResponse.queued", "Waiting for the provider to start the video") : _("mediaResponse.makingVideo", "Making the video, {percent}% done", { percent: v(Math.round(E)) }), O = p != null, k = _("responseView.retry", "Retry"), A = i === "done" && n === "video" && a[0], j = i === "done" && (f || A) ? /* @__PURE__ */ W("span", {
268
+ let E = typeof l == "number" && Number.isFinite(l) ? Math.max(0, Math.min(100, l)) : null, D = n === "image" ? _("mediaResponse.makingImages", "Making the image") : n === "audio" ? _("mediaResponse.makingAudio", "Making the audio") : i === "pending" || E === null || E === 0 ? _("mediaResponse.queued", "Waiting for the provider to start the video") : _("mediaResponse.makingVideo", "Making the video, {percent}% done", { percent: v(Math.round(E)) }), O = p != null, ee = _("responseView.retry", "Retry"), k = i === "done" && n === "video" && a[0], A = i === "done" && (f || k) ? /* @__PURE__ */ U("span", {
268
269
  "data-reply-actions": "",
269
- className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", A && f ? "starting:-ml-72" : "starting:-ml-36"),
270
- children: [A && /* @__PURE__ */ U(r, {
270
+ className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", k && f ? "starting:-ml-72" : "starting:-ml-36"),
271
+ children: [k && /* @__PURE__ */ H(r, {
271
272
  size: "sm",
272
273
  variant: "quiet",
273
- icon: de,
274
- "aria-label": _("mediaResponse.download", "Download {name}", { name: A.label ?? A.name }),
275
- href: A.src,
276
- download: A.name
277
- }), f && /* @__PURE__ */ U(r, {
274
+ icon: Y,
275
+ "aria-label": _("mediaResponse.download", "Download {name}", { name: k.label ?? k.name }),
276
+ href: k.src,
277
+ download: k.name
278
+ }), f && /* @__PURE__ */ H(r, {
278
279
  size: "sm",
279
280
  variant: "quiet",
280
281
  icon: q,
281
- "aria-label": k,
282
+ "aria-label": ee,
282
283
  onClick: f
283
284
  })]
284
- }) : null, M = a[0];
285
- return /* @__PURE__ */ W("article", {
285
+ }) : null, j = a[0];
286
+ return /* @__PURE__ */ U("article", {
286
287
  ref: g,
287
288
  "aria-label": y,
288
289
  "aria-busy": b || void 0,
289
290
  ...b ? { "aria-describedby": x } : {},
290
291
  className: e("flex min-w-0 flex-col gap-8", h),
291
292
  children: [
292
- n === "image" && (b || a.length > 0) && /* @__PURE__ */ U(Me, {
293
+ n === "image" && (b || a.length > 0) && /* @__PURE__ */ H(Ne, {
293
294
  items: a,
294
295
  expected: o,
295
296
  waiting: b,
296
297
  t: _
297
298
  }),
298
- n === "audio" && (b ? /* @__PURE__ */ U("div", {
299
+ n === "audio" && (b ? /* @__PURE__ */ H("div", {
299
300
  "aria-hidden": !0,
300
- className: e("h-56 rounded-pill bg-fill-1", ke)
301
- }) : M ? /* @__PURE__ */ W("div", {
301
+ className: e("h-56 rounded-pill bg-fill-1", Ae)
302
+ }) : j ? /* @__PURE__ */ U("div", {
302
303
  className: "flex h-56 min-w-0 items-center gap-8",
303
- children: [/* @__PURE__ */ U("audio", {
304
+ children: [/* @__PURE__ */ H("audio", {
304
305
  controls: !0,
305
306
  preload: "metadata",
306
- src: M.src,
307
- "aria-label": M.label ?? M.name,
307
+ src: j.src,
308
+ "aria-label": j.label ?? j.name,
308
309
  className: "h-40 min-w-0 flex-1"
309
- }), /* @__PURE__ */ U(je, {
310
- item: M,
311
- label: _("mediaResponse.download", "Download {name}", { name: M.label ?? M.name })
310
+ }), /* @__PURE__ */ H(Me, {
311
+ item: j,
312
+ label: _("mediaResponse.download", "Download {name}", { name: j.label ?? j.name })
312
313
  })]
313
314
  }) : null),
314
- n === "video" && (b || M ? /* @__PURE__ */ U("div", {
315
- className: e(Oe, b && "flex flex-col items-center justify-center gap-12 px-24"),
316
- style: Ae,
317
- children: b ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
315
+ n === "video" && (b || j ? /* @__PURE__ */ H("div", {
316
+ className: e(ke, b && "flex flex-col items-center justify-center gap-12 px-24"),
317
+ style: je,
318
+ children: b ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
318
319
  role: "progressbar",
319
320
  "aria-label": D,
320
321
  "aria-valuemin": 0,
321
322
  "aria-valuemax": 100,
322
323
  ...E === null ? {} : { "aria-valuenow": Math.round(E) },
323
324
  className: "h-6 w-full max-w-240 overflow-hidden rounded-pill bg-fill-2",
324
- children: /* @__PURE__ */ U("div", {
325
- className: e("h-full rounded-pill bg-fg-secondary", E === null && ke),
325
+ children: /* @__PURE__ */ H("div", {
326
+ className: e("h-full rounded-pill bg-fg-secondary", E === null && Ae),
326
327
  style: { width: `${E === null ? 100 : Math.max(4, E)}%` }
327
328
  })
328
- }), u && /* @__PURE__ */ U(r, {
329
+ }), u && /* @__PURE__ */ H(r, {
329
330
  size: "sm",
330
331
  variant: "secondary",
331
332
  onClick: u,
332
333
  children: _("mediaResponse.cancel", "Cancel")
333
- })] }) : M && /* @__PURE__ */ U("video", {
334
+ })] }) : j && /* @__PURE__ */ H("video", {
334
335
  controls: !0,
335
336
  playsInline: !0,
336
337
  preload: "metadata",
337
- src: M.src,
338
- "aria-label": M.label ?? M.name,
338
+ src: j.src,
339
+ "aria-label": j.label ?? j.name,
339
340
  className: "size-full object-contain"
340
341
  })
341
342
  }) : null),
342
- b && /* @__PURE__ */ W("p", {
343
+ b && /* @__PURE__ */ U("p", {
343
344
  id: x,
344
345
  className: "flex min-h-22 items-center gap-8 px-12 text-small text-fg-secondary tabular",
345
- children: [/* @__PURE__ */ U("span", {
346
+ children: [/* @__PURE__ */ H("span", {
346
347
  className: "min-w-0 truncate",
347
348
  children: D
348
- }), n === "video" && S > 0 && /* @__PURE__ */ U("span", {
349
+ }), n === "video" && S > 0 && /* @__PURE__ */ H("span", {
349
350
  className: "text-fg-tertiary",
350
351
  children: _("format.seconds", "{s} s", { s: v(S) })
351
352
  })]
352
353
  }),
353
- i === "done" && a.length === 0 && /* @__PURE__ */ U("span", {
354
+ i === "done" && a.length === 0 && /* @__PURE__ */ H("span", {
354
355
  className: "px-12 text-small text-fg-tertiary",
355
356
  children: _("mediaResponse.nothing", "The model returned nothing to show")
356
357
  }),
357
- i === "stopped" && /* @__PURE__ */ W("div", {
358
+ i === "stopped" && /* @__PURE__ */ U("div", {
358
359
  className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4 px-12",
359
- children: [/* @__PURE__ */ U("span", {
360
+ children: [/* @__PURE__ */ H("span", {
360
361
  className: "text-small text-fg-secondary",
361
362
  children: _("mediaResponse.stopped", "Stopped before it finished")
362
- }), f && /* @__PURE__ */ U(r, {
363
+ }), f && /* @__PURE__ */ H(r, {
363
364
  size: "sm",
364
365
  variant: "secondary",
365
366
  onClick: f,
366
367
  children: _("responseView.retry", "Retry")
367
368
  })]
368
369
  }),
369
- i === "error" && /* @__PURE__ */ W("div", {
370
+ i === "error" && /* @__PURE__ */ U("div", {
370
371
  className: "flex flex-col items-start gap-8 px-12",
371
- children: [/* @__PURE__ */ W("div", {
372
+ children: [/* @__PURE__ */ U("div", {
372
373
  role: "alert",
373
374
  className: "flex min-w-0 flex-col gap-4",
374
- children: [/* @__PURE__ */ U("span", {
375
+ children: [/* @__PURE__ */ H("span", {
375
376
  className: "text-small font-medium text-fg",
376
377
  children: _("responseView.noResponse", "No response")
377
- }), d && /* @__PURE__ */ U(c, {
378
+ }), d && /* @__PURE__ */ H(c, {
378
379
  text: d,
379
380
  size: "small",
380
381
  tone: "secondary",
381
382
  className: "max-w-prose min-w-0"
382
383
  })]
383
- }), f && /* @__PURE__ */ U(r, {
384
+ }), f && /* @__PURE__ */ H(r, {
384
385
  size: "sm",
385
386
  variant: "secondary",
386
387
  onClick: f,
387
388
  children: _("responseView.retry", "Retry")
388
389
  })]
389
390
  }),
390
- (O || j) && /* @__PURE__ */ W("div", {
391
+ (O || A) && /* @__PURE__ */ U("div", {
391
392
  className: "flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4",
392
- children: [j, O && /* @__PURE__ */ U("div", {
393
- className: e("min-w-0", j ? "px-8" : "px-12"),
393
+ children: [A, O && /* @__PURE__ */ H("div", {
394
+ className: e("min-w-0", A ? "px-8" : "px-12"),
394
395
  children: p
395
396
  })]
396
397
  }),
397
- /* @__PURE__ */ U("span", {
398
+ /* @__PURE__ */ H("span", {
398
399
  role: "status",
399
400
  className: "sr-only",
400
401
  children: w
@@ -402,25 +403,25 @@ var Pe = /* @__PURE__ */ P(function({ kind: n = "image", status: i = "done", ite
402
403
  ]
403
404
  });
404
405
  });
405
- process.env.NODE_ENV !== "production" && (Pe.displayName = "MediaResponse");
406
+ process.env.NODE_ENV !== "production" && (Fe.displayName = "MediaResponse");
406
407
  // src/components/playground/compare-grid.tsx
407
- var Fe = { divider: {
408
+ var Ie = { divider: {
408
409
  hairline: { classes: "hairline-l" },
409
410
  none: { classes: "" }
410
- } }, Ie = { divider: "hairline" }, Le = /* @__PURE__ */ ne({
411
+ } }, Le = { divider: "hairline" }, Re = /* @__PURE__ */ N({
411
412
  index: 0,
412
413
  count: 1,
413
414
  divider: "hairline",
414
415
  add: null,
415
416
  removing: () => {}
416
- }), Re = "button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex='-1'])";
417
- function ze(e, t) {
417
+ }), ze = "button:not([disabled]), [href], input:not([disabled]), select, textarea, [tabindex]:not([tabindex='-1'])";
418
+ function Be(e, t) {
418
419
  let n = e?.querySelector("header");
419
- ((t ? n?.querySelector(t) : null) ?? n?.querySelector(Re))?.focus({ preventScroll: !0 });
420
+ ((t ? n?.querySelector(t) : null) ?? n?.querySelector(ze))?.focus({ preventScroll: !0 });
420
421
  }
421
- var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, addLabel: o, max: s = 4, active: c, onActiveChange: l, divider: u = "hairline", className: d }, f) {
422
- let p = t(), m = te.toArray(n).filter(re), h = m.length, g = B(null), [_, v] = V(0), y = Math.min(c ?? _, Math.max(0, h - 1)), b = B(null), x = B(l);
423
- R(() => {
422
+ var Ve = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, addLabel: o, max: s = 4, active: c, onActiveChange: l, divider: u = "hairline", className: d }, f) {
423
+ let p = t(), m = re.toArray(n).filter(ie), h = m.length, g = z(null), [_, v] = B(0), y = Math.min(c ?? _, Math.max(0, h - 1)), b = z(null), x = z(l);
424
+ oe(() => {
424
425
  x.current = l;
425
426
  });
426
427
  let S = F((e) => {
@@ -439,19 +440,19 @@ var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, ad
439
440
  I(() => {
440
441
  c !== void 0 && S(c);
441
442
  }, [c, S]);
442
- let w = B(h), T = B(!1), E = B(null);
443
- R(() => {
443
+ let w = z(h), T = z(!1), E = z(null);
444
+ oe(() => {
444
445
  let e = g.current?.children;
445
- if (h > w.current) v(h - 1), x.current?.(h - 1), S(h - 1), T.current && ze(e?.[h - 1]);
446
+ if (h > w.current) v(h - 1), x.current?.(h - 1), S(h - 1), T.current && Be(e?.[h - 1]);
446
447
  else if (h < w.current && E.current !== null) {
447
448
  let t = Math.min(E.current, h - 1);
448
- ze(e?.[t], "[data-compare-remove]");
449
+ Be(e?.[t], "[data-compare-remove]");
449
450
  }
450
451
  T.current = !1, E.current = null, w.current = h;
451
452
  }, [h, S]);
452
453
  let D = F((e) => {
453
454
  E.current = e;
454
- }, []), [O, k] = V(null), A = F(() => {
455
+ }, []), [O, ee] = B(null), k = F(() => {
455
456
  let e = g.current;
456
457
  if (!e) return;
457
458
  let t = e.scrollWidth - e.clientWidth - e.scrollLeft;
@@ -461,19 +462,19 @@ var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, ad
461
462
  start: e.scrollLeft <= 1,
462
463
  end: t <= 1
463
464
  };
464
- k((e) => e && e.overflow === n.overflow && e.start === n.start && e.end === n.end ? e : n);
465
+ ee((e) => e && e.overflow === n.overflow && e.start === n.start && e.end === n.end ? e : n);
465
466
  }, []);
466
- R(() => {
467
+ oe(() => {
467
468
  let e = g.current;
468
469
  if (!e || typeof ResizeObserver > "u") return;
469
- A();
470
- let t = new ResizeObserver(A);
470
+ k();
471
+ let t = new ResizeObserver(k);
471
472
  t.observe(e);
472
473
  for (let n of e.children) t.observe(n);
473
474
  return () => t.disconnect();
474
- }, [A, h]);
475
- let j = () => {
476
- A();
475
+ }, [k, h]);
476
+ let A = () => {
477
+ k();
477
478
  let e = g.current, t = e?.children[0];
478
479
  if (!e || !t || !t.offsetWidth) return;
479
480
  let n = Math.max(0, Math.min(h - 1, Math.round(e.scrollLeft / t.offsetWidth)));
@@ -482,81 +483,81 @@ var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, ad
482
483
  b.current = null;
483
484
  }
484
485
  n !== y && (v(n), l?.(n));
485
- }, M = () => {
486
+ }, j = () => {
486
487
  b.current = null;
487
- }, N = h >= s, ee = a ? /* @__PURE__ */ U(r, {
488
+ }, M = h >= s, te = a ? /* @__PURE__ */ H(r, {
488
489
  variant: "ghost",
489
- icon: oe,
490
+ icon: W,
490
491
  "aria-label": o ?? p("compareGrid.addModel", "Add model"),
491
492
  size: "sm",
492
493
  onClick: () => {
493
494
  T.current = !0, a();
494
495
  },
495
- disabled: N,
496
- ...N ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: s }) } : {}
497
- }) : null, ne = m[y]?.props.label ?? "", P = O?.overflow ? "flex" : "flex md:hidden", ie = O?.overflow ? O.start : y === 0, L = O?.overflow ? O.end : y >= h - 1, z = {
496
+ disabled: M,
497
+ ...M ? { disabledReason: p("compareGrid.compareUpTo", "Compare up to {max} at once", { max: s }) } : {}
498
+ }) : null, ne = m[y]?.props.label ?? "", N = O?.overflow ? "flex" : "flex md:hidden", P = O?.overflow ? O.start : y === 0, ae = O?.overflow ? O.end : y >= h - 1, L = {
498
499
  index: y + 1,
499
500
  count: h
500
501
  };
501
- return /* @__PURE__ */ W("div", {
502
+ return /* @__PURE__ */ U("div", {
502
503
  ref: f,
503
504
  role: "group",
504
505
  "aria-label": i,
505
506
  className: e("flex h-full min-h-0 min-w-0 flex-col", d),
506
- children: [(h > 1 || O?.overflow) && /* @__PURE__ */ W("div", {
507
- className: e("h-44 shrink-0 items-center gap-4 px-24 hairline-b", P),
507
+ children: [(h > 1 || O?.overflow) && /* @__PURE__ */ U("div", {
508
+ className: e("h-44 shrink-0 items-center gap-4 px-24 hairline-b", N),
508
509
  children: [
509
- /* @__PURE__ */ U(r, {
510
+ /* @__PURE__ */ H(r, {
510
511
  variant: "ghost",
511
512
  icon: K,
512
513
  "aria-label": p("compareGrid.previousColumn", "Previous column"),
513
514
  size: "sm",
514
- disabled: ie,
515
+ disabled: P,
515
516
  onClick: () => C(y - 1)
516
517
  }),
517
- /* @__PURE__ */ W("span", {
518
+ /* @__PURE__ */ U("span", {
518
519
  "aria-live": "polite",
519
520
  className: "min-w-0 flex-1 truncate text-center text-small text-fg-secondary tabular",
520
- children: [/* @__PURE__ */ U("span", {
521
+ children: [/* @__PURE__ */ H("span", {
521
522
  className: "sr-only",
522
523
  children: p("compareGrid.namedPosition", "{label}, {index} of {count}", {
523
524
  label: ne,
524
- ...z
525
+ ...L
525
526
  })
526
- }), /* @__PURE__ */ U("span", {
527
+ }), /* @__PURE__ */ H("span", {
527
528
  "aria-hidden": !0,
528
- children: p("compareGrid.position", "{index} of {count}", z)
529
+ children: p("compareGrid.position", "{index} of {count}", L)
529
530
  })]
530
531
  }),
531
- /* @__PURE__ */ U(r, {
532
+ /* @__PURE__ */ H(r, {
532
533
  variant: "ghost",
533
- icon: J,
534
+ icon: ce,
534
535
  "aria-label": p("compareGrid.nextColumn", "Next column"),
535
536
  size: "sm",
536
- disabled: L,
537
+ disabled: ae,
537
538
  onClick: () => C(y + 1)
538
539
  }),
539
- ee && /* @__PURE__ */ U("span", {
540
+ te && /* @__PURE__ */ H("span", {
540
541
  className: "contents md:hidden",
541
- children: ee
542
+ children: te
542
543
  })
543
544
  ]
544
- }), /* @__PURE__ */ U("div", {
545
+ }), /* @__PURE__ */ H("div", {
545
546
  className: "flex min-h-0 min-w-0 flex-1",
546
- children: /* @__PURE__ */ U("div", {
547
+ children: /* @__PURE__ */ H("div", {
547
548
  ref: g,
548
- onScroll: j,
549
- onPointerDown: M,
550
- onWheel: M,
551
- onTouchStart: M,
552
- onKeyDown: M,
549
+ onScroll: A,
550
+ onPointerDown: j,
551
+ onWheel: j,
552
+ onTouchStart: j,
553
+ onKeyDown: j,
553
554
  className: "relative min-h-0 min-w-0 flex-1 compare-grid",
554
- children: m.map((e, t) => /* @__PURE__ */ U(Le.Provider, {
555
+ children: m.map((e, t) => /* @__PURE__ */ H(Re.Provider, {
555
556
  value: {
556
557
  index: t,
557
558
  count: h,
558
559
  divider: u,
559
- add: t === h - 1 ? ee : null,
560
+ add: t === h - 1 ? te : null,
560
561
  removing: D
561
562
  },
562
563
  children: e
@@ -565,14 +566,14 @@ var Be = /* @__PURE__ */ P(function({ children: n, "aria-label": i, onAdd: a, ad
565
566
  })]
566
567
  });
567
568
  });
568
- process.env.NODE_ENV !== "production" && (Be.displayName = "CompareGrid");
569
- var Ve = /* @__PURE__ */ new Set([
569
+ process.env.NODE_ENV !== "production" && (Ve.displayName = "CompareGrid");
570
+ var He = /* @__PURE__ */ new Set([
570
571
  "ArrowUp",
571
572
  "PageUp",
572
573
  "Home"
573
574
  ]);
574
- function He(e, t) {
575
- let n = B(null), r = B(null), i = B(!0);
575
+ function Ue(e, t) {
576
+ let n = z(null), r = z(null), i = z(!0);
576
577
  return I(() => {
577
578
  let t = n.current, a = r.current;
578
579
  if (!e || !t || !a || typeof ResizeObserver > "u") return;
@@ -585,7 +586,7 @@ function He(e, t) {
585
586
  }, f = (e) => {
586
587
  e.deltaY < 0 && u();
587
588
  }, p = (e) => {
588
- Ve.has(e.key) && u();
589
+ He.has(e.key) && u();
589
590
  }, m = (e) => {
590
591
  s = e.touches[0]?.clientY ?? null;
591
592
  }, h = (e) => {
@@ -597,7 +598,7 @@ function He(e, t) {
597
598
  return t.addEventListener("scroll", d, { passive: !0 }), t.addEventListener("wheel", f, { passive: !0 }), t.addEventListener("keydown", p), t.addEventListener("touchstart", m, { passive: !0 }), t.addEventListener("touchmove", h, { passive: !0 }), g.observe(a), g.observe(t), () => {
598
599
  t.removeEventListener("scroll", d), t.removeEventListener("wheel", f), t.removeEventListener("keydown", p), t.removeEventListener("touchstart", m), t.removeEventListener("touchmove", h), g.disconnect();
599
600
  };
600
- }, [e]), R(() => {
601
+ }, [e]), oe(() => {
601
602
  let r = n.current;
602
603
  e && r && t !== void 0 && (i.current = !0, r.scrollTop = r.scrollHeight);
603
604
  }, [e, t]), {
@@ -605,55 +606,55 @@ function He(e, t) {
605
606
  content: r
606
607
  };
607
608
  }
608
- var Ue = /* @__PURE__ */ P(function({ label: n, header: i, actions: a, children: o, footer: s, onRemove: c, removeLabel: l, stickToEnd: u = !0, followKey: d, className: f }, p) {
609
- let m = t(), { index: h, count: g, divider: _, add: v, removing: y } = ie(Le), { body: b, content: x } = He(u, d);
610
- return /* @__PURE__ */ W("section", {
609
+ var We = /* @__PURE__ */ P(function({ label: n, header: i, actions: a, children: o, footer: s, onRemove: c, removeLabel: l, stickToEnd: u = !0, followKey: d, className: f }, p) {
610
+ let m = t(), { index: h, count: g, divider: _, add: v, removing: y } = ae(Re), { body: b, content: x } = Ue(u, d);
611
+ return /* @__PURE__ */ U("section", {
611
612
  ref: p,
612
613
  "aria-label": n,
613
- className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", h > 0 && Fe.divider[_].classes, f),
614
+ className: e("row-span-3 grid min-h-0 min-w-0 snap-start snap-always grid-rows-subgrid", h > 0 && Ie.divider[_].classes, f),
614
615
  children: [
615
- /* @__PURE__ */ W("header", {
616
+ /* @__PURE__ */ U("header", {
616
617
  className: "flex h-52 min-w-0 items-center gap-4 px-24 hairline-b",
617
618
  children: [
618
- /* @__PURE__ */ U("div", {
619
+ /* @__PURE__ */ H("div", {
619
620
  className: "flex min-w-0 flex-1 items-center",
620
621
  children: i
621
622
  }),
622
623
  a,
623
- c && g > 1 && /* @__PURE__ */ U(r, {
624
+ c && g > 1 && /* @__PURE__ */ H(r, {
624
625
  variant: "ghost",
625
626
  "data-compare-remove": "",
626
- icon: le,
627
+ icon: fe,
627
628
  "aria-label": l ?? m("compareGrid.remove", "Remove {label}", { label: n }),
628
629
  size: "sm",
629
630
  onClick: () => {
630
631
  y(h), c();
631
632
  }
632
633
  }),
633
- v && /* @__PURE__ */ U("span", {
634
+ v && /* @__PURE__ */ H("span", {
634
635
  className: e("flex shrink-0", g > 1 && "max-md:hidden"),
635
636
  children: v
636
637
  })
637
638
  ]
638
639
  }),
639
- /* @__PURE__ */ U("div", {
640
+ /* @__PURE__ */ H("div", {
640
641
  className: "min-h-0 min-w-0 compare-thread",
641
- children: /* @__PURE__ */ U("div", {
642
+ children: /* @__PURE__ */ H("div", {
642
643
  ref: b,
643
644
  tabIndex: 0,
644
645
  "aria-label": m("compareGrid.thread", "{label} thread", { label: n }),
645
646
  role: "region",
646
647
  className: "relative h-full min-h-0 overflow-y-auto overscroll-contain outline-none scrollbar-quiet scroll-fade-y",
647
- children: /* @__PURE__ */ U("div", {
648
+ children: /* @__PURE__ */ H("div", {
648
649
  ref: x,
649
650
  className: "flex min-h-full flex-col px-24 pt-16 pb-24",
650
651
  children: o
651
652
  })
652
653
  })
653
654
  }),
654
- s != null && /* @__PURE__ */ U("footer", {
655
+ s != null && /* @__PURE__ */ H("footer", {
655
656
  className: "flex min-h-44 min-w-0 items-start px-24 pt-12 pb-12",
656
- children: /* @__PURE__ */ U("div", {
657
+ children: /* @__PURE__ */ H("div", {
657
658
  className: "min-w-0 px-12",
658
659
  children: s
659
660
  })
@@ -661,12 +662,12 @@ var Ue = /* @__PURE__ */ P(function({ label: n, header: i, actions: a, children:
661
662
  ]
662
663
  });
663
664
  });
664
- process.env.NODE_ENV !== "production" && (Ue.displayName = "CompareGrid.Column");
665
- var We = /* @__PURE__ */ Object.assign(Be, { Column: Ue }), Ge = { state: {
665
+ process.env.NODE_ENV !== "production" && (We.displayName = "CompareGrid.Column");
666
+ var Ge = /* @__PURE__ */ Object.assign(Ve, { Column: We }), Ke = { state: {
666
667
  done: { classes: "" },
667
668
  live: { classes: "" }
668
- } }, Ke = { state: "done" };
669
- function qe(e) {
669
+ } }, qe = { state: "done" };
670
+ function Je(e) {
670
671
  let t = e.trim().split("\n");
671
672
  for (let e = t.length - 1; e >= 0; e--) {
672
673
  let n = (t[e] ?? "").replace(/[*_`#>]+/g, "").trim();
@@ -674,12 +675,12 @@ function qe(e) {
674
675
  }
675
676
  return "";
676
677
  }
677
- var Je = /* @__PURE__ */ P(function({ text: e = "", live: n = !1, duration: r, title: i, hint: a, open: o, defaultOpen: l, onOpenChange: d, children: f, className: p, "data-force": m }, h) {
678
+ var Ye = /* @__PURE__ */ P(function({ text: e = "", live: n = !1, duration: r, title: i, hint: a, open: o, defaultOpen: l, onOpenChange: d, children: f, className: p, "data-force": m }, h) {
678
679
  let g = t(), { formatDuration: _ } = s(), v = i ?? (!n && r !== void 0 ? g("responseView.thoughtFor", "Thought for {duration}", { duration: _(r) }) : g("responseView.thinking", "Thinking"));
679
- return /* @__PURE__ */ U(u, {
680
+ return /* @__PURE__ */ H(u, {
680
681
  ref: h,
681
682
  heading: v,
682
- preview: a ?? (n ? qe(e) : ""),
683
+ preview: a ?? (n ? Je(e) : ""),
683
684
  previewHidden: a === void 0,
684
685
  live: n,
685
686
  open: o,
@@ -687,7 +688,7 @@ var Je = /* @__PURE__ */ P(function({ text: e = "", live: n = !1, duration: r, t
687
688
  onOpenChange: d,
688
689
  className: p,
689
690
  "data-force": m,
690
- children: f ?? /* @__PURE__ */ U(c, {
691
+ children: f ?? /* @__PURE__ */ H(c, {
691
692
  text: e,
692
693
  size: "small",
693
694
  tone: "secondary",
@@ -698,44 +699,44 @@ var Je = /* @__PURE__ */ P(function({ text: e = "", live: n = !1, duration: r, t
698
699
  })
699
700
  });
700
701
  });
701
- process.env.NODE_ENV !== "production" && (Je.displayName = "Reasoning");
702
+ process.env.NODE_ENV !== "production" && (Ye.displayName = "Reasoning");
702
703
  // src/components/playground/response-view.tsx
703
- var Ye = { status: {
704
+ var Xe = { status: {
704
705
  pending: { classes: "" },
705
706
  streaming: { classes: "" },
706
707
  done: { classes: "" },
707
708
  stopped: { classes: "" },
708
709
  incomplete: { classes: "" },
709
710
  error: { classes: "" }
710
- } }, Xe = { status: "done" };
711
- function Ze(e, t) {
711
+ } }, Ze = { status: "done" };
712
+ function Qe(e, t) {
712
713
  return t === "max_output_tokens" ? e("responseView.outputLimit", "Stopped at the output limit") : t === "content_filter" ? e("responseView.contentFilter", "Stopped by the provider's content filter") : e("responseView.incomplete", "The model ended the response early");
713
714
  }
714
- function Qe(e, t) {
715
- let [n, r] = V(""), i = B(e);
715
+ function $e(e, t) {
716
+ let [n, r] = B(""), i = z(e);
716
717
  return I(() => {
717
718
  let n = i.current;
718
719
  i.current = e, e === "pending" || e === "streaming" ? r("") : (n === "pending" || n === "streaming") && e !== "error" && r(t);
719
720
  }, [e, t]), n;
720
721
  }
721
- var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "done", reasoningDuration: o, reasoningOpen: s, defaultReasoningOpen: u, onReasoningOpenChange: d, incompleteReason: f, error: p, onRetry: m, footer: h, "aria-label": g, className: _ }, v) {
722
- let y = t(), b = g ?? y("responseView.response", "Response"), x = L(), S = a === "pending" || a === "streaming", C = n.trim() !== "", w = !!i && i.trim() !== "", T = S && w && !C, E = Qe(a, a === "stopped" ? y("responseView.endedStopped", "{label} stopped", { label: b }) : a === "incomplete" ? y("responseView.endedIncomplete", "{label}: {reason}", {
722
+ var et = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "done", reasoningDuration: o, reasoningOpen: s, defaultReasoningOpen: u, onReasoningOpenChange: d, incompleteReason: f, error: p, onRetry: m, footer: h, "aria-label": g, className: _ }, v) {
723
+ let y = t(), b = g ?? y("responseView.response", "Response"), x = L(), S = a === "pending" || a === "streaming", C = n.trim() !== "", w = !!i && i.trim() !== "", T = S && w && !C, E = $e(a, a === "stopped" ? y("responseView.endedStopped", "{label} stopped", { label: b }) : a === "incomplete" ? y("responseView.endedIncomplete", "{label}: {reason}", {
723
724
  label: b,
724
- reason: Ze(y, f)
725
- }) : y("responseView.endedDone", "{label} finished", { label: b })), D = y("responseView.retry", "Retry"), O = m ? /* @__PURE__ */ U(r, {
725
+ reason: Qe(y, f)
726
+ }) : y("responseView.endedDone", "{label} finished", { label: b })), D = y("responseView.retry", "Retry"), O = m ? /* @__PURE__ */ H(r, {
726
727
  size: "sm",
727
728
  variant: "secondary",
728
729
  onClick: m,
729
730
  children: D
730
- }) : null, k = y("responseView.copy", "Copy response"), A = h != null, j = a === "done" && (C || m) ? /* @__PURE__ */ W("span", {
731
+ }) : null, ee = y("responseView.copy", "Copy response"), k = h != null, A = a === "done" && (C || m) ? /* @__PURE__ */ U("span", {
731
732
  "data-reply-actions": "",
732
733
  className: e("flex items-center gap-x-4 transition-arrive reduced:transition-none starting:opacity-0", C && m ? "starting:-ml-72" : "starting:-ml-36"),
733
- children: [C && /* @__PURE__ */ U(l, {
734
+ children: [C && /* @__PURE__ */ H(l, {
734
735
  value: n,
735
736
  size: "sm",
736
737
  variant: "quiet",
737
- label: k
738
- }), m && /* @__PURE__ */ U(r, {
738
+ label: ee
739
+ }), m && /* @__PURE__ */ H(r, {
739
740
  size: "sm",
740
741
  variant: "quiet",
741
742
  icon: q,
@@ -743,14 +744,14 @@ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "d
743
744
  onClick: m
744
745
  })]
745
746
  }) : null;
746
- return /* @__PURE__ */ W("article", {
747
+ return /* @__PURE__ */ U("article", {
747
748
  ref: v,
748
749
  "aria-label": b,
749
750
  "aria-busy": S || void 0,
750
751
  "aria-describedby": x,
751
752
  className: e("flex min-w-0 flex-col gap-8", _),
752
753
  children: [
753
- w && /* @__PURE__ */ U(Je, {
754
+ w && /* @__PURE__ */ H(Ye, {
754
755
  text: i,
755
756
  live: T,
756
757
  duration: o,
@@ -758,7 +759,7 @@ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "d
758
759
  defaultOpen: u,
759
760
  onOpenChange: d
760
761
  }),
761
- C ? /* @__PURE__ */ U(c, {
762
+ C ? /* @__PURE__ */ H(c, {
762
763
  text: n,
763
764
  size: "lg",
764
765
  streaming: S,
@@ -766,22 +767,22 @@ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "d
766
767
  wrapCode: !0,
767
768
  className: "markdown-text-inset"
768
769
  }) : null,
769
- (a === "stopped" || a === "incomplete") && /* @__PURE__ */ W("div", {
770
+ (a === "stopped" || a === "incomplete") && /* @__PURE__ */ U("div", {
770
771
  className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4 px-12",
771
- children: [/* @__PURE__ */ U("span", {
772
+ children: [/* @__PURE__ */ H("span", {
772
773
  className: "text-small text-fg-secondary",
773
- children: a === "incomplete" ? Ze(y, f) : C ? y("responseView.stopped", "Stopped") : y("responseView.stoppedBeforeResponse", "Stopped before a response")
774
+ children: a === "incomplete" ? Qe(y, f) : C ? y("responseView.stopped", "Stopped") : y("responseView.stoppedBeforeResponse", "Stopped before a response")
774
775
  }), O]
775
776
  }),
776
- a === "error" && /* @__PURE__ */ W("div", {
777
+ a === "error" && /* @__PURE__ */ U("div", {
777
778
  className: "flex flex-col items-start gap-8 px-12",
778
- children: [/* @__PURE__ */ W("div", {
779
+ children: [/* @__PURE__ */ U("div", {
779
780
  role: "alert",
780
781
  className: "flex min-w-0 flex-col gap-4",
781
- children: [/* @__PURE__ */ U("span", {
782
+ children: [/* @__PURE__ */ H("span", {
782
783
  className: "text-small font-medium text-fg",
783
784
  children: C ? y("responseView.failedPartway", "The response failed partway") : y("responseView.noResponse", "No response")
784
- }), p && /* @__PURE__ */ U(c, {
785
+ }), p && /* @__PURE__ */ H(c, {
785
786
  text: p,
786
787
  size: "small",
787
788
  tone: "secondary",
@@ -789,24 +790,24 @@ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "d
789
790
  })]
790
791
  }), O]
791
792
  }),
792
- a === "done" && !C && /* @__PURE__ */ U("span", {
793
+ a === "done" && !C && /* @__PURE__ */ H("span", {
793
794
  className: "px-12 text-small text-fg-tertiary",
794
795
  children: y("responseView.noText", "The model returned no text")
795
796
  }),
796
- (j || A) && /* @__PURE__ */ W("div", {
797
+ (A || k) && /* @__PURE__ */ U("div", {
797
798
  "data-reply-tools": "",
798
- className: e("flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4", j && "pl-4"),
799
- children: [j, A && /* @__PURE__ */ U("div", {
800
- className: e("min-w-0", j ? "px-8" : "px-12"),
799
+ className: e("flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4", A && "pl-4"),
800
+ children: [A, k && /* @__PURE__ */ H("div", {
801
+ className: e("min-w-0", A ? "px-8" : "px-12"),
801
802
  children: h
802
803
  })]
803
804
  }),
804
- /* @__PURE__ */ U("span", {
805
+ /* @__PURE__ */ H("span", {
805
806
  id: x,
806
807
  className: "sr-only",
807
808
  children: a === "pending" ? y("responseView.waiting", "Waiting for the response") : a === "streaming" ? y("responseView.responding", "Responding") : ""
808
809
  }),
809
- /* @__PURE__ */ U("span", {
810
+ /* @__PURE__ */ H("span", {
810
811
  role: "status",
811
812
  className: "sr-only",
812
813
  children: E
@@ -814,34 +815,34 @@ var $e = /* @__PURE__ */ P(function({ text: n = "", reasoning: i, status: a = "d
814
815
  ]
815
816
  });
816
817
  });
817
- process.env.NODE_ENV !== "production" && ($e.displayName = "ResponseView");
818
- var et = {
818
+ process.env.NODE_ENV !== "production" && (et.displayName = "ResponseView");
819
+ var tt = {
819
820
  2: "line-clamp-2",
820
821
  3: "line-clamp-3",
821
822
  4: "line-clamp-4",
822
823
  6: "line-clamp-6"
823
- }, tt = /* @__PURE__ */ P(function({ children: n, attachments: i = [], actions: a, maxLines: o = 4, "aria-label": s, className: c }, l) {
824
- let u = t(), f = s ?? u("userMessage.prompt", "Prompt"), p = u("userMessage.showAll", "Show all"), m = u("userMessage.showLess", "Show less"), [h, g] = V(!1), _ = L(), v = B(null), y = d(v, o > 0 && !h), b = n !== "" && n != null && n !== !1;
825
- return /* @__PURE__ */ W("div", {
824
+ }, nt = /* @__PURE__ */ P(function({ children: n, attachments: i = [], actions: a, maxLines: o = 4, "aria-label": s, className: c }, l) {
825
+ let u = t(), f = s ?? u("userMessage.prompt", "Prompt"), p = u("userMessage.showAll", "Show all"), m = u("userMessage.showLess", "Show less"), [h, g] = B(!1), _ = L(), v = z(null), y = d(v, o > 0 && !h), b = n !== "" && n != null && n !== !1;
826
+ return /* @__PURE__ */ U("div", {
826
827
  ref: l,
827
828
  role: "group",
828
829
  "aria-label": f,
829
830
  className: e("flex min-w-0 flex-col items-end gap-2", c),
830
831
  children: [
831
- /* @__PURE__ */ U(_e, {
832
+ /* @__PURE__ */ H(ve, {
832
833
  items: i,
833
834
  align: "end",
834
835
  className: b ? "mb-6" : void 0
835
836
  }),
836
- b && /* @__PURE__ */ U("p", {
837
+ b && /* @__PURE__ */ H("p", {
837
838
  id: _,
838
839
  ref: v,
839
- className: e("max-w-prose min-w-0 rounded-frame bg-fill-1 px-16 py-10 text-body-lg whitespace-pre-wrap wrap-break-word text-fg", o !== 0 && !h && et[o]),
840
+ className: e("max-w-prose min-w-0 rounded-frame bg-fill-1 px-16 py-10 text-body-lg whitespace-pre-wrap wrap-break-word text-fg", o !== 0 && !h && tt[o]),
840
841
  children: n
841
842
  }),
842
- (y || h || a) && /* @__PURE__ */ W("div", {
843
+ (y || h || a) && /* @__PURE__ */ U("div", {
843
844
  className: "flex items-center gap-4",
844
- children: [(y || h) && /* @__PURE__ */ U(r, {
845
+ children: [(y || h) && /* @__PURE__ */ H(r, {
845
846
  size: "sm",
846
847
  variant: "quiet",
847
848
  "aria-expanded": h,
@@ -854,25 +855,25 @@ var et = {
854
855
  ]
855
856
  });
856
857
  });
857
- process.env.NODE_ENV !== "production" && (tt.displayName = "UserMessage");
858
- var nt = /* @__PURE__ */ P(function({ children: t, className: n }, r) {
859
- return /* @__PURE__ */ U("div", {
858
+ process.env.NODE_ENV !== "production" && (nt.displayName = "UserMessage");
859
+ var rt = /* @__PURE__ */ P(function({ children: t, className: n }, r) {
860
+ return /* @__PURE__ */ H("div", {
860
861
  ref: r,
861
862
  className: e("flex min-w-0 flex-col gap-32", n),
862
863
  children: t
863
864
  });
864
865
  });
865
- process.env.NODE_ENV !== "production" && (nt.displayName = "Thread");
866
+ process.env.NODE_ENV !== "production" && (rt.displayName = "Thread");
866
867
  // src/components/playground/response-metrics.tsx
867
- var rt = { size: {
868
+ var it = { size: {
868
869
  sm: { classes: "text-caption gap-x-16 gap-y-2" },
869
870
  md: { classes: "text-small gap-x-20 gap-y-4" }
870
- } }, it = { size: "sm" };
871
- function at(e, { formatDuration: t } = f()) {
871
+ } }, at = { size: "sm" };
872
+ function ot(e, { formatDuration: t } = f()) {
872
873
  return !Number.isFinite(e) || e < 0 ? "—" : t(e, { precise: !0 });
873
874
  }
874
- function ot(e) {
875
- let [t, n] = V(() => Date.now());
875
+ function st(e) {
876
+ let [t, n] = B(() => Date.now());
876
877
  return I(() => {
877
878
  if (e === void 0) return;
878
879
  n(Date.now());
@@ -880,42 +881,42 @@ function ot(e) {
880
881
  return () => clearInterval(t);
881
882
  }, [e]), e === void 0 ? void 0 : Math.max(0, t - e);
882
883
  }
883
- function st(e, { formatPrice: t, formatUSD: n }) {
884
+ function ct(e, { formatPrice: t, formatUSD: n }) {
884
885
  return /[1-9]/.test(e) ? t(e) : n("0", { decimals: 0 });
885
886
  }
886
887
  function $(e) {
887
888
  return typeof e == "number" && Number.isFinite(e);
888
889
  }
889
- function ct({ label: e, children: t }) {
890
- return /* @__PURE__ */ W("div", {
890
+ function lt({ label: e, children: t }) {
891
+ return /* @__PURE__ */ U("div", {
891
892
  className: "flex items-baseline gap-6 whitespace-nowrap",
892
- children: [/* @__PURE__ */ U("dt", {
893
+ children: [/* @__PURE__ */ H("dt", {
893
894
  className: "text-fg-tertiary",
894
895
  children: e
895
- }), /* @__PURE__ */ U("dd", {
896
+ }), /* @__PURE__ */ H("dd", {
896
897
  className: "text-fg-secondary tabular",
897
898
  children: t
898
899
  })]
899
900
  });
900
901
  }
901
- var lt = /* @__PURE__ */ P(function({ timeToFirstToken: n, duration: r, inputTokens: i, outputTokens: a, reasoningTokens: o, live: c = !1, startedAt: l, cost: u, costKnown: d = !0, formatCost: f, size: p = "sm", className: m }, h) {
902
- let g = t(), _ = s(), { formatDuration: v, formatNumber: y } = _, b = ot(c && l !== void 0 && !$(r) ? l : void 0), x = $(i) || $(a), S = !d && !c, C = S || u != null && u !== "", w = e("flex min-w-0 flex-wrap items-baseline", rt.size[p].classes, m);
903
- return !x && !C && !$(n) && !$(r) && !$(o) && b === void 0 ? /* @__PURE__ */ U("dl", {
902
+ var ut = /* @__PURE__ */ P(function({ timeToFirstToken: n, duration: r, inputTokens: i, outputTokens: a, reasoningTokens: o, live: c = !1, startedAt: l, cost: u, costKnown: d = !0, formatCost: f, size: p = "sm", className: m }, h) {
903
+ let g = t(), _ = s(), { formatDuration: v, formatNumber: y } = _, b = st(c && l !== void 0 && !$(r) ? l : void 0), x = $(i) || $(a), S = !d && !c, C = S || u != null && u !== "", w = e("flex min-w-0 flex-wrap items-baseline", it.size[p].classes, m);
904
+ return !x && !C && !$(n) && !$(r) && !$(o) && b === void 0 ? /* @__PURE__ */ H("dl", {
904
905
  ref: h,
905
906
  "aria-label": g("responseMetrics.metrics", "Metrics"),
906
907
  className: e(w, p === "sm" ? "min-h-16" : "min-h-18")
907
- }) : /* @__PURE__ */ W("dl", {
908
+ }) : /* @__PURE__ */ U("dl", {
908
909
  ref: h,
909
910
  "aria-label": g("responseMetrics.metrics", "Metrics"),
910
911
  className: w,
911
912
  children: [
912
- $(n) && /* @__PURE__ */ U(ct, {
913
+ $(n) && /* @__PURE__ */ H(lt, {
913
914
  label: g("responseMetrics.firstToken", "First token"),
914
- children: at(n, _)
915
+ children: ot(n, _)
915
916
  }),
916
- ($(r) || b !== void 0) && /* @__PURE__ */ U(ct, {
917
+ ($(r) || b !== void 0) && /* @__PURE__ */ H(lt, {
917
918
  label: g("responseMetrics.total", "Total"),
918
- children: $(r) ? at(r, _) : /* @__PURE__ */ U("span", {
919
+ children: $(r) ? ot(r, _) : /* @__PURE__ */ H("span", {
919
920
  className: "text-fg-tertiary",
920
921
  children: ((e) => e < 1e4 ? g("format.seconds", "{s} s", { s: y(Math.floor(e / 100) / 10, {
921
922
  minimumFractionDigits: 1,
@@ -923,35 +924,35 @@ var lt = /* @__PURE__ */ P(function({ timeToFirstToken: n, duration: r, inputTok
923
924
  }) }) : e < 6e4 ? g("format.seconds", "{s} s", { s: y(Math.floor(e / 1e3)) }) : v(Math.floor(e / 1e3) * 1e3))(b ?? 0)
924
925
  })
925
926
  }),
926
- x && /* @__PURE__ */ U(ct, {
927
+ x && /* @__PURE__ */ H(lt, {
927
928
  label: g("responseMetrics.tokens", "Tokens"),
928
929
  children: g("responseMetrics.tokensValue", "{input} in · {output} out", {
929
930
  input: $(i) ? y(i) : "—",
930
931
  output: $(a) ? y(a) : "—"
931
932
  })
932
933
  }),
933
- $(o) && /* @__PURE__ */ U(ct, {
934
+ $(o) && /* @__PURE__ */ H(lt, {
934
935
  label: g("responseMetrics.reasoning", "Reasoning"),
935
936
  children: y(o)
936
937
  }),
937
- C && /* @__PURE__ */ U(ct, {
938
+ C && /* @__PURE__ */ H(lt, {
938
939
  label: g("responseMetrics.cost", "Cost"),
939
- children: S ? g("responseMetrics.costUnknown", "Unknown") : (f ?? ((e) => st(e, _)))(u ?? "0")
940
+ children: S ? g("responseMetrics.costUnknown", "Unknown") : (f ?? ((e) => ct(e, _)))(u ?? "0")
940
941
  })
941
942
  ]
942
943
  });
943
944
  });
944
- process.env.NODE_ENV !== "production" && (lt.displayName = "ResponseMetrics");
945
+ process.env.NODE_ENV !== "production" && (ut.displayName = "ResponseMetrics");
945
946
  // src/components/playground/parameter-panel.tsx
946
- var ut = { layout: {
947
+ var dt = { layout: {
947
948
  popover: { classes: "w-full gap-20" },
948
949
  panel: { classes: "w-full gap-24" }
949
- } }, dt = { layout: "popover" }, ft = [
950
+ } }, ft = { layout: "popover" }, pt = [
950
951
  "1024x1024",
951
952
  "1536x1024",
952
953
  "1024x1536"
953
954
  ];
954
- function pt(e, t) {
955
+ function mt(e, t) {
955
956
  switch (t) {
956
957
  case "auto": return e("parameterPanel.qualityAuto", "Automatic");
957
958
  case "low": return e("parameterPanel.qualityLow", "Low");
@@ -962,8 +963,8 @@ function pt(e, t) {
962
963
  default: return t;
963
964
  }
964
965
  }
965
- var mt = 4;
966
- function ht(e) {
966
+ var ht = 4;
967
+ function gt(e) {
967
968
  return [
968
969
  {
969
970
  value: "none",
@@ -995,23 +996,23 @@ function ht(e) {
995
996
  }
996
997
  ];
997
998
  }
998
- function gt({ label: n, value: r, unset: i, min: a, max: o, step: c, digits: l, disabled: u, onChange: d }) {
999
+ function _t({ label: n, value: r, unset: i, min: a, max: o, step: c, digits: l, disabled: u, onChange: d }) {
999
1000
  let f = t(), { formatNumber: p } = s(), m = p(r, {
1000
1001
  minimumFractionDigits: l,
1001
1002
  maximumFractionDigits: l
1002
1003
  });
1003
- return /* @__PURE__ */ W("div", {
1004
+ return /* @__PURE__ */ U("div", {
1004
1005
  className: "flex flex-col gap-8",
1005
- children: [/* @__PURE__ */ W("div", {
1006
+ children: [/* @__PURE__ */ U("div", {
1006
1007
  className: "flex items-baseline justify-between gap-12",
1007
- children: [/* @__PURE__ */ U("span", {
1008
+ children: [/* @__PURE__ */ H("span", {
1008
1009
  className: e("text-small font-medium", u ? "text-fg-disabled" : "text-fg"),
1009
1010
  children: n
1010
- }), /* @__PURE__ */ U("span", {
1011
+ }), /* @__PURE__ */ H("span", {
1011
1012
  className: e("text-small tabular", i ? "text-fg-tertiary" : "text-fg-secondary"),
1012
1013
  children: i ? f("parameterPanel.valueDefault", "{value} (default)", { value: m }) : m
1013
1014
  })]
1014
- }), /* @__PURE__ */ U(b, {
1015
+ }), /* @__PURE__ */ H(b, {
1015
1016
  "aria-label": n,
1016
1017
  min: a,
1017
1018
  max: o,
@@ -1026,23 +1027,23 @@ function gt({ label: n, value: r, unset: i, min: a, max: o, step: c, digits: l,
1026
1027
  })]
1027
1028
  });
1028
1029
  }
1029
- var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, instructions: o = !0, sampling: c = !0, reasoning: l = !1, maxOutputTokensLimit: u, text: d = !0, image: f, voices: g = !1, duration: v = !1, translate: b = !1, disabled: x = !1, layout: S = "popover", className: C }, w) {
1030
+ var vt = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, instructions: o = !0, sampling: c = !0, reasoning: l = !1, maxOutputTokensLimit: u, text: d = !0, image: f, voices: g = !1, duration: v = !1, translate: b = !1, disabled: x = !1, layout: S = "popover", className: C }, w) {
1030
1031
  let T = t(), { formatNumber: E } = s(), D = (e) => i({
1031
1032
  ...n,
1032
1033
  ...e
1033
- }), O = ht(T), k = l === !0 ? O : Array.isArray(l) ? O.filter((e) => l.includes(e.value)) : [], A = n.temperature !== void 0 || n.topP !== void 0 || n.maxOutputTokens !== void 0 || n.reasoningEffort !== void 0 || n.reasoningSummary !== void 0 || n.imageSize !== void 0 || n.imageCount !== void 0 || n.imageQuality !== void 0 || n.voice !== void 0 || n.durationSeconds !== void 0 || n.translate !== void 0, j = T("parameterPanel.modelDefault", "Model default"), M = (e) => {
1034
+ }), O = gt(T), ee = l === !0 ? O : Array.isArray(l) ? O.filter((e) => l.includes(e.value)) : [], k = n.temperature !== void 0 || n.topP !== void 0 || n.maxOutputTokens !== void 0 || n.reasoningEffort !== void 0 || n.reasoningSummary !== void 0 || n.imageSize !== void 0 || n.imageCount !== void 0 || n.imageQuality !== void 0 || n.voice !== void 0 || n.durationSeconds !== void 0 || n.translate !== void 0, A = T("parameterPanel.modelDefault", "Model default"), j = (e) => {
1034
1035
  let [t, n] = e.split("x"), r = t === n ? T("parameterPanel.sizeSquare", "Square") : Number(t) > Number(n) ? T("parameterPanel.sizeLandscape", "Landscape") : T("parameterPanel.sizePortrait", "Portrait");
1035
1036
  return T("parameterPanel.sizeValue", "{shape}, {width} × {height}", {
1036
1037
  shape: r,
1037
1038
  width: t ?? "",
1038
1039
  height: n ?? ""
1039
1040
  });
1040
- }, N = f ? Array.from({ length: Math.min(mt, Math.max(1, f.maxCount)) }, (e, t) => t + 1) : [];
1041
- return /* @__PURE__ */ W("div", {
1041
+ }, M = f ? Array.from({ length: Math.min(ht, Math.max(1, f.maxCount)) }, (e, t) => t + 1) : [];
1042
+ return /* @__PURE__ */ U("div", {
1042
1043
  ref: w,
1043
- className: e("flex min-w-0 flex-col", ut.layout[S].classes, C),
1044
+ className: e("flex min-w-0 flex-col", dt.layout[S].classes, C),
1044
1045
  children: [
1045
- o && /* @__PURE__ */ U(h, {
1046
+ o && /* @__PURE__ */ H(h, {
1046
1047
  label: T("parameterPanel.systemInstructions", "System instructions"),
1047
1048
  rows: 3,
1048
1049
  maxRows: 8,
@@ -1051,7 +1052,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1051
1052
  disabled: x,
1052
1053
  onChange: (e) => D({ instructions: e.target.value === "" ? void 0 : e.target.value })
1053
1054
  }),
1054
- c && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(gt, {
1055
+ c && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(_t, {
1055
1056
  label: T("parameterPanel.temperature", "Temperature"),
1056
1057
  value: n.temperature ?? a?.temperature ?? 1,
1057
1058
  unset: n.temperature === void 0,
@@ -1061,7 +1062,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1061
1062
  digits: 2,
1062
1063
  disabled: x,
1063
1064
  onChange: (e) => D({ temperature: e })
1064
- }), /* @__PURE__ */ U(gt, {
1065
+ }), /* @__PURE__ */ H(_t, {
1065
1066
  label: T("parameterPanel.topP", "Top P"),
1066
1067
  value: n.topP ?? a?.topP ?? 1,
1067
1068
  unset: n.topP === void 0,
@@ -1072,7 +1073,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1072
1073
  disabled: x,
1073
1074
  onChange: (e) => D({ topP: e })
1074
1075
  })] }),
1075
- d && /* @__PURE__ */ U(m, {
1076
+ d && /* @__PURE__ */ H(m, {
1076
1077
  label: T("parameterPanel.maxOutputTokens", "Max output tokens"),
1077
1078
  size: "sm",
1078
1079
  placeholder: T("parameterPanel.modelDefault", "Model default"),
@@ -1090,7 +1091,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1090
1091
  D({ maxOutputTokens: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : Math.round(t) });
1091
1092
  }
1092
1093
  }),
1093
- k.length > 0 && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(y, {
1094
+ ee.length > 0 && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(y, {
1094
1095
  label: T("parameterPanel.reasoningEffort", "Reasoning effort"),
1095
1096
  size: "sm",
1096
1097
  fullWidth: !0,
@@ -1099,14 +1100,14 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1099
1100
  options: [{
1100
1101
  value: "default",
1101
1102
  label: T("parameterPanel.modelDefault", "Model default")
1102
- }, ...k],
1103
+ }, ...ee],
1103
1104
  onValueChange: (e) => D({ reasoningEffort: e === "default" ? void 0 : e })
1104
- }), /* @__PURE__ */ W("div", {
1105
+ }), /* @__PURE__ */ U("div", {
1105
1106
  className: "flex flex-col gap-8",
1106
- children: [/* @__PURE__ */ U("span", {
1107
+ children: [/* @__PURE__ */ H("span", {
1107
1108
  className: e("text-small font-medium", x ? "text-fg-disabled" : "text-fg"),
1108
1109
  children: T("parameterPanel.reasoningSummary", "Reasoning summary")
1109
- }), /* @__PURE__ */ U(_, {
1110
+ }), /* @__PURE__ */ H(_, {
1110
1111
  "aria-label": T("parameterPanel.reasoningSummary", "Reasoning summary"),
1111
1112
  size: "sm",
1112
1113
  fullWidth: !0,
@@ -1133,7 +1134,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1133
1134
  onValueChange: (e) => D({ reasoningSummary: e === "auto" ? void 0 : e })
1134
1135
  })]
1135
1136
  })] }),
1136
- f?.sizes && /* @__PURE__ */ U(y, {
1137
+ f?.sizes && /* @__PURE__ */ H(y, {
1137
1138
  label: T("parameterPanel.imageSize", "Image size"),
1138
1139
  size: "sm",
1139
1140
  fullWidth: !0,
@@ -1141,26 +1142,26 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1141
1142
  value: n.imageSize ?? "default",
1142
1143
  options: [{
1143
1144
  value: "default",
1144
- label: j
1145
- }, ...ft.map((e) => ({
1145
+ label: A
1146
+ }, ...pt.map((e) => ({
1146
1147
  value: e,
1147
- label: M(e)
1148
+ label: j(e)
1148
1149
  }))],
1149
1150
  onValueChange: (e) => D({ imageSize: e === "default" ? void 0 : e })
1150
1151
  }),
1151
- N.length > 1 && /* @__PURE__ */ U(y, {
1152
+ M.length > 1 && /* @__PURE__ */ H(y, {
1152
1153
  label: T("parameterPanel.imageCount", "Images per prompt"),
1153
1154
  size: "sm",
1154
1155
  fullWidth: !0,
1155
1156
  disabled: x,
1156
1157
  value: String(n.imageCount ?? 1),
1157
- options: N.map((e) => ({
1158
+ options: M.map((e) => ({
1158
1159
  value: String(e),
1159
1160
  label: E(e)
1160
1161
  })),
1161
1162
  onValueChange: (e) => D({ imageCount: e === "1" ? void 0 : Number(e) })
1162
1163
  }),
1163
- f && f.qualities.length > 0 && /* @__PURE__ */ U(y, {
1164
+ f && f.qualities.length > 0 && /* @__PURE__ */ H(y, {
1164
1165
  label: T("parameterPanel.imageQuality", "Image quality"),
1165
1166
  size: "sm",
1166
1167
  fullWidth: !0,
@@ -1168,14 +1169,14 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1168
1169
  value: n.imageQuality ?? "default",
1169
1170
  options: [{
1170
1171
  value: "default",
1171
- label: j
1172
+ label: A
1172
1173
  }, ...f.qualities.map((e) => ({
1173
1174
  value: e,
1174
- label: pt(T, e)
1175
+ label: mt(T, e)
1175
1176
  }))],
1176
1177
  onValueChange: (e) => D({ imageQuality: e === "default" ? void 0 : e })
1177
1178
  }),
1178
- Array.isArray(g) && g.length > 0 ? /* @__PURE__ */ U(y, {
1179
+ Array.isArray(g) && g.length > 0 ? /* @__PURE__ */ H(y, {
1179
1180
  label: T("parameterPanel.voice", "Voice"),
1180
1181
  size: "sm",
1181
1182
  fullWidth: !0,
@@ -1186,7 +1187,7 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1186
1187
  label: e
1187
1188
  })),
1188
1189
  onValueChange: (e) => D({ voice: e === g[0] ? void 0 : e })
1189
- }) : g ? /* @__PURE__ */ U(p, {
1190
+ }) : g ? /* @__PURE__ */ H(p, {
1190
1191
  label: T("parameterPanel.voice", "Voice"),
1191
1192
  size: "sm",
1192
1193
  placeholder: T("parameterPanel.voicePlaceholder", "A voice name or id"),
@@ -1194,10 +1195,10 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1194
1195
  value: n.voice ?? "",
1195
1196
  onChange: (e) => D({ voice: e.target.value.trim() === "" ? void 0 : e.target.value })
1196
1197
  }) : null,
1197
- v && /* @__PURE__ */ U(m, {
1198
+ v && /* @__PURE__ */ H(m, {
1198
1199
  label: T("parameterPanel.duration", "Length in seconds"),
1199
1200
  size: "sm",
1200
- placeholder: j,
1201
+ placeholder: A,
1201
1202
  align: "start",
1202
1203
  min: "0.5",
1203
1204
  step: "0.5",
@@ -1208,12 +1209,12 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1208
1209
  D({ durationSeconds: e.trim() === "" || !Number.isFinite(t) || t <= 0 ? void 0 : t });
1209
1210
  }
1210
1211
  }),
1211
- b && /* @__PURE__ */ W("div", {
1212
+ b && /* @__PURE__ */ U("div", {
1212
1213
  className: "flex flex-col gap-8",
1213
- children: [/* @__PURE__ */ U("span", {
1214
+ children: [/* @__PURE__ */ H("span", {
1214
1215
  className: e("text-small font-medium", x ? "text-fg-disabled" : "text-fg"),
1215
1216
  children: T("parameterPanel.transcript", "Transcript")
1216
- }), /* @__PURE__ */ U(_, {
1217
+ }), /* @__PURE__ */ H(_, {
1217
1218
  "aria-label": T("parameterPanel.transcript", "Transcript"),
1218
1219
  size: "sm",
1219
1220
  fullWidth: !0,
@@ -1229,12 +1230,12 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1229
1230
  onValueChange: (e) => D({ translate: e === "english" || void 0 })
1230
1231
  })]
1231
1232
  }),
1232
- /* @__PURE__ */ U("div", {
1233
+ /* @__PURE__ */ H("div", {
1233
1234
  className: "flex justify-end",
1234
- children: /* @__PURE__ */ U(r, {
1235
+ children: /* @__PURE__ */ H(r, {
1235
1236
  size: "sm",
1236
1237
  variant: "ghost",
1237
- disabled: x || !A,
1238
+ disabled: x || !k,
1238
1239
  onClick: () => i(n.instructions === void 0 ? {} : { instructions: n.instructions }),
1239
1240
  children: T("parameterPanel.resetToDefaults", "Reset to defaults")
1240
1241
  })
@@ -1242,41 +1243,41 @@ var _t = /* @__PURE__ */ P(function({ value: n, onValueChange: i, defaults: a, i
1242
1243
  ]
1243
1244
  });
1244
1245
  });
1245
- process.env.NODE_ENV !== "production" && (_t.displayName = "ParameterPanel");
1246
- var vt = /* @__PURE__ */ P(function({ trigger: e, title: n, open: i, defaultOpen: a, onOpenChange: o, side: s = "bottom", align: c = "end", ...l }, u) {
1246
+ process.env.NODE_ENV !== "production" && (vt.displayName = "ParameterPanel");
1247
+ var yt = /* @__PURE__ */ P(function({ trigger: e, title: n, open: i, defaultOpen: a, onOpenChange: o, side: s = "bottom", align: c = "end", ...l }, u) {
1247
1248
  let d = t();
1248
- if (!e) return /* @__PURE__ */ U(_t, {
1249
+ if (!e) return /* @__PURE__ */ H(vt, {
1249
1250
  ref: u,
1250
1251
  ...l
1251
1252
  });
1252
1253
  let f = n ?? d("parameterPopover.parameters", "Parameters");
1253
- return /* @__PURE__ */ W(g, {
1254
+ return /* @__PURE__ */ U(g, {
1254
1255
  trapFocus: !0,
1255
1256
  ...i === void 0 ? {} : { open: i },
1256
1257
  ...a === void 0 ? {} : { defaultOpen: a },
1257
1258
  ...o ? { onOpenChange: o } : {},
1258
- children: [/* @__PURE__ */ U(g.Trigger, { children: e }), /* @__PURE__ */ U(g.Content, {
1259
+ children: [/* @__PURE__ */ H(g.Trigger, { children: e }), /* @__PURE__ */ H(g.Content, {
1259
1260
  ref: u,
1260
1261
  "aria-label": f,
1261
1262
  side: s,
1262
1263
  align: c,
1263
1264
  className: "w-320 max-w-(--available-width)",
1264
- children: /* @__PURE__ */ W("div", {
1265
+ children: /* @__PURE__ */ U("div", {
1265
1266
  className: "relative",
1266
1267
  children: [
1267
- /* @__PURE__ */ U("p", {
1268
+ /* @__PURE__ */ H("p", {
1268
1269
  className: "mb-16 flex min-h-32 items-center pr-40 text-body font-semibold text-fg",
1269
1270
  children: f
1270
1271
  }),
1271
- /* @__PURE__ */ U(_t, {
1272
+ /* @__PURE__ */ H(vt, {
1272
1273
  ...l,
1273
1274
  layout: "popover"
1274
1275
  }),
1275
- /* @__PURE__ */ U("div", {
1276
+ /* @__PURE__ */ H("div", {
1276
1277
  className: "absolute top-0 right-0",
1277
- children: /* @__PURE__ */ U(g.Close, { children: /* @__PURE__ */ U(r, {
1278
+ children: /* @__PURE__ */ H(g.Close, { children: /* @__PURE__ */ H(r, {
1278
1279
  variant: "ghost",
1279
- icon: le,
1280
+ icon: fe,
1280
1281
  "aria-label": d("parameterPopover.close", "Close parameters"),
1281
1282
  size: "sm"
1282
1283
  }) })
@@ -1286,53 +1287,54 @@ var vt = /* @__PURE__ */ P(function({ trigger: e, title: n, open: i, defaultOpen
1286
1287
  })]
1287
1288
  });
1288
1289
  });
1289
- process.env.NODE_ENV !== "production" && (vt.displayName = "ParameterPanel");
1290
+ process.env.NODE_ENV !== "production" && (yt.displayName = "ParameterPanel");
1290
1291
  // src/components/playground/model-picker.tsx
1291
- var yt = {
1292
+ var bt = {
1292
1293
  ghost: "header",
1293
1294
  default: "default"
1294
- }, bt = { appearance: {
1295
+ }, xt = { appearance: {
1295
1296
  ghost: { classes: v.appearance.header.classes },
1296
1297
  default: { classes: v.appearance.default.classes }
1297
- } }, xt = { appearance: "ghost" }, St = "", Ct = "*";
1298
- function wt({ option: t, query: n, providerLabel: r }) {
1298
+ } }, St = { appearance: "ghost" }, Ct = "", wt = "*";
1299
+ function Tt({ option: t, query: n, providerLabel: r }) {
1299
1300
  let { formatContext: i } = s(), a = t.model ?? t.value, o = [t.context ? i(t.context) : "", t.price ?? ""].filter(Boolean).join(" · ");
1300
- return /* @__PURE__ */ W(H, { children: [
1301
- r !== void 0 && /* @__PURE__ */ U("span", {
1301
+ return /* @__PURE__ */ U(V, { children: [
1302
+ r !== void 0 && /* @__PURE__ */ H("span", {
1302
1303
  "aria-hidden": !0,
1303
1304
  className: "flex",
1304
- children: /* @__PURE__ */ U(A, {
1305
+ children: /* @__PURE__ */ H(M, {
1305
1306
  provider: t.provider,
1306
- name: r
1307
+ name: r,
1308
+ model: a
1307
1309
  })
1308
1310
  }),
1309
- /* @__PURE__ */ W("span", {
1311
+ /* @__PURE__ */ U("span", {
1310
1312
  className: "flex min-w-0 flex-1 items-baseline gap-8",
1311
- children: [/* @__PURE__ */ U("span", {
1313
+ children: [/* @__PURE__ */ H("span", {
1312
1314
  className: "min-w-0 shrink truncate",
1313
- children: /* @__PURE__ */ U(T, {
1315
+ children: /* @__PURE__ */ H(E, {
1314
1316
  text: t.name ?? a,
1315
1317
  query: n
1316
1318
  })
1317
- }), t.name && t.name !== a && /* @__PURE__ */ U("span", {
1319
+ }), t.name && t.name !== a && /* @__PURE__ */ H("span", {
1318
1320
  className: "min-w-0 flex-1 truncate mono text-small font-regular text-fg-tertiary",
1319
- children: /* @__PURE__ */ U(T, {
1321
+ children: /* @__PURE__ */ H(E, {
1320
1322
  text: a,
1321
1323
  query: n
1322
1324
  })
1323
1325
  })]
1324
1326
  }),
1325
- t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ U(N, {
1327
+ t.capabilities && t.capabilities.length > 0 && /* @__PURE__ */ H(te, {
1326
1328
  capabilities: t.capabilities,
1327
1329
  className: "hidden sm:flex"
1328
1330
  }),
1329
- (t.note ?? o) && /* @__PURE__ */ U("span", {
1330
- className: e("shrink-0 text-caption font-regular tabular", t.note ? "text-fg-secondary" : "hidden text-fg-tertiary sm:inline"),
1331
+ (t.note ?? o) && /* @__PURE__ */ H("span", {
1332
+ className: e("shrink-0 text-caption font-regular", x(t.note ?? o), t.note ? "text-fg-secondary" : "hidden text-fg-tertiary sm:inline"),
1331
1333
  children: t.note ?? o
1332
1334
  })
1333
1335
  ] });
1334
1336
  }
1335
- function Tt(e, t, n) {
1337
+ function Et(e, t, n) {
1336
1338
  let r = e.model ?? e.value, i = t(e.provider);
1337
1339
  return {
1338
1340
  value: e.value,
@@ -1342,7 +1344,7 @@ function Tt(e, t, n) {
1342
1344
  i,
1343
1345
  e.provider
1344
1346
  ],
1345
- render: ({ query: t }) => /* @__PURE__ */ U(wt, {
1347
+ render: ({ query: t }) => /* @__PURE__ */ H(Tt, {
1346
1348
  option: e,
1347
1349
  query: t,
1348
1350
  ...n ? { providerLabel: i } : {}
@@ -1350,34 +1352,34 @@ function Tt(e, t, n) {
1350
1352
  ...e.disabled ? { disabled: !0 } : {}
1351
1353
  };
1352
1354
  }
1353
- function Et(e, t, n, r) {
1355
+ function Dt(e, t, n, r) {
1354
1356
  return n ? t.flatMap((t) => {
1355
1357
  let n = e.filter((e) => e.provider === t);
1356
1358
  return n.length ? [{
1357
1359
  id: `provider:${t}`,
1358
1360
  label: r(t),
1359
- leading: /* @__PURE__ */ U("span", {
1361
+ leading: /* @__PURE__ */ H("span", {
1360
1362
  "aria-hidden": !0,
1361
1363
  className: "flex",
1362
- children: /* @__PURE__ */ U(A, {
1364
+ children: /* @__PURE__ */ H(M, {
1363
1365
  provider: t,
1364
1366
  name: r(t),
1365
1367
  size: "sm"
1366
1368
  })
1367
1369
  }),
1368
1370
  count: n.length,
1369
- items: n.map((e) => Tt(e, r, !1))
1371
+ items: n.map((e) => Et(e, r, !1))
1370
1372
  }] : [];
1371
1373
  }) : [{
1372
1374
  id: "models",
1373
- items: e.map((e) => Tt(e, r, !0))
1375
+ items: e.map((e) => Et(e, r, !0))
1374
1376
  }];
1375
1377
  }
1376
- function Dt(e, t) {
1377
- let r = n(), i = z(() => new Map(t.map((e) => [e.id, e])), [t]), a = F((e) => j(e, i.get(e)?.name), [i]);
1378
+ function Ot(e, t) {
1379
+ let r = n(), i = R(() => new Map(t.map((e) => [e.id, e])), [t]), a = F((e) => j(e, i.get(e)?.name), [i]);
1378
1380
  return {
1379
1381
  nameOf: a,
1380
- providerOrder: z(() => [...new Set(e.map((e) => e.provider))].sort((e, t) => Number(!!i.get(t)?.connected) - Number(!!i.get(e)?.connected) || a(e).localeCompare(a(t), r, { sensitivity: "base" })), [
1382
+ providerOrder: R(() => [...new Set(e.map((e) => e.provider))].sort((e, t) => Number(!!i.get(t)?.connected) - Number(!!i.get(e)?.connected) || a(e).localeCompare(a(t), r, { sensitivity: "base" })), [
1381
1383
  e,
1382
1384
  i,
1383
1385
  a,
@@ -1385,225 +1387,225 @@ function Dt(e, t) {
1385
1387
  ])
1386
1388
  };
1387
1389
  }
1388
- function Ot(e, { providers: t = [], groupByProvider: n } = {}) {
1389
- let { nameOf: r, providerOrder: i } = Dt(e, t), a = n ?? i.length > 1;
1390
- return z(() => Et(e, i, a, r), [
1390
+ function kt(e, { providers: t = [], groupByProvider: n } = {}) {
1391
+ let { nameOf: r, providerOrder: i } = Ot(e, t), a = n ?? i.length > 1;
1392
+ return R(() => Dt(e, i, a, r), [
1391
1393
  e,
1392
1394
  i,
1393
1395
  a,
1394
1396
  r
1395
1397
  ]);
1396
1398
  }
1397
- var kt = /* @__PURE__ */ P(function(n, r) {
1398
- let { options: i, providers: a = [], recent: o = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: f = "sm", fullWidth: p, disabled: m, invalid: h, open: g, onOpenChange: _, "data-force": v, className: b, label: T, description: j, error: N, optional: ee, required: te, layout: ne } = n, P = t(), { formatNumber: re } = s(), F = D(), ie = O(n), [I, L] = V(!1), R = g ?? I, B = (e) => {
1399
- g === void 0 && L(e), _?.(e);
1400
- }, [ae, oe] = V(() => n.defaultValue ?? (n.multiple ? [] : null)), G = n.value === void 0 ? ae : n.value, K = Array.isArray(G) ? G : G ? [G] : [], q = n.multiple ? void 0 : n.allLabel, [J, se] = V(""), [Y, ce] = V(null), [X, le] = V(!1), [ue, de] = V(R);
1401
- R !== ue && (de(R), R && (se(""), ce(null)));
1402
- let fe = z(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: Z, providerOrder: pe } = Dt(i, a), me = c ?? pe.length > 1, he = i.some((e) => e.deprecated && !K.includes(e.value)), ge = K.join("\0"), _e = z(() => {
1403
- let e = new Set(ge.split("\0")), t = (t) => (X || !t.deprecated || e.has(t.value)) && (!Y || t.provider === Y), n = [];
1404
- q && !Y && n.push({
1399
+ var At = /* @__PURE__ */ P(function(n, r) {
1400
+ let { options: i, providers: a = [], recent: o = [], groupByProvider: c, placeholder: l, "aria-label": u, appearance: d = "ghost", size: f = "sm", fullWidth: p, disabled: m, invalid: h, open: g, onOpenChange: _, "data-force": v, className: b, label: x, description: E, error: j, optional: te, required: ne, layout: re } = n, N = t(), { formatNumber: P } = s(), ie = O(), F = ee(n), [ae, I] = B(!1), L = g ?? ae, oe = (e) => {
1401
+ g === void 0 && I(e), _?.(e);
1402
+ }, [z, se] = B(() => n.defaultValue ?? (n.multiple ? [] : null)), W = n.value === void 0 ? z : n.value, G = Array.isArray(W) ? W : W ? [W] : [], K = n.multiple ? void 0 : n.allLabel, [q, ce] = B(""), [J, le] = B(null), [ue, de] = B(!1), [fe, pe] = B(L);
1403
+ L !== fe && (pe(L), L && (ce(""), le(null)));
1404
+ let Y = R(() => new Map(i.map((e) => [e.value, e])), [i]), { nameOf: X, providerOrder: Z } = Ot(i, a), me = c ?? Z.length > 1, he = i.some((e) => e.deprecated && !G.includes(e.value)), ge = G.join("\0"), _e = R(() => {
1405
+ let e = new Set(ge.split("\0")), t = (t) => (ue || !t.deprecated || e.has(t.value)) && (!J || t.provider === J), n = [];
1406
+ K && !J && n.push({
1405
1407
  id: "all",
1406
1408
  items: [{
1407
- value: St,
1408
- label: q
1409
+ value: Ct,
1410
+ label: K
1409
1411
  }]
1410
1412
  });
1411
- let r = J.trim() || Y ? [] : o.flatMap((e) => fe.get(e) && t(fe.get(e)) ? [Tt(fe.get(e), Z, !0)] : []);
1413
+ let r = q.trim() || J ? [] : o.flatMap((e) => Y.get(e) && t(Y.get(e)) ? [Et(Y.get(e), X, !0)] : []);
1412
1414
  return r.length && n.push({
1413
1415
  id: "recent",
1414
- label: P("modelPicker.recent", "Recent"),
1416
+ label: N("modelPicker.recent", "Recent"),
1415
1417
  items: r
1416
- }), [...n, ...Et(i.filter(t), pe, me, Z)];
1418
+ }), [...n, ...Dt(i.filter(t), Z, me, X)];
1417
1419
  }, [
1418
1420
  i,
1419
- pe,
1421
+ Z,
1420
1422
  me,
1421
1423
  o,
1422
- fe,
1423
- J,
1424
1424
  Y,
1425
- X,
1426
- ge,
1427
1425
  q,
1428
- P,
1429
- Z
1426
+ J,
1427
+ ue,
1428
+ ge,
1429
+ K,
1430
+ N,
1431
+ X
1430
1432
  ]), ve = (e) => {
1431
1433
  if (n.multiple) {
1432
- let t = K.includes(e) ? K.filter((t) => t !== e) : [...K, e];
1433
- n.value === void 0 && oe(t), n.onValueChange?.(t);
1434
- } else n.value === void 0 && oe(e === St ? null : e), n.onValueChange?.(e), B(!1);
1435
- }, ye = z(() => {
1436
- let e = J.trim(), t = new Set(ge.split("\0")), n = /* @__PURE__ */ new Map();
1434
+ let t = G.includes(e) ? G.filter((t) => t !== e) : [...G, e];
1435
+ n.value === void 0 && se(t), n.onValueChange?.(t);
1436
+ } else n.value === void 0 && se(e === Ct ? null : e), n.onValueChange?.(e), oe(!1);
1437
+ }, ye = R(() => {
1438
+ let e = q.trim(), t = new Set(ge.split("\0")), n = /* @__PURE__ */ new Map();
1437
1439
  for (let r of i) {
1438
- if (r.deprecated && !X && !t.has(r.value)) continue;
1440
+ if (r.deprecated && !ue && !t.has(r.value)) continue;
1439
1441
  let i = r.model ?? r.value;
1440
- e && x(e, [
1442
+ e && S(e, [
1441
1443
  r.name ?? i,
1442
1444
  i,
1443
- Z(r.provider),
1445
+ X(r.provider),
1444
1446
  r.provider
1445
1447
  ]) <= 0 || n.set(r.provider, (n.get(r.provider) ?? 0) + 1);
1446
1448
  }
1447
- return pe.filter((e) => n.has(e) || e === Y).map((e) => ({
1449
+ return Z.filter((e) => n.has(e) || e === J).map((e) => ({
1448
1450
  id: e,
1449
1451
  count: n.get(e) ?? 0
1450
1452
  }));
1451
1453
  }, [
1452
1454
  i,
1453
- pe,
1454
- J,
1455
- X,
1455
+ Z,
1456
+ q,
1457
+ ue,
1456
1458
  ge,
1457
- Y,
1458
- Z
1459
- ]), be = me && pe.length > 1 ? /* @__PURE__ */ U(y, {
1460
- "aria-label": P("modelPicker.provider", "Provider"),
1459
+ J,
1460
+ X
1461
+ ]), be = me && Z.length > 1 ? /* @__PURE__ */ H(y, {
1462
+ "aria-label": N("modelPicker.provider", "Provider"),
1461
1463
  size: "sm",
1462
1464
  appearance: "ghost",
1463
- value: Y ?? Ct,
1464
- onValueChange: (e) => ce(e === Ct ? null : e),
1465
+ value: J ?? wt,
1466
+ onValueChange: (e) => le(e === wt ? null : e),
1465
1467
  options: [{
1466
- value: Ct,
1467
- label: P("modelPicker.everyProvider", "All providers")
1468
+ value: wt,
1469
+ label: N("modelPicker.everyProvider", "All providers")
1468
1470
  }, ...ye.map(({ id: e, count: t }) => ({
1469
1471
  value: e,
1470
- textValue: Z(e),
1471
- label: /* @__PURE__ */ W("span", {
1472
+ textValue: X(e),
1473
+ label: /* @__PURE__ */ U("span", {
1472
1474
  className: "flex min-w-0 items-center gap-8",
1473
1475
  children: [
1474
- /* @__PURE__ */ U("span", {
1476
+ /* @__PURE__ */ H("span", {
1475
1477
  "aria-hidden": !0,
1476
1478
  className: "flex shrink-0",
1477
- children: /* @__PURE__ */ U(A, {
1479
+ children: /* @__PURE__ */ H(M, {
1478
1480
  provider: e,
1479
1481
  size: "sm"
1480
1482
  })
1481
1483
  }),
1482
- /* @__PURE__ */ U("span", {
1484
+ /* @__PURE__ */ H("span", {
1483
1485
  className: "min-w-0 truncate",
1484
- children: Z(e)
1486
+ children: X(e)
1485
1487
  }),
1486
- /* @__PURE__ */ U("span", {
1488
+ /* @__PURE__ */ H("span", {
1487
1489
  className: "shrink-0 text-fg-tertiary tabular",
1488
- children: re(t)
1490
+ children: P(t)
1489
1491
  })
1490
1492
  ]
1491
1493
  })
1492
1494
  }))]
1493
- }) : null, xe = be || he ? /* @__PURE__ */ W(H, { children: [be, he && /* @__PURE__ */ U(E, {
1495
+ }) : null, xe = be || he ? /* @__PURE__ */ U(V, { children: [be, he && /* @__PURE__ */ H(D, {
1494
1496
  size: "sm",
1495
- label: P("modelPicker.showDeprecated", "Show deprecated"),
1496
- checked: X,
1497
- onCheckedChange: le
1498
- })] }) : void 0, Q = K[0] ? fe.get(K[0]) : void 0, Se = n.multiple ? Q ? K.length === 1 ? /* @__PURE__ */ U(M, {
1497
+ label: N("modelPicker.showDeprecated", "Show deprecated"),
1498
+ checked: ue,
1499
+ onCheckedChange: de
1500
+ })] }) : void 0, Q = G[0] ? Y.get(G[0]) : void 0, Se = n.multiple ? Q ? G.length === 1 ? /* @__PURE__ */ H(A, {
1499
1501
  provider: Q.provider,
1500
- providerName: Z(Q.provider),
1502
+ providerName: X(Q.provider),
1501
1503
  model: Q.model ?? Q.value,
1502
1504
  ...Q.name ? { name: Q.name } : {}
1503
- }) : /* @__PURE__ */ W("span", {
1505
+ }) : /* @__PURE__ */ U("span", {
1504
1506
  className: "flex min-w-0 items-center",
1505
1507
  children: [
1506
- /* @__PURE__ */ U("span", {
1508
+ /* @__PURE__ */ H("span", {
1507
1509
  className: "min-w-0 truncate",
1508
1510
  children: Q.name ?? Q.model ?? Q.value
1509
1511
  }),
1510
1512
  " ",
1511
- /* @__PURE__ */ U("span", {
1513
+ /* @__PURE__ */ H("span", {
1512
1514
  className: "shrink-0 pl-4 tabular",
1513
- children: P("select.more", "+{count}", { count: String(K.length - 1) })
1515
+ children: N("select.more", "+{count}", { count: String(G.length - 1) })
1514
1516
  })
1515
1517
  ]
1516
- }) : void 0 : Q ? /* @__PURE__ */ U(M, {
1518
+ }) : void 0 : Q ? /* @__PURE__ */ H(A, {
1517
1519
  provider: Q.provider,
1518
- providerName: Z(Q.provider),
1520
+ providerName: X(Q.provider),
1519
1521
  model: Q.model ?? Q.value,
1520
1522
  ...Q.name ? { name: Q.name } : {}
1521
- }) : G === St || G === null && q ? q : void 0, Ce = u ?? (typeof T == "string" ? T : P("modelPicker.model", "Model")), we = /* @__PURE__ */ U(w, {
1523
+ }) : W === Ct || W === null && K ? K : void 0, Ce = u ?? (typeof x == "string" ? x : N("modelPicker.model", "Model")), we = /* @__PURE__ */ H(T, {
1522
1524
  title: Ce,
1523
1525
  width: "lg",
1524
- open: R,
1525
- onOpenChange: B,
1526
- trigger: /* @__PURE__ */ U(C, {
1526
+ open: L,
1527
+ onOpenChange: oe,
1528
+ trigger: /* @__PURE__ */ H(w, {
1527
1529
  ref: r,
1528
- appearance: yt[d],
1530
+ appearance: bt[d],
1529
1531
  size: f,
1530
- ...ie.controlProps,
1531
- ...u || !T ? { "aria-label": Ce } : {},
1532
+ ...F.controlProps,
1533
+ ...u || !x ? { "aria-label": Ce } : {},
1532
1534
  ...m ? { disabled: m } : {},
1533
1535
  ...h ? { invalid: h } : {},
1534
1536
  ...p ? { fullWidth: p } : {},
1535
1537
  ...v ? { "data-force": v } : {},
1536
1538
  ...Q && !n.multiple ? { title: Q.name && Q.name !== (Q.model ?? Q.value) ? `${Q.name} · ${Q.model ?? Q.value}` : Q.model ?? Q.value } : {},
1537
- placeholder: l ?? (n.multiple ? P("modelPicker.chooseSome", "Choose models") : P("modelPicker.choose", "Choose a model")),
1538
- className: e("max-w-full", !(T || j || N) && b),
1539
+ placeholder: l ?? (n.multiple ? N("modelPicker.chooseSome", "Choose models") : N("modelPicker.choose", "Choose a model")),
1540
+ className: e("max-w-full", !(x || E || j) && b),
1539
1541
  children: Se
1540
1542
  }),
1541
- children: /* @__PURE__ */ U(S, {
1543
+ children: /* @__PURE__ */ H(C, {
1542
1544
  groups: _e,
1543
1545
  "aria-label": Ce,
1544
- value: n.multiple ? K : K[0] ?? (q ? St : null),
1546
+ value: n.multiple ? G : G[0] ?? (K ? Ct : null),
1545
1547
  ...n.multiple ? { multiple: !0 } : {},
1546
1548
  onSelect: ve,
1547
- query: J,
1548
- onQueryChange: se,
1549
- placeholder: P("modelPicker.search", "Search models"),
1550
- emptyText: P("modelPicker.noMatch", "No models match"),
1549
+ query: q,
1550
+ onQueryChange: ce,
1551
+ placeholder: N("modelPicker.search", "Search models"),
1552
+ emptyText: N("modelPicker.noMatch", "No models match"),
1551
1553
  toolbar: xe,
1552
1554
  autoFocus: !0
1553
1555
  })
1554
1556
  });
1555
- return F ? we : k({
1556
- label: T,
1557
- description: j,
1558
- error: N,
1559
- optional: ee,
1560
- required: te,
1561
- layout: ne,
1562
- id: ie.wrapId,
1557
+ return ie ? we : k({
1558
+ label: x,
1559
+ description: E,
1560
+ error: j,
1561
+ optional: te,
1562
+ required: ne,
1563
+ layout: re,
1564
+ id: F.wrapId,
1563
1565
  disabled: m,
1564
1566
  className: b
1565
1567
  }, we);
1566
1568
  });
1567
- process.env.NODE_ENV !== "production" && (kt.displayName = "ModelPicker");
1569
+ process.env.NODE_ENV !== "production" && (At.displayName = "ModelPicker");
1568
1570
  // src/components/playground/probability-bar.tsx
1569
- var At = { layout: {
1571
+ var jt = { layout: {
1570
1572
  inline: { classes: "flex min-h-22 items-center gap-12" },
1571
1573
  stacked: { classes: "flex flex-col gap-6" },
1572
1574
  row: { classes: "col-span-full grid min-h-22 grid-cols-subgrid items-center" }
1573
- } }, jt = { layout: "inline" };
1574
- function Mt(e, t, { formatPercent: n }) {
1575
+ } }, Mt = { layout: "inline" };
1576
+ function Nt(e, t, { formatPercent: n }) {
1575
1577
  return e > 0 && e < .005 ? t("probabilityBar.below", "<{percent}", { percent: n(.01, 0) }) : e < 1 && e >= .995 ? t("probabilityBar.above", ">{percent}", { percent: n(.99, 0) }) : n(e, 0);
1576
1578
  }
1577
- function Nt(e) {
1579
+ function Pt(e) {
1578
1580
  return typeof e == "number" && Number.isFinite(e);
1579
1581
  }
1580
- var Pt = /* @__PURE__ */ P(function({ value: n, label: r, highlight: i = !1, pending: a = !1, layout: o = "inline", "aria-label": c, className: l }, u) {
1581
- let d = t(), f = s(), p = L(), m = !a && Nt(n), h = m ? Math.max(0, Math.min(1, n)) : 0, g = m ? Mt(h, d, f) : "", _ = i ? d("probabilityBar.chosen", "{percent}, chosen", { percent: g }) : g, v = !a && !m, y = d("probabilityBar.missing", "Not given"), b = r == null ? null : /* @__PURE__ */ U("span", {
1582
+ var Ft = /* @__PURE__ */ P(function({ value: n, label: r, highlight: i = !1, pending: a = !1, layout: o = "inline", "aria-label": c, className: l }, u) {
1583
+ let d = t(), f = s(), p = L(), m = !a && Pt(n), h = m ? Math.max(0, Math.min(1, n)) : 0, g = m ? Nt(h, d, f) : "", _ = i ? d("probabilityBar.chosen", "{percent}, chosen", { percent: g }) : g, v = !a && !m, y = d("probabilityBar.missing", "Not given"), b = r == null ? null : /* @__PURE__ */ H("span", {
1582
1584
  id: p,
1583
1585
  className: e("min-w-0 text-small wrap-anywhere", o === "inline" ? "w-120 shrink-0" : o === "stacked" && "flex-1", i ? "font-medium text-fg" : "text-fg-secondary"),
1584
1586
  children: r
1585
- }), x = /* @__PURE__ */ U("span", {
1587
+ }), x = /* @__PURE__ */ H("span", {
1586
1588
  className: e("shrink-0 text-small tabular", o === "inline" && "w-48 text-end", o === "row" && "text-end", i ? "font-medium text-fg" : v ? "text-fg-tertiary" : "text-fg-secondary"),
1587
1589
  children: v && o === "stacked" ? y : g
1588
- }), S = v && o !== "stacked" ? /* @__PURE__ */ U("span", {
1590
+ }), S = v && o !== "stacked" ? /* @__PURE__ */ H("span", {
1589
1591
  className: e("min-w-0 truncate text-small text-fg-tertiary", o === "row" ? "col-span-2" : "flex-1"),
1590
1592
  children: y
1591
- }) : /* @__PURE__ */ U("span", {
1593
+ }) : /* @__PURE__ */ H("span", {
1592
1594
  "aria-hidden": !0,
1593
1595
  className: e("relative block h-6 min-w-0 overflow-hidden rounded-pill bg-fill-2 forced-colors:outline forced-colors:-outline-offset-1", o === "inline" && "flex-1", a && "animate-pulse-quiet reduced:animate-none"),
1594
- children: m && /* @__PURE__ */ U("span", {
1596
+ children: m && /* @__PURE__ */ H("span", {
1595
1597
  className: e("block h-full rounded-pill width-motion reduced:transition-none data-mark forced-line", i ? "bg-viz-1" : "bg-fg-tertiary"),
1596
1598
  style: { width: `${h * 100}%` }
1597
1599
  })
1598
- }), C = o === "stacked" ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("span", {
1600
+ }), C = o === "stacked" ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("span", {
1599
1601
  className: "flex items-baseline justify-between gap-12",
1600
- children: [b ?? /* @__PURE__ */ U("span", { className: "flex-1" }), x]
1601
- }), S] }) : /* @__PURE__ */ W(H, { children: [
1602
- b ?? (o === "row" ? /* @__PURE__ */ U("span", {}) : null),
1602
+ children: [b ?? /* @__PURE__ */ H("span", { className: "flex-1" }), x]
1603
+ }), S] }) : /* @__PURE__ */ U(V, { children: [
1604
+ b ?? (o === "row" ? /* @__PURE__ */ H("span", {}) : null),
1603
1605
  S,
1604
1606
  !v && x
1605
1607
  ] }), w = c ?? (typeof r == "string" ? r : void 0);
1606
- return /* @__PURE__ */ U("div", {
1608
+ return /* @__PURE__ */ H("div", {
1607
1609
  ref: u,
1608
1610
  ...m ? {
1609
1611
  role: "meter",
@@ -1616,13 +1618,13 @@ var Pt = /* @__PURE__ */ P(function({ value: n, label: r, highlight: i = !1, pen
1616
1618
  ...a ? { "aria-hidden": !0 } : {},
1617
1619
  "data-probability-bar": "",
1618
1620
  "data-highlight": i || void 0,
1619
- className: e(At.layout[o].classes, "min-w-0", l),
1621
+ className: e(jt.layout[o].classes, "min-w-0", l),
1620
1622
  children: C
1621
1623
  });
1622
1624
  });
1623
- process.env.NODE_ENV !== "production" && (Pt.displayName = "ProbabilityBar");
1625
+ process.env.NODE_ENV !== "production" && (Ft.displayName = "ProbabilityBar");
1624
1626
  // src/components/playground/decision-types.ts
1625
- function Ft(e, t) {
1627
+ function It(e, t) {
1626
1628
  switch (t) {
1627
1629
  case "predicate": return e("decision.kindPredicate", "Yes/no");
1628
1630
  case "choice": return e("decision.kindChoice", "Choice");
@@ -1630,37 +1632,37 @@ function Ft(e, t) {
1630
1632
  case "box": return e("decision.kindBox", "Box");
1631
1633
  }
1632
1634
  }
1633
- function It(e, t, n) {
1635
+ function Lt(e, t, n) {
1634
1636
  return t.name?.trim() || e("decision.question", "Question {n}", { n: n + 1 });
1635
1637
  }
1636
- function Lt(e, t, n) {
1638
+ function Rt(e, t, n) {
1637
1639
  return t?.value.trim() || e("decision.option", "Option {n}", { n: n + 1 });
1638
1640
  }
1639
- function Rt(e, t, n) {
1641
+ function zt(e, t, n) {
1640
1642
  return t?.label?.trim() || e("decision.level", "Level {n}", { n });
1641
1643
  }
1642
1644
  // src/components/playground/decision-response.tsx
1643
- var zt = { status: {
1645
+ var Bt = { status: {
1644
1646
  pending: { classes: "" },
1645
1647
  done: { classes: "" },
1646
1648
  error: { classes: "" }
1647
- } }, Bt = { status: "done" }, Vt = "animate-pulse-quiet reduced:animate-none";
1648
- function Ht(e, t) {
1649
+ } }, Vt = { status: "done" }, Ht = "animate-pulse-quiet reduced:animate-none";
1650
+ function Ut(e, t) {
1649
1651
  let n = e.map((e, t) => t);
1650
1652
  if (e.length <= t) return n;
1651
1653
  let r = (t) => e[t]?.highlight ? 2 : e[t]?.value ?? -1;
1652
1654
  return [...n].sort((e, t) => r(t) - r(e) || e - t).slice(0, t).sort((e, t) => e - t);
1653
1655
  }
1654
- function Ut({ bars: e, pending: t, max: n, unit: i, t: a }) {
1655
- let [o, s] = V(!1), c = L(), l = e.length > n, u = o || !l ? e.map((e, t) => t) : t ? e.slice(0, n).map((e, t) => t) : Ht(e, n);
1656
- return /* @__PURE__ */ W("div", {
1656
+ function Wt({ bars: e, pending: t, max: n, unit: i, t: a }) {
1657
+ let [o, s] = B(!1), c = L(), l = e.length > n, u = o || !l ? e.map((e, t) => t) : t ? e.slice(0, n).map((e, t) => t) : Ut(e, n);
1658
+ return /* @__PURE__ */ U("div", {
1657
1659
  className: "flex flex-col gap-4",
1658
- children: [/* @__PURE__ */ U("div", {
1660
+ children: [/* @__PURE__ */ H("div", {
1659
1661
  id: c,
1660
1662
  className: "grid grid-cols-meter gap-x-12 gap-y-6",
1661
1663
  children: u.map((n) => {
1662
1664
  let r = e[n];
1663
- return r ? /* @__PURE__ */ U(Pt, {
1665
+ return r ? /* @__PURE__ */ H(Ft, {
1664
1666
  layout: "row",
1665
1667
  label: r.label,
1666
1668
  value: r.value,
@@ -1668,46 +1670,52 @@ function Ut({ bars: e, pending: t, max: n, unit: i, t: a }) {
1668
1670
  pending: t
1669
1671
  }, n) : null;
1670
1672
  })
1671
- }), l && /* @__PURE__ */ U("span", {
1673
+ }), l && /* @__PURE__ */ H("span", {
1672
1674
  className: "flex h-32 items-center",
1673
- children: /* @__PURE__ */ U(r, {
1675
+ children: /* @__PURE__ */ H(r, {
1674
1676
  size: "sm",
1675
1677
  variant: "ghost",
1676
1678
  disabled: t,
1677
1679
  "aria-expanded": o,
1678
1680
  "aria-controls": c,
1679
- leadingIcon: o ? se : G,
1681
+ leadingIcon: o ? J : G,
1680
1682
  onClick: () => s((e) => !e),
1681
1683
  children: o ? a("decisionResponse.showFewer", "Show fewer") : i === "options" ? a("decisionResponse.showAllOptions", "Show all {count} options", { count: e.length }) : a("decisionResponse.showAllLevels", "Show all {count} levels", { count: e.length })
1682
1684
  })
1683
1685
  })]
1684
1686
  });
1685
1687
  }
1686
- function Wt(e) {
1688
+ function Gt(e) {
1687
1689
  return Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : 0;
1688
1690
  }
1689
- function Gt({ answer: t, image: n, t: r }) {
1691
+ function Kt({ text: t }) {
1692
+ return /* @__PURE__ */ H("span", {
1693
+ className: e("min-w-0 text-body text-fg wrap-anywhere", x(t)),
1694
+ children: t
1695
+ });
1696
+ }
1697
+ function qt({ answer: t, image: n, t: r }) {
1690
1698
  let { formatPercent: i } = s(), a = t ? {
1691
- top: Wt(Math.min(t.top, t.bottom)),
1692
- bottom: Wt(Math.max(t.top, t.bottom)),
1693
- left: Wt(Math.min(t.left, t.right)),
1694
- right: Wt(Math.max(t.left, t.right))
1699
+ top: Gt(Math.min(t.top, t.bottom)),
1700
+ bottom: Gt(Math.max(t.top, t.bottom)),
1701
+ left: Gt(Math.min(t.left, t.right)),
1702
+ right: Gt(Math.max(t.left, t.right))
1695
1703
  } : void 0, o = [
1696
1704
  ["top", r("decisionResponse.boxTop", "Top")],
1697
1705
  ["left", r("decisionResponse.boxLeft", "Left")],
1698
1706
  ["bottom", r("decisionResponse.boxBottom", "Bottom")],
1699
1707
  ["right", r("decisionResponse.boxRight", "Right")]
1700
1708
  ];
1701
- return /* @__PURE__ */ W("div", {
1709
+ return /* @__PURE__ */ U("div", {
1702
1710
  className: "flex flex-col gap-8",
1703
- children: [n && /* @__PURE__ */ W("div", {
1711
+ children: [n && /* @__PURE__ */ U("div", {
1704
1712
  className: "relative max-w-480 min-w-0 overflow-hidden rounded-well bg-fill-1 image-outline",
1705
- children: [/* @__PURE__ */ U("img", {
1713
+ children: [/* @__PURE__ */ H("img", {
1706
1714
  src: n.src,
1707
1715
  alt: n.alt ?? "",
1708
1716
  decoding: "async",
1709
1717
  className: "block h-auto w-full"
1710
- }), a && /* @__PURE__ */ U("span", {
1718
+ }), a && /* @__PURE__ */ H("span", {
1711
1719
  "aria-hidden": !0,
1712
1720
  "data-box": "",
1713
1721
  className: "pointer-events-none absolute rounded-code ring-box",
@@ -1718,28 +1726,28 @@ function Gt({ answer: t, image: n, t: r }) {
1718
1726
  height: `${(a.bottom - a.top) * 100}%`
1719
1727
  }
1720
1728
  })]
1721
- }), /* @__PURE__ */ U("dl", {
1729
+ }), /* @__PURE__ */ H("dl", {
1722
1730
  className: "flex flex-wrap gap-x-24 gap-y-4",
1723
- children: o.map(([t, n]) => /* @__PURE__ */ W("div", {
1731
+ children: o.map(([t, n]) => /* @__PURE__ */ U("div", {
1724
1732
  className: "flex min-h-22 items-baseline gap-8",
1725
- children: [/* @__PURE__ */ U("dt", {
1733
+ children: [/* @__PURE__ */ H("dt", {
1726
1734
  className: "text-small text-fg-tertiary",
1727
1735
  children: n
1728
- }), /* @__PURE__ */ U("dd", {
1736
+ }), /* @__PURE__ */ H("dd", {
1729
1737
  className: "text-small text-fg tabular",
1730
- children: a ? i(a[t], 1) : /* @__PURE__ */ U("span", {
1738
+ children: a ? i(a[t], 1) : /* @__PURE__ */ H("span", {
1731
1739
  "aria-hidden": !0,
1732
- className: e("inline-block h-12 w-40 rounded-pill bg-fill-1", Vt)
1740
+ className: e("inline-block h-12 w-40 rounded-pill bg-fill-1", Ht)
1733
1741
  })
1734
1742
  })]
1735
1743
  }, t))
1736
1744
  })]
1737
1745
  });
1738
1746
  }
1739
- function Kt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c, showInstructions: l }) {
1747
+ function Jt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c, showInstructions: l }) {
1740
1748
  let u = t(), d = s(), { formatNumber: f } = d, p = L(), m = n.kind, h = i && (i.kind === m || i.kind === "refusal") ? i : void 0, g = h?.kind === "refusal" ? h : void 0, _ = !!h && !g, v = h && h.kind !== "refusal" && typeof h.confidence == "number" && Number.isFinite(h.confidence) ? h.confidence : void 0, y = l ? n.instructions?.trim() : void 0, b, x, S = "options";
1741
1749
  if (m === "predicate") {
1742
- let e = h?.kind === "predicate" && Number.isFinite(h.probability) ? Wt(h.probability) : void 0;
1750
+ let e = h?.kind === "predicate" && Number.isFinite(h.probability) ? Gt(h.probability) : void 0;
1743
1751
  x = [{
1744
1752
  label: u("decisionResponse.yes", "Yes"),
1745
1753
  value: e,
@@ -1752,7 +1760,7 @@ function Kt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c
1752
1760
  } else if (m === "choice") {
1753
1761
  let e = n.options ?? [], t = h?.kind === "choice" ? h.option : void 0, r = h?.kind === "choice" ? h.probabilities ?? [] : [];
1754
1762
  x = e.map((e, n) => ({
1755
- label: Lt(u, e, n),
1763
+ label: Rt(u, e, n),
1756
1764
  value: r[n],
1757
1765
  highlight: n === t
1758
1766
  }));
@@ -1764,72 +1772,69 @@ function Kt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c
1764
1772
  max: f(Math.max(0, e.length - 1)),
1765
1773
  level: i === void 0 ? void 0 : e[i]?.label?.trim() || void 0
1766
1774
  }), x = e.map((e, t) => ({
1767
- label: Rt(u, e, t),
1775
+ label: zt(u, e, t),
1768
1776
  value: r[t],
1769
1777
  highlight: t === i
1770
1778
  }));
1771
1779
  }
1772
- let C = /* @__PURE__ */ W("span", {
1780
+ let C = /* @__PURE__ */ U("span", {
1773
1781
  className: "flex shrink-0 items-baseline gap-12 text-small text-fg-tertiary",
1774
- children: [v !== void 0 && /* @__PURE__ */ U("span", {
1782
+ children: [v !== void 0 && /* @__PURE__ */ H("span", {
1775
1783
  className: "tabular",
1776
- children: u("decisionResponse.confidence", "Confidence {percent}", { percent: Mt(Wt(v), u, d) })
1777
- }), /* @__PURE__ */ U("span", { children: Ft(u, m) })]
1784
+ children: u("decisionResponse.confidence", "Confidence {percent}", { percent: Nt(Gt(v), u, d) })
1785
+ }), /* @__PURE__ */ H("span", { children: It(u, m) })]
1778
1786
  });
1779
- return /* @__PURE__ */ W("li", {
1787
+ return /* @__PURE__ */ U("li", {
1780
1788
  className: "flex min-w-0 flex-col gap-12 px-12 py-16 not-first:hairline-t first:pt-0 last:pb-0",
1781
1789
  "aria-labelledby": p,
1782
1790
  "data-kind": m,
1783
1791
  "data-refused": g ? "" : void 0,
1784
- children: [/* @__PURE__ */ W("div", {
1792
+ children: [/* @__PURE__ */ U("div", {
1785
1793
  className: "flex min-w-0 flex-col gap-4",
1786
- children: [/* @__PURE__ */ W("div", {
1794
+ children: [/* @__PURE__ */ U("div", {
1787
1795
  className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-12 gap-y-4",
1788
- children: [/* @__PURE__ */ U("span", {
1796
+ children: [/* @__PURE__ */ H("span", {
1789
1797
  id: p,
1790
1798
  className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
1791
- children: It(u, n, r)
1799
+ children: Lt(u, n, r)
1792
1800
  }), C]
1793
- }), y && /* @__PURE__ */ U("span", {
1801
+ }), y && /* @__PURE__ */ H("span", {
1794
1802
  className: "max-w-prose text-small text-fg-secondary wrap-break-word",
1795
1803
  children: y
1796
1804
  })]
1797
- }), g ? /* @__PURE__ */ W("div", {
1805
+ }), g ? /* @__PURE__ */ U("div", {
1798
1806
  className: "flex min-h-22 flex-col gap-4",
1799
- children: [/* @__PURE__ */ U("span", {
1807
+ children: [/* @__PURE__ */ H("span", {
1800
1808
  className: "text-body text-fg-secondary",
1801
1809
  children: u("decisionResponse.refused", "Refused: the model declined to answer this question")
1802
- }), g.reason && /* @__PURE__ */ U("span", {
1810
+ }), g.reason && /* @__PURE__ */ H("span", {
1803
1811
  className: "text-small text-fg-tertiary wrap-anywhere",
1804
1812
  children: g.reason
1805
1813
  })]
1806
- }) : !a && !_ ? /* @__PURE__ */ U("span", {
1814
+ }) : !a && !_ ? /* @__PURE__ */ H("span", {
1807
1815
  className: "flex min-h-22 items-center text-body text-fg-tertiary",
1808
1816
  children: u("decisionResponse.noAnswer", "No answer")
1809
- }) : /* @__PURE__ */ W(H, { children: [
1810
- m === "score" && /* @__PURE__ */ U("div", {
1817
+ }) : /* @__PURE__ */ U(V, { children: [
1818
+ m === "score" && /* @__PURE__ */ H("div", {
1811
1819
  className: "flex min-h-22 items-baseline",
1812
- children: a || !b ? /* @__PURE__ */ U("span", {
1820
+ children: a || !b ? /* @__PURE__ */ H("span", {
1813
1821
  "aria-hidden": !0,
1814
- className: e("h-12 w-120 self-center rounded-pill bg-fill-1", Vt)
1815
- }) : /* @__PURE__ */ U("span", {
1816
- className: "min-w-0 text-body text-fg tabular wrap-anywhere",
1817
- children: b.level ? u("decisionResponse.scoreNear", "{score} of {max}, nearest {level}", {
1818
- score: b.value,
1819
- max: b.max,
1820
- level: b.level
1821
- }) : u("decisionResponse.score", "{score} of {max}", {
1822
- score: b.value,
1823
- max: b.max
1824
- })
1825
- })
1822
+ className: e("h-12 w-120 self-center rounded-pill bg-fill-1", Ht)
1823
+ }) : /* @__PURE__ */ H(Kt, { text: b.level ? u("decisionResponse.scoreNear", "{score} of {max}, nearest {level}", {
1824
+ score: b.value,
1825
+ max: b.max,
1826
+ level: b.level
1827
+ }) : u("decisionResponse.score", "{score} of {max}", {
1828
+ score: b.value,
1829
+ max: b.max
1830
+ }) })
1826
1831
  }),
1827
- m === "box" && /* @__PURE__ */ U(Gt, {
1832
+ m === "box" && /* @__PURE__ */ H(qt, {
1828
1833
  answer: h?.kind === "box" ? h : void 0,
1829
1834
  image: o,
1830
1835
  t: u
1831
1836
  }),
1832
- x && x.length > 0 && /* @__PURE__ */ U(Ut, {
1837
+ x && x.length > 0 && /* @__PURE__ */ H(Wt, {
1833
1838
  bars: x,
1834
1839
  pending: a,
1835
1840
  max: c,
@@ -1839,8 +1844,8 @@ function Kt({ question: n, index: r, answer: i, pending: a, image: o, maxBars: c
1839
1844
  ] })]
1840
1845
  });
1841
1846
  }
1842
- var qt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a = "done", image: o, maxBars: s = 8, showInstructions: l = !1, error: u, onRetry: d, footer: f, "aria-label": p, className: m }, h) {
1843
- let g = t(), _ = p ?? g("responseView.response", "Response"), v = a === "pending", y = L(), b = B(a), [x, S] = V("");
1847
+ var Yt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a = "done", image: o, maxBars: s = 8, showInstructions: l = !1, error: u, onRetry: d, footer: f, "aria-label": p, className: m }, h) {
1848
+ let g = t(), _ = p ?? g("responseView.response", "Response"), v = a === "pending", y = L(), b = z(a), [x, S] = B("");
1844
1849
  I(() => {
1845
1850
  let e = b.current;
1846
1851
  b.current = a, v ? S("") : e === "pending" && a === "done" && S(g("responseView.endedDone", "{label} finished", { label: _ }));
@@ -1851,36 +1856,36 @@ var qt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a =
1851
1856
  g
1852
1857
  ]);
1853
1858
  let C = f != null, w = Math.max(1, Math.floor(s));
1854
- return /* @__PURE__ */ W("article", {
1859
+ return /* @__PURE__ */ U("article", {
1855
1860
  ref: h,
1856
1861
  "aria-label": _,
1857
1862
  "aria-busy": v || void 0,
1858
1863
  ...v ? { "aria-describedby": y } : {},
1859
1864
  className: e("flex min-w-0 flex-col gap-16", m),
1860
1865
  children: [
1861
- a === "error" ? /* @__PURE__ */ W("div", {
1866
+ a === "error" ? /* @__PURE__ */ U("div", {
1862
1867
  className: "flex flex-col items-start gap-8 px-12",
1863
- children: [/* @__PURE__ */ W("div", {
1868
+ children: [/* @__PURE__ */ U("div", {
1864
1869
  role: "alert",
1865
1870
  className: "flex min-w-0 flex-col gap-4",
1866
- children: [/* @__PURE__ */ U("span", {
1871
+ children: [/* @__PURE__ */ H("span", {
1867
1872
  className: "text-small font-medium text-fg",
1868
1873
  children: g("decisionResponse.failed", "No answers")
1869
- }), u && /* @__PURE__ */ U(c, {
1874
+ }), u && /* @__PURE__ */ H(c, {
1870
1875
  text: u,
1871
1876
  size: "small",
1872
1877
  tone: "secondary",
1873
1878
  className: "max-w-prose min-w-0"
1874
1879
  })]
1875
- }), d && /* @__PURE__ */ U(r, {
1880
+ }), d && /* @__PURE__ */ H(r, {
1876
1881
  size: "sm",
1877
1882
  variant: "secondary",
1878
1883
  onClick: d,
1879
1884
  children: g("responseView.retry", "Retry")
1880
1885
  })]
1881
- }) : /* @__PURE__ */ U("ol", {
1886
+ }) : /* @__PURE__ */ H("ol", {
1882
1887
  className: "flex min-w-0 flex-col",
1883
- children: n.map((e, t) => /* @__PURE__ */ U(Kt, {
1888
+ children: n.map((e, t) => /* @__PURE__ */ H(Jt, {
1884
1889
  question: e,
1885
1890
  index: t,
1886
1891
  answer: v ? void 0 : i[t],
@@ -1890,29 +1895,29 @@ var qt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a =
1890
1895
  showInstructions: l
1891
1896
  }, e.id ?? t))
1892
1897
  }),
1893
- v && /* @__PURE__ */ U("p", {
1898
+ v && /* @__PURE__ */ H("p", {
1894
1899
  id: y,
1895
1900
  className: "sr-only",
1896
1901
  children: g("decisionResponse.waiting", "Waiting for the answers")
1897
1902
  }),
1898
- (C || a === "done" && d) && /* @__PURE__ */ W("div", {
1903
+ (C || a === "done" && d) && /* @__PURE__ */ U("div", {
1899
1904
  className: "flex min-h-32 min-w-0 flex-wrap items-center gap-x-4 gap-y-4",
1900
- children: [a === "done" && d && /* @__PURE__ */ U("span", {
1905
+ children: [a === "done" && d && /* @__PURE__ */ H("span", {
1901
1906
  "data-reply-actions": "",
1902
1907
  className: "flex items-center gap-x-4 transition-arrive reduced:transition-none starting:-ml-36 starting:opacity-0",
1903
- children: /* @__PURE__ */ U(r, {
1908
+ children: /* @__PURE__ */ H(r, {
1904
1909
  size: "sm",
1905
1910
  variant: "quiet",
1906
1911
  icon: q,
1907
1912
  "aria-label": g("responseView.retry", "Retry"),
1908
1913
  onClick: d
1909
1914
  })
1910
- }), C && /* @__PURE__ */ U("div", {
1915
+ }), C && /* @__PURE__ */ H("div", {
1911
1916
  className: e("min-w-0", a === "done" && d ? "px-8" : "px-12"),
1912
1917
  children: f
1913
1918
  })]
1914
1919
  }),
1915
- /* @__PURE__ */ U("span", {
1920
+ /* @__PURE__ */ H("span", {
1916
1921
  role: "status",
1917
1922
  className: "sr-only",
1918
1923
  children: x
@@ -1920,10 +1925,10 @@ var qt = /* @__PURE__ */ P(function({ questions: n, answers: i = [], status: a =
1920
1925
  ]
1921
1926
  });
1922
1927
  });
1923
- process.env.NODE_ENV !== "production" && (qt.displayName = "DecisionResponse");
1928
+ process.env.NODE_ENV !== "production" && (Yt.displayName = "DecisionResponse");
1924
1929
  // src/components/playground/decision-questions.tsx
1925
- var Jt = { layout: { list: { classes: "" } } }, Yt = { layout: "list" };
1926
- function Xt(e, t, n) {
1930
+ var Xt = { layout: { list: { classes: "" } } }, Zt = { layout: "list" };
1931
+ function Qt(e, t, n) {
1927
1932
  switch (e.kind) {
1928
1933
  case "predicate": {
1929
1934
  let n = e.whenTrue?.trim(), r = e.whenFalse?.trim();
@@ -1941,7 +1946,7 @@ function Xt(e, t, n) {
1941
1946
  }
1942
1947
  case "choice": return (e.options ?? []).map((e, n) => ({
1943
1948
  key: `o${n}`,
1944
- term: Lt(t, e, n),
1949
+ term: Rt(t, e, n),
1945
1950
  mono: !!e.value.trim(),
1946
1951
  description: e.description?.trim() || void 0
1947
1952
  }));
@@ -1957,42 +1962,42 @@ function Xt(e, t, n) {
1957
1962
  case "box": return [];
1958
1963
  }
1959
1964
  }
1960
- function Zt({ question: n, index: r }) {
1961
- let i = t(), { formatNumber: a } = s(), o = L(), c = n.instructions?.trim(), l = Xt(n, i, (e) => a(e)), u = n.kind === "choice" ? i("decisionQuestions.options", "{count, plural, one {# option} other {# options}}", { count: l.length }) : n.kind === "score" ? i("decisionQuestions.levels", "{count, plural, one {# level} other {# levels}}", { count: l.length }) : void 0;
1962
- return /* @__PURE__ */ W("li", {
1965
+ function $t({ question: n, index: r }) {
1966
+ let i = t(), { formatNumber: a } = s(), o = L(), c = n.instructions?.trim(), l = Qt(n, i, (e) => a(e)), u = n.kind === "choice" ? i("decisionQuestions.options", "{count, plural, one {# option} other {# options}}", { count: l.length }) : n.kind === "score" ? i("decisionQuestions.levels", "{count, plural, one {# level} other {# levels}}", { count: l.length }) : void 0;
1967
+ return /* @__PURE__ */ U("li", {
1963
1968
  className: "flex min-w-0 flex-col gap-12 px-12 py-16 not-first:hairline-t first:pt-0 last:pb-0",
1964
1969
  "aria-labelledby": o,
1965
1970
  "data-kind": n.kind,
1966
- children: [/* @__PURE__ */ W("div", {
1971
+ children: [/* @__PURE__ */ U("div", {
1967
1972
  className: "flex min-w-0 flex-col gap-4",
1968
- children: [/* @__PURE__ */ W("div", {
1973
+ children: [/* @__PURE__ */ U("div", {
1969
1974
  className: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-12 gap-y-4",
1970
- children: [/* @__PURE__ */ U("span", {
1975
+ children: [/* @__PURE__ */ H("span", {
1971
1976
  id: o,
1972
1977
  className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
1973
- children: It(i, n, r)
1974
- }), /* @__PURE__ */ W("span", {
1978
+ children: Lt(i, n, r)
1979
+ }), /* @__PURE__ */ U("span", {
1975
1980
  className: "flex shrink-0 items-baseline gap-12 text-small text-fg-tertiary",
1976
- children: [u && /* @__PURE__ */ U("span", {
1981
+ children: [u && /* @__PURE__ */ H("span", {
1977
1982
  className: "tabular",
1978
1983
  children: u
1979
- }), /* @__PURE__ */ U("span", { children: Ft(i, n.kind) })]
1984
+ }), /* @__PURE__ */ H("span", { children: It(i, n.kind) })]
1980
1985
  })]
1981
- }), c ? /* @__PURE__ */ U("span", {
1986
+ }), c ? /* @__PURE__ */ H("span", {
1982
1987
  className: "max-w-prose text-body text-fg-secondary wrap-break-word whitespace-pre-line",
1983
1988
  children: c
1984
- }) : /* @__PURE__ */ U("span", {
1989
+ }) : /* @__PURE__ */ H("span", {
1985
1990
  className: "text-body text-fg-tertiary",
1986
1991
  children: i("decisionQuestions.noInstructions", "No instructions")
1987
1992
  })]
1988
- }), l.length > 0 && /* @__PURE__ */ U("dl", {
1993
+ }), l.length > 0 && /* @__PURE__ */ H("dl", {
1989
1994
  className: "grid min-w-0 grid-cols-term gap-x-16 gap-y-6",
1990
- children: l.map((t) => /* @__PURE__ */ W("div", {
1995
+ children: l.map((t) => /* @__PURE__ */ U("div", {
1991
1996
  className: "col-span-full grid min-h-22 grid-cols-subgrid items-baseline",
1992
- children: [/* @__PURE__ */ U("dt", {
1997
+ children: [/* @__PURE__ */ H("dt", {
1993
1998
  className: e("min-w-0 text-small text-fg wrap-anywhere", t.mono ? "font-mono" : "tabular font-medium"),
1994
1999
  children: t.term
1995
- }), /* @__PURE__ */ U("dd", {
2000
+ }), /* @__PURE__ */ H("dd", {
1996
2001
  className: e("min-w-0 text-small wrap-break-word", t.description ? "text-fg-secondary" : "text-fg-tertiary"),
1997
2002
  children: t.description ?? i("decisionQuestions.noDescription", "No description")
1998
2003
  })]
@@ -2000,35 +2005,35 @@ function Zt({ question: n, index: r }) {
2000
2005
  })]
2001
2006
  });
2002
2007
  }
2003
- var Qt = /* @__PURE__ */ P(function({ questions: n, layout: r = "list", "aria-label": i, className: a }, o) {
2008
+ var en = /* @__PURE__ */ P(function({ questions: n, layout: r = "list", "aria-label": i, className: a }, o) {
2004
2009
  let s = t();
2005
- return /* @__PURE__ */ U("ol", {
2010
+ return /* @__PURE__ */ H("ol", {
2006
2011
  ref: o,
2007
2012
  "aria-label": i ?? s("decisionQuestions.label", "Questions"),
2008
- className: e("flex min-w-0 flex-col", Jt.layout[r].classes, a),
2009
- children: n.map((e, t) => /* @__PURE__ */ U(Zt, {
2013
+ className: e("flex min-w-0 flex-col", Xt.layout[r].classes, a),
2014
+ children: n.map((e, t) => /* @__PURE__ */ H($t, {
2010
2015
  question: e,
2011
2016
  index: t
2012
2017
  }, e.id ?? t))
2013
2018
  });
2014
2019
  });
2015
- process.env.NODE_ENV !== "production" && (Qt.displayName = "DecisionQuestions");
2020
+ process.env.NODE_ENV !== "production" && (en.displayName = "DecisionQuestions");
2016
2021
  // src/components/playground/question-editor.tsx
2017
- var $t = { layout: {
2022
+ var tn = { layout: {
2018
2023
  panel: { classes: "gap-24" },
2019
2024
  compact: { classes: "gap-16" }
2020
- } }, en = { layout: "panel" }, tn = 2, nn = 3;
2021
- function rn(e) {
2025
+ } }, nn = { layout: "panel" }, rn = 2, an = 3;
2026
+ function on(e) {
2022
2027
  return e === "" ? void 0 : e;
2023
2028
  }
2024
- function an(e, t) {
2029
+ function sn(e, t) {
2025
2030
  let n = {
2026
2031
  ...e,
2027
2032
  kind: t
2028
2033
  };
2029
- return t === "choice" && !e.options?.length && (n.options = Array.from({ length: tn }, () => ({ value: "" }))), t === "score" && !e.levels?.length && (n.levels = Array.from({ length: nn }, () => ({}))), n;
2034
+ return t === "choice" && !e.options?.length && (n.options = Array.from({ length: rn }, () => ({ value: "" }))), t === "score" && !e.levels?.length && (n.levels = Array.from({ length: an }, () => ({}))), n;
2030
2035
  }
2031
- function on(e, t, n) {
2036
+ function cn(e, t, n) {
2032
2037
  return [
2033
2038
  "predicate",
2034
2039
  "choice",
@@ -2036,10 +2041,10 @@ function on(e, t, n) {
2036
2041
  "box"
2037
2042
  ].filter((e) => e !== "box" || t || n === "box").map((t) => ({
2038
2043
  value: t,
2039
- label: Ft(e, t)
2044
+ label: It(e, t)
2040
2045
  }));
2041
2046
  }
2042
- function sn({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s, removeLabel: c, addLabel: l, limitText: u, onChange: d, onFocus: f, make: m, setFirst: h, setSecond: g }) {
2047
+ function ln({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s, removeLabel: c, addLabel: l, limitText: u, onChange: d, onFocus: f, make: m, setFirst: h, setSecond: g }) {
2043
2048
  let _ = e.length >= i, v = (n) => {
2044
2049
  _ || (d([
2045
2050
  ...e.slice(0, n),
@@ -2051,17 +2056,17 @@ function sn({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s
2051
2056
  }, b = (e) => (t) => {
2052
2057
  t.key !== "Enter" || t.nativeEvent.isComposing || (t.preventDefault(), v(e + 1));
2053
2058
  };
2054
- return /* @__PURE__ */ W("div", {
2059
+ return /* @__PURE__ */ U("div", {
2055
2060
  className: "flex flex-col gap-8",
2056
- children: [/* @__PURE__ */ U("ul", {
2061
+ children: [/* @__PURE__ */ H("ul", {
2057
2062
  className: "flex flex-col gap-16 sm:gap-8",
2058
2063
  children: e.map((i, l) => {
2059
2064
  let u = o(i, l), f = s(i, l);
2060
- return /* @__PURE__ */ W("li", {
2065
+ return /* @__PURE__ */ U("li", {
2061
2066
  className: "flex min-w-0 items-start gap-8",
2062
- children: [/* @__PURE__ */ W("div", {
2067
+ children: [/* @__PURE__ */ U("div", {
2063
2068
  className: "grid min-w-0 flex-1 grid-cols-1 gap-8 sm:grid-cols-2",
2064
- children: [/* @__PURE__ */ U(p, {
2069
+ children: [/* @__PURE__ */ H(p, {
2065
2070
  id: t(l),
2066
2071
  size: "sm",
2067
2072
  "aria-label": u.label,
@@ -2070,7 +2075,7 @@ function sn({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s
2070
2075
  disabled: a,
2071
2076
  onChange: (t) => d(e.map((e, n) => n === l ? h(e, t.target.value) : e)),
2072
2077
  onKeyDown: b(l)
2073
- }), /* @__PURE__ */ U(p, {
2078
+ }), /* @__PURE__ */ H(p, {
2074
2079
  size: "sm",
2075
2080
  "aria-label": f.label,
2076
2081
  placeholder: f.placeholder,
@@ -2078,34 +2083,34 @@ function sn({ rows: e, idOf: t, min: n, max: i, disabled: a, first: o, second: s
2078
2083
  disabled: a,
2079
2084
  onChange: (t) => d(e.map((e, n) => n === l ? g(e, t.target.value) : e))
2080
2085
  })]
2081
- }), /* @__PURE__ */ U(r, {
2086
+ }), /* @__PURE__ */ H(r, {
2082
2087
  size: "sm",
2083
2088
  variant: "ghost",
2084
- icon: ue,
2089
+ icon: pe,
2085
2090
  "aria-label": c(l),
2086
2091
  disabled: a || e.length <= n,
2087
2092
  onClick: () => y(l)
2088
2093
  })]
2089
2094
  }, l);
2090
2095
  })
2091
- }), /* @__PURE__ */ W("div", {
2096
+ }), /* @__PURE__ */ U("div", {
2092
2097
  className: "flex min-h-32 flex-wrap items-center gap-x-12 gap-y-4",
2093
- children: [/* @__PURE__ */ U(r, {
2098
+ children: [/* @__PURE__ */ H(r, {
2094
2099
  size: "sm",
2095
2100
  variant: "secondary",
2096
- leadingIcon: oe,
2101
+ leadingIcon: W,
2097
2102
  disabled: a || _,
2098
2103
  onClick: () => v(e.length),
2099
2104
  children: l
2100
- }), _ && /* @__PURE__ */ U("span", {
2105
+ }), _ && /* @__PURE__ */ H("span", {
2101
2106
  className: "text-small text-fg-tertiary",
2102
2107
  children: u
2103
2108
  })]
2104
2109
  })]
2105
2110
  });
2106
2111
  }
2107
- var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a = !1, maxQuestions: o = Infinity, maxOptions: s = 255, maxLevels: c = 10, disabled: l = !1, layout: u = "panel", "aria-label": d, className: f }, m) {
2108
- let g = t(), _ = L(), v = B(0), [b, x] = V(null);
2112
+ var un = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a = !1, maxQuestions: o = Infinity, maxOptions: s = 255, maxLevels: c = 10, disabled: l = !1, layout: u = "panel", "aria-label": d, className: f }, m) {
2113
+ let g = t(), _ = L(), v = z(0), [b, x] = B(null);
2109
2114
  I(() => {
2110
2115
  b && (document.getElementById(b)?.focus(), x(null));
2111
2116
  }, [b, n]);
@@ -2123,53 +2128,53 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2123
2128
  let r = t[Math.min(e, t.length - 1)];
2124
2129
  x(r ? `${S(r, Math.min(e, t.length - 1))}-remove` : `${_}-add`);
2125
2130
  };
2126
- return /* @__PURE__ */ W("div", {
2131
+ return /* @__PURE__ */ U("div", {
2127
2132
  ref: m,
2128
2133
  role: "group",
2129
2134
  "aria-label": d ?? g("questionEditor.label", "Questions"),
2130
- className: e("flex min-w-0 flex-col", $t.layout[u].classes, f),
2135
+ className: e("flex min-w-0 flex-col", tn.layout[u].classes, f),
2131
2136
  children: [
2132
- n.length === 0 && /* @__PURE__ */ U("p", {
2137
+ n.length === 0 && /* @__PURE__ */ H("p", {
2133
2138
  className: "text-body text-fg-secondary",
2134
2139
  children: g("questionEditor.empty", "No questions yet. Add one to ask the model something it answers with probabilities.")
2135
2140
  }),
2136
- n.length > 0 && /* @__PURE__ */ U("ol", {
2137
- className: e("flex min-w-0 flex-col", $t.layout[u].classes),
2141
+ n.length > 0 && /* @__PURE__ */ H("ol", {
2142
+ className: e("flex min-w-0 flex-col", tn.layout[u].classes),
2138
2143
  children: n.map((t, n) => {
2139
- let i = S(t, n), o = It(g, t, n), d = `${i}-head`;
2140
- return /* @__PURE__ */ W("li", {
2141
- className: e("flex min-w-0 flex-col", $t.layout[u].classes),
2142
- children: [n > 0 && /* @__PURE__ */ U(ee, { "aria-hidden": !0 }), /* @__PURE__ */ W("fieldset", {
2144
+ let i = S(t, n), o = Lt(g, t, n), d = `${i}-head`;
2145
+ return /* @__PURE__ */ U("li", {
2146
+ className: e("flex min-w-0 flex-col", tn.layout[u].classes),
2147
+ children: [n > 0 && /* @__PURE__ */ H(ne, { "aria-hidden": !0 }), /* @__PURE__ */ U("fieldset", {
2143
2148
  "aria-labelledby": d,
2144
2149
  className: "flex min-w-0 flex-col gap-12",
2145
2150
  disabled: l,
2146
2151
  children: [
2147
- /* @__PURE__ */ W("div", {
2152
+ /* @__PURE__ */ U("div", {
2148
2153
  className: "flex min-h-32 min-w-0 items-center justify-between gap-12",
2149
- children: [/* @__PURE__ */ U("span", {
2154
+ children: [/* @__PURE__ */ H("span", {
2150
2155
  id: d,
2151
2156
  className: "min-w-0 text-body font-medium text-fg wrap-anywhere",
2152
2157
  children: o
2153
- }), /* @__PURE__ */ U(r, {
2158
+ }), /* @__PURE__ */ H(r, {
2154
2159
  id: `${i}-remove`,
2155
2160
  size: "sm",
2156
2161
  variant: "ghost",
2157
- icon: ue,
2162
+ icon: pe,
2158
2163
  "aria-label": g("questionEditor.removeQuestion", "Remove {name}", { name: o }),
2159
2164
  disabled: l,
2160
2165
  onClick: () => T(n)
2161
2166
  })]
2162
2167
  }),
2163
- /* @__PURE__ */ W("div", {
2168
+ /* @__PURE__ */ U("div", {
2164
2169
  className: "grid min-w-0 grid-cols-1 gap-12 sm:grid-cols-2",
2165
- children: [/* @__PURE__ */ U(y, {
2170
+ children: [/* @__PURE__ */ H(y, {
2166
2171
  label: g("questionEditor.kind", "Type"),
2167
2172
  value: t.kind,
2168
- options: on(g, a, t.kind),
2173
+ options: cn(g, a, t.kind),
2169
2174
  disabled: l,
2170
2175
  fullWidth: !0,
2171
- onValueChange: (e) => C(n, an(t, e))
2172
- }), /* @__PURE__ */ U(p, {
2176
+ onValueChange: (e) => C(n, sn(t, e))
2177
+ }), /* @__PURE__ */ H(p, {
2173
2178
  id: `${i}-name`,
2174
2179
  label: g("questionEditor.name", "Name"),
2175
2180
  placeholder: g("questionEditor.namePlaceholder", "is_invoice"),
@@ -2177,11 +2182,11 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2177
2182
  disabled: l,
2178
2183
  onChange: (e) => C(n, {
2179
2184
  ...t,
2180
- name: rn(e.target.value)
2185
+ name: on(e.target.value)
2181
2186
  })
2182
2187
  })]
2183
2188
  }),
2184
- /* @__PURE__ */ U(h, {
2189
+ /* @__PURE__ */ H(h, {
2185
2190
  label: g("questionEditor.instructions", "Instructions"),
2186
2191
  placeholder: g("questionEditor.instructionsPlaceholder", "What the model should decide, in a sentence"),
2187
2192
  rows: 2,
@@ -2189,41 +2194,41 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2189
2194
  disabled: l,
2190
2195
  onChange: (e) => C(n, {
2191
2196
  ...t,
2192
- instructions: rn(e.target.value)
2197
+ instructions: on(e.target.value)
2193
2198
  })
2194
2199
  }),
2195
- t.kind === "predicate" && /* @__PURE__ */ W("div", {
2200
+ t.kind === "predicate" && /* @__PURE__ */ U("div", {
2196
2201
  className: "grid min-w-0 grid-cols-1 gap-12 sm:grid-cols-2",
2197
- children: [/* @__PURE__ */ U(p, {
2202
+ children: [/* @__PURE__ */ H(p, {
2198
2203
  label: g("questionEditor.whenTrue", "What yes means"),
2199
2204
  value: t.whenTrue ?? "",
2200
2205
  disabled: l,
2201
2206
  onChange: (e) => C(n, {
2202
2207
  ...t,
2203
- whenTrue: rn(e.target.value)
2208
+ whenTrue: on(e.target.value)
2204
2209
  })
2205
- }), /* @__PURE__ */ U(p, {
2210
+ }), /* @__PURE__ */ H(p, {
2206
2211
  label: g("questionEditor.whenFalse", "What no means"),
2207
2212
  value: t.whenFalse ?? "",
2208
2213
  disabled: l,
2209
2214
  onChange: (e) => C(n, {
2210
2215
  ...t,
2211
- whenFalse: rn(e.target.value)
2216
+ whenFalse: on(e.target.value)
2212
2217
  })
2213
2218
  })]
2214
2219
  }),
2215
- t.kind === "choice" && /* @__PURE__ */ W("div", {
2220
+ t.kind === "choice" && /* @__PURE__ */ U("div", {
2216
2221
  role: "group",
2217
2222
  "aria-labelledby": `${i}-options`,
2218
2223
  className: "flex min-w-0 flex-col gap-8",
2219
- children: [/* @__PURE__ */ U("span", {
2224
+ children: [/* @__PURE__ */ H("span", {
2220
2225
  id: `${i}-options`,
2221
2226
  className: "text-body font-medium text-fg",
2222
2227
  children: g("questionEditor.options", "Options")
2223
- }), /* @__PURE__ */ U(sn, {
2228
+ }), /* @__PURE__ */ H(ln, {
2224
2229
  rows: t.options ?? [],
2225
2230
  idOf: (e) => `${i}-option-${e}`,
2226
- min: tn,
2231
+ min: rn,
2227
2232
  max: s,
2228
2233
  disabled: l,
2229
2234
  first: (e, t) => ({
@@ -2251,28 +2256,28 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2251
2256
  }),
2252
2257
  setSecond: (e, t) => ({
2253
2258
  ...e,
2254
- description: rn(t)
2259
+ description: on(t)
2255
2260
  })
2256
2261
  })]
2257
2262
  }),
2258
- t.kind === "score" && /* @__PURE__ */ W("div", {
2263
+ t.kind === "score" && /* @__PURE__ */ U("div", {
2259
2264
  role: "group",
2260
2265
  "aria-labelledby": `${i}-levels`,
2261
2266
  className: "flex min-w-0 flex-col gap-8",
2262
- children: [/* @__PURE__ */ U("span", {
2267
+ children: [/* @__PURE__ */ H("span", {
2263
2268
  id: `${i}-levels`,
2264
2269
  className: "text-body font-medium text-fg",
2265
2270
  children: g("questionEditor.levels", "Levels, from 0 up")
2266
- }), /* @__PURE__ */ U(sn, {
2271
+ }), /* @__PURE__ */ H(ln, {
2267
2272
  rows: t.levels ?? [],
2268
2273
  idOf: (e) => `${i}-level-${e}`,
2269
- min: tn,
2274
+ min: rn,
2270
2275
  max: c,
2271
2276
  disabled: l,
2272
2277
  first: (e, t) => ({
2273
2278
  value: e.label ?? "",
2274
2279
  label: g("questionEditor.levelLabel", "Label of level {n}", { n: t }),
2275
- placeholder: Rt(g, void 0, t)
2280
+ placeholder: zt(g, void 0, t)
2276
2281
  }),
2277
2282
  second: (e, t) => ({
2278
2283
  value: e.description ?? "",
@@ -2290,15 +2295,15 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2290
2295
  make: () => ({}),
2291
2296
  setFirst: (e, t) => ({
2292
2297
  ...e,
2293
- label: rn(t)
2298
+ label: on(t)
2294
2299
  }),
2295
2300
  setSecond: (e, t) => ({
2296
2301
  ...e,
2297
- description: rn(t)
2302
+ description: on(t)
2298
2303
  })
2299
2304
  })]
2300
2305
  }),
2301
- t.kind === "box" && /* @__PURE__ */ U("p", {
2306
+ t.kind === "box" && /* @__PURE__ */ H("p", {
2302
2307
  className: "text-small text-fg-secondary",
2303
2308
  children: g("questionEditor.boxHint", "The model answers with a box around what the instructions describe, on the image sent with the state.")
2304
2309
  })
@@ -2307,16 +2312,16 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2307
2312
  }, i);
2308
2313
  })
2309
2314
  }),
2310
- /* @__PURE__ */ W("div", {
2315
+ /* @__PURE__ */ U("div", {
2311
2316
  className: "flex min-h-36 flex-wrap items-center gap-x-12 gap-y-4",
2312
- children: [/* @__PURE__ */ U(r, {
2317
+ children: [/* @__PURE__ */ H(r, {
2313
2318
  id: `${_}-add`,
2314
2319
  variant: "secondary",
2315
- leadingIcon: oe,
2320
+ leadingIcon: W,
2316
2321
  disabled: l || n.length >= o,
2317
2322
  onClick: w,
2318
2323
  children: g("questionEditor.addQuestion", "Add question")
2319
- }), n.length >= o && /* @__PURE__ */ U("span", {
2324
+ }), n.length >= o && /* @__PURE__ */ H("span", {
2320
2325
  className: "text-small text-fg-tertiary",
2321
2326
  children: g("questionEditor.questionLimit", "{max, plural, one {Up to # question} other {Up to # questions}}", { max: o })
2322
2327
  })]
@@ -2324,7 +2329,7 @@ var cn = /* @__PURE__ */ P(function({ value: n, onValueChange: i, allowBox: a =
2324
2329
  ]
2325
2330
  });
2326
2331
  });
2327
- process.env.NODE_ENV !== "production" && (cn.displayName = "QuestionEditor");
2328
- export { _e as Attachments, We as CompareGrid, Te as Composer, Qt as DecisionQuestions, qt as DecisionResponse, he as KAESO_ATTACHMENTS_DEFAULT_VARIANTS, me as KAESO_ATTACHMENTS_VARIANTS, Ie as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, Fe as KAESO_COMPARE_GRID_VARIANTS, ye as KAESO_COMPOSER_DEFAULT_VARIANTS, ve as KAESO_COMPOSER_VARIANTS, Yt as KAESO_DECISION_QUESTIONS_DEFAULT_VARIANTS, Jt as KAESO_DECISION_QUESTIONS_VARIANTS, Bt as KAESO_DECISION_RESPONSE_DEFAULT_VARIANTS, zt as KAESO_DECISION_RESPONSE_VARIANTS, De as KAESO_MEDIA_RESPONSE_DEFAULT_VARIANTS, Ee as KAESO_MEDIA_RESPONSE_VARIANTS, xt as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, bt as KAESO_MODEL_PICKER_VARIANTS, dt as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, ut as KAESO_PARAMETER_PANEL_VARIANTS, jt as KAESO_PROBABILITY_BAR_DEFAULT_VARIANTS, At as KAESO_PROBABILITY_BAR_VARIANTS, en as KAESO_QUESTION_EDITOR_DEFAULT_VARIANTS, $t as KAESO_QUESTION_EDITOR_VARIANTS, Ke as KAESO_REASONING_DEFAULT_VARIANTS, Ge as KAESO_REASONING_VARIANTS, it as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, rt as KAESO_RESPONSE_METRICS_VARIANTS, Xe as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Ye as KAESO_RESPONSE_VIEW_VARIANTS, Pe as MediaResponse, kt as ModelPicker, vt as ParameterPanel, Pt as ProbabilityBar, cn as QuestionEditor, Je as Reasoning, lt as ResponseMetrics, $e as ResponseView, nt as Thread, tt as UserMessage, at as formatLatency, Ot as useModelGroups };
2332
+ process.env.NODE_ENV !== "production" && (un.displayName = "QuestionEditor");
2333
+ export { ve as Attachments, Ge as CompareGrid, Ee as Composer, en as DecisionQuestions, Yt as DecisionResponse, ge as KAESO_ATTACHMENTS_DEFAULT_VARIANTS, he as KAESO_ATTACHMENTS_VARIANTS, Le as KAESO_COMPARE_GRID_DEFAULT_VARIANTS, Ie as KAESO_COMPARE_GRID_VARIANTS, be as KAESO_COMPOSER_DEFAULT_VARIANTS, ye as KAESO_COMPOSER_VARIANTS, Zt as KAESO_DECISION_QUESTIONS_DEFAULT_VARIANTS, Xt as KAESO_DECISION_QUESTIONS_VARIANTS, Vt as KAESO_DECISION_RESPONSE_DEFAULT_VARIANTS, Bt as KAESO_DECISION_RESPONSE_VARIANTS, Oe as KAESO_MEDIA_RESPONSE_DEFAULT_VARIANTS, De as KAESO_MEDIA_RESPONSE_VARIANTS, St as KAESO_MODEL_PICKER_DEFAULT_VARIANTS, xt as KAESO_MODEL_PICKER_VARIANTS, ft as KAESO_PARAMETER_PANEL_DEFAULT_VARIANTS, dt as KAESO_PARAMETER_PANEL_VARIANTS, Mt as KAESO_PROBABILITY_BAR_DEFAULT_VARIANTS, jt as KAESO_PROBABILITY_BAR_VARIANTS, nn as KAESO_QUESTION_EDITOR_DEFAULT_VARIANTS, tn as KAESO_QUESTION_EDITOR_VARIANTS, qe as KAESO_REASONING_DEFAULT_VARIANTS, Ke as KAESO_REASONING_VARIANTS, at as KAESO_RESPONSE_METRICS_DEFAULT_VARIANTS, it as KAESO_RESPONSE_METRICS_VARIANTS, Ze as KAESO_RESPONSE_VIEW_DEFAULT_VARIANTS, Xe as KAESO_RESPONSE_VIEW_VARIANTS, Fe as MediaResponse, At as ModelPicker, yt as ParameterPanel, Ft as ProbabilityBar, un as QuestionEditor, Ye as Reasoning, ut as ResponseMetrics, et as ResponseView, rt as Thread, nt as UserMessage, ot as formatLatency, kt as useModelGroups };
2329
2334
 
2330
2335
  //# sourceMappingURL=playground.js.map