react-semaphor 0.1.374 → 0.1.376

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 (49) hide show
  1. package/dist/brand-studio/index.cjs +2 -7
  2. package/dist/brand-studio/index.js +94 -106
  3. package/dist/chunks/{calendar-preferences-dialog-DmBRXOH6.js → calendar-preferences-dialog-B6fsethx.js} +3 -3
  4. package/dist/chunks/{calendar-preferences-dialog-94DoRSW_.js → calendar-preferences-dialog-Dh1b0ytN.js} +1 -1
  5. package/dist/chunks/{chevrons-up-down-CnCSGY02.js → chevrons-up-down-D2fZD4N_.js} +1 -1
  6. package/dist/chunks/{chevrons-up-down-DSvLu4Ye.js → chevrons-up-down-lahj6tQy.js} +1 -1
  7. package/dist/chunks/{dashboard-briefing-launcher-l0ylhcAv.js → dashboard-briefing-launcher-BKCRO7Qw.js} +597 -589
  8. package/dist/chunks/{dashboard-briefing-launcher-CAFCkwG3.js → dashboard-briefing-launcher-Gv1cwT0I.js} +13 -8
  9. package/dist/chunks/dashboard-controls-BDJZarV7.js +52 -0
  10. package/dist/chunks/dashboard-controls-CchLBVDv.js +3037 -0
  11. package/dist/chunks/{dashboard-json-B8kke4ES.js → dashboard-json-QT0T2ad_.js} +2 -2
  12. package/dist/chunks/{dashboard-json-BlPA6wRT.js → dashboard-json-ZhIEMXN0.js} +1 -1
  13. package/dist/chunks/edit-dashboard-visual-DNzPgXMh.js +178 -0
  14. package/dist/chunks/{edit-dashboard-visual-CgJxTZLJ.js → edit-dashboard-visual-kNoMQRmH.js} +4413 -4330
  15. package/dist/chunks/{index-BJ971AL_.js → index-CPpqPJba.js} +185 -180
  16. package/dist/chunks/{index-BiDFY4Gr.js → index-DX_0OcRv.js} +24419 -24257
  17. package/dist/chunks/layout-grid-BOTLt36V.js +36 -0
  18. package/dist/chunks/layout-grid-CS6BSCJF.js +11 -0
  19. package/dist/chunks/{palette-D-f4-82S.js → palette-2HWSR5wb.js} +1 -1
  20. package/dist/chunks/{palette-DUGktM-M.js → palette-BcHHAmOU.js} +1 -1
  21. package/dist/chunks/{save-kkBEBeLg.js → save-B-YfAPhu.js} +1 -1
  22. package/dist/chunks/{save-D3YYinDz.js → save-MoF1T13_.js} +1 -1
  23. package/dist/chunks/switch-CmHP5dT7.js +168 -0
  24. package/dist/chunks/{switch-Dkx2qEOr.js → switch-DmE_MY3L.js} +2001 -1982
  25. package/dist/chunks/use-create-flow-overlay-state-BLPQgGuz.js +21 -0
  26. package/dist/chunks/use-create-flow-overlay-state-D_Ntx-_C.js +1967 -0
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/data-app-builder/index.cjs +18 -13
  30. package/dist/data-app-builder/index.js +141 -131
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.js +61 -63
  33. package/dist/style.css +1 -1
  34. package/dist/surfboard/index.cjs +1 -1
  35. package/dist/surfboard/index.js +2 -2
  36. package/dist/types/main.d.ts +1 -12
  37. package/package.json +1 -1
  38. package/dist/chunks/braces-C3-w6xDL.js +0 -6
  39. package/dist/chunks/braces-C8QqW4wu.js +0 -23
  40. package/dist/chunks/dashboard-controls-BX47yuCH.js +0 -57
  41. package/dist/chunks/dashboard-controls-DyzG0r5f.js +0 -2269
  42. package/dist/chunks/edit-dashboard-visual-DA8SaE4h.js +0 -178
  43. package/dist/chunks/resource-management-panel-Bssc5uaX.js +0 -1018
  44. package/dist/chunks/resource-management-panel-C14F7VSc.js +0 -6
  45. package/dist/chunks/switch-fIkmwzUt.js +0 -168
  46. package/dist/chunks/use-create-flow-overlay-state-BGhwg121.js +0 -1647
  47. package/dist/chunks/use-create-flow-overlay-state-DAVI3fO1.js +0 -26
  48. package/dist/chunks/use-visual-utils-47dkDwLK.js +0 -340
  49. package/dist/chunks/use-visual-utils-K0yQRSI7.js +0 -1
@@ -1,18 +1,18 @@
1
1
  import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
2
2
  import * as Yn from "react";
3
- import { useContext as Zn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
3
+ import { useContext as Zn, useState as x, useRef as oe, useMemo as ze, useEffect as W, useCallback as Ot } from "react";
4
4
  import * as Xn from "react-dom/client";
5
- import { al as ea, am as ta, an as Lr, ao as jr, ap as zr, aq as ra, ar as Wr, as as Hr, at as Jr, au as Vr, av as _r, aw as Ur, ax as Gr, ay as na, az as aa, aA as oa, aB as sa, aC as Ht, aD as on, w as Kr, aE as ia, aF as Vt, aG as _t, aH as sn, aI as la, aJ as da, aK as ca } from "../chunks/index-BiDFY4Gr.js";
6
- import { c as Ve, B as H, P as it, b as lt, d as dt, a2 as ua, a3 as pa, a4 as ha, a5 as ma, a6 as fa, X as He, f as me, R as ga, e as Ut } from "../chunks/switch-Dkx2qEOr.js";
5
+ import { ad as ea, ae as ta, af as Ir, ag as jr, ah as zr, ai as ra, aj as Wr, ak as Hr, al as Jr, am as Vr, an as _r, ao as Ur, ap as Gr, aq as na, ar as aa, as as oa, at as Ht, au as on, w as Kr, av as sa, aw as Vt, ax as _t, ay as sn, az as ia, aA as la, aB as da } from "../chunks/index-DX_0OcRv.js";
6
+ import { c as $e, B as H, P as it, b as lt, d as dt, a1 as ca, a2 as ua, a3 as pa, a4 as ha, a5 as ma, X as Je, f as me, R as fa, e as Ut } from "../chunks/switch-DmE_MY3L.js";
7
7
  import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
8
- import { S as ba } from "../chunks/save-kkBEBeLg.js";
8
+ import { S as ga } from "../chunks/save-B-YfAPhu.js";
9
9
  /**
10
10
  * @license lucide-react v0.453.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- const xa = Ve("CloudUpload", [
15
+ const ba = $e("CloudUpload", [
16
16
  ["path", { d: "M12 13v8", key: "1l5pq0" }],
17
17
  ["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
18
18
  ["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
@@ -23,7 +23,7 @@ const xa = Ve("CloudUpload", [
23
23
  * This source code is licensed under the ISC license.
24
24
  * See the LICENSE file in the root directory of this source tree.
25
25
  */
26
- const wa = Ve("Folder", [
26
+ const xa = $e("Folder", [
27
27
  [
28
28
  "path",
29
29
  {
@@ -38,7 +38,7 @@ const wa = Ve("Folder", [
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
40
  */
41
- const ya = Ve("ImagePlus", [
41
+ const wa = $e("ImagePlus", [
42
42
  ["path", { d: "M16 5h6", key: "1vod17" }],
43
43
  ["path", { d: "M19 2v6", key: "4bpg5p" }],
44
44
  ["path", { d: "M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5", key: "1ue2ih" }],
@@ -51,7 +51,7 @@ const ya = Ve("ImagePlus", [
51
51
  * This source code is licensed under the ISC license.
52
52
  * See the LICENSE file in the root directory of this source tree.
53
53
  */
54
- const va = Ve("MousePointer2", [
54
+ const ya = $e("MousePointer2", [
55
55
  [
56
56
  "path",
57
57
  {
@@ -66,10 +66,20 @@ const va = Ve("MousePointer2", [
66
66
  * This source code is licensed under the ISC license.
67
67
  * See the LICENSE file in the root directory of this source tree.
68
68
  */
69
- const ka = Ve("PanelLeftClose", [
69
+ const va = $e("PanelLeftClose", [
70
70
  ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
71
71
  ["path", { d: "M9 3v18", key: "fh3hqa" }],
72
72
  ["path", { d: "m16 15-3-3 3-3", key: "14y99z" }]
73
+ ]);
74
+ /**
75
+ * @license lucide-react v0.453.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */
80
+ const ka = $e("PanelLeft", [
81
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
82
+ ["path", { d: "M9 3v18", key: "fh3hqa" }]
73
83
  ]), Na = [
74
84
  {
75
85
  id: "customer-health",
@@ -149,7 +159,7 @@ const ka = Ve("PanelLeftClose", [
149
159
  reasoningEffort: "low"
150
160
  },
151
161
  { id: "gpt-4.1-mini", label: "GPT-4.1 mini", model: "gpt-4.1-mini" }
152
- ], Qr = "semaphor-data-app-builder-transcript", qr = "semaphor-data-app-builder-preview-url", Yr = "semaphor-data-app-builder-bridge-url", Zr = "semaphor-data-app-builder-project-dir", It = "http://semaphor-data-app.localhost:8088", Xr = "http://localhost:8787", Lt = "/Users/rohit/code/sandbox/semaphor-data-apps/data-app", ze = 3, Aa = 18, jt = 12;
162
+ ], Qr = "semaphor-data-app-builder-transcript", qr = "semaphor-data-app-builder-preview-url", Yr = "semaphor-data-app-builder-bridge-url", Zr = "semaphor-data-app-builder-project-dir", Lt = "http://semaphor-data-app.localhost:8088", Xr = "http://localhost:8787", It = "/Users/rohit/code/sandbox/semaphor-data-apps/data-app", We = 3, Aa = 18, jt = 12;
153
163
  function he(e, a) {
154
164
  return `${e}:${a}`;
155
165
  }
@@ -186,9 +196,9 @@ function Re(e) {
186
196
  function Be(e) {
187
197
  return e ? "omit" : "include";
188
198
  }
189
- function We(e) {
199
+ function He(e) {
190
200
  if (Array.isArray(e))
191
- return e.map(We);
201
+ return e.map(He);
192
202
  if (!e || typeof e != "object")
193
203
  return e;
194
204
  const a = {};
@@ -202,11 +212,11 @@ function We(e) {
202
212
  contentsBase64: p,
203
213
  ...h
204
214
  } = l;
205
- return We(h);
215
+ return He(h);
206
216
  });
207
217
  return;
208
218
  }
209
- a[s] = We(d);
219
+ a[s] = He(d);
210
220
  }
211
221
  }), a;
212
222
  }
@@ -261,9 +271,9 @@ async function $a(e, a) {
261
271
  status: e.status,
262
272
  ok: e.ok
263
273
  }, h = (v) => {
264
- var I;
274
+ var L;
265
275
  const B = v.split(`
266
- `), b = ((I = B.find((F) => F.startsWith("event:"))) == null ? void 0 : I.slice(6).trim()) || "message", E = B.filter((F) => F.startsWith("data:")).map((F) => F.slice(5).trim()).join(`
276
+ `), b = ((L = B.find((F) => F.startsWith("event:"))) == null ? void 0 : L.slice(6).trim()) || "message", E = B.filter((F) => F.startsWith("data:")).map((F) => F.slice(5).trim()).join(`
267
277
  `);
268
278
  if (!E) return;
269
279
  const j = JSON.parse(E);
@@ -368,7 +378,7 @@ async function Fa(e, {
368
378
  throw new Error(
369
379
  "Data App publish requires a saved draft and matching source revision."
370
380
  );
371
- const p = We(e.validationStatus);
381
+ const p = He(e.validationStatus);
372
382
  l == null || l({
373
383
  phase: "start",
374
384
  label: "Starting publish session",
@@ -405,7 +415,7 @@ async function Fa(e, {
405
415
  const b = await e.buildArtifacts({
406
416
  signal: d,
407
417
  onProgress: l
408
- }), E = We(
418
+ }), E = He(
409
419
  b.validationStatus
410
420
  );
411
421
  for (const [F, z] of b.assets.entries()) {
@@ -462,16 +472,16 @@ async function Fa(e, {
462
472
  validationStatus: E
463
473
  })
464
474
  }
465
- ), I = await O(j, "Data App publish complete");
466
- if (!j.ok || !((B = I.version) != null && B.id))
475
+ ), L = await O(j, "Data App publish complete");
476
+ if (!j.ok || !((B = L.version) != null && B.id))
467
477
  throw new Error(
468
- I.error || "Data App publish could not be completed."
478
+ L.error || "Data App publish could not be completed."
469
479
  );
470
480
  return {
471
481
  dataAppId: e.dataAppId,
472
- versionId: I.version.id,
473
- version: I.version.version,
474
- publishedAt: I.version.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
482
+ versionId: L.version.id,
483
+ version: L.version.version,
484
+ publishedAt: L.version.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
475
485
  };
476
486
  } catch (b) {
477
487
  throw await fetch(ye(a, `/${e.dataAppId}/publish/fail`), {
@@ -615,7 +625,7 @@ function Oa(e) {
615
625
  }
616
626
  return s(a), a.children;
617
627
  }
618
- function Ia(e) {
628
+ function La(e) {
619
629
  return {
620
630
  idle: "Working through your request",
621
631
  context: "Reading app context",
@@ -626,7 +636,7 @@ function Ia(e) {
626
636
  planning: "Planning the changes"
627
637
  }[e];
628
638
  }
629
- function La(e) {
639
+ function Ia(e) {
630
640
  return {
631
641
  idle: "Preparing the next step.",
632
642
  context: "Reading the app and figuring out what to change.",
@@ -685,7 +695,7 @@ function Wa(e) {
685
695
  `).slice(0, 2e3)
686
696
  };
687
697
  }
688
- function Je(e) {
698
+ function Ve(e) {
689
699
  var h;
690
700
  const a = Array.isArray(e == null ? void 0 : e.sources) ? e.sources : [], s = Array.isArray(e == null ? void 0 : e.inputs) ? e.inputs : [], d = Array.isArray(e == null ? void 0 : e.views) ? e.views : [], l = Array.isArray(e == null ? void 0 : e.interactions) ? e.interactions : [], p = Array.isArray((h = e == null ? void 0 : e.layout) == null ? void 0 : h.sections) ? e.layout.sections : [];
691
701
  return !!(e && (a.length > 0 || s.length > 0 || d.length > 0 || l.length > 0 || p.length > 0));
@@ -757,7 +767,7 @@ function st(e, a) {
757
767
  return Array.from(s.values());
758
768
  }
759
769
  function Ga(e, a) {
760
- return !a || !Je(a) ? e : !e || !Je(e) ? a : {
770
+ return !a || !Ve(a) ? e : !e || !Ve(e) ? a : {
761
771
  schemaVersion: "data-app-intent/v1",
762
772
  app: {
763
773
  title: a.app.title || e.app.title,
@@ -772,7 +782,7 @@ function Ga(e, a) {
772
782
  };
773
783
  }
774
784
  function an(e, a) {
775
- var S, f, R, v, B, b, E, j, I;
785
+ var S, f, R, v, B, b, E, j, L;
776
786
  const s = e.slice(-12).map(Wa), d = e.slice().reverse().find(
777
787
  (F) => {
778
788
  var z;
@@ -785,8 +795,8 @@ function an(e, a) {
785
795
  }
786
796
  ), p = (S = e.slice().reverse().find(
787
797
  (F) => F.type === "assistant" && !!F.operation
788
- )) == null ? void 0 : S.operation, h = (Je(a) ? a : void 0) || ((f = e.slice().reverse().find(
789
- (F) => F.type === "assistant" && Je(F.intentManifest)
798
+ )) == null ? void 0 : S.operation, h = (Ve(a) ? a : void 0) || ((f = e.slice().reverse().find(
799
+ (F) => F.type === "assistant" && Ve(F.intentManifest)
790
800
  )) == null ? void 0 : f.intentManifest), g = [
791
801
  (R = l == null ? void 0 : l.attachments) != null && R.length ? [
792
802
  "Most recent selected/attached target:",
@@ -807,7 +817,7 @@ function an(e, a) {
807
817
  prompt: d.prompt,
808
818
  changedFiles: ((E = d.result) == null ? void 0 : E.changedFiles) || [],
809
819
  summary: (j = d.result) == null ? void 0 : j.summary,
810
- filePlan: (I = d.result) == null ? void 0 : I.filePlan
820
+ filePlan: (L = d.result) == null ? void 0 : L.filePlan
811
821
  } : void 0,
812
822
  lastOperation: p,
813
823
  intentManifest: h || void 0
@@ -818,7 +828,7 @@ function Ka({
818
828
  selectedPath: a,
819
829
  onSelect: s
820
830
  }) {
821
- const d = je(() => Oa(e), [e]);
831
+ const d = ze(() => Oa(e), [e]);
822
832
  return d.length === 0 ? /* @__PURE__ */ r("div", { className: "rounded-[5px] border border-border bg-background p-2 text-[11px] text-muted-foreground", children: "No browser files loaded yet." }) : /* @__PURE__ */ r("div", { className: "space-y-0.5", children: d.map((l) => /* @__PURE__ */ r(
823
833
  cn,
824
834
  {
@@ -849,7 +859,7 @@ function cn({
849
859
  children: [
850
860
  l ? /* @__PURE__ */ c(re, { children: [
851
861
  /* @__PURE__ */ r(_t, { className: "h-3 w-3 rotate-90 text-muted-foreground" }),
852
- /* @__PURE__ */ r(wa, { className: "h-3.5 w-3.5 text-muted-foreground" })
862
+ /* @__PURE__ */ r(xa, { className: "h-3.5 w-3.5 text-muted-foreground" })
853
863
  ] }) : /* @__PURE__ */ c(re, { children: [
854
864
  /* @__PURE__ */ r("span", { className: "h-3 w-3" }),
855
865
  /* @__PURE__ */ r(Vt, { className: "h-3.5 w-3.5 text-muted-foreground" })
@@ -983,24 +993,24 @@ function Ya({
983
993
  projectName: g,
984
994
  onRestart: S
985
995
  }) {
986
- var Or, Ir;
987
- const [f, R] = x(It), [v, B] = x(Xr), [b, E] = x(Lt), [j, I] = x(!1), [F, z] = x(It), [ve, Y] = x(0), [A] = x(p), [_e, ct] = x(
996
+ var Or, Lr;
997
+ const [f, R] = x(Lt), [v, B] = x(Xr), [b, E] = x(It), [j, L] = x(!1), [F, z] = x(Lt), [ve, Y] = x(0), [A] = x(p), [_e, ct] = x(
988
998
  l || ""
989
- ), [ut, Ue] = x([]), [$e, De] = x([]), [Z, ge] = x([]), [Qt, Ge] = x(null), [X, Ke] = x(!1), [ee, qt] = x(!1), [Pe, un] = x(!0), [pn, se] = x("idle"), [hn, ie] = x(null), [Yt, Zt] = x(null), [Xt, Qe] = x(() => Date.now()), [Fe, er] = x(null), [pt, mn] = x("gpt-5.5-low"), q = oe(null), G = oe(null), ht = oe([]), mt = oe(null), ft = oe(null), tr = oe(null), [be, ke] = x(!1), [rr, le] = x(null), [nr, gt] = x(!1), [ar, or] = x(!1), [Me, bt] = x("idle"), [sr, ir] = x(
999
+ ), [ut, Ue] = x([]), [De, Pe] = x([]), [Z, ge] = x([]), [Qt, Ge] = x(null), [X, Ke] = x(!1), [ee, qt] = x(!1), [Fe, un] = x(!0), [pn, se] = x("idle"), [hn, ie] = x(null), [Yt, Zt] = x(null), [Xt, Qe] = x(() => Date.now()), [Me, er] = x(null), [pt, mn] = x("gpt-5.5-low"), q = oe(null), G = oe(null), ht = oe([]), mt = oe(null), ft = oe(null), tr = oe(null), [be, ke] = x(!1), [rr, le] = x(null), [nr, gt] = x(!1), [ar, or] = x(!1), [Te, bt] = x("idle"), [sr, ir] = x(
990
1000
  null
991
1001
  ), [fn, lr] = x(""), [gn, dr] = x([]), [xt, cr] = x([]), [wt, ur] = x(null), [pr, bn] = x([]), [xn, wn] = x(null), [yt, hr] = x(null), [vt, mr] = x(null), [xe, qe] = x(
992
1002
  d || null
993
- ), [Ye, kt] = x("idle"), [fr, Nt] = x("idle"), [gr, br] = x(null), [xr, wr] = x(null), [St, Ne] = x(null), [de, J] = x(null), [yr, Ze] = x(null), [Xe, At] = x(null), [Ct, et] = x(!1), [Rt, vr] = x(""), [kr, Bt] = x(null), [Nr, Sr] = x(!1), Te = oe(
1003
+ ), [Ye, kt] = x("idle"), [fr, Nt] = x("idle"), [gr, br] = x(null), [xr, wr] = x(null), [St, Ne] = x(null), [de, J] = x(null), [yr, Ze] = x(null), [Xe, At] = x(null), [Ct, et] = x(!1), [Rt, vr] = x(""), [kr, Bt] = x(null), [Nr, Sr] = x(!1), Ee = oe(
994
1004
  null
995
- ), $t = oe(null), Se = oe(null), Ar = (e == null ? void 0 : e.readStatus) || Ra, tt = (e == null ? void 0 : e.runTurn) || Ba, Dt = (e == null ? void 0 : e.saveDraft) || Da, yn = (e == null ? void 0 : e.loadApp) || Pa, Pt = (e == null ? void 0 : e.publish) || Fa, V = je(() => Ca(pt), [pt]), vn = je(
1005
+ ), $t = oe(null), Se = oe(null), Ar = (e == null ? void 0 : e.readStatus) || Ra, tt = (e == null ? void 0 : e.runTurn) || Ba, Dt = (e == null ? void 0 : e.saveDraft) || Da, yn = (e == null ? void 0 : e.loadApp) || Pa, Pt = (e == null ? void 0 : e.publish) || Fa, V = ze(() => Ca(pt), [pt]), vn = ze(
996
1006
  () => Z.find(
997
1007
  (t) => t.type === "run" && t.id === Qt
998
1008
  ),
999
1009
  [Qt, Z]
1000
- ), Ft = je(
1010
+ ), Ft = ze(
1001
1011
  () => [...Z].reverse().find((t) => t.type === "run"),
1002
1012
  [Z]
1003
- ), Mt = je(() => {
1013
+ ), Mt = ze(() => {
1004
1014
  const t = F.includes("?") ? "&" : "?";
1005
1015
  return `${F}${t}dataAppBuilderRefresh=${ve}`;
1006
1016
  }, [F, ve]);
@@ -1018,11 +1028,11 @@ function Ya({
1018
1028
  window.removeEventListener("blur", t);
1019
1029
  };
1020
1030
  }, [Ct]), W(() => {
1021
- I(!1);
1022
- const t = window.localStorage.getItem(he(qr, h)) || It, n = window.localStorage.getItem(he(Yr, h)) || Xr, i = window.localStorage.getItem(he(Zr, h)) || Lt, o = window.localStorage.getItem(
1031
+ L(!1);
1032
+ const t = window.localStorage.getItem(he(qr, h)) || Lt, n = window.localStorage.getItem(he(Yr, h)) || Xr, i = window.localStorage.getItem(he(Zr, h)) || It, o = window.localStorage.getItem(
1023
1033
  he(Qr, h)
1024
1034
  );
1025
- if (R(t), z(t), B(n), E(i), I(!0), o)
1035
+ if (R(t), z(t), B(n), E(i), L(!0), o)
1026
1036
  try {
1027
1037
  ge(JSON.parse(o));
1028
1038
  } catch {
@@ -1169,10 +1179,10 @@ function Ya({
1169
1179
  }, [be]), W(() => {
1170
1180
  ke(!1), gt(!1), le(null);
1171
1181
  }, [v, b, A]), W(() => {
1172
- if (X || ee || $e.length === 0) return;
1173
- const [t, ...n] = $e;
1174
- De(n), Br(t);
1175
- }, [X, ee, $e]), W(() => {
1182
+ if (X || ee || De.length === 0) return;
1183
+ const [t, ...n] = De;
1184
+ Pe(n), Br(t);
1185
+ }, [X, ee, De]), W(() => {
1176
1186
  let t = !1;
1177
1187
  const n = new AbortController();
1178
1188
  async function i() {
@@ -1201,7 +1211,7 @@ function Ya({
1201
1211
  lr(n.html), dr(n.diagnostics), cr(n.warnings || []), ur(n.cssMode || null), Y((i) => i + 1);
1202
1212
  },
1203
1213
  []
1204
- ), Ee = Ot(
1214
+ ), Oe = Ot(
1205
1215
  (t = G.current, n = Se.current) => {
1206
1216
  var m;
1207
1217
  if (!t) return;
@@ -1223,7 +1233,7 @@ function Ya({
1223
1233
  try {
1224
1234
  const i = await ot();
1225
1235
  if (t) return;
1226
- G.current = i, bt("ready"), await rt(i), Ee(i);
1236
+ G.current = i, bt("ready"), await rt(i), Oe(i);
1227
1237
  } catch (i) {
1228
1238
  if (t) return;
1229
1239
  bt("failed"), ir(
@@ -1234,7 +1244,7 @@ function Ya({
1234
1244
  return n(), () => {
1235
1245
  t = !0;
1236
1246
  };
1237
- }, [A, Ee, rt]);
1247
+ }, [A, Oe, rt]);
1238
1248
  function kn(t) {
1239
1249
  const n = G.current;
1240
1250
  hr(t), Se.current = t, mr(
@@ -1243,7 +1253,7 @@ function Ya({
1243
1253
  }
1244
1254
  async function Cr() {
1245
1255
  const t = G.current;
1246
- !t || X || (t.resetBrowserSandbox(), await rt(t), Ee(t), M(
1256
+ !t || X || (t.resetBrowserSandbox(), await rt(t), Oe(t), M(
1247
1257
  "Browser Sandbox reset to the approved starter template. Existing generated browser files were replaced in local browser storage.",
1248
1258
  "guidance"
1249
1259
  ));
@@ -1336,7 +1346,7 @@ function Ya({
1336
1346
  );
1337
1347
  }
1338
1348
  function M(t, n = "default", i) {
1339
- const o = Je(
1349
+ const o = Ve(
1340
1350
  i == null ? void 0 : i.intentManifest
1341
1351
  ) ? i == null ? void 0 : i.intentManifest : void 0;
1342
1352
  ge((u) => [
@@ -1509,15 +1519,15 @@ function Ya({
1509
1519
  };
1510
1520
  }
1511
1521
  function Tn(t, n) {
1512
- De(
1522
+ Pe(
1513
1523
  (i) => i.map((o) => o.id === t ? { ...o, prompt: n } : o)
1514
1524
  );
1515
1525
  }
1516
1526
  function En(t) {
1517
- De((n) => n.filter((i) => i.id !== t));
1527
+ Pe((n) => n.filter((i) => i.id !== t));
1518
1528
  }
1519
1529
  function On(t, n) {
1520
- De(
1530
+ Pe(
1521
1531
  (i) => i.map(
1522
1532
  (o) => o.id === t ? {
1523
1533
  ...o,
@@ -1567,7 +1577,7 @@ function Ya({
1567
1577
  })
1568
1578
  );
1569
1579
  }
1570
- async function In(t, n, i) {
1580
+ async function Ln(t, n, i) {
1571
1581
  var k, w, C, y;
1572
1582
  (k = q.current) == null || k.abort();
1573
1583
  const o = new AbortController(), u = Date.now();
@@ -1578,26 +1588,26 @@ function Ya({
1578
1588
  try {
1579
1589
  let N = G.current;
1580
1590
  N || (N = await ot(), G.current = N);
1581
- const L = N.readBrowserSandboxWorkspaceContext(), $ = (C = (w = L.files) == null ? void 0 : w.editable) != null && C.length ? tn(
1582
- L.files.editable,
1591
+ const I = N.readBrowserSandboxWorkspaceContext(), $ = (C = (w = I.files) == null ? void 0 : w.editable) != null && C.length ? tn(
1592
+ I.files.editable,
1583
1593
  Se.current,
1584
1594
  t
1585
1595
  ) : ["src/App.tsx"], ce = N.readBrowserSandboxFiles($), Ae = ce.reduce(
1586
1596
  (ne, te) => ne + te.contents.length,
1587
1597
  0
1588
1598
  );
1589
- let Ce = ce, Oe = [], ue = i, Q = null;
1599
+ let Ce = ce, Le = [], ue = i, Q = null;
1590
1600
  const pe = [];
1591
- for (let ne = 0; ne < ze; ne += 1) {
1592
- const te = Oe.length > 0 || ne > 0, Ie = te ? `repair-${ne + 1}` : "initial";
1601
+ for (let ne = 0; ne < We; ne += 1) {
1602
+ const te = Le.length > 0 || ne > 0, Ie = te ? `repair-${ne + 1}` : "initial";
1593
1603
  K(n, te ? "repairing" : "generating");
1594
1604
  const _ = ue || (await tt(
1595
1605
  {
1596
1606
  projectId: h,
1597
1607
  message: t,
1598
1608
  currentFiles: Ce,
1599
- workspaceContext: L,
1600
- diagnostics: Oe,
1609
+ workspaceContext: I,
1610
+ diagnostics: Le,
1601
1611
  repair: te,
1602
1612
  generationModel: V.model,
1603
1613
  generationReasoningEffort: V.reasoningEffort,
@@ -1633,7 +1643,7 @@ function Ya({
1633
1643
  };
1634
1644
  if (we.ok) {
1635
1645
  const P = await N.compileBrowserSandboxPreviewHtml();
1636
- if (lr(P.html), dr(P.diagnostics), cr(P.warnings || []), ur(P.cssMode || null), Y((U) => U + 1), Ee(N), P.diagnostics.length > 0) {
1646
+ if (lr(P.html), dr(P.diagnostics), cr(P.warnings || []), ur(P.cssMode || null), Y((U) => U + 1), Oe(N), P.diagnostics.length > 0) {
1637
1647
  const U = {
1638
1648
  command: "browser sandbox preview compile",
1639
1649
  durationMs: 0,
@@ -1656,14 +1666,14 @@ function Ya({
1656
1666
  };
1657
1667
  }
1658
1668
  }
1659
- if (Q = D, D.ok || ne === ze - 1)
1669
+ if (Q = D, D.ok || ne === We - 1)
1660
1670
  break;
1661
1671
  const T = (y = D.changedFiles) != null && y.length ? D.changedFiles : _.files.map(
1662
1672
  (P) => P.path
1663
1673
  );
1664
1674
  Ce = N.readBrowserSandboxFiles(
1665
1675
  Array.from(/* @__PURE__ */ new Set([...$, ...T]))
1666
- ), Oe = [zt(D)];
1676
+ ), Le = [zt(D)];
1667
1677
  }
1668
1678
  if (!Q)
1669
1679
  throw new Error("The browser runtime loop ended without a validation result.");
@@ -1677,9 +1687,9 @@ function Ya({
1677
1687
  Q.ok ? "default" : "blocked"
1678
1688
  );
1679
1689
  } catch (N) {
1680
- const L = N instanceof DOMException && N.name === "AbortError", $ = L ? "Timed out waiting for the browser runtime loop." : N instanceof Error ? N.message : String(N);
1690
+ const I = N instanceof DOMException && N.name === "AbortError", $ = I ? "Timed out waiting for the browser runtime loop." : N instanceof Error ? N.message : String(N);
1681
1691
  nt(n, {
1682
- status: L ? "cancelled" : "failed",
1692
+ status: I ? "cancelled" : "failed",
1683
1693
  error: $,
1684
1694
  result: {
1685
1695
  ok: !1,
@@ -1695,7 +1705,7 @@ function Ya({
1695
1705
  Ke(!1), Ge(null), q.current = null, window.clearTimeout(m);
1696
1706
  }
1697
1707
  }
1698
- async function Ln(t, n, i) {
1708
+ async function In(t, n, i) {
1699
1709
  var k, w, C, y;
1700
1710
  (k = q.current) == null || k.abort();
1701
1711
  const o = new AbortController(), u = Date.now();
@@ -1704,7 +1714,7 @@ function Ya({
1704
1714
  o.abort();
1705
1715
  }, 18e4);
1706
1716
  try {
1707
- const N = v.replace(/\/$/, ""), L = async (D) => {
1717
+ const N = v.replace(/\/$/, ""), I = async (D) => {
1708
1718
  const T = await fetch(`${N}/read-files`, {
1709
1719
  method: "POST",
1710
1720
  signal: o.signal,
@@ -1773,7 +1783,7 @@ function Ya({
1773
1783
  P.error || "Bridge could not apply generated files."
1774
1784
  );
1775
1785
  return P;
1776
- }, Oe = async () => {
1786
+ }, Le = async () => {
1777
1787
  const D = await fetch(`${N}/validate-typecheck`, {
1778
1788
  method: "POST",
1779
1789
  signal: o.signal,
@@ -1791,20 +1801,20 @@ function Ya({
1791
1801
  }, ue = await $();
1792
1802
  ue.projectRoot && E(ue.projectRoot);
1793
1803
  let Q = (C = (w = ue.files) == null ? void 0 : w.editable) != null && C.length ? en(ue.files.editable) : ["src/App.tsx"];
1794
- const pe = await L(Q), ne = pe.reduce(
1804
+ const pe = await I(Q), ne = pe.reduce(
1795
1805
  (D, T) => D + T.contents.length,
1796
1806
  0
1797
1807
  );
1798
1808
  let te = [];
1799
1809
  if (Ea(t)) {
1800
- const D = await Oe();
1810
+ const D = await Le();
1801
1811
  D.ok || (te = [
1802
1812
  zt(D)
1803
1813
  ]);
1804
1814
  }
1805
1815
  let Ie = pe, _ = null;
1806
1816
  const we = [];
1807
- for (let D = 0; D < ze; D += 1) {
1817
+ for (let D = 0; D < We; D += 1) {
1808
1818
  const T = te.length > 0 || D > 0, P = T ? `repair-${D + 1}` : "initial";
1809
1819
  K(n, T ? "repairing" : "generating");
1810
1820
  const U = await Ae({
@@ -1818,7 +1828,7 @@ function Ya({
1818
1828
  ...U,
1819
1829
  attemptLabel: P
1820
1830
  });
1821
- if (z(f), Y((Le) => Le + 1), we.push(...ae.attempts || []), _ = {
1831
+ if (z(f), Y((je) => je + 1), we.push(...ae.attempts || []), _ = {
1822
1832
  ...ae,
1823
1833
  attempts: [...we],
1824
1834
  filePlan: U.plan,
@@ -1827,16 +1837,16 @@ function Ya({
1827
1837
  contextChars: ne,
1828
1838
  generatedFileCount: U.files.length,
1829
1839
  generatedChars: U.files.reduce(
1830
- (Le, qn) => Le + qn.contents.length,
1840
+ (je, qn) => je + qn.contents.length,
1831
1841
  0
1832
1842
  ),
1833
1843
  repairAttempts: we.filter(
1834
- (Le) => Le.label.startsWith("repair")
1844
+ (je) => je.label.startsWith("repair")
1835
1845
  ).length
1836
1846
  }
1837
- }, K(n, "typechecking"), ae.ok || D === ze - 1)
1847
+ }, K(n, "typechecking"), ae.ok || D === We - 1)
1838
1848
  break;
1839
- Ie = (((y = ae.changedFiles) == null ? void 0 : y.length) || 0) > 0 ? await L(
1849
+ Ie = (((y = ae.changedFiles) == null ? void 0 : y.length) || 0) > 0 ? await I(
1840
1850
  Q = Array.from(
1841
1851
  /* @__PURE__ */ new Set([
1842
1852
  ...Q,
@@ -1857,9 +1867,9 @@ function Ya({
1857
1867
  _.ok ? "default" : "blocked"
1858
1868
  );
1859
1869
  } catch (N) {
1860
- const L = N instanceof DOMException && N.name === "AbortError", $ = L ? "Timed out waiting for the app-builder/bridge loop. The target app may still have updated through HMR." : N instanceof Error ? N.message : String(N);
1870
+ const I = N instanceof DOMException && N.name === "AbortError", $ = I ? "Timed out waiting for the app-builder/bridge loop. The target app may still have updated through HMR." : N instanceof Error ? N.message : String(N);
1861
1871
  nt(n, {
1862
- status: L ? "cancelled" : "failed",
1872
+ status: I ? "cancelled" : "failed",
1863
1873
  error: $,
1864
1874
  result: {
1865
1875
  ok: !1,
@@ -1963,7 +1973,7 @@ function Ya({
1963
1973
  };
1964
1974
  }
1965
1975
  async function Mr(t) {
1966
- var k, w, C, y, N, L;
1976
+ var k, w, C, y, N, I;
1967
1977
  const { workspaceContext: n } = await Pr(t), i = v.replace(/\/$/, ""), o = await fetch(`${i}/source-snapshot`, {
1968
1978
  method: "POST",
1969
1979
  signal: t,
@@ -1995,7 +2005,7 @@ function Ya({
1995
2005
  }
1996
2006
  const u = (y = (C = n.files) == null ? void 0 : C.snapshot) != null && y.length ? n.files.snapshot : [
1997
2007
  ...((N = n.files) == null ? void 0 : N.source) || [],
1998
- ...((L = n.files) == null ? void 0 : L.root) || []
2008
+ ...((I = n.files) == null ? void 0 : I.root) || []
1999
2009
  ], m = await Et(
2000
2010
  [...new Set(u.length ? u : ["src/App.tsx"])],
2001
2011
  t
@@ -2137,8 +2147,8 @@ function Ya({
2137
2147
  }
2138
2148
  }
2139
2149
  async function Er() {
2140
- if (Te.current)
2141
- return Te.current;
2150
+ if (Ee.current)
2151
+ return Ee.current;
2142
2152
  if (!Dt)
2143
2153
  return M(
2144
2154
  "Save draft is not configured in this host yet.",
@@ -2194,10 +2204,10 @@ function Ya({
2194
2204
  detail: u
2195
2205
  }), M(`Save draft failed: ${u}`, "blocked"), null;
2196
2206
  } finally {
2197
- Te.current = null;
2207
+ Ee.current = null;
2198
2208
  }
2199
2209
  })();
2200
- return Te.current = n, n;
2210
+ return Ee.current = n, n;
2201
2211
  }
2202
2212
  async function Un(t) {
2203
2213
  var u;
@@ -2224,7 +2234,7 @@ function Ya({
2224
2234
  );
2225
2235
  return;
2226
2236
  }
2227
- if (Ye === "saving" && !Te.current) {
2237
+ if (Ye === "saving" && !Ee.current) {
2228
2238
  M("Save draft is already in progress.", "blocked");
2229
2239
  return;
2230
2240
  }
@@ -2427,7 +2437,7 @@ function Ya({
2427
2437
  }), se("planning"), ie(
2428
2438
  (k = (m = y.revision.plan) == null ? void 0 : m.files) != null && k.length ? `Preparing edits for ${y.revision.plan.files.length} file${y.revision.plan.files.length === 1 ? "" : "s"}.` : "Preparing the file edit and validation run."
2429
2439
  );
2430
- const N = fe("run"), L = Date.now();
2440
+ const N = fe("run"), I = Date.now();
2431
2441
  ge(($) => [
2432
2442
  ...$,
2433
2443
  {
@@ -2436,10 +2446,10 @@ function Ya({
2436
2446
  prompt: i,
2437
2447
  status: "running",
2438
2448
  steps: Ta(),
2439
- createdAt: L,
2440
- startedAt: L
2449
+ createdAt: I,
2450
+ startedAt: I
2441
2451
  }
2442
- ]), q.current = null, A === "browser" ? In(i, N, y.revision) : Ln(i, N, y.revision);
2452
+ ]), q.current = null, A === "browser" ? Ln(i, N, y.revision) : In(i, N, y.revision);
2443
2453
  } catch (w) {
2444
2454
  const C = w instanceof DOMException && w.name === "AbortError";
2445
2455
  M(
@@ -2461,7 +2471,7 @@ function Ya({
2461
2471
  createdAt: i
2462
2472
  };
2463
2473
  if (ct(""), Ue([]), X || ee) {
2464
- De((m) => [...m, u]);
2474
+ Pe((m) => [...m, u]);
2465
2475
  return;
2466
2476
  }
2467
2477
  Br(u);
@@ -2473,9 +2483,9 @@ function Ya({
2473
2483
  className: "h-full min-h-0 flex-1",
2474
2484
  direction: "horizontal",
2475
2485
  children: [
2476
- Pe ? /* @__PURE__ */ c(re, { children: [
2486
+ Fe ? /* @__PURE__ */ c(re, { children: [
2477
2487
  /* @__PURE__ */ r(
2478
- Lr,
2488
+ Ir,
2479
2489
  {
2480
2490
  className: "min-w-[320px] max-w-[760px]",
2481
2491
  defaultSize: 28,
@@ -2569,10 +2579,10 @@ function Ya({
2569
2579
  onSubmit: Qn,
2570
2580
  className: "border-t border-border p-3",
2571
2581
  children: [
2572
- $e.length > 0 ? /* @__PURE__ */ r(
2582
+ De.length > 0 ? /* @__PURE__ */ r(
2573
2583
  no,
2574
2584
  {
2575
- turns: $e,
2585
+ turns: De,
2576
2586
  onDelete: En,
2577
2587
  onRemoveAttachment: On,
2578
2588
  onUpdatePrompt: Tn
@@ -2650,7 +2660,7 @@ function Ya({
2650
2660
  return (t = tr.current) == null ? void 0 : t.click();
2651
2661
  },
2652
2662
  children: [
2653
- /* @__PURE__ */ r(ya, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2663
+ /* @__PURE__ */ r(wa, { className: "h-3.5 w-3.5 text-muted-foreground" }),
2654
2664
  "Screenshot"
2655
2665
  ]
2656
2666
  }
@@ -2658,18 +2668,18 @@ function Ya({
2658
2668
  }
2659
2669
  )
2660
2670
  ] }),
2661
- /* @__PURE__ */ c(ua, { value: pt, onValueChange: mn, children: [
2671
+ /* @__PURE__ */ c(ca, { value: pt, onValueChange: mn, children: [
2662
2672
  /* @__PURE__ */ r(
2663
- pa,
2673
+ ua,
2664
2674
  {
2665
2675
  "aria-label": "Generation model",
2666
2676
  title: "Model used to generate changes",
2667
2677
  className: "h-7 w-auto gap-1.5 border-0 bg-transparent px-1.5 text-[11px] text-muted-foreground shadow-none hover:text-foreground focus:ring-0",
2668
- children: /* @__PURE__ */ r(ha, { placeholder: "Model" })
2678
+ children: /* @__PURE__ */ r(pa, { placeholder: "Model" })
2669
2679
  }
2670
2680
  ),
2671
- /* @__PURE__ */ r(ma, { align: "start", children: Jt.map((t) => /* @__PURE__ */ r(
2672
- fa,
2681
+ /* @__PURE__ */ r(ha, { align: "start", children: Jt.map((t) => /* @__PURE__ */ r(
2682
+ ma,
2673
2683
  {
2674
2684
  value: t.id,
2675
2685
  className: "text-[12px]",
@@ -2704,7 +2714,7 @@ function Ya({
2704
2714
  return (t = q.current) == null ? void 0 : t.abort();
2705
2715
  },
2706
2716
  children: [
2707
- /* @__PURE__ */ r(He, { className: "h-3 w-3" }),
2717
+ /* @__PURE__ */ r(Je, { className: "h-3 w-3" }),
2708
2718
  "Stop"
2709
2719
  ]
2710
2720
  }
@@ -2738,10 +2748,10 @@ function Ya({
2738
2748
  )
2739
2749
  ] }) : null,
2740
2750
  /* @__PURE__ */ r(
2741
- Lr,
2751
+ Ir,
2742
2752
  {
2743
2753
  className: "min-w-0",
2744
- defaultSize: Pe ? 72 : 100,
2754
+ defaultSize: Fe ? 72 : 100,
2745
2755
  minSize: 35,
2746
2756
  order: 2,
2747
2757
  children: /* @__PURE__ */ c("main", { className: "flex h-full min-w-0 flex-col bg-muted/40", children: [
@@ -2753,10 +2763,10 @@ function Ya({
2753
2763
  variant: "ghost",
2754
2764
  size: "xs",
2755
2765
  className: "-ml-1 gap-1.5 px-1.5 text-muted-foreground",
2756
- title: Pe ? "Hide chat" : "Show chat",
2757
- "aria-label": Pe ? "Hide chat" : "Show chat",
2766
+ title: Fe ? "Hide chat" : "Show chat",
2767
+ "aria-label": Fe ? "Hide chat" : "Show chat",
2758
2768
  onClick: () => un((t) => !t),
2759
- children: Pe ? /* @__PURE__ */ r(ka, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(sa, { className: "h-3.5 w-3.5" })
2769
+ children: Fe ? /* @__PURE__ */ r(va, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(ka, { className: "h-3.5 w-3.5" })
2760
2770
  }
2761
2771
  ),
2762
2772
  /* @__PURE__ */ c("div", { className: "flex min-w-0 items-baseline gap-2", children: [
@@ -2878,7 +2888,7 @@ function Ya({
2878
2888
  disabled: X || ee,
2879
2889
  title: "Reset the app to a blank development template",
2880
2890
  children: [
2881
- /* @__PURE__ */ r(ga, { className: "h-3.5 w-3.5" }),
2891
+ /* @__PURE__ */ r(fa, { className: "h-3.5 w-3.5" }),
2882
2892
  "Reset app"
2883
2893
  ]
2884
2894
  }
@@ -2905,7 +2915,7 @@ function Ya({
2905
2915
  title: "Save the current local source snapshot as a Semaphor draft",
2906
2916
  onClick: () => void Er(),
2907
2917
  children: [
2908
- Ye === "saving" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ba, { className: "h-3.5 w-3.5" }),
2918
+ Ye === "saving" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ga, { className: "h-3.5 w-3.5" }),
2909
2919
  "Save draft"
2910
2920
  ]
2911
2921
  }
@@ -2921,7 +2931,7 @@ function Ya({
2921
2931
  title: "Build, upload, and publish the current Data App",
2922
2932
  onClick: () => void Gn(),
2923
2933
  children: [
2924
- fr === "publishing" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(xa, { className: "h-3.5 w-3.5" }),
2934
+ fr === "publishing" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ba, { className: "h-3.5 w-3.5" }),
2925
2935
  "Publish"
2926
2936
  ]
2927
2937
  }
@@ -2937,7 +2947,7 @@ function Ya({
2937
2947
  title: "Select an element in the preview and attach its DOM/React context",
2938
2948
  onClick: () => be ? Fn() : void Pn(),
2939
2949
  children: [
2940
- ar ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(va, { className: "h-3.5 w-3.5" }),
2950
+ ar ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(ya, { className: "h-3.5 w-3.5" }),
2941
2951
  be ? "Cancel inspect" : "Inspect"
2942
2952
  ]
2943
2953
  }
@@ -2951,7 +2961,7 @@ function Ya({
2951
2961
  size: "xs",
2952
2962
  className: "gap-1.5 text-muted-foreground",
2953
2963
  children: [
2954
- /* @__PURE__ */ r(ia, { className: "h-3.5 w-3.5" }),
2964
+ /* @__PURE__ */ r(sa, { className: "h-3.5 w-3.5" }),
2955
2965
  "Runtime",
2956
2966
  A === "browser" && xt.length > 0 ? /* @__PURE__ */ r("span", { className: "text-[10px] text-amber-600", children: "CSS fallback" }) : null
2957
2967
  ]
@@ -2969,7 +2979,7 @@ function Ya({
2969
2979
  {
2970
2980
  label: "App Directory",
2971
2981
  value: b,
2972
- placeholder: Lt,
2982
+ placeholder: It,
2973
2983
  onChange: E
2974
2984
  }
2975
2985
  ),
@@ -2999,7 +3009,7 @@ function Ya({
2999
3009
  variant: "outline",
3000
3010
  size: "xs",
3001
3011
  className: "h-6 shrink-0 text-[10.5px]",
3002
- disabled: X || ee || Me !== "ready",
3012
+ disabled: X || ee || Te !== "ready",
3003
3013
  onClick: () => void Cr(),
3004
3014
  children: "Reset"
3005
3015
  }
@@ -3020,7 +3030,7 @@ function Ya({
3020
3030
  title: "Reload the live preview",
3021
3031
  "aria-label": "Reload the live preview",
3022
3032
  onClick: () => {
3023
- A === "browser" ? (rt(), Ee()) : (z(f), Y((t) => t + 1));
3033
+ A === "browser" ? (rt(), Oe()) : (z(f), Y((t) => t + 1));
3024
3034
  },
3025
3035
  children: /* @__PURE__ */ r(Kr, { className: "h-3.5 w-3.5" })
3026
3036
  }
@@ -3032,7 +3042,7 @@ function Ya({
3032
3042
  {
3033
3043
  className: `flex items-start gap-2 rounded-[6px] border px-2.5 py-2 text-[11.5px] leading-relaxed ${de.state === "failed" ? "border-destructive/30 bg-destructive/10 text-destructive" : de.state === "done" ? "border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/60 dark:bg-emerald-950/30 dark:text-emerald-300" : "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/60 dark:bg-blue-950/30 dark:text-blue-300"}`,
3034
3044
  children: [
3035
- de.state === "running" ? /* @__PURE__ */ r(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin" }) : de.state === "done" ? /* @__PURE__ */ r(Ut, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ r(He, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
3045
+ de.state === "running" ? /* @__PURE__ */ r(me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 animate-spin" }) : de.state === "done" ? /* @__PURE__ */ r(Ut, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ r(Je, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
3036
3046
  /* @__PURE__ */ c("div", { className: "min-w-0", children: [
3037
3047
  /* @__PURE__ */ r("div", { className: "font-medium", children: de.label }),
3038
3048
  de.detail ? /* @__PURE__ */ r("div", { className: "mt-0.5 truncate opacity-80", children: de.detail }) : null
@@ -3040,13 +3050,13 @@ function Ya({
3040
3050
  ]
3041
3051
  }
3042
3052
  ) }) : null,
3043
- (A === "browser" && (Me === "loading" || Me === "failed") || Fe && !((Or = Fe.appBuilder) != null && Or.hasOpenAiKey)) && /* @__PURE__ */ c("div", { className: "shrink-0 border-b border-border px-3 py-2", children: [
3044
- A === "browser" && Me === "loading" && /* @__PURE__ */ r("p", { className: "text-[11px] leading-relaxed text-muted-foreground", children: "Loading the in-browser runtime…" }),
3045
- A === "browser" && Me === "failed" && /* @__PURE__ */ c("div", { className: "rounded-[5px] border border-border bg-muted/40 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground", children: [
3053
+ (A === "browser" && (Te === "loading" || Te === "failed") || Me && !((Or = Me.appBuilder) != null && Or.hasOpenAiKey)) && /* @__PURE__ */ c("div", { className: "shrink-0 border-b border-border px-3 py-2", children: [
3054
+ A === "browser" && Te === "loading" && /* @__PURE__ */ r("p", { className: "text-[11px] leading-relaxed text-muted-foreground", children: "Loading the in-browser runtime…" }),
3055
+ A === "browser" && Te === "failed" && /* @__PURE__ */ c("div", { className: "rounded-[5px] border border-border bg-muted/40 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground", children: [
3046
3056
  "Browser runtime is unavailable. Link or install semaphor-browser-runtime, or use the local bridge path.",
3047
3057
  sr ? /* @__PURE__ */ r("pre", { className: "mt-1.5 whitespace-pre-wrap font-mono text-[10.5px] text-muted-foreground", children: sr }) : null
3048
3058
  ] }),
3049
- Fe && !((Ir = Fe.appBuilder) != null && Ir.hasOpenAiKey) && /* @__PURE__ */ r("div", { className: "rounded-[5px] border border-destructive/30 bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive", children: Fe.error || "OPENAI_API_KEY is not configured." })
3059
+ Me && !((Lr = Me.appBuilder) != null && Lr.hasOpenAiKey) && /* @__PURE__ */ r("div", { className: "rounded-[5px] border border-destructive/30 bg-destructive/10 px-2 py-1.5 text-[11px] text-destructive", children: Me.error || "OPENAI_API_KEY is not configured." })
3050
3060
  ] }),
3051
3061
  A === "browser" && gn.length > 0 && /* @__PURE__ */ r("div", { className: "shrink-0 border-b border-border px-3 py-1.5 text-[11px] text-amber-700 dark:text-amber-400", children: "Preview compiled with diagnostics. The next prompt can use them for repair." }),
3052
3062
  /* @__PURE__ */ c("div", { className: "flex min-h-0 flex-1", children: [
@@ -3141,7 +3151,7 @@ function Za({ code: e, lang: a }) {
3141
3151
  }
3142
3152
  )
3143
3153
  ] }),
3144
- /* @__PURE__ */ r("div", { className: "overflow-x-auto bg-background", children: /* @__PURE__ */ r(da, { code: e, language: a || "tsx" }) })
3154
+ /* @__PURE__ */ r("div", { className: "overflow-x-auto bg-background", children: /* @__PURE__ */ r(la, { code: e, language: a || "tsx" }) })
3145
3155
  ] });
3146
3156
  }
3147
3157
  const Xa = /(\b[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*\.(?:tsx?|jsx?|mjs|cjs|css|scss|json|mdx?|html?|ya?ml|toml|sql|sh|py|rb|go|rs)\b)/g;
@@ -3307,7 +3317,7 @@ function Kt({
3307
3317
  className: "rounded-[3px] p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",
3308
3318
  onClick: () => a(e.id),
3309
3319
  "aria-label": `Remove ${e.name}`,
3310
- children: /* @__PURE__ */ r(He, { className: "h-3 w-3" })
3320
+ children: /* @__PURE__ */ r(Je, { className: "h-3 w-3" })
3311
3321
  }
3312
3322
  ) : null
3313
3323
  ] });
@@ -3405,7 +3415,7 @@ function lo({
3405
3415
  }) {
3406
3416
  const [s, d] = x(""), [l, p] = x("all"), h = s.trim().toLowerCase(), g = e.fields.filter((f) => {
3407
3417
  var E, j;
3408
- const R = (E = f.role) == null ? void 0 : E.toLowerCase(), v = (j = f.dataType) == null ? void 0 : j.toLowerCase(), B = l === "all" || l === "measures" && (R === "measure" || R === "metric") || l === "dimensions" && R === "dimension" || l === "dates" && (R === "date" || v === "date" || v === "timestamp") || l === "identifiers" && R === "identifier" || l === "calculated" && f.source === "calculated", b = !h || [f.name, f.label, f.role, f.dataType].filter((I) => typeof I == "string").some((I) => I.toLowerCase().includes(h));
3418
+ const R = (E = f.role) == null ? void 0 : E.toLowerCase(), v = (j = f.dataType) == null ? void 0 : j.toLowerCase(), B = l === "all" || l === "measures" && (R === "measure" || R === "metric") || l === "dimensions" && R === "dimension" || l === "dates" && (R === "date" || v === "date" || v === "timestamp") || l === "identifiers" && R === "identifier" || l === "calculated" && f.source === "calculated", b = !h || [f.name, f.label, f.role, f.dataType].filter((L) => typeof L == "string").some((L) => L.toLowerCase().includes(h));
3409
3419
  return B && b;
3410
3420
  }), S = [
3411
3421
  { id: "all", label: "All", count: e.counts.total },
@@ -3440,7 +3450,7 @@ function lo({
3440
3450
  className: "h-7 w-7 text-muted-foreground",
3441
3451
  "aria-label": "Close field inspector",
3442
3452
  onClick: a,
3443
- children: /* @__PURE__ */ r(He, { className: "h-3.5 w-3.5" })
3453
+ children: /* @__PURE__ */ r(Je, { className: "h-3.5 w-3.5" })
3444
3454
  }
3445
3455
  )
3446
3456
  ] }),
@@ -3456,7 +3466,7 @@ function lo({
3456
3466
  e.dataset.primaryDateField
3457
3467
  ] }) : null,
3458
3468
  /* @__PURE__ */ c("label", { className: "mt-3 flex h-8 items-center gap-2 rounded-[5px] border border-border bg-background px-2", children: [
3459
- /* @__PURE__ */ r(la, { className: "h-3.5 w-3.5 text-muted-foreground" }),
3469
+ /* @__PURE__ */ r(ia, { className: "h-3.5 w-3.5 text-muted-foreground" }),
3460
3470
  /* @__PURE__ */ r(
3461
3471
  "input",
3462
3472
  {
@@ -3511,7 +3521,7 @@ function co({
3511
3521
  detail: a,
3512
3522
  elapsedMs: s
3513
3523
  }) {
3514
- const d = Ia(e), l = a || La(e);
3524
+ const d = La(e), l = a || Ia(e);
3515
3525
  return /* @__PURE__ */ c("div", { className: "max-w-[92%] rounded-[6px] rounded-bl-[2px] border border-border bg-background px-3 py-2.5", children: [
3516
3526
  /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
3517
3527
  /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" }),
@@ -3656,12 +3666,12 @@ function po({
3656
3666
  "attempt ",
3657
3667
  (a || 0) + 1,
3658
3668
  " / ",
3659
- ze
3669
+ We
3660
3670
  ] }) : /* @__PURE__ */ r("span", { children: Gt(e) }) })
3661
3671
  ] });
3662
3672
  }
3663
3673
  function ho({ state: e }) {
3664
- return e === "done" ? /* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5 text-emerald-600" }) : e === "running" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin text-blue-600" }) : e === "blocked" ? /* @__PURE__ */ r(He, { className: "h-3.5 w-3.5 text-destructive" }) : /* @__PURE__ */ r(ca, { className: "h-2.5 w-2.5 fill-zinc-300 stroke-none" });
3674
+ return e === "done" ? /* @__PURE__ */ r(Ut, { className: "h-3.5 w-3.5 text-emerald-600" }) : e === "running" ? /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 animate-spin text-blue-600" }) : e === "blocked" ? /* @__PURE__ */ r(Je, { className: "h-3.5 w-3.5 text-destructive" }) : /* @__PURE__ */ r(da, { className: "h-2.5 w-2.5 fill-zinc-300 stroke-none" });
3665
3675
  }
3666
3676
  export {
3667
3677
  yo as DataAppBuilder