@streamoid/agent 0.5.14 → 0.5.16

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { createContext, useContext, useRef, useLayoutEffect, useEffect, useId as useId$1, useInsertionEffect as useInsertionEffect$1, useMemo, useCallback, Children, isValidElement, useState, Fragment as Fragment$1, createElement, forwardRef, Component, memo as memo$2, createRef, cloneElement, useReducer, useTransition, useSyncExternalStore } from "react";
4
- import { ScThinkingStepIcon, ScSubAgent, ScInChatMessage, ScButton, ScFileField, ScTodoList, ScMediaSelect, ScMediaApproval, ScHDivider, ScSelection, ScCheckbox, ScSelect, ScTextField, ScTextArea, ScBriefCard, ScCxoCopilotLogo, ScOnlyField, ScMenuOptions } from "@streamoid/ui";
4
+ import { ScThinkingStepIcon, ScSubAgent, ScInChatMessage, ScButton, ScFileField, ScTodoList, ScMediaSelect, ScMediaApproval, ScHDivider, ScSelection, ScCheckbox, ScSelect, ScTextField, ScTextArea, ScOnlyField, ScMenuOptions } from "@streamoid/ui";
5
5
  import * as ReactDOM from "react-dom";
6
6
  import ReactDOM__default, { createPortal, flushSync } from "react-dom";
7
7
  import { SiconDown, SiconClose, SiconAttach, SiconSearch, SiconPlus, SiconMore } from "@streamoid/icons";
@@ -10653,8 +10653,8 @@ function compiler$1(e) {
10653
10653
  link: l(Un),
10654
10654
  listItem: l(Xn),
10655
10655
  listItemValue: R,
10656
- listOrdered: l(Gn, E),
10657
- listUnordered: l(Gn),
10656
+ listOrdered: l(Hn, E),
10657
+ listUnordered: l(Hn),
10658
10658
  paragraph: l(Qn),
10659
10659
  reference: _e,
10660
10660
  referenceString: c,
@@ -11092,7 +11092,7 @@ function compiler$1(e) {
11092
11092
  children: []
11093
11093
  };
11094
11094
  }
11095
- function Gn(Pt) {
11095
+ function Hn(Pt) {
11096
11096
  return {
11097
11097
  type: "list",
11098
11098
  ordered: Pt.type === "listOrdered",
@@ -23922,8 +23922,8 @@ function compiler(e) {
23922
23922
  link: l(Un),
23923
23923
  listItem: l(Xn),
23924
23924
  listItemValue: R,
23925
- listOrdered: l(Gn, E),
23926
- listUnordered: l(Gn),
23925
+ listOrdered: l(Hn, E),
23926
+ listUnordered: l(Hn),
23927
23927
  paragraph: l(Qn),
23928
23928
  reference: _e,
23929
23929
  referenceString: c,
@@ -24361,7 +24361,7 @@ function compiler(e) {
24361
24361
  children: []
24362
24362
  };
24363
24363
  }
24364
- function Gn(Pt) {
24364
+ function Hn(Pt) {
24365
24365
  return {
24366
24366
  type: "list",
24367
24367
  ordered: Pt.type === "listOrdered",
@@ -35273,7 +35273,7 @@ function requireJsuites() {
35273
35273
  }, Ze;
35274
35274
  }
35275
35275
  var Un = Vn();
35276
- function Gn(Ze, it) {
35276
+ function Hn(Ze, it) {
35277
35277
  var Pe = {};
35278
35278
  Pe.options = {};
35279
35279
  var je = {
@@ -35896,7 +35896,7 @@ function requireJsuites() {
35896
35896
  notification: Un,
35897
35897
  palette: Je,
35898
35898
  picker: Ge,
35899
- progressbar: Gn,
35899
+ progressbar: Hn,
35900
35900
  rating: Xn,
35901
35901
  search: Qn,
35902
35902
  slider: Jn,
@@ -37925,7 +37925,7 @@ function requireDist$1() {
37925
37925
  function Un(z) {
37926
37926
  return [M, I, T, F, P, R].indexOf(z) >= 0 || typeof z == "number" && (isNaN(z) || !isFinite(z));
37927
37927
  }
37928
- function Gn(z) {
37928
+ function Hn(z) {
37929
37929
  return Un(z) || z === Z;
37930
37930
  }
37931
37931
  function Xn(z) {
@@ -39392,7 +39392,7 @@ function requireDist$1() {
39392
39392
  }, h.HYPGEOM = Ct, h.HYPGEOMDIST = Lu, h.IF = function(z, ee, Fe) {
39393
39393
  return z instanceof Error ? z : ((ee = !(arguments.length >= 2) || ee) == null && (ee = 0), (Fe = arguments.length === 3 && Fe) == null && (Fe = 0), z ? ee : Fe);
39394
39394
  }, h.IFERROR = function(z, ee) {
39395
- return Gn(z) ? ee : z;
39395
+ return Hn(z) ? ee : z;
39396
39396
  }, h.IFNA = function(z, ee) {
39397
39397
  return z === Z ? ee : z;
39398
39398
  }, h.IFS = function() {
@@ -39514,7 +39514,7 @@ function requireDist$1() {
39514
39514
  return Yn;
39515
39515
  }, h.ISBLANK = function(z) {
39516
39516
  return z === null;
39517
- }, h.ISERR = Un, h.ISERROR = Gn, h.ISEVEN = function(z) {
39517
+ }, h.ISERR = Un, h.ISERROR = Hn, h.ISEVEN = function(z) {
39518
39518
  return !(1 & Math.floor(Math.abs(z)));
39519
39519
  }, h.ISFORMULA = function() {
39520
39520
  throw new Error("ISFORMULA is not implemented");
@@ -39638,7 +39638,7 @@ function requireDist$1() {
39638
39638
  }, h.MUNIT = function(z) {
39639
39639
  return arguments.length > 1 ? Z : !(z = parseInt(z)) || z <= 0 ? M : Array(z).fill(0).map((() => Array(z).fill(0))).map(((ee, Fe) => (ee[Fe] = 1, ee)));
39640
39640
  }, h.N = function(z) {
39641
- return Qn(z) ? z : z instanceof Date ? z.getTime() : z === !0 ? 1 : z === !1 ? 0 : Gn(z) ? z : 0;
39641
+ return Qn(z) ? z : z instanceof Date ? z.getTime() : z === !0 ? 1 : z === !1 ? 0 : Hn(z) ? z : 0;
39642
39642
  }, h.NA = function() {
39643
39643
  return Z;
39644
39644
  }, h.NEGBINOM = Mn, h.NEGBINOMDIST = Zc, h.NETWORKDAYS = Po, h.NETWORKDAYSINTL = wo, h.NOMINAL = function(z, ee) {
@@ -40064,7 +40064,7 @@ function requireDist$1() {
40064
40064
  }, h.TRUNC = function(z, ee) {
40065
40065
  return tt(z = _e(z), ee = _e(ee)) || (z > 0 ? 1 : -1) * Math.floor(Math.abs(z) * Math.pow(10, ee)) / Math.pow(10, ee);
40066
40066
  }, h.TTEST = Pu, h.TYPE = function(z) {
40067
- return Qn(z) ? 1 : Jn(z) ? 2 : Xn(z) ? 4 : Gn(z) ? 16 : Array.isArray(z) ? 64 : void 0;
40067
+ return Qn(z) ? 1 : Jn(z) ? 2 : Xn(z) ? 4 : Hn(z) ? 16 : Array.isArray(z) ? 64 : void 0;
40068
40068
  }, h.UNICHAR = yl, h.UNICODE = Ki, h.UNIQUE = Sn, h.UPPER = function(z) {
40069
40069
  return (z = pt(z)) instanceof Error ? z : z.toUpperCase();
40070
40070
  }, h.VALUE = function(z) {
@@ -44972,7 +44972,7 @@ var CRC32 = /* @__PURE__ */ (function() {
44972
44972
  var vt = et & 7, ct = et >>> 3;
44973
44973
  return vt <= 5 ? Oe[ct] |= (st & 7) << vt : (Oe[ct] |= st << vt & 255, Oe[ct + 1] = (st & 7) >> 8 - vt), et + 3;
44974
44974
  }
44975
- function Gn(Oe, et, st) {
44975
+ function Hn(Oe, et, st) {
44976
44976
  var vt = et & 7, ct = et >>> 3;
44977
44977
  return st = (st & 1) << vt, Oe[ct] |= st, et + 1;
44978
44978
  }
@@ -45079,7 +45079,7 @@ var CRC32 = /* @__PURE__ */ (function() {
45079
45079
  wn[In] = Wt & 32767, In = (In << 5 ^ Mt[Wt]) & 32767, ++Wt;
45080
45080
  En -= sr - 1;
45081
45081
  } else
45082
- Tn <= 143 ? Tn = Tn + 48 : Ut = Gn(It, Ut, 1), Ut = Xn(It, Ut, At[Tn]), wn[In] = Wt & 32767, ++Wt;
45082
+ Tn <= 143 ? Tn = Tn + 48 : Ut = Hn(It, Ut, 1), Ut = Xn(It, Ut, At[Tn]), wn[In] = Wt & 32767, ++Wt;
45083
45083
  }
45084
45084
  Ut = Xn(It, Ut, 0) - 1;
45085
45085
  }
@@ -50078,9 +50078,9 @@ var WK_ = /* @__PURE__ */ (function() {
50078
50078
  /* NUMBER */
50079
50079
  case 16:
50080
50080
  Un == 14 && (on[2] & 112) == 112 && (on[2] & 15) > 1 && (on[2] & 15) < 15 && (on[1].z = at.dateNF || table_fmt[14], at.cellDates && (on[1].t = "d", on[1].v = numdate(on[1].v))), at.qpro && on[3] > Et && (pt["!ref"] = encode_range(xt), bt[St] = pt, At.push(St), pt = at.dense ? [] : {}, xt = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } }, Et = on[3], St = wt || "Sheet" + (Et + 1), wt = "");
50081
- var Gn = at.dense ? (pt[on[0].r] || [])[on[0].c] : pt[encode_cell(on[0])];
50082
- if (Gn) {
50083
- Gn.t = on[1].t, Gn.v = on[1].v, on[1].z != null && (Gn.z = on[1].z), on[1].f != null && (Gn.f = on[1].f);
50081
+ var Hn = at.dense ? (pt[on[0].r] || [])[on[0].c] : pt[encode_cell(on[0])];
50082
+ if (Hn) {
50083
+ Hn.t = on[1].t, Hn.v = on[1].v, on[1].z != null && (Hn.z = on[1].z), on[1].f != null && (Hn.f = on[1].f);
50084
50084
  break;
50085
50085
  }
50086
50086
  at.dense ? (pt[on[0].r] || (pt[on[0].r] = []), pt[on[0].r][on[0].c] = on[1]) : pt[encode_cell(on[0])] = on[1];
@@ -58663,8 +58663,8 @@ function parse_workbook(e, t) {
58663
58663
  if (Q = make_cell(xt.val, xt.cell.ixfe, xt.tt), Q.XF = Ne[Q.ixfe], t.cellFormula) {
58664
58664
  var Vn = xt.formula;
58665
58665
  if (Vn && Vn[0] && Vn[0][0] && Vn[0][0][0] == "PtgExp") {
58666
- var Un = Vn[0][0][1][0], Gn = Vn[0][0][1][1], Xn = encode_cell({ r: Un, c: Gn });
58667
- F[Xn] ? Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe) : Q.F = ((t.dense ? (s[Un] || [])[Gn] : s[Xn]) || {}).F;
58666
+ var Un = Vn[0][0][1][0], Hn = Vn[0][0][1][1], Xn = encode_cell({ r: Un, c: Hn });
58667
+ F[Xn] ? Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe) : Q.F = ((t.dense ? (s[Un] || [])[Hn] : s[Xn]) || {}).F;
58668
58668
  } else Q.f = "" + stringify_formula(xt.formula, c, xt.cell, ut, qe);
58669
58669
  }
58670
58670
  Ve > 0 && (Q.z = _e[Q.ixfe >> 8 & 63]), safe_format_xf(Q, t, n.opts.Date1904), He(xt.cell, Q, t), f = xt;
@@ -68135,7 +68135,7 @@ function DynamicForm(e) {
68135
68135
  } finally {
68136
68136
  Ie(!1);
68137
68137
  }
68138
- }, Gn = async (nt) => {
68138
+ }, Hn = async (nt) => {
68139
68139
  nt?.preventDefault(), Vn() && await Un(I, Ae);
68140
68140
  }, Xn = async () => {
68141
68141
  await Un(P ?? "Cancel", Ae);
@@ -68630,7 +68630,7 @@ function DynamicForm(e) {
68630
68630
  size: "md",
68631
68631
  text: I,
68632
68632
  onClick: () => {
68633
- Gn();
68633
+ Hn();
68634
68634
  }
68635
68635
  }
68636
68636
  )
@@ -68690,7 +68690,7 @@ function DynamicForm(e) {
68690
68690
  }
68691
68691
  )
68692
68692
  ] }),
68693
- /* @__PURE__ */ jsxs("form", { onSubmit: Gn, className: "flex flex-col", children: [
68693
+ /* @__PURE__ */ jsxs("form", { onSubmit: Hn, className: "flex flex-col", children: [
68694
68694
  Ze && /* @__PURE__ */ jsx("div", { className: "px-[24px] pt-[16px]", children: Ze }),
68695
68695
  /* @__PURE__ */ jsx("div", { className: "max-h-[40vh] overflow-y-auto", children: Rt }),
68696
68696
  ft
@@ -68715,7 +68715,7 @@ function DynamicForm(e) {
68715
68715
  }
68716
68716
  )
68717
68717
  ] }),
68718
- /* @__PURE__ */ jsxs("form", { onSubmit: Gn, className: "relative flex-1 min-h-0 flex flex-col", children: [
68718
+ /* @__PURE__ */ jsxs("form", { onSubmit: Hn, className: "relative flex-1 min-h-0 flex flex-col", children: [
68719
68719
  Ze && /* @__PURE__ */ jsx("div", { className: "px-3 sm:px-5 pb-2 flex-shrink-0", children: Ze }),
68720
68720
  /* @__PURE__ */ jsx("div", { className: `scroll-fade-top ${$t ? "" : "fade-hidden"}` }),
68721
68721
  /* @__PURE__ */ jsx(
@@ -69065,7 +69065,7 @@ function SpreadsheetField({
69065
69065
  }, [g, He, Je, E, pt]), Vn = on ? Object.keys(on).length : 0, Un = useMemo(
69066
69066
  () => `${He}:${gn.length}:${Bt.length}:${Je}:${Vn}`,
69067
69067
  [He, gn.length, Bt.length, Je, Vn]
69068
- ), Gn = useMemo(
69068
+ ), Hn = useMemo(
69069
69069
  () => ({ current: null }),
69070
69070
  [ke, Un]
69071
69071
  ), Xn = useMemo(
@@ -69147,7 +69147,7 @@ function SpreadsheetField({
69147
69147
  }
69148
69148
  )
69149
69149
  ] }), jn = (mn, Ze) => {
69150
- const it = mn === "preview", Pe = it ? Xn : Gn, je = ke === "compact" ? "spreadsheet-density-compact" : "spreadsheet-density-comfortable";
69150
+ const it = mn === "preview", Pe = it ? Xn : Hn, je = ke === "compact" ? "spreadsheet-density-compact" : "spreadsheet-density-comfortable";
69151
69151
  return gn.length ? /* @__PURE__ */ jsxs(
69152
69152
  "div",
69153
69153
  {
@@ -81085,7 +81085,7 @@ function SelectProducts({
81085
81085
  try {
81086
81086
  const Vn = await fetchRequiredFields(t);
81087
81087
  if (Vn?.status?.code !== 0 || !Vn.data) return;
81088
- const { columns: Un, allowedValues: Gn } = buildFromRequiredFields(Vn.data), Xn = new Set(DEFAULT_COLUMNS.map((Jn) => Jn.value)), Qn = Un.filter((Jn) => !Xn.has(Jn.value));
81088
+ const { columns: Un, allowedValues: Hn } = buildFromRequiredFields(Vn.data), Xn = new Set(DEFAULT_COLUMNS.map((Jn) => Jn.value)), Qn = Un.filter((Jn) => !Xn.has(Jn.value));
81089
81089
  Qn.length > 0 && (P((Jn) => {
81090
81090
  const Sn = new Set(Jn.map((Pt) => Pt.value)), nr = Qn.filter((Pt) => !Sn.has(Pt.value));
81091
81091
  return nr.length > 0 ? [...Jn, ...nr] : Jn;
@@ -81094,7 +81094,7 @@ function SelectProducts({
81094
81094
  for (const nr of Qn)
81095
81095
  !CORE_COLUMN_VALUES.has(nr.value) && Sn[nr.value] === void 0 && (Sn[nr.value] = !1);
81096
81096
  return Sn;
81097
- })), Z((Jn) => mergeAllowedValues(Jn, Gn));
81097
+ })), Z((Jn) => mergeAllowedValues(Jn, Hn));
81098
81098
  } catch (Vn) {
81099
81099
  console.error("Failed to fetch required fields:", Vn);
81100
81100
  } finally {
@@ -81105,12 +81105,12 @@ function SelectProducts({
81105
81105
  const At = useCallback(
81106
81106
  async (Vn = 1) => {
81107
81107
  if (!t) return;
81108
- const Un = ++bt.current, Gn = buildFieldsFromColumns(I, DEFAULT_SOURCE_MP), Xn = buildFiltersFromFields(Gn), Qn = (Vn - 1) * PRODUCTS_PER_PAGE;
81108
+ const Un = ++bt.current, Hn = buildFieldsFromColumns(I, DEFAULT_SOURCE_MP), Xn = buildFiltersFromFields(Hn), Qn = (Vn - 1) * PRODUCTS_PER_PAGE;
81109
81109
  R(!0);
81110
81110
  try {
81111
81111
  const Jn = await searchProducts({
81112
81112
  storeId: t,
81113
- fields: Gn,
81113
+ fields: Hn,
81114
81114
  filters: Xn,
81115
81115
  start: Qn,
81116
81116
  rows: PRODUCTS_PER_PAGE
@@ -81140,8 +81140,8 @@ function SelectProducts({
81140
81140
  !t || !Ke || At(Ne);
81141
81141
  }, [t, Ne, Ke]);
81142
81142
  const Ht = useCallback(
81143
- async (Vn, Un, Gn, Xn) => {
81144
- const Qn = Gn === "required" ? "product" : Gn, Jn = Vn.product_code, Sn = Vn.product_uuid;
81143
+ async (Vn, Un, Hn, Xn) => {
81144
+ const Qn = Hn === "required" ? "product" : Hn, Jn = Vn.product_code, Sn = Vn.product_uuid;
81145
81145
  if (!Jn || !Sn)
81146
81146
  throw new Error("Missing product code or UUID");
81147
81147
  await updateProduct({
@@ -81174,7 +81174,7 @@ function SelectProducts({
81174
81174
  new Set(gn.map((Qn) => Qn.product_uuid).filter(Boolean))
81175
81175
  ), Un = Array.from(
81176
81176
  new Set(gn.map((Qn) => Qn.product_code).filter(Boolean))
81177
- ), Gn = h ? { product_uuids: Vn } : { product_codes: Un }, Xn = {
81177
+ ), Hn = h ? { product_uuids: Vn } : { product_codes: Un }, Xn = {
81178
81178
  product_uuids: Vn,
81179
81179
  product_codes: Un,
81180
81180
  workspaceId: e,
@@ -81191,7 +81191,7 @@ function SelectProducts({
81191
81191
  {},
81192
81192
  // filters
81193
81193
  h,
81194
- Gn,
81194
+ Hn,
81195
81195
  Xn
81196
81196
  );
81197
81197
  Qn?.submitted && (at(!0), St(Qn.submittedValues ?? Xn));
@@ -81213,7 +81213,7 @@ function SelectProducts({
81213
81213
  }));
81214
81214
  }, []);
81215
81215
  if (_e) {
81216
- const Vn = pt, Un = Array.isArray(Vn?.product_uuids) ? Vn.product_uuids : [], Gn = Array.isArray(Vn?.product_codes) ? Vn.product_codes : [], Xn = Un.length || Gn.length;
81216
+ const Vn = pt, Un = Array.isArray(Vn?.product_uuids) ? Vn.product_uuids : [], Hn = Array.isArray(Vn?.product_codes) ? Vn.product_codes : [], Xn = Un.length || Hn.length;
81217
81217
  return /* @__PURE__ */ jsx("div", { className: "w-fit max-w-full py-2 animate-in fade-in duration-300", children: /* @__PURE__ */ jsxs("div", { className: "rounded-md border p-2.5 flex items-start gap-2 bg-emerald-50/50 border-emerald-200 dark:bg-muted/20 dark:border-border", children: [
81218
81218
  /* @__PURE__ */ jsx("div", { className: "mt-px text-emerald-500", children: /* @__PURE__ */ jsx(CircleCheckBig$1, { className: "w-4 h-4" }) }),
81219
81219
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
@@ -82942,7 +82942,7 @@ function EditFeed({
82942
82942
  }), He((Xe) => new Set(Xe).add(`${Rt}:${Lt}`));
82943
82943
  },
82944
82944
  []
82945
- ), [Un, Gn] = useState(null), [Xn, Qn] = useState(null), Jn = useRef(null), Sn = useRef(Un);
82945
+ ), [Un, Hn] = useState(null), [Xn, Qn] = useState(null), Jn = useRef(null), Sn = useRef(Un);
82946
82946
  useEffect(() => {
82947
82947
  Sn.current = Un;
82948
82948
  }, [Un]);
@@ -82953,10 +82953,10 @@ function EditFeed({
82953
82953
  at
82954
82954
  ]);
82955
82955
  const Pt = useCallback((Rt, Lt) => {
82956
- Gn({ col: Lt, anchorRow: Rt, focusRow: Rt });
82956
+ Hn({ col: Lt, anchorRow: Rt, focusRow: Rt });
82957
82957
  }, []), Kt = useCallback(
82958
82958
  (Rt, Lt) => {
82959
- Gn((ze) => !ze || ze.col !== Lt ? { col: Lt, anchorRow: Rt, focusRow: Rt } : { ...ze, focusRow: Rt });
82959
+ Hn((ze) => !ze || ze.col !== Lt ? { col: Lt, anchorRow: Rt, focusRow: Rt } : { ...ze, focusRow: Rt });
82960
82960
  },
82961
82961
  []
82962
82962
  ), pn = useCallback(
@@ -83009,7 +83009,7 @@ function EditFeed({
83009
83009
  const Gt = Tt - 1 - jt;
83010
83010
  Gt >= 0 && Vn(Gt, gt, Nn[jt]);
83011
83011
  }
83012
- return Gn({
83012
+ return Hn({
83013
83013
  col: gt,
83014
83014
  anchorRow: Zt,
83015
83015
  focusRow: Vt
@@ -83019,7 +83019,7 @@ function EditFeed({
83019
83019
  const Xt = computeFillValues(Mn, qn.length);
83020
83020
  return qn.forEach((un, Nn) => {
83021
83021
  Vn(un, gt, Xt[Nn]);
83022
- }), Gn({
83022
+ }), Hn({
83023
83023
  col: gt,
83024
83024
  anchorRow: Tt,
83025
83025
  focusRow: Zt
@@ -83060,7 +83060,7 @@ function EditFeed({
83060
83060
  else if (Lt.key === "ArrowLeft") ft = -1;
83061
83061
  else if (Lt.key === "ArrowRight") ft = 1;
83062
83062
  else if (Lt.key === "Escape") {
83063
- Lt.preventDefault(), Gn(null);
83063
+ Lt.preventDefault(), Hn(null);
83064
83064
  return;
83065
83065
  } else
83066
83066
  return;
@@ -83073,11 +83073,11 @@ function EditFeed({
83073
83073
  0,
83074
83074
  Math.min(nt, Un.focusRow + Xe)
83075
83075
  );
83076
- Gn({ ...Un, focusRow: Zt }), it(Zt, Un.col);
83076
+ Hn({ ...Un, focusRow: Zt }), it(Zt, Un.col);
83077
83077
  return;
83078
83078
  }
83079
83079
  const gt = Math.max(0, Math.min(dt, Ct + ft)), Tt = Ie[gt], Vt = Math.max(0, Math.min(nt, Un.focusRow + Xe));
83080
- Gn({ col: Tt, anchorRow: Vt, focusRow: Vt }), it(Vt, Tt);
83080
+ Hn({ col: Tt, anchorRow: Vt, focusRow: Vt }), it(Vt, Tt);
83081
83081
  };
83082
83082
  return window.addEventListener("keydown", Rt), () => window.removeEventListener("keydown", Rt);
83083
83083
  }, [Un, Ie, F.length, it]);
@@ -85434,7 +85434,7 @@ var catalogixManifest = [
85434
85434
  }
85435
85435
  }
85436
85436
  function T() {
85437
- var ze = Gn.A;
85437
+ var ze = Hn.A;
85438
85438
  return ze === null ? null : ze.getOwner();
85439
85439
  }
85440
85440
  function M() {
@@ -85675,7 +85675,7 @@ Your code should look like:
85675
85675
  throw ze._result;
85676
85676
  }
85677
85677
  function qe() {
85678
- var ze = Gn.H;
85678
+ var ze = Hn.H;
85679
85679
  return ze === null && console.error(
85680
85680
  `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
85681
85681
  1. You might have mismatching versions of React and the renderer (such as React DOM)
@@ -85685,7 +85685,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85685
85685
  ), ze;
85686
85686
  }
85687
85687
  function Je() {
85688
- Gn.asyncTransitions--;
85688
+ Hn.asyncTransitions--;
85689
85689
  }
85690
85690
  function Qe(ze) {
85691
85691
  if (it === null)
@@ -85715,7 +85715,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85715
85715
  ), Pe = Xe;
85716
85716
  }
85717
85717
  function Ke(ze, Xe, ft) {
85718
- var Ct = Gn.actQueue;
85718
+ var Ct = Hn.actQueue;
85719
85719
  if (Ct !== null)
85720
85720
  if (Ct.length !== 0)
85721
85721
  try {
@@ -85724,10 +85724,10 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85724
85724
  });
85725
85725
  return;
85726
85726
  } catch (nt) {
85727
- Gn.thrownErrors.push(nt);
85727
+ Hn.thrownErrors.push(nt);
85728
85728
  }
85729
- else Gn.actQueue = null;
85730
- 0 < Gn.thrownErrors.length ? (Ct = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ft(Ct)) : Xe(ze);
85729
+ else Hn.actQueue = null;
85730
+ 0 < Hn.thrownErrors.length ? (Ct = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ft(Ct)) : Xe(ze);
85731
85731
  }
85732
85732
  function lt(ze) {
85733
85733
  if (!yt) {
@@ -85737,10 +85737,10 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85737
85737
  for (; Xe < ze.length; Xe++) {
85738
85738
  var ft = ze[Xe];
85739
85739
  do {
85740
- Gn.didUsePromise = !1;
85740
+ Hn.didUsePromise = !1;
85741
85741
  var Ct = ft(!1);
85742
85742
  if (Ct !== null) {
85743
- if (Gn.didUsePromise) {
85743
+ if (Hn.didUsePromise) {
85744
85744
  ze[Xe] = ft, ze.splice(0, Xe);
85745
85745
  return;
85746
85746
  }
@@ -85750,7 +85750,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85750
85750
  }
85751
85751
  ze.length = 0;
85752
85752
  } catch (nt) {
85753
- ze.splice(0, Xe + 1), Gn.thrownErrors.push(nt);
85753
+ ze.splice(0, Xe + 1), Hn.thrownErrors.push(nt);
85754
85754
  } finally {
85755
85755
  yt = !1;
85756
85756
  }
@@ -85793,7 +85793,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85793
85793
  for (Lt in on)
85794
85794
  on.hasOwnProperty(Lt) && n(Lt, on[Lt]);
85795
85795
  c.prototype = l.prototype, on = f.prototype = new c(), on.constructor = f, vn(on, l.prototype), on.isPureReactComponent = !0;
85796
- var Vn = Array.isArray, Un = /* @__PURE__ */ Symbol.for("react.client.reference"), Gn = {
85796
+ var Vn = Array.isArray, Un = /* @__PURE__ */ Symbol.for("react.client.reference"), Hn = {
85797
85797
  H: null,
85798
85798
  A: null,
85799
85799
  T: null,
@@ -85872,17 +85872,17 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85872
85872
  return ze;
85873
85873
  }
85874
85874
  };
85875
- e.Activity = Ht, e.Children = Lt, e.Component = l, e.Fragment = $t, e.Profiler = _e, e.PureComponent = f, e.StrictMode = Ve, e.Suspense = wt, e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Gn, e.__COMPILER_RUNTIME = on, e.act = function(ze) {
85876
- var Xe = Gn.actQueue, ft = Pe;
85875
+ e.Activity = Ht, e.Children = Lt, e.Component = l, e.Fragment = $t, e.Profiler = _e, e.PureComponent = f, e.StrictMode = Ve, e.Suspense = wt, e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Hn, e.__COMPILER_RUNTIME = on, e.act = function(ze) {
85876
+ var Xe = Hn.actQueue, ft = Pe;
85877
85877
  Pe++;
85878
- var Ct = Gn.actQueue = Xe !== null ? Xe : [], nt = !1;
85878
+ var Ct = Hn.actQueue = Xe !== null ? Xe : [], nt = !1;
85879
85879
  try {
85880
85880
  var dt = ze();
85881
85881
  } catch (Vt) {
85882
- Gn.thrownErrors.push(Vt);
85882
+ Hn.thrownErrors.push(Vt);
85883
85883
  }
85884
- if (0 < Gn.thrownErrors.length)
85885
- throw tt(Xe, ft), ze = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ze;
85884
+ if (0 < Hn.thrownErrors.length)
85885
+ throw tt(Xe, ft), ze = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ze;
85886
85886
  if (dt !== null && typeof dt == "object" && typeof dt.then == "function") {
85887
85887
  var gt = dt;
85888
85888
  return Rt(function() {
@@ -85903,20 +85903,20 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85903
85903
  );
85904
85904
  });
85905
85905
  } catch (qn) {
85906
- Gn.thrownErrors.push(qn);
85906
+ Hn.thrownErrors.push(qn);
85907
85907
  }
85908
- if (0 < Gn.thrownErrors.length) {
85908
+ if (0 < Hn.thrownErrors.length) {
85909
85909
  var Mn = ot(
85910
- Gn.thrownErrors
85910
+ Hn.thrownErrors
85911
85911
  );
85912
- Gn.thrownErrors.length = 0, Zt(Mn);
85912
+ Hn.thrownErrors.length = 0, Zt(Mn);
85913
85913
  }
85914
85914
  } else Vt(hn);
85915
85915
  },
85916
85916
  function(hn) {
85917
- tt(Xe, ft), 0 < Gn.thrownErrors.length && (hn = ot(
85918
- Gn.thrownErrors
85919
- ), Gn.thrownErrors.length = 0), Zt(hn);
85917
+ tt(Xe, ft), 0 < Hn.thrownErrors.length && (hn = ot(
85918
+ Hn.thrownErrors
85919
+ ), Hn.thrownErrors.length = 0), Zt(hn);
85920
85920
  }
85921
85921
  );
85922
85922
  }
@@ -85927,11 +85927,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85927
85927
  nt || je || (je = !0, console.error(
85928
85928
  "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
85929
85929
  ));
85930
- }), Gn.actQueue = null), 0 < Gn.thrownErrors.length)
85931
- throw ze = ot(Gn.thrownErrors), Gn.thrownErrors.length = 0, ze;
85930
+ }), Hn.actQueue = null), 0 < Hn.thrownErrors.length)
85931
+ throw ze = ot(Hn.thrownErrors), Hn.thrownErrors.length = 0, ze;
85932
85932
  return {
85933
85933
  then: function(Vt, Zt) {
85934
- nt = !0, ft === 0 ? (Gn.actQueue = Ct, Qe(function() {
85934
+ nt = !0, ft === 0 ? (Hn.actQueue = Ct, Qe(function() {
85935
85935
  return Ke(
85936
85936
  Tt,
85937
85937
  Vt,
@@ -85947,7 +85947,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
85947
85947
  }, e.cacheSignal = function() {
85948
85948
  return null;
85949
85949
  }, e.captureOwnerStack = function() {
85950
- var ze = Gn.getCurrentStack;
85950
+ var ze = Hn.getCurrentStack;
85951
85951
  return ze === null ? null : ze();
85952
85952
  }, e.cloneElement = function(ze, Xe, ft) {
85953
85953
  if (ze == null)
@@ -86025,7 +86025,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86025
86025
  Ct,
86026
86026
  typeof ze == "function" ? ze.displayName || ze.name || "Unknown" : ze
86027
86027
  );
86028
- var Vt = 1e4 > Gn.recentlyCreatedOwnerStacks++;
86028
+ var Vt = 1e4 > Hn.recentlyCreatedOwnerStacks++;
86029
86029
  return Z(
86030
86030
  ze,
86031
86031
  nt,
@@ -86097,11 +86097,11 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86097
86097
  }
86098
86098
  }), Xe;
86099
86099
  }, e.startTransition = function(ze) {
86100
- var Xe = Gn.T, ft = {};
86101
- ft._updatedFibers = /* @__PURE__ */ new Set(), Gn.T = ft;
86100
+ var Xe = Hn.T, ft = {};
86101
+ ft._updatedFibers = /* @__PURE__ */ new Set(), Hn.T = ft;
86102
86102
  try {
86103
- var Ct = ze(), nt = Gn.S;
86104
- nt !== null && nt(ft, Ct), typeof Ct == "object" && Ct !== null && typeof Ct.then == "function" && (Gn.asyncTransitions++, Ct.then(Je, Je), Ct.then(h, mn));
86103
+ var Ct = ze(), nt = Hn.S;
86104
+ nt !== null && nt(ft, Ct), typeof Ct == "object" && Ct !== null && typeof Ct.then == "function" && (Hn.asyncTransitions++, Ct.then(Je, Je), Ct.then(h, mn));
86105
86105
  } catch (dt) {
86106
86106
  mn(dt);
86107
86107
  } finally {
@@ -86109,7 +86109,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
86109
86109
  "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
86110
86110
  )), Xe !== null && ft.types !== null && (Xe.types !== null && Xe.types !== ft.types && console.error(
86111
86111
  "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
86112
- ), Xe.types = ft.types), Gn.T = Xe;
86112
+ ), Xe.types = ft.types), Hn.T = Xe;
86113
86113
  }
86114
86114
  }, e.unstable_useCacheRefresh = function() {
86115
86115
  return qe().useCacheRefresh();
@@ -86874,7 +86874,7 @@ Error generating stack: ` + te.message + `
86874
86874
  ` + te.stack;
86875
86875
  }
86876
86876
  }
86877
- var Gn = Object.prototype.hasOwnProperty, Xn = t.unstable_scheduleCallback, Qn = t.unstable_cancelCallback, Jn = t.unstable_shouldYield, Sn = t.unstable_requestPaint, nr = t.unstable_now, Pt = t.unstable_getCurrentPriorityLevel, Kt = t.unstable_ImmediatePriority, pn = t.unstable_UserBlockingPriority, jn = t.unstable_NormalPriority, mn = t.unstable_LowPriority, Ze = t.unstable_IdlePriority, it = t.log, Pe = t.unstable_setDisableYieldValue, je = null, yt = null;
86877
+ var Hn = Object.prototype.hasOwnProperty, Xn = t.unstable_scheduleCallback, Qn = t.unstable_cancelCallback, Jn = t.unstable_shouldYield, Sn = t.unstable_requestPaint, nr = t.unstable_now, Pt = t.unstable_getCurrentPriorityLevel, Kt = t.unstable_ImmediatePriority, pn = t.unstable_UserBlockingPriority, jn = t.unstable_NormalPriority, mn = t.unstable_LowPriority, Ze = t.unstable_IdlePriority, it = t.log, Pe = t.unstable_setDisableYieldValue, je = null, yt = null;
86878
86878
  function Rt(C) {
86879
86879
  if (typeof it == "function" && Pe(C), yt && typeof yt.setStrictMode == "function")
86880
86880
  try {
@@ -87144,7 +87144,7 @@ Error generating stack: ` + te.message + `
87144
87144
  "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"
87145
87145
  ), Mi = {}, wi = {};
87146
87146
  function Cr(C) {
87147
- return Gn.call(wi, C) ? !0 : Gn.call(Mi, C) ? !1 : ur.test(C) ? wi[C] = !0 : (Mi[C] = !0, !1);
87147
+ return Hn.call(wi, C) ? !0 : Hn.call(Mi, C) ? !1 : ur.test(C) ? wi[C] = !0 : (Mi[C] = !0, !1);
87148
87148
  }
87149
87149
  function Ta(C, j, V) {
87150
87150
  if (Cr(j))
@@ -87913,7 +87913,7 @@ Error generating stack: ` + te.message + `
87913
87913
  if (V.length !== te.length) return !1;
87914
87914
  for (te = 0; te < V.length; te++) {
87915
87915
  var Be = V[te];
87916
- if (!Gn.call(j, Be) || !Kn(C[Be], j[Be]))
87916
+ if (!Hn.call(j, Be) || !Kn(C[Be], j[Be]))
87917
87917
  return !1;
87918
87918
  }
87919
87919
  return !0;
@@ -88046,10 +88046,10 @@ Error generating stack: ` + te.message + `
88046
88046
  va[Ea++] = C, va[Ea++] = j, va[Ea++] = V, va[Ea++] = te, oi |= te, C.lanes |= te, C = C.alternate, C !== null && (C.lanes |= te);
88047
88047
  }
88048
88048
  function Yt(C, j, V, te) {
88049
- return Ot(C, j, V, te), Hn(C);
88049
+ return Ot(C, j, V, te), Gn(C);
88050
88050
  }
88051
88051
  function rn(C, j) {
88052
- return Ot(C, null, null, j), Hn(C);
88052
+ return Ot(C, null, null, j), Gn(C);
88053
88053
  }
88054
88054
  function Wn(C, j, V) {
88055
88055
  C.lanes |= V;
@@ -88059,7 +88059,7 @@ Error generating stack: ` + te.message + `
88059
88059
  Ue.childLanes |= V, te = Ue.alternate, te !== null && (te.childLanes |= V), Ue.tag === 22 && (C = Ue.stateNode, C === null || C._visibility & 1 || (Be = !0)), C = Ue, Ue = Ue.return;
88060
88060
  return C.tag === 3 ? (Ue = C.stateNode, Be && j !== null && (Be = 31 - Lt(V), C = Ue.hiddenUpdates, te = C[Be], te === null ? C[Be] = [j] : te.push(j), j.lane = V | 536870912), Ue) : null;
88061
88061
  }
88062
- function Hn(C) {
88062
+ function Gn(C) {
88063
88063
  if (50 < df)
88064
88064
  throw df = 0, Bp = null, Error(s(185));
88065
88065
  for (var j = C.return; j !== null; )
@@ -88984,9 +88984,9 @@ Error generating stack: ` + te.message + `
88984
88984
  if (te === null) return null;
88985
88985
  if (te = te.shared, (oa & 2) !== 0) {
88986
88986
  var Be = te.pending;
88987
- return Be === null ? j.next = j : (j.next = Be.next, Be.next = j), te.pending = j, j = Hn(C), Wn(C, null, V), j;
88987
+ return Be === null ? j.next = j : (j.next = Be.next, Be.next = j), te.pending = j, j = Gn(C), Wn(C, null, V), j;
88988
88988
  }
88989
- return Ot(C, te, j, V), Hn(C);
88989
+ return Ot(C, te, j, V), Gn(C);
88990
88990
  }
88991
88991
  function du(C, j, V) {
88992
88992
  if (j = j.updateQueue, j !== null && (j = j.shared, (V & 4194048) !== 0)) {
@@ -96949,7 +96949,7 @@ Error generating stack: ` + rt.message + `
96949
96949
  Bt(d)
96950
96950
  ), Jt(d);
96951
96951
  }
96952
- function Gn(d) {
96952
+ function Hn(d) {
96953
96953
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u") return !1;
96954
96954
  var v = __REACT_DEVTOOLS_GLOBAL_HOOK__;
96955
96955
  if (v.isDisabled) return !0;
@@ -99877,7 +99877,7 @@ It can also happen if the client has a browser extension installed which messes
99877
99877
  d.actualDuration += v, d.selfBaseDuration = v, xs = -1;
99878
99878
  }
99879
99879
  }
99880
- function Hn(d) {
99880
+ function Gn(d) {
99881
99881
  if (0 <= xs) {
99882
99882
  var v = Ui() - xs;
99883
99883
  d.actualDuration += v, xs = -1;
@@ -106851,7 +106851,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
106851
106851
  N,
106852
106852
  v,
106853
106853
  Mu
106854
- ), (v.mode & Fr) !== wr && Hn(v), N !== null) {
106854
+ ), (v.mode & Fr) !== wr && Gn(v), N !== null) {
106855
106855
  Ur = N;
106856
106856
  return;
106857
106857
  }
@@ -106871,7 +106871,7 @@ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fet
106871
106871
  return;
106872
106872
  }
106873
106873
  if ((d.mode & Fr) !== wr) {
106874
- Hn(d), N = d.actualDuration;
106874
+ Gn(d), N = d.actualDuration;
106875
106875
  for (var q = d.child; q !== null; )
106876
106876
  N += q.actualDuration, q = q.sibling;
106877
106877
  d.actualDuration = N;
@@ -113198,7 +113198,7 @@ Learn more: https://react.dev/warnings/version-mismatch`)
113198
113198
  currentDispatcherRef: $n,
113199
113199
  reconcilerVersion: "19.2.4"
113200
113200
  };
113201
- return d.overrideHookState = o_, d.overrideHookStateDeletePath = s_, d.overrideHookStateRenamePath = l_, d.overrideProps = c_, d.overridePropsDeletePath = u_, d.overridePropsRenamePath = d_, d.scheduleUpdate = f_, d.scheduleRetry = p_, d.setErrorHandler = h_, d.setSuspenseHandler = m_, d.scheduleRefresh = I, d.scheduleRoot = M, d.setRefreshHandler = P, d.getCurrentFiber = wa, Gn(d);
113201
+ return d.overrideHookState = o_, d.overrideHookStateDeletePath = s_, d.overrideHookStateRenamePath = l_, d.overrideProps = c_, d.overridePropsDeletePath = u_, d.overridePropsRenamePath = d_, d.scheduleUpdate = f_, d.scheduleRetry = p_, d.setErrorHandler = h_, d.setSuspenseHandler = m_, d.scheduleRefresh = I, d.scheduleRoot = M, d.setRefreshHandler = P, d.getCurrentFiber = wa, Hn(d);
113202
113202
  })() && Nu && window.top === window.self && (-1 < navigator.userAgent.indexOf("Chrome") && navigator.userAgent.indexOf("Edge") === -1 || -1 < navigator.userAgent.indexOf("Firefox"))) {
113203
113203
  var g_ = window.location.protocol;
113204
113204
  /^(https?|file):$/.test(g_) && console.info(
@@ -115863,7 +115863,7 @@ var ApiError = class extends Error {
115863
115863
  updateAdTemplate: on,
115864
115864
  deleteAdTemplate: Vn,
115865
115865
  addStylingCategory: Un,
115866
- updateStylingCategory: Gn,
115866
+ updateStylingCategory: Hn,
115867
115867
  deleteStylingCategory: Xn,
115868
115868
  addStylingItem: Qn,
115869
115869
  updateStylingItem: Jn,
@@ -116043,7 +116043,7 @@ var ApiError = class extends Error {
116043
116043
  updateAdTemplate: on,
116044
116044
  deleteAdTemplate: Vn,
116045
116045
  addStylingCategory: Un,
116046
- updateStylingCategory: Gn,
116046
+ updateStylingCategory: Hn,
116047
116047
  deleteStylingCategory: Xn,
116048
116048
  addStylingItem: Qn,
116049
116049
  updateStylingItem: Jn,
@@ -126093,7 +126093,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126093
126093
  const pn = new Map(Kt);
126094
126094
  return pn.delete(Pt), pn;
126095
126095
  });
126096
- }, Gn = (Pt) => {
126096
+ }, Hn = (Pt) => {
126097
126097
  const Kt = b.selectedGroupIds.size > 0 ? Array.from(b.selectedGroupIds) : b.activeGroupId ? [b.activeGroupId] : [];
126098
126098
  b.hasGroups && Kt.length > 0 ? Qe((pn) => {
126099
126099
  const jn = new Map(pn);
@@ -126153,7 +126153,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126153
126153
  onChange: bt,
126154
126154
  variant: "modal",
126155
126155
  showFavorites: !0,
126156
- onUpload: Gn,
126156
+ onUpload: Hn,
126157
126157
  onRemoveCustom: Xn,
126158
126158
  customUpload: tt || null
126159
126159
  }
@@ -126713,7 +126713,7 @@ var import_react37 = __toESM(require_react(), 1), import_react_dom = __toESM(req
126713
126713
  Jt?.age || ""
126714
126714
  ).length > 0, Un = (0, import_react51.useMemo)(() => new Set(
126715
126715
  Object.values(g).flat().filter((Xe) => Xe.isBackPose || Xe.name.toLowerCase().includes("back") || Xe.id.toLowerCase().includes("back")).map((Xe) => Xe.id)
126716
- ), [g]), Gn = (0, import_react51.useMemo)(() => {
126716
+ ), [g]), Hn = (0, import_react51.useMemo)(() => {
126717
126717
  const Xe = /* @__PURE__ */ new Set();
126718
126718
  return R || Un.forEach((ft) => Xe.add(ft)), Xe;
126719
126719
  }, [R, Un]), Xn = (0, import_react51.useMemo)(() => {
@@ -126955,7 +126955,7 @@ ${xt}`,
126955
126955
  modelAge: Jt?.age,
126956
126956
  variant: "modal",
126957
126957
  allowMultiSelect: !0,
126958
- disabledPoseIds: Gn
126958
+ disabledPoseIds: Hn
126959
126959
  }
126960
126960
  ) }),
126961
126961
  isValid: tt.size > 0
@@ -128110,7 +128110,7 @@ function DirectEditorHost({
128110
128110
  propIds: on = [],
128111
128111
  prompt: Vn = "",
128112
128112
  quality: Un,
128113
- ...Gn
128113
+ ...Hn
128114
128114
  } = xt, Xn = Ke.find((Pe) => Pe.id === gn), Qn = lt.find((Pe) => Pe.id === Bt), Jn = vn.map((Pe) => ut.find((je) => je.id === Pe)?.image).filter(Boolean), Sn = Jt.map((Pe) => Ge.find((je) => je.id === Pe)?.image).filter(Boolean), nr = on.map((Pe) => $t.find((je) => je.id === Pe)?.image).filter(Boolean), Pt = Jt.map((Pe) => {
128115
128115
  const je = Ge.find((yt) => yt.id === Pe);
128116
128116
  return je?.prompt || je?.name || "";
@@ -128127,7 +128127,7 @@ function DirectEditorHost({
128127
128127
  propsPrompt: Kt
128128
128128
  });
128129
128129
  _e({
128130
- ...Gn,
128130
+ ...Hn,
128131
128131
  modelId: gn,
128132
128132
  bgId: Bt,
128133
128133
  quality: Un,
@@ -128151,7 +128151,7 @@ function DirectEditorHost({
128151
128151
  ]
128152
128152
  ), pt = (0, import_react56.useCallback)(
128153
128153
  (xt) => {
128154
- const { selectedBgId: gn, propIds: Bt = [], customPrompt: vn = "", quality: Jt, ...on } = xt, Vn = lt.find((Pt) => Pt.id === gn), Un = Bt.map((Pt) => $t.find((Kt) => Kt.id === Pt)?.image).filter(Boolean), Gn = gn === CUSTOM_BG_ID, Xn = Vn ? isAllowedBgImage(Vn.name) : !1, Qn = Gn || Xn, Jn = tt("product-bg-change") || DEFAULT_BG_CHANGE_TEMPLATE, Sn = [Vn?.prompt, vn].filter(Boolean).join(" "), nr = Jn.replace("{{bgPrompt}}", Sn).replace("[BG PROMPT HERE]", Sn);
128154
+ const { selectedBgId: gn, propIds: Bt = [], customPrompt: vn = "", quality: Jt, ...on } = xt, Vn = lt.find((Pt) => Pt.id === gn), Un = Bt.map((Pt) => $t.find((Kt) => Kt.id === Pt)?.image).filter(Boolean), Hn = gn === CUSTOM_BG_ID, Xn = Vn ? isAllowedBgImage(Vn.name) : !1, Qn = Hn || Xn, Jn = tt("product-bg-change") || DEFAULT_BG_CHANGE_TEMPLATE, Sn = [Vn?.prompt, vn].filter(Boolean).join(" "), nr = Jn.replace("{{bgPrompt}}", Sn).replace("[BG PROMPT HERE]", Sn);
128155
128155
  _e({
128156
128156
  ...on,
128157
128157
  selectedBgId: gn,
@@ -130302,6 +130302,37 @@ function AppChain({ apps: e }) {
130302
130302
  ] })
130303
130303
  ] }, t)) });
130304
130304
  }
130305
+ function BriefCard({
130306
+ description: e,
130307
+ children: t,
130308
+ onActivate: n,
130309
+ className: o = "",
130310
+ ...s
130311
+ }) {
130312
+ return /* @__PURE__ */ jsx(
130313
+ "div",
130314
+ {
130315
+ role: "button",
130316
+ tabIndex: 0,
130317
+ onClick: n,
130318
+ onKeyDown: (c) => {
130319
+ c.key !== "Enter" && c.key !== " " || (c.preventDefault(), n());
130320
+ },
130321
+ className: [
130322
+ "sa-brief-card sa-brief-card group/brief cursor-pointer outline-none",
130323
+ "focus-visible:ring-2 focus-visible:ring-[var(--alias-border-focus)]",
130324
+ "focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--alias-surface-base)]",
130325
+ o
130326
+ ].join(" "),
130327
+ ...s,
130328
+ children: /* @__PURE__ */ jsxs("div", { className: "sa-brief-card-inner", children: [
130329
+ /* @__PURE__ */ jsx("span", { "aria-hidden": !0, className: "sa-brief-card-glow" }),
130330
+ /* @__PURE__ */ jsx("p", { className: "sa-brief-card-desc", children: e }),
130331
+ t && /* @__PURE__ */ jsx("div", { className: "mt-auto w-full pt-[10px]", children: t })
130332
+ ] })
130333
+ }
130334
+ );
130335
+ }
130305
130336
  function QuickPrompt({
130306
130337
  title: e,
130307
130338
  value: t,
@@ -130311,30 +130342,21 @@ function QuickPrompt({
130311
130342
  onClick: l,
130312
130343
  className: c = ""
130313
130344
  }) {
130314
- const f = t ?? e, h = n || e, g = useId$1(), b = (T) => {
130315
- T.key !== "Enter" && T.key !== " " || (T.preventDefault(), l?.(f));
130316
- }, E = /* @__PURE__ */ jsx(
130317
- ScBriefCard,
130345
+ const f = t ?? e, h = n || e, g = useId$1(), b = /* @__PURE__ */ jsx(
130346
+ BriefCard,
130318
130347
  {
130319
- role: "button",
130320
- tabIndex: 0,
130321
130348
  "aria-label": e,
130322
130349
  "aria-describedby": o ? g : void 0,
130323
130350
  description: h,
130324
- className: [
130325
- "cursor-pointer outline-none transition-transform",
130326
- "focus-visible:ring-2 focus-visible:ring-[var(--alias-border-focus)]",
130327
- "focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--alias-surface-base)]"
130328
- ].join(" "),
130329
- onClick: () => l?.(f),
130330
- onKeyDown: b
130351
+ onActivate: () => l?.(f),
130352
+ className: "min-h-0 flex-1",
130353
+ children: /* @__PURE__ */ jsx(AppChain, { apps: s })
130331
130354
  }
130332
- ), R = s.length > 0 ? /* @__PURE__ */ jsx("div", { className: "mt-[6px] px-[2px]", children: /* @__PURE__ */ jsx(AppChain, { apps: s }) }) : null;
130355
+ );
130333
130356
  return o ? (
130334
130357
  // Same hover-reveal idiom as the Products pills below the composer.
130335
130358
  /* @__PURE__ */ jsxs("div", { className: `group relative flex flex-col ${c}`, "data-id": "quick-prompt", children: [
130336
- E,
130337
- R,
130359
+ b,
130338
130360
  /* @__PURE__ */ jsxs(
130339
130361
  "div",
130340
130362
  {
@@ -130362,10 +130384,7 @@ function QuickPrompt({
130362
130384
  }
130363
130385
  )
130364
130386
  ] })
130365
- ) : /* @__PURE__ */ jsxs("div", { className: `flex flex-col ${c}`, "data-id": "quick-prompt", children: [
130366
- E,
130367
- R
130368
- ] });
130387
+ ) : /* @__PURE__ */ jsx("div", { className: `flex flex-col ${c}`, "data-id": "quick-prompt", children: b });
130369
130388
  }
130370
130389
  const FIELD_RE = /^([A-Za-z][A-Za-z0-9 /&-]{0,40}?)\s*:\s*(.+)$/, UPLOAD_VERB_RE = /^(upload|attach|add|drop)\b/i;
130371
130390
  function splitSegments(e) {
@@ -130470,15 +130489,22 @@ function QuickPromptSkeleton({ className: e = "" }) {
130470
130489
  );
130471
130490
  }
130472
130491
  function EmptyChatHero() {
130473
- return /* @__PURE__ */ jsxs(
130492
+ return /* @__PURE__ */ jsx(
130474
130493
  "div",
130475
130494
  {
130476
- className: "flex w-full flex-col items-center gap-[24px]",
130495
+ className: "flex w-full flex-col items-center gap-[10px] pt-[110px]",
130477
130496
  "data-id": "empty-chat-hero",
130478
- children: [
130479
- /* @__PURE__ */ jsx(ScCxoCopilotLogo, {}),
130480
- /* @__PURE__ */ jsx("p", { className: "w-full text-center text-[18px] leading-[26px] text-[var(--alias-text---icons-primary)]", children: "Start with a task. Review outputs. Approve." })
130481
- ]
130497
+ children: /* @__PURE__ */ jsx("h1", { className: "m-0 w-full text-center text-[24px] font-semibold leading-[32px] tracking-[-0.01em] text-[var(--alias-text---icons-primary)]", children: "Run your retail operations from here." })
130498
+ }
130499
+ );
130500
+ }
130501
+ function EmptyChatSubheading() {
130502
+ return /* @__PURE__ */ jsx(
130503
+ "p",
130504
+ {
130505
+ "data-id": "empty-chat-subheading",
130506
+ className: "m-0 w-full pt-[12px] text-center text-[14px] leading-[20px] text-[var(--alias-text---icons-tertiary)]",
130507
+ children: "Plan, design, shoot, list. You decide what moves forward."
130482
130508
  }
130483
130509
  );
130484
130510
  }
@@ -130565,27 +130591,33 @@ function EmptyChatBelow({
130565
130591
  {
130566
130592
  role: "status",
130567
130593
  "aria-label": "Loading quick prompts",
130568
- className: "flex w-full min-w-0 flex-row flex-wrap items-start justify-center gap-[16px]",
130594
+ className: "flex w-full min-w-0 flex-row flex-wrap items-stretch justify-center gap-[16px]",
130569
130595
  children: Array.from({ length: QUICK_PROMPT_SKELETON_COUNT }).map((R, T) => /* @__PURE__ */ jsx(QuickPromptSkeleton, {}, `quick-prompt-skeleton-${T}`))
130570
130596
  }
130571
130597
  ) : (
130572
130598
  // No inner scroll container even when expanded: the chat pane
130573
130599
  // above already scrolls, and clipping here would cut off the
130574
130600
  // hover panel that says what each task needs.
130575
- t.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex w-full min-w-0 flex-row flex-wrap items-start justify-center gap-[16px]", children: t.map((R) => /* @__PURE__ */ jsx(
130576
- QuickPrompt,
130601
+ t.length > 0 && /* @__PURE__ */ jsx(
130602
+ "div",
130577
130603
  {
130578
- title: R.title,
130579
- value: R.value,
130580
- description: R.description,
130581
- icon: R.icon,
130582
- hints: readBriefHints(R.meta),
130583
- apps: readBriefApps(R.meta),
130584
- onClick: (T) => o?.(R, T),
130585
- className: "flex-1 basis-[220px] min-w-[220px]"
130586
- },
130587
- `${R.title}:${R.value ?? R.title}`
130588
- )) })
130604
+ className: "flex w-full min-w-0 flex-row flex-wrap items-stretch justify-center gap-[16px]",
130605
+ children: t.map((R) => /* @__PURE__ */ jsx(
130606
+ QuickPrompt,
130607
+ {
130608
+ title: R.title,
130609
+ value: R.value,
130610
+ description: R.description,
130611
+ icon: R.icon,
130612
+ hints: readBriefHints(R.meta),
130613
+ apps: readBriefApps(R.meta),
130614
+ onClick: (T) => o?.(R, T),
130615
+ className: "flex-1 basis-[220px] min-w-[220px]"
130616
+ },
130617
+ `${R.title}:${R.value ?? R.title}`
130618
+ ))
130619
+ }
130620
+ )
130589
130621
  )
130590
130622
  ] }),
130591
130623
  /* @__PURE__ */ jsxs("div", { className: "w-full pb-[8px]", children: [
@@ -130920,6 +130952,25 @@ function BriefChips({
130920
130952
  }
130921
130953
  );
130922
130954
  }
130955
+ function normalizeSpecializationKey(e) {
130956
+ return e?.trim().toLowerCase() || null;
130957
+ }
130958
+ function briefsForRole(e, t) {
130959
+ const n = normalizeSpecializationKey(t);
130960
+ return n ? e.filter((o) => {
130961
+ const s = normalizeSpecializationKey(o.specialization_key);
130962
+ return !s || s === n;
130963
+ }) : e.filter((o) => !normalizeSpecializationKey(o.specialization_key));
130964
+ }
130965
+ const EMPTY_CHAT_BRIEF_LIMIT = 3;
130966
+ function pickEmptyChatBriefs(e, t, n = EMPTY_CHAT_BRIEF_LIMIT) {
130967
+ return e.map((o, s) => ({ brief: o, index: s })).sort((o, s) => {
130968
+ const l = +!normalizeSpecializationKey(o.brief.specialization_key) - +!normalizeSpecializationKey(s.brief.specialization_key);
130969
+ if (l !== 0) return l;
130970
+ const c = t(s.brief) - t(o.brief);
130971
+ return c !== 0 ? c : o.index - s.index;
130972
+ }).slice(0, n).map((o) => o.brief);
130973
+ }
130923
130974
  function extractClipboardImageFiles(e) {
130924
130975
  return e?.items ? Array.from(e.items).flatMap((t) => {
130925
130976
  if (t.kind !== "file" || !t.type.startsWith("image/"))
@@ -133284,7 +133335,7 @@ function MoreBriefsBrowser({
133284
133335
  const Jt = [], on = [];
133285
133336
  for (const Un of o)
133286
133337
  matchesSearch(Un, Ke) && (Un.scope_type === "user" ? on.push(Un) : Jt.push(Un));
133287
- const Vn = (Un, Gn) => Un.sort_order - Gn.sort_order || Un.title.localeCompare(Gn.title);
133338
+ const Vn = (Un, Hn) => Un.sort_order - Hn.sort_order || Un.title.localeCompare(Hn.title);
133288
133339
  return { presetBriefs: Jt.sort(Vn), customBriefs: on.sort(Vn) };
133289
133340
  }, [o, Ke]), Ge = useMemo(
133290
133341
  () => [
@@ -134573,9 +134624,6 @@ function isUserSideRow(e) {
134573
134624
  function isScrollAnchorRow(e) {
134574
134625
  return e === "user";
134575
134626
  }
134576
- function normalizeSpecializationKey(e) {
134577
- return e?.trim().toLowerCase() || null;
134578
- }
134579
134627
  function CopyContentButton({
134580
134628
  text: e,
134581
134629
  idleLabel: t,
@@ -134638,7 +134686,7 @@ function ChatScreen() {
134638
134686
  setTechpackStatus: Ke,
134639
134687
  removeBrowserSession: lt
134640
134688
  } = useChatStore(), ut = useRef(null), Ge = useRef(null), $t = useRef(n), Ve = useRef(n), _e = useRef(null), at = useRef(!0), pt = useRef(!0), St = useRef(!1), wt = useRef(null), Et = useRef(0), bt = useRef(!1), At = useRef(null), Ht = useRef([]), xt = useRef([]), gn = useRef(null), Bt = useRef(null), vn = useRef(null), Jt = useRef(!1), on = useRef(null), Vn = useRef(!1), Un = useRef(() => {
134641
- }), Gn = useRef(null), Xn = useRef(/* @__PURE__ */ new Set()), Qn = useRef(/* @__PURE__ */ new Set()), Jn = useRef([]), [Sn, nr] = useState(n);
134689
+ }), Hn = useRef(null), Xn = useRef(/* @__PURE__ */ new Set()), Qn = useRef(/* @__PURE__ */ new Set()), Jn = useRef([]), [Sn, nr] = useState(n);
134642
134690
  useEffect(() => {
134643
134691
  Qe(null);
134644
134692
  }, [Sn, Qe]);
@@ -134677,7 +134725,7 @@ function ChatScreen() {
134677
134725
  specialization_key: Yt ?? void 0
134678
134726
  });
134679
134727
  if (Ot !== yl.current) return;
134680
- const Wn = Yt ? rn.data.filter((Hn) => normalizeSpecializationKey(Hn.specialization_key) === Yt) : rn.data.filter((Hn) => !normalizeSpecializationKey(Hn.specialization_key));
134728
+ const Wn = briefsForRole(rn.data, Yt);
134681
134729
  wn(Wn.map(toPromptEntry));
134682
134730
  } catch (Yt) {
134683
134731
  if (Ot !== yl.current) return;
@@ -134728,8 +134776,8 @@ function ChatScreen() {
134728
134776
  In((Ot) => (Ot || _r(normalizeSpecializationKey(f) ?? ""), !Ot));
134729
134777
  }, [f]), bl = useCallback((Ot, Yt, rn) => {
134730
134778
  E((Wn) => dedupeMessagesByIdentity(
134731
- Wn.map((Hn) => Hn.role !== "user" || Hn.chatId !== Ot || getMessageClientMessageId(Hn) !== Yt ? Hn : {
134732
- ...Hn,
134779
+ Wn.map((Gn) => Gn.role !== "user" || Gn.chatId !== Ot || getMessageClientMessageId(Gn) !== Yt ? Gn : {
134780
+ ...Gn,
134733
134781
  request_id: rn
134734
134782
  })
134735
134783
  ));
@@ -134763,31 +134811,31 @@ function ChatScreen() {
134763
134811
  }, [Ci]), bo = useCallback((Ot, Yt) => {
134764
134812
  const rn = ut.current;
134765
134813
  if (!rn) return;
134766
- const Wn = rn.getBoundingClientRect(), Hn = Ot.element.getBoundingClientRect(), er = rn.scrollTop + (Hn.bottom - Wn.bottom);
134814
+ const Wn = rn.getBoundingClientRect(), Gn = Ot.element.getBoundingClientRect(), er = rn.scrollTop + (Gn.bottom - Wn.bottom);
134767
134815
  Ci(Math.max(0, er), Yt);
134768
134816
  }, [Ci]), Ss = useRef(() => null), Cs = useRef(() => {
134769
134817
  }), Xc = useRef(() => !0), Da = useRef(!1), Di = useCallback((Ot, Yt = !1) => {
134770
134818
  const rn = ut.current, Wn = Ge.current;
134771
134819
  if (!rn || yt.current || !Yt && !at.current) return;
134772
- const Hn = Si(Ot);
134820
+ const Gn = Si(Ot);
134773
134821
  if (Ot === "initial-load") {
134774
- kr(Hn);
134822
+ kr(Gn);
134775
134823
  return;
134776
134824
  }
134777
134825
  if (Ot === "user-submit" && Ss.current() !== null) {
134778
- Cs.current(Hn);
134826
+ Cs.current(Gn);
134779
134827
  return;
134780
134828
  }
134781
134829
  if (Ot === "follow-tail") {
134782
134830
  if (Da.current && Xc.current() && Ss.current() !== null) {
134783
- Cs.current(Hn);
134831
+ Cs.current(Gn);
134784
134832
  return;
134785
134833
  }
134786
- kr(Hn);
134834
+ kr(Gn);
134787
134835
  return;
134788
134836
  }
134789
134837
  const er = _i(Wn ?? rn, Ot);
134790
- er ? bo(er, Hn) : kr(Hn);
134838
+ er ? bo(er, Gn) : kr(Gn);
134791
134839
  }, [Si, _i, bo, kr]), wl = useCallback((Ot) => Ot === "follow-tail" ? 0 : Ot === "initial-load" ? 1 : Ot === "form-close" ? 2 : Ot === "user-submit" ? 3 : 4, []), Us = useCallback(() => {
134792
134840
  vn.current = null, gn.current !== null && (window.clearTimeout(gn.current), gn.current = null), Bt.current !== null && (window.cancelAnimationFrame(Bt.current), Bt.current = null);
134793
134841
  }, []);
@@ -134797,30 +134845,30 @@ function ChatScreen() {
134797
134845
  if (Wn !== null && wl(Wn) > rn)
134798
134846
  return;
134799
134847
  vn.current = Ot, gn.current !== null && (window.clearTimeout(gn.current), gn.current = null), Bt.current !== null && (window.cancelAnimationFrame(Bt.current), Bt.current = null);
134800
- const Hn = () => {
134848
+ const Gn = () => {
134801
134849
  Bt.current = window.requestAnimationFrame(() => {
134802
134850
  Bt.current = null, vn.current = null, Di(Ot, Yt?.force ?? !1);
134803
134851
  });
134804
134852
  };
134805
134853
  if (Yt?.delayMs && Yt.delayMs > 0) {
134806
134854
  gn.current = window.setTimeout(() => {
134807
- gn.current = null, Hn();
134855
+ gn.current = null, Gn();
134808
134856
  }, Yt.delayMs);
134809
134857
  return;
134810
134858
  }
134811
- Hn();
134859
+ Gn();
134812
134860
  }, [Di]), _l = useCallback(() => {
134813
134861
  Ht.current.forEach((Ot) => window.clearTimeout(Ot)), xt.current.forEach((Ot) => window.cancelAnimationFrame(Ot)), Ht.current = [], xt.current = [];
134814
134862
  }, []), ks = useCallback((Ot) => {
134815
134863
  _l(), pt.current = !0, Et.current = Date.now() + FORM_SCROLL_SUPPRESS_MS, (Ot === "form-open" ? [0, FORM_LAYOUT_SETTLE_MS] : [0, FORM_LAYOUT_SETTLE_MS, FORM_LAYOUT_SETTLE_MS * 2]).forEach((rn) => {
134816
134864
  const Wn = window.setTimeout(() => {
134817
- const Hn = window.requestAnimationFrame(() => {
134865
+ const Gn = window.requestAnimationFrame(() => {
134818
134866
  const er = window.requestAnimationFrame(() => {
134819
134867
  Di(Ot, !0), xt.current = xt.current.filter((hr) => hr !== er);
134820
134868
  });
134821
- xt.current.push(er), xt.current = xt.current.filter((hr) => hr !== Hn);
134869
+ xt.current.push(er), xt.current = xt.current.filter((hr) => hr !== Gn);
134822
134870
  });
134823
- xt.current.push(Hn), Ht.current = Ht.current.filter((er) => er !== Wn);
134871
+ xt.current.push(Gn), Ht.current = Ht.current.filter((er) => er !== Wn);
134824
134872
  }, rn);
134825
134873
  Ht.current.push(Wn);
134826
134874
  });
@@ -134900,12 +134948,12 @@ function ChatScreen() {
134900
134948
  try {
134901
134949
  const Wn = await loadChat(o, Ot);
134902
134950
  if ($t.current !== Ot) return;
134903
- const Hn = hasArtifaxDreamerCanvas(
134951
+ const Gn = hasArtifaxDreamerCanvas(
134904
134952
  Wn
134905
134953
  ), er = hasTechpackPane(
134906
134954
  Wn
134907
134955
  );
134908
- if (Hn ? oe(Ot, "loading") : Bo?.active || oe(Ot, null), er ? Ke("loading") : Ae?.active || Ke(null), E(
134956
+ if (Gn ? oe(Ot, "loading") : Bo?.active || oe(Ot, null), er ? Ke("loading") : Ae?.active || Ke(null), E(
134909
134957
  (hr) => mergeHydratedMessages(
134910
134958
  hr,
134911
134959
  Wn,
@@ -134955,14 +135003,14 @@ function ChatScreen() {
134955
135003
  } else
134956
135004
  Oe(null);
134957
135005
  if (rn.length === 0) return;
134958
- const Hn = [];
135006
+ const Gn = [];
134959
135007
  for (const er of rn) {
134960
135008
  const hr = uuidv7(), Tr = er.type.startsWith("image/");
134961
135009
  let La;
134962
- Tr && (La = URL.createObjectURL(er)), Hn.push({ id: hr, file: er, previewUrl: La, isImage: Tr, uploadStatus: "pending" });
135010
+ Tr && (La = URL.createObjectURL(er)), Gn.push({ id: hr, file: er, previewUrl: La, isImage: Tr, uploadStatus: "pending" });
134963
135011
  }
134964
- gt((er) => [...er, ...Hn]);
134965
- for (const er of Hn) {
135012
+ gt((er) => [...er, ...Gn]);
135013
+ for (const er of Gn) {
134966
135014
  if (!o) continue;
134967
135015
  gt((Tr) => Tr.map((La) => La.id === er.id ? { ...La, uploadStatus: "uploading" } : La));
134968
135016
  const hr = new FormData();
@@ -134991,26 +135039,26 @@ function ChatScreen() {
134991
135039
  if (!o || !s || !l || Zt) return;
134992
135040
  const rn = Ot.trim();
134993
135041
  if (!rn) return;
134994
- const Wn = Yt?.forceNewConversation ?? !1, Hn = Wn ? uuidv7() : Sn || uuidv7(), er = Wn || !Sn, hr = uuidv7();
134995
- er && (_e.current = { chatId: Hn }, po.current = !0);
135042
+ const Wn = Yt?.forceNewConversation ?? !1, Gn = Wn ? uuidv7() : Sn || uuidv7(), er = Wn || !Sn, hr = uuidv7();
135043
+ er && (_e.current = { chatId: Gn }, po.current = !0);
134996
135044
  const Tr = {
134997
135045
  id: `opt-${Date.now()}`,
134998
135046
  client_message_id: hr,
134999
135047
  role: "user",
135000
135048
  type: "message",
135001
135049
  content: rn,
135002
- chatId: Hn
135050
+ chatId: Gn
135003
135051
  };
135004
135052
  hn(!0);
135005
135053
  try {
135006
135054
  E((Ks) => [...Ks, Tr]), at.current = !0, pt.current = !0, yt.current = !1, ze(!1), requestAnimationFrame(() => {
135007
135055
  Rt.current(), ut.current?.scrollHeight, Ja("user-submit", { force: !0, delayMs: 150 });
135008
- }), Yt?.clearComposer && Kt(""), Yt?.clearPendingFiles && gt([]), ka(Hn), er && t(Hn), await Ga(Hn);
135056
+ }), Yt?.clearComposer && Kt(""), Yt?.clearPendingFiles && gt([]), ka(Gn), er && t(Gn), await Ga(Gn);
135009
135057
  const Xa = await (await sendMessageToAgent(
135010
135058
  o,
135011
135059
  s,
135012
135060
  l,
135013
- Hn,
135061
+ Gn,
135014
135062
  rn,
135015
135063
  !1,
135016
135064
  {
@@ -135021,7 +135069,7 @@ function ChatScreen() {
135021
135069
  widgetMode: h
135022
135070
  }
135023
135071
  )).clone().json().catch(() => null);
135024
- Xa?.request_id && (bl(Hn, hr, Xa.request_id), ka(Hn, Xa.request_id));
135072
+ Xa?.request_id && (bl(Gn, hr, Xa.request_id), ka(Gn, Xa.request_id));
135025
135073
  } catch (La) {
135026
135074
  console.error("sendMessageToAgent failed", La);
135027
135075
  } finally {
@@ -135045,12 +135093,12 @@ function ChatScreen() {
135045
135093
  bl
135046
135094
  ]), Ld = useCallback(async (Ot, Yt) => {
135047
135095
  const rn = Yt || Ot;
135048
- if (!(Gn.current || Zt)) {
135049
- Gn.current = rn, qn(rn);
135096
+ if (!(Hn.current || Zt)) {
135097
+ Hn.current = rn, qn(rn);
135050
135098
  try {
135051
135099
  await ts(Ot);
135052
135100
  } finally {
135053
- Gn.current = null, qn(null);
135101
+ Hn.current = null, qn(null);
135054
135102
  }
135055
135103
  }
135056
135104
  }, [Zt, ts]);
@@ -135142,25 +135190,28 @@ function ChatScreen() {
135142
135190
  vt(!1), _t("general"), Mt(!1), Ut(!1), Vs();
135143
135191
  }, [Vs]), ns = useMemo(() => {
135144
135192
  const Ot = b.filter(
135145
- (Hn) => (!Sn || !Hn.chatId || Hn.chatId === Sn) && !Hn.hidden && Hn.type !== "thinking"
135193
+ (Gn) => (!Sn || !Gn.chatId || Gn.chatId === Sn) && !Gn.hidden && Gn.type !== "thinking"
135146
135194
  ), Yt = dedupeMessagesByIdentity(Ot), Wn = [...Yt];
135147
135195
  if (ki) {
135148
- for (let Hn = Wn.length - 1; Hn >= 0 && Wn[Hn].role !== "user"; Hn--)
135149
- if (Wn[Hn].role === "assistant" && Wn[Hn].type === "message" && !Wn[Hn].additional_kwargs?.ui_components) {
135150
- Wn.splice(Hn, 1);
135196
+ for (let Gn = Wn.length - 1; Gn >= 0 && Wn[Gn].role !== "user"; Gn--)
135197
+ if (Wn[Gn].role === "assistant" && Wn[Gn].type === "message" && !Wn[Gn].additional_kwargs?.ui_components) {
135198
+ Wn.splice(Gn, 1);
135151
135199
  break;
135152
135200
  }
135153
135201
  }
135154
135202
  return Wn;
135155
- }, [b, ki, Sn]), tu = En ? sr : Wt.filter((Ot) => Ot.show_in_empty_chat), Fu = En || Wt.some((Ot) => !Ot.show_in_empty_chat), Ws = useMemo(
135203
+ }, [b, ki, Sn]), tu = En ? sr : pickEmptyChatBriefs(
135204
+ Wt.filter((Ot) => Ot.show_in_empty_chat),
135205
+ (Ot) => readBriefApps(Ot.meta).length
135206
+ ), Fu = En || Wt.some((Ot) => !Ot.show_in_empty_chat), Ws = useMemo(
135156
135207
  () => ur.map((Ot) => ({ id: Ot.key, label: Ot.label })),
135157
135208
  [ur]
135158
135209
  ), ia = useMemo(() => {
135159
135210
  const Ot = [];
135160
135211
  let Yt = null;
135161
135212
  return ns.forEach((rn, Wn) => {
135162
- const Hn = getMessageRequestId(rn);
135163
- rn.role === "user" ? Yt = Hn ?? `optimistic:${String(rn.id ?? rn.message_db_id ?? Wn)}` : Hn ? Yt = Hn : Yt || (Yt = `turn:${Wn}`);
135213
+ const Gn = getMessageRequestId(rn);
135214
+ rn.role === "user" ? Yt = Gn ?? `optimistic:${String(rn.id ?? rn.message_db_id ?? Wn)}` : Gn ? Yt = Gn : Yt || (Yt = `turn:${Wn}`);
135164
135215
  const er = {
135165
135216
  ...rn,
135166
135217
  __turnKey: Yt
@@ -135181,8 +135232,8 @@ function ChatScreen() {
135181
135232
  for (const Wn of String(Yt.content ?? "").split(`
135182
135233
  `))
135183
135234
  try {
135184
- const Hn = JSON.parse(Wn.trim());
135185
- Hn?.event === "END" && (Hn.id || Hn.message) && rn.add(Hn.id ?? Hn.message);
135235
+ const Gn = JSON.parse(Wn.trim());
135236
+ Gn?.event === "END" && (Gn.id || Gn.message) && rn.add(Gn.id ?? Gn.message);
135186
135237
  } catch {
135187
135238
  }
135188
135239
  }
@@ -135190,13 +135241,13 @@ function ChatScreen() {
135190
135241
  }, [ia]), El = useMemo(() => {
135191
135242
  const Ot = /* @__PURE__ */ new Map(), Yt = /* @__PURE__ */ new Map();
135192
135243
  return ia.forEach((rn, Wn) => {
135193
- let Hn = Yt.get(rn.__turnKey);
135194
- if (Hn || (Hn = /* @__PURE__ */ new Set(), Yt.set(rn.__turnKey, Hn)), Ot.set(Wn, new Set(Hn)), rn.type === "reasoning")
135244
+ let Gn = Yt.get(rn.__turnKey);
135245
+ if (Gn || (Gn = /* @__PURE__ */ new Set(), Yt.set(rn.__turnKey, Gn)), Ot.set(Wn, new Set(Gn)), rn.type === "reasoning")
135195
135246
  for (const er of String(rn.content ?? "").split(`
135196
135247
  `))
135197
135248
  try {
135198
135249
  const hr = JSON.parse(er.trim());
135199
- hr?.event === "START" && (hr.id || hr.message) && Hn.add(hr.id ?? hr.message);
135250
+ hr?.event === "START" && (hr.id || hr.message) && Gn.add(hr.id ?? hr.message);
135200
135251
  } catch {
135201
135252
  }
135202
135253
  }), Ot;
@@ -135210,9 +135261,9 @@ function ChatScreen() {
135210
135261
  if (Ot.has(Wn)) continue;
135211
135262
  Ot.add(Wn);
135212
135263
  }
135213
- const Hn = getUIComponent(rn), er = Hn?.name;
135214
- if (!er || Hn?.submitted || Hn?.submitted_values) continue;
135215
- const hr = Hn?.props || {};
135264
+ const Gn = getUIComponent(rn), er = Gn?.name;
135265
+ if (!er || Gn?.submitted || Gn?.submitted_values) continue;
135266
+ const hr = Gn?.props || {};
135216
135267
  if (DISPLAY_ONLY_COMPONENTS.has(er) && hr.resume === !0 || !DISPLAY_ONLY_COMPONENTS.has(er) && INPUT_BLOCKING_COMPONENTS.has(er))
135217
135268
  return rn;
135218
135269
  }
@@ -135232,7 +135283,7 @@ function ChatScreen() {
135232
135283
  }, [ia]), eo = useMemo(() => {
135233
135284
  const Ot = [];
135234
135285
  return ia.forEach((Yt, rn) => {
135235
- const Wn = String(Yt.id ?? Yt.message_db_id ?? rn), Hn = getUIComponent(Yt), er = !!(Hn?.submitted || Hn?.submitted_values), hr = !!Hn && Yt !== Xr;
135286
+ const Wn = String(Yt.id ?? Yt.message_db_id ?? rn), Gn = getUIComponent(Yt), er = !!(Gn?.submitted || Gn?.submitted_values), hr = !!Gn && Yt !== Xr;
135236
135287
  if (Yt.type === "reasoning") {
135237
135288
  Ot.push({
135238
135289
  key: `${Wn}-reasoning`,
@@ -135259,7 +135310,7 @@ function ChatScreen() {
135259
135310
  message: Yt,
135260
135311
  sourceIndex: rn,
135261
135312
  turnKey: Yt.__turnKey
135262
- }), hr && er && !RECEIPT_BEARING_COMPONENTS.has(String(Hn?.name ?? "")) && Ot.push({
135313
+ }), hr && er && !RECEIPT_BEARING_COMPONENTS.has(String(Gn?.name ?? "")) && Ot.push({
135263
135314
  key: `${Wn}-submitted`,
135264
135315
  kind: "submitted",
135265
135316
  message: Yt,
@@ -135272,10 +135323,10 @@ function ChatScreen() {
135272
135323
  for (const Yt of ia) {
135273
135324
  const rn = getUIComponent(Yt), Wn = rn?.name;
135274
135325
  if (!Wn || !registry.isSidePaneComponent(Wn) || rn?.submitted || rn?.submitted_values) continue;
135275
- const Hn = String(Yt.message_db_id ?? Yt.id ?? "");
135276
- if (!Hn) continue;
135326
+ const Gn = String(Yt.message_db_id ?? Yt.id ?? "");
135327
+ if (!Gn) continue;
135277
135328
  const er = rn?.props || {}, hr = registry.lookup(Wn), Tr = typeof er.title == "string" && er.title.trim() || hr?.panelTitle || "Panel";
135278
- Ot.push({ messageId: Hn, name: Wn, title: Tr });
135329
+ Ot.push({ messageId: Gn, name: Wn, title: Tr });
135279
135330
  }
135280
135331
  return Ot;
135281
135332
  }, [ia]), z = useMemo(() => {
@@ -135284,7 +135335,7 @@ function ChatScreen() {
135284
135335
  if (!isAssistantMedia(Yt)) continue;
135285
135336
  const { items: rn } = collectMessageMedia(Yt);
135286
135337
  if (rn.length === 0) continue;
135287
- const Wn = rn.filter((Hn) => Hn.isImage || Hn.isVideo);
135338
+ const Wn = rn.filter((Gn) => Gn.isImage || Gn.isVideo);
135288
135339
  Wn.length !== 0 && Ot.push({
135289
135340
  messageId: mediaSourceId(Yt),
135290
135341
  items: rn,
@@ -135302,14 +135353,14 @@ function ChatScreen() {
135302
135353
  }, [ia]), Fe = useCallback(
135303
135354
  (Ot, Yt, rn) => {
135304
135355
  if (!Sn || Ot.length === 0) return;
135305
- const Wn = mediaPanelId(Yt), Hn = Ot.map((er, hr) => ({
135356
+ const Wn = mediaPanelId(Yt), Gn = Ot.map((er, hr) => ({
135306
135357
  id: er.id ?? `${Yt}-${hr}`,
135307
135358
  url: er.url,
135308
135359
  name: er.name
135309
135360
  }));
135310
135361
  nt((er) => {
135311
135362
  const hr = new Map(er);
135312
- return hr.set(Wn, { images: Hn, onRemoveImage: rn }), hr;
135363
+ return hr.set(Wn, { images: Gn, onRemoveImage: rn }), hr;
135313
135364
  });
135314
135365
  for (const er of useChatStore.getState().panels)
135315
135366
  er.kind === "media" && er.chatId === Sn && er.id !== Wn && (qe(er.id), nt((hr) => {
@@ -135363,12 +135414,12 @@ function ChatScreen() {
135363
135414
  (Ot) => {
135364
135415
  if (!Ot || !Sn) return;
135365
135416
  const Yt = z.find(
135366
- (Hn) => Hn.messageId === mediaSourceId(Ot)
135417
+ (Gn) => Gn.messageId === mediaSourceId(Ot)
135367
135418
  );
135368
135419
  if (!Yt) return;
135369
135420
  const rn = mediaPanelId(Yt.messageId);
135370
135421
  return {
135371
- showing: Me.some((Hn) => Hn.id === rn) && Ie === rn,
135422
+ showing: Me.some((Gn) => Gn.id === rn) && Ie === rn,
135372
135423
  onOpen: () => Fe(Yt.items, Yt.messageId),
135373
135424
  onClose: () => qe(rn)
135374
135425
  };
@@ -135599,8 +135650,8 @@ function ChatScreen() {
135599
135650
  Er
135600
135651
  ]), Ts = useRef(!1);
135601
135652
  useEffect(() => {
135602
- const Ot = Ts.current, Yt = !!Xr, rn = wt.current, Wn = typeof rn?.id == "string" ? rn.id : typeof rn?.message_db_id == "string" ? rn.message_db_id : void 0, Hn = typeof Xr?.id == "string" ? Xr.id : typeof Xr?.message_db_id == "string" ? Xr.message_db_id : void 0;
135603
- !Ot && Yt ? (bt.current = !1, At.current = null, ks("form-open")) : Ot && !Yt ? (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close")) : Ot && Yt && Wn !== Hn && (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close"), ks("form-open")), Ts.current = Yt, wt.current = Xr;
135653
+ const Ot = Ts.current, Yt = !!Xr, rn = wt.current, Wn = typeof rn?.id == "string" ? rn.id : typeof rn?.message_db_id == "string" ? rn.message_db_id : void 0, Gn = typeof Xr?.id == "string" ? Xr.id : typeof Xr?.message_db_id == "string" ? Xr.message_db_id : void 0;
135654
+ !Ot && Yt ? (bt.current = !1, At.current = null, ks("form-open")) : Ot && !Yt ? (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close")) : Ot && Yt && Wn !== Gn && (at.current = !0, bt.current = !0, At.current = typeof rn?.__turnKey == "string" && rn.__turnKey ? rn.__turnKey : null, Sn && ka(Sn), ks("form-close"), ks("form-open")), Ts.current = Yt, wt.current = Xr;
135604
135655
  }, [Xr, Sn, ka, ks]), useEffect(() => {
135605
135656
  if (xa) {
135606
135657
  At.current = null;
@@ -135619,9 +135670,9 @@ function ChatScreen() {
135619
135670
  bt.current = !1;
135620
135671
  const rn = window.requestAnimationFrame(() => {
135621
135672
  const Wn = window.requestAnimationFrame(() => {
135622
- Di("form-close", !0), xt.current = xt.current.filter((Hn) => Hn !== Wn);
135673
+ Di("form-close", !0), xt.current = xt.current.filter((Gn) => Gn !== Wn);
135623
135674
  });
135624
- xt.current.push(Wn), xt.current = xt.current.filter((Hn) => Hn !== rn);
135675
+ xt.current.push(Wn), xt.current = xt.current.filter((Gn) => Gn !== rn);
135625
135676
  });
135626
135677
  xt.current.push(rn);
135627
135678
  }, [
@@ -135657,8 +135708,8 @@ function ChatScreen() {
135657
135708
  Yt.style.height = "0px";
135658
135709
  return;
135659
135710
  }
135660
- const Hn = rn.scrollHeight - Yt.offsetHeight - Wn;
135661
- Yt.style.height = `${Math.max(0, Ot.clientHeight - Hn - 28)}px`;
135711
+ const Gn = rn.scrollHeight - Yt.offsetHeight - Wn;
135712
+ Yt.style.height = `${Math.max(0, Ot.clientHeight - Gn - 28)}px`;
135662
135713
  }, [qa]), Yr = useCallback(() => {
135663
135714
  const Ot = ut.current, Yt = Ze.current, rn = Ge.current;
135664
135715
  if (!Ot || !rn) return !0;
@@ -135674,8 +135725,8 @@ function ChatScreen() {
135674
135725
  if (!Ot) return;
135675
135726
  const rn = Ot.scrollHeight - Ot.scrollTop - Ot.clientHeight < 100;
135676
135727
  at.current = rn;
135677
- const Wn = qa(), Hn = Wn !== null && Math.abs(Ot.scrollTop - Wn) <= 14;
135678
- (rn || Hn) && (yt.current = !1, pt.current = !0), je.current();
135728
+ const Wn = qa(), Gn = Wn !== null && Math.abs(Ot.scrollTop - Wn) <= 14;
135729
+ (rn || Gn) && (yt.current = !1, pt.current = !0), je.current();
135679
135730
  }, [qa]), Ys = useCallback((Ot) => {
135680
135731
  const Yt = ut.current;
135681
135732
  if (!Yt || Yt.scrollHeight - Yt.clientHeight <= 8) return;
@@ -135853,7 +135904,7 @@ function ChatScreen() {
135853
135904
  className: `max-w-[1020px] mx-auto flex flex-col gap-10 ${Ea ? "hidden" : ""} ${Lt ? "pb-[56px]" : ""}`,
135854
135905
  children: [
135855
135906
  ii.map((Ot, Yt) => {
135856
- const rn = Ot.message, Wn = rn?.type, Hn = String(rn?.content ?? ""), er = !!gi && Ot.turnKey === gi, hr = !!Ot.message?.additional_kwargs?.ui_components, Tr = er ? hr ? !0 : "position" : !1, La = Yt > 0 ? getRowSpeaker(ii[Yt - 1].kind) : null, Xa = (() => {
135907
+ const rn = Ot.message, Wn = rn?.type, Gn = String(rn?.content ?? ""), er = !!gi && Ot.turnKey === gi, hr = !!Ot.message?.additional_kwargs?.ui_components, Tr = er ? hr ? !0 : "position" : !1, La = Yt > 0 ? getRowSpeaker(ii[Yt - 1].kind) : null, Xa = (() => {
135857
135908
  if (isUserSideRow(Ot.kind))
135858
135909
  return La !== getRowSpeaker(Ot.kind);
135859
135910
  for (let Jr = Yt + 1; Jr < ii.length; Jr++)
@@ -135870,7 +135921,7 @@ function ChatScreen() {
135870
135921
  (Jr) => Jr.kind === "reasoning" && Jr.turnKey === Ot.turnKey
135871
135922
  ), Id = Ot.kind === "reasoning" && hasDisplayOnlyUIComponent(rn);
135872
135923
  if (Ot.kind === "reasoning")
135873
- return !(la && Zs || traceHasContent(Hn, El.get(Ot.sourceIndex))) && !Id ? null : /* @__PURE__ */ jsx(
135924
+ return !(la && Zs || traceHasContent(Gn, El.get(Ot.sourceIndex))) && !Id ? null : /* @__PURE__ */ jsx(
135874
135925
  motion$1.div,
135875
135926
  {
135876
135927
  layout: Tr,
@@ -135880,7 +135931,7 @@ function ChatScreen() {
135880
135931
  /* @__PURE__ */ jsx(
135881
135932
  AgentSteps,
135882
135933
  {
135883
- content: Hn,
135934
+ content: Gn,
135884
135935
  isLoading: la && Zs,
135885
135936
  completedStepIds: uo.get(Ot.turnKey ?? ""),
135886
135937
  previouslyStartedIds: El.get(Ot.sourceIndex),
@@ -135929,7 +135980,7 @@ function ChatScreen() {
135929
135980
  /* @__PURE__ */ jsx(
135930
135981
  CopyContentButton,
135931
135982
  {
135932
- text: Hn,
135983
+ text: Gn,
135933
135984
  idleLabel: "Copy message",
135934
135985
  successLabel: "Message copied"
135935
135986
  }
@@ -136066,7 +136117,7 @@ function ChatScreen() {
136066
136117
  leadingAction: /* @__PURE__ */ jsx(
136067
136118
  CopyContentButton,
136068
136119
  {
136069
- text: Hn,
136120
+ text: Gn,
136070
136121
  idleLabel: "Copy markdown",
136071
136122
  successLabel: "Markdown copied"
136072
136123
  }
@@ -136237,25 +136288,28 @@ function ChatScreen() {
136237
136288
  ]
136238
136289
  }
136239
136290
  ),
136240
- Ea && /* @__PURE__ */ jsx("div", { className: "mb-auto shrink-0 overflow-visible px-3 pb-4 sm:px-6", children: /* @__PURE__ */ jsx("div", { className: "mx-auto w-full max-w-[800px]", children: /* @__PURE__ */ jsx(
136241
- EmptyChatBelow,
136242
- {
136243
- quickPrompts: tu.map((Ot) => ({
136244
- title: Ot.title,
136245
- description: Ot.text,
136246
- value: Ot.text,
136247
- meta: Ot.meta
136248
- })),
136249
- isLoadingQuickPrompts: En ? br : Tn,
136250
- onPromptCardClick: rp,
136251
- onToggleQuickPrompts: Fu ? Gc : void 0,
136252
- onManageQuickPromptsClick: Pu,
136253
- quickPromptsExpanded: En,
136254
- quickPromptRoles: Ws,
136255
- activeQuickPromptRole: ta,
136256
- onQuickPromptRoleChange: _r
136257
- }
136258
- ) }) })
136291
+ Ea && /* @__PURE__ */ jsx("div", { className: "mb-auto shrink-0 overflow-visible px-3 pb-4 sm:px-6", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto w-full max-w-[800px]", children: [
136292
+ /* @__PURE__ */ jsx(EmptyChatSubheading, {}),
136293
+ /* @__PURE__ */ jsx(
136294
+ EmptyChatBelow,
136295
+ {
136296
+ quickPrompts: tu.map((Ot) => ({
136297
+ title: Ot.title,
136298
+ description: Ot.text,
136299
+ value: Ot.text,
136300
+ meta: Ot.meta
136301
+ })),
136302
+ isLoadingQuickPrompts: En ? br : Tn,
136303
+ onPromptCardClick: rp,
136304
+ onToggleQuickPrompts: Fu ? Gc : void 0,
136305
+ onManageQuickPromptsClick: Pu,
136306
+ quickPromptsExpanded: En,
136307
+ quickPromptRoles: Ws,
136308
+ activeQuickPromptRole: ta,
136309
+ onQuickPromptRoleChange: _r
136310
+ }
136311
+ )
136312
+ ] }) })
136259
136313
  ]
136260
136314
  }
136261
136315
  ),