@hanzo/dev 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/{BinaryViewer-CmFUK4zZ.js → BinaryViewer-BCDMNW2g.js} +19 -19
  2. package/dist/{ChatMarkdown-nvEI7iCv.js → ChatMarkdown-BUidXqSs.js} +2460 -2460
  3. package/dist/{DevicePanel-v5e3sEIf.js → DevicePanel-D-pksK3r.js} +532 -532
  4. package/dist/{DeviceStreamView-CCIfmbxH.js → DeviceStreamView-DsCoOzDV.js} +377 -377
  5. package/dist/{DiffCommentAnnotation-BPTN_2a6.js → DiffCommentAnnotation-2HD5qiyt.js} +227 -227
  6. package/dist/{DiffFileTree-B_br90vY.js → DiffFileTree-CuWvI5hS.js} +13 -13
  7. package/dist/{DiffPanel-V5R5TPuK.js → DiffPanel-Z2QVmBzu.js} +328 -328
  8. package/dist/{DiffWorkerPoolProvider-BwFR-Fc9.js → DiffWorkerPoolProvider-CEfiCIGR.js} +3 -3
  9. package/dist/{DocumentPages-VSn83vty.js → DocumentPages-glImt2JO.js} +3 -3
  10. package/dist/{ExpandedImageDialog-CAorLacL.js → ExpandedImageDialog-iqO3LiIj.js} +404 -404
  11. package/dist/{FileExplorerPane-CeHulcPz.js → FileExplorerPane-GwnRmXEh.js} +4 -4
  12. package/dist/{FilePreviewPanel-BVNLvWOc.js → FilePreviewPanel-CXWpTlfI.js} +1089 -1089
  13. package/dist/{FontFilePreview-Dj8Blcay.js → FontFilePreview-CDydHOXg.js} +2 -2
  14. package/dist/{FontViewer-CLDdwhSr.js → FontViewer-DDt9C5Cb.js} +5 -5
  15. package/dist/{HanzoConnectAccountPages-BEzYfu2l.js → HanzoConnectAccountPages-_sfrtw9j.js} +357 -357
  16. package/dist/{HanzoConnectSidebarSignIn-BhD6-Up5.js → HanzoConnectSidebarSignIn-coFQvyRw.js} +3 -3
  17. package/dist/{Icons-CvSmt8vD.js → Icons-CdegMw5l.js} +1 -1
  18. package/dist/{LargeTextViewer-DfFnYGCw.js → LargeTextViewer-D3RklYQB.js} +8 -8
  19. package/dist/{MermaidDiagram-CTolIzQD.js → MermaidDiagram-sVLnox7j.js} +8 -8
  20. package/dist/{MermaidFilePreview-CP2zP4FU.js → MermaidFilePreview-BmPdNxW5.js} +2 -2
  21. package/dist/{MermaidViewer-BDfYkS9E.js → MermaidViewer-BlKTevTF.js} +3 -3
  22. package/dist/{NotebookPreview-Cybs5uM0.js → NotebookPreview-C0gSEyeO.js} +10 -10
  23. package/dist/{OfficeFilePreview-7JsmSoKU.js → OfficeFilePreview-Ago_DWEt.js} +2 -2
  24. package/dist/{OfficeViewer-CJoojlJK.js → OfficeViewer-DBRqtLet.js} +10 -10
  25. package/dist/{OpenInPicker-BIMWUxBP.js → OpenInPicker-DD_h7VLv.js} +287 -287
  26. package/dist/{OpenXmlOfficeViewer-C24Kj8DM.js → OpenXmlOfficeViewer-B4dxjpba.js} +4 -4
  27. package/dist/{PdfViewer-Cf1iD759.js → PdfViewer-BanXvPmz.js} +16 -16
  28. package/dist/{PreviewFaviconIcon-zFOuzIxe.js → PreviewFaviconIcon-BwYKB-3e.js} +892 -892
  29. package/dist/{PreviewImage-oY5YnuTr.js → PreviewImage-6UU-M6_B.js} +3 -3
  30. package/dist/{PreviewImageContent-n6eLzY99.js → PreviewImageContent-D-00K-A9.js} +3 -3
  31. package/dist/{PreviewPanel-Bo4Lt02m.js → PreviewPanel-CiuHdDv8.js} +489 -489
  32. package/dist/{PreviewPanelShell-DhXLeN5j.js → PreviewPanelShell-Dezxjg0T.js} +71 -71
  33. package/dist/{ProjectIconPickerDialog-D0kFzt8f.js → ProjectIconPickerDialog-LomrzROv.js} +29 -29
  34. package/dist/{ProjectMonogram-D35xrrXQ.js → ProjectMonogram-D21--FQY.js} +1 -1
  35. package/dist/{ProviderAuthTerminal-DfsXnu7A.js → ProviderAuthTerminal-pQXIfodT.js} +3 -3
  36. package/dist/{PullRequestCodeTab-Dv_0kVad.js → PullRequestCodeTab-Cqfh5eN2.js} +476 -476
  37. package/dist/{PullRequestReviewAnnotation-LeuwO-iH.js → PullRequestReviewAnnotation-B4Lp8Ktf.js} +334 -334
  38. package/dist/{ReadOnlySourcePreview-D__IA5g1.js → ReadOnlySourcePreview-7xXUUySV.js} +5 -5
  39. package/dist/{RelativeTime-BMRprQS8.js → RelativeTime-B_yprjav.js} +2 -2
  40. package/dist/{RightPanelResizeHandle-BLbSz-gk.js → RightPanelResizeHandle-PumvYb9P.js} +2 -2
  41. package/dist/{ThemeEditorPanel-CUDdsRsE.js → ThemeEditorPanel-BmXXpaCI.js} +196 -196
  42. package/dist/{ThreadTerminalDrawer-BF3Ix0q_.js → ThreadTerminalDrawer-DCgE3ojz.js} +461 -461
  43. package/dist/{VirtualTablePreview-dajviAfu.js → VirtualTablePreview-mA6DOFwb.js} +1 -1
  44. package/dist/{anchoredCopyToast-DnUtg1n_.js → anchoredCopyToast-BVa_dlBU.js} +2 -2
  45. package/dist/{assetUrls-DkY7vXfM.js → assetUrls-D8lRk7Xd.js} +45 -45
  46. package/dist/{browserLinkTarget-CA46wnQC.js → browserLinkTarget-BbVlDQYx.js} +18 -18
  47. package/dist/builder/api/models.d.ts +2 -0
  48. package/dist/builder/api/models.js +6 -1
  49. package/dist/builder/api/sandbox.d.ts +2 -0
  50. package/dist/builder/api/sandbox.js +3 -1
  51. package/dist/builder/desk.d.ts +6 -0
  52. package/dist/builder/desk.js +79 -14
  53. package/dist/builder/mind.d.ts +5 -5
  54. package/dist/builder/mind.js +35 -14
  55. package/dist/builder/pane.d.ts +1 -1
  56. package/dist/builder/pane.js +1 -1
  57. package/dist/builder/panel.js +5 -5
  58. package/dist/builder/preview-fallback.d.ts +47 -0
  59. package/dist/builder/preview-fallback.js +341 -0
  60. package/dist/{changedFileKind-D6QYvIez.js → changedFileKind-DrjqPCpz.js} +5 -5
  61. package/dist/{collapsible-DFT41MdC.js → collapsible-CDT6JKbk.js} +1 -1
  62. package/dist/{color-picker-CshqBbpY.js → color-picker-kSVcH92L.js} +16 -16
  63. package/dist/core.js +1 -1
  64. package/dist/{decodeImagePreview-DnfFEjhw.js → decodeImagePreview-ZtWU3urU.js} +2 -2
  65. package/dist/{delimitedPreview-BiEpdYOj.js → delimitedPreview-DbbXcqOT.js} +1 -1
  66. package/dist/{dialog-DhQtWGRa.js → dialog-EmpqFZiK.js} +40 -40
  67. package/dist/{embed-c030vUqM.js → embed-CPWZKyIW.js} +36098 -35677
  68. package/dist/{empty-Bm5EzcG8.js → empty-ChM6gdzn.js} +1 -1
  69. package/dist/{errors-DrFQSJW3.js → errors-D8_Zn8KN.js} +2 -2
  70. package/dist/{fileContextMenu-BBo91omq.js → fileContextMenu-DW94DZj4.js} +54 -54
  71. package/dist/{fileExplorerLabel-AikEChiS.js → fileExplorerLabel-Cfz-3q1U.js} +507 -507
  72. package/dist/{fileSurfaceChrome-Cqkvn8RQ.js → fileSurfaceChrome-BDyKklTq.js} +26 -26
  73. package/dist/{hanzoWebAnalytics-CCxpTzcI.js → hanzoWebAnalytics-B1eETW-7.js} +1 -1
  74. package/dist/index.css +1 -1
  75. package/dist/{input-group-DEJEuwc9.js → input-group-BZ_QN-y7.js} +1 -1
  76. package/dist/{keybindings-C5tK_GAk.js → keybindings-D0pBlT1k.js} +7812 -7806
  77. package/dist/keymap.js +1 -1
  78. package/dist/{lucideIconByName-DUaXKH0V.js → lucideIconByName-CXY44V8P.js} +6835 -6848
  79. package/dist/{mediaReference-Bt_mh-ag.js → mediaReference-3wc4ZfY8.js} +95 -95
  80. package/dist/mediaSource-jW5c7b4r.js +70 -0
  81. package/dist/{modelPickerVisibility-Jue3CLfc.js → modelPickerVisibility-DBTc5r1G.js} +1 -1
  82. package/dist/{network-BbwqRm8c.js → network-wuXD7-is.js} +1 -1
  83. package/dist/{popover-anNQdce7.js → popover-BAyP2Tdr.js} +1 -1
  84. package/dist/{presentation-D9mVPBHm.js → presentation-68y8EAuH.js} +299 -299
  85. package/dist/{previewFailureMessages-BKpsSGX5.js → previewFailureMessages-CFguipaK.js} +3 -3
  86. package/dist/query-BPk2W3QN.js +63 -0
  87. package/dist/{readBinaryPreview-BAQ4fFjm.js → readBinaryPreview-CjZdBNVR.js} +2 -2
  88. package/dist/{refresh-icon-BYx64to1.js → refresh-icon-Vo5ImiQL.js} +1 -1
  89. package/dist/{scroll-area-ChvX8uOh.js → scroll-area-CEoyjC7h.js} +1 -1
  90. package/dist/{select-DumYjny_.js → select-DLFnkZsI.js} +2 -2
  91. package/dist/{session-_kmiSv2A.js → session-Decc4Fo5.js} +1063 -1063
  92. package/dist/{skeleton-CJqwfMSF.js → skeleton-BOKpAZv6.js} +1 -1
  93. package/dist/{switch-COwevwaq.js → switch-DjpPjtQN.js} +2 -2
  94. package/dist/{themePalette-Dl_7omVL.js → themePalette-C-GtwwqV.js} +977 -977
  95. package/dist/{threadSearch-BHyWwcV3.js → threadSearch-CrtCof6n.js} +162 -162
  96. package/dist/{toggle-CEO6qTxB.js → toggle-B4F0EEtI.js} +1 -1
  97. package/dist/{toggle-group-BHovdMDl.js → toggle-group-l8hRPswr.js} +2 -2
  98. package/dist/{use-atom-command-ByoYq_K6.js → use-atom-command-XemtT1Gv.js} +1 -1
  99. package/dist/{useAriaLabelledBy-DPSISlnL.js → useAriaLabelledBy-CibvSz-b.js} +1 -1
  100. package/dist/{useFileMetadata-e7zsixVX.js → useFileMetadata-PesehDX0.js} +33 -33
  101. package/dist/{useFloatingRootContext-CJ9stHca.js → useFloatingRootContext-ppoGvqar.js} +1 -1
  102. package/dist/{useLiveRefresh-BkKJKXhH.js → useLiveRefresh-aHkPuz6N.js} +172 -172
  103. package/dist/{useNextRenderData-CyUmSAgz.js → useNextRenderData-CNhjWfP0.js} +1 -1
  104. package/dist/{useSettings-DYG9Dmro.js → useSettings-B_MtcTyD.js} +139 -139
  105. package/dist/{useTextFieldSpeech-COa9XcRx.js → useTextFieldSpeech-B1wCgLPO.js} +1404 -1404
  106. package/dist/{useTheme-D2ZM1gvV.js → useTheme-WlXpQRKG.js} +4 -4
  107. package/dist/{utils-515nQ17G.js → utils-DtKQl-D3.js} +6184 -6172
  108. package/dist/{wizard-i86ViMRc.js → wizard-DjD4UNew.js} +3 -3
  109. package/dist/{workspaceFocus-BV1_9KiH.js → workspaceFocus-MR1plm6A.js} +144 -144
  110. package/dist/{zap-e0OsRjBR.js → zap-iwsUKtvA.js} +30 -17
  111. package/package.json +1 -1
  112. package/dist/mediaSource-zI7JWid4.js +0 -70
  113. package/dist/query-BxrrBAp6.js +0 -63
@@ -1,7 +1,7 @@
1
- import { S_ as e, t } from "./utils-515nQ17G.js";
1
+ import { C_ as e, t } from "./utils-DtKQl-D3.js";
2
2
  import { a as n } from "./search-3oqTSaO6.js";
3
- import { c as r, d as i, o as a, s as o, u as s } from "./dialog-DhQtWGRa.js";
4
- import { t as c } from "./scroll-area-ChvX8uOh.js";
3
+ import { c as r, d as i, o as a, s as o, u as s } from "./dialog-EmpqFZiK.js";
4
+ import { t as c } from "./scroll-area-CEoyjC7h.js";
5
5
  import { t as l } from "./observeResize-DRQ9DVLE.js";
6
6
  import { useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
7
7
  import { c as m } from "react/compiler-runtime";
@@ -1,10 +1,10 @@
1
1
  import { c as e, n as t } from "./messages-yqmY7G5x.js";
2
- import { Ag as n, Bc as r, Eg as i, Og as a, X as o, ct as s, l as c, lt as l, st as u } from "./utils-515nQ17G.js";
3
- import { $u as d, Mu as f, io as p, nf as m, qu as h, td as g, xr as _ } from "./keybindings-C5tK_GAk.js";
2
+ import { Bc as n, Dg as r, X as i, ct as a, jg as o, kg as s, l as c, lt as l, st as u } from "./utils-DtKQl-D3.js";
3
+ import { $u as d, Mu as f, io as p, nf as m, qu as h, td as g, xr as _ } from "./keybindings-D0pBlT1k.js";
4
4
  import { t as ee } from "./contextMenuFallback-BXyyYmm-.js";
5
5
  // src/closedViewStore.ts
6
6
  var v = (e, t) => {
7
- if (e.kind !== t.kind || n(e.threadRef) !== n(t.threadRef)) return !1;
7
+ if (e.kind !== t.kind || o(e.threadRef) !== o(t.threadRef)) return !1;
8
8
  switch (e.kind) {
9
9
  case "panel-tab": return t.kind === "panel-tab" && e.surface.id === t.surface.id;
10
10
  case "browser": return t.kind === "browser" && e.snapshot.tabId === t.snapshot.tabId;
@@ -28,7 +28,7 @@ var v = (e, t) => {
28
28
  case "issue": return typeof n.projectId == "string" && typeof n.tracker == "string" && typeof n.scope == "string" && typeof n.key == "string" && (n.environmentId === void 0 || typeof n.environmentId == "string") && (n.host === void 0 || typeof n.host == "string") && (n.url === void 0 || typeof n.url == "string");
29
29
  default: return !1;
30
30
  }
31
- }, ie = l()(s((e) => ({
31
+ }, ie = l()(a((e) => ({
32
32
  entries: [],
33
33
  remember: (t) => {
34
34
  let n = c();
@@ -44,14 +44,14 @@ var v = (e, t) => {
44
44
  remove: (t) => e((e) => ({ entries: e.entries.filter((e) => e.id !== t) }))
45
45
  }), {
46
46
  name: "hanzodev:closed-views:v2",
47
- storage: u(() => o(typeof window < "u" ? window.localStorage : void 0)),
47
+ storage: u(() => i(typeof window < "u" ? window.localStorage : void 0)),
48
48
  version: 2,
49
49
  migrate: (e) => {
50
50
  let t = e?.entries;
51
51
  return { entries: Array.isArray(t) ? t.filter(re).filter(y) : [] };
52
52
  },
53
53
  partialize: ({ entries: e }) => ({ entries: e.filter(y) })
54
- })), ae = "hanzodev:right-panel-state:v2", oe = 15, se = a(h.make("pull-requests-panel"), g.make("pull-requests-panel")), ce = a(h.make("issues-panel"), g.make("issues-panel")), le = (e) => e.endsWith(":pull-requests-panel") || e.endsWith(":issues-panel"), x = {
54
+ })), ae = "hanzodev:right-panel-state:v2", oe = 15, se = s(h.make("pull-requests-panel"), g.make("pull-requests-panel")), ce = s(h.make("issues-panel"), g.make("issues-panel")), le = (e) => e.endsWith(":pull-requests-panel") || e.endsWith(":issues-panel"), x = {
55
55
  isOpen: !1,
56
56
  activeSurfaceId: null,
57
57
  surfaces: []
@@ -184,17 +184,17 @@ var E = (e) => {
184
184
  };
185
185
  }, A = (e, t, n) => ({ ...k(e, t, n) }), j = /* @__PURE__ */ new Map();
186
186
  function _e(e, t) {
187
- let r = n(e);
188
- return j.set(r, t), () => {
189
- j.get(r) === t && j.delete(r);
187
+ let n = o(e);
188
+ return j.set(n, t), () => {
189
+ j.get(n) === t && j.delete(n);
190
190
  };
191
191
  }
192
192
  function ve(e) {
193
- return j.get(n(e)) ?? e;
193
+ return j.get(o(e)) ?? e;
194
194
  }
195
- var M = (e, t, r, i = !1) => {
196
- let a = j.get(t);
197
- return ye(e, a === void 0 ? t : n(a), r, i);
195
+ var M = (e, t, n, r = !1) => {
196
+ let i = j.get(t);
197
+ return ye(e, i === void 0 ? t : o(i), n, r);
198
198
  }, ye = (e, t, n, r) => ({
199
199
  ...k(e, t, (e) => {
200
200
  let t = n(e);
@@ -282,72 +282,72 @@ function Se(e) {
282
282
  }]] : [])) : {}
283
283
  };
284
284
  }
285
- var P = l()(s((r, i) => ({
285
+ var P = l()(a((n, r) => ({
286
286
  byThreadKey: {},
287
287
  pendingMaximizeThreadKey: null,
288
- requestMaximize: (e) => r({ pendingMaximizeThreadKey: n(e) }),
289
- consumeMaximizeRequest: (e) => i().pendingMaximizeThreadKey === n(e) && (r({ pendingMaximizeThreadKey: null }), !0),
288
+ requestMaximize: (e) => n({ pendingMaximizeThreadKey: o(e) }),
289
+ consumeMaximizeRequest: (e) => r().pendingMaximizeThreadKey === o(e) && (n({ pendingMaximizeThreadKey: null }), !0),
290
290
  threadPanelVisibilityByThreadKey: {},
291
291
  userActionRevisionByThreadKey: {},
292
292
  closeRevisionByThreadKey: {},
293
- getUserActionRevision: (e) => i().userActionRevisionByThreadKey[n(e)] ?? 0,
293
+ getUserActionRevision: (e) => r().userActionRevisionByThreadKey[o(e)] ?? 0,
294
294
  markUserAction: (e) => {
295
- let t = i().getUserActionRevision(e) + 1;
296
- return r((r) => ({ userActionRevisionByThreadKey: {
297
- ...r.userActionRevisionByThreadKey,
298
- [n(e)]: t
295
+ let t = r().getUserActionRevision(e) + 1;
296
+ return n((n) => ({ userActionRevisionByThreadKey: {
297
+ ...n.userActionRevisionByThreadKey,
298
+ [o(e)]: t
299
299
  } })), t;
300
300
  },
301
- openProactive: (e, t, i, a = !1) => {
302
- let o = !1;
303
- return r((r) => {
304
- let s = n(e);
301
+ openProactive: (e, t, r, i = !1) => {
302
+ let a = !1;
303
+ return n((n) => {
304
+ let s = o(e);
305
305
  if (t.kind === "diff") {
306
- if (F(r.byThreadKey, e).proactiveDiffTurnId === t.turnId) return r;
307
- let n = Te(r.byThreadKey, e), a = n === "pull-request" || n === "pull-requests";
308
- return o = (r.userActionRevisionByThreadKey[s] ?? 0) === i && n !== "diff" && !a, A(r, s, (e) => ({
309
- ...o ? D(e, C("diff")) : e,
306
+ if (F(n.byThreadKey, e).proactiveDiffTurnId === t.turnId) return n;
307
+ let i = Te(n.byThreadKey, e), o = i === "pull-request" || i === "pull-requests";
308
+ return a = (n.userActionRevisionByThreadKey[s] ?? 0) === r && i !== "diff" && !o, A(n, s, (e) => ({
309
+ ...a ? D(e, C("diff")) : e,
310
310
  proactiveDiffTurnId: t.turnId
311
311
  }));
312
312
  }
313
- return (r.userActionRevisionByThreadKey[s] ?? 0) !== i || !a && F(r.byThreadKey, e).surfaces.some((e) => e.id === t.id) ? r : (o = !0, A(r, s, (e) => D(e, t)));
314
- }), o;
313
+ return (n.userActionRevisionByThreadKey[s] ?? 0) !== r || !i && F(n.byThreadKey, e).surfaces.some((e) => e.id === t.id) ? n : (a = !0, A(n, s, (e) => D(e, t)));
314
+ }), a;
315
315
  },
316
- open: (e, t) => r((r) => M(r, n(e), (e) => t === "preview" ? D(e, e.surfaces.find((e) => e.kind === "preview") ?? w(null)) : D(e, C(t)))),
317
- openDevice: (e, t, i = !1) => r((r) => (i ? A : M)(r, n(e), (e) => {
316
+ open: (e, t) => n((n) => M(n, o(e), (e) => t === "preview" ? D(e, e.surfaces.find((e) => e.kind === "preview") ?? w(null)) : D(e, C(t)))),
317
+ openDevice: (e, t, r = !1) => n((n) => (r ? A : M)(n, o(e), (e) => {
318
318
  let n = `device:${encodeURIComponent(t.hostId)}:${encodeURIComponent(t.deviceId)}`;
319
- if (i && e.dismissedDeviceSurfaceIds?.includes(n)) return e;
320
- let r = {
319
+ if (r && e.dismissedDeviceSurfaceIds?.includes(n)) return e;
320
+ let i = {
321
321
  id: n,
322
322
  kind: "device",
323
323
  target: t
324
- }, a = e.surfaces.find((e) => e.id === n), o = a ? e.surfaces.filter((e) => e.id !== "device") : e.surfaces.map((e) => e.id === "device" ? r : e);
324
+ }, a = e.surfaces.find((e) => e.id === n), o = a ? e.surfaces.filter((e) => e.id !== "device") : e.surfaces.map((e) => e.id === "device" ? i : e);
325
325
  return D({
326
326
  ...e,
327
327
  surfaces: o,
328
328
  dismissedDeviceSurfaceIds: (e.dismissedDeviceSurfaceIds ?? []).filter((e) => e !== n)
329
- }, a ?? r);
329
+ }, a ?? i);
330
330
  })),
331
- openSideChat: (e, t) => r((r) => M(r, n(e), (e) => D(e, {
331
+ openSideChat: (e, t) => n((n) => M(n, o(e), (e) => D(e, {
332
332
  id: `side-chat:${t}`,
333
333
  kind: "side-chat",
334
334
  threadId: t
335
335
  }))),
336
- renameDevice: (i, a, o) => r((r) => M(r, n(i), (n) => ({
336
+ renameDevice: (r, i, a) => n((n) => M(n, o(r), (n) => ({
337
337
  ...n,
338
- surfaces: n.surfaces.map((n) => n.id === a && n.kind === "device" ? {
338
+ surfaces: n.surfaces.map((n) => n.id === i && n.kind === "device" ? {
339
339
  ...n,
340
- title: o.trim() || n.target?.name || t(e("Device", { $context: "a simulator or emulator" }))
340
+ title: a.trim() || n.target?.name || t(e("Device", { $context: "a simulator or emulator" }))
341
341
  } : n)
342
342
  }))),
343
- openBrowser: (e, t) => r((r) => M(r, n(e), (e) => {
343
+ openBrowser: (e, t) => n((n) => M(n, o(e), (e) => {
344
344
  let n = w(t), r = t ? e.surfaces.filter((e) => e.id !== "browser:new") : e.surfaces;
345
345
  return D({
346
346
  ...e,
347
347
  surfaces: r
348
348
  }, n);
349
349
  })),
350
- openPullRequest: (e, t) => r((r) => M(r, n(e), (e) => {
350
+ openPullRequest: (e, t) => n((n) => M(n, o(e), (e) => {
351
351
  let n = T(t), r = D(e, n), { url: i, revealUrl: a } = t;
352
352
  return !i && !a ? r : {
353
353
  ...r,
@@ -362,52 +362,52 @@ var P = l()(s((r, i) => ({
362
362
  })
363
363
  };
364
364
  })),
365
- openIssue: (e, t) => r((r) => M(r, n(e), (e) => {
365
+ openIssue: (e, t) => n((n) => M(n, o(e), (e) => {
366
366
  let n = he(t), r = D(e, n);
367
367
  return t.url ? {
368
368
  ...r,
369
369
  surfaces: r.surfaces.map((e) => e.id === n.id ? n : e)
370
370
  } : r;
371
371
  })),
372
- setPullRequestDetailTab: (e, t, i) => r((r) => {
373
- let a = n(e), o = r.byThreadKey[a]?.surfaces.find((e) => e.id === t);
374
- return o?.kind !== "pull-request" || (o.detailTab ?? "summary") === i ? r : A(r, a, (e) => ({
372
+ setPullRequestDetailTab: (e, t, r) => n((n) => {
373
+ let i = o(e), a = n.byThreadKey[i]?.surfaces.find((e) => e.id === t);
374
+ return a?.kind !== "pull-request" || (a.detailTab ?? "summary") === r ? n : A(n, i, (e) => ({
375
375
  ...e,
376
376
  surfaces: e.surfaces.map((e) => e.id === t && e.kind === "pull-request" ? {
377
377
  ...e,
378
- detailTab: i
378
+ detailTab: r
379
379
  } : e)
380
380
  }));
381
381
  }),
382
- settlePullRequestReveal: (e, t, i) => r((r) => {
383
- let a = n(e), o = r.byThreadKey[a]?.surfaces.find((e) => e.id === t);
384
- return o?.kind !== "pull-request" || o.revealUrl !== i ? r : A(r, a, (e) => ({
382
+ settlePullRequestReveal: (e, t, r) => n((n) => {
383
+ let i = o(e), a = n.byThreadKey[i]?.surfaces.find((e) => e.id === t);
384
+ return a?.kind !== "pull-request" || a.revealUrl !== r ? n : A(n, i, (e) => ({
385
385
  ...e,
386
386
  surfaces: e.surfaces.map((e) => e.id === t ? E(e) : e)
387
387
  }));
388
388
  }),
389
- openFile: (e, t, i) => r((r) => M(r, n(e), (e) => {
389
+ openFile: (e, t, r) => n((n) => M(n, o(e), (e) => {
390
390
  if (t === ".") return D(e, C("files"));
391
- let n = /^[A-Za-z]:\/+$/.test(t) ? t : t.replace(/\/+$/, "") || t, r = e.surfaces.filter((e) => e.kind !== "files"), a = `file:${n}`, o = r.find((e) => e.id === a && e.kind === "file"), s = ue(n, xe(i), (o?.revealRequestId ?? 0) + 1);
391
+ let n = /^[A-Za-z]:\/+$/.test(t) ? t : t.replace(/\/+$/, "") || t, i = e.surfaces.filter((e) => e.kind !== "files"), a = `file:${n}`, o = i.find((e) => e.id === a && e.kind === "file"), s = ue(n, xe(r), (o?.revealRequestId ?? 0) + 1);
392
392
  return {
393
393
  ...e,
394
394
  isOpen: !0,
395
395
  activeSurfaceId: s.id,
396
- surfaces: o ? r.map((e) => e.id === s.id ? s : e) : [...r, s]
396
+ surfaces: o ? i.map((e) => e.id === s.id ? s : e) : [...i, s]
397
397
  };
398
398
  })),
399
- navigateFolder: (e, t, i, a, o = !1) => r((r) => M(r, n(e), (e) => {
399
+ navigateFolder: (e, t, r, i, a = !1) => n((n) => M(n, o(e), (e) => {
400
400
  let n = e.surfaces.findIndex((e) => e.id === t);
401
401
  if (n < 0) return e;
402
- let r = a === i ? {} : { folderTrail: a }, s = i === "" ? {
402
+ let o = i === r ? {} : { folderTrail: i }, s = r === "" ? {
403
403
  ...C("files"),
404
- ...r
404
+ ...o
405
405
  } : {
406
- ...ue(i, null, 1),
407
- ...r
406
+ ...ue(r, null, 1),
407
+ ...o
408
408
  }, c = e.surfaces[n], l = e.surfaces.some((e, t) => t !== n && e.id === s.id), u = e.surfaces.flatMap((e, t) => {
409
409
  if (t === n) {
410
- let e = o ? [c] : [];
410
+ let e = a ? [c] : [];
411
411
  return l ? e : [...e, s];
412
412
  }
413
413
  return !l && s.kind === "file" && e.kind === "files" ? [] : [e];
@@ -419,42 +419,42 @@ var P = l()(s((r, i) => ({
419
419
  surfaces: u
420
420
  };
421
421
  })),
422
- openAttachment: (e, t) => r((r) => M(r, n(e), (e) => {
422
+ openAttachment: (e, t) => n((n) => M(n, o(e), (e) => {
423
423
  let n = e.surfaces.filter((e) => e.kind !== "files");
424
424
  return D({
425
425
  ...e,
426
426
  surfaces: n
427
427
  }, de(t));
428
428
  })),
429
- openTerminal: (e, t) => r((r) => M(r, n(e), (e) => D(e, fe(t)))),
430
- splitTerminal: (e, t, i, a = "horizontal") => r((r) => M(r, n(e), (e) => ({
429
+ openTerminal: (e, t) => n((n) => M(n, o(e), (e) => D(e, fe(t)))),
430
+ splitTerminal: (e, t, r, i = "horizontal") => n((n) => M(n, o(e), (e) => ({
431
431
  ...e,
432
432
  isOpen: !0,
433
433
  activeSurfaceId: t,
434
434
  surfaces: e.surfaces.map((e) => {
435
435
  if (e.id !== t || e.kind !== "terminal") return e;
436
- let { splitDirection: n, ...r } = e;
436
+ let { splitDirection: n, ...a } = e;
437
437
  return {
438
- ...r,
439
- terminalIds: e.terminalIds.includes(i) ? e.terminalIds : [...e.terminalIds, i],
440
- activeTerminalId: i,
441
- ...a === "vertical" ? { splitDirection: "vertical" } : {}
438
+ ...a,
439
+ terminalIds: e.terminalIds.includes(r) ? e.terminalIds : [...e.terminalIds, r],
440
+ activeTerminalId: r,
441
+ ...i === "vertical" ? { splitDirection: "vertical" } : {}
442
442
  };
443
443
  })
444
444
  }))),
445
- activateTerminal: (e, t, i) => r((r) => M(r, n(e), (e) => ({
445
+ activateTerminal: (e, t, r) => n((n) => M(n, o(e), (e) => ({
446
446
  ...e,
447
447
  activeSurfaceId: t,
448
- surfaces: e.surfaces.map((e) => e.id === t && e.kind === "terminal" && e.terminalIds.includes(i) ? {
448
+ surfaces: e.surfaces.map((e) => e.id === t && e.kind === "terminal" && e.terminalIds.includes(r) ? {
449
449
  ...e,
450
- activeTerminalId: i
450
+ activeTerminalId: r
451
451
  } : e)
452
452
  }))),
453
- closeTerminal: (e, t, i) => r((r) => N(r, n(e), (e) => {
453
+ closeTerminal: (e, t, r) => n((n) => N(n, o(e), (e) => {
454
454
  let n = e.surfaces.find((e) => e.id === t && e.kind === "terminal");
455
455
  if (!n || n.kind !== "terminal") return e;
456
- let r = n.terminalIds.filter((e) => e !== i);
457
- if (r.length === 0) {
456
+ let i = n.terminalIds.filter((e) => e !== r);
457
+ if (i.length === 0) {
458
458
  let n = e.surfaces.findIndex((e) => e.id === t), r = e.surfaces.filter((e) => e.id !== t), i = r[Math.min(n, r.length - 1)] ?? null;
459
459
  return {
460
460
  ...e,
@@ -467,14 +467,14 @@ var P = l()(s((r, i) => ({
467
467
  ...e,
468
468
  surfaces: e.surfaces.map((e) => e.id === t && e.kind === "terminal" ? {
469
469
  ...e,
470
- terminalIds: r,
471
- activeTerminalId: e.activeTerminalId === i ? r.at(-1) ?? r[0] : e.activeTerminalId
470
+ terminalIds: i,
471
+ activeTerminalId: e.activeTerminalId === r ? i.at(-1) ?? i[0] : e.activeTerminalId
472
472
  } : e)
473
473
  };
474
474
  })),
475
- activateSurface: (e, t) => r((r) => M(r, n(e), (e) => be(e, t))),
476
- revealSurface: (e, t) => r((r) => A(r, n(e), (e) => be(e, t))),
477
- closeSurface: (e, t) => r((r) => N(r, n(e), (e) => {
475
+ activateSurface: (e, t) => n((n) => M(n, o(e), (e) => be(e, t))),
476
+ revealSurface: (e, t) => n((n) => A(n, o(e), (e) => be(e, t))),
477
+ closeSurface: (e, t) => n((n) => N(n, o(e), (e) => {
478
478
  let n = e.surfaces.findIndex((e) => e.id === t);
479
479
  if (n < 0) return e;
480
480
  let r = e.surfaces.filter((e) => e.id !== t), i = {
@@ -489,7 +489,7 @@ var P = l()(s((r, i) => ({
489
489
  activeSurfaceId: a?.id ?? null
490
490
  };
491
491
  })),
492
- closeOtherSurfaces: (e, t) => r((r) => N(r, n(e), (e) => {
492
+ closeOtherSurfaces: (e, t) => n((n) => N(n, o(e), (e) => {
493
493
  let n = e.surfaces.find((e) => e.id === t);
494
494
  return !n || e.surfaces.length === 1 ? e : {
495
495
  ...e,
@@ -498,7 +498,7 @@ var P = l()(s((r, i) => ({
498
498
  activeSurfaceId: n.id
499
499
  };
500
500
  })),
501
- closeSurfacesToRight: (e, t) => r((r) => N(r, n(e), (e) => {
501
+ closeSurfacesToRight: (e, t) => n((n) => N(n, o(e), (e) => {
502
502
  let n = e.surfaces.findIndex((e) => e.id === t);
503
503
  if (n < 0 || n === e.surfaces.length - 1) return e;
504
504
  let r = e.surfaces.slice(0, n + 1), i = r.some((t) => t.id === e.activeSurfaceId);
@@ -508,23 +508,23 @@ var P = l()(s((r, i) => ({
508
508
  activeSurfaceId: i ? e.activeSurfaceId : t
509
509
  };
510
510
  })),
511
- closeAllSurfaces: (e) => r((t) => N(t, n(e), (e) => e.surfaces.length === 0 ? e : {
511
+ closeAllSurfaces: (e) => n((t) => N(t, o(e), (e) => e.surfaces.length === 0 ? e : {
512
512
  ...e,
513
513
  isOpen: !1,
514
514
  surfaces: [],
515
515
  activeSurfaceId: null
516
516
  })),
517
- moveSurface: (e, t, i) => r((r) => k(r, n(e), (e) => {
517
+ moveSurface: (e, t, r) => n((n) => k(n, o(e), (e) => {
518
518
  let n = e.surfaces.findIndex((e) => e.id === t);
519
- if (n < 0 || n === i) return e;
520
- let r = [...e.surfaces];
521
- return r.splice(i, 0, ...r.splice(n, 1)), {
519
+ if (n < 0 || n === r) return e;
520
+ let i = [...e.surfaces];
521
+ return i.splice(r, 0, ...i.splice(n, 1)), {
522
522
  ...e,
523
- surfaces: r
523
+ surfaces: i
524
524
  };
525
525
  })),
526
- reconcileBrowserSurfaces: (e, t, i) => r((r) => A(r, n(e), (e) => {
527
- let n = new Set(t.map((e) => `browser:${e}`)), r = e.surfaces.filter((e) => e.kind !== "preview" || e.id !== "browser:new" && n.has(e.id)), a = new Set(r.map((e) => e.id)), o = t.filter((e) => !a.has(`browser:${e}`) && !i?.has(e)).map((e) => w(e)), s = [...r, ...o], c = s.some((t) => t.id === e.activeSurfaceId), l = s.find((e) => e.kind === "preview"), u = s.length === 0 && e.surfaces.some((e) => e.kind === "preview" && e.resourceId);
526
+ reconcileBrowserSurfaces: (e, t, r) => n((n) => A(n, o(e), (e) => {
527
+ let n = new Set(t.map((e) => `browser:${e}`)), i = e.surfaces.filter((e) => e.kind !== "preview" || e.id !== "browser:new" && n.has(e.id)), a = new Set(i.map((e) => e.id)), o = t.filter((e) => !a.has(`browser:${e}`) && !r?.has(e)).map((e) => w(e)), s = [...i, ...o], c = s.some((t) => t.id === e.activeSurfaceId), l = s.find((e) => e.kind === "preview"), u = s.length === 0 && e.surfaces.some((e) => e.kind === "preview" && e.resourceId);
528
528
  return {
529
529
  ...e,
530
530
  isOpen: !u && e.isOpen,
@@ -532,7 +532,7 @@ var P = l()(s((r, i) => ({
532
532
  activeSurfaceId: c ? e.activeSurfaceId : l?.id ?? s[0]?.id ?? null
533
533
  };
534
534
  })),
535
- reconcileFileSurfaces: (e, t) => r((r) => A(r, n(e), (e) => {
535
+ reconcileFileSurfaces: (e, t) => n((n) => A(n, o(e), (e) => {
536
536
  if (t) return e;
537
537
  let n = e.surfaces.filter((e) => e.kind !== "files" && (e.kind !== "file" || e.attachment !== void 0));
538
538
  if (n.length === e.surfaces.length) return e;
@@ -544,15 +544,15 @@ var P = l()(s((r, i) => ({
544
544
  activeSurfaceId: r ? e.activeSurfaceId : n.at(-1)?.id ?? null
545
545
  };
546
546
  })),
547
- show: (e) => r((t) => M(t, n(e), (e) => e.isOpen ? e : {
547
+ show: (e) => n((t) => M(t, o(e), (e) => e.isOpen ? e : {
548
548
  ...e,
549
549
  isOpen: !0
550
550
  })),
551
- close: (e) => r((t) => M(t, n(e), (e) => e.isOpen ? {
551
+ close: (e) => n((t) => M(t, o(e), (e) => e.isOpen ? {
552
552
  ...e,
553
553
  isOpen: !1
554
554
  } : e)),
555
- setMaximized: (e, t) => r((r) => A(r, n(e), (e) => {
555
+ setMaximized: (e, t) => n((n) => A(n, o(e), (e) => {
556
556
  if ((e.maximized ?? !1) === t) return e;
557
557
  let { maximized: n, ...r } = e;
558
558
  return t ? {
@@ -560,37 +560,37 @@ var P = l()(s((r, i) => ({
560
560
  maximized: !0
561
561
  } : r;
562
562
  })),
563
- toggleVisibility: (e) => r((t) => M(t, n(e), (e) => ({
563
+ toggleVisibility: (e) => n((t) => M(t, o(e), (e) => ({
564
564
  ...e,
565
565
  isOpen: !e.isOpen
566
566
  }))),
567
- toggle: (e, t) => r((r) => M(r, n(e), (e) => {
567
+ toggle: (e, t) => n((n) => M(n, o(e), (e) => {
568
568
  let n = e.surfaces.find((t) => t.id === e.activeSurfaceId);
569
569
  return e.isOpen && n?.kind === t ? {
570
570
  ...e,
571
571
  isOpen: !1
572
572
  } : t === "preview" ? D(e, e.surfaces.find((e) => e.kind === "preview") ?? w(null)) : D(e, C(t));
573
573
  })),
574
- setThreadPanelOpen: (e, t, i) => r((r) => ({ threadPanelVisibilityByThreadKey: O(r.threadPanelVisibilityByThreadKey, n(e), (e) => {
574
+ setThreadPanelOpen: (e, t, r) => n((n) => ({ threadPanelVisibilityByThreadKey: O(n.threadPanelVisibilityByThreadKey, o(e), (e) => {
575
575
  let n = t === "inline" ? "inlineOpen" : "popoverOpen";
576
- return e[n] === i ? e : {
576
+ return e[n] === r ? e : {
577
577
  ...e,
578
- [n]: i
578
+ [n]: r
579
579
  };
580
580
  }) })),
581
- toggleThreadPanel: (e, t) => r((r) => ({ threadPanelVisibilityByThreadKey: O(r.threadPanelVisibilityByThreadKey, n(e), (e) => t === "inline" ? {
581
+ toggleThreadPanel: (e, t) => n((n) => ({ threadPanelVisibilityByThreadKey: O(n.threadPanelVisibilityByThreadKey, o(e), (e) => t === "inline" ? {
582
582
  ...e,
583
583
  inlineOpen: !e.inlineOpen
584
584
  } : {
585
585
  ...e,
586
586
  popoverOpen: !e.popoverOpen
587
587
  }) })),
588
- removeThread: (e) => r((t) => {
589
- let r = n(e);
590
- if (!(r in t.byThreadKey) && !(r in t.threadPanelVisibilityByThreadKey) && !(r in t.userActionRevisionByThreadKey) && !(r in t.closeRevisionByThreadKey)) return t;
591
- let { [r]: i, ...a } = t.byThreadKey, { [r]: o, ...s } = t.threadPanelVisibilityByThreadKey, { [r]: c, ...l } = t.userActionRevisionByThreadKey, { [r]: u, ...d } = t.closeRevisionByThreadKey;
588
+ removeThread: (e) => n((t) => {
589
+ let n = o(e);
590
+ if (!(n in t.byThreadKey) && !(n in t.threadPanelVisibilityByThreadKey) && !(n in t.userActionRevisionByThreadKey) && !(n in t.closeRevisionByThreadKey)) return t;
591
+ let { [n]: r, ...i } = t.byThreadKey, { [n]: a, ...s } = t.threadPanelVisibilityByThreadKey, { [n]: c, ...l } = t.userActionRevisionByThreadKey, { [n]: u, ...d } = t.closeRevisionByThreadKey;
592
592
  return {
593
- byThreadKey: a,
593
+ byThreadKey: i,
594
594
  threadPanelVisibilityByThreadKey: s,
595
595
  userActionRevisionByThreadKey: l,
596
596
  closeRevisionByThreadKey: d
@@ -599,7 +599,7 @@ var P = l()(s((r, i) => ({
599
599
  }), {
600
600
  name: ae,
601
601
  version: oe,
602
- storage: u(() => o(typeof window < "u" ? window.localStorage : void 0)),
602
+ storage: u(() => i(typeof window < "u" ? window.localStorage : void 0)),
603
603
  partialize: (e) => ({
604
604
  byThreadKey: Object.fromEntries(Object.entries(e.byThreadKey).flatMap(([e, t]) => le(e) ? [] : [[e, {
605
605
  ...t,
@@ -613,9 +613,9 @@ var P = l()(s((r, i) => ({
613
613
  migrate: Se
614
614
  }));
615
615
  P.subscribe((e, t) => {
616
- if (e.closeRevisionByThreadKey !== t.closeRevisionByThreadKey) for (let [n, r] of Object.entries(e.closeRevisionByThreadKey)) {
617
- if (r === t.closeRevisionByThreadKey[n]) continue;
618
- let a = i(n);
616
+ if (e.closeRevisionByThreadKey !== t.closeRevisionByThreadKey) for (let [n, i] of Object.entries(e.closeRevisionByThreadKey)) {
617
+ if (i === t.closeRevisionByThreadKey[n]) continue;
618
+ let a = r(n);
619
619
  if (!a) continue;
620
620
  let o = t.byThreadKey[n] ?? x, s = e.byThreadKey[n] ?? x, c = o.surfaces.filter((e) => !s.surfaces.some((t) => t.id === e.id)), l = [...c.filter((e) => e.id !== o.activeSurfaceId), ...c.filter((e) => e.id === o.activeSurfaceId)];
621
621
  for (let e of l.map(E)) e.kind === "terminal" || e.kind === "preview" && e.resourceId !== null || ie.getState().remember({
@@ -626,10 +626,10 @@ P.subscribe((e, t) => {
626
626
  }
627
627
  });
628
628
  function F(e, t) {
629
- return t ? e[n(t)] ?? x : x;
629
+ return t ? e[o(t)] ?? x : x;
630
630
  }
631
631
  function Ce(e, t) {
632
- return t ? e[n(t)] ?? S : S;
632
+ return t ? e[o(t)] ?? S : S;
633
633
  }
634
634
  function we(e, t, n) {
635
635
  let r = Ce(e, t);
@@ -650,11 +650,11 @@ function De(e, t) {
650
650
  var Oe = "hanzodev:terminal-state:v1";
651
651
  function ke(e, t) {
652
652
  if (!e || typeof e != "object") return { terminalUiStateByThreadKey: {} };
653
- let n = e, r = n.terminalUiStateByThreadKey ?? n.terminalStateByThreadKey ?? {};
654
- return { terminalUiStateByThreadKey: Object.fromEntries(Object.entries(r).filter(([e]) => i(e))) };
653
+ let n = e, i = n.terminalUiStateByThreadKey ?? n.terminalStateByThreadKey ?? {};
654
+ return { terminalUiStateByThreadKey: Object.fromEntries(Object.entries(i).filter(([e]) => r(e))) };
655
655
  }
656
656
  function Ae() {
657
- return o(typeof window < "u" ? window.localStorage : void 0);
657
+ return i(typeof window < "u" ? window.localStorage : void 0);
658
658
  }
659
659
  function je(e) {
660
660
  let t = [], n = /* @__PURE__ */ new Set();
@@ -750,7 +750,7 @@ function Ve(e) {
750
750
  return e.trim().length > 0;
751
751
  }
752
752
  function B(e) {
753
- return n(e);
753
+ return o(e);
754
754
  }
755
755
  function He(e) {
756
756
  return e.map((e) => ({
@@ -803,9 +803,9 @@ function Ue(e, t, n, r = "horizontal") {
803
803
  });
804
804
  }
805
805
  function We(e, t) {
806
- let n = z(e);
807
- return t && n.terminalIds.length === 0 ? Ue(n, r, "new") : n.terminalOpen === t ? n : {
808
- ...n,
806
+ let r = z(e);
807
+ return t && r.terminalIds.length === 0 ? Ue(r, n, "new") : r.terminalOpen === t ? r : {
808
+ ...r,
809
809
  terminalOpen: t
810
810
  };
811
811
  }
@@ -900,8 +900,8 @@ function H(e, t) {
900
900
  let { [t]: n, ...r } = e;
901
901
  return r;
902
902
  }
903
- var $e = l()(s((e, t) => {
904
- let n = (t) => e((e) => {
903
+ var $e = l()(a((e, t) => {
904
+ let r = (t) => e((e) => {
905
905
  let n = B(t);
906
906
  return e.terminalUiStateByThreadKey[n] === void 0 && e.suppressedTerminalIdsByThreadKey[n] === void 0 && e.serverObservationsByThreadKey[n] === void 0 ? e : {
907
907
  terminalUiStateByThreadKey: H(e.terminalUiStateByThreadKey, n),
@@ -921,10 +921,10 @@ var $e = l()(s((e, t) => {
921
921
  terminalUiStateByThreadKey: {},
922
922
  serverObservationsByThreadKey: {},
923
923
  suppressedTerminalIdsByThreadKey: {},
924
- setTerminalOpen: (e, n) => {
924
+ setTerminalOpen: (e, r) => {
925
925
  let a = V(t().terminalUiStateByThreadKey, e);
926
- i(e, (e) => We(e, n), n && a.terminalIds.length === 0 ? {
927
- terminalId: r,
926
+ i(e, (e) => We(e, r), r && a.terminalIds.length === 0 ? {
927
+ terminalId: n,
928
928
  suppressed: !1
929
929
  } : void 0);
930
930
  },
@@ -971,8 +971,8 @@ var $e = l()(s((e, t) => {
971
971
  serverObservationsByThreadKey: d
972
972
  });
973
973
  },
974
- clearTerminalUiState: n,
975
- removeTerminalUiState: n,
974
+ clearTerminalUiState: r,
975
+ removeTerminalUiState: r,
976
976
  removeOrphanedTerminalUiStates: (t) => e((e) => {
977
977
  let n = new Set([
978
978
  ...Object.keys(e.terminalUiStateByThreadKey),
@@ -1019,13 +1019,13 @@ function ot(e, t) {
1019
1019
  return W?.threadKey === e && W.terminalId === t;
1020
1020
  }
1021
1021
  function st(e, t) {
1022
- for (let r of U) if (r.terminalId === t && n(r.threadRef) === e && r.focus()) return !0;
1022
+ for (let n of U) if (n.terminalId === t && o(n.threadRef) === e && n.focus()) return !0;
1023
1023
  return !1;
1024
1024
  }
1025
1025
  function K(e, t) {
1026
- let r = n(e);
1027
- W = st(r, t) ? null : {
1028
- threadKey: r,
1026
+ let n = o(e);
1027
+ W = st(n, t) ? null : {
1028
+ threadKey: n,
1029
1029
  terminalId: t
1030
1030
  };
1031
1031
  }
@@ -1042,35 +1042,35 @@ function ut(e, t) {
1042
1042
  n !== t && lt(e);
1043
1043
  }
1044
1044
  function dt(e, t) {
1045
- let r = n(e);
1046
- at = r === G ? null : r, K(e, t);
1045
+ let n = o(e);
1046
+ at = n === G ? null : n, K(e, t);
1047
1047
  }
1048
1048
  function ft(e, t) {
1049
- let r = n(e), i = at === r || it.get(t.root) === r && W?.threadKey === r;
1050
- i || (W = null), it.set(t.root, r), at = null, G = r;
1051
- let a = rt.get(r), o = () => {
1049
+ let n = o(e), r = at === n || it.get(t.root) === n && W?.threadKey === n;
1050
+ r || (W = null), it.set(t.root, n), at = null, G = n;
1051
+ let i = rt.get(n), a = () => {
1052
1052
  let e = t.root.ownerDocument.activeElement;
1053
1053
  if (!e) return;
1054
- let i = Array.from(U).find((t) => t.element?.contains(e));
1055
- i ? n(i.threadRef) === r && rt.set(r, { terminalId: i.terminalId }) : t.root.contains(e) && e.closest("[data-workspace-area=\"composer\"]") && rt.set(r, "composer");
1054
+ let r = Array.from(U).find((t) => t.element?.contains(e));
1055
+ r ? o(r.threadRef) === n && rt.set(n, { terminalId: r.terminalId }) : t.root.contains(e) && e.closest("[data-workspace-area=\"composer\"]") && rt.set(n, "composer");
1056
1056
  };
1057
- if (t.root.ownerDocument.addEventListener("focusin", o), !i) {
1058
- let n = V($e.getState().terminalUiStateByThreadKey, e), r = F(P.getState().byThreadKey, e), i = r.isOpen ? r.surfaces.find((e) => e.id === r.activeSurfaceId) : null;
1059
- a === "composer" ? t.focusComposer() : a && (n.terminalOpen && n.terminalGroups.find((e) => e.id === n.activeTerminalGroupId)?.terminalIds.includes(a.terminalId) || i?.kind === "terminal" && i.terminalIds.includes(a.terminalId)) ? K(e, a.terminalId) : n.terminalOpen && n.activeTerminalId ? K(e, n.activeTerminalId) : t.focusComposer();
1057
+ if (t.root.ownerDocument.addEventListener("focusin", a), !r) {
1058
+ let n = V($e.getState().terminalUiStateByThreadKey, e), r = F(P.getState().byThreadKey, e), a = r.isOpen ? r.surfaces.find((e) => e.id === r.activeSurfaceId) : null;
1059
+ i === "composer" ? t.focusComposer() : i && (n.terminalOpen && n.terminalGroups.find((e) => e.id === n.activeTerminalGroupId)?.terminalIds.includes(i.terminalId) || a?.kind === "terminal" && a.terminalIds.includes(i.terminalId)) ? K(e, i.terminalId) : n.terminalOpen && n.activeTerminalId ? K(e, n.activeTerminalId) : t.focusComposer();
1060
1060
  }
1061
- return i && o(), () => {
1062
- t.root.ownerDocument.removeEventListener("focusin", o), G === r && (G = null);
1061
+ return r && a(), () => {
1062
+ t.root.ownerDocument.removeEventListener("focusin", a), G === n && (G = null);
1063
1063
  };
1064
1064
  }
1065
1065
  function pt(e) {
1066
- W?.threadKey === n(e) && (W = null);
1066
+ W?.threadKey === o(e) && (W = null);
1067
1067
  }
1068
1068
  function mt(e, t) {
1069
- let r = n(e);
1070
- ot(r, t) && st(r, t) && (W = null);
1069
+ let n = o(e);
1070
+ ot(n, t) && st(n, t) && (W = null);
1071
1071
  }
1072
1072
  function ht(e) {
1073
- return U.add(e), ot(n(e.threadRef), e.terminalId) && e.focus() && (W = null), () => {
1073
+ return U.add(e), ot(o(e.threadRef), e.terminalId) && e.focus() && (W = null), () => {
1074
1074
  U.delete(e);
1075
1075
  };
1076
1076
  }