@rpcbase/agents-sdk 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/agents-sdk.css +1 -1
  2. package/dist/api/chat/handler.d.ts +2 -1
  3. package/dist/api/chat/handler.d.ts.map +1 -1
  4. package/dist/api/chat/toolApproval.d.ts.map +1 -1
  5. package/dist/api/chatDb.d.ts +1 -0
  6. package/dist/api/chatDb.d.ts.map +1 -1
  7. package/dist/api/chatStore.d.ts +1 -0
  8. package/dist/api/chatStore.d.ts.map +1 -1
  9. package/dist/{chatDb-DwhaaOmO.js → chatDb-Cz7QrJEO.js} +20 -10
  10. package/dist/{chatDb-DTjvCb7r.js → chatDb-DN3gG0rE.js} +20 -10
  11. package/dist/client-routes.browser.js +1 -1
  12. package/dist/client-routes.js +1 -1
  13. package/dist/components/message-actions.d.ts.map +1 -1
  14. package/dist/components/message.d.ts.map +1 -1
  15. package/dist/components/sidebar-history-item.d.ts.map +1 -1
  16. package/dist/components/sidebar-history.d.ts +2 -1
  17. package/dist/components/sidebar-history.d.ts.map +1 -1
  18. package/dist/{data-stream-handler-C-APWWFX.js → data-stream-handler-BF2hMP90.js} +879 -860
  19. package/dist/{data-stream-handler-CE4hrlns.js → data-stream-handler-nmD-b7vk.js} +879 -860
  20. package/dist/{handler-RTP9W4lT.js → handler-C6oMmAvW.js} +1 -1
  21. package/dist/{handler-Bj8-MkNf.js → handler-CkkGxcAy.js} +523 -507
  22. package/dist/{handler-DtSnDhW2.js → handler-Clz26ndM.js} +1 -1
  23. package/dist/{handler-hTPifowr.js → handler-D63zn0W5.js} +1 -1
  24. package/dist/{handler-C3GOpsFS.js → handler-DUaBZkpS.js} +1 -1
  25. package/dist/{handler-B-erVnQ6.js → handler-DXYE_QcX.js} +1 -1
  26. package/dist/{handler-CsNuMrRb.js → handler-DdjrldqF.js} +1 -1
  27. package/dist/{handler-BnDd10G3.js → handler-DhvGNj_T.js} +1 -1
  28. package/dist/{handler-0bIpqvbt.js → handler-DkRxnOUN.js} +1 -1
  29. package/dist/{handler-By4I5hjo.js → handler-Do5xRfzR.js} +1 -1
  30. package/dist/{handler-DAcB4fHJ.js → handler-DxEfTi-F.js} +1 -1
  31. package/dist/{handler-M3fJUpy0.js → handler-ICOAej54.js} +446 -430
  32. package/dist/{handler-Bsto5ImB.js → handler-jQOdtyET.js} +1 -1
  33. package/dist/{handler-BLKbyYqI.js → handler-moTb7fZ2.js} +1 -1
  34. package/dist/{handler-CNnPLVlT.js → handler-pmPm2R2f.js} +1 -1
  35. package/dist/{handler-DUljRc5z.js → handler-yu9qDThP.js} +1 -1
  36. package/dist/index.browser.js +1 -1
  37. package/dist/index.js +1 -1
  38. package/dist/lib/reasoning-parts.d.ts +8 -0
  39. package/dist/lib/reasoning-parts.d.ts.map +1 -0
  40. package/dist/lib/types.d.ts +1 -0
  41. package/dist/lib/types.d.ts.map +1 -1
  42. package/dist/models/RBAgentsChatThread.d.ts +1 -0
  43. package/dist/models/RBAgentsChatThread.d.ts.map +1 -1
  44. package/dist/models.browser.js +1 -0
  45. package/dist/models.js +8 -2
  46. package/dist/routes.browser.js +8 -8
  47. package/dist/routes.js +8 -8
  48. package/dist/runtime.js +1 -1
  49. package/dist/tailwind-source.js +1 -1
  50. package/package.json +6 -6
@@ -44043,7 +44043,13 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44043
44043
  isStaleStreaming: n,
44044
44044
  isStreaming: r,
44045
44045
  title: s
44046
- }), { getChatPath: l } = Qe(), u = sy(e.id), [d, f] = z(!1), p = R(null), m = R(null), h = (e) => {
44046
+ }), { getChatPath: l } = Qe(), u = sy(e.id), [d, f] = z(!1), p = R(null), m = R(null), h = r ? /* @__PURE__ */ V("span", {
44047
+ className: "mr-0.5 shrink-0",
44048
+ children: /* @__PURE__ */ V(cy, { label: "Conversation is streaming" })
44049
+ }) : n ? /* @__PURE__ */ V("span", {
44050
+ className: "mr-0.5 shrink-0",
44051
+ children: /* @__PURE__ */ V(ly, {})
44052
+ }) : null, g = (e) => {
44047
44053
  let t = e.relatedTarget;
44048
44054
  if (!(t instanceof Node)) {
44049
44055
  f(!1);
@@ -44053,6 +44059,7 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44053
44059
  };
44054
44060
  return /* @__PURE__ */ H(b_, { children: [/* @__PURE__ */ V(S_, {
44055
44061
  asChild: !0,
44062
+ className: c === void 0 ? void 0 : "h-auto min-h-12 py-2",
44056
44063
  isActive: t,
44057
44064
  children: /* @__PURE__ */ V(ne, {
44058
44065
  className: "flex min-w-0 items-center gap-2",
@@ -44061,13 +44068,7 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44061
44068
  children: c === void 0 ? /* @__PURE__ */ H(ce, { children: [/* @__PURE__ */ V("span", {
44062
44069
  className: "min-w-0 flex-1 truncate",
44063
44070
  children: s
44064
- }), r ? /* @__PURE__ */ V("span", {
44065
- className: "mr-0.5 shrink-0",
44066
- children: /* @__PURE__ */ V(cy, { label: "Conversation is streaming" })
44067
- }) : n ? /* @__PURE__ */ V("span", {
44068
- className: "mr-0.5 shrink-0",
44069
- children: /* @__PURE__ */ V(ly, {})
44070
- }) : null] }) : c
44071
+ }), h] }) : /* @__PURE__ */ H(ce, { children: [c, h] })
44071
44072
  })
44072
44073
  }), /* @__PURE__ */ H(Yv, {
44073
44074
  modal: !0,
@@ -44078,9 +44079,9 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44078
44079
  children: /* @__PURE__ */ H(C_, {
44079
44080
  className: "mr-0.5 data-open:bg-sidebar-accent data-open:text-sidebar-accent-foreground",
44080
44081
  id: u,
44081
- onMouseLeave: h,
44082
+ onMouseLeave: g,
44082
44083
  ref: p,
44083
- showOnHover: !t,
44084
+ showOnHover: r || n || !t,
44084
44085
  children: [/* @__PURE__ */ V(mt, {}), /* @__PURE__ */ V("span", {
44085
44086
  className: "sr-only",
44086
44087
  children: "More"
@@ -44088,7 +44089,7 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44088
44089
  })
44089
44090
  }), /* @__PURE__ */ V(Qv, {
44090
44091
  align: "end",
44091
- onMouseLeave: h,
44092
+ onMouseLeave: g,
44092
44093
  ref: m,
44093
44094
  side: "bottom",
44094
44095
  children: /* @__PURE__ */ H(ty, {
@@ -44104,6 +44105,7 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44104
44105
  _id: 1,
44105
44106
  id: 1,
44106
44107
  createdAt: 1,
44108
+ lastActivityAt: 1,
44107
44109
  title: 1,
44108
44110
  userId: 1,
44109
44111
  isStreaming: 1,
@@ -44111,19 +44113,26 @@ var uy = ({ chat: e, isActive: t, isStaleStreaming: n, isStreaming: r, onDelete:
44111
44113
  },
44112
44114
  pagination: {
44113
44115
  limit: dy,
44114
- sort: [{
44115
- field: "createdAt",
44116
- order: "desc"
44117
- }, {
44118
- field: "_id",
44119
- order: "desc"
44120
- }]
44116
+ sort: [
44117
+ {
44118
+ field: "lastActivityAt",
44119
+ order: "desc"
44120
+ },
44121
+ {
44122
+ field: "createdAt",
44123
+ order: "desc"
44124
+ },
44125
+ {
44126
+ field: "_id",
44127
+ order: "desc"
44128
+ }
44129
+ ]
44121
44130
  },
44122
44131
  ssr: "auto"
44123
44132
  }, my = (e) => {
44124
44133
  let t = /* @__PURE__ */ new Date(), n = mi(t, 1), r = pi(t, 1);
44125
44134
  return e.reduce((e, t) => {
44126
- let i = new Date(t.createdAt);
44135
+ let i = new Date(t.lastActivityAt);
44127
44136
  return li(i) ? e.today.push(t) : fi(i) ? e.yesterday.push(t) : i > n ? e.lastWeek.push(t) : i > r ? e.lastMonth.push(t) : e.older.push(t), e;
44128
44137
  }, {
44129
44138
  today: [],
@@ -54967,7 +54976,7 @@ function FR(e, t = !0) {
54967
54976
  //#endregion
54968
54977
  //#region src/components/artifact-actions.tsx
54969
54978
  function IR({ artifact: e, handleVersionChange: t, currentVersionIndex: n, isCurrentVersion: r, mode: i, metadata: a, setMetadata: o }) {
54970
- let [s, c] = z(!1), l = bW.find((t) => t.kind === e.kind);
54979
+ let [s, c] = z(!1), l = xW.find((t) => t.kind === e.kind);
54971
54980
  if (!l) throw Error("Artifact definition not found!");
54972
54981
  let u = {
54973
54982
  content: e.content,
@@ -55111,16 +55120,47 @@ function VR({ status: e }) {
55111
55120
  };
55112
55121
  }
55113
55122
  //#endregion
55123
+ //#region src/lib/reasoning-parts.ts
55124
+ function HR(e, t) {
55125
+ let n = [];
55126
+ for (let r = 0; r < t.length; r++) {
55127
+ let i = t[r];
55128
+ if (i.type !== "reasoning") {
55129
+ n.push({
55130
+ part: i,
55131
+ key: `message-${e}-part-${r}`
55132
+ });
55133
+ continue;
55134
+ }
55135
+ let a = [i.text ?? ""], o = i.state === "streaming", s = i.providerMetadata, c = r + 1;
55136
+ for (; c < t.length;) {
55137
+ let e = t[c];
55138
+ if (e.type !== "reasoning") break;
55139
+ a.push(e.text ?? ""), o ||= e.state === "streaming", s = e.providerMetadata ?? s, c++;
55140
+ }
55141
+ n.push({
55142
+ part: {
55143
+ ...i,
55144
+ text: a.filter((e) => e.length > 0).join("\n\n"),
55145
+ state: o ? "streaming" : "done",
55146
+ providerMetadata: s
55147
+ },
55148
+ key: `message-${e}-reasoning-${r}`
55149
+ }), r = c - 1;
55150
+ }
55151
+ return n;
55152
+ }
55153
+ //#endregion
55114
55154
  //#region src/lib/tool-approval-decisions.ts
55115
- var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e) => typeof e == "object" && !!e && !Array.isArray(e), WR = (e) => {
55155
+ var UR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), WR = (e) => typeof e == "object" && !!e && !Array.isArray(e), GR = (e) => {
55116
55156
  let t = /* @__PURE__ */ new Map();
55117
55157
  for (let n of e) {
55118
55158
  if (n.type !== "data-tool-approval-decision") continue;
55119
55159
  let e = n.data;
55120
- UR(e) && typeof e.toolCallId == "string" && typeof e.reason == "string" && e.reason.trim() && t.set(e.toolCallId, e.reason.trim());
55160
+ WR(e) && typeof e.toolCallId == "string" && typeof e.reason == "string" && e.reason.trim() && t.set(e.toolCallId, e.reason.trim());
55121
55161
  }
55122
55162
  return t.size === 0 ? e : e.map((e) => {
55123
- if (!HR(e)) return e;
55163
+ if (!UR(e)) return e;
55124
55164
  let n = e, r = n.toolCallId ? t.get(n.toolCallId) : void 0;
55125
55165
  return !r || !n.approval || n.approval.reason ? e : {
55126
55166
  ...e,
@@ -55130,7 +55170,7 @@ var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e
55130
55170
  }
55131
55171
  };
55132
55172
  });
55133
- }, GR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
55173
+ }, KR = he("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
55134
55174
  variants: { variant: {
55135
55175
  default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
55136
55176
  secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
@@ -55139,15 +55179,15 @@ var HR = (e) => e.type === "dynamic-tool" || e.type.startsWith("tool-"), UR = (e
55139
55179
  } },
55140
55180
  defaultVariants: { variant: "default" }
55141
55181
  });
55142
- function KR({ className: e, variant: t, ...n }) {
55182
+ function qR({ className: e, variant: t, ...n }) {
55143
55183
  return /* @__PURE__ */ V("div", {
55144
- className: U(GR({ variant: t }), e),
55184
+ className: U(KR({ variant: t }), e),
55145
55185
  ...n
55146
55186
  });
55147
55187
  }
55148
55188
  //#endregion
55149
55189
  //#region ../../node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs
55150
- function qR(e) {
55190
+ function JR(e) {
55151
55191
  let { open: t, defaultOpen: n, onOpenChange: r, disabled: i } = e, [a, o] = R_({
55152
55192
  controlled: t,
55153
55193
  default: n,
@@ -55181,28 +55221,28 @@ function qR(e) {
55181
55221
  }
55182
55222
  //#endregion
55183
55223
  //#region ../../node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs
55184
- var JR = /* @__PURE__ */ y.createContext(void 0);
55185
- process.env.NODE_ENV !== "production" && (JR.displayName = "CollapsibleRootContext");
55186
- function YR() {
55187
- let e = y.useContext(JR);
55224
+ var YR = /* @__PURE__ */ y.createContext(void 0);
55225
+ process.env.NODE_ENV !== "production" && (YR.displayName = "CollapsibleRootContext");
55226
+ function XR() {
55227
+ let e = y.useContext(YR);
55188
55228
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(15) : "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");
55189
55229
  return e;
55190
55230
  }
55191
55231
  //#endregion
55192
55232
  //#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs
55193
- var XR = function(e) {
55233
+ var ZR = function(e) {
55194
55234
  return e.open = "data-open", e.closed = "data-closed", e[e.startingStyle = Yd.startingStyle] = "startingStyle", e[e.endingStyle = Yd.endingStyle] = "endingStyle", e;
55195
- }({}), ZR = /* @__PURE__ */ function(e) {
55235
+ }({}), QR = /* @__PURE__ */ function(e) {
55196
55236
  return e.panelOpen = "data-panel-open", e;
55197
- }({}), QR = { [XR.open]: "" }, $R = { [XR.closed]: "" }, ez = { open(e) {
55198
- return e ? { [ZR.panelOpen]: "" } : null;
55199
- } }, tz = {
55237
+ }({}), $R = { [ZR.open]: "" }, ez = { [ZR.closed]: "" }, tz = { open(e) {
55238
+ return e ? { [QR.panelOpen]: "" } : null;
55239
+ } }, nz = {
55200
55240
  open(e) {
55201
- return e ? QR : $R;
55241
+ return e ? $R : ez;
55202
55242
  },
55203
55243
  ...Qd
55204
- }, nz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55205
- let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d = qR({
55244
+ }, rz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55245
+ let { render: n, className: r, defaultOpen: i = !1, disabled: a = !1, onOpenChange: o, open: s, style: c, ...l } = e, u = J(o), d = JR({
55206
55246
  open: s,
55207
55247
  defaultOpen: i,
55208
55248
  onOpenChange: u,
@@ -55227,21 +55267,21 @@ var XR = function(e) {
55227
55267
  state: f,
55228
55268
  ref: t,
55229
55269
  props: l,
55230
- stateAttributesMapping: tz
55270
+ stateAttributesMapping: nz
55231
55271
  });
55232
- return /* @__PURE__ */ V(JR.Provider, {
55272
+ return /* @__PURE__ */ V(YR.Provider, {
55233
55273
  value: p,
55234
55274
  children: m
55235
55275
  });
55236
55276
  });
55237
- process.env.NODE_ENV !== "production" && (nz.displayName = "CollapsibleRoot");
55277
+ process.env.NODE_ENV !== "production" && (rz.displayName = "CollapsibleRoot");
55238
55278
  //#endregion
55239
55279
  //#region ../../node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs
55240
- var rz = {
55241
- ...ez,
55280
+ var iz = {
55281
+ ...tz,
55242
55282
  ...Qd
55243
- }, iz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55244
- let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } = YR(), { className: s, disabled: c = o, render: l, nativeButton: u = !0, style: d, ...f } = e, { getButtonProps: p, buttonRef: m } = Ep({
55283
+ }, az = /* @__PURE__ */ y.forwardRef(function(e, t) {
55284
+ let { panelId: n, open: r, handleTrigger: i, state: a, disabled: o } = XR(), { className: s, disabled: c = o, render: l, nativeButton: u = !0, style: d, ...f } = e, { getButtonProps: p, buttonRef: m } = Ep({
55245
55285
  disabled: c,
55246
55286
  focusableWhenDisabled: !0,
55247
55287
  native: u
@@ -55258,18 +55298,18 @@ var rz = {
55258
55298
  f,
55259
55299
  p
55260
55300
  ],
55261
- stateAttributesMapping: rz
55301
+ stateAttributesMapping: iz
55262
55302
  });
55263
55303
  });
55264
- process.env.NODE_ENV !== "production" && (iz.displayName = "CollapsibleTrigger");
55304
+ process.env.NODE_ENV !== "production" && (az.displayName = "CollapsibleTrigger");
55265
55305
  //#endregion
55266
55306
  //#region ../../node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs
55267
- var az = {
55307
+ var oz = {
55268
55308
  height: void 0,
55269
55309
  width: void 0
55270
55310
  };
55271
- function oz(e) {
55272
- let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(az), h = y.useRef(az), g = y.useRef(!1), _ = y.useRef(s), v = y.useRef(!1), [b, x] = y.useState(!1), S = y.useRef(null), C = So(t, d), w = Oo({
55311
+ function sz(e) {
55312
+ let { externalRef: t, hiddenUntilFound: n, id: r, keepMounted: i, mounted: a, onOpenChange: o, open: s, setMounted: c, setOpen: l, transitionStatus: u } = e, d = y.useRef(null), f = y.useRef(null), [p, m] = y.useState(oz), h = y.useRef(oz), g = y.useRef(!1), _ = y.useRef(s), v = y.useRef(!1), [b, x] = y.useState(!1), S = y.useRef(null), C = So(t, d), w = Oo({
55273
55313
  mounted: a,
55274
55314
  open: s
55275
55315
  }), T = $d(d, !1, !1), E = !s && !a, D = b ? "idle" : u, O = s && (_.current || v.current), k = !s && a && f.current === "css-animation" && p.height === void 0 && p.width === void 0 ? h.current : p, A = n && E && f.current !== "css-animation", j = J((e, t = !0) => {
@@ -55291,37 +55331,37 @@ function oz(e) {
55291
55331
  let e = d.current;
55292
55332
  if (!e) return;
55293
55333
  !s && S.current && M();
55294
- let t = cz(e, O);
55334
+ let t = lz(e, O);
55295
55335
  if (f.current = t, s && u === "idle" && _.current && t === "css-animation") {
55296
- h.current = sz(e);
55336
+ h.current = cz(e);
55297
55337
  return;
55298
55338
  }
55299
55339
  if (s && u === "starting") {
55300
55340
  let n = g.current;
55301
55341
  if (g.current = !1, t === "none") {
55302
- j(sz(e)), x(!0);
55342
+ j(cz(e)), x(!0);
55303
55343
  return;
55304
55344
  }
55305
55345
  if (t === "css-transition") {
55306
- let t = dz(e);
55307
- return j(sz(e)), n ? (N(uz(e, "transition-duration", "0s")), x(!0), t) : t;
55346
+ let t = fz(e);
55347
+ return j(cz(e)), n ? (N(dz(e, "transition-duration", "0s")), x(!0), t) : t;
55308
55348
  }
55309
55349
  if (t === "css-animation") {
55310
- if (j(sz(e)), !n) {
55311
- uz(e, "animation-name", "none")();
55350
+ if (j(cz(e)), !n) {
55351
+ dz(e, "animation-name", "none")();
55312
55352
  return;
55313
55353
  }
55314
- let t = uz(e, "animation-name", "none"), r = uz(e, "animation-duration", "0s");
55354
+ let t = dz(e, "animation-name", "none"), r = dz(e, "animation-duration", "0s");
55315
55355
  t(), N(r), x(!0);
55316
55356
  return;
55317
55357
  }
55318
55358
  }
55319
55359
  if (!s && a && (u === "idle" || u === "starting")) {
55320
55360
  if (_.current = !1, v.current = !1, t === "none") {
55321
- j(az, !1), c(!1);
55361
+ j(oz, !1), c(!1);
55322
55362
  return;
55323
55363
  }
55324
- j(sz(e));
55364
+ j(cz(e));
55325
55365
  return;
55326
55366
  }
55327
55367
  if (u !== "ending") return;
@@ -55329,12 +55369,12 @@ function oz(e) {
55329
55369
  c(!1);
55330
55370
  return;
55331
55371
  }
55332
- let n = sz(e);
55372
+ let n = cz(e);
55333
55373
  if (!((n.height ?? 0) > 0 || (n.width ?? 0) > 0)) {
55334
55374
  c(!1);
55335
55375
  return;
55336
55376
  }
55337
- j(n), t === "css-animation" && uz(e, "animation-name", "none")();
55377
+ j(n), t === "css-animation" && dz(e, "animation-name", "none")();
55338
55378
  }, [
55339
55379
  a,
55340
55380
  s,
@@ -55349,13 +55389,13 @@ function oz(e) {
55349
55389
  open: !0,
55350
55390
  ref: d,
55351
55391
  onComplete() {
55352
- s && j(az, !1);
55392
+ s && j(oz, !1);
55353
55393
  }
55354
55394
  }), y.useEffect(() => {
55355
55395
  if (s || !a || D !== "ending" || !d.current) return;
55356
55396
  let e = new AbortController(), t = -1;
55357
55397
  function n() {
55358
- w.current.open || (c(!1), j(az, !1));
55398
+ w.current.open || (c(!1), j(oz, !1));
55359
55399
  }
55360
55400
  return t = pa.request(() => {
55361
55401
  e.signal.aborted || T(n, e.signal);
@@ -55386,7 +55426,7 @@ function oz(e) {
55386
55426
  return {
55387
55427
  height: k.height,
55388
55428
  props: {
55389
- ...A ? { [XR.startingStyle]: "" } : void 0,
55429
+ ...A ? { [ZR.startingStyle]: "" } : void 0,
55390
55430
  hidden: E,
55391
55431
  id: r
55392
55432
  },
@@ -55397,20 +55437,20 @@ function oz(e) {
55397
55437
  width: k.width
55398
55438
  };
55399
55439
  }
55400
- function sz(e) {
55440
+ function cz(e) {
55401
55441
  return {
55402
55442
  height: e.scrollHeight,
55403
55443
  width: e.scrollWidth
55404
55444
  };
55405
55445
  }
55406
- function cz(e, t = !1) {
55407
- let n = vi(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) && lz(n.animationDuration), i = lz(n.transitionDuration);
55446
+ function lz(e, t = !1) {
55447
+ let n = vi(e).getComputedStyle(e), r = (n.animationName.split(",").map((e) => e.trim()).some((e) => e !== "" && e !== "none") || t) && uz(n.animationDuration), i = uz(n.transitionDuration);
55408
55448
  return r && i ? (process.env.NODE_ENV !== "production" && yc("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.", "Only one of either animation type should be used."), "css-transition") : i ? "css-transition" : r ? "css-animation" : "none";
55409
55449
  }
55410
- function lz(e) {
55450
+ function uz(e) {
55411
55451
  return e.split(",").map((e) => e.trim()).some((e) => e !== "" && Number.parseFloat(e) > 0);
55412
55452
  }
55413
- function uz(e, t, n) {
55453
+ function dz(e, t, n) {
55414
55454
  let r = e.style.getPropertyValue(t), i = e.style.getPropertyPriority(t);
55415
55455
  return e.style.setProperty(t, n), () => {
55416
55456
  if (r === "") {
@@ -55420,7 +55460,7 @@ function uz(e, t, n) {
55420
55460
  e.style.setProperty(t, r, i);
55421
55461
  };
55422
55462
  }
55423
- function dz(e) {
55463
+ function fz(e) {
55424
55464
  let t = {
55425
55465
  "justify-content": e.style.justifyContent,
55426
55466
  "align-items": e.style.alignItems,
@@ -55446,20 +55486,20 @@ function dz(e) {
55446
55486
  }
55447
55487
  //#endregion
55448
55488
  //#region ../../node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs
55449
- var fz = /* @__PURE__ */ function(e) {
55489
+ var pz = /* @__PURE__ */ function(e) {
55450
55490
  return e.collapsiblePanelHeight = "--collapsible-panel-height", e.collapsiblePanelWidth = "--collapsible-panel-width", e;
55451
- }({}), pz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55491
+ }({}), mz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55452
55492
  let { className: n, hiddenUntilFound: r, keepMounted: i, render: a, id: o, style: s, ...c } = e;
55453
55493
  process.env.NODE_ENV !== "production" && K(() => {
55454
55494
  r && i === !1 && yc("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed.");
55455
55495
  }, [r, i]);
55456
- let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } = YR(), v = r ?? !1, y = i ?? !1;
55496
+ let { mounted: l, onOpenChange: u, open: d, panelId: f, setMounted: p, setPanelIdState: m, setOpen: h, state: g, transitionStatus: _ } = XR(), v = r ?? !1, y = i ?? !1;
55457
55497
  K(() => {
55458
55498
  if (o) return m(o), () => {
55459
55499
  m(void 0);
55460
55500
  };
55461
55501
  }, [o, m]);
55462
- let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } = oz({
55502
+ let { height: b, props: x, ref: S, shouldPreventOpenAnimation: C, shouldRender: w, transitionStatus: T, width: E } = sz({
55463
55503
  externalRef: t,
55464
55504
  hiddenUntilFound: v,
55465
55505
  id: f,
@@ -55482,45 +55522,45 @@ var fz = /* @__PURE__ */ function(e) {
55482
55522
  props: [
55483
55523
  x,
55484
55524
  { style: {
55485
- [fz.collapsiblePanelHeight]: b === void 0 ? "auto" : `${b}px`,
55486
- [fz.collapsiblePanelWidth]: E === void 0 ? "auto" : `${E}px`
55525
+ [pz.collapsiblePanelHeight]: b === void 0 ? "auto" : `${b}px`,
55526
+ [pz.collapsiblePanelWidth]: E === void 0 ? "auto" : `${E}px`
55487
55527
  } },
55488
55528
  c,
55489
55529
  O ? { style: O } : void 0,
55490
55530
  C ? { style: { animationName: "none" } } : void 0
55491
55531
  ],
55492
- stateAttributesMapping: tz
55532
+ stateAttributesMapping: nz
55493
55533
  });
55494
55534
  return w ? k : null;
55495
55535
  });
55496
- process.env.NODE_ENV !== "production" && (pz.displayName = "CollapsiblePanel");
55536
+ process.env.NODE_ENV !== "production" && (mz.displayName = "CollapsiblePanel");
55497
55537
  //#endregion
55498
55538
  //#region src/components/ui/collapsible.tsx
55499
- var mz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(nz, {
55539
+ var hz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(rz, {
55500
55540
  render: um(e, t),
55501
55541
  ref: r,
55502
55542
  ...n,
55503
55543
  children: t
55504
55544
  }));
55505
- mz.displayName = "Collapsible";
55506
- var hz = y.forwardRef(({ className: e, asChild: t = !1, children: n, ...r }, i) => /* @__PURE__ */ V(iz, {
55545
+ hz.displayName = "Collapsible";
55546
+ var gz = y.forwardRef(({ className: e, asChild: t = !1, children: n, ...r }, i) => /* @__PURE__ */ V(az, {
55507
55547
  className: U("cursor-pointer disabled:cursor-not-allowed", e),
55508
55548
  render: um(t, n),
55509
55549
  ref: i,
55510
55550
  ...r,
55511
55551
  children: n
55512
55552
  }));
55513
- hz.displayName = "CollapsibleTrigger";
55514
- var gz = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(pz, {
55553
+ gz.displayName = "CollapsibleTrigger";
55554
+ var _z = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(mz, {
55515
55555
  render: um(e, t),
55516
55556
  ref: r,
55517
55557
  ...n,
55518
55558
  children: t
55519
55559
  }));
55520
- gz.displayName = "CollapsibleContent";
55560
+ _z.displayName = "CollapsibleContent";
55521
55561
  //#endregion
55522
55562
  //#region src/components/ai-elements/code-block.tsx
55523
- var _z = w({ code: "" }), vz = {
55563
+ var vz = w({ code: "" }), yz = {
55524
55564
  name: "line-numbers",
55525
55565
  line(e, t) {
55526
55566
  e.children.unshift({
@@ -55541,8 +55581,8 @@ var _z = w({ code: "" }), vz = {
55541
55581
  });
55542
55582
  }
55543
55583
  };
55544
- async function yz(e, t, n = !1) {
55545
- let r = n ? [vz] : [];
55584
+ async function bz(e, t, n = !1) {
55585
+ let r = n ? [yz] : [];
55546
55586
  return await Promise.all([Je(e, {
55547
55587
  lang: t,
55548
55588
  theme: "one-light",
@@ -55553,11 +55593,11 @@ async function yz(e, t, n = !1) {
55553
55593
  transformers: r
55554
55594
  })]);
55555
55595
  }
55556
- var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, children: i, ...a }) => {
55596
+ var xz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, children: i, ...a }) => {
55557
55597
  let [o, s] = z(""), [c, l] = z("");
55558
55598
  j(() => {
55559
55599
  let r = !1;
55560
- return s(""), l(""), yz(e, t, n).then(([e, t]) => {
55600
+ return s(""), l(""), bz(e, t, n).then(([e, t]) => {
55561
55601
  r || (s(e), l(t));
55562
55602
  }), () => {
55563
55603
  r = !0;
@@ -55568,7 +55608,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55568
55608
  n
55569
55609
  ]);
55570
55610
  let u = o.length > 0 && c.length > 0;
55571
- return /* @__PURE__ */ V(_z.Provider, {
55611
+ return /* @__PURE__ */ V(vz.Provider, {
55572
55612
  value: { code: e },
55573
55613
  children: /* @__PURE__ */ V("div", {
55574
55614
  className: U("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", r),
@@ -55591,10 +55631,10 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55591
55631
  })
55592
55632
  })
55593
55633
  });
55594
- }, xz = ({ className: e, ...t }) => /* @__PURE__ */ V(mz, {
55634
+ }, Sz = ({ className: e, ...t }) => /* @__PURE__ */ V(hz, {
55595
55635
  className: U("group not-prose w-full rounded-md border", e),
55596
55636
  ...t
55597
- }), Sz = {
55637
+ }), Cz = {
55598
55638
  "approval-requested": "Awaiting Approval",
55599
55639
  "approval-responded": "Responded",
55600
55640
  "input-available": "Running",
@@ -55602,7 +55642,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55602
55642
  "output-available": "Completed",
55603
55643
  "output-denied": "Denied",
55604
55644
  "output-error": "Error"
55605
- }, Cz = {
55645
+ }, wz = {
55606
55646
  "approval-requested": /* @__PURE__ */ V(vh, { className: "size-4 text-muted-foreground" }),
55607
55647
  "approval-responded": /* @__PURE__ */ V(hh, { className: "size-4 text-foreground" }),
55608
55648
  "input-available": /* @__PURE__ */ V(bh, { className: "size-4 animate-spin" }),
@@ -55610,13 +55650,13 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55610
55650
  "output-available": /* @__PURE__ */ V(hh, { className: "size-4 text-foreground" }),
55611
55651
  "output-denied": /* @__PURE__ */ V(gh, { className: "size-4 text-muted-foreground" }),
55612
55652
  "output-error": /* @__PURE__ */ V(gh, { className: "size-4 text-destructive" })
55613
- }, wz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : Sz[e], Tz = (e, t) => /* @__PURE__ */ H(KR, {
55653
+ }, Tz = (e, t) => t?.isAutomatic && t.approved === !0 ? "Auto-approved" : e === "approval-responded" && t?.approved === !0 ? "Approved" : Cz[e], Ez = (e, t) => /* @__PURE__ */ H(qR, {
55614
55654
  className: "gap-1.5 rounded-full text-xs",
55615
55655
  variant: "secondary",
55616
- children: [Cz[e], wz(e, t)]
55617
- }), Ez = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
55656
+ children: [wz[e], Tz(e, t)]
55657
+ }), Dz = ({ className: e, title: t, type: n, state: r, toolName: i, approval: a, ...o }) => {
55618
55658
  let s = n === "dynamic-tool" ? i : n.split("-").slice(1).join("-");
55619
- return /* @__PURE__ */ H(hz, {
55659
+ return /* @__PURE__ */ H(gz, {
55620
55660
  className: U("flex w-full items-center justify-between gap-4 p-3", e),
55621
55661
  ...o,
55622
55662
  children: [/* @__PURE__ */ H("div", {
@@ -55627,15 +55667,15 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55627
55667
  className: "font-medium text-sm",
55628
55668
  children: t ?? s
55629
55669
  }),
55630
- Tz(r, a)
55670
+ Ez(r, a)
55631
55671
  ]
55632
55672
  }), /* @__PURE__ */ V(fh, { className: "size-4 text-muted-foreground group-data-open:rotate-180" })]
55633
55673
  });
55634
- }, Dz = ({ className: e, ...t }) => /* @__PURE__ */ V(gz, {
55674
+ }, Oz = ({ className: e, ...t }) => /* @__PURE__ */ V(_z, {
55635
55675
  className: U("space-y-4 p-4 text-popover-foreground outline-none", e),
55636
55676
  ...t
55637
- }), Oz = 5, kz = ({ className: e, input: t, ...n }) => {
55638
- let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > Oz && !r;
55677
+ }), kz = 5, Az = ({ className: e, input: t, ...n }) => {
55678
+ let [r, i] = z(!1), a = JSON.stringify(t, null, 2) ?? String(t), o = a.split("\n").length > kz && !r;
55639
55679
  return /* @__PURE__ */ H("div", {
55640
55680
  className: U("space-y-2 overflow-hidden", e),
55641
55681
  ...n,
@@ -55644,7 +55684,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55644
55684
  children: "Parameters"
55645
55685
  }), /* @__PURE__ */ H("div", {
55646
55686
  className: "relative rounded-md bg-muted/50",
55647
- children: [/* @__PURE__ */ V(bz, {
55687
+ children: [/* @__PURE__ */ V(xz, {
55648
55688
  className: U("transition-[max-height] duration-200", o && "max-h-[8.25rem]"),
55649
55689
  code: a,
55650
55690
  language: "json"
@@ -55659,13 +55699,13 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55659
55699
  })] })]
55660
55700
  })]
55661
55701
  });
55662
- }, Az = ({ className: e, output: t, errorText: n, ...r }) => {
55702
+ }, jz = ({ className: e, output: t, errorText: n, ...r }) => {
55663
55703
  if (!(t || n)) return null;
55664
55704
  let i = /* @__PURE__ */ V("div", { children: t });
55665
- return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(bz, {
55705
+ return typeof t == "object" && !D(t) ? i = /* @__PURE__ */ V(xz, {
55666
55706
  code: JSON.stringify(t, null, 2),
55667
55707
  language: "json"
55668
- }) : typeof t == "string" && (i = /* @__PURE__ */ V(bz, {
55708
+ }) : typeof t == "string" && (i = /* @__PURE__ */ V(xz, {
55669
55709
  code: t,
55670
55710
  language: "json"
55671
55711
  })), /* @__PURE__ */ H("div", {
@@ -55679,7 +55719,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55679
55719
  children: [n && /* @__PURE__ */ V("div", { children: n }), i]
55680
55720
  })]
55681
55721
  });
55682
- }, jz = (e, t) => {
55722
+ }, Mz = (e, t) => {
55683
55723
  switch (e) {
55684
55724
  case "create": return t === "present" ? "Creating" : "Created";
55685
55725
  case "update": return t === "present" ? "Updating" : "Updated";
@@ -55687,7 +55727,7 @@ var bz = ({ code: e, language: t, showLineNumbers: n = !1, className: r, childre
55687
55727
  default: return null;
55688
55728
  }
55689
55729
  };
55690
- function Mz({ type: e, result: t, isReadonly: n }) {
55730
+ function Nz({ type: e, result: t, isReadonly: n }) {
55691
55731
  let { setArtifact: r } = DS();
55692
55732
  return /* @__PURE__ */ H("button", {
55693
55733
  className: "flex w-fit cursor-pointer flex-row items-center gap-2 rounded-xl border bg-background px-3 py-2",
@@ -55718,12 +55758,12 @@ function Mz({ type: e, result: t, isReadonly: n }) {
55718
55758
  children: e === "create" ? /* @__PURE__ */ V(ct, {}) : e === "update" ? /* @__PURE__ */ V(ut, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(ht, {}) : null
55719
55759
  }), /* @__PURE__ */ V("div", {
55720
55760
  className: "text-left",
55721
- children: `${jz(e, "past")} "${t.title}"`
55761
+ children: `${Mz(e, "past")} "${t.title}"`
55722
55762
  })]
55723
55763
  });
55724
55764
  }
55725
- var Nz = O(Mz, () => !0);
55726
- function Pz({ type: e, args: t, isReadonly: n }) {
55765
+ var Pz = O(Nz, () => !0);
55766
+ function Fz({ type: e, args: t, isReadonly: n }) {
55727
55767
  let { setArtifact: r } = DS();
55728
55768
  return /* @__PURE__ */ H("button", {
55729
55769
  className: "flex w-fit cursor-pointer flex-row items-start justify-between gap-3 rounded-xl border px-3 py-2",
@@ -55752,7 +55792,7 @@ function Pz({ type: e, args: t, isReadonly: n }) {
55752
55792
  children: e === "create" ? /* @__PURE__ */ V(ct, {}) : e === "update" ? /* @__PURE__ */ V(ut, {}) : e === "request-suggestions" ? /* @__PURE__ */ V(ht, {}) : null
55753
55793
  }), /* @__PURE__ */ V("div", {
55754
55794
  className: "text-left",
55755
- children: `${jz(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
55795
+ children: `${Mz(e, "present")} ${e === "create" && "title" in t && t.title ? `"${t.title}"` : e === "update" && "description" in t ? `"${t.description}"` : e === "request-suggestions" ? "for document" : ""}`
55756
55796
  })]
55757
55797
  }), /* @__PURE__ */ V("div", {
55758
55798
  className: "mt-1 animate-spin",
@@ -55760,10 +55800,10 @@ function Pz({ type: e, args: t, isReadonly: n }) {
55760
55800
  })]
55761
55801
  });
55762
55802
  }
55763
- O(Pz, () => !0);
55803
+ O(Fz, () => !0);
55764
55804
  //#endregion
55765
55805
  //#region src/components/document-preview.tsx
55766
- function Fz({ isReadonly: e, result: t, args: n }) {
55806
+ function Iz({ isReadonly: e, result: t, args: n }) {
55767
55807
  let { artifact: r, setArtifact: i } = DS(), { data: a, isLoading: o } = FR(t?.id ?? "", !!t?.id), s = L(() => a?.[0], [a]), c = R(null);
55768
55808
  if (j(() => {
55769
55809
  let e = c.current?.getBoundingClientRect();
@@ -55780,7 +55820,7 @@ function Fz({ isReadonly: e, result: t, args: n }) {
55780
55820
  let e = t?.kind ?? n?.kind ?? r.kind, i = t?.title ?? n?.title ?? r.title;
55781
55821
  return /* @__PURE__ */ H("div", {
55782
55822
  className: "w-full max-w-[450px]",
55783
- children: [i ? /* @__PURE__ */ V(Rz, {
55823
+ children: [i ? /* @__PURE__ */ V(zz, {
55784
55824
  isStreaming: !0,
55785
55825
  kind: e,
55786
55826
  title: i
@@ -55807,21 +55847,21 @@ function Fz({ isReadonly: e, result: t, args: n }) {
55807
55847
  return l ? /* @__PURE__ */ H("div", {
55808
55848
  className: "relative w-full max-w-[450px] cursor-pointer",
55809
55849
  children: [
55810
- /* @__PURE__ */ V(Lz, {
55850
+ /* @__PURE__ */ V(Rz, {
55811
55851
  hitboxRef: c,
55812
55852
  result: t,
55813
55853
  setArtifact: i
55814
55854
  }),
55815
- /* @__PURE__ */ V(Rz, {
55855
+ /* @__PURE__ */ V(zz, {
55816
55856
  isStreaming: r.status === "streaming",
55817
55857
  kind: l.kind,
55818
55858
  title: l.title
55819
55859
  }),
55820
- /* @__PURE__ */ V(zz, { document: l })
55860
+ /* @__PURE__ */ V(Bz, { document: l })
55821
55861
  ]
55822
- }) : /* @__PURE__ */ V(Iz, { artifactKind: r.kind });
55862
+ }) : /* @__PURE__ */ V(Lz, { artifactKind: r.kind });
55823
55863
  }
55824
- var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55864
+ var Lz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55825
55865
  className: "w-full max-w-[450px]",
55826
55866
  children: [/* @__PURE__ */ H("div", {
55827
55867
  className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
@@ -55836,7 +55876,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55836
55876
  className: "h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 bg-muted p-6",
55837
55877
  children: /* @__PURE__ */ V(uR, {})
55838
55878
  })]
55839
- }), Lz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
55879
+ }), Rz = O(({ hitboxRef: e, result: t, setArtifact: n }) => {
55840
55880
  let r = k((e) => {
55841
55881
  let r = e.currentTarget.getBoundingClientRect();
55842
55882
  n((e) => ({
@@ -55867,7 +55907,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55867
55907
  })
55868
55908
  })
55869
55909
  });
55870
- }, (e, t) => !!ye(e.result, t.result)), Rz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
55910
+ }, (e, t) => !!ye(e.result, t.result)), zz = O(({ title: e, kind: t, isStreaming: n }) => /* @__PURE__ */ H("div", {
55871
55911
  className: "flex flex-row items-center justify-between gap-2 rounded-t-2xl border border-b-0 border-border/50 px-4 py-3 dark:bg-muted",
55872
55912
  children: [/* @__PURE__ */ H("div", {
55873
55913
  className: "flex flex-row items-center gap-2.5",
@@ -55882,7 +55922,7 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55882
55922
  children: e
55883
55923
  })]
55884
55924
  }), /* @__PURE__ */ V("div", { className: "w-8" })]
55885
- }), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), zz = ({ document: e }) => {
55925
+ }), (e, t) => !(e.title !== t.title || e.isStreaming !== t.isStreaming)), Bz = ({ document: e }) => {
55886
55926
  let { artifact: t } = DS(), n = U("h-[257px] overflow-hidden rounded-b-2xl border border-t-0 border-border/50 dark:bg-muted", {
55887
55927
  "p-4 sm:px-10 sm:py-10": e.kind === "text",
55888
55928
  "p-0": e.kind === "code"
@@ -55927,16 +55967,16 @@ var Iz = ({ artifactKind: e }) => /* @__PURE__ */ H("div", {
55927
55967
  e.kind === "code" && /* @__PURE__ */ V("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-muted to-transparent dark:from-muted" })
55928
55968
  ]
55929
55969
  });
55930
- }, Bz = /* @__PURE__ */ y.createContext(void 0);
55931
- process.env.NODE_ENV !== "production" && (Bz.displayName = "AvatarRootContext");
55932
- function Vz() {
55933
- let e = y.useContext(Bz);
55970
+ }, Vz = /* @__PURE__ */ y.createContext(void 0);
55971
+ process.env.NODE_ENV !== "production" && (Vz.displayName = "AvatarRootContext");
55972
+ function Hz() {
55973
+ let e = y.useContext(Vz);
55934
55974
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(13) : "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>.");
55935
55975
  return e;
55936
55976
  }
55937
55977
  //#endregion
55938
55978
  //#region ../../node_modules/@base-ui/react/avatar/root/stateAttributesMapping.mjs
55939
- var Hz = { imageLoadingStatus: () => null }, Uz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55979
+ var Uz = { imageLoadingStatus: () => null }, Wz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55940
55980
  let { className: n, render: r, style: i, ...a } = e, [o, s] = y.useState("idle"), c = { imageLoadingStatus: o }, l = y.useMemo(() => ({
55941
55981
  imageLoadingStatus: o,
55942
55982
  setImageLoadingStatus: s
@@ -55944,17 +55984,17 @@ var Hz = { imageLoadingStatus: () => null }, Uz = /* @__PURE__ */ y.forwardRef(f
55944
55984
  state: c,
55945
55985
  ref: t,
55946
55986
  props: a,
55947
- stateAttributesMapping: Hz
55987
+ stateAttributesMapping: Uz
55948
55988
  });
55949
- return /* @__PURE__ */ V(Bz.Provider, {
55989
+ return /* @__PURE__ */ V(Vz.Provider, {
55950
55990
  value: l,
55951
55991
  children: u
55952
55992
  });
55953
55993
  });
55954
- process.env.NODE_ENV !== "production" && (Uz.displayName = "AvatarRoot");
55994
+ process.env.NODE_ENV !== "production" && (Wz.displayName = "AvatarRoot");
55955
55995
  //#endregion
55956
55996
  //#region ../../node_modules/@base-ui/react/avatar/image/useImageLoadingStatus.mjs
55957
- function Wz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55997
+ function Gz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55958
55998
  let [a, o] = y.useState("idle");
55959
55999
  return K(() => {
55960
56000
  if (!e && !i) return o("error"), ha;
@@ -55974,11 +56014,11 @@ function Wz(e, { referrerPolicy: t, crossOrigin: n, sizes: r, srcSet: i }) {
55974
56014
  }
55975
56015
  //#endregion
55976
56016
  //#region ../../node_modules/@base-ui/react/avatar/image/AvatarImage.mjs
55977
- var Gz = {
55978
- ...Hz,
56017
+ var Kz = {
56018
+ ...Uz,
55979
56019
  ...Qd
55980
- }, Kz = /* @__PURE__ */ y.forwardRef(function(e, t) {
55981
- let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = Vz(), c = Wz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = Jd(l), p = y.useRef(null), m = J((e) => {
56020
+ }, qz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56021
+ let { className: n, render: r, onLoadingStatusChange: i, style: a, ...o } = e, { setImageLoadingStatus: s } = Hz(), c = Gz(o.src, o), l = c === "loaded", { mounted: u, transitionStatus: d, setMounted: f } = Jd(l), p = y.useRef(null), m = J((e) => {
55982
56022
  i?.(e), s(e);
55983
56023
  });
55984
56024
  K(() => {
@@ -55997,54 +56037,54 @@ var Gz = {
55997
56037
  },
55998
56038
  ref: [t, p],
55999
56039
  props: o,
56000
- stateAttributesMapping: Gz,
56040
+ stateAttributesMapping: Kz,
56001
56041
  enabled: u
56002
56042
  });
56003
56043
  return u ? h : null;
56004
56044
  });
56005
- process.env.NODE_ENV !== "production" && (Kz.displayName = "AvatarImage");
56045
+ process.env.NODE_ENV !== "production" && (qz.displayName = "AvatarImage");
56006
56046
  //#endregion
56007
56047
  //#region ../../node_modules/@base-ui/react/avatar/fallback/AvatarFallback.mjs
56008
- var qz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56009
- let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = Vz(), [c, l] = y.useState(i === void 0), u = la();
56048
+ var Jz = /* @__PURE__ */ y.forwardRef(function(e, t) {
56049
+ let { className: n, render: r, delay: i, style: a, ...o } = e, { imageLoadingStatus: s } = Hz(), [c, l] = y.useState(i === void 0), u = la();
56010
56050
  return y.useEffect(() => (i === void 0 ? l(!0) : u.start(i, () => l(!0)), u.clear), [u, i]), Rc("span", e, {
56011
56051
  state: { imageLoadingStatus: s },
56012
56052
  ref: t,
56013
56053
  props: o,
56014
- stateAttributesMapping: Hz,
56054
+ stateAttributesMapping: Uz,
56015
56055
  enabled: s !== "loaded" && (i === void 0 || c)
56016
56056
  });
56017
56057
  });
56018
- process.env.NODE_ENV !== "production" && (qz.displayName = "AvatarFallback");
56058
+ process.env.NODE_ENV !== "production" && (Jz.displayName = "AvatarFallback");
56019
56059
  //#endregion
56020
56060
  //#region src/components/ui/avatar.tsx
56021
- var Jz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Uz, {
56061
+ var Yz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Wz, {
56022
56062
  ref: n,
56023
56063
  className: U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", e),
56024
56064
  ...t
56025
56065
  }));
56026
- Jz.displayName = "Avatar";
56027
- var Yz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Kz, {
56066
+ Yz.displayName = "Avatar";
56067
+ var Xz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(qz, {
56028
56068
  ref: n,
56029
56069
  className: U("aspect-square h-full w-full", e),
56030
56070
  ...t
56031
56071
  }));
56032
- Yz.displayName = "AvatarImage";
56033
- var Xz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(qz, {
56072
+ Xz.displayName = "AvatarImage";
56073
+ var Zz = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Jz, {
56034
56074
  ref: n,
56035
56075
  className: U("flex h-full w-full items-center justify-center rounded-full bg-muted", e),
56036
56076
  ...t
56037
56077
  }));
56038
- Xz.displayName = "AvatarFallback";
56039
- var Zz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56078
+ Zz.displayName = "AvatarFallback";
56079
+ var Qz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56040
56080
  className: U("flex flex-col gap-2 overflow-hidden rounded-lg px-4 py-3 text-foreground text-sm", "group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground", "group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground", "is-user:dark", t),
56041
56081
  ...n,
56042
56082
  children: e
56043
- }), Qz = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
56083
+ }), $z = ({ className: e, children: t, ...n }) => /* @__PURE__ */ V("div", {
56044
56084
  className: U("flex items-center gap-1", e),
56045
56085
  ...n,
56046
56086
  children: t
56047
- }), $z = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
56087
+ }), eB = ({ tooltip: e, children: t, label: n, className: r, variant: i = "ghost", size: a = "sm", ...o }) => {
56048
56088
  let s = /* @__PURE__ */ H(Im, {
56049
56089
  className: U("relative size-9 p-1.5 text-muted-foreground hover:text-foreground", r),
56050
56090
  size: a,
@@ -56063,13 +56103,13 @@ var Zz = ({ children: e, className: t, ...n }) => /* @__PURE__ */ V("div", {
56063
56103
  };
56064
56104
  //#endregion
56065
56105
  //#region src/components/message-actions.tsx
56066
- function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56106
+ function tB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56067
56107
  let [a, o] = qP(), [s, c] = z();
56068
56108
  j(() => {
56069
56109
  c(void 0);
56070
56110
  }, [t.id, n?.isUpvoted]);
56071
56111
  let l = s ?? n;
56072
- if (r) return null;
56112
+ if (r || t.role === "user" && t.parts.some((e) => e.type !== "text" && e.type !== "file")) return null;
56073
56113
  let u = t.parts?.filter((e) => e.type === "text").map((e) => e.text).join("\n").trim(), d = async () => {
56074
56114
  if (!u) {
56075
56115
  le.error("There's no text to copy!");
@@ -56077,31 +56117,31 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56077
56117
  }
56078
56118
  await o(u), le.success("Copied to clipboard!");
56079
56119
  };
56080
- return t.role === "user" ? /* @__PURE__ */ V(Qz, {
56120
+ return t.role === "user" ? /* @__PURE__ */ V($z, {
56081
56121
  className: "-mr-0.5 justify-end",
56082
56122
  children: /* @__PURE__ */ H("div", {
56083
56123
  className: "relative",
56084
- children: [i && /* @__PURE__ */ V($z, {
56124
+ children: [i && /* @__PURE__ */ V(eB, {
56085
56125
  className: "-left-10 absolute top-0 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/message:opacity-100",
56086
56126
  "data-testid": "message-edit-button",
56087
56127
  onClick: () => i("edit"),
56088
56128
  tooltip: "Edit",
56089
56129
  children: /* @__PURE__ */ V(ut, {})
56090
- }), /* @__PURE__ */ V($z, {
56130
+ }), /* @__PURE__ */ V(eB, {
56091
56131
  onClick: d,
56092
56132
  tooltip: "Copy",
56093
56133
  children: /* @__PURE__ */ V(St, {})
56094
56134
  })]
56095
56135
  })
56096
- }) : /* @__PURE__ */ H(Qz, {
56136
+ }) : /* @__PURE__ */ H($z, {
56097
56137
  className: "-ml-0.5",
56098
56138
  children: [
56099
- /* @__PURE__ */ V($z, {
56139
+ /* @__PURE__ */ V(eB, {
56100
56140
  onClick: d,
56101
56141
  tooltip: "Copy",
56102
56142
  children: /* @__PURE__ */ V(St, {})
56103
56143
  }),
56104
- /* @__PURE__ */ V($z, {
56144
+ /* @__PURE__ */ V(eB, {
56105
56145
  "data-testid": "message-upvote",
56106
56146
  disabled: l?.isUpvoted,
56107
56147
  onClick: () => {
@@ -56129,7 +56169,7 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56129
56169
  tooltip: "Upvote Response",
56130
56170
  children: /* @__PURE__ */ V(Ct, {})
56131
56171
  }),
56132
- /* @__PURE__ */ V($z, {
56172
+ /* @__PURE__ */ V(eB, {
56133
56173
  "data-testid": "message-downvote",
56134
56174
  disabled: l && !l.isUpvoted,
56135
56175
  onClick: () => {
@@ -56160,15 +56200,15 @@ function eB({ chatId: e, message: t, vote: n, isLoading: r, setMode: i }) {
56160
56200
  ]
56161
56201
  });
56162
56202
  }
56163
- var tB = O(eB, (e, t) => !(!ye(e.vote, t.vote) || e.isLoading !== t.isLoading)), nB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
56203
+ var nB = O(tB, (e, t) => !(!ye(e.vote, t.vote) || e.isLoading !== t.isLoading)), rB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("textarea", {
56164
56204
  className: U("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", e),
56165
56205
  ref: n,
56166
56206
  ...t
56167
56207
  }));
56168
- nB.displayName = "Textarea";
56208
+ rB.displayName = "Textarea";
56169
56209
  //#endregion
56170
56210
  //#region src/components/message-editor.tsx
56171
- function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56211
+ function iB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56172
56212
  let [i, a] = z(!1), [o, s] = z(Pm(e)), c = R(null), l = k(() => {
56173
56213
  c.current && (c.current.style.height = "auto", c.current.style.height = `${c.current.scrollHeight + 2}px`);
56174
56214
  }, []);
@@ -56180,7 +56220,7 @@ function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56180
56220
  };
56181
56221
  return /* @__PURE__ */ H("div", {
56182
56222
  className: "flex w-full flex-col gap-2",
56183
- children: [/* @__PURE__ */ V(nB, {
56223
+ children: [/* @__PURE__ */ V(rB, {
56184
56224
  className: "w-full resize-none overflow-hidden rounded-xl bg-transparent text-base! outline-hidden",
56185
56225
  "data-testid": "message-editor",
56186
56226
  onChange: u,
@@ -56227,7 +56267,7 @@ function rB({ message: e, setMode: t, setMessages: n, regenerate: r }) {
56227
56267
  }
56228
56268
  //#endregion
56229
56269
  //#region src/hooks/use-controllable-state.ts
56230
- function iB({ prop: e, defaultProp: t, onChange: n }) {
56270
+ function aB({ prop: e, defaultProp: t, onChange: n }) {
56231
56271
  let [r, i] = y.useState(t), a = e !== void 0, o = a ? e : r;
56232
56272
  return [o, y.useCallback((e) => {
56233
56273
  let t = typeof e == "function" ? e(o) : e;
@@ -56240,33 +56280,33 @@ function iB({ prop: e, defaultProp: t, onChange: n }) {
56240
56280
  }
56241
56281
  //#endregion
56242
56282
  //#region src/components/elements/reasoning.tsx
56243
- var aB = w(null), oB = () => {
56244
- let e = A(aB);
56283
+ var oB = w(null), sB = () => {
56284
+ let e = A(oB);
56245
56285
  if (!e) throw Error("Reasoning components must be used within Reasoning");
56246
56286
  return e;
56247
- }, sB = 1e3, cB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
56248
- let [c, l] = iB({
56287
+ }, cB = 1e3, lB = O(({ className: e, isStreaming: t = !1, open: n, defaultOpen: r = !0, onOpenChange: i, duration: a, children: o, ...s }) => {
56288
+ let [c, l] = aB({
56249
56289
  prop: n,
56250
56290
  defaultProp: r,
56251
56291
  onChange: i
56252
- }), [u, d] = iB({
56292
+ }), [u, d] = aB({
56253
56293
  prop: a,
56254
56294
  defaultProp: void 0
56255
56295
  }), [f, p] = z(null);
56256
56296
  return j(() => {
56257
- t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / sB)), p(null));
56297
+ t ? f === null && p(Date.now()) : f !== null && (d(Math.ceil((Date.now() - f) / cB)), p(null));
56258
56298
  }, [
56259
56299
  t,
56260
56300
  f,
56261
56301
  d
56262
- ]), /* @__PURE__ */ V(aB.Provider, {
56302
+ ]), /* @__PURE__ */ V(oB.Provider, {
56263
56303
  value: {
56264
56304
  isStreaming: t,
56265
56305
  isOpen: c,
56266
56306
  setIsOpen: l,
56267
56307
  duration: u
56268
56308
  },
56269
- children: /* @__PURE__ */ V(mz, {
56309
+ children: /* @__PURE__ */ V(hz, {
56270
56310
  className: U("not-prose", e),
56271
56311
  onOpenChange: (e) => {
56272
56312
  l(e);
@@ -56276,22 +56316,22 @@ var aB = w(null), oB = () => {
56276
56316
  children: o
56277
56317
  })
56278
56318
  });
56279
- }), lB = O(({ className: e, children: t, ...n }) => {
56280
- let { isStreaming: r, isOpen: i, duration: a } = oB();
56281
- return /* @__PURE__ */ V(hz, {
56319
+ }), uB = O(({ className: e, children: t, ...n }) => {
56320
+ let { isStreaming: r, isOpen: i, duration: a } = sB();
56321
+ return /* @__PURE__ */ V(gz, {
56282
56322
  className: U("flex items-center gap-1 rounded-md px-1.5 py-0.5 text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", e),
56283
56323
  ...n,
56284
56324
  children: t ?? /* @__PURE__ */ H(ce, { children: [
56285
56325
  /* @__PURE__ */ V(uh, { className: "size-3" }),
56286
- r ? /* @__PURE__ */ V("span", { children: "Reasoning…" }) : a === void 0 ? /* @__PURE__ */ V("span", { children: "Reasoning" }) : /* @__PURE__ */ H("span", { children: [
56287
- "Reasoning · ",
56326
+ r ? /* @__PURE__ */ V("span", { children: "Reasoning summary…" }) : a === void 0 ? /* @__PURE__ */ V("span", { children: "Reasoning summary" }) : /* @__PURE__ */ H("span", { children: [
56327
+ "Reasoning summary · ",
56288
56328
  a,
56289
56329
  "s"
56290
56330
  ] }),
56291
56331
  /* @__PURE__ */ V(fh, { className: U("size-2.5", i ? "rotate-180" : "rotate-0") })
56292
56332
  ] })
56293
56333
  });
56294
- }), uB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(gz, {
56334
+ }), dB = O(({ className: e, children: t, ...n }) => /* @__PURE__ */ V(_z, {
56295
56335
  className: U("mt-1.5 text-sm text-muted-foreground leading-relaxed outline-hidden", e),
56296
56336
  ...n,
56297
56337
  children: /* @__PURE__ */ V("div", {
@@ -56302,11 +56342,11 @@ var aB = w(null), oB = () => {
56302
56342
  })
56303
56343
  })
56304
56344
  }));
56305
- cB.displayName = "Reasoning", lB.displayName = "ReasoningTrigger", uB.displayName = "ReasoningContent";
56345
+ lB.displayName = "Reasoning", uB.displayName = "ReasoningTrigger", dB.displayName = "ReasoningContent";
56306
56346
  //#endregion
56307
56347
  //#region src/components/message-reasoning.tsx
56308
- var dB = 300;
56309
- function fB({ isStreaming: e, reasoning: t }) {
56348
+ var fB = 300;
56349
+ function pB({ isStreaming: e, reasoning: t }) {
56310
56350
  let [n, r] = z(!1), i = t.trim().length > 0, a = R(null), o = R(e);
56311
56351
  j(() => {
56312
56352
  if (a.current !== null && (window.clearTimeout(a.current), a.current = null), e) {
@@ -56316,7 +56356,7 @@ function fB({ isStreaming: e, reasoning: t }) {
56316
56356
  let t = o.current;
56317
56357
  if (o.current = !1, !(!t || !i || !n)) return a.current = window.setTimeout(() => {
56318
56358
  a.current = null, r(!1);
56319
- }, dB), () => {
56359
+ }, fB), () => {
56320
56360
  a.current !== null && (window.clearTimeout(a.current), a.current = null);
56321
56361
  };
56322
56362
  }, [
@@ -56327,17 +56367,17 @@ function fB({ isStreaming: e, reasoning: t }) {
56327
56367
  let s = (e) => {
56328
56368
  e && a.current !== null && (window.clearTimeout(a.current), a.current = null), r(e);
56329
56369
  };
56330
- return /* @__PURE__ */ H(cB, {
56370
+ return /* @__PURE__ */ H(lB, {
56331
56371
  "data-testid": "message-reasoning",
56332
56372
  isStreaming: e,
56333
56373
  onOpenChange: s,
56334
56374
  open: n,
56335
- children: [/* @__PURE__ */ V(lB, {}), /* @__PURE__ */ V(uB, { children: i || e ? t : "Reasoning summary unavailable." })]
56375
+ children: [/* @__PURE__ */ V(uB, {}), /* @__PURE__ */ V(dB, { children: i || e ? t : "Reasoning summary unavailable." })]
56336
56376
  });
56337
56377
  }
56338
56378
  //#endregion
56339
56379
  //#region src/components/preview-attachment.tsx
56340
- var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56380
+ var mB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56341
56381
  let { name: r, url: i, contentType: a } = e;
56342
56382
  return /* @__PURE__ */ H("div", {
56343
56383
  className: "group relative size-16 overflow-hidden rounded-lg border bg-muted",
@@ -56371,7 +56411,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56371
56411
  })
56372
56412
  ]
56373
56413
  });
56374
- }, mB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
56414
+ }, hB = ({ size: e = 40 }) => /* @__PURE__ */ H("svg", {
56375
56415
  fill: "none",
56376
56416
  height: e,
56377
56417
  viewBox: "0 0 24 24",
@@ -56448,7 +56488,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56448
56488
  y2: "4.22"
56449
56489
  })
56450
56490
  ]
56451
- }), hB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
56491
+ }), gB = ({ size: e = 40 }) => /* @__PURE__ */ V("svg", {
56452
56492
  fill: "none",
56453
56493
  height: e,
56454
56494
  viewBox: "0 0 24 24",
@@ -56457,7 +56497,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56457
56497
  d: "M21 12.79A9 9 0 1 1 11.21 3A7 7 0 0 0 21 12.79z",
56458
56498
  fill: "currentColor"
56459
56499
  })
56460
- }), gB = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
56500
+ }), _B = ({ size: e = 24 }) => /* @__PURE__ */ V("svg", {
56461
56501
  fill: "none",
56462
56502
  height: e,
56463
56503
  viewBox: "0 0 24 24",
@@ -56468,7 +56508,7 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56468
56508
  stroke: "currentColor",
56469
56509
  strokeWidth: "2"
56470
56510
  })
56471
- }), _B = {
56511
+ }), vB = {
56472
56512
  latitude: 37.763283,
56473
56513
  longitude: -122.41286,
56474
56514
  generationtime_ms: .027894974,
@@ -56624,10 +56664,10 @@ var pB = ({ attachment: e, isUploading: t = !1, onRemove: n }) => {
56624
56664
  ]
56625
56665
  }
56626
56666
  };
56627
- function vB(e) {
56667
+ function yB(e) {
56628
56668
  return Math.ceil(e);
56629
56669
  }
56630
- function yB({ weatherAtLocation: e = _B }) {
56670
+ function bB({ weatherAtLocation: e = vB }) {
56631
56671
  let t = Math.max(...e.hourly.temperature_2m.slice(0, 24)), n = Math.min(...e.hourly.temperature_2m.slice(0, 24)), r = ui(new Date(e.current.time), {
56632
56672
  start: new Date(e.daily.sunrise[0]),
56633
56673
  end: new Date(e.daily.sunset[0])
@@ -56660,10 +56700,10 @@ function yB({ weatherAtLocation: e = _B }) {
56660
56700
  className: "flex items-center gap-3",
56661
56701
  children: [/* @__PURE__ */ V("div", {
56662
56702
  className: "text-primary-foreground/90",
56663
- children: V(r ? mB : hB, { size: 32 })
56703
+ children: V(r ? hB : gB, { size: 32 })
56664
56704
  }), /* @__PURE__ */ H("div", {
56665
56705
  className: "font-light text-3xl text-primary-foreground",
56666
- children: [vB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
56706
+ children: [yB(e.current.temperature_2m), /* @__PURE__ */ V("span", {
56667
56707
  className: "text-lg text-primary-foreground/80",
56668
56708
  children: e.current_units.temperature_2m
56669
56709
  })]
@@ -56674,14 +56714,14 @@ function yB({ weatherAtLocation: e = _B }) {
56674
56714
  className: "font-medium text-primary-foreground/90 text-xs",
56675
56715
  children: [
56676
56716
  "H: ",
56677
- vB(t),
56717
+ yB(t),
56678
56718
  "°"
56679
56719
  ]
56680
56720
  }), /* @__PURE__ */ H("div", {
56681
56721
  className: "text-primary-foreground/70 text-xs",
56682
56722
  children: [
56683
56723
  "L: ",
56684
- vB(n),
56724
+ yB(n),
56685
56725
  "°"
56686
56726
  ]
56687
56727
  })]
@@ -56705,11 +56745,11 @@ function yB({ weatherAtLocation: e = _B }) {
56705
56745
  }),
56706
56746
  /* @__PURE__ */ V("div", {
56707
56747
  className: "text-primary-foreground/60",
56708
- children: /* @__PURE__ */ V(gB, { size: 16 })
56748
+ children: /* @__PURE__ */ V(_B, { size: 16 })
56709
56749
  }),
56710
56750
  /* @__PURE__ */ H("div", {
56711
56751
  className: "font-medium text-primary-foreground text-xs",
56712
- children: [vB(l[t]), "°"]
56752
+ children: [yB(l[t]), "°"]
56713
56753
  })
56714
56754
  ]
56715
56755
  }, e);
@@ -56734,7 +56774,7 @@ function yB({ weatherAtLocation: e = _B }) {
56734
56774
  }
56735
56775
  //#endregion
56736
56776
  //#region src/components/message.tsx
56737
- function bB(e) {
56777
+ function xB(e) {
56738
56778
  if (typeof e != "string") return e;
56739
56779
  try {
56740
56780
  return JSON.parse(e);
@@ -56742,8 +56782,8 @@ function bB(e) {
56742
56782
  return e;
56743
56783
  }
56744
56784
  }
56745
- var xB = (e) => typeof e == "object" && !!e, SB = (e) => !xB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
56746
- function CB(e) {
56785
+ var SB = (e) => typeof e == "object" && !!e, CB = (e) => !SB(e) || typeof e.error != "string" ? null : e.error.trim() || null;
56786
+ function wB(e) {
56747
56787
  if (typeof e != "string") return null;
56748
56788
  let t = new Date(e);
56749
56789
  return Number.isNaN(t.getTime()) ? null : {
@@ -56758,7 +56798,14 @@ function CB(e) {
56758
56798
  }).format(t)
56759
56799
  };
56760
56800
  }
56761
- function wB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56801
+ function TB({ approval: e, className: t }) {
56802
+ return e?.reason ? /* @__PURE__ */ V("div", {
56803
+ className: U(t, e.isAutomatic && "line-clamp-2"),
56804
+ title: e.isAutomatic ? e.reason : void 0,
56805
+ children: /* @__PURE__ */ V("span", { children: e.reason })
56806
+ }) : null;
56807
+ }
56808
+ function EB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56762
56809
  return /* @__PURE__ */ H("div", {
56763
56810
  className: "flex items-center justify-end gap-2 px-4 py-3",
56764
56811
  children: [/* @__PURE__ */ V(Im, {
@@ -56786,46 +56833,18 @@ function wB({ addToolApprovalResponse: e, approvalId: t, denyReason: n }) {
56786
56833
  })]
56787
56834
  });
56788
56835
  }
56789
- var TB = new Set([
56836
+ var DB = new Set([
56790
56837
  "text",
56791
56838
  "code",
56792
56839
  "image",
56793
56840
  "sheet"
56794
- ]), EB = new Set([
56841
+ ]), OB = new Set([
56795
56842
  "tool-createDocument",
56796
56843
  "tool-updateDocument",
56797
56844
  "tool-editDocument",
56798
56845
  "tool-requestSuggestions"
56799
- ]), DB = (e) => EB.has(e), OB = (e) => !(!xB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !TB.has(e.kind)) || "content" in e && typeof e.content != "string");
56800
- function kB(e, t) {
56801
- let n = [];
56802
- for (let r = 0; r < t.length; r++) {
56803
- let i = t[r];
56804
- if (i.type !== "reasoning") {
56805
- n.push({
56806
- part: i,
56807
- key: `message-${e}-part-${r}`
56808
- });
56809
- continue;
56810
- }
56811
- let a = i.text ?? "", o = r + 1;
56812
- for (; o < t.length;) {
56813
- let e = t[o];
56814
- if (e.type !== "reasoning") break;
56815
- a += e.text ?? "", o++;
56816
- }
56817
- n.push({
56818
- part: {
56819
- ...i,
56820
- text: a
56821
- },
56822
- key: `message-${e}-reasoning-${r}`
56823
- }), r = o - 1;
56824
- }
56825
- return n;
56826
- }
56827
- var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
56828
- let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = kB(n.id, WR(n.parts)), v = CB(n.metadata?.createdAt);
56846
+ ]), kB = (e) => OB.has(e), AB = (e) => !(!SB(e) || !("id" in e || "title" in e || "kind" in e || "content" in e) || "id" in e && typeof e.id != "string" || "title" in e && typeof e.title != "string" || "kind" in e && (typeof e.kind != "string" || !DB.has(e.kind)) || "content" in e && typeof e.content != "string"), jB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoading: i, renderMessagePart: s, setMessages: c, regenerate: l, isReadonly: u, requiresScrollPadding: d }) => {
56847
+ let [f, p] = z("view"), m = n.parts?.some((e) => e.type === "text" && e.text?.trim()), h = n.parts?.some((e) => a(e.type)), g = n.parts.filter((e) => e.type === "file"), _ = HR(n.id, GR(n.parts)), v = wB(n.metadata?.createdAt);
56829
56848
  return st(), /* @__PURE__ */ V("div", {
56830
56849
  className: "group/message fade-in w-full animate-in duration-200",
56831
56850
  "data-role": n.role,
@@ -56848,7 +56867,7 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56848
56867
  g.length > 0 && /* @__PURE__ */ V("div", {
56849
56868
  className: "flex flex-row justify-end gap-2",
56850
56869
  "data-testid": "message-attachments",
56851
- children: g.map((e) => /* @__PURE__ */ V(pB, { attachment: {
56870
+ children: g.map((e) => /* @__PURE__ */ V(mB, { attachment: {
56852
56871
  name: e.filename ?? "file",
56853
56872
  contentType: e.mediaType,
56854
56873
  url: e.url
@@ -56862,12 +56881,12 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56862
56881
  part: t
56863
56882
  });
56864
56883
  if (m !== void 0) return /* @__PURE__ */ V(C, { children: m }, r);
56865
- if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(fB, {
56884
+ if (d === "reasoning" && o(t)) return /* @__PURE__ */ V(pB, {
56866
56885
  isStreaming: t.state === "streaming",
56867
56886
  reasoning: t.text ?? ""
56868
56887
  }, r);
56869
56888
  if (d === "text") {
56870
- if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Zz, {
56889
+ if (f === "view") return /* @__PURE__ */ V("div", { children: /* @__PURE__ */ V(Qz, {
56871
56890
  className: U({
56872
56891
  "wrap-break-word w-fit rounded-2xl bg-primary px-3 py-2 text-left text-primary-foreground": n.role === "user",
56873
56892
  "bg-transparent px-0 py-0 text-left": n.role === "assistant"
@@ -56879,7 +56898,7 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56879
56898
  className: "flex w-full flex-row items-start gap-3",
56880
56899
  children: [/* @__PURE__ */ V("div", { className: "size-8" }), /* @__PURE__ */ V("div", {
56881
56900
  className: "min-w-0 flex-1",
56882
- children: /* @__PURE__ */ V(rB, {
56901
+ children: /* @__PURE__ */ V(iB, {
56883
56902
  message: n,
56884
56903
  regenerate: l,
56885
56904
  setMessages: c,
@@ -56889,113 +56908,113 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
56889
56908
  }, r);
56890
56909
  }
56891
56910
  if (d === "tool-getWeather") {
56892
- let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = SB(t.output);
56911
+ let { toolCallId: n, state: r } = t, i = t.approval?.id, a = t.approval, o = r === "output-denied" || r === "approval-responded" && t.approval?.approved === !1, s = "w-[min(100%,450px)]", c = CB(t.output);
56893
56912
  return r === "output-available" ? c ? /* @__PURE__ */ V("div", {
56894
56913
  className: s,
56895
- children: /* @__PURE__ */ H(xz, {
56914
+ children: /* @__PURE__ */ H(Sz, {
56896
56915
  className: "w-full",
56897
56916
  defaultOpen: !0,
56898
- children: [/* @__PURE__ */ V(Ez, {
56917
+ children: [/* @__PURE__ */ V(Dz, {
56899
56918
  approval: a,
56900
56919
  state: "output-error",
56901
56920
  type: "tool-getWeather"
56902
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V(Az, {
56921
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V(jz, {
56903
56922
  errorText: c,
56904
56923
  output: null
56905
56924
  }) })]
56906
56925
  })
56907
56926
  }, n) : /* @__PURE__ */ V("div", {
56908
56927
  className: s,
56909
- children: /* @__PURE__ */ V(yB, { weatherAtLocation: t.output })
56928
+ children: /* @__PURE__ */ V(bB, { weatherAtLocation: t.output })
56910
56929
  }, n) : r === "output-error" ? /* @__PURE__ */ V("div", {
56911
56930
  className: s,
56912
- children: /* @__PURE__ */ H(xz, {
56931
+ children: /* @__PURE__ */ H(Sz, {
56913
56932
  className: "w-full",
56914
56933
  defaultOpen: !0,
56915
- children: [/* @__PURE__ */ V(Ez, {
56934
+ children: [/* @__PURE__ */ V(Dz, {
56916
56935
  approval: a,
56917
56936
  state: r,
56918
56937
  type: "tool-getWeather"
56919
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V(Az, {
56938
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V(jz, {
56920
56939
  errorText: t.errorText,
56921
56940
  output: null
56922
56941
  }) })]
56923
56942
  })
56924
56943
  }, n) : o ? /* @__PURE__ */ V("div", {
56925
56944
  className: s,
56926
- children: /* @__PURE__ */ H(xz, {
56945
+ children: /* @__PURE__ */ H(Sz, {
56927
56946
  className: "w-full",
56928
56947
  defaultOpen: !0,
56929
- children: [/* @__PURE__ */ V(Ez, {
56948
+ children: [/* @__PURE__ */ V(Dz, {
56930
56949
  approval: a,
56931
56950
  state: "output-denied",
56932
56951
  type: "tool-getWeather"
56933
- }), /* @__PURE__ */ V(Dz, { children: /* @__PURE__ */ V("div", {
56952
+ }), /* @__PURE__ */ V(Oz, { children: /* @__PURE__ */ V("div", {
56934
56953
  className: "px-4 py-3 text-muted-foreground text-sm",
56935
56954
  children: "Weather lookup was denied."
56936
56955
  }) })]
56937
56956
  })
56938
56957
  }, n) : r === "approval-responded" ? /* @__PURE__ */ V("div", {
56939
56958
  className: s,
56940
- children: /* @__PURE__ */ H(xz, {
56959
+ children: /* @__PURE__ */ H(Sz, {
56941
56960
  className: "w-full",
56942
56961
  defaultOpen: !0,
56943
- children: [/* @__PURE__ */ V(Ez, {
56962
+ children: [/* @__PURE__ */ V(Dz, {
56944
56963
  approval: a,
56945
56964
  state: r,
56946
56965
  type: "tool-getWeather"
56947
- }), /* @__PURE__ */ H(Dz, { children: [/* @__PURE__ */ V(kz, { input: t.input }), a?.reason && /* @__PURE__ */ V("div", {
56948
- className: "text-muted-foreground text-sm",
56949
- children: a.reason
56966
+ }), /* @__PURE__ */ H(Oz, { children: [/* @__PURE__ */ V(Az, { input: t.input }), /* @__PURE__ */ V(TB, {
56967
+ approval: a,
56968
+ className: "text-muted-foreground text-sm"
56950
56969
  })] })]
56951
56970
  })
56952
56971
  }, n) : /* @__PURE__ */ V("div", {
56953
56972
  className: s,
56954
- children: /* @__PURE__ */ H(xz, {
56973
+ children: /* @__PURE__ */ H(Sz, {
56955
56974
  className: "w-full",
56956
56975
  defaultOpen: !0,
56957
- children: [/* @__PURE__ */ V(Ez, {
56976
+ children: [/* @__PURE__ */ V(Dz, {
56958
56977
  approval: a,
56959
56978
  state: r,
56960
56979
  type: "tool-getWeather"
56961
- }), /* @__PURE__ */ H(Dz, { children: [
56962
- (r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(kz, { input: t.input }),
56963
- r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(wB, {
56980
+ }), /* @__PURE__ */ H(Oz, { children: [
56981
+ (r === "input-available" || r === "approval-requested") && /* @__PURE__ */ V(Az, { input: t.input }),
56982
+ r === "approval-requested" && i && !a?.isAutomatic && /* @__PURE__ */ V(EB, {
56964
56983
  addToolApprovalResponse: e,
56965
56984
  approvalId: i,
56966
56985
  denyReason: "User denied weather lookup"
56967
56986
  }),
56968
- a?.reason && /* @__PURE__ */ V("div", {
56969
- className: "border-t pt-3 text-muted-foreground text-sm",
56970
- children: a.reason
56987
+ /* @__PURE__ */ V(TB, {
56988
+ approval: a,
56989
+ className: "border-t pt-3 text-muted-foreground text-sm"
56971
56990
  })
56972
56991
  ] })]
56973
56992
  })
56974
56993
  }, n);
56975
56994
  }
56976
- if (DB(d)) {
56995
+ if (kB(d)) {
56977
56996
  let n = t, { approval: i } = n, a = n.state, o = a === "output-denied" || a === "approval-responded" && i?.approved === !1;
56978
56997
  if (a === "approval-requested" || a === "approval-responded" || a === "output-denied") {
56979
56998
  let t = n.toolCallId ?? r;
56980
56999
  return /* @__PURE__ */ V("div", {
56981
57000
  className: "w-[min(100%,450px)]",
56982
- children: /* @__PURE__ */ H(xz, {
57001
+ children: /* @__PURE__ */ H(Sz, {
56983
57002
  className: "w-full",
56984
57003
  defaultOpen: !0,
56985
- children: [/* @__PURE__ */ V(Ez, {
57004
+ children: [/* @__PURE__ */ V(Dz, {
56986
57005
  approval: i,
56987
57006
  state: o ? "output-denied" : a,
56988
57007
  type: d
56989
- }), /* @__PURE__ */ H(Dz, { children: [
56990
- n.input !== void 0 && /* @__PURE__ */ V(kz, { input: bB(n.input) }),
56991
- a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(wB, {
57008
+ }), /* @__PURE__ */ H(Oz, { children: [
57009
+ n.input !== void 0 && /* @__PURE__ */ V(Az, { input: xB(n.input) }),
57010
+ a === "approval-requested" && i && !i.isAutomatic && /* @__PURE__ */ V(EB, {
56992
57011
  addToolApprovalResponse: e,
56993
57012
  approvalId: i.id,
56994
57013
  denyReason: "User denied tool call"
56995
57014
  }),
56996
- i?.reason && /* @__PURE__ */ V("div", {
56997
- className: "text-muted-foreground text-sm",
56998
- children: i.reason
57015
+ /* @__PURE__ */ V(TB, {
57016
+ approval: i,
57017
+ className: "text-muted-foreground text-sm"
56999
57018
  }),
57000
57019
  o && /* @__PURE__ */ V("div", {
57001
57020
  className: "text-muted-foreground text-sm",
@@ -57007,23 +57026,23 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57007
57026
  }
57008
57027
  }
57009
57028
  if (d === "tool-createDocument") {
57010
- let { toolCallId: e } = t, n = t.output, r = OB(n) ? n : void 0;
57011
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57029
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57030
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57012
57031
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57013
57032
  children: ["Error creating document: ", String(n.error)]
57014
- }, e) : /* @__PURE__ */ V(Fz, {
57033
+ }, e) : /* @__PURE__ */ V(Iz, {
57015
57034
  isReadonly: u,
57016
57035
  result: r
57017
57036
  }, e);
57018
57037
  }
57019
57038
  if (d === "tool-updateDocument") {
57020
- let { toolCallId: e } = t, n = t.output, r = OB(n) ? n : void 0;
57021
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57039
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57040
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57022
57041
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57023
57042
  children: ["Error updating document: ", String(n.error)]
57024
57043
  }, e) : /* @__PURE__ */ V("div", {
57025
57044
  className: "relative",
57026
- children: /* @__PURE__ */ V(Fz, {
57045
+ children: /* @__PURE__ */ V(Iz, {
57027
57046
  args: r ? {
57028
57047
  ...r,
57029
57048
  isUpdate: !0
@@ -57034,13 +57053,13 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57034
57053
  }, e);
57035
57054
  }
57036
57055
  if (d === "tool-editDocument") {
57037
- let { toolCallId: e } = t, n = t.output, r = OB(n) ? n : void 0;
57038
- return xB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57056
+ let { toolCallId: e } = t, n = t.output, r = AB(n) ? n : void 0;
57057
+ return SB(n) && "error" in n ? /* @__PURE__ */ H("div", {
57039
57058
  className: "rounded-lg border border-destructive/25 bg-destructive/10 p-4 text-destructive",
57040
57059
  children: ["Error editing document: ", String(n.error)]
57041
57060
  }, e) : /* @__PURE__ */ V("div", {
57042
57061
  className: "relative",
57043
- children: /* @__PURE__ */ V(Fz, {
57062
+ children: /* @__PURE__ */ V(Iz, {
57044
57063
  args: r ? {
57045
57064
  ...r,
57046
57065
  isUpdate: !0
@@ -57052,17 +57071,17 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57052
57071
  }
57053
57072
  if (d === "tool-requestSuggestions") {
57054
57073
  let { toolCallId: e, state: n } = t;
57055
- return /* @__PURE__ */ H(xz, {
57074
+ return /* @__PURE__ */ H(Sz, {
57056
57075
  defaultOpen: !0,
57057
- children: [/* @__PURE__ */ V(Ez, {
57076
+ children: [/* @__PURE__ */ V(Dz, {
57058
57077
  state: n,
57059
57078
  type: "tool-requestSuggestions"
57060
- }), /* @__PURE__ */ H(Dz, { children: [n === "input-available" && /* @__PURE__ */ V(kz, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(Az, {
57079
+ }), /* @__PURE__ */ H(Oz, { children: [n === "input-available" && /* @__PURE__ */ V(Az, { input: t.input }), n === "output-available" && /* @__PURE__ */ V(jz, {
57061
57080
  errorText: void 0,
57062
- output: xB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
57081
+ output: SB(t.output) && "error" in t.output ? /* @__PURE__ */ H("div", {
57063
57082
  className: "rounded border p-2 text-destructive",
57064
57083
  children: ["Error: ", String(t.output.error)]
57065
- }) : /* @__PURE__ */ V(Nz, {
57084
+ }) : /* @__PURE__ */ V(Pz, {
57066
57085
  isReadonly: u,
57067
57086
  result: t.output,
57068
57087
  type: "request-suggestions"
@@ -57074,38 +57093,38 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57074
57093
  let n = t, i = n.toolCallId ?? r, a = n.state, o = n.approval?.id, s = typeof n.title == "string" ? n.title : void 0, c = typeof n.toolName == "string" ? n.toolName : "tool", l = n.state === "output-denied" || n.state === "approval-responded" && n.approval?.approved === !1;
57075
57094
  return /* @__PURE__ */ V("div", {
57076
57095
  className: "w-[min(100%,450px)]",
57077
- children: /* @__PURE__ */ H(xz, {
57096
+ children: /* @__PURE__ */ H(Sz, {
57078
57097
  className: "w-full",
57079
57098
  defaultOpen: !0,
57080
- children: [d === "dynamic-tool" ? /* @__PURE__ */ V(Ez, {
57099
+ children: [d === "dynamic-tool" ? /* @__PURE__ */ V(Dz, {
57081
57100
  approval: n.approval,
57082
57101
  state: l ? "output-denied" : a,
57083
57102
  title: s,
57084
57103
  toolName: c,
57085
57104
  type: "dynamic-tool"
57086
- }) : /* @__PURE__ */ V(Ez, {
57105
+ }) : /* @__PURE__ */ V(Dz, {
57087
57106
  approval: n.approval,
57088
57107
  state: l ? "output-denied" : a,
57089
57108
  title: s,
57090
57109
  type: d
57091
- }), /* @__PURE__ */ H(Dz, { children: [
57092
- n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(kz, { input: bB(n.input) }),
57093
- n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(wB, {
57110
+ }), /* @__PURE__ */ H(Oz, { children: [
57111
+ n.input !== void 0 && (n.state === "input-available" || n.state === "approval-requested" || n.state === "approval-responded" || n.state === "output-available" || n.state === "output-error" || n.state === "output-denied") && /* @__PURE__ */ V(Az, { input: xB(n.input) }),
57112
+ n.state === "approval-requested" && o && !n.approval?.isAutomatic && /* @__PURE__ */ V(EB, {
57094
57113
  addToolApprovalResponse: e,
57095
57114
  approvalId: o,
57096
57115
  denyReason: "User denied tool call"
57097
57116
  }),
57098
- n.approval?.reason && /* @__PURE__ */ V("div", {
57099
- className: "border-t pt-3 text-muted-foreground text-sm",
57100
- children: n.approval.reason
57117
+ /* @__PURE__ */ V(TB, {
57118
+ approval: n.approval,
57119
+ className: "border-t pt-3 text-muted-foreground text-sm"
57101
57120
  }),
57102
57121
  l && /* @__PURE__ */ V("div", {
57103
57122
  className: "border-t px-4 py-3 text-muted-foreground text-sm",
57104
57123
  children: "This tool call was denied."
57105
57124
  }),
57106
- !l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(Az, {
57125
+ !l && (n.output !== void 0 || n.errorText !== void 0) && /* @__PURE__ */ V(jz, {
57107
57126
  errorText: n.errorText,
57108
- output: n.output === void 0 ? null : bB(n.output)
57127
+ output: n.output === void 0 ? null : xB(n.output)
57109
57128
  })
57110
57129
  ] })]
57111
57130
  })
@@ -57115,7 +57134,7 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57115
57134
  }),
57116
57135
  !u || v && f === "view" ? /* @__PURE__ */ H("div", {
57117
57136
  className: U("flex items-center gap-1", { "justify-end": n.role === "user" }),
57118
- children: [u ? null : /* @__PURE__ */ V(tB, {
57137
+ children: [u ? null : /* @__PURE__ */ V(nB, {
57119
57138
  chatId: t,
57120
57139
  isLoading: i,
57121
57140
  message: n,
@@ -57135,7 +57154,7 @@ var AB = ({ addToolApprovalResponse: e, chatId: t, message: n, vote: r, isLoadin
57135
57154
  })
57136
57155
  });
57137
57156
  };
57138
- function jB() {
57157
+ function MB() {
57139
57158
  let { waitingStatus: e } = st();
57140
57159
  return /* @__PURE__ */ V("div", {
57141
57160
  className: "flex min-w-0 items-center gap-1 p-0 text-muted-foreground text-sm",
@@ -57145,7 +57164,7 @@ function jB() {
57145
57164
  })
57146
57165
  });
57147
57166
  }
57148
- var MB = () => /* @__PURE__ */ V("div", {
57167
+ var NB = () => /* @__PURE__ */ V("div", {
57149
57168
  className: "group/message fade-in w-full animate-in duration-300",
57150
57169
  "data-role": "assistant",
57151
57170
  "data-testid": "message-assistant-loading",
@@ -57159,19 +57178,19 @@ var MB = () => /* @__PURE__ */ V("div", {
57159
57178
  })
57160
57179
  }), /* @__PURE__ */ V("div", {
57161
57180
  className: "min-w-0 flex-1",
57162
- children: /* @__PURE__ */ V(jB, {})
57181
+ children: /* @__PURE__ */ V(MB, {})
57163
57182
  })]
57164
57183
  })
57165
57184
  });
57166
57185
  //#endregion
57167
57186
  //#region src/components/artifact-messages.tsx
57168
- function NB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, renderMessagePart: a, setMessages: o, regenerate: s, isReadonly: c }) {
57187
+ function PB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messages: i, renderMessagePart: a, setMessages: o, regenerate: s, isReadonly: c }) {
57169
57188
  let { containerRef: l, endRef: u, onViewportEnter: d, onViewportLeave: f, hasSentMessage: p } = VR({ status: n });
57170
57189
  return /* @__PURE__ */ H("div", {
57171
57190
  className: "flex h-full flex-col items-center gap-4 overflow-y-scroll px-4 pt-20",
57172
57191
  ref: l,
57173
57192
  children: [
57174
- i.map((l, u) => /* @__PURE__ */ V(AB, {
57193
+ i.map((l, u) => /* @__PURE__ */ V(jB, {
57175
57194
  addToolApprovalResponse: e,
57176
57195
  chatId: t,
57177
57196
  isLoading: n === "streaming" && u === i.length - 1,
@@ -57185,7 +57204,7 @@ function NB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
57185
57204
  }, l.id)),
57186
57205
  /* @__PURE__ */ V(_M, {
57187
57206
  mode: "wait",
57188
- children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(MB, {}, "thinking")
57207
+ children: n === "submitted" && !i.some((e) => e.parts?.some((e) => "state" in e && e.state === "approval-responded")) && /* @__PURE__ */ V(NB, {}, "thinking")
57189
57208
  }),
57190
57209
  /* @__PURE__ */ V(uP.div, {
57191
57210
  className: "min-h-[24px] min-w-[24px] shrink-0",
@@ -57196,10 +57215,10 @@ function NB({ addToolApprovalResponse: e, chatId: t, status: n, votes: r, messag
57196
57215
  ]
57197
57216
  });
57198
57217
  }
57199
- function PB(e, t) {
57218
+ function FB(e, t) {
57200
57219
  return e.artifactStatus === "streaming" && t.artifactStatus === "streaming" ? !0 : !(e.status !== t.status || e.status && t.status || e.messages.length !== t.messages.length || !ye(e.votes, t.votes) || e.renderMessagePart !== t.renderMessagePart);
57201
57220
  }
57202
- var FB = O(NB, PB), IB = jh, LB = Yp, RB = y.forwardRef(({ className: e, ...t }, n) => {
57221
+ var IB = O(PB, FB), LB = jh, RB = Yp, zB = y.forwardRef(({ className: e, ...t }, n) => {
57203
57222
  let { resolvedTheme: r, theme: i } = Hm();
57204
57223
  return /* @__PURE__ */ V(bp, {
57205
57224
  ref: n,
@@ -57209,24 +57228,24 @@ var FB = O(NB, PB), IB = jh, LB = Yp, RB = y.forwardRef(({ className: e, ...t },
57209
57228
  ...t
57210
57229
  });
57211
57230
  });
57212
- RB.displayName = "DialogOverlay";
57213
- var zB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(tm, {
57231
+ zB.displayName = "DialogOverlay";
57232
+ var BB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(tm, {
57214
57233
  ref: r,
57215
57234
  render: um(e, t),
57216
57235
  ...n,
57217
57236
  children: t
57218
57237
  }));
57219
- zB.displayName = "DialogTrigger";
57220
- var BB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(kp, {
57238
+ BB.displayName = "DialogTrigger";
57239
+ var VB = y.forwardRef(({ asChild: e = !1, children: t, ...n }, r) => /* @__PURE__ */ V(kp, {
57221
57240
  ref: r,
57222
57241
  render: um(e, t),
57223
57242
  ...n,
57224
57243
  children: t
57225
57244
  }));
57226
- BB.displayName = "DialogClose";
57227
- var VB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
57245
+ VB.displayName = "DialogClose";
57246
+ var HB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
57228
57247
  let { resolvedTheme: i, theme: a } = Hm();
57229
- return /* @__PURE__ */ H(LB, { children: [/* @__PURE__ */ V(RB, {}), /* @__PURE__ */ H(Kp, {
57248
+ return /* @__PURE__ */ H(RB, { children: [/* @__PURE__ */ V(zB, {}), /* @__PURE__ */ H(Kp, {
57230
57249
  ref: r,
57231
57250
  className: U("agents-sdk fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 opacity-0 shadow-lg transition-opacity duration-200 data-open:opacity-100 data-closed:opacity-0 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 sm:rounded-lg", e),
57232
57251
  "data-agents-sdk-resolved-theme": i,
@@ -57241,48 +57260,48 @@ var VB = y.forwardRef(({ className: e, children: t, ...n }, r) => {
57241
57260
  })]
57242
57261
  })] });
57243
57262
  });
57244
- VB.displayName = "DialogContent";
57245
- var HB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
57263
+ HB.displayName = "DialogContent";
57264
+ var UB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
57246
57265
  className: U("flex flex-col space-y-1.5 text-center sm:text-left", e),
57247
57266
  ...t
57248
57267
  });
57249
- HB.displayName = "DialogHeader";
57250
- var UB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
57268
+ UB.displayName = "DialogHeader";
57269
+ var WB = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
57251
57270
  className: U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
57252
57271
  ...t
57253
57272
  });
57254
- UB.displayName = "DialogFooter";
57255
- var WB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Xp, {
57273
+ WB.displayName = "DialogFooter";
57274
+ var GB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(Xp, {
57256
57275
  ref: n,
57257
57276
  className: U("text-lg font-semibold leading-none tracking-tight", e),
57258
57277
  ...t
57259
57278
  }));
57260
- WB.displayName = "DialogTitle";
57261
- var GB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(jp, {
57279
+ GB.displayName = "DialogTitle";
57280
+ var KB = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(jp, {
57262
57281
  ref: n,
57263
57282
  className: U("text-sm text-muted-foreground", e),
57264
57283
  ...t
57265
57284
  }));
57266
- GB.displayName = "DialogDescription";
57285
+ KB.displayName = "DialogDescription";
57267
57286
  //#endregion
57268
57287
  //#region src/components/ui/command.tsx
57269
- var KB = y.createContext(null), qB = (e) => e.trim().toLocaleLowerCase(), JB = (e) => {
57288
+ var qB = y.createContext(null), JB = (e) => e.trim().toLocaleLowerCase(), YB = (e) => {
57270
57289
  if (typeof e == "string" || typeof e == "number") return String(e);
57271
- if (Array.isArray(e)) return e.map(JB).join(" ");
57290
+ if (Array.isArray(e)) return e.map(YB).join(" ");
57272
57291
  if (y.isValidElement(e)) {
57273
57292
  let t = e.props;
57274
- return `${typeof t.alt == "string" ? t.alt : ""} ${JB(t.children)}`.trim();
57293
+ return `${typeof t.alt == "string" ? t.alt : ""} ${YB(t.children)}`.trim();
57275
57294
  }
57276
57295
  return "";
57277
- }, YB = (e, t) => {
57278
- let n = qB(e);
57279
- return n ? qB(`${t.value} ${t.searchValue}`).includes(n) : !0;
57280
- }, XB = () => {
57281
- let e = y.useContext(KB);
57296
+ }, XB = (e, t) => {
57297
+ let n = JB(e);
57298
+ return n ? JB(`${t.value} ${t.searchValue}`).includes(n) : !0;
57299
+ }, ZB = () => {
57300
+ let e = y.useContext(qB);
57282
57301
  if (!e) throw Error("Command components must be rendered inside <Command>.");
57283
57302
  return e;
57284
- }, ZB = y.forwardRef(({ className: e, defaultValue: t, loop: n = !0, onKeyDown: r, onValueChange: i, value: a, ...o }, s) => {
57285
- let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) => YB(c, e)), [u, c]);
57303
+ }, QB = y.forwardRef(({ className: e, defaultValue: t, loop: n = !0, onKeyDown: r, onValueChange: i, value: a, ...o }, s) => {
57304
+ let [c, l] = y.useState(""), [u, d] = y.useState(() => /* @__PURE__ */ new Map()), [f, p] = y.useState(null), m = y.useRef(!1), h = y.useMemo(() => Array.from(u.values()).filter((e) => XB(c, e)), [u, c]);
57286
57305
  y.useEffect(() => {
57287
57306
  if (a) {
57288
57307
  let e = Array.from(u.values()).find((e) => e.value === a);
@@ -57293,7 +57312,7 @@ var KB = y.createContext(null), qB = (e) => e.trim().toLocaleLowerCase(), JB = (
57293
57312
  }
57294
57313
  if (!m.current && t) {
57295
57314
  let e = Array.from(u.values()).find((e) => e.value === t);
57296
- if (e && YB(c, e)) {
57315
+ if (e && XB(c, e)) {
57297
57316
  m.current = !0, e.id !== f && p(e.id);
57298
57317
  return;
57299
57318
  }
@@ -57326,7 +57345,7 @@ var KB = y.createContext(null), qB = (e) => e.trim().toLocaleLowerCase(), JB = (
57326
57345
  });
57327
57346
  }, []), v = y.useCallback((e) => {
57328
57347
  let t = u.get(e);
57329
- !t || t.disabled || !YB(c, t) || (i?.(t.value), t.select());
57348
+ !t || t.disabled || !XB(c, t) || (i?.(t.value), t.select());
57330
57349
  }, [
57331
57350
  u,
57332
57351
  i,
@@ -57371,7 +57390,7 @@ var KB = y.createContext(null), qB = (e) => e.trim().toLocaleLowerCase(), JB = (
57371
57390
  e.key === "Enter" && (e.preventDefault(), x());
57372
57391
  }
57373
57392
  };
57374
- return /* @__PURE__ */ V(KB.Provider, {
57393
+ return /* @__PURE__ */ V(qB.Provider, {
57375
57394
  value: {
57376
57395
  activeId: f,
57377
57396
  registerItem: g,
@@ -57393,9 +57412,9 @@ var KB = y.createContext(null), qB = (e) => e.trim().toLocaleLowerCase(), JB = (
57393
57412
  })
57394
57413
  });
57395
57414
  });
57396
- ZB.displayName = "Command";
57397
- var QB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
57398
- let a = XB();
57415
+ QB.displayName = "Command";
57416
+ var $B = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
57417
+ let a = ZB();
57399
57418
  return /* @__PURE__ */ H("div", {
57400
57419
  className: "flex items-center border-b px-3",
57401
57420
  "data-slot": "command-input-wrapper",
@@ -57411,17 +57430,17 @@ var QB = y.forwardRef(({ className: e, onChange: t, value: n, ...r }, i) => {
57411
57430
  })]
57412
57431
  });
57413
57432
  });
57414
- QB.displayName = "CommandInput";
57415
- var $B = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
57433
+ $B.displayName = "CommandInput";
57434
+ var eV = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
57416
57435
  ref: n,
57417
57436
  className: U("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
57418
57437
  "data-command-list": "",
57419
57438
  role: "listbox",
57420
57439
  ...t
57421
57440
  }));
57422
- $B.displayName = "CommandList";
57423
- var eV = y.forwardRef(({ className: e, ...t }, n) => {
57424
- let r = XB();
57441
+ eV.displayName = "CommandList";
57442
+ var tV = y.forwardRef(({ className: e, ...t }, n) => {
57443
+ let r = ZB();
57425
57444
  return !r.search.trim() || r.visibleCount > 0 ? null : /* @__PURE__ */ V("div", {
57426
57445
  ref: n,
57427
57446
  className: U("py-6 text-center text-sm", e),
@@ -57429,8 +57448,8 @@ var eV = y.forwardRef(({ className: e, ...t }, n) => {
57429
57448
  ...t
57430
57449
  });
57431
57450
  });
57432
- eV.displayName = "CommandEmpty";
57433
- var tV = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /* @__PURE__ */ H("div", {
57451
+ tV.displayName = "CommandEmpty";
57452
+ var nV = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /* @__PURE__ */ H("div", {
57434
57453
  ref: i,
57435
57454
  "aria-label": typeof t == "string" ? t : void 0,
57436
57455
  className: U("overflow-hidden p-1 text-foreground [&_[data-command-group-heading]]:px-2 [&_[data-command-group-heading]]:py-1.5 [&_[data-command-group-heading]]:text-xs [&_[data-command-group-heading]]:font-medium [&_[data-command-group-heading]]:text-muted-foreground", e),
@@ -57442,17 +57461,17 @@ var tV = y.forwardRef(({ className: e, heading: t, children: n, ...r }, i) => /*
57442
57461
  children: t
57443
57462
  }), n]
57444
57463
  }));
57445
- tV.displayName = "CommandGroup";
57446
- var nV = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
57464
+ nV.displayName = "CommandGroup";
57465
+ var rV = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V("div", {
57447
57466
  ref: n,
57448
57467
  className: U("-mx-1 h-px bg-border", e),
57449
57468
  "data-command-separator": "",
57450
57469
  role: "separator",
57451
57470
  ...t
57452
57471
  }));
57453
- nV.displayName = "CommandSeparator";
57454
- var rV = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords: r = [], onClick: i, onMouseMove: a, onSelect: o, value: s, ...c }, l) => {
57455
- let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } = XB(), g = y.useId(), _ = JB(e), v = s ?? _, b = `${_} ${r.join(" ")}`.trim(), x = y.useRef(() => {});
57472
+ rV.displayName = "CommandSeparator";
57473
+ var iV = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords: r = [], onClick: i, onMouseMove: a, onSelect: o, value: s, ...c }, l) => {
57474
+ let { activeId: u, registerItem: d, search: f, selectItem: p, setActiveId: m, unregisterItem: h } = ZB(), g = y.useId(), _ = YB(e), v = s ?? _, b = `${_} ${r.join(" ")}`.trim(), x = y.useRef(() => {});
57456
57475
  x.current = () => o?.(v);
57457
57476
  let S = y.useCallback(() => {
57458
57477
  x.current();
@@ -57462,7 +57481,7 @@ var rV = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
57462
57481
  searchValue: b,
57463
57482
  select: S,
57464
57483
  value: v
57465
- }, w = YB(f, C), T = u === g;
57484
+ }, w = XB(f, C), T = u === g;
57466
57485
  return y.useEffect(() => (d(C), () => h(g)), [
57467
57486
  n,
57468
57487
  g,
@@ -57492,109 +57511,109 @@ var rV = y.forwardRef(({ children: e, className: t, disabled: n = !1, keywords:
57492
57511
  children: e
57493
57512
  });
57494
57513
  });
57495
- rV.displayName = "CommandItem";
57496
- var iV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
57514
+ iV.displayName = "CommandItem";
57515
+ var aV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
57497
57516
  className: U("ml-auto text-xs tracking-widest text-muted-foreground", e),
57498
57517
  ...t
57499
57518
  });
57500
- iV.displayName = "CommandShortcut";
57519
+ aV.displayName = "CommandShortcut";
57501
57520
  //#endregion
57502
57521
  //#region src/components/ai-elements/model-selector.tsx
57503
- var aV = (e) => /* @__PURE__ */ V(IB, { ...e }), oV = (e) => /* @__PURE__ */ V(zB, { ...e }), sV = ({ className: e, commandDefaultValue: t, children: n, title: r = "Model Selector", ...i }) => /* @__PURE__ */ H(VB, {
57522
+ var oV = (e) => /* @__PURE__ */ V(LB, { ...e }), sV = (e) => /* @__PURE__ */ V(BB, { ...e }), cV = ({ className: e, commandDefaultValue: t, children: n, title: r = "Model Selector", ...i }) => /* @__PURE__ */ H(HB, {
57504
57523
  className: U("p-0", e),
57505
57524
  ...i,
57506
- children: [/* @__PURE__ */ V(WB, {
57525
+ children: [/* @__PURE__ */ V(GB, {
57507
57526
  className: "sr-only",
57508
57527
  children: r
57509
- }), /* @__PURE__ */ V(ZB, {
57528
+ }), /* @__PURE__ */ V(QB, {
57510
57529
  className: "**:data-[slot=command-input-wrapper]:h-auto",
57511
57530
  defaultValue: t,
57512
57531
  children: n
57513
57532
  })]
57514
- }), cV = ({ className: e, ...t }) => /* @__PURE__ */ V(QB, {
57533
+ }), lV = ({ className: e, ...t }) => /* @__PURE__ */ V($B, {
57515
57534
  className: U("h-auto py-3.5", e),
57516
57535
  ...t
57517
- }), lV = (e) => /* @__PURE__ */ V($B, { ...e }), uV = (e) => /* @__PURE__ */ V(tV, { ...e }), dV = (e) => /* @__PURE__ */ V(rV, { ...e }), fV = ({ provider: e, className: t }) => /* @__PURE__ */ V("img", {
57536
+ }), uV = (e) => /* @__PURE__ */ V(eV, { ...e }), dV = (e) => /* @__PURE__ */ V(nV, { ...e }), fV = (e) => /* @__PURE__ */ V(iV, { ...e }), pV = ({ provider: e, className: t }) => /* @__PURE__ */ V("img", {
57518
57537
  alt: `${e} logo`,
57519
57538
  className: U("size-3 dark:invert", t),
57520
57539
  height: 12,
57521
57540
  src: `https://models.dev/logos/${e}.svg`,
57522
57541
  width: 12
57523
- }), pV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
57542
+ }), mV = ({ className: e, ...t }) => /* @__PURE__ */ V("span", {
57524
57543
  className: U("flex-1 truncate text-left", e),
57525
57544
  ...t
57526
- }), mV = /* @__PURE__ */ y.createContext(void 0);
57527
- process.env.NODE_ENV !== "production" && (mV.displayName = "ScrollAreaRootContext");
57528
- function hV() {
57529
- let e = y.useContext(mV);
57545
+ }), hV = /* @__PURE__ */ y.createContext(void 0);
57546
+ process.env.NODE_ENV !== "production" && (hV.displayName = "ScrollAreaRootContext");
57547
+ function gV() {
57548
+ let e = y.useContext(hV);
57530
57549
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(53) : "Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");
57531
57550
  return e;
57532
57551
  }
57533
57552
  //#endregion
57534
57553
  //#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootCssVars.mjs
57535
- var gV = /* @__PURE__ */ function(e) {
57554
+ var _V = /* @__PURE__ */ function(e) {
57536
57555
  return e.scrollAreaCornerHeight = "--scroll-area-corner-height", e.scrollAreaCornerWidth = "--scroll-area-corner-width", e;
57537
57556
  }({});
57538
57557
  //#endregion
57539
57558
  //#region ../../node_modules/@base-ui/react/scroll-area/utils/getOffset.mjs
57540
- function _V(e, t, n) {
57559
+ function vV(e, t, n) {
57541
57560
  if (!e) return 0;
57542
57561
  let r = getComputedStyle(e), i = n === "x" ? "Inline" : "Block";
57543
57562
  return n === "x" && t === "margin" ? parseFloat(r[`${t}InlineStart`]) * 2 : parseFloat(r[`${t}${i}Start`]) + parseFloat(r[`${t}${i}End`]);
57544
57563
  }
57545
57564
  //#endregion
57546
57565
  //#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.mjs
57547
- var vV = /* @__PURE__ */ function(e) {
57566
+ var yV = /* @__PURE__ */ function(e) {
57548
57567
  return e.orientation = "data-orientation", e.hovering = "data-hovering", e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
57549
- }({}), yV = "base-ui-disable-scrollbar", bV = {
57550
- className: yV,
57568
+ }({}), bV = "base-ui-disable-scrollbar", xV = {
57569
+ className: bV,
57551
57570
  getElement(e) {
57552
57571
  return /* @__PURE__ */ V("style", {
57553
57572
  nonce: e,
57554
- href: yV,
57573
+ href: bV,
57555
57574
  precedence: "base-ui:low",
57556
- children: `.${yV}{scrollbar-width:none}.${yV}::-webkit-scrollbar{display:none}`
57575
+ children: `.${bV}{scrollbar-width:none}.${bV}::-webkit-scrollbar{display:none}`
57557
57576
  });
57558
57577
  }
57559
57578
  };
57560
- process.env.NODE_ENV !== "production" && (bV.getElement.displayName = "styleDisableScrollbar.getElement");
57579
+ process.env.NODE_ENV !== "production" && (xV.getElement.displayName = "styleDisableScrollbar.getElement");
57561
57580
  //#endregion
57562
57581
  //#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRootDataAttributes.mjs
57563
- var xV = /* @__PURE__ */ function(e) {
57582
+ var SV = /* @__PURE__ */ function(e) {
57564
57583
  return e.scrolling = "data-scrolling", e.hasOverflowX = "data-has-overflow-x", e.hasOverflowY = "data-has-overflow-y", e.overflowXStart = "data-overflow-x-start", e.overflowXEnd = "data-overflow-x-end", e.overflowYStart = "data-overflow-y-start", e.overflowYEnd = "data-overflow-y-end", e;
57565
- }({}), SV = {
57566
- hasOverflowX: (e) => e ? { [xV.hasOverflowX]: "" } : null,
57567
- hasOverflowY: (e) => e ? { [xV.hasOverflowY]: "" } : null,
57568
- overflowXStart: (e) => e ? { [xV.overflowXStart]: "" } : null,
57569
- overflowXEnd: (e) => e ? { [xV.overflowXEnd]: "" } : null,
57570
- overflowYStart: (e) => e ? { [xV.overflowYStart]: "" } : null,
57571
- overflowYEnd: (e) => e ? { [xV.overflowYEnd]: "" } : null,
57584
+ }({}), CV = {
57585
+ hasOverflowX: (e) => e ? { [SV.hasOverflowX]: "" } : null,
57586
+ hasOverflowY: (e) => e ? { [SV.hasOverflowY]: "" } : null,
57587
+ overflowXStart: (e) => e ? { [SV.overflowXStart]: "" } : null,
57588
+ overflowXEnd: (e) => e ? { [SV.overflowXEnd]: "" } : null,
57589
+ overflowYStart: (e) => e ? { [SV.overflowYStart]: "" } : null,
57590
+ overflowYEnd: (e) => e ? { [SV.overflowYEnd]: "" } : null,
57572
57591
  cornerHidden: () => null
57573
- }, CV = /* @__PURE__ */ y.createContext(void 0);
57574
- process.env.NODE_ENV !== "production" && (CV.displayName = "CSPContext");
57575
- var wV = { disableStyleElements: !1 };
57576
- function TV() {
57577
- return y.useContext(CV) ?? wV;
57592
+ }, wV = /* @__PURE__ */ y.createContext(void 0);
57593
+ process.env.NODE_ENV !== "production" && (wV.displayName = "CSPContext");
57594
+ var TV = { disableStyleElements: !1 };
57595
+ function EV() {
57596
+ return y.useContext(wV) ?? TV;
57578
57597
  }
57579
57598
  //#endregion
57580
57599
  //#region ../../node_modules/@base-ui/react/scroll-area/root/ScrollAreaRoot.mjs
57581
- var EV = {
57600
+ var DV = {
57582
57601
  x: 0,
57583
57602
  y: 0
57584
- }, DV = {
57603
+ }, OV = {
57585
57604
  width: 0,
57586
57605
  height: 0
57587
- }, OV = {
57606
+ }, kV = {
57588
57607
  xStart: !1,
57589
57608
  xEnd: !1,
57590
57609
  yStart: !1,
57591
57610
  yEnd: !1
57592
- }, kV = {
57611
+ }, AV = {
57593
57612
  x: !0,
57594
57613
  y: !0,
57595
57614
  corner: !0
57596
- }, AV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57597
- let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } = jV(i), d = Ap(), f = la(), p = la(), { nonce: m, disableStyleElements: h } = TV(), [g, _] = y.useState(!1), [v, b] = y.useState(!1), [x, S] = y.useState(!1), [C, w] = y.useState(!1), [T, E] = y.useState(!1), [D, O] = y.useState(DV), [k, A] = y.useState(DV), [j, M] = y.useState(OV), [N, P] = y.useState(kV), F = y.useRef(null), I = y.useRef(null), L = y.useRef(null), R = y.useRef(null), z = y.useRef(null), ee = y.useRef(null), te = y.useRef(null), ne = y.useRef(!1), re = y.useRef(0), ie = y.useRef(0), B = y.useRef(0), ae = y.useRef(0), oe = y.useRef("vertical"), se = y.useRef(EV), ce = J((e) => {
57615
+ }, jV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57616
+ let { render: n, className: r, overflowEdgeThreshold: i, style: a, ...o } = e, { xStart: s, xEnd: c, yStart: l, yEnd: u } = MV(i), d = Ap(), f = la(), p = la(), { nonce: m, disableStyleElements: h } = EV(), [g, _] = y.useState(!1), [v, b] = y.useState(!1), [x, S] = y.useState(!1), [C, w] = y.useState(!1), [T, E] = y.useState(!1), [D, O] = y.useState(OV), [k, A] = y.useState(OV), [j, M] = y.useState(kV), [N, P] = y.useState(AV), F = y.useRef(null), I = y.useRef(null), L = y.useRef(null), R = y.useRef(null), z = y.useRef(null), ee = y.useRef(null), te = y.useRef(null), ne = y.useRef(!1), re = y.useRef(0), ie = y.useRef(0), B = y.useRef(0), ae = y.useRef(0), oe = y.useRef("vertical"), se = y.useRef(DV), ce = J((e) => {
57598
57617
  let t = e.x - se.current.x, n = e.y - se.current.y;
57599
57618
  se.current = e, n !== 0 && (S(!0), f.start(500, () => {
57600
57619
  S(!1);
@@ -57602,20 +57621,20 @@ var EV = {
57602
57621
  b(!1);
57603
57622
  }));
57604
57623
  }), V = J((e) => {
57605
- e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(vV.orientation), I.current && (B.current = I.current.scrollTop, ae.current = I.current.scrollLeft), z.current && oe.current === "vertical" && z.current.setPointerCapture(e.pointerId), ee.current && oe.current === "horizontal" && ee.current.setPointerCapture(e.pointerId));
57624
+ e.button === 0 && (ne.current = !0, re.current = e.clientY, ie.current = e.clientX, oe.current = e.currentTarget.getAttribute(yV.orientation), I.current && (B.current = I.current.scrollTop, ae.current = I.current.scrollLeft), z.current && oe.current === "vertical" && z.current.setPointerCapture(e.pointerId), ee.current && oe.current === "horizontal" && ee.current.setPointerCapture(e.pointerId));
57606
57625
  }), le = J((e) => {
57607
57626
  if (!ne.current) return;
57608
57627
  let t = e.clientY - re.current, n = e.clientX - ie.current;
57609
57628
  if (I.current) {
57610
57629
  let r = I.current.scrollHeight, i = I.current.clientHeight, a = I.current.scrollWidth, o = I.current.clientWidth;
57611
57630
  if (z.current && L.current && oe.current === "vertical") {
57612
- let n = _V(L.current, "padding", "y"), a = _V(z.current, "margin", "y"), o = z.current.offsetHeight, s = t / (L.current.offsetHeight - o - n - a);
57631
+ let n = vV(L.current, "padding", "y"), a = vV(z.current, "margin", "y"), o = z.current.offsetHeight, s = t / (L.current.offsetHeight - o - n - a);
57613
57632
  I.current.scrollTop = B.current + s * (r - i), e.preventDefault(), S(!0), f.start(500, () => {
57614
57633
  S(!1);
57615
57634
  });
57616
57635
  }
57617
57636
  if (ee.current && R.current && oe.current === "horizontal") {
57618
- let t = _V(R.current, "padding", "x"), r = _V(ee.current, "margin", "x"), i = ee.current.offsetWidth, s = n / (R.current.offsetWidth - i - t - r);
57637
+ let t = vV(R.current, "padding", "x"), r = vV(ee.current, "margin", "x"), i = ee.current.offsetWidth, s = n / (R.current.offsetWidth - i - t - r);
57619
57638
  I.current.scrollLeft = ae.current + s * (a - o), e.preventDefault(), b(!0), p.start(500, () => {
57620
57639
  b(!1);
57621
57640
  });
@@ -57656,14 +57675,14 @@ var EV = {
57656
57675
  },
57657
57676
  style: {
57658
57677
  position: "relative",
57659
- [gV.scrollAreaCornerHeight]: `${D.height}px`,
57660
- [gV.scrollAreaCornerWidth]: `${D.width}px`
57678
+ [_V.scrollAreaCornerHeight]: `${D.height}px`,
57679
+ [_V.scrollAreaCornerWidth]: `${D.width}px`
57661
57680
  }
57662
57681
  }, me = Rc("div", e, {
57663
57682
  state: fe,
57664
57683
  ref: [t, F],
57665
57684
  props: [pe, o],
57666
- stateAttributesMapping: SV
57685
+ stateAttributesMapping: CV
57667
57686
  }), he = y.useMemo(() => ({
57668
57687
  handlePointerDown: V,
57669
57688
  handlePointerMove: le,
@@ -57725,13 +57744,13 @@ var EV = {
57725
57744
  l,
57726
57745
  u
57727
57746
  ]);
57728
- return /* @__PURE__ */ H(mV.Provider, {
57747
+ return /* @__PURE__ */ H(hV.Provider, {
57729
57748
  value: he,
57730
- children: [!h && bV.getElement(m), me]
57749
+ children: [!h && xV.getElement(m), me]
57731
57750
  });
57732
57751
  });
57733
- process.env.NODE_ENV !== "production" && (AV.displayName = "ScrollAreaRoot");
57734
- function jV(e) {
57752
+ process.env.NODE_ENV !== "production" && (jV.displayName = "ScrollAreaRoot");
57753
+ function MV(e) {
57735
57754
  if (typeof e == "number") {
57736
57755
  let t = Math.max(0, e);
57737
57756
  return {
@@ -57750,40 +57769,40 @@ function jV(e) {
57750
57769
  }
57751
57770
  //#endregion
57752
57771
  //#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportContext.mjs
57753
- var MV = /* @__PURE__ */ y.createContext(void 0);
57754
- process.env.NODE_ENV !== "production" && (MV.displayName = "ScrollAreaViewportContext");
57755
- function NV() {
57756
- let e = y.useContext(MV);
57772
+ var NV = /* @__PURE__ */ y.createContext(void 0);
57773
+ process.env.NODE_ENV !== "production" && (NV.displayName = "ScrollAreaViewportContext");
57774
+ function PV() {
57775
+ let e = y.useContext(NV);
57757
57776
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(55) : "Base UI: ScrollAreaViewportContext missing. ScrollAreaViewport parts must be placed within <ScrollArea.Viewport>.");
57758
57777
  return e;
57759
57778
  }
57760
57779
  //#endregion
57761
57780
  //#region ../../node_modules/@base-ui/react/internals/clamp.mjs
57762
- function PV(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
57781
+ function FV(e, t = -(2 ** 53 - 1), n = 2 ** 53 - 1) {
57763
57782
  return Math.max(t, Math.min(e, n));
57764
57783
  }
57765
57784
  //#endregion
57766
57785
  //#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewportCssVars.mjs
57767
- var FV = /* @__PURE__ */ function(e) {
57786
+ var IV = /* @__PURE__ */ function(e) {
57768
57787
  return e.scrollAreaOverflowXStart = "--scroll-area-overflow-x-start", e.scrollAreaOverflowXEnd = "--scroll-area-overflow-x-end", e.scrollAreaOverflowYStart = "--scroll-area-overflow-y-start", e.scrollAreaOverflowYEnd = "--scroll-area-overflow-y-end", e;
57769
57788
  }({});
57770
- function IV(e, t) {
57789
+ function LV(e, t) {
57771
57790
  return Math.max(0, e - t);
57772
57791
  }
57773
- function LV(e, t) {
57792
+ function RV(e, t) {
57774
57793
  if (t <= 0) return 0;
57775
- let n = PV(e, 0, t), r = n, i = t - n, a = r <= 1, o = i <= 1;
57794
+ let n = FV(e, 0, t), r = n, i = t - n, a = r <= 1, o = i <= 1;
57776
57795
  return a && o ? r <= i ? 0 : t : a ? 0 : o ? t : n;
57777
57796
  }
57778
57797
  //#endregion
57779
57798
  //#region ../../node_modules/@base-ui/react/scroll-area/viewport/ScrollAreaViewport.mjs
57780
- var RV = !1;
57781
- function zV() {
57782
- RV || $i || (typeof CSS < "u" && "registerProperty" in CSS && [
57783
- FV.scrollAreaOverflowXStart,
57784
- FV.scrollAreaOverflowXEnd,
57785
- FV.scrollAreaOverflowYStart,
57786
- FV.scrollAreaOverflowYEnd
57799
+ var zV = !1;
57800
+ function BV() {
57801
+ zV || $i || (typeof CSS < "u" && "registerProperty" in CSS && [
57802
+ IV.scrollAreaOverflowXStart,
57803
+ IV.scrollAreaOverflowXEnd,
57804
+ IV.scrollAreaOverflowYStart,
57805
+ IV.scrollAreaOverflowYEnd
57787
57806
  ].forEach((e) => {
57788
57807
  try {
57789
57808
  CSS.registerProperty({
@@ -57793,10 +57812,10 @@ function zV() {
57793
57812
  initialValue: "0px"
57794
57813
  });
57795
57814
  } catch {}
57796
- }), RV = !0);
57815
+ }), zV = !0);
57797
57816
  }
57798
- var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57799
- let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } = hV(), D = dg(), O = y.useRef(!0), k = y.useRef([
57817
+ var VV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57818
+ let { render: n, className: r, style: i, ...a } = e, { viewportRef: o, scrollbarYRef: s, scrollbarXRef: c, thumbYRef: l, thumbXRef: u, cornerRef: d, cornerSize: f, setCornerSize: p, setThumbSize: m, rootId: h, setHiddenState: g, hiddenState: _, setHasMeasuredScrollbar: v, handleScroll: b, setHovering: x, setOverflowEdges: S, overflowEdges: C, overflowEdgeThreshold: w, scrollingX: T, scrollingY: E } = gV(), D = dg(), O = y.useRef(!0), k = y.useRef([
57800
57819
  NaN,
57801
57820
  NaN,
57802
57821
  NaN,
@@ -57806,14 +57825,14 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57806
57825
  if (!e) return;
57807
57826
  let h = e.scrollHeight, _ = e.scrollWidth, y = e.clientHeight, b = e.clientWidth, x = e.scrollTop, C = e.scrollLeft, T = k.current, E = Number.isNaN(T[0]);
57808
57827
  if (T[0] = y, T[1] = h, T[2] = b, T[3] = _, E && v(!0), h === 0 || _ === 0) return;
57809
- let O = VV(e), A = O.y, j = O.x, M = b / _, N = y / h, P = Math.max(0, _ - b), F = Math.max(0, h - y), I = 0, L = 0;
57828
+ let O = HV(e), A = O.y, j = O.x, M = b / _, N = y / h, P = Math.max(0, _ - b), F = Math.max(0, h - y), I = 0, L = 0;
57810
57829
  if (!j) {
57811
57830
  let e = 0;
57812
- e = PV(D === "rtl" ? -C : C, 0, P), I = LV(e, P), L = P - I;
57831
+ e = FV(D === "rtl" ? -C : C, 0, P), I = RV(e, P), L = P - I;
57813
57832
  }
57814
- let R = A ? 0 : PV(x, 0, F), z = A ? 0 : LV(R, F), ee = A ? 0 : F - z, te = j ? 0 : b, ne = A ? 0 : y, re = 0, ie = 0;
57833
+ let R = A ? 0 : FV(x, 0, F), z = A ? 0 : RV(R, F), ee = A ? 0 : F - z, te = j ? 0 : b, ne = A ? 0 : y, re = 0, ie = 0;
57815
57834
  !j && !A && (re = t?.offsetWidth || 0, ie = n?.offsetHeight || 0);
57816
- let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se = _V(n, "padding", "x"), ce = _V(t, "padding", "y"), V = _V(i, "margin", "x"), H = _V(r, "margin", "y"), le = te - se - V, ue = ne - ce - H, de = n ? Math.min(n.offsetWidth - ae, le) : le, U = t ? Math.min(t.offsetHeight - oe, ue) : ue, fe = Math.max(16, de * M), pe = Math.max(16, U * N);
57835
+ let B = f.width === 0 && f.height === 0, ae = B ? re : 0, oe = B ? ie : 0, se = vV(n, "padding", "x"), ce = vV(t, "padding", "y"), V = vV(i, "margin", "x"), H = vV(r, "margin", "y"), le = te - se - V, ue = ne - ce - H, de = n ? Math.min(n.offsetWidth - ae, le) : le, U = t ? Math.min(t.offsetHeight - oe, ue) : ue, fe = Math.max(16, de * M), pe = Math.max(16, U * N);
57817
57836
  if (m((e) => e.height === pe && e.width === fe ? e : {
57818
57837
  width: fe,
57819
57838
  height: pe
@@ -57822,14 +57841,14 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57822
57841
  r.style.transform = `translate3d(0,${a}px,0)`;
57823
57842
  }
57824
57843
  if (n && i) {
57825
- let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ? PV(r * e, -e, 0) : PV(r * e, 0, e);
57844
+ let e = n.offsetWidth - fe - se - V, t = _ - b, r = t === 0 ? 0 : C / t, a = D === "rtl" ? FV(r * e, -e, 0) : FV(r * e, 0, e);
57826
57845
  i.style.transform = `translate3d(${a}px,0,0)`;
57827
57846
  }
57828
57847
  let me = [
57829
- [FV.scrollAreaOverflowXStart, I],
57830
- [FV.scrollAreaOverflowXEnd, L],
57831
- [FV.scrollAreaOverflowYStart, z],
57832
- [FV.scrollAreaOverflowYEnd, ee]
57848
+ [IV.scrollAreaOverflowXStart, I],
57849
+ [IV.scrollAreaOverflowXEnd, L],
57850
+ [IV.scrollAreaOverflowYStart, z],
57851
+ [IV.scrollAreaOverflowYEnd, ee]
57833
57852
  ];
57834
57853
  for (let [t, n] of me) e.style.setProperty(t, `${n}px`);
57835
57854
  a && (j || A ? p({
@@ -57838,7 +57857,7 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57838
57857
  }) : !j && !A && p({
57839
57858
  width: re,
57840
57859
  height: ie
57841
- })), g((e) => HV(e, O));
57860
+ })), g((e) => UV(e, O));
57842
57861
  let he = {
57843
57862
  xStart: !j && I > w.xStart,
57844
57863
  xEnd: !j && L > w.xEnd,
@@ -57848,7 +57867,7 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57848
57867
  S((e) => e.xStart === he.xStart && e.xEnd === he.xEnd && e.yStart === he.yStart && e.yEnd === he.yEnd ? e : he);
57849
57868
  });
57850
57869
  K(() => {
57851
- o.current && zV();
57870
+ o.current && BV();
57852
57871
  }, [o]), K(() => {
57853
57872
  queueMicrotask(M);
57854
57873
  }, [
@@ -57890,7 +57909,7 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57890
57909
  role: "presentation",
57891
57910
  ...h && { "data-id": `${h}-viewport` },
57892
57911
  tabIndex: _.x && _.y ? -1 : 0,
57893
- className: bV.className,
57912
+ className: xV.className,
57894
57913
  style: { overflow: "scroll" },
57895
57914
  onScroll() {
57896
57915
  o.current && (M(), O.current || b({
@@ -57925,15 +57944,15 @@ var BV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57925
57944
  ref: [t, o],
57926
57945
  state: F,
57927
57946
  props: [P, a],
57928
- stateAttributesMapping: SV
57947
+ stateAttributesMapping: CV
57929
57948
  }), L = y.useMemo(() => ({ computeThumbPosition: M }), [M]);
57930
- return /* @__PURE__ */ V(MV.Provider, {
57949
+ return /* @__PURE__ */ V(NV.Provider, {
57931
57950
  value: L,
57932
57951
  children: I
57933
57952
  });
57934
57953
  });
57935
- process.env.NODE_ENV !== "production" && (BV.displayName = "ScrollAreaViewport");
57936
- function VV(e) {
57954
+ process.env.NODE_ENV !== "production" && (VV.displayName = "ScrollAreaViewport");
57955
+ function HV(e) {
57937
57956
  let t = e.clientHeight >= e.scrollHeight, n = e.clientWidth >= e.scrollWidth;
57938
57957
  return {
57939
57958
  y: t,
@@ -57941,24 +57960,24 @@ function VV(e) {
57941
57960
  corner: t || n
57942
57961
  };
57943
57962
  }
57944
- function HV(e, t) {
57963
+ function UV(e, t) {
57945
57964
  return e.y === t.y && e.x === t.x && e.corner === t.corner ? e : t;
57946
57965
  }
57947
57966
  //#endregion
57948
57967
  //#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarContext.mjs
57949
- var UV = /* @__PURE__ */ y.createContext(void 0);
57950
- process.env.NODE_ENV !== "production" && (UV.displayName = "ScrollAreaScrollbarContext");
57951
- function WV() {
57952
- let e = y.useContext(UV);
57968
+ var WV = /* @__PURE__ */ y.createContext(void 0);
57969
+ process.env.NODE_ENV !== "production" && (WV.displayName = "ScrollAreaScrollbarContext");
57970
+ function GV() {
57971
+ let e = y.useContext(WV);
57953
57972
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(54) : "Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");
57954
57973
  return e;
57955
57974
  }
57956
57975
  //#endregion
57957
57976
  //#region ../../node_modules/@base-ui/react/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.mjs
57958
- var GV = /* @__PURE__ */ function(e) {
57977
+ var KV = /* @__PURE__ */ function(e) {
57959
57978
  return e.scrollAreaThumbHeight = "--scroll-area-thumb-height", e.scrollAreaThumbWidth = "--scroll-area-thumb-width", e;
57960
- }({}), KV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57961
- let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } = hV(), T = {
57979
+ }({}), qV = /* @__PURE__ */ y.forwardRef(function(e, t) {
57980
+ let { render: n, className: r, orientation: i = "vertical", keepMounted: a = !1, style: o, ...s } = e, { hovering: c, scrollingX: l, scrollingY: u, hiddenState: d, overflowEdges: f, scrollbarYRef: p, scrollbarXRef: m, viewportRef: h, thumbYRef: g, thumbXRef: _, handlePointerDown: v, handlePointerUp: b, handleScroll: x, rootId: S, thumbSize: C, hasMeasuredScrollbar: w } = gV(), T = {
57962
57981
  hovering: c,
57963
57982
  scrolling: {
57964
57983
  horizontal: l,
@@ -58004,11 +58023,11 @@ var GV = /* @__PURE__ */ function(e) {
58004
58023
  let t = Ba(e.nativeEvent), n = i === "vertical" ? g.current : _.current;
58005
58024
  if (!(n && q(n, t)) && h.current) {
58006
58025
  if (g.current && p.current && i === "vertical") {
58007
- let t = _V(g.current, "margin", "y"), n = _V(p.current, "padding", "y"), r = g.current.offsetHeight, i = p.current.getBoundingClientRect(), a = e.clientY - i.top - r / 2 - n + t / 2, o = h.current.scrollHeight, s = h.current.clientHeight, c = a / (p.current.offsetHeight - r - n - t) * (o - s);
58026
+ let t = vV(g.current, "margin", "y"), n = vV(p.current, "padding", "y"), r = g.current.offsetHeight, i = p.current.getBoundingClientRect(), a = e.clientY - i.top - r / 2 - n + t / 2, o = h.current.scrollHeight, s = h.current.clientHeight, c = a / (p.current.offsetHeight - r - n - t) * (o - s);
58008
58027
  h.current.scrollTop = c;
58009
58028
  }
58010
58029
  if (_.current && m.current && i === "horizontal") {
58011
- let t = _V(_.current, "margin", "x"), n = _V(m.current, "padding", "x"), r = _.current.offsetWidth, i = m.current.getBoundingClientRect(), a = e.clientX - i.left - r / 2 - n + t / 2, o = h.current.scrollWidth, s = h.current.clientWidth, c = a / (m.current.offsetWidth - r - n - t), l;
58030
+ let t = vV(_.current, "margin", "x"), n = vV(m.current, "padding", "x"), r = _.current.offsetWidth, i = m.current.getBoundingClientRect(), a = e.clientX - i.left - r / 2 - n + t / 2, o = h.current.scrollWidth, s = h.current.clientWidth, c = a / (m.current.offsetWidth - r - n - t), l;
58012
58031
  E === "rtl" ? (l = (1 - c) * (o - s), h.current.scrollLeft <= 0 && (l = -l)) : l = c * (o - s), h.current.scrollLeft = l;
58013
58032
  }
58014
58033
  x({
@@ -58027,33 +58046,33 @@ var GV = /* @__PURE__ */ function(e) {
58027
58046
  visibility: D ? "hidden" : void 0,
58028
58047
  ...i === "vertical" && {
58029
58048
  top: 0,
58030
- bottom: `var(${gV.scrollAreaCornerHeight})`,
58049
+ bottom: `var(${_V.scrollAreaCornerHeight})`,
58031
58050
  insetInlineEnd: 0,
58032
- [GV.scrollAreaThumbHeight]: `${C.height}px`
58051
+ [KV.scrollAreaThumbHeight]: `${C.height}px`
58033
58052
  },
58034
58053
  ...i === "horizontal" && {
58035
58054
  insetInlineStart: 0,
58036
- insetInlineEnd: `var(${gV.scrollAreaCornerWidth})`,
58055
+ insetInlineEnd: `var(${_V.scrollAreaCornerWidth})`,
58037
58056
  bottom: 0,
58038
- [GV.scrollAreaThumbWidth]: `${C.width}px`
58057
+ [KV.scrollAreaThumbWidth]: `${C.width}px`
58039
58058
  }
58040
58059
  }
58041
58060
  }, j = Rc("div", e, {
58042
58061
  ref: [t, i === "vertical" ? p : m],
58043
58062
  state: T,
58044
58063
  props: [A, s],
58045
- stateAttributesMapping: SV
58064
+ stateAttributesMapping: CV
58046
58065
  }), M = y.useMemo(() => ({ orientation: i }), [i]);
58047
- return k ? /* @__PURE__ */ V(UV.Provider, {
58066
+ return k ? /* @__PURE__ */ V(WV.Provider, {
58048
58067
  value: M,
58049
58068
  children: j
58050
58069
  }) : null;
58051
58070
  });
58052
- process.env.NODE_ENV !== "production" && (KV.displayName = "ScrollAreaScrollbar");
58071
+ process.env.NODE_ENV !== "production" && (qV.displayName = "ScrollAreaScrollbar");
58053
58072
  //#endregion
58054
58073
  //#region ../../node_modules/@base-ui/react/scroll-area/content/ScrollAreaContent.mjs
58055
- var qV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58056
- let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } = NV(), { hasMeasuredScrollbar: s, viewportState: c } = hV(), l = y.useRef(null), u = y.useRef(s);
58074
+ var JV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58075
+ let { render: n, className: r, style: i, ...a } = e, { computeThumbPosition: o } = PV(), { hasMeasuredScrollbar: s, viewportState: c } = gV(), l = y.useRef(null), u = y.useRef(s);
58057
58076
  return K(() => {
58058
58077
  if (typeof ResizeObserver > "u") return;
58059
58078
  let e = !1, t = new ResizeObserver(() => {
@@ -58065,18 +58084,18 @@ var qV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58065
58084
  }, [o]), Rc("div", e, {
58066
58085
  ref: [t, l],
58067
58086
  state: c,
58068
- stateAttributesMapping: SV,
58087
+ stateAttributesMapping: CV,
58069
58088
  props: [{
58070
58089
  role: "presentation",
58071
58090
  style: { minWidth: "fit-content" }
58072
58091
  }, a]
58073
58092
  });
58074
58093
  });
58075
- process.env.NODE_ENV !== "production" && (qV.displayName = "ScrollAreaContent");
58094
+ process.env.NODE_ENV !== "production" && (JV.displayName = "ScrollAreaContent");
58076
58095
  //#endregion
58077
58096
  //#region ../../node_modules/@base-ui/react/scroll-area/thumb/ScrollAreaThumb.mjs
58078
- var JV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58079
- let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } = hV(), { orientation: g } = WV(), _ = {
58097
+ var YV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58098
+ let { render: n, className: r, style: i, ...a } = e, { thumbYRef: o, thumbXRef: s, handlePointerDown: c, handlePointerMove: l, handlePointerUp: u, setScrollingX: d, setScrollingY: f, scrollingX: p, scrollingY: m, hasMeasuredScrollbar: h } = gV(), { orientation: g } = GV(), _ = {
58080
58099
  scrolling: g === "horizontal" ? p : m,
58081
58100
  orientation: g
58082
58101
  };
@@ -58093,17 +58112,17 @@ var JV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58093
58112
  onPointerCancel: v,
58094
58113
  style: {
58095
58114
  visibility: h ? void 0 : "hidden",
58096
- ...g === "vertical" && { height: `var(${GV.scrollAreaThumbHeight})` },
58097
- ...g === "horizontal" && { width: `var(${GV.scrollAreaThumbWidth})` }
58115
+ ...g === "vertical" && { height: `var(${KV.scrollAreaThumbHeight})` },
58116
+ ...g === "horizontal" && { width: `var(${KV.scrollAreaThumbWidth})` }
58098
58117
  }
58099
58118
  }, a]
58100
58119
  });
58101
58120
  });
58102
- process.env.NODE_ENV !== "production" && (JV.displayName = "ScrollAreaThumb");
58121
+ process.env.NODE_ENV !== "production" && (YV.displayName = "ScrollAreaThumb");
58103
58122
  //#endregion
58104
58123
  //#region ../../node_modules/@base-ui/react/scroll-area/corner/ScrollAreaCorner.mjs
58105
- var YV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58106
- let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } = hV(), l = Rc("div", e, {
58124
+ var XV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58125
+ let { render: n, className: r, style: i, ...a } = e, { cornerRef: o, cornerSize: s, hiddenState: c } = gV(), l = Rc("div", e, {
58107
58126
  ref: [t, o],
58108
58127
  props: [{ style: {
58109
58128
  position: "absolute",
@@ -58115,52 +58134,52 @@ var YV = /* @__PURE__ */ y.forwardRef(function(e, t) {
58115
58134
  });
58116
58135
  return c.corner ? null : l;
58117
58136
  });
58118
- process.env.NODE_ENV !== "production" && (YV.displayName = "ScrollAreaCorner");
58137
+ process.env.NODE_ENV !== "production" && (XV.displayName = "ScrollAreaCorner");
58119
58138
  //#endregion
58120
58139
  //#region src/components/ui/scroll-area.tsx
58121
- var XV = y.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ H(AV, {
58140
+ var ZV = y.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ H(jV, {
58122
58141
  ref: r,
58123
58142
  className: U("relative overflow-hidden", e),
58124
58143
  ...n,
58125
58144
  children: [
58126
- /* @__PURE__ */ V(BV, {
58145
+ /* @__PURE__ */ V(VV, {
58127
58146
  className: "h-full w-full rounded-[inherit]",
58128
58147
  children: t
58129
58148
  }),
58130
- /* @__PURE__ */ V(ZV, {}),
58131
- /* @__PURE__ */ V(YV, {})
58149
+ /* @__PURE__ */ V(QV, {}),
58150
+ /* @__PURE__ */ V(XV, {})
58132
58151
  ]
58133
58152
  }));
58134
- XV.displayName = "ScrollArea";
58135
- var ZV = y.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ V(KV, {
58153
+ ZV.displayName = "ScrollArea";
58154
+ var QV = y.forwardRef(({ className: e, orientation: t = "vertical", ...n }, r) => /* @__PURE__ */ V(qV, {
58136
58155
  ref: r,
58137
58156
  orientation: t,
58138
58157
  className: U("flex touch-none select-none transition-colors", t === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]", e),
58139
58158
  ...n,
58140
- children: /* @__PURE__ */ V(JV, { className: "relative flex-1 rounded-full bg-border" })
58159
+ children: /* @__PURE__ */ V(YV, { className: "relative flex-1 rounded-full bg-border" })
58141
58160
  }));
58142
- ZV.displayName = "ScrollBar";
58161
+ QV.displayName = "ScrollBar";
58143
58162
  //#endregion
58144
58163
  //#region ../../node_modules/@base-ui/react/select/root/SelectRootContext.mjs
58145
- var QV = /* @__PURE__ */ y.createContext(null);
58146
- process.env.NODE_ENV !== "production" && (QV.displayName = "SelectRootContext");
58147
58164
  var $V = /* @__PURE__ */ y.createContext(null);
58148
- process.env.NODE_ENV !== "production" && ($V.displayName = "SelectFloatingContext");
58149
- function eH() {
58150
- let e = y.useContext(QV);
58165
+ process.env.NODE_ENV !== "production" && ($V.displayName = "SelectRootContext");
58166
+ var eH = /* @__PURE__ */ y.createContext(null);
58167
+ process.env.NODE_ENV !== "production" && (eH.displayName = "SelectFloatingContext");
58168
+ function tH() {
58169
+ let e = y.useContext($V);
58151
58170
  if (e === null) throw Error(process.env.NODE_ENV === "production" ? pc(60) : "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.");
58152
58171
  return e;
58153
58172
  }
58154
- function tH() {
58155
- let e = y.useContext($V);
58173
+ function nH() {
58174
+ let e = y.useContext(eH);
58156
58175
  if (e === null) throw Error(process.env.NODE_ENV === "production" ? pc(61) : "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.");
58157
58176
  return e;
58158
58177
  }
58159
58178
  //#endregion
58160
58179
  //#region ../../node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
58161
- var nH = /* @__PURE__ */ function(e) {
58180
+ var rH = /* @__PURE__ */ function(e) {
58162
58181
  return e.disabled = "data-disabled", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
58163
- }({}), rH = {
58182
+ }({}), iH = {
58164
58183
  badInput: !1,
58165
58184
  customError: !1,
58166
58185
  patternMismatch: !1,
@@ -58172,22 +58191,22 @@ var nH = /* @__PURE__ */ function(e) {
58172
58191
  typeMismatch: !1,
58173
58192
  valid: null,
58174
58193
  valueMissing: !1
58175
- }, iH = {
58194
+ }, aH = {
58176
58195
  valid: null,
58177
58196
  touched: !1,
58178
58197
  dirty: !1,
58179
58198
  filled: !1,
58180
58199
  focused: !1
58181
- }, aH = {
58200
+ }, oH = {
58182
58201
  disabled: !1,
58183
- ...iH
58184
- }, oH = { valid(e) {
58185
- return e === null ? null : e ? { [nH.valid]: "" } : { [nH.invalid]: "" };
58186
- } }, sH = {
58202
+ ...aH
58203
+ }, sH = { valid(e) {
58204
+ return e === null ? null : e ? { [rH.valid]: "" } : { [rH.invalid]: "" };
58205
+ } }, cH = {
58187
58206
  invalid: void 0,
58188
58207
  name: void 0,
58189
58208
  validityData: {
58190
- state: rH,
58209
+ state: iH,
58191
58210
  errors: [],
58192
58211
  error: "",
58193
58212
  value: "",
@@ -58195,19 +58214,19 @@ var nH = /* @__PURE__ */ function(e) {
58195
58214
  },
58196
58215
  setValidityData: ha,
58197
58216
  disabled: void 0,
58198
- touched: iH.touched,
58217
+ touched: aH.touched,
58199
58218
  setTouched: ha,
58200
- dirty: iH.dirty,
58219
+ dirty: aH.dirty,
58201
58220
  setDirty: ha,
58202
- filled: iH.filled,
58221
+ filled: aH.filled,
58203
58222
  setFilled: ha,
58204
- focused: iH.focused,
58223
+ focused: aH.focused,
58205
58224
  setFocused: ha,
58206
58225
  validate: () => null,
58207
58226
  validationMode: "onSubmit",
58208
58227
  validationDebounceTime: 0,
58209
58228
  shouldValidateOnChange: () => !1,
58210
- state: aH,
58229
+ state: oH,
58211
58230
  markedDirtyRef: { current: !1 },
58212
58231
  registerFieldControl: ha,
58213
58232
  validation: {
@@ -58217,17 +58236,17 @@ var nH = /* @__PURE__ */ function(e) {
58217
58236
  commit: async () => {},
58218
58237
  change: ha
58219
58238
  }
58220
- }, cH = /* @__PURE__ */ y.createContext(sH);
58221
- process.env.NODE_ENV !== "production" && (cH.displayName = "FieldRootContext");
58222
- function lH(e = !0) {
58223
- let t = y.useContext(cH);
58239
+ }, lH = /* @__PURE__ */ y.createContext(cH);
58240
+ process.env.NODE_ENV !== "production" && (lH.displayName = "FieldRootContext");
58241
+ function uH(e = !0) {
58242
+ let t = y.useContext(lH);
58224
58243
  if (t.setValidityData === ha && !e) throw Error(process.env.NODE_ENV === "production" ? pc(28) : "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.");
58225
58244
  return t;
58226
58245
  }
58227
58246
  //#endregion
58228
58247
  //#region ../../node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
58229
- function uH(e, t, n, r, i = !0, a) {
58230
- let { registerFieldControl: o } = lH(), s = y.useRef(null);
58248
+ function dH(e, t, n, r, i = !0, a) {
58249
+ let { registerFieldControl: o } = uH(), s = y.useRef(null);
58231
58250
  s.current ||= Symbol(), K(() => {
58232
58251
  let c = s.current;
58233
58252
  return !c || !i ? void 0 : (o(c, {
@@ -58251,7 +58270,7 @@ function uH(e, t, n, r, i = !0, a) {
58251
58270
  }
58252
58271
  //#endregion
58253
58272
  //#region ../../node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
58254
- var dH = /* @__PURE__ */ y.createContext({
58273
+ var fH = /* @__PURE__ */ y.createContext({
58255
58274
  controlId: void 0,
58256
58275
  registerControlId: ha,
58257
58276
  labelId: void 0,
@@ -58260,14 +58279,14 @@ var dH = /* @__PURE__ */ y.createContext({
58260
58279
  setMessageIds: ha,
58261
58280
  getDescriptionProps: (e) => e
58262
58281
  });
58263
- process.env.NODE_ENV !== "production" && (dH.displayName = "LabelableContext");
58264
- function fH() {
58265
- return y.useContext(dH);
58282
+ process.env.NODE_ENV !== "production" && (fH.displayName = "LabelableContext");
58283
+ function pH() {
58284
+ return y.useContext(fH);
58266
58285
  }
58267
58286
  //#endregion
58268
58287
  //#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
58269
- function pH(e = {}) {
58270
- let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } = fH(), o = Ap(t), s = n ? i : void 0, c = ia(() => Symbol("labelable-control")), l = y.useRef(!1), u = y.useRef(t != null), d = J(() => {
58288
+ function mH(e = {}) {
58289
+ let { id: t, implicit: n = !1, controlRef: r } = e, { controlId: i, registerControlId: a } = pH(), o = Ap(t), s = n ? i : void 0, c = ia(() => Symbol("labelable-control")), l = y.useRef(!1), u = y.useRef(t != null), d = J(() => {
58271
58290
  !l.current || a === ha || (l.current = !1, a(c.current, void 0));
58272
58291
  });
58273
58292
  return K(() => {
@@ -58300,22 +58319,22 @@ function pH(e = {}) {
58300
58319
  }
58301
58320
  //#endregion
58302
58321
  //#region ../../node_modules/@base-ui/react/internals/itemEquality.mjs
58303
- var mH = (e, t) => Object.is(e, t);
58304
- function hH(e, t, n) {
58305
- return e == null || t == null ? Object.is(e, t) : n(e, t);
58306
- }
58322
+ var hH = (e, t) => Object.is(e, t);
58307
58323
  function gH(e, t, n) {
58308
- return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 : hH(t, e, n));
58324
+ return e == null || t == null ? Object.is(e, t) : n(e, t);
58309
58325
  }
58310
58326
  function _H(e, t, n) {
58311
- return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 : hH(e, t, n));
58327
+ return !e || e.length === 0 ? !1 : e.some((e) => e === void 0 ? !1 : gH(t, e, n));
58312
58328
  }
58313
58329
  function vH(e, t, n) {
58314
- return e.filter((e) => !hH(t, e, n));
58330
+ return !e || e.length === 0 ? -1 : e.findIndex((e) => e === void 0 ? !1 : gH(e, t, n));
58331
+ }
58332
+ function yH(e, t, n) {
58333
+ return e.filter((e) => !gH(t, e, n));
58315
58334
  }
58316
58335
  //#endregion
58317
58336
  //#region ../../node_modules/@base-ui/react/internals/serializeValue.mjs
58318
- function yH(e) {
58337
+ function bH(e) {
58319
58338
  if (e == null) return "";
58320
58339
  if (typeof e == "string") return e;
58321
58340
  try {
@@ -58326,39 +58345,39 @@ function yH(e) {
58326
58345
  }
58327
58346
  //#endregion
58328
58347
  //#region ../../node_modules/@base-ui/react/internals/resolveValueLabel.mjs
58329
- function bH(e) {
58348
+ function xH(e) {
58330
58349
  return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
58331
58350
  }
58332
- function xH(e) {
58351
+ function SH(e) {
58333
58352
  if (!Array.isArray(e)) return e != null && "null" in e;
58334
58353
  let t = e;
58335
- if (bH(t)) {
58354
+ if (xH(t)) {
58336
58355
  for (let e of t) for (let t of e.items) if (t && t.value == null && t.label != null) return !0;
58337
58356
  return !1;
58338
58357
  }
58339
58358
  for (let e of t) if (e && e.value == null && e.label != null) return !0;
58340
58359
  return !1;
58341
58360
  }
58342
- function SH(e, t) {
58361
+ function CH(e, t) {
58343
58362
  if (t && e != null) return t(e) ?? "";
58344
58363
  if (e && typeof e == "object") {
58345
58364
  if ("label" in e && e.label != null) return String(e.label);
58346
58365
  if ("value" in e) return String(e.value);
58347
58366
  }
58348
- return yH(e);
58367
+ return bH(e);
58349
58368
  }
58350
- function CH(e, t) {
58351
- return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? yH(e.value) : yH(e);
58369
+ function wH(e, t) {
58370
+ return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? bH(e.value) : bH(e);
58352
58371
  }
58353
- function wH(e, t, n) {
58372
+ function TH(e, t, n) {
58354
58373
  function r() {
58355
- return SH(e, n);
58374
+ return CH(e, n);
58356
58375
  }
58357
58376
  if (n && e != null) return n(e);
58358
58377
  if (e && typeof e == "object" && "label" in e && e.label != null) return e.label;
58359
58378
  if (t && !Array.isArray(t)) return t[e] ?? r();
58360
58379
  if (Array.isArray(t)) {
58361
- let n = t, i = bH(n) ? n.flatMap((e) => e.items) : n;
58380
+ let n = t, i = xH(n) ? n.flatMap((e) => e.items) : n;
58362
58381
  if (typeof e != "object" || !e) {
58363
58382
  let t = i.find((t) => t.value === e);
58364
58383
  return t && t.label != null ? t.label : r();
@@ -58370,8 +58389,8 @@ function wH(e, t, n) {
58370
58389
  }
58371
58390
  return r();
58372
58391
  }
58373
- function TH(e, t, n) {
58374
- return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children: wH(r, t, n) }, i)), e), []);
58392
+ function EH(e, t, n) {
58393
+ return e.reduce((e, r, i) => (i > 0 && e.push(", "), e.push(/* @__PURE__ */ V(y.Fragment, { children: TH(r, t, n) }, i)), e), []);
58375
58394
  }
58376
58395
  //#endregion
58377
58396
  //#region ../../node_modules/@base-ui/react/select/store.mjs
@@ -58387,9 +58406,9 @@ var $ = {
58387
58406
  value: Y((e) => e.value),
58388
58407
  hasSelectedValue: Y((e) => {
58389
58408
  let { value: t, multiple: n, itemToStringValue: r } = e;
58390
- return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : CH(t, r) !== "";
58409
+ return t == null ? !1 : n && Array.isArray(t) ? t.length > 0 : wH(t, r) !== "";
58391
58410
  }),
58392
- hasNullItemLabel: Y((e, t) => t ? xH(e.items) : !1),
58411
+ hasNullItemLabel: Y((e, t) => t ? SH(e.items) : !1),
58393
58412
  open: Y((e) => e.open),
58394
58413
  mounted: Y((e) => e.mounted),
58395
58414
  forceMount: Y((e) => e.forceMount),
@@ -58400,7 +58419,7 @@ var $ = {
58400
58419
  isActive: Y((e, t) => e.activeIndex === t),
58401
58420
  isSelected: Y((e, t) => {
58402
58421
  let n = e.isItemEqualToValue, r = e.value;
58403
- return e.multiple ? Array.isArray(r) && r.some((e) => hH(t, e, n)) : hH(t, r, n);
58422
+ return e.multiple ? Array.isArray(r) && r.some((e) => gH(t, e, n)) : gH(t, r, n);
58404
58423
  }),
58405
58424
  isSelectedByFocus: Y((e, t) => e.selectedIndex === t),
58406
58425
  popupProps: Y((e) => e.popupProps),
@@ -58412,26 +58431,26 @@ var $ = {
58412
58431
  scrollUpArrowVisible: Y((e) => e.scrollUpArrowVisible),
58413
58432
  scrollDownArrowVisible: Y((e) => e.scrollDownArrowVisible),
58414
58433
  hasScrollArrows: Y((e) => e.hasScrollArrows)
58415
- }, EH = /* @__PURE__ */ y.createContext({
58434
+ }, DH = /* @__PURE__ */ y.createContext({
58416
58435
  formRef: { current: { fields: /* @__PURE__ */ new Map() } },
58417
58436
  errors: {},
58418
58437
  clearErrors: ha,
58419
58438
  validationMode: "onSubmit",
58420
58439
  submitAttemptedRef: { current: !1 }
58421
58440
  });
58422
- process.env.NODE_ENV !== "production" && (EH.displayName = "FormContext");
58423
- function DH() {
58424
- return y.useContext(EH);
58441
+ process.env.NODE_ENV !== "production" && (DH.displayName = "FormContext");
58442
+ function OH() {
58443
+ return y.useContext(DH);
58425
58444
  }
58426
58445
  //#endregion
58427
58446
  //#region ../../node_modules/@base-ui/react/internals/areArraysEqual.mjs
58428
- function OH(e, t, n = (e, t) => e === t) {
58447
+ function kH(e, t, n = (e, t) => e === t) {
58429
58448
  return e.length === t.length && e.every((e, r) => n(e, t[r]));
58430
58449
  }
58431
58450
  //#endregion
58432
58451
  //#region ../../node_modules/@base-ui/react/select/root/SelectRoot.mjs
58433
- function kH(e) {
58434
- let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C = mH, highlightItemOnHover: w = !0, children: T } = e, { clearErrors: E } = DH(), { setDirty: D, setTouched: O, setFocused: k, validityData: A, setFilled: j, name: M, disabled: N, validation: P, validationMode: F } = lH(), I = pH({ id: t }), L = N || d, R = M ?? c, [z, ee] = R_({
58452
+ function AH(e) {
58453
+ let { id: t, value: n, defaultValue: r = null, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, form: l, autoComplete: u, disabled: d = !1, readOnly: f = !1, required: p = !1, modal: m = !0, actionsRef: h, inputRef: g, onOpenChangeComplete: _, items: v, multiple: b = !1, itemToStringLabel: x, itemToStringValue: S, isItemEqualToValue: C = hH, highlightItemOnHover: w = !0, children: T } = e, { clearErrors: E } = OH(), { setDirty: D, setTouched: O, setFocused: k, validityData: A, setFilled: j, name: M, disabled: N, validation: P, validationMode: F } = uH(), I = mH({ id: t }), L = N || d, R = M ?? c, [z, ee] = R_({
58435
58454
  controlled: n,
58436
58455
  default: b ? r ?? ga : r,
58437
58456
  name: "Select",
@@ -58471,17 +58490,17 @@ function kH(e) {
58471
58490
  scrollUpArrowVisible: !1,
58472
58491
  scrollDownArrowVisible: !1,
58473
58492
  hasScrollArrows: !1
58474
- })).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = Ag(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" : CH(z, S), [
58493
+ })).current, ve = X(_e, $.activeIndex), ye = X(_e, $.selectedIndex), be = X(_e, $.triggerElement), xe = X(_e, $.positionerElement), Se = Ag(W), Ce = W ?? Se ?? null, we = y.useMemo(() => b ? "" : wH(z, S), [
58475
58494
  b,
58476
58495
  z,
58477
58496
  S
58478
- ]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) => CH(e, S)) : CH(z, S), [
58497
+ ]), Te = y.useMemo(() => b && Array.isArray(z) ? z.map((e) => wH(e, S)) : wH(z, S), [
58479
58498
  b,
58480
58499
  z,
58481
58500
  S
58482
58501
  ]);
58483
- uH(Oo(_e.state.triggerElement), I, z, J(() => Te), !L, c);
58484
- let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null && CH(z, S) !== "";
58502
+ dH(Oo(_e.state.triggerElement), I, z, J(() => Te), !L, c);
58503
+ let Ee = y.useRef(z), De = b ? Array.isArray(z) && z.length > 0 : z != null && wH(z, S) !== "";
58485
58504
  K(() => {
58486
58505
  z !== Ee.current && _e.set("forceMount", !0);
58487
58506
  }, [_e, z]), K(() => {
@@ -58492,11 +58511,11 @@ function kH(e) {
58492
58511
  let n = Array.isArray(z) ? z : [];
58493
58512
  if (n.length === 0) t = null;
58494
58513
  else {
58495
- let r = n[n.length - 1], i = _H(e, r, C);
58514
+ let r = n[n.length - 1], i = vH(e, r, C);
58496
58515
  t = i === -1 ? null : i;
58497
58516
  }
58498
58517
  } else {
58499
- let n = _H(e, z, C);
58518
+ let n = vH(e, z, C);
58500
58519
  t = n === -1 ? null : n;
58501
58520
  }
58502
58521
  t === null && (de.current = null), !te && _e.set("selectedIndex", t);
@@ -58512,7 +58531,7 @@ function kH(e) {
58512
58531
  ]);
58513
58532
  function Oe(e) {
58514
58533
  let t = A.initialValue;
58515
- return Array.isArray(e) && Array.isArray(t) ? !OH(e, t, (e, t) => hH(e, t, C)) : e !== t;
58534
+ return Array.isArray(e) && Array.isArray(t) ? !kH(e, t, (e, t) => gH(e, t, C)) : e !== t;
58516
58535
  }
58517
58536
  Qp(z, () => {
58518
58537
  E(R), D(Oe(z)), P.change(z);
@@ -58538,7 +58557,7 @@ function kH(e) {
58538
58557
  }), Me = J(() => {
58539
58558
  let e = _e.state.listElement || B.current;
58540
58559
  if (!e) return;
58541
- let t = IV(e.scrollHeight, e.clientHeight), n = LV(e.scrollTop, t), r = n > 0, i = n < t;
58560
+ let t = LV(e.scrollHeight, e.clientHeight), n = RV(e.scrollTop, t), r = n > 0, i = n < t;
58542
58561
  _e.state.scrollUpArrowVisible !== r && _e.set("scrollUpArrowVisible", r), _e.state.scrollDownArrowVisible !== i && _e.set("scrollDownArrowVisible", i);
58543
58562
  }), Ne = Tf({
58544
58563
  open: te,
@@ -58668,7 +58687,7 @@ function kH(e) {
58668
58687
  _,
58669
58688
  Me
58670
58689
  ]), He = So(g, P.inputRef), Ue = b && Array.isArray(z) && z.length > 0, We = b ? void 0 : R, Ge = y.useMemo(() => !b || !Array.isArray(z) || !R ? null : z.map((e) => {
58671
- let t = CH(e, S);
58690
+ let t = wH(e, S);
58672
58691
  return /* @__PURE__ */ V("input", {
58673
58692
  type: "hidden",
58674
58693
  form: l,
@@ -58684,9 +58703,9 @@ function kH(e) {
58684
58703
  S,
58685
58704
  L
58686
58705
  ]);
58687
- return /* @__PURE__ */ V(QV.Provider, {
58706
+ return /* @__PURE__ */ V($V.Provider, {
58688
58707
  value: Ve,
58689
- children: /* @__PURE__ */ H($V.Provider, {
58708
+ children: /* @__PURE__ */ H(eH.Provider, {
58690
58709
  value: Ne,
58691
58710
  children: [
58692
58711
  T,
@@ -58700,7 +58719,7 @@ function kH(e) {
58700
58719
  let t = e.currentTarget.value, n = go(eo, e.nativeEvent);
58701
58720
  function r() {
58702
58721
  if (b) return;
58703
- let e = t.toLowerCase(), r = ce.current.findIndex((t) => CH(t, S).toLowerCase() === e || SH(t, x).toLowerCase() === e);
58722
+ let e = t.toLowerCase(), r = ce.current.findIndex((t) => wH(t, S).toLowerCase() === e || CH(t, x).toLowerCase() === e);
58704
58723
  r === -1 && (r = ce.current.findIndex((t, n) => {
58705
58724
  let r = ie.current[n];
58706
58725
  return r != null && r.toLowerCase() === e;
@@ -58732,7 +58751,7 @@ function kH(e) {
58732
58751
  }
58733
58752
  //#endregion
58734
58753
  //#region ../../node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
58735
- function AH(e, t) {
58754
+ function jH(e, t) {
58736
58755
  let n = Ap(e);
58737
58756
  return K(() => (t(n), () => {
58738
58757
  t(void 0);
@@ -58740,8 +58759,8 @@ function AH(e, t) {
58740
58759
  }
58741
58760
  //#endregion
58742
58761
  //#region ../../node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
58743
- function jH(e = {}) {
58744
- let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } = fH(), c = AH(t, J((e) => {
58762
+ function MH(e = {}) {
58763
+ let { id: t, fallbackControlId: n, native: r = !1, setLabelId: i, focusControl: a } = e, { controlId: o, setLabelId: s } = pH(), c = jH(t, J((e) => {
58745
58764
  s(e), i?.(e);
58746
58765
  })), l = o ?? n;
58747
58766
  function u(e) {
@@ -58751,7 +58770,7 @@ function jH(e = {}) {
58751
58770
  }
58752
58771
  if (!l) return;
58753
58772
  let t = na(e.currentTarget).getElementById(l);
58754
- Si(t) && MH(t);
58773
+ Si(t) && NH(t);
58755
58774
  }
58756
58775
  function d(e) {
58757
58776
  Ba(e.nativeEvent)?.closest("button,input,select,textarea") || (!e.defaultPrevented && e.detail > 1 && e.preventDefault(), !r && u(e));
@@ -58768,24 +58787,24 @@ function jH(e = {}) {
58768
58787
  }
58769
58788
  };
58770
58789
  }
58771
- function MH(e) {
58790
+ function NH(e) {
58772
58791
  e.focus({ focusVisible: !0 });
58773
58792
  }
58774
58793
  //#endregion
58775
58794
  //#region ../../node_modules/@base-ui/react/utils/resolveAriaLabelledBy.mjs
58776
- function NH(e) {
58795
+ function PH(e) {
58777
58796
  return e == null ? void 0 : `${e}-label`;
58778
58797
  }
58779
- function PH(e, t) {
58798
+ function FH(e, t) {
58780
58799
  return e ?? t;
58781
58800
  }
58782
58801
  //#endregion
58783
58802
  //#region ../../node_modules/@base-ui/react/select/label/SelectLabel.mjs
58784
- var FH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58803
+ var IH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58785
58804
  let { render: n, className: r, style: i, ...a } = e, o = a;
58786
58805
  delete o.id;
58787
- let s = lH(), { store: c } = eH(), l = X(c, $.triggerElement), u = X(c, $.id), d = jH({
58788
- id: NH(u),
58806
+ let s = uH(), { store: c } = tH(), l = X(c, $.triggerElement), u = X(c, $.id), d = MH({
58807
+ id: PH(u),
58789
58808
  fallbackControlId: l?.id ?? u,
58790
58809
  setLabelId(e) {
58791
58810
  c.set("labelId", e);
@@ -58795,20 +58814,20 @@ var FH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58795
58814
  ref: t,
58796
58815
  state: s.state,
58797
58816
  props: [d, a],
58798
- stateAttributesMapping: oH
58817
+ stateAttributesMapping: sH
58799
58818
  });
58800
58819
  });
58801
- process.env.NODE_ENV !== "production" && (FH.displayName = "SelectLabel");
58820
+ process.env.NODE_ENV !== "production" && (IH.displayName = "SelectLabel");
58802
58821
  //#endregion
58803
58822
  //#region ../../node_modules/@base-ui/react/select/trigger/SelectTrigger.mjs
58804
- var IH = 2, LH = 400, RH = {
58823
+ var LH = 2, RH = 400, zH = {
58805
58824
  ..._p,
58806
- ...oH,
58825
+ ...sH,
58807
58826
  popupSide: (e) => e ? { "data-popup-side": e } : null,
58808
58827
  value: () => null
58809
- }, zH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58810
- let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } = lH(), { labelId: m } = fH(), { store: h, setOpen: g, selectionRef: _, validation: v, readOnly: b, required: x, alignItemWithTriggerActiveRef: S, disabled: C } = eH(), w = p || C || a, T = X(h, $.open), E = X(h, $.mounted), D = X(h, $.value), O = X(h, $.triggerProps), k = X(h, $.positionerElement), A = X(h, $.listElement), j = X(h, $.popupSide), M = X(h, $.id), N = X(h, $.labelId), P = X(h, $.hasSelectedValue), F = E && k ? j : null, I = i ?? M, L = PH(m, N);
58811
- pH({ id: I });
58828
+ }, BH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58829
+ let { render: n, className: r, id: i, disabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { setTouched: l, setFocused: u, validationMode: d, state: f, disabled: p } = uH(), { labelId: m } = pH(), { store: h, setOpen: g, selectionRef: _, validation: v, readOnly: b, required: x, alignItemWithTriggerActiveRef: S, disabled: C } = tH(), w = p || C || a, T = X(h, $.open), E = X(h, $.mounted), D = X(h, $.value), O = X(h, $.triggerProps), k = X(h, $.positionerElement), A = X(h, $.listElement), j = X(h, $.popupSide), M = X(h, $.id), N = X(h, $.labelId), P = X(h, $.hasSelectedValue), F = E && k ? j : null, I = i ?? M, L = FH(m, N);
58830
+ mH({ id: I });
58812
58831
  let R = Oo(k), z = y.useRef(null), { getButtonProps: ee, buttonRef: te } = Ep({
58813
58832
  disabled: w,
58814
58833
  native: o
@@ -58816,7 +58835,7 @@ var IH = 2, LH = 400, RH = {
58816
58835
  h.set("triggerElement", e);
58817
58836
  }), re = la(), ie = la(), B = la();
58818
58837
  y.useEffect(() => {
58819
- if (T) return B.start(LH, () => {
58838
+ if (T) return B.start(RH, () => {
58820
58839
  _.current.allowUnselectedMouseUp = !0, _.current.allowSelectedMouseUp = !0;
58821
58840
  }), () => {
58822
58841
  B.clear();
@@ -58858,7 +58877,7 @@ var IH = 2, LH = 400, RH = {
58858
58877
  let t = e.target;
58859
58878
  if (q(z.current, t) || q(R.current, t)) return;
58860
58879
  let n = Pv(z.current);
58861
- e.clientX >= n.left - IH && e.clientX <= n.right + IH && e.clientY >= n.top - IH && e.clientY <= n.bottom + IH || g(!1, go(uo, e));
58880
+ e.clientX >= n.left - LH && e.clientX <= n.right + LH && e.clientY >= n.top - LH && e.clientY <= n.bottom + LH || g(!1, go(uo, e));
58862
58881
  }
58863
58882
  ie.start(0, () => {
58864
58883
  t.addEventListener("mouseup", n, { once: !0 });
@@ -58883,30 +58902,30 @@ var IH = 2, LH = 400, RH = {
58883
58902
  ne
58884
58903
  ],
58885
58904
  state: se,
58886
- stateAttributesMapping: RH,
58905
+ stateAttributesMapping: zH,
58887
58906
  props: oe
58888
58907
  });
58889
58908
  });
58890
- process.env.NODE_ENV !== "production" && (zH.displayName = "SelectTrigger");
58909
+ process.env.NODE_ENV !== "production" && (BH.displayName = "SelectTrigger");
58891
58910
  //#endregion
58892
58911
  //#region ../../node_modules/@base-ui/react/select/value/SelectValue.mjs
58893
- var BH = { value: () => null }, VH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58894
- let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = eH(), u = X(c, $.value), d = X(c, $.items), f = X(c, $.itemToStringLabel), p = X(c, $.hasSelectedValue), m = !p && a != null && i == null, h = X(c, $.hasNullItemLabel, m), g = {
58912
+ var VH = { value: () => null }, HH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58913
+ let { className: n, render: r, children: i, placeholder: a, style: o, ...s } = e, { store: c, valueRef: l } = tH(), u = X(c, $.value), d = X(c, $.items), f = X(c, $.itemToStringLabel), p = X(c, $.hasSelectedValue), m = !p && a != null && i == null, h = X(c, $.hasNullItemLabel, m), g = {
58895
58914
  value: u,
58896
58915
  placeholder: !p
58897
58916
  }, _ = null;
58898
- return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ? TH(u, d, f) : wH(u, d, f)), Rc("span", e, {
58917
+ return _ = typeof i == "function" ? i(u) : i ?? (!p && a != null && !h ? a : Array.isArray(u) ? EH(u, d, f) : TH(u, d, f)), Rc("span", e, {
58899
58918
  state: g,
58900
58919
  ref: [t, l],
58901
58920
  props: [{ children: _ }, s],
58902
- stateAttributesMapping: BH
58921
+ stateAttributesMapping: VH
58903
58922
  });
58904
58923
  });
58905
- process.env.NODE_ENV !== "production" && (VH.displayName = "SelectValue");
58924
+ process.env.NODE_ENV !== "production" && (HH.displayName = "SelectValue");
58906
58925
  //#endregion
58907
58926
  //#region ../../node_modules/@base-ui/react/select/icon/SelectIcon.mjs
58908
- var HH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58909
- let { render: n, className: r, style: i, ...a } = e, { store: o } = eH();
58927
+ var UH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58928
+ let { render: n, className: r, style: i, ...a } = e, { store: o } = tH();
58910
58929
  return Rc("span", e, {
58911
58930
  state: { open: X(o, $.open) },
58912
58931
  ref: t,
@@ -58917,16 +58936,16 @@ var HH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58917
58936
  stateAttributesMapping: gp
58918
58937
  });
58919
58938
  });
58920
- process.env.NODE_ENV !== "production" && (HH.displayName = "SelectIcon");
58939
+ process.env.NODE_ENV !== "production" && (UH.displayName = "SelectIcon");
58921
58940
  //#endregion
58922
58941
  //#region ../../node_modules/@base-ui/react/select/portal/SelectPortalContext.mjs
58923
- var UH = /* @__PURE__ */ y.createContext(void 0);
58924
- process.env.NODE_ENV !== "production" && (UH.displayName = "SelectPortalContext");
58942
+ var WH = /* @__PURE__ */ y.createContext(void 0);
58943
+ process.env.NODE_ENV !== "production" && (WH.displayName = "SelectPortalContext");
58925
58944
  //#endregion
58926
58945
  //#region ../../node_modules/@base-ui/react/select/portal/SelectPortal.mjs
58927
- var WH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58928
- let { store: n } = eH(), r = X(n, $.mounted), i = X(n, $.forceMount);
58929
- return r || i ? /* @__PURE__ */ V(UH.Provider, {
58946
+ var GH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58947
+ let { store: n } = tH(), r = X(n, $.mounted), i = X(n, $.forceMount);
58948
+ return r || i ? /* @__PURE__ */ V(WH.Provider, {
58930
58949
  value: !0,
58931
58950
  children: /* @__PURE__ */ V(nl, {
58932
58951
  ref: t,
@@ -58934,14 +58953,14 @@ var WH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58934
58953
  })
58935
58954
  }) : null;
58936
58955
  });
58937
- process.env.NODE_ENV !== "production" && (WH.displayName = "SelectPortal");
58956
+ process.env.NODE_ENV !== "production" && (GH.displayName = "SelectPortal");
58938
58957
  //#endregion
58939
58958
  //#region ../../node_modules/@base-ui/react/select/backdrop/SelectBackdrop.mjs
58940
- var GH = {
58959
+ var KH = {
58941
58960
  ...vp,
58942
58961
  ...Qd
58943
- }, KH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58944
- let { render: n, className: r, style: i, ...a } = e, { store: o } = eH(), s = X(o, $.open), c = X(o, $.mounted);
58962
+ }, qH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58963
+ let { render: n, className: r, style: i, ...a } = e, { store: o } = tH(), s = X(o, $.open), c = X(o, $.mounted);
58945
58964
  return Rc("div", e, {
58946
58965
  state: {
58947
58966
  open: s,
@@ -58956,31 +58975,31 @@ var GH = {
58956
58975
  WebkitUserSelect: "none"
58957
58976
  }
58958
58977
  }, a],
58959
- stateAttributesMapping: GH
58978
+ stateAttributesMapping: KH
58960
58979
  });
58961
58980
  });
58962
- process.env.NODE_ENV !== "production" && (KH.displayName = "SelectBackdrop");
58981
+ process.env.NODE_ENV !== "production" && (qH.displayName = "SelectBackdrop");
58963
58982
  //#endregion
58964
58983
  //#region ../../node_modules/@base-ui/react/select/positioner/SelectPositionerContext.mjs
58965
- var qH = /* @__PURE__ */ y.createContext(void 0);
58966
- process.env.NODE_ENV !== "production" && (qH.displayName = "SelectPositionerContext");
58967
- function JH() {
58968
- let e = y.useContext(qH);
58984
+ var JH = /* @__PURE__ */ y.createContext(void 0);
58985
+ process.env.NODE_ENV !== "production" && (JH.displayName = "SelectPositionerContext");
58986
+ function YH() {
58987
+ let e = y.useContext(JH);
58969
58988
  if (!e) throw Error(process.env.NODE_ENV === "production" ? pc(59) : "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.");
58970
58989
  return e;
58971
58990
  }
58972
58991
  //#endregion
58973
58992
  //#region ../../node_modules/@base-ui/react/select/popup/utils.mjs
58974
- function YH(e, t) {
58993
+ function XH(e, t) {
58975
58994
  e && Object.assign(e.style, t);
58976
58995
  }
58977
- var XH = {
58996
+ var ZH = {
58978
58997
  position: "relative",
58979
58998
  maxHeight: "100%",
58980
58999
  overflowX: "hidden",
58981
59000
  overflowY: "auto"
58982
- }, ZH = { position: "fixed" }, QH = /* @__PURE__ */ y.forwardRef(function(e, t) {
58983
- let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Yc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } = eH(), k = tH(), A = X(b, $.open), j = X(b, $.mounted), M = X(b, $.modal), N = X(b, $.value), P = X(b, $.openMethod), F = X(b, $.positionerElement), I = X(b, $.triggerElement), L = X(b, $.isItemEqualToValue), R = X(b, $.transitionStatus), z = y.useRef(null), ee = y.useRef(null), [te, ne] = y.useState(h), re = j && te && P !== "touch";
59001
+ }, QH = { position: "fixed" }, $H = /* @__PURE__ */ y.forwardRef(function(e, t) {
59002
+ let { anchor: n, positionMethod: r = "absolute", className: i, render: a, side: o = "bottom", align: s = "center", sideOffset: c = 0, alignOffset: l = 0, collisionBoundary: u = "clipping-ancestors", collisionPadding: d, arrowPadding: f = 5, sticky: p = !1, disableAnchorTracking: m, alignItemWithTrigger: h = !0, collisionAvoidance: g = Yc, style: _, ...v } = e, { store: b, listRef: x, labelsRef: S, alignItemWithTriggerActiveRef: C, selectedItemTextRef: w, valuesRef: T, initialValueRef: E, popupRef: D, setValue: O } = tH(), k = nH(), A = X(b, $.open), j = X(b, $.mounted), M = X(b, $.modal), N = X(b, $.value), P = X(b, $.openMethod), F = X(b, $.positionerElement), I = X(b, $.triggerElement), L = X(b, $.isItemEqualToValue), R = X(b, $.transitionStatus), z = y.useRef(null), ee = y.useRef(null), [te, ne] = y.useState(h), re = j && te && P !== "touch";
58984
59003
  !j && te !== h && ne(h), K(() => {
58985
59004
  j || ($.scrollUpArrowVisible(b.state) && b.set("scrollUpArrowVisible", !1), $.scrollDownArrowVisible(b.state) && b.set("scrollDownArrowVisible", !1));
58986
59005
  }, [b, j]), y.useImperativeHandle(C, () => re), _v((re || M) && A, P === "touch", F, I);
@@ -59000,7 +59019,7 @@ var XH = {
59000
59019
  disableAnchorTracking: m ?? re,
59001
59020
  collisionAvoidance: g,
59002
59021
  keepMounted: !0
59003
- }), B = re ? "none" : ie.side, ae = re ? ZH : ie.positionerStyles, oe = {
59022
+ }), B = re ? "none" : ie.side, ae = re ? QH : ie.positionerStyles, oe = {
59004
59023
  open: A,
59005
59024
  side: B,
59006
59025
  align: ie.align,
@@ -59023,13 +59042,13 @@ var XH = {
59023
59042
  let t = ce.current;
59024
59043
  if (ce.current = e.size, e.size === t) return;
59025
59044
  let n = go(eo);
59026
- if (t !== 0 && !b.state.multiple && N !== null && _H(T.current, N, L) === -1) {
59027
- let e = E.current, t = e != null && _H(T.current, e, L) !== -1 ? e : null;
59045
+ if (t !== 0 && !b.state.multiple && N !== null && vH(T.current, N, L) === -1) {
59046
+ let e = E.current, t = e != null && vH(T.current, e, L) !== -1 ? e : null;
59028
59047
  O(t, n), t === null && (b.set("selectedIndex", null), w.current = null);
59029
59048
  }
59030
59049
  if (t !== 0 && b.state.multiple && Array.isArray(N)) {
59031
- let e = (e) => _H(T.current, e, L) !== -1, t = N.filter((t) => e(t));
59032
- (t.length !== N.length || t.some((e) => !gH(N, e, L))) && (O(t, n), t.length === 0 && (b.set("selectedIndex", null), w.current = null));
59050
+ let e = (e) => vH(T.current, e, L) !== -1, t = N.filter((t) => e(t));
59051
+ (t.length !== N.length || t.some((e) => !_H(N, e, L))) && (O(t, n), t.length === 0 && (b.set("selectedIndex", null), w.current = null));
59033
59052
  }
59034
59053
  if (A && re) {
59035
59054
  b.update({
@@ -59037,7 +59056,7 @@ var XH = {
59037
59056
  scrollDownArrowVisible: !1
59038
59057
  });
59039
59058
  let e = { height: "" };
59040
- YH(F, e), YH(D.current, e);
59059
+ XH(F, e), XH(D.current, e);
59041
59060
  }
59042
59061
  }), ue = y.useMemo(() => ({
59043
59062
  ...ie,
@@ -59056,7 +59075,7 @@ var XH = {
59056
59075
  elementsRef: x,
59057
59076
  labelsRef: S,
59058
59077
  onMapChange: le,
59059
- children: /* @__PURE__ */ H(qH.Provider, {
59078
+ children: /* @__PURE__ */ H(JH.Provider, {
59060
59079
  value: ue,
59061
59080
  children: [j && M && /* @__PURE__ */ V(Jp, {
59062
59081
  inert: qp(!A),
@@ -59065,14 +59084,14 @@ var XH = {
59065
59084
  })
59066
59085
  });
59067
59086
  });
59068
- process.env.NODE_ENV !== "production" && (QH.displayName = "SelectPositioner");
59087
+ process.env.NODE_ENV !== "production" && ($H.displayName = "SelectPositioner");
59069
59088
  //#endregion
59070
59089
  //#region ../../node_modules/@base-ui/react/select/popup/SelectPopup.mjs
59071
- var $H = {
59090
+ var eU = {
59072
59091
  ...vp,
59073
59092
  ...Qd
59074
- }, eU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59075
- let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } = eH(), { side: b, align: x, alignItemWithTriggerActive: S, isPositioned: C, setControlledAlignItemWithTrigger: w } = JH(), T = ov(!0) != null, E = tH(), D = dg(), { nonce: O, disableStyleElements: k } = TV(), A = X(s, $.id), j = X(s, $.open), M = X(s, $.openMethod), N = X(s, $.mounted), P = X(s, $.popupProps), F = X(s, $.transitionStatus), I = X(s, $.triggerElement), L = X(s, $.positionerElement), R = X(s, $.listElement), z = y.useRef(!1), ee = y.useRef(!1), te = y.useRef({}), ne = ma(), re = J((e) => {
59093
+ }, tU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59094
+ let { render: n, className: r, style: i, finalFocus: a, ...o } = e, { store: s, popupRef: c, onOpenChangeComplete: l, setOpen: u, valueRef: d, firstItemTextRef: f, selectedItemTextRef: p, multiple: m, handleScrollArrowVisibility: h, scrollHandlerRef: g, listRef: _, highlightItemOnHover: v } = tH(), { side: b, align: x, alignItemWithTriggerActive: S, isPositioned: C, setControlledAlignItemWithTrigger: w } = YH(), T = ov(!0) != null, E = nH(), D = dg(), { nonce: O, disableStyleElements: k } = EV(), A = X(s, $.id), j = X(s, $.open), M = X(s, $.openMethod), N = X(s, $.mounted), P = X(s, $.popupProps), F = X(s, $.transitionStatus), I = X(s, $.triggerElement), L = X(s, $.positionerElement), R = X(s, $.listElement), z = y.useRef(!1), ee = y.useRef(!1), te = y.useRef({}), ne = ma(), re = J((e) => {
59076
59095
  if (!L || !c.current || !ee.current) return;
59077
59096
  if (z.current || !S) {
59078
59097
  h();
@@ -59083,10 +59102,10 @@ var $H = {
59083
59102
  h();
59084
59103
  return;
59085
59104
  }
59086
- let r = rU(L), i = iU(L.getBoundingClientRect().height, "y", r), a = na(L), o = vi(L), s = o.getComputedStyle(L), l = parseFloat(s.marginTop), u = parseFloat(s.marginBottom), d = tU(o.getComputedStyle(c.current)), f = Math.min(a.documentElement.clientHeight - l - u, d), p = e.scrollTop, m = nU(e), g = 0, _ = null, v = !1, y = !1, b = (e) => {
59105
+ let r = iU(L), i = aU(L.getBoundingClientRect().height, "y", r), a = na(L), o = vi(L), s = o.getComputedStyle(L), l = parseFloat(s.marginTop), u = parseFloat(s.marginBottom), d = nU(o.getComputedStyle(c.current)), f = Math.min(a.documentElement.clientHeight - l - u, d), p = e.scrollTop, m = rU(e), g = 0, _ = null, v = !1, y = !1, b = (e) => {
59087
59106
  L.style.height = `${e}px`;
59088
59107
  }, x = (t, n) => {
59089
- let r = PV(t, 0, f - i);
59108
+ let r = FV(t, 0, f - i);
59090
59109
  r > 0 && b(i + r), e.scrollTop = n, f - (i + r) <= 1 && (z.current = !0), h();
59091
59110
  }, C = t ? m - p : p, w = Math.min(i + C, f);
59092
59111
  if (g = w, C <= 1) {
@@ -59094,7 +59113,7 @@ var $H = {
59094
59113
  return;
59095
59114
  }
59096
59115
  if (f - w > 1 ? t ? y = !0 : _ = 0 : (v = !0, n && p < m && (_ = p - (C - (i + C - f)))), g = Math.ceil(g), g !== 0 && b(g), y || _ != null) {
59097
- let t = nU(e), n = y ? t : PV(_, 0, t);
59116
+ let t = rU(e), n = y ? t : FV(_, 0, t);
59098
59117
  Math.abs(e.scrollTop - n) > 1 && (e.scrollTop = n);
59099
59118
  }
59100
59119
  (v || g >= f - 1) && (z.current = !0), h();
@@ -59125,7 +59144,7 @@ var $H = {
59125
59144
  marginBottom: L.style.marginBottom
59126
59145
  });
59127
59146
  }, [c, L]), K(() => {
59128
- j || S || (ee.current = !1, z.current = !1, YH(L, te.current));
59147
+ j || S || (ee.current = !1, z.current = !1, XH(L, te.current));
59129
59148
  }, [
59130
59149
  j,
59131
59150
  S,
@@ -59138,34 +59157,34 @@ var $H = {
59138
59157
  ee.current = !0, ne.request(h), e.style.removeProperty("--transform-origin");
59139
59158
  return;
59140
59159
  }
59141
- let t = sU(e);
59160
+ let t = cU(e);
59142
59161
  e.style.removeProperty("--transform-origin");
59143
59162
  try {
59144
59163
  let t = p.current;
59145
59164
  t?.isConnected || (t = !$.hasSelectedValue(s.state) && f.current?.isConnected ? f.current : null);
59146
- let n = d.current, r = vi(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = na(I), c = rU(I), l = aU(I.getBoundingClientRect(), c), u = aU(L.getBoundingClientRect(), c), m = l.height, g = R || e, y = g.scrollHeight, b = parseFloat(a.borderBottomWidth), x = parseFloat(i.marginTop) || 10, S = parseFloat(i.marginBottom) || 10, C = parseFloat(i.minHeight) || 100, T = tU(a), E = o.documentElement.clientHeight - x - S, O = o.documentElement.clientWidth, k = E - l.bottom + m, A, j = D === "rtl" ? l.right - u.width : l.left, M = 0;
59165
+ let n = d.current, r = vi(L), i = r.getComputedStyle(L), a = r.getComputedStyle(e), o = na(I), c = iU(I), l = oU(I.getBoundingClientRect(), c), u = oU(L.getBoundingClientRect(), c), m = l.height, g = R || e, y = g.scrollHeight, b = parseFloat(a.borderBottomWidth), x = parseFloat(i.marginTop) || 10, S = parseFloat(i.marginBottom) || 10, C = parseFloat(i.minHeight) || 100, T = nU(a), E = o.documentElement.clientHeight - x - S, O = o.documentElement.clientWidth, k = E - l.bottom + m, A, j = D === "rtl" ? l.right - u.width : l.left, M = 0;
59147
59166
  if (t && n) {
59148
- let e = aU(n.getBoundingClientRect(), c);
59149
- A = aU(t.getBoundingClientRect(), c), j = u.left + (D === "rtl" ? e.right - A.right : e.left - A.left);
59167
+ let e = oU(n.getBoundingClientRect(), c);
59168
+ A = oU(t.getBoundingClientRect(), c), j = u.left + (D === "rtl" ? e.right - A.right : e.left - A.left);
59150
59169
  let r = e.top - l.top + e.height / 2;
59151
59170
  M = A.top - u.top + A.height / 2 - r;
59152
59171
  }
59153
59172
  let N = k + M + S + b, P = Math.min(E, N), F = E - x - S, ne = N - P, re = O - 5;
59154
- L.style.left = `${PV(j, 5, re - u.width)}px`, L.style.height = `${P}px`, L.style.maxHeight = "none", L.style.marginTop = `${x}px`, L.style.marginBottom = `${S}px`, e.style.height = "100%";
59155
- let ie = nU(g), B = ne >= ie - 1;
59173
+ L.style.left = `${FV(j, 5, re - u.width)}px`, L.style.height = `${P}px`, L.style.maxHeight = "none", L.style.marginTop = `${x}px`, L.style.marginBottom = `${S}px`, e.style.height = "100%";
59174
+ let ie = rU(g), B = ne >= ie - 1;
59156
59175
  B && (P = Math.min(E, u.height) - (ne - ie));
59157
59176
  let ae = l.top < 20 || l.bottom > E - 20 || Math.ceil(P) + 1 < Math.min(y, C), oe = (r.visualViewport?.scale ?? 1) !== 1 && $i;
59158
59177
  if (ae || oe) {
59159
- ee.current = !0, YH(L, te.current), w(!1);
59178
+ ee.current = !0, XH(L, te.current), w(!1);
59160
59179
  return;
59161
59180
  }
59162
59181
  let se = Math.max(C, P);
59163
59182
  if (B) {
59164
59183
  let e = Math.max(0, E - N);
59165
- L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop = nU(g);
59184
+ L.style.top = u.height >= F ? "0" : `${e}px`, L.style.height = `${P}px`, g.scrollTop = rU(g);
59166
59185
  } else L.style.bottom = "0", g.scrollTop = ne;
59167
59186
  if (A) {
59168
- let t = u.top, n = u.height, r = A.top + A.height / 2, i = PV(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
59187
+ let t = u.top, n = u.height, r = A.top + A.height / 2, i = FV(n > 0 ? (r - t) / n * 100 : 50, 0, 100);
59169
59188
  e.style.setProperty("--transform-origin", `50% ${i}%`);
59170
59189
  }
59171
59190
  (se === E || P >= T) && (z.current = !0), h(), v && s.state.selectedIndex === null && s.state.activeIndex === null && _.current[0] != null && s.set("activeIndex", 0), ee.current = !0;
@@ -59218,20 +59237,20 @@ var $H = {
59218
59237
  onScroll(e) {
59219
59238
  R || re(e.currentTarget);
59220
59239
  },
59221
- ...S && { style: R ? { height: "100%" } : XH }
59240
+ ...S && { style: R ? { height: "100%" } : ZH }
59222
59241
  }, ae = Rc("div", e, {
59223
59242
  ref: [t, c],
59224
59243
  state: ie,
59225
- stateAttributesMapping: $H,
59244
+ stateAttributesMapping: eU,
59226
59245
  props: [
59227
59246
  P,
59228
59247
  B,
59229
59248
  Sg(F),
59230
- { className: !R && S ? bV.className : void 0 },
59249
+ { className: !R && S ? xV.className : void 0 },
59231
59250
  o
59232
59251
  ]
59233
59252
  });
59234
- return /* @__PURE__ */ H(y.Fragment, { children: [!k && bV.getElement(O), /* @__PURE__ */ V(xl, {
59253
+ return /* @__PURE__ */ H(y.Fragment, { children: [!k && xV.getElement(O), /* @__PURE__ */ V(xl, {
59235
59254
  context: E,
59236
59255
  modal: !1,
59237
59256
  disabled: !N,
@@ -59241,38 +59260,38 @@ var $H = {
59241
59260
  children: ae
59242
59261
  })] });
59243
59262
  });
59244
- process.env.NODE_ENV !== "production" && (eU.displayName = "SelectPopup");
59245
- function tU(e) {
59263
+ process.env.NODE_ENV !== "production" && (tU.displayName = "SelectPopup");
59264
+ function nU(e) {
59246
59265
  let t = e.maxHeight || "";
59247
59266
  return t.endsWith("px") && parseFloat(t) || Infinity;
59248
59267
  }
59249
- function nU(e) {
59250
- return IV(e.scrollHeight, e.clientHeight);
59251
- }
59252
59268
  function rU(e) {
59269
+ return LV(e.scrollHeight, e.clientHeight);
59270
+ }
59271
+ function iU(e) {
59253
59272
  return hu.getScale(e);
59254
59273
  }
59255
- function iU(e, t, n) {
59274
+ function aU(e, t, n) {
59256
59275
  return e / n[t];
59257
59276
  }
59258
- function aU(e, t) {
59277
+ function oU(e, t) {
59259
59278
  return fs({
59260
- x: iU(e.x, "x", t),
59261
- y: iU(e.y, "y", t),
59262
- width: iU(e.width, "x", t),
59263
- height: iU(e.height, "y", t)
59279
+ x: aU(e.x, "x", t),
59280
+ y: aU(e.y, "y", t),
59281
+ width: aU(e.width, "x", t),
59282
+ height: aU(e.height, "y", t)
59264
59283
  });
59265
59284
  }
59266
- var oU = [
59285
+ var sU = [
59267
59286
  ["transform", "none"],
59268
59287
  ["scale", "1"],
59269
59288
  ["translate", "0 0"]
59270
59289
  ];
59271
- function sU(e) {
59290
+ function cU(e) {
59272
59291
  let { style: t } = e, n = {};
59273
- for (let [e, r] of oU) n[e] = t.getPropertyValue(e), t.setProperty(e, r, "important");
59292
+ for (let [e, r] of sU) n[e] = t.getPropertyValue(e), t.setProperty(e, r, "important");
59274
59293
  return () => {
59275
- for (let [e] of oU) {
59294
+ for (let [e] of sU) {
59276
59295
  let r = n[e];
59277
59296
  r ? t.setProperty(e, r) : t.removeProperty(e);
59278
59297
  }
@@ -59280,16 +59299,16 @@ function sU(e) {
59280
59299
  }
59281
59300
  //#endregion
59282
59301
  //#region ../../node_modules/@base-ui/react/select/list/SelectList.mjs
59283
- var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59284
- let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = eH(), { alignItemWithTriggerActive: c } = JH(), l = X(o, $.hasScrollArrows), u = X(o, $.openMethod), d = X(o, $.multiple), f = {
59302
+ var lU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59303
+ let { render: n, className: r, style: i, ...a } = e, { store: o, scrollHandlerRef: s } = tH(), { alignItemWithTriggerActive: c } = YH(), l = X(o, $.hasScrollArrows), u = X(o, $.openMethod), d = X(o, $.multiple), f = {
59285
59304
  id: `${X(o, $.id)}-list`,
59286
59305
  role: "listbox",
59287
59306
  "aria-multiselectable": d || void 0,
59288
59307
  onScroll(e) {
59289
59308
  s.current?.(e.currentTarget);
59290
59309
  },
59291
- ...c && { style: XH },
59292
- className: l && u !== "touch" ? bV.className : void 0
59310
+ ...c && { style: ZH },
59311
+ className: l && u !== "touch" ? xV.className : void 0
59293
59312
  };
59294
59313
  return Rc("div", e, {
59295
59314
  ref: [t, J((e) => {
@@ -59298,24 +59317,24 @@ var cU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59298
59317
  props: [f, a]
59299
59318
  });
59300
59319
  });
59301
- process.env.NODE_ENV !== "production" && (cU.displayName = "SelectList");
59320
+ process.env.NODE_ENV !== "production" && (lU.displayName = "SelectList");
59302
59321
  //#endregion
59303
59322
  //#region ../../node_modules/@base-ui/react/select/item/SelectItemContext.mjs
59304
- var lU = /* @__PURE__ */ y.createContext(void 0);
59305
- process.env.NODE_ENV !== "production" && (lU.displayName = "SelectItemContext");
59306
- function uU() {
59307
- let e = y.useContext(lU);
59323
+ var uU = /* @__PURE__ */ y.createContext(void 0);
59324
+ process.env.NODE_ENV !== "production" && (uU.displayName = "SelectItemContext");
59325
+ function dU() {
59326
+ let e = y.useContext(uU);
59308
59327
  if (!e) throw Error(process.env.NODE_ENV === "production" ? pc(57) : "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.");
59309
59328
  return e;
59310
59329
  }
59311
59330
  //#endregion
59312
59331
  //#region ../../node_modules/@base-ui/react/select/item/SelectItem.mjs
59313
- var dU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59332
+ var fU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59314
59333
  let { render: n, className: r, style: i, value: a = null, label: o, disabled: s = !1, nativeButton: c = !1, ...l } = e, u = y.useRef(null), d = J_({
59315
59334
  label: o,
59316
59335
  textRef: u,
59317
59336
  indexGuessBehavior: q_.GuessFromOrder
59318
- }), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } = eH(), w = X(f, $.isActive, d.index), T = X(f, $.open), E = X(f, $.isSelected, a), D = X(f, $.isSelectedByFocus, d.index), O = X(f, $.isItemEqualToValue), k = d.index, A = k !== -1, j = y.useRef(null);
59337
+ }), { store: f, itemProps: p, setOpen: m, setValue: h, selectionRef: g, typingRef: _, valuesRef: v, multiple: b, selectedItemTextRef: x, disabled: S, readOnly: C } = tH(), w = X(f, $.isActive, d.index), T = X(f, $.open), E = X(f, $.isSelected, a), D = X(f, $.isSelectedByFocus, d.index), O = X(f, $.isItemEqualToValue), k = d.index, A = k !== -1, j = y.useRef(null);
59319
59338
  K(() => {
59320
59339
  if (!A) return;
59321
59340
  let e = v.current;
@@ -59330,7 +59349,7 @@ var dU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59330
59349
  ]), K(() => {
59331
59350
  if (!A) return;
59332
59351
  let e = f.state.value, t = e;
59333
- b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && hH(a, t, O) && (f.set("selectedIndex", k), u.current && (x.current = u.current));
59352
+ b && Array.isArray(e) && (t = e.length > 0 ? e[e.length - 1] : void 0), t !== void 0 && gH(a, t, O) && (f.set("selectedIndex", k), u.current && (x.current = u.current));
59334
59353
  }, [
59335
59354
  A,
59336
59355
  k,
@@ -59355,7 +59374,7 @@ var dU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59355
59374
  let t = f.state.value;
59356
59375
  if (b) {
59357
59376
  let n = Array.isArray(t) ? t : [];
59358
- h(E ? vH(n, a, O) : [...n, a], go(ao, e));
59377
+ h(E ? yH(n, a, O) : [...n, a], go(ao, e));
59359
59378
  } else h(a, go(ao, e)), m(!1, go(ao, e));
59360
59379
  }
59361
59380
  function z() {
@@ -59416,24 +59435,24 @@ var dU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59416
59435
  D,
59417
59436
  A
59418
59437
  ]);
59419
- return /* @__PURE__ */ V(lU.Provider, {
59438
+ return /* @__PURE__ */ V(uU.Provider, {
59420
59439
  value: ne,
59421
59440
  children: te
59422
59441
  });
59423
59442
  }));
59424
- process.env.NODE_ENV !== "production" && (dU.displayName = "SelectItem");
59443
+ process.env.NODE_ENV !== "production" && (fU.displayName = "SelectItem");
59425
59444
  //#endregion
59426
59445
  //#region ../../node_modules/@base-ui/react/select/item-indicator/SelectItemIndicator.mjs
59427
- var fU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59428
- let n = e.keepMounted ?? !1, { selected: r } = uU();
59429
- return n || r ? /* @__PURE__ */ V(pU, {
59446
+ var pU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59447
+ let n = e.keepMounted ?? !1, { selected: r } = dU();
59448
+ return n || r ? /* @__PURE__ */ V(mU, {
59430
59449
  ...e,
59431
59450
  ref: t
59432
59451
  }) : null;
59433
59452
  });
59434
- process.env.NODE_ENV !== "production" && (fU.displayName = "SelectItemIndicator");
59435
- var pU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
59436
- let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = uU(), c = y.useRef(null), { transitionStatus: l, setMounted: u } = Jd(s), d = Rc("span", e, {
59453
+ process.env.NODE_ENV !== "production" && (pU.displayName = "SelectItemIndicator");
59454
+ var mU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
59455
+ let { render: n, className: r, style: i, keepMounted: a, ...o } = e, { selected: s } = dU(), c = y.useRef(null), { transitionStatus: l, setMounted: u } = Jd(s), d = Rc("span", e, {
59437
59456
  ref: [t, c],
59438
59457
  state: {
59439
59458
  selected: s,
@@ -59453,11 +59472,11 @@ var pU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef((e, t) => {
59453
59472
  }
59454
59473
  }), d;
59455
59474
  }));
59456
- process.env.NODE_ENV !== "production" && (pU.displayName = "Inner");
59475
+ process.env.NODE_ENV !== "production" && (mU.displayName = "Inner");
59457
59476
  //#endregion
59458
59477
  //#region ../../node_modules/@base-ui/react/select/item-text/SelectItemText.mjs
59459
- var mU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59460
- let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } = uU(), { firstItemTextRef: o, selectedItemTextRef: s } = eH(), { render: c, className: l, style: u, ...d } = e;
59478
+ var hU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59479
+ let { index: n, textRef: r, selectedByFocus: i, hasRegistered: a } = dU(), { firstItemTextRef: o, selectedItemTextRef: s } = tH(), { render: c, className: l, style: u, ...d } = e;
59461
59480
  return Rc("div", e, {
59462
59481
  ref: [
59463
59482
  y.useCallback((e) => {
@@ -59475,14 +59494,14 @@ var mU = /* @__PURE__ */ y.memo(/* @__PURE__ */ y.forwardRef(function(e, t) {
59475
59494
  props: d
59476
59495
  });
59477
59496
  }));
59478
- process.env.NODE_ENV !== "production" && (mU.displayName = "SelectItemText");
59497
+ process.env.NODE_ENV !== "production" && (hU.displayName = "SelectItemText");
59479
59498
  //#endregion
59480
59499
  //#region ../../node_modules/@base-ui/react/select/arrow/SelectArrow.mjs
59481
- var hU = {
59500
+ var gU = {
59482
59501
  ...vp,
59483
59502
  ...Qd
59484
- }, gU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59485
- let { render: n, className: r, style: i, ...a } = e, { store: o } = eH(), { side: s, align: c, arrowRef: l, arrowStyles: u, arrowUncentered: d, alignItemWithTriggerActive: f } = JH(), p = Rc("div", e, {
59503
+ }, _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
59504
+ let { render: n, className: r, style: i, ...a } = e, { store: o } = tH(), { side: s, align: c, arrowRef: l, arrowStyles: u, arrowUncentered: d, alignItemWithTriggerActive: f } = YH(), p = Rc("div", e, {
59486
59505
  state: {
59487
59506
  open: X(o, $.open),
59488
59507
  side: s,
@@ -59494,15 +59513,15 @@ var hU = {
59494
59513
  style: u,
59495
59514
  "aria-hidden": !0
59496
59515
  }, a],
59497
- stateAttributesMapping: hU
59516
+ stateAttributesMapping: gU
59498
59517
  });
59499
59518
  return f ? null : p;
59500
59519
  });
59501
- process.env.NODE_ENV !== "production" && (gU.displayName = "SelectArrow");
59520
+ process.env.NODE_ENV !== "production" && (_U.displayName = "SelectArrow");
59502
59521
  //#endregion
59503
59522
  //#region ../../node_modules/@base-ui/react/select/scroll-arrow/SelectScrollArrow.mjs
59504
- var _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
59505
- let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } = eH(), { side: m, scrollDownArrowRef: h, scrollUpArrowRef: g } = JH(), _ = X(l, c ? $.scrollUpArrowVisible : $.scrollDownArrowVisible), v = X(l, $.openMethod), y = _ && v !== "touch", b = la(), x = c ? g : h, { mounted: S, transitionStatus: C, setMounted: w } = Jd(y);
59523
+ var vU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59524
+ let { render: n, className: r, style: i, direction: a, keepMounted: o = !1, ...s } = e, c = a === "up", { store: l, popupRef: u, listRef: d, handleScrollArrowVisibility: f, scrollArrowsMountedCountRef: p } = tH(), { side: m, scrollDownArrowRef: h, scrollUpArrowRef: g } = YH(), _ = X(l, c ? $.scrollUpArrowVisible : $.scrollDownArrowVisible), v = X(l, $.openMethod), y = _ && v !== "touch", b = la(), x = c ? g : h, { mounted: S, transitionStatus: C, setMounted: w } = Jd(y);
59506
59525
  K(() => (p.current += 1, l.state.hasScrollArrows || l.set("hasScrollArrows", !0), () => {
59507
59526
  p.current = Math.max(0, p.current - 1), p.current === 0 && l.state.hasScrollArrows && l.set("hasScrollArrows", !1);
59508
59527
  }), [l, p]), ef({
@@ -59531,14 +59550,14 @@ var _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
59531
59550
  let e = l.state.listElement ?? u.current;
59532
59551
  if (!e) return;
59533
59552
  l.set("activeIndex", null), f();
59534
- let n = IV(e.scrollHeight, e.clientHeight), r = LV(e.scrollTop, n), i = r === (c ? 0 : n), a = d.current;
59553
+ let n = LV(e.scrollHeight, e.clientHeight), r = RV(e.scrollTop, n), i = r === (c ? 0 : n), a = d.current;
59535
59554
  if (r !== e.scrollTop && (e.scrollTop = r), a.length === 0 && l.set(c ? "scrollUpArrowVisible" : "scrollDownArrowVisible", !i), i) {
59536
59555
  b.clear();
59537
59556
  return;
59538
59557
  }
59539
59558
  if (a.length > 0) {
59540
59559
  let t = x.current?.offsetHeight || 0;
59541
- e.scrollTop = vU(a, c, r, e.clientHeight, t, n);
59560
+ e.scrollTop = yU(a, c, r, e.clientHeight, t, n);
59542
59561
  }
59543
59562
  b.start(40, t);
59544
59563
  }
@@ -59552,8 +59571,8 @@ var _U = /* @__PURE__ */ y.forwardRef(function(e, t) {
59552
59571
  });
59553
59572
  return S || o ? T : null;
59554
59573
  });
59555
- process.env.NODE_ENV !== "production" && (_U.displayName = "SelectScrollArrow");
59556
- function vU(e, t, n, r, i, a) {
59574
+ process.env.NODE_ENV !== "production" && (vU.displayName = "SelectScrollArrow");
59575
+ function yU(e, t, n, r, i, a) {
59557
59576
  if (t) {
59558
59577
  let t = 0, r = n + i - 1;
59559
59578
  for (let n = 0; n < e.length; n += 1) {
@@ -59564,7 +59583,7 @@ function vU(e, t, n, r, i, a) {
59564
59583
  }
59565
59584
  }
59566
59585
  let o = Math.max(0, t - 1), s = e[o];
59567
- return o < t && s ? LV(s.offsetTop - i, a) : 0;
59586
+ return o < t && s ? RV(s.offsetTop - i, a) : 0;
59568
59587
  }
59569
59588
  let o = e.length - 1, s = n + r - i + 1;
59570
59589
  for (let t = 0; t < e.length; t += 1) {
@@ -59575,40 +59594,40 @@ function vU(e, t, n, r, i, a) {
59575
59594
  }
59576
59595
  }
59577
59596
  let c = Math.min(e.length - 1, o + 1), l = e[c];
59578
- return c > o && l ? LV(l.offsetTop + l.offsetHeight - r + i, a) : a;
59597
+ return c > o && l ? RV(l.offsetTop + l.offsetHeight - r + i, a) : a;
59579
59598
  }
59580
59599
  //#endregion
59581
59600
  //#region ../../node_modules/@base-ui/react/select/scroll-down-arrow/SelectScrollDownArrow.mjs
59582
- var yU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59583
- return /* @__PURE__ */ V(_U, {
59601
+ var bU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59602
+ return /* @__PURE__ */ V(vU, {
59584
59603
  ...e,
59585
59604
  ref: t,
59586
59605
  direction: "down"
59587
59606
  });
59588
59607
  });
59589
- process.env.NODE_ENV !== "production" && (yU.displayName = "SelectScrollDownArrow");
59608
+ process.env.NODE_ENV !== "production" && (bU.displayName = "SelectScrollDownArrow");
59590
59609
  //#endregion
59591
59610
  //#region ../../node_modules/@base-ui/react/select/scroll-up-arrow/SelectScrollUpArrow.mjs
59592
- var bU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59593
- return /* @__PURE__ */ V(_U, {
59611
+ var xU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59612
+ return /* @__PURE__ */ V(vU, {
59594
59613
  ...e,
59595
59614
  ref: t,
59596
59615
  direction: "up"
59597
59616
  });
59598
59617
  });
59599
- process.env.NODE_ENV !== "production" && (bU.displayName = "SelectScrollUpArrow");
59618
+ process.env.NODE_ENV !== "production" && (xU.displayName = "SelectScrollUpArrow");
59600
59619
  //#endregion
59601
59620
  //#region ../../node_modules/@base-ui/react/select/group/SelectGroupContext.mjs
59602
- var xU = /* @__PURE__ */ y.createContext(void 0);
59603
- process.env.NODE_ENV !== "production" && (xU.displayName = "SelectGroupContext");
59604
- function SU() {
59605
- let e = y.useContext(xU);
59621
+ var SU = /* @__PURE__ */ y.createContext(void 0);
59622
+ process.env.NODE_ENV !== "production" && (SU.displayName = "SelectGroupContext");
59623
+ function CU() {
59624
+ let e = y.useContext(SU);
59606
59625
  if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? pc(56) : "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.");
59607
59626
  return e;
59608
59627
  }
59609
59628
  //#endregion
59610
59629
  //#region ../../node_modules/@base-ui/react/select/group/SelectGroup.mjs
59611
- var CU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59630
+ var wU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59612
59631
  let { render: n, className: r, style: i, ...a } = e, [o, s] = y.useState(), c = y.useMemo(() => ({
59613
59632
  labelId: o,
59614
59633
  setLabelId: s
@@ -59619,16 +59638,16 @@ var CU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59619
59638
  "aria-labelledby": o
59620
59639
  }, a]
59621
59640
  });
59622
- return /* @__PURE__ */ V(xU.Provider, {
59641
+ return /* @__PURE__ */ V(SU.Provider, {
59623
59642
  value: c,
59624
59643
  children: l
59625
59644
  });
59626
59645
  });
59627
- process.env.NODE_ENV !== "production" && (CU.displayName = "SelectGroup");
59646
+ process.env.NODE_ENV !== "production" && (wU.displayName = "SelectGroup");
59628
59647
  //#endregion
59629
59648
  //#region ../../node_modules/@base-ui/react/select/group-label/SelectGroupLabel.mjs
59630
- var wU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59631
- let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } = SU(), c = Ap(a);
59649
+ var TU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59650
+ let { render: n, className: r, style: i, id: a, ...o } = e, { setLabelId: s } = CU(), c = Ap(a);
59632
59651
  return K(() => {
59633
59652
  s(c);
59634
59653
  }, [c, s]), Rc("div", e, {
@@ -59636,12 +59655,12 @@ var wU = /* @__PURE__ */ y.forwardRef(function(e, t) {
59636
59655
  props: [{ id: c }, o]
59637
59656
  });
59638
59657
  });
59639
- process.env.NODE_ENV !== "production" && (wU.displayName = "SelectGroupLabel");
59658
+ process.env.NODE_ENV !== "production" && (TU.displayName = "SelectGroupLabel");
59640
59659
  //#endregion
59641
59660
  //#region src/components/ui/select.tsx
59642
- function TU({ children: e, items: t, onValueChange: n, ...r }) {
59643
- return /* @__PURE__ */ V(kH, {
59644
- items: t ?? NU(e),
59661
+ function EU({ children: e, items: t, onValueChange: n, ...r }) {
59662
+ return /* @__PURE__ */ V(AH, {
59663
+ items: t ?? PU(e),
59645
59664
  onValueChange: (e) => {
59646
59665
  e !== null && n?.(e);
59647
59666
  },
@@ -59649,86 +59668,86 @@ function TU({ children: e, items: t, onValueChange: n, ...r }) {
59649
59668
  children: e
59650
59669
  });
59651
59670
  }
59652
- var EU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(VH, {
59671
+ var DU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(HH, {
59653
59672
  ref: n,
59654
59673
  className: U("flex flex-1 text-left", e),
59655
59674
  ...t
59656
59675
  }));
59657
- EU.displayName = "SelectValue";
59658
- var DU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(zH, {
59676
+ DU.displayName = "SelectValue";
59677
+ var OU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(BH, {
59659
59678
  ref: i,
59660
59679
  render: um(n, t),
59661
59680
  className: U("flex cursor-pointer h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50 [&>span]:line-clamp-1", e),
59662
59681
  ...r,
59663
- children: [t, /* @__PURE__ */ V(HH, { render: /* @__PURE__ */ V(fh, { className: "h-4 w-4 text-muted-foreground" }) })]
59682
+ children: [t, /* @__PURE__ */ V(UH, { render: /* @__PURE__ */ V(fh, { className: "h-4 w-4 text-muted-foreground" }) })]
59664
59683
  }));
59665
- DU.displayName = "SelectTrigger";
59666
- var OU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(bU, {
59684
+ OU.displayName = "SelectTrigger";
59685
+ var kU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(xU, {
59667
59686
  ref: n,
59668
59687
  className: U("flex cursor-pointer items-center justify-center py-1", e),
59669
59688
  ...t,
59670
59689
  children: /* @__PURE__ */ V(mh, { className: "h-4 w-4" })
59671
59690
  }));
59672
- OU.displayName = "SelectScrollUpButton";
59673
- var kU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(yU, {
59691
+ kU.displayName = "SelectScrollUpButton";
59692
+ var AU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(bU, {
59674
59693
  ref: n,
59675
59694
  className: U("flex cursor-pointer items-center justify-center py-1", e),
59676
59695
  ...t,
59677
59696
  children: /* @__PURE__ */ V(fh, { className: "h-4 w-4" })
59678
59697
  }));
59679
- kU.displayName = "SelectScrollDownButton";
59680
- var AU = y.forwardRef(({ className: e, children: t, position: n = "popper", side: r = "bottom", sideOffset: i = 4, align: a = "center", alignOffset: o = 0, alignItemWithTrigger: s = n === "popper", ...c }, l) => {
59698
+ AU.displayName = "SelectScrollDownButton";
59699
+ var jU = y.forwardRef(({ className: e, children: t, position: n = "popper", side: r = "bottom", sideOffset: i = 4, align: a = "center", alignOffset: o = 0, alignItemWithTrigger: s = n === "popper", ...c }, l) => {
59681
59700
  let { resolvedTheme: u, theme: d } = Hm();
59682
- return /* @__PURE__ */ V(WH, { children: /* @__PURE__ */ V(QH, {
59701
+ return /* @__PURE__ */ V(GH, { children: /* @__PURE__ */ V($H, {
59683
59702
  align: a,
59684
59703
  alignOffset: o,
59685
59704
  alignItemWithTrigger: s,
59686
59705
  className: "z-50",
59687
59706
  side: r,
59688
59707
  sideOffset: i,
59689
- children: /* @__PURE__ */ H(eU, {
59708
+ children: /* @__PURE__ */ H(tU, {
59690
59709
  ref: l,
59691
59710
  className: U("agents-sdk relative z-50 max-h-[var(--available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--transform-origin)]", n === "popper" && "w-full min-w-[var(--anchor-width)] data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", e),
59692
59711
  "data-agents-sdk-resolved-theme": u,
59693
59712
  "data-agents-sdk-theme": d,
59694
59713
  ...c,
59695
59714
  children: [
59696
- /* @__PURE__ */ V(OU, {}),
59697
- /* @__PURE__ */ V(cU, {
59715
+ /* @__PURE__ */ V(kU, {}),
59716
+ /* @__PURE__ */ V(lU, {
59698
59717
  className: "p-1",
59699
59718
  children: t
59700
59719
  }),
59701
- /* @__PURE__ */ V(kU, {})
59720
+ /* @__PURE__ */ V(AU, {})
59702
59721
  ]
59703
59722
  })
59704
59723
  }) });
59705
59724
  });
59706
- AU.displayName = "SelectContent";
59707
- var jU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(wU, {
59725
+ jU.displayName = "SelectContent";
59726
+ var MU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(TU, {
59708
59727
  ref: n,
59709
59728
  className: U("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
59710
59729
  ...t
59711
59730
  }));
59712
- jU.displayName = "SelectLabel";
59713
- var MU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(dU, {
59731
+ MU.displayName = "SelectLabel";
59732
+ var NU = y.forwardRef(({ className: e, children: t, asChild: n = !1, ...r }, i) => /* @__PURE__ */ H(fU, {
59714
59733
  ref: i,
59715
59734
  render: um(n, t),
59716
59735
  className: U("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", e),
59717
59736
  ...r,
59718
59737
  children: [/* @__PURE__ */ V("span", {
59719
59738
  className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
59720
- children: /* @__PURE__ */ V(fU, { children: /* @__PURE__ */ V(dh, { className: "h-4 w-4" }) })
59721
- }), /* @__PURE__ */ V(mU, { children: t })]
59739
+ children: /* @__PURE__ */ V(pU, { children: /* @__PURE__ */ V(dh, { className: "h-4 w-4" }) })
59740
+ }), /* @__PURE__ */ V(hU, { children: t })]
59722
59741
  }));
59723
- MU.displayName = "SelectItem";
59724
- function NU(e) {
59742
+ NU.displayName = "SelectItem";
59743
+ function PU(e) {
59725
59744
  let t = [];
59726
- return PU(e, t), t.length > 0 ? t : void 0;
59745
+ return FU(e, t), t.length > 0 ? t : void 0;
59727
59746
  }
59728
- function PU(e, t) {
59747
+ function FU(e, t) {
59729
59748
  y.Children.forEach(e, (e) => {
59730
59749
  if (y.isValidElement(e)) {
59731
- if (e.type === MU) {
59750
+ if (e.type === NU) {
59732
59751
  let n = e.props.value;
59733
59752
  typeof n == "string" && t.push({
59734
59753
  value: n,
@@ -59736,34 +59755,34 @@ function PU(e, t) {
59736
59755
  });
59737
59756
  return;
59738
59757
  }
59739
- PU(e.props.children, t);
59758
+ FU(e.props.children, t);
59740
59759
  }
59741
59760
  });
59742
59761
  }
59743
- var FU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(kh, {
59762
+ var IU = y.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ V(kh, {
59744
59763
  ref: n,
59745
59764
  className: U("-mx-1 my-1 h-px bg-muted", e),
59746
59765
  ...t
59747
59766
  }));
59748
- FU.displayName = "SelectSeparator";
59767
+ IU.displayName = "SelectSeparator";
59749
59768
  //#endregion
59750
59769
  //#region src/components/elements/prompt-input.tsx
59751
- var IU = 9;
59752
- function LU(e) {
59770
+ var LU = 9;
59771
+ function RU(e) {
59753
59772
  let t = e?.firstElementChild;
59754
59773
  return t instanceof HTMLElement ? t : null;
59755
59774
  }
59756
- function RU(e) {
59775
+ function zU(e) {
59757
59776
  let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
59758
59777
  return {
59759
59778
  minHeight: a + o + s,
59760
- maxHeight: a * IU + o + s
59779
+ maxHeight: a * LU + o + s
59761
59780
  };
59762
59781
  }
59763
- function zU(e, t, n) {
59782
+ function BU(e, t, n) {
59764
59783
  if (!e) return;
59765
59784
  e.style.height = "auto";
59766
- let { minHeight: r, maxHeight: i } = RU(e), a = Math.max(e.scrollHeight, r), o = Math.min(a, i), s = LU(t);
59785
+ let { minHeight: r, maxHeight: i } = zU(e), a = Math.max(e.scrollHeight, r), o = Math.min(a, i), s = RU(t);
59767
59786
  if (e.style.height = `${a}px`, e.style.overflowY = "hidden", n((e) => e === o ? e : o), s) {
59768
59787
  if (a <= i) {
59769
59788
  s.scrollTop = 0;
@@ -59774,30 +59793,30 @@ function zU(e, t, n) {
59774
59793
  });
59775
59794
  }
59776
59795
  }
59777
- function BU(e, t) {
59796
+ function VU(e, t) {
59778
59797
  if (typeof e == "function") {
59779
59798
  e(t);
59780
59799
  return;
59781
59800
  }
59782
59801
  e && (e.current = t);
59783
59802
  }
59784
- var VU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59803
+ var HU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59785
59804
  className: U("w-full overflow-hidden rounded-xl border bg-background shadow-xs", e),
59786
59805
  ...t
59787
- }), HU = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ref: r, disableAutoResize: i = !1, resizeOnNewLinesOnly: a = !1, ...o }) => {
59806
+ }), UU = ({ onChange: e, className: t, placeholder: n = "What would you like to know?", ref: r, disableAutoResize: i = !1, resizeOnNewLinesOnly: a = !1, ...o }) => {
59788
59807
  let s = R(null), c = R(null), [l, u] = z(), d = !i && !a;
59789
59808
  j(() => {
59790
- d && zU(s.current, c.current, u);
59809
+ d && BU(s.current, c.current, u);
59791
59810
  }, [
59792
59811
  o.value,
59793
59812
  o.defaultValue,
59794
59813
  d
59795
59814
  ]);
59796
- let f = /* @__PURE__ */ V(nB, {
59815
+ let f = /* @__PURE__ */ V(rB, {
59797
59816
  className: U("w-full resize-none rounded-none border-none p-3 shadow-none outline-hidden ring-0", i || a ? "field-sizing-fixed" : "field-sizing-fixed min-h-[calc(1lh+1.5rem)] overflow-y-hidden", "bg-transparent dark:bg-transparent", "focus-visible:ring-0", t),
59798
59817
  name: "message",
59799
59818
  onChange: (t) => {
59800
- d && zU(t.currentTarget, c.current, u), e?.(t);
59819
+ d && BU(t.currentTarget, c.current, u), e?.(t);
59801
59820
  },
59802
59821
  onKeyDown: (e) => {
59803
59822
  if (e.key === "Enter") {
@@ -59809,23 +59828,23 @@ var VU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59809
59828
  },
59810
59829
  placeholder: n,
59811
59830
  ref: (e) => {
59812
- s.current = e, BU(r, e);
59831
+ s.current = e, VU(r, e);
59813
59832
  },
59814
59833
  ...o
59815
59834
  });
59816
- return d ? /* @__PURE__ */ V(XV, {
59835
+ return d ? /* @__PURE__ */ V(ZV, {
59817
59836
  className: "w-full",
59818
59837
  ref: c,
59819
59838
  style: { height: l },
59820
59839
  children: f
59821
59840
  }) : f;
59822
- }, UU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
59841
+ }, WU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
59823
59842
  className: U("flex items-center justify-between p-1", e),
59824
59843
  ...t
59825
- }), WU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
59844
+ }), GU = ({ className: e, ...t }) => /* @__PURE__ */ V("div", {
59826
59845
  className: U("flex items-center gap-1", "[&_button:first-child]:rounded-bl-xl", e),
59827
59846
  ...t
59828
- }), GU = ({ className: e, variant: t = "default", size: n = "icon", status: r, children: i, ...a }) => {
59847
+ }), KU = ({ className: e, variant: t = "default", size: n = "icon", status: r, children: i, ...a }) => {
59829
59848
  let o = /* @__PURE__ */ V(wh, { className: "size-4" });
59830
59849
  return r === "submitted" ? o = /* @__PURE__ */ V(bh, { className: "size-4 animate-spin" }) : r === "streaming" ? o = /* @__PURE__ */ V(Th, { className: "size-4" }) : r === "error" && (o = /* @__PURE__ */ V(Dh, { className: "size-4" })), /* @__PURE__ */ V(Im, {
59831
59850
  className: U("gap-1.5 rounded-lg", e),
@@ -59835,7 +59854,7 @@ var VU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59835
59854
  ...a,
59836
59855
  children: i ?? o
59837
59856
  });
59838
- }, KU = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ V(Im, {
59857
+ }, qU = ({ suggestion: e, onClick: t, className: n, variant: r = "outline", size: i = "sm", children: a, ...o }) => /* @__PURE__ */ V(Im, {
59839
59858
  className: U("cursor-pointer rounded-full px-4", n),
59840
59859
  onClick: () => {
59841
59860
  t?.(e);
@@ -59848,7 +59867,7 @@ var VU = ({ className: e, ...t }) => /* @__PURE__ */ V("form", {
59848
59867
  });
59849
59868
  //#endregion
59850
59869
  //#region src/components/suggested-actions.tsx
59851
- function qU({ chatId: e, sendMessage: t, suggestedActions: n }) {
59870
+ function JU({ chatId: e, sendMessage: t, suggestedActions: n }) {
59852
59871
  let { getChatPath: r } = Qe(), i = n.map((e) => e.trim()).filter(Boolean);
59853
59872
  return i.length === 0 ? null : /* @__PURE__ */ V("div", {
59854
59873
  className: "grid w-full gap-2 sm:grid-cols-2",
@@ -59867,7 +59886,7 @@ function qU({ chatId: e, sendMessage: t, suggestedActions: n }) {
59867
59886
  y: 20
59868
59887
  },
59869
59888
  transition: { delay: .05 * i },
59870
- children: /* @__PURE__ */ V(KU, {
59889
+ children: /* @__PURE__ */ V(qU, {
59871
59890
  className: "h-auto w-full whitespace-normal p-3 text-left",
59872
59891
  onClick: (n) => {
59873
59892
  window.history.pushState({}, "", r(e)), t({
@@ -59884,28 +59903,28 @@ function qU({ chatId: e, sendMessage: t, suggestedActions: n }) {
59884
59903
  }, `${i}-${n}`))
59885
59904
  });
59886
59905
  }
59887
- var JU = O(qU, (e, t) => !(e.chatId !== t.chatId || !ye(e.suggestedActions, t.suggestedActions)));
59906
+ var YU = O(JU, (e, t) => !(e.chatId !== t.chatId || !ye(e.suggestedActions, t.suggestedActions)));
59888
59907
  //#endregion
59889
59908
  //#region src/components/multimodal-input.tsx
59890
- function YU(e, t) {
59909
+ function XU(e, t) {
59891
59910
  document.cookie = `${e}=${encodeURIComponent(t)}; path=/; max-age=31536000`;
59892
59911
  }
59893
- var XU = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", ZU = 40, QU = 9;
59894
- function $U(e) {
59912
+ var ZU = (e) => e.replace(/[^a-zA-Z0-9_-]/g, "_") || "default", QU = 40, $U = 9;
59913
+ function eW(e) {
59895
59914
  let t = e?.firstElementChild;
59896
59915
  return t instanceof HTMLElement ? t : null;
59897
59916
  }
59898
- function eW(e) {
59917
+ function tW(e) {
59899
59918
  let t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight), r = Number.parseFloat(t.paddingTop), i = Number.parseFloat(t.paddingBottom), a = Number.isFinite(n) ? n : 24, o = Number.isFinite(r) ? r : 0, s = Number.isFinite(i) ? i : 0;
59900
59919
  return {
59901
- minHeight: Math.max(a + o + s, ZU),
59902
- maxHeight: a * QU + o + s
59920
+ minHeight: Math.max(a + o + s, QU),
59921
+ maxHeight: a * $U + o + s
59903
59922
  };
59904
59923
  }
59905
- function tW(e, t) {
59924
+ function nW(e, t) {
59906
59925
  if (!e) return;
59907
59926
  e.style.height = "auto";
59908
- let { minHeight: n, maxHeight: r } = eW(e), i = e.scrollHeight, a = Math.max(i, n), o = Math.min(a, r), s = $U(t.scrollArea);
59927
+ let { minHeight: n, maxHeight: r } = tW(e), i = e.scrollHeight, a = Math.max(i, n), o = Math.min(a, r), s = eW(t.scrollArea);
59909
59928
  if (e.style.height = `${a}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight((e) => e === o ? e : o), s) {
59910
59929
  if (a <= r) {
59911
59930
  s.scrollTop = 0;
@@ -59916,17 +59935,17 @@ function tW(e, t) {
59916
59935
  });
59917
59936
  }
59918
59937
  }
59919
- function nW(e, t) {
59938
+ function rW(e, t) {
59920
59939
  if (!e) return;
59921
- let { minHeight: n } = eW(e);
59940
+ let { minHeight: n } = tW(e);
59922
59941
  e.style.height = `${n}px`, e.style.overflowY = "hidden", t.setScrollAreaHeight(n);
59923
- let r = $U(t.scrollArea);
59942
+ let r = eW(t.scrollArea);
59924
59943
  r && (r.scrollTop = 0);
59925
59944
  }
59926
- function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, chatModels: d, defaultChatModel: f, selectedModelId: p, onModelChange: m, openaiReasoningEffort: h = v, onOpenAIReasoningEffortChange: g, suggestedActions: _ }) {
59927
- let y = R(null), b = R(null), [x, S] = z(ZU), { width: C } = tF(), { getChatPath: w } = Qe(), T = r === "ready" || r === "error";
59945
+ function iW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments: a, setAttachments: o, messages: s, setMessages: c, sendMessage: l, className: u, chatModels: d, defaultChatModel: f, selectedModelId: p, onModelChange: m, openaiReasoningEffort: h = v, onOpenAIReasoningEffortChange: g, suggestedActions: _ }) {
59946
+ let y = R(null), b = R(null), [x, S] = z(QU), { width: C } = tF(), { getChatPath: w } = Qe(), T = r === "ready" || r === "error";
59928
59947
  j(() => {
59929
- tW(y.current, {
59948
+ nW(y.current, {
59930
59949
  scrollArea: b.current,
59931
59950
  setScrollAreaHeight: S
59932
59951
  });
@@ -59947,7 +59966,7 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
59947
59966
  O(t);
59948
59967
  }, [t, O]);
59949
59968
  let A = (e) => {
59950
- n(e.target.value), tW(e.currentTarget, {
59969
+ n(e.target.value), nW(e.currentTarget, {
59951
59970
  scrollArea: b.current,
59952
59971
  setScrollAreaHeight: S
59953
59972
  });
@@ -59964,7 +59983,7 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
59964
59983
  type: "text",
59965
59984
  text: t
59966
59985
  }]
59967
- }), o([]), O(""), n(""), nW(y.current, {
59986
+ }), o([]), O(""), n(""), rW(y.current, {
59968
59987
  scrollArea: b.current,
59969
59988
  setScrollAreaHeight: S
59970
59989
  }), C && C > 768 && y.current?.focus();
@@ -60072,7 +60091,7 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60072
60091
  }, [ee]), /* @__PURE__ */ H("div", {
60073
60092
  className: U("relative flex w-full flex-col gap-4", u),
60074
60093
  children: [
60075
- s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(JU, {
60094
+ s.length === 0 && a.length === 0 && N.length === 0 && _ && _.length > 0 && /* @__PURE__ */ V(YU, {
60076
60095
  chatId: e,
60077
60096
  sendMessage: l,
60078
60097
  suggestedActions: _
@@ -60085,7 +60104,7 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60085
60104
  tabIndex: -1,
60086
60105
  type: "file"
60087
60106
  }),
60088
- /* @__PURE__ */ H(VU, {
60107
+ /* @__PURE__ */ H(HU, {
60089
60108
  className: "rounded-xl border border-border bg-background p-3 shadow-xs transition-all duration-200 focus-within:border-border hover:border-muted-foreground/50",
60090
60109
  onSubmit: (e) => {
60091
60110
  if (e.preventDefault(), !(!t.trim() && a.length === 0)) {
@@ -60100,12 +60119,12 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60100
60119
  (a.length > 0 || N.length > 0) && /* @__PURE__ */ H("div", {
60101
60120
  className: "flex flex-row items-end gap-2 overflow-x-scroll",
60102
60121
  "data-testid": "attachments-preview",
60103
- children: [a.map((e) => /* @__PURE__ */ V(pB, {
60122
+ children: [a.map((e) => /* @__PURE__ */ V(mB, {
60104
60123
  attachment: e,
60105
60124
  onRemove: () => {
60106
60125
  o((t) => t.filter((t) => t.url !== e.url)), M.current && (M.current.value = "");
60107
60126
  }
60108
- }, e.url)), N.map((e) => /* @__PURE__ */ V(pB, {
60127
+ }, e.url)), N.map((e) => /* @__PURE__ */ V(mB, {
60109
60128
  attachment: {
60110
60129
  url: "",
60111
60130
  name: e,
@@ -60116,11 +60135,11 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60116
60135
  }),
60117
60136
  /* @__PURE__ */ V("div", {
60118
60137
  className: "flex flex-row items-start gap-1 sm:gap-2",
60119
- children: /* @__PURE__ */ V(XV, {
60138
+ children: /* @__PURE__ */ V(ZV, {
60120
60139
  className: "grow rounded-md",
60121
60140
  ref: b,
60122
60141
  style: { height: x },
60123
- children: /* @__PURE__ */ V(HU, {
60142
+ children: /* @__PURE__ */ V(UU, {
60124
60143
  className: "min-h-10 w-full resize-none overflow-y-hidden border-0! border-none! bg-transparent p-2 text-base outline-none ring-0 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
60125
60144
  "data-testid": "multimodal-input",
60126
60145
  disableAutoResize: !0,
@@ -60132,17 +60151,17 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60132
60151
  })
60133
60152
  })
60134
60153
  }),
60135
- /* @__PURE__ */ H(UU, {
60154
+ /* @__PURE__ */ H(WU, {
60136
60155
  className: "border-top-0! border-t-0! p-0 shadow-none dark:border-0 dark:border-transparent!",
60137
- children: [/* @__PURE__ */ H(WU, {
60156
+ children: [/* @__PURE__ */ H(GU, {
60138
60157
  className: "gap-0 sm:gap-0.5",
60139
60158
  children: [
60140
- /* @__PURE__ */ V(oW, {
60159
+ /* @__PURE__ */ V(sW, {
60141
60160
  fileInputRef: M,
60142
60161
  selectedModelId: p,
60143
60162
  status: r
60144
60163
  }),
60145
- /* @__PURE__ */ V(cW, {
60164
+ /* @__PURE__ */ V(lW, {
60146
60165
  focusTargetRef: y,
60147
60166
  chatModels: d,
60148
60167
  defaultChatModel: f,
@@ -60150,7 +60169,7 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60150
60169
  onModelChange: m,
60151
60170
  selectedModelId: p
60152
60171
  }),
60153
- /* @__PURE__ */ V(dW, {
60172
+ /* @__PURE__ */ V(fW, {
60154
60173
  disabled: r !== "ready",
60155
60174
  idScope: e,
60156
60175
  onChange: g,
@@ -60158,10 +60177,10 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60158
60177
  value: h
60159
60178
  })
60160
60179
  ]
60161
- }), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(pW, {
60180
+ }), r === "submitted" || r === "streaming" ? /* @__PURE__ */ V(mW, {
60162
60181
  setMessages: c,
60163
60182
  stop: i
60164
- }) : /* @__PURE__ */ V(GU, {
60183
+ }) : /* @__PURE__ */ V(KU, {
60165
60184
  className: "size-8 rounded-full bg-primary text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
60166
60185
  "data-testid": "send-button",
60167
60186
  disabled: !t.trim() || N.length > 0,
@@ -60174,8 +60193,8 @@ function rW({ chatId: e, input: t, setInput: n, status: r, stop: i, attachments:
60174
60193
  ]
60175
60194
  });
60176
60195
  }
60177
- var iW = O(rW, (e, t) => !(e.input !== t.input || e.status !== t.status || !ye(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort || !ye(e.suggestedActions, t.suggestedActions) || !ye(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel));
60178
- function aW({ fileInputRef: e, status: t, selectedModelId: n }) {
60196
+ var aW = O(iW, (e, t) => !(e.input !== t.input || e.status !== t.status || !ye(e.attachments, t.attachments) || e.selectedModelId !== t.selectedModelId || e.openaiReasoningEffort !== t.openaiReasoningEffort || !ye(e.suggestedActions, t.suggestedActions) || !ye(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel));
60197
+ function oW({ fileInputRef: e, status: t, selectedModelId: n }) {
60179
60198
  let r = n.includes("reasoning") || n.includes("think");
60180
60199
  return /* @__PURE__ */ V(Im, {
60181
60200
  className: "aspect-square h-8 rounded-lg p-1 transition-colors hover:bg-accent",
@@ -60194,44 +60213,44 @@ function aW({ fileInputRef: e, status: t, selectedModelId: n }) {
60194
60213
  })
60195
60214
  });
60196
60215
  }
60197
- var oW = O(aW);
60198
- function sW({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r, selectedModelId: i, onModelChange: a }) {
60199
- let [o, s] = z(!1), c = R(!1), l = XU(r), d = t && t.length > 0 ? t : f, p = u(d), m = d.find((e) => e.id === i) ?? d.find((e) => e.id === n) ?? d[0] ?? f[0], [h] = m.id.split("/"), g = {
60216
+ var sW = O(oW);
60217
+ function cW({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r, selectedModelId: i, onModelChange: a }) {
60218
+ let [o, s] = z(!1), c = R(!1), l = ZU(r), d = t && t.length > 0 ? t : f, p = u(d), m = d.find((e) => e.id === i) ?? d.find((e) => e.id === n) ?? d[0] ?? f[0], [h] = m.id.split("/"), g = {
60200
60219
  anthropic: "Anthropic",
60201
60220
  openai: "OpenAI",
60202
60221
  google: "Google",
60203
60222
  xai: "xAI",
60204
60223
  reasoning: "Reasoning"
60205
60224
  };
60206
- return /* @__PURE__ */ H(aV, {
60225
+ return /* @__PURE__ */ H(oV, {
60207
60226
  onOpenChange: s,
60208
60227
  open: o,
60209
- children: [/* @__PURE__ */ V(oV, {
60228
+ children: [/* @__PURE__ */ V(sV, {
60210
60229
  asChild: !0,
60211
60230
  children: /* @__PURE__ */ H(Im, {
60212
60231
  className: "agents-chat-model-selector-trigger h-8 w-auto max-w-[18rem] justify-start gap-2 px-2",
60213
60232
  id: `agents-sdk-model-selector-${l}`,
60214
60233
  variant: "ghost",
60215
- children: [h && /* @__PURE__ */ V(fV, { provider: h }), /* @__PURE__ */ V(pV, {
60234
+ children: [h && /* @__PURE__ */ V(pV, { provider: h }), /* @__PURE__ */ V(mV, {
60216
60235
  className: "min-w-0 max-w-[14rem] flex-initial",
60217
60236
  children: m.name
60218
60237
  })]
60219
60238
  })
60220
- }), /* @__PURE__ */ H(sV, {
60239
+ }), /* @__PURE__ */ H(cV, {
60221
60240
  commandDefaultValue: m.id,
60222
60241
  finalFocus: () => c.current ? (c.current = !1, e.current) : !0,
60223
- children: [/* @__PURE__ */ V(cV, { placeholder: "Search models..." }), /* @__PURE__ */ V(lV, { children: Object.entries(p).map(([e, t]) => /* @__PURE__ */ V(uV, {
60242
+ children: [/* @__PURE__ */ V(lV, { placeholder: "Search models..." }), /* @__PURE__ */ V(uV, { children: Object.entries(p).map(([e, t]) => /* @__PURE__ */ V(dV, {
60224
60243
  heading: g[e] ?? e,
60225
60244
  children: t.map((e) => {
60226
60245
  let t = e.id.split("/")[0];
60227
- return /* @__PURE__ */ H(dV, {
60246
+ return /* @__PURE__ */ H(fV, {
60228
60247
  onSelect: () => {
60229
- c.current = !0, a?.(e.id), YU("chat-model", e.id), s(!1);
60248
+ c.current = !0, a?.(e.id), XU("chat-model", e.id), s(!1);
60230
60249
  },
60231
60250
  value: e.id,
60232
60251
  children: [
60233
- /* @__PURE__ */ V(fV, { provider: t }),
60234
- /* @__PURE__ */ V(pV, { children: e.name }),
60252
+ /* @__PURE__ */ V(pV, { provider: t }),
60253
+ /* @__PURE__ */ V(mV, { children: e.name }),
60235
60254
  e.id === m.id && /* @__PURE__ */ V(dh, { className: "ml-auto size-4" })
60236
60255
  ]
60237
60256
  }, e.id);
@@ -60240,40 +60259,40 @@ function sW({ focusTargetRef: e, chatModels: t, defaultChatModel: n, idScope: r,
60240
60259
  })]
60241
60260
  });
60242
60261
  }
60243
- var cW = O(sW), lW = (e, t) => t.includes(e), uW = (e) => e.charAt(0).toUpperCase() + e.slice(1);
60244
- function dW({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: i }) {
60245
- let a = m(t), o = h(t), s = _(t), c = s && lW(s, o) ? s : o[0], l = lW(n, o) ? n : c ?? "default";
60262
+ var lW = O(cW), uW = (e, t) => t.includes(e), dW = (e) => e.charAt(0).toUpperCase() + e.slice(1);
60263
+ function fW({ idScope: e, selectedModelId: t, value: n, onChange: r, disabled: i }) {
60264
+ let a = m(t), o = h(t), s = _(t), c = s && uW(s, o) ? s : o[0], l = uW(n, o) ? n : c ?? "default";
60246
60265
  return j(() => {
60247
- !a || !r || lW(n, o) || r(c ?? "default");
60266
+ !a || !r || uW(n, o) || r(c ?? "default");
60248
60267
  }, [
60249
60268
  o,
60250
60269
  c,
60251
60270
  r,
60252
60271
  a,
60253
60272
  n
60254
- ]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(TU, {
60273
+ ]), !a || !r || l === "default" ? null : /* @__PURE__ */ H(EU, {
60255
60274
  disabled: i,
60256
60275
  onValueChange: (e) => {
60257
- YU(g, e), r(e);
60276
+ XU(g, e), r(e);
60258
60277
  },
60259
60278
  value: l,
60260
- children: [/* @__PURE__ */ V(DU, {
60279
+ children: [/* @__PURE__ */ V(OU, {
60261
60280
  className: "h-8 w-[112px] gap-1 border-0 bg-transparent px-2 text-sm hover:bg-accent focus:ring-0 focus:ring-offset-0",
60262
- id: `agents-sdk-reasoning-effort-${XU(e)}`,
60281
+ id: `agents-sdk-reasoning-effort-${ZU(e)}`,
60263
60282
  children: /* @__PURE__ */ H("div", {
60264
60283
  className: "flex min-w-0 items-center gap-1.5",
60265
60284
  children: [/* @__PURE__ */ V(uh, { className: "size-3.5 shrink-0 text-muted-foreground" }), /* @__PURE__ */ V("span", {
60266
60285
  className: "min-w-0 truncate",
60267
- children: /* @__PURE__ */ V(EU, {})
60286
+ children: /* @__PURE__ */ V(DU, {})
60268
60287
  })]
60269
60288
  })
60270
- }), /* @__PURE__ */ V(AU, { children: o.map((e) => /* @__PURE__ */ V(MU, {
60289
+ }), /* @__PURE__ */ V(jU, { children: o.map((e) => /* @__PURE__ */ V(NU, {
60271
60290
  value: e,
60272
- children: /* @__PURE__ */ V("span", { children: uW(e) })
60291
+ children: /* @__PURE__ */ V("span", { children: dW(e) })
60273
60292
  }, e)) })]
60274
60293
  });
60275
60294
  }
60276
- function fW({ stop: e, setMessages: t }) {
60295
+ function pW({ stop: e, setMessages: t }) {
60277
60296
  return /* @__PURE__ */ V(Im, {
60278
60297
  className: "size-8 rounded-full bg-primary p-1 text-primary-foreground transition-colors duration-200 hover:bg-primary/90 disabled:bg-muted disabled:text-muted-foreground",
60279
60298
  "data-testid": "stop-button",
@@ -60283,7 +60302,7 @@ function fW({ stop: e, setMessages: t }) {
60283
60302
  children: /* @__PURE__ */ V(ft, { size: 14 })
60284
60303
  });
60285
60304
  }
60286
- var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedTool: r, isToolbarVisible: i, setIsToolbarVisible: a, isAnimating: o, sendMessage: s, onClick: c }) => {
60305
+ var mW = O(pW), hW = ({ description: e, icon: t, selectedTool: n, setSelectedTool: r, isToolbarVisible: i, setIsToolbarVisible: a, isAnimating: o, sendMessage: s, onClick: c }) => {
60287
60306
  let [l, u] = z(!1);
60288
60307
  j(() => {
60289
60308
  n !== e && u(!1);
@@ -60341,14 +60360,14 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60341
60360
  children: e
60342
60361
  })]
60343
60362
  });
60344
- }, hW = [...[
60363
+ }, gW = [...[
60345
60364
  ,
60346
60365
  ,
60347
60366
  ,
60348
60367
  ,
60349
60368
  ,
60350
60369
  ,
60351
- ]].map((e) => Ye(5)), gW = ({ setSelectedTool: e, sendMessage: t, isAnimating: n }) => {
60370
+ ]].map((e) => Ye(5)), _W = ({ setSelectedTool: e, sendMessage: t, isAnimating: n }) => {
60352
60371
  let r = [
60353
60372
  "Elementary",
60354
60373
  "Middle School",
@@ -60364,7 +60383,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60364
60383
  return () => e();
60365
60384
  }, [a]), /* @__PURE__ */ H("div", {
60366
60385
  className: "relative flex flex-col items-center justify-end",
60367
- children: [hW.map((e) => /* @__PURE__ */ V(uP.div, {
60386
+ children: [gW.map((e) => /* @__PURE__ */ V(uP.div, {
60368
60387
  animate: { opacity: 1 },
60369
60388
  className: "flex size-[40px] flex-row items-center justify-center",
60370
60389
  exit: { opacity: 0 },
@@ -60416,7 +60435,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60416
60435
  })]
60417
60436
  }) })]
60418
60437
  });
60419
- }, _W = ({ isToolbarVisible: e, selectedTool: t, setSelectedTool: n, sendMessage: r, isAnimating: i, setIsToolbarVisible: a, tools: o }) => {
60438
+ }, vW = ({ isToolbarVisible: e, selectedTool: t, setSelectedTool: n, sendMessage: r, isAnimating: i, setIsToolbarVisible: a, tools: o }) => {
60420
60439
  let [s, ...c] = o;
60421
60440
  return /* @__PURE__ */ H(uP.div, {
60422
60441
  animate: {
@@ -60432,7 +60451,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60432
60451
  opacity: 0,
60433
60452
  scale: .95
60434
60453
  },
60435
- children: [/* @__PURE__ */ V(_M, { children: e && c.map((e) => /* @__PURE__ */ V(mW, {
60454
+ children: [/* @__PURE__ */ V(_M, { children: e && c.map((e) => /* @__PURE__ */ V(hW, {
60436
60455
  description: e.description,
60437
60456
  icon: e.icon,
60438
60457
  isAnimating: i,
@@ -60440,7 +60459,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60440
60459
  selectedTool: t,
60441
60460
  sendMessage: r,
60442
60461
  setSelectedTool: n
60443
- }, e.description)) }), /* @__PURE__ */ V(mW, {
60462
+ }, e.description)) }), /* @__PURE__ */ V(hW, {
60444
60463
  description: s.description,
60445
60464
  icon: s.icon,
60446
60465
  isAnimating: i,
@@ -60452,7 +60471,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60452
60471
  setSelectedTool: n
60453
60472
  })]
60454
60473
  });
60455
- }, vW = O(({ isToolbarVisible: e, setIsToolbarVisible: t, sendMessage: n, status: r, stop: i, setMessages: a, artifactKind: o }) => {
60474
+ }, yW = O(({ isToolbarVisible: e, setIsToolbarVisible: t, sendMessage: n, status: r, stop: i, setMessages: a, artifactKind: o }) => {
60456
60475
  let s = R(null), c = R(null), [l, u] = z(null), [d, f] = z(!1);
60457
60476
  $P(s, () => {
60458
60477
  t(!1), u(null);
@@ -60469,7 +60488,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60469
60488
  }, []), j(() => {
60470
60489
  r === "streaming" && t(!1);
60471
60490
  }, [r, t]);
60472
- let h = bW.find((e) => e.kind === o);
60491
+ let h = xW.find((e) => e.kind === o);
60473
60492
  if (!h) throw Error("Artifact definition not found!");
60474
60493
  let g = h.toolbar;
60475
60494
  return g.length === 0 ? null : /* @__PURE__ */ V(Gg, {
@@ -60531,11 +60550,11 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60531
60550
  i(), a((e) => e);
60532
60551
  },
60533
60552
  children: /* @__PURE__ */ V(ft, {})
60534
- }, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(gW, {
60553
+ }, "stop-icon") : l === "adjust-reading-level" ? /* @__PURE__ */ V(_W, {
60535
60554
  isAnimating: d,
60536
60555
  sendMessage: n,
60537
60556
  setSelectedTool: u
60538
- }, "reading-level-selector") : /* @__PURE__ */ V(_W, {
60557
+ }, "reading-level-selector") : /* @__PURE__ */ V(vW, {
60539
60558
  isAnimating: d,
60540
60559
  isToolbarVisible: e,
60541
60560
  selectedTool: l,
@@ -60546,7 +60565,7 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60546
60565
  }, "tools")
60547
60566
  })
60548
60567
  });
60549
- }, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)), yW = ({ handleVersionChange: e, documents: t, currentVersionIndex: n }) => {
60568
+ }, (e, t) => !(e.status !== t.status || e.isToolbarVisible !== t.isToolbarVisible || e.artifactKind !== t.artifactKind)), bW = ({ handleVersionChange: e, documents: t, currentVersionIndex: n }) => {
60550
60569
  let { artifact: r } = DS(), { width: i } = tF(), a = i < 768, [o, s] = z(!1);
60551
60570
  if (t) return /* @__PURE__ */ H(uP.div, {
60552
60571
  animate: { y: 0 },
@@ -60586,13 +60605,13 @@ var pW = O(fW), mW = ({ description: e, icon: t, selectedTool: n, setSelectedToo
60586
60605
  })]
60587
60606
  })]
60588
60607
  });
60589
- }, bW = [
60608
+ }, xW = [
60590
60609
  OR,
60591
60610
  dF,
60592
60611
  pF,
60593
60612
  NL
60594
60613
  ];
60595
- function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, chatModels: c, defaultChatModel: l, sendMessage: u, messages: d, setMessages: f, regenerate: p, renderMessagePart: m, votes: h, isReadonly: g, selectedModelId: _, suggestedActions: v }) {
60614
+ function SW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, status: i, stop: a, attachments: o, setAttachments: s, chatModels: c, defaultChatModel: l, sendMessage: u, messages: d, setMessages: f, regenerate: p, renderMessagePart: m, votes: h, isReadonly: g, selectedModelId: _, suggestedActions: v }) {
60596
60615
  let { artifact: y, setArtifact: b, metadata: x, setMetadata: S } = DS(), { data: C, isLoading: w } = FR(y.documentId, y.documentId !== "init" && y.status !== "streaming"), [T, E] = z([]), D = L(() => T.length > 0 ? PR(C, T) : C, [C, T]), [O, A] = z("edit"), [M, N] = z(null), [P, F] = z(-1);
60597
60616
  j(() => {
60598
60617
  E([]);
@@ -60650,7 +60669,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60650
60669
  }
60651
60670
  let ie = (e) => {
60652
60671
  D && (e === "latest" && (F(D.length - 1), A("edit")), e === "toggle" && A((e) => e === "edit" ? "diff" : "edit"), e === "prev" ? P > 0 && F((e) => e - 1) : e === "next" && P < D.length - 1 && F((e) => e + 1));
60653
- }, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Xg(), ce = bW.find((e) => e.kind === y.kind);
60672
+ }, [B, ae] = z(!1), oe = D && D.length > 0 ? P === D.length - 1 : !0, se = Xg(), ce = xW.find((e) => e.kind === y.kind);
60654
60673
  if (!ce) throw Error("Artifact definition not found!");
60655
60674
  return j(() => {
60656
60675
  y.documentId !== "init" && ce.initialize && ce.initialize({
@@ -60701,7 +60720,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60701
60720
  initial: { opacity: 0 }
60702
60721
  }) }), /* @__PURE__ */ H("div", {
60703
60722
  className: "flex h-full flex-col items-center justify-between",
60704
- children: [/* @__PURE__ */ V(FB, {
60723
+ children: [/* @__PURE__ */ V(IB, {
60705
60724
  addToolApprovalResponse: e,
60706
60725
  artifactStatus: y.status,
60707
60726
  chatId: t,
@@ -60714,7 +60733,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60714
60733
  votes: h
60715
60734
  }), /* @__PURE__ */ V("div", {
60716
60735
  className: "relative flex w-full flex-row items-end gap-2 px-4 pb-4",
60717
- children: /* @__PURE__ */ V(iW, {
60736
+ children: /* @__PURE__ */ V(aW, {
60718
60737
  attachments: o,
60719
60738
  chatModels: c,
60720
60739
  defaultChatModel: l,
@@ -60813,7 +60832,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60813
60832
  status: y.status,
60814
60833
  suggestions: [],
60815
60834
  title: y.title
60816
- }), /* @__PURE__ */ V(_M, { children: oe && /* @__PURE__ */ V(vW, {
60835
+ }), /* @__PURE__ */ V(_M, { children: oe && /* @__PURE__ */ V(yW, {
60817
60836
  artifactKind: y.kind,
60818
60837
  isToolbarVisible: B,
60819
60838
  sendMessage: u,
@@ -60823,7 +60842,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60823
60842
  stop: a
60824
60843
  }) })]
60825
60844
  }),
60826
- /* @__PURE__ */ V(_M, { children: !oe && /* @__PURE__ */ V(yW, {
60845
+ /* @__PURE__ */ V(_M, { children: !oe && /* @__PURE__ */ V(bW, {
60827
60846
  currentVersionIndex: P,
60828
60847
  documents: D,
60829
60848
  handleVersionChange: ie
@@ -60832,7 +60851,7 @@ function xW({ addToolApprovalResponse: e, chatId: t, input: n, setInput: r, stat
60832
60851
  })]
60833
60852
  }) });
60834
60853
  }
60835
- var SW = O(xW, (e, t) => !(e.status !== t.status || !ye(e.votes, t.votes) || e.input !== t.input || !ye(e.messages, t.messages.length) || e.renderMessagePart !== t.renderMessagePart || !ye(e.suggestedActions, t.suggestedActions) || !ye(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel)), CW = ({ title1: e, title2: t }) => {
60854
+ var CW = O(SW, (e, t) => !(e.status !== t.status || !ye(e.votes, t.votes) || e.input !== t.input || !ye(e.messages, t.messages.length) || e.renderMessagePart !== t.renderMessagePart || !ye(e.suggestedActions, t.suggestedActions) || !ye(e.chatModels, t.chatModels) || e.defaultChatModel !== t.defaultChatModel)), wW = ({ title1: e, title2: t }) => {
60836
60855
  let n = e?.trim(), r = t?.trim();
60837
60856
  return !n && !r ? null : /* @__PURE__ */ H("div", {
60838
60857
  className: "mx-auto mt-4 flex size-full max-w-3xl flex-col justify-center px-4 md:mt-16 md:px-8",
@@ -60870,9 +60889,9 @@ var SW = O(xW, (e, t) => !(e.status !== t.status || !ye(e.votes, t.votes) || e.i
60870
60889
  children: r
60871
60890
  })]
60872
60891
  }, "overview");
60873
- }, wW = (e) => e.trim().toLowerCase().replace(/\.+$/, "") === "an error occurred";
60874
- function TW({ disabled: e, error: t, onRetry: n }) {
60875
- let r = t.message.trim(), i = r !== "" && !wW(r);
60892
+ }, TW = (e) => e.trim().toLowerCase().replace(/\.+$/, "") === "an error occurred";
60893
+ function EW({ disabled: e, error: t, onRetry: n }) {
60894
+ let r = t.message.trim(), i = r !== "" && !TW(r);
60876
60895
  return /* @__PURE__ */ V("div", {
60877
60896
  className: "group/message fade-in w-full animate-in duration-200",
60878
60897
  "data-testid": "message-error",
@@ -60906,7 +60925,7 @@ function TW({ disabled: e, error: t, onRetry: n }) {
60906
60925
  })
60907
60926
  });
60908
60927
  }
60909
- function EW({ addToolApprovalResponse: e, chatId: t, conversationError: n, status: r, votes: i, messages: a, renderMessagePart: o, setMessages: c, regenerate: u, onRetryConversationError: d, isReadonly: f, selectedModelId: p, title1: m, title2: h }) {
60928
+ function DW({ addToolApprovalResponse: e, chatId: t, conversationError: n, status: r, votes: i, messages: a, renderMessagePart: o, setMessages: c, regenerate: u, onRetryConversationError: d, isReadonly: f, selectedModelId: p, title1: m, title2: h }) {
60910
60929
  let g = a.at(-1), _ = g ? l(g) : !1, v = r === "submitted" || r === "streaming" && g?.role === "assistant" && !_, { containerRef: y, endRef: b, isAtBottom: x, scrollToBottom: S, hasSentMessage: C } = VR({ status: r });
60911
60930
  return st(), /* @__PURE__ */ H("div", {
60912
60931
  className: "relative flex-1",
@@ -60916,11 +60935,11 @@ function EW({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
60916
60935
  children: /* @__PURE__ */ H("div", {
60917
60936
  className: "mx-auto flex min-w-0 max-w-4xl flex-col gap-4 px-2 pt-[60px] pb-4 md:gap-6 md:px-4",
60918
60937
  children: [
60919
- a.length === 0 && /* @__PURE__ */ V(CW, {
60938
+ a.length === 0 && /* @__PURE__ */ V(wW, {
60920
60939
  title1: m,
60921
60940
  title2: h
60922
60941
  }),
60923
- a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(AB, {
60942
+ a.map((n, l) => s(n) ? null : /* @__PURE__ */ V(jB, {
60924
60943
  addToolApprovalResponse: e,
60925
60944
  chatId: t,
60926
60945
  isLoading: r === "streaming" && a.length - 1 === l,
@@ -60932,8 +60951,8 @@ function EW({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
60932
60951
  setMessages: c,
60933
60952
  vote: i ? i.find((e) => e.messageId === n.id) : void 0
60934
60953
  }, n.id)),
60935
- v && /* @__PURE__ */ V(MB, {}),
60936
- n && /* @__PURE__ */ V(TW, {
60954
+ v && /* @__PURE__ */ V(NB, {}),
60955
+ n && /* @__PURE__ */ V(EW, {
60937
60956
  disabled: r !== "ready" && r !== "error",
60938
60957
  error: n,
60939
60958
  onRetry: d
@@ -60953,10 +60972,10 @@ function EW({ addToolApprovalResponse: e, chatId: t, conversationError: n, statu
60953
60972
  })]
60954
60973
  });
60955
60974
  }
60956
- var DW = EW, OW = (e) => e?.parts?.some((e) => {
60975
+ var OW = DW, kW = (e) => e?.parts?.some((e) => {
60957
60976
  let t = e.state;
60958
60977
  return t === "approval-responded" || t === "output-denied";
60959
- }) ?? !1, kW = (e) => `agents-sdk:chat:${e}:stream`, AW = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), jW = (e) => _(e) ?? "default", MW = (e) => {
60978
+ }) ?? !1, AW = (e) => `agents-sdk:chat:${e}:stream`, jW = (e) => !!(e && typeof e == "object" && !Array.isArray(e)), MW = (e) => _(e) ?? "default", NW = (e) => {
60960
60979
  if (typeof document > "u") return null;
60961
60980
  let t = document.cookie.split(";");
60962
60981
  for (let n of t) {
@@ -60971,10 +60990,10 @@ var DW = EW, OW = (e) => e?.parts?.some((e) => {
60971
60990
  }
60972
60991
  }
60973
60992
  return null;
60974
- }, NW = (e) => MW("chat-reasoning-effort") ?? e, PW = (e, t) => {
60993
+ }, PW = (e) => NW("chat-reasoning-effort") ?? e, FW = (e, t) => {
60975
60994
  let n = h(e);
60976
- return t && n.some((e) => e === t) ? t : jW(e);
60977
- }, FW = (e, t) => PW(e, NW(t)), IW = (e) => e instanceof mm || e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.", LW = (e) => {
60995
+ return t && n.some((e) => e === t) ? t : MW(e);
60996
+ }, IW = (e, t) => FW(e, PW(t)), LW = (e) => e instanceof mm || e instanceof Error && e.message ? e.message : "Something went wrong. Please try again.", RW = (e) => {
60978
60997
  for (let t = e.length - 1; t >= 0; --t) {
60979
60998
  let n = e[t];
60980
60999
  if (!s(n)) {
@@ -60983,23 +61002,23 @@ var DW = EW, OW = (e) => e?.parts?.some((e) => {
60983
61002
  }
60984
61003
  }
60985
61004
  return null;
60986
- }, RW = (e) => {
61005
+ }, zW = (e) => {
60987
61006
  for (let t = e.length - 1; t >= 0; --t) {
60988
61007
  let n = e[t];
60989
61008
  if (n.role === "assistant" && l(n)) return n;
60990
61009
  }
60991
61010
  return null;
60992
- }, zW = (e) => {
61011
+ }, BW = (e) => {
60993
61012
  let t = e.length;
60994
61013
  for (; t > 0 && s(e[t - 1]);) --t;
60995
61014
  return t === e.length ? e : e.slice(0, t);
60996
- }, BW = (e) => {
61015
+ }, VW = (e) => {
60997
61016
  if (e?.role !== "assistant") return null;
60998
61017
  for (let t of e.parts) {
60999
- if (!AW(t)) continue;
61018
+ if (!jW(t)) continue;
61000
61019
  let e = t;
61001
61020
  if (e.state !== "approval-responded") continue;
61002
- let n = AW(e.approval) ? e.approval : null;
61021
+ let n = jW(e.approval) ? e.approval : null;
61003
61022
  if (!(n?.approved !== !0 || typeof n.id != "string")) return {
61004
61023
  id: n.id,
61005
61024
  reason: typeof n.reason == "string" ? n.reason : void 0
@@ -61007,15 +61026,15 @@ var DW = EW, OW = (e) => e?.parts?.some((e) => {
61007
61026
  }
61008
61027
  return null;
61009
61028
  };
61010
- function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReasoningEffort: r, isReadonly: i, autoResume: a, chatModels: o, defaultChatModel: s, renderMessagePart: c, suggestedActions: l, title1: u, title2: h }) {
61029
+ function HW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReasoningEffort: r, isReadonly: i, autoResume: a, chatModels: o, defaultChatModel: s, renderMessagePart: c, suggestedActions: l, title1: u, title2: h }) {
61011
61030
  let { setDataStream: g, setWaitingStatus: _ } = st(), { getChatPath: v } = Qe(), y = o && o.length > 0 ? o : f, b = p({
61012
61031
  defaultChatModel: s,
61013
61032
  models: y
61014
- }), x = d(y).has(n) ? n : b, S = FW(x, r), [C, w] = z(""), [T, E] = z(x), D = R(T), [O, k] = z(S), A = R(O), [M, N] = z(null);
61033
+ }), x = d(y).has(n) ? n : b, S = IW(x, r), [C, w] = z(""), [T, E] = z(x), D = R(T), [O, k] = z(S), A = R(O), [M, N] = z(null);
61015
61034
  j(() => {
61016
61035
  D.current = T;
61017
61036
  }, [T]), j(() => {
61018
- E(x), k(FW(x, r)), N(null), _(void 0);
61037
+ E(x), k(IW(x, r)), N(null), _(void 0);
61019
61038
  }, [
61020
61039
  e,
61021
61040
  x,
@@ -61034,7 +61053,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61034
61053
  api: "/api/rb/agents/chat",
61035
61054
  fetch: km,
61036
61055
  prepareSendMessagesRequest(e) {
61037
- let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = wm(e.headers, Sm()), o = r?.role !== "user" || r?.role === "user" && OW(i);
61056
+ let t = D.current, n = A.current, r = e.messages.at(-1), i = e.messages.at(-2), a = wm(e.headers, Sm()), o = r?.role !== "user" || r?.role === "user" && kW(i);
61038
61057
  return {
61039
61058
  ...a ? { headers: a } : {},
61040
61059
  body: {
@@ -61062,7 +61081,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61062
61081
  g((t) => t ? [...t, e] : []);
61063
61082
  },
61064
61083
  onError: (e) => {
61065
- let t = IW(e);
61084
+ let t = LW(e);
61066
61085
  N({ message: t }), le.error(t);
61067
61086
  }
61068
61087
  });
@@ -61070,7 +61089,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61070
61089
  (L === "submitted" || L === "ready" || L === "error") && _(void 0);
61071
61090
  }, [L, _]);
61072
61091
  let B = (...e) => (N(null), re(), I(...e)), ae = (...e) => (N(null), re(), te(...e)), oe = () => {
61073
- let e = LW(P);
61092
+ let e = RW(P);
61074
61093
  if (e) {
61075
61094
  B({
61076
61095
  messageId: e.id,
@@ -61080,11 +61099,11 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61080
61099
  });
61081
61100
  return;
61082
61101
  }
61083
- let t = RW(P);
61102
+ let t = zW(P);
61084
61103
  if (t) {
61085
- let e = BW(t);
61104
+ let e = VW(t);
61086
61105
  if (e) {
61087
- N(null), re(), F(zW), ie({
61106
+ N(null), re(), F(BW), ie({
61088
61107
  id: e.id,
61089
61108
  approved: !0,
61090
61109
  reason: e.reason
@@ -61097,7 +61116,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61097
61116
  ae();
61098
61117
  };
61099
61118
  j(() => {
61100
- let t = kW(e), n = (e) => {
61119
+ let t = AW(e), n = (e) => {
61101
61120
  F((t) => {
61102
61121
  let n = t.findIndex((t) => t.id === e.id);
61103
61122
  return n === -1 ? [...t, e] : t.map((t, r) => r === n ? e : t);
@@ -61108,15 +61127,15 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61108
61127
  },
61109
61128
  onMessage: n
61110
61129
  }), i = ue(t, (t) => {
61111
- if (!AW(t) || t.chatId !== e) return;
61130
+ if (!jW(t) || t.chatId !== e) return;
61112
61131
  let i = t.message;
61113
- if (AW(i)) {
61132
+ if (jW(i)) {
61114
61133
  let e = typeof i.id == "string" ? i.id : null, t = typeof i.role == "string" ? i.role : null, r = Array.isArray(i.parts) ? i.parts : null;
61115
61134
  e && t && r && n({
61116
61135
  id: e,
61117
61136
  role: t,
61118
61137
  parts: r,
61119
- metadata: AW(i.metadata) ? i.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
61138
+ metadata: jW(i.metadata) ? i.metadata : { createdAt: (/* @__PURE__ */ new Date()).toISOString() }
61120
61139
  });
61121
61140
  }
61122
61141
  if (t.done === !0) {
@@ -61124,7 +61143,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61124
61143
  return;
61125
61144
  }
61126
61145
  let a = t.part;
61127
- AW(a) && (typeof a.type == "string" && a.type.startsWith("data-") && g((e) => e ? [...e, a] : []), r.push(a));
61146
+ jW(a) && (typeof a.type == "string" && a.type.startsWith("data-") && g((e) => e ? [...e, a] : []), r.push(a));
61128
61147
  });
61129
61148
  return () => {
61130
61149
  i(), r.dispose();
@@ -61166,7 +61185,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61166
61185
  className: "relative flex h-full min-h-0 min-w-0 overflow-hidden bg-background",
61167
61186
  children: [/* @__PURE__ */ H("div", {
61168
61187
  className: "overscroll-behavior-contain flex h-full min-h-0 min-w-0 flex-1 touch-pan-y flex-col bg-background",
61169
- children: [/* @__PURE__ */ V(DW, {
61188
+ children: [/* @__PURE__ */ V(OW, {
61170
61189
  addToolApprovalResponse: ie,
61171
61190
  chatId: e,
61172
61191
  conversationError: M,
@@ -61184,7 +61203,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61184
61203
  votes: pe
61185
61204
  }), /* @__PURE__ */ V("div", {
61186
61205
  className: "sticky bottom-0 z-1 mx-auto flex w-full max-w-4xl gap-2 border-t-0 bg-background px-2 pb-3 md:px-4 md:pb-4",
61187
- children: !i && /* @__PURE__ */ V(iW, {
61206
+ children: !i && /* @__PURE__ */ V(aW, {
61188
61207
  attachments: me,
61189
61208
  chatModels: y,
61190
61209
  defaultChatModel: b,
@@ -61192,7 +61211,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61192
61211
  input: C,
61193
61212
  messages: P,
61194
61213
  onModelChange: (e) => {
61195
- E(e), k(FW(e, r));
61214
+ E(e), k(IW(e, r));
61196
61215
  },
61197
61216
  onOpenAIReasoningEffortChange: k,
61198
61217
  openaiReasoningEffort: O,
@@ -61206,7 +61225,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61206
61225
  suggestedActions: l
61207
61226
  })
61208
61227
  })]
61209
- }), /* @__PURE__ */ V(SW, {
61228
+ }), /* @__PURE__ */ V(CW, {
61210
61229
  addToolApprovalResponse: ie,
61211
61230
  attachments: me,
61212
61231
  chatModels: y,
@@ -61231,7 +61250,7 @@ function VW({ id: e, initialMessages: t, initialChatModel: n, initialOpenAIReaso
61231
61250
  }
61232
61251
  //#endregion
61233
61252
  //#region src/components/data-stream-handler.tsx
61234
- function HW() {
61253
+ function UW() {
61235
61254
  let { dataStream: e, setDataStream: t } = st(), { artifact: n, setArtifact: r, setMetadata: i } = DS();
61236
61255
  return j(() => {
61237
61256
  if (!e?.length) return;
@@ -61239,7 +61258,7 @@ function HW() {
61239
61258
  t([]);
61240
61259
  for (let e of a) {
61241
61260
  if (e.type === "data-chat-title") continue;
61242
- let t = bW.find((e) => e.kind === n.kind);
61261
+ let t = xW.find((e) => e.kind === n.kind);
61243
61262
  t?.onStreamPart && t.onStreamPart({
61244
61263
  streamPart: e,
61245
61264
  setArtifact: r,
@@ -61287,4 +61306,4 @@ function HW() {
61287
61306
  ]), null;
61288
61307
  }
61289
61308
  //#endregion
61290
- export { _y as a, Cm as c, Ze as d, et as f, Qe as h, wy as i, xm as l, tt as m, VW as n, Nm as o, $e as p, xy as r, Sm as s, HW as t, ot as u };
61309
+ export { _y as a, Cm as c, Ze as d, et as f, Qe as h, wy as i, xm as l, tt as m, HW as n, Nm as o, $e as p, xy as r, Sm as s, UW as t, ot as u };