@intent-hq/web 2.383.7 → 2.383.8

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 (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{51Rp6_AF.js → 1pggOq7Y.js} +1 -1
  3. package/web/app/immutable/chunks/{BgjaD_Yy.js → 3Ldfn3Hk.js} +1 -1
  4. package/web/app/immutable/chunks/{B0SuIES7.js → 7gWOOPbU.js} +1 -1
  5. package/web/app/immutable/chunks/{CLUxyZqF.js → 7xJIif_I.js} +1 -1
  6. package/web/app/immutable/chunks/{lzc_ALaY.js → B-GeM0hN.js} +1 -1
  7. package/web/app/immutable/chunks/{C8ZC1xrW.js → B1xhmeEH.js} +1 -1
  8. package/web/app/immutable/chunks/{B6q3uVQG.js → B76xmWcE.js} +1 -1
  9. package/web/app/immutable/chunks/{DQZ6hbu0.js → B9nR8abu.js} +1 -1
  10. package/web/app/immutable/chunks/{BUDFO3oC.js → BAlOCGA0.js} +1 -1
  11. package/web/app/immutable/chunks/{DqH-hVUa.js → BJJHfc9t.js} +1 -1
  12. package/web/app/immutable/chunks/{BBrT6DIB.js → BK9M_z99.js} +1 -1
  13. package/web/app/immutable/chunks/{BXMl8g0k.js → BKS-pxip.js} +1 -1
  14. package/web/app/immutable/chunks/{lQcc1B6x.js → BLUz30qV.js} +1 -1
  15. package/web/app/immutable/chunks/{C5H3ErAr.js → BPXHGMqU.js} +1 -1
  16. package/web/app/immutable/chunks/{Dl2c_Q4j.js → BQDKcjOE.js} +1 -1
  17. package/web/app/immutable/chunks/{CqEyPGwj.js → BSVf-Bjr.js} +1 -1
  18. package/web/app/immutable/chunks/{C1IZMhCT.js → BTKxt0G5.js} +1 -1
  19. package/web/app/immutable/chunks/{Dqhi5681.js → BTQPEfI4.js} +1 -1
  20. package/web/app/immutable/chunks/{Dl4B5sLX.js → BURetyvc.js} +1 -1
  21. package/web/app/immutable/chunks/{DbD3dAy_.js → BUtc5GRR.js} +1 -1
  22. package/web/app/immutable/chunks/{C1dPOfxb.js → BVAdLfsa.js} +4 -4
  23. package/web/app/immutable/chunks/{9KbPq6ne.js → BYFX8NvB.js} +1 -1
  24. package/web/app/immutable/chunks/{DtekCANZ.js → BbV6sku_.js} +1 -1
  25. package/web/app/immutable/chunks/{lFCyJLs0.js → BbbgNz0Q.js} +1 -1
  26. package/web/app/immutable/chunks/{1VDAs3Ud.js → BdTfZwM8.js} +1 -1
  27. package/web/app/immutable/chunks/{BIsdYrnK.js → BhqgbIQr.js} +1 -1
  28. package/web/app/immutable/chunks/{96gE90DS.js → Bjm5XArF.js} +1 -1
  29. package/web/app/immutable/chunks/{BtI19qHa.js → BkfS5KoW.js} +13 -13
  30. package/web/app/immutable/chunks/{Q16zd2xh.js → BmlblCgy.js} +1 -1
  31. package/web/app/immutable/chunks/{8MucyzZK.js → BnbH2DvO.js} +1 -1
  32. package/web/app/immutable/chunks/{BZ1Q38PM.js → Bo1VuU-H.js} +1 -1
  33. package/web/app/immutable/chunks/{Dc0NoKVI.js → Bo7KS63f.js} +1 -1
  34. package/web/app/immutable/chunks/{C91EC830.js → BpfNraM2.js} +1 -1
  35. package/web/app/immutable/chunks/{CE-gn8fg.js → Brm4kmEq.js} +1 -1
  36. package/web/app/immutable/chunks/{CKjysSbd.js → BtxkToW7.js} +1 -1
  37. package/web/app/immutable/chunks/{D1Kvaw2U.js → Buso8jHT.js} +1 -1
  38. package/web/app/immutable/chunks/{DCzWLn9w.js → ByDL4Wt0.js} +1 -1
  39. package/web/app/immutable/chunks/{DLS35Cs2.js → C2o4LFKC.js} +2 -2
  40. package/web/app/immutable/chunks/{BUchcLc3.js → C6AhVpEM.js} +3 -3
  41. package/web/app/immutable/chunks/{Cpw-AI-k.js → C89-HR3N.js} +4 -4
  42. package/web/app/immutable/chunks/{ZtnoAnS2.js → C8za2RwY.js} +1 -1
  43. package/web/app/immutable/chunks/{SnC5sLK-.js → CC1pNuhl.js} +1 -1
  44. package/web/app/immutable/chunks/{38BB0grB.js → CDaqERFv.js} +1 -1
  45. package/web/app/immutable/chunks/{CzRvdM50.js → CE0T7dwE.js} +3 -3
  46. package/web/app/immutable/chunks/{Dj8digI5.js → CGOaYbWk.js} +1 -1
  47. package/web/app/immutable/chunks/{DOAyQZ8n.js → CGnOIrwW.js} +1 -1
  48. package/web/app/immutable/chunks/{B7ZVMWBx.js → CJL0nxkZ.js} +1 -1
  49. package/web/app/immutable/chunks/{C3KL0Dob.js → CKyxiFOy.js} +2 -2
  50. package/web/app/immutable/chunks/{DnNC4gf3.js → COBU-CLw.js} +3 -3
  51. package/web/app/immutable/chunks/{B3WV7a-V.js → COW99wsu.js} +1 -1
  52. package/web/app/immutable/chunks/{B9bXgFyu.js → CRR7Y95m.js} +2 -2
  53. package/web/app/immutable/chunks/{BgZpMc5-.js → CRfEdILh.js} +1 -1
  54. package/web/app/immutable/chunks/{C4ItHUxb.js → CS4mJHYc.js} +1 -1
  55. package/web/app/immutable/chunks/{Cxb8aRlA.js → CSRKWN2m.js} +2 -2
  56. package/web/app/immutable/chunks/{CS3H-hA4.js → CShcKF5d.js} +1 -1
  57. package/web/app/immutable/chunks/{5moVT_HQ.js → CUfjsZQQ.js} +1 -1
  58. package/web/app/immutable/chunks/{BB2DpGJV.js → CZsHRLvg.js} +1 -1
  59. package/web/app/immutable/chunks/{CtCH4W1N.js → C_zDgOHy.js} +1 -1
  60. package/web/app/immutable/chunks/{BfSTFUKA.js → CaiHVgqy.js} +1 -1
  61. package/web/app/immutable/chunks/{D_Fe9jJy.js → Cb9Smg8Z.js} +1 -1
  62. package/web/app/immutable/chunks/{Cb9atCGq.js → CbT0r42d.js} +1 -1
  63. package/web/app/immutable/chunks/{7da8sugr.js → Cc4N9YOF.js} +2 -2
  64. package/web/app/immutable/chunks/{DhQSNgxc.js → Cg61PLZh.js} +1 -1
  65. package/web/app/immutable/chunks/{DsCz_Hld.js → CjpmxxIF.js} +1 -1
  66. package/web/app/immutable/chunks/{SwH0lZVC.js → Cka0AqTN.js} +1 -1
  67. package/web/app/immutable/chunks/{C9fVl7VH.js → CkvXIU5f.js} +1 -1
  68. package/web/app/immutable/chunks/{BbHdeR3v.js → ClZz0jys.js} +1 -1
  69. package/web/app/immutable/chunks/{Cxs-r6qH.js → ClfSST38.js} +1 -1
  70. package/web/app/immutable/chunks/{NaXnyxXD.js → CmQgxntP.js} +1 -1
  71. package/web/app/immutable/chunks/{C56HY_cI.js → CmoThujO.js} +1 -1
  72. package/web/app/immutable/chunks/{i2uLOz57.js → CpwGgnWV.js} +1 -1
  73. package/web/app/immutable/chunks/{DaLNZosE.js → CqjTdgdP.js} +1 -1
  74. package/web/app/immutable/chunks/{DBOkAv2-.js → CzAdFBS-.js} +1 -1
  75. package/web/app/immutable/chunks/{B6ERx__s.js → D0DWZnGH.js} +2 -2
  76. package/web/app/immutable/chunks/{DqMZWY-u.js → D0i8GwSa.js} +2 -2
  77. package/web/app/immutable/chunks/{DITUyjV2.js → D0n-4lqf.js} +3 -3
  78. package/web/app/immutable/chunks/{DGSdOlov.js → D2EoEx7R.js} +1 -1
  79. package/web/app/immutable/chunks/{DyIsX23v.js → D2Y3lcdt.js} +4 -4
  80. package/web/app/immutable/chunks/{CzMfcD76.js → D3qmsAQt.js} +2 -2
  81. package/web/app/immutable/chunks/{DggzSry-.js → D5EQeUyi.js} +1 -1
  82. package/web/app/immutable/chunks/{DT_iJHxn.js → DAreoJms.js} +1 -1
  83. package/web/app/immutable/chunks/{cWnGUUZk.js → DBD3Fgdf.js} +1 -1
  84. package/web/app/immutable/chunks/{CEl8yEuC.js → DBvm0g7B.js} +1 -1
  85. package/web/app/immutable/chunks/{3FaPVDTk.js → DDYaIqxc.js} +1 -1
  86. package/web/app/immutable/chunks/{tV0w-z-Q.js → DTDpxeis.js} +1 -1
  87. package/web/app/immutable/chunks/{CQvGDYQV.js → DU7k8Meq.js} +1 -1
  88. package/web/app/immutable/chunks/{Bf16PEz1.js → DUUjp9sb.js} +1 -1
  89. package/web/app/immutable/chunks/{CaVcxIX_.js → DaNZLNee.js} +1 -1
  90. package/web/app/immutable/chunks/{SSdhXyvx.js → DaVnXn1w.js} +1 -1
  91. package/web/app/immutable/chunks/{FoSxZj2s.js → Dbkui2NJ.js} +1 -1
  92. package/web/app/immutable/chunks/{amTgh_yM.js → Dea7iEsq.js} +1 -1
  93. package/web/app/immutable/chunks/{Bwa_PJLB.js → Df8HaglQ.js} +1 -1
  94. package/web/app/immutable/chunks/{CmbyIv2W.js → DgSmYey_.js} +1 -1
  95. package/web/app/immutable/chunks/{C2BnXWav.js → DhBr4igy.js} +1 -1
  96. package/web/app/immutable/chunks/{DgiZ-0Sp.js → DiKXd1w8.js} +2 -2
  97. package/web/app/immutable/chunks/{NqwdDVdt.js → DqkmESML.js} +1 -1
  98. package/web/app/immutable/chunks/{xGj0i83D.js → DrG_DaSS.js} +6 -6
  99. package/web/app/immutable/chunks/{BGm3f58g.js → DrOujub9.js} +1 -1
  100. package/web/app/immutable/chunks/{DMVD9ZWm.js → DsKSelM2.js} +1 -1
  101. package/web/app/immutable/chunks/{Y3x17kvu.js → DtAW1k1y.js} +1 -1
  102. package/web/app/immutable/chunks/{CIeXUP7u.js → DtKxKldd.js} +1 -1
  103. package/web/app/immutable/chunks/{Byb6yuNY.js → Dua5IJ1m.js} +1 -1
  104. package/web/app/immutable/chunks/{aoCeefP4.js → DxM5221X.js} +1 -1
  105. package/web/app/immutable/chunks/{9p0DyBPU.js → DyLYpcbU.js} +1 -1
  106. package/web/app/immutable/chunks/{DwDabzpx.js → DyU1d4KO.js} +1 -1
  107. package/web/app/immutable/chunks/{D8bef7T8.js → K0UaKTlA.js} +1 -1
  108. package/web/app/immutable/chunks/{CQlHJWbs.js → M1pm4Ylz.js} +3 -3
  109. package/web/app/immutable/chunks/{m2kIPDiE.js → M4SSivqw.js} +1 -1
  110. package/web/app/immutable/chunks/{CqhHB0m1.js → Ok-Tb49z.js} +3 -3
  111. package/web/app/immutable/chunks/{BhcBqtJg.js → PWCv1nwS.js} +1 -1
  112. package/web/app/immutable/chunks/{DGP-y2GB.js → TwgPo_u9.js} +3 -3
  113. package/web/app/immutable/chunks/{CdDve0EN.js → a-NM4LeO.js} +1 -1
  114. package/web/app/immutable/chunks/{BcUHkjB6.js → c1qYicwM.js} +1 -1
  115. package/web/app/immutable/chunks/{CTYV2WCR.js → e_FRlhPf.js} +1 -1
  116. package/web/app/immutable/chunks/{D14F6Zen.js → fKj7i94n.js} +1 -1
  117. package/web/app/immutable/chunks/{veocPVpA.js → hoVWzIJA.js} +1 -1
  118. package/web/app/immutable/chunks/{B91a7NqB.js → ijAQGDk2.js} +1 -1
  119. package/web/app/immutable/chunks/{CteMcmUe.js → j9JAHeUU.js} +2 -2
  120. package/web/app/immutable/chunks/{B3zWdyp-.js → jVKXeiL6.js} +1 -1
  121. package/web/app/immutable/chunks/{BcQ6Rg0V.js → jbr21ium.js} +1 -1
  122. package/web/app/immutable/chunks/{CaCH7xka.js → m6pGB8MK.js} +1 -1
  123. package/web/app/immutable/chunks/{SDBQMo24.js → pxZ1G7sU.js} +1 -1
  124. package/web/app/immutable/chunks/{Dd6jkKNK.js → rotY2sdQ.js} +1 -1
  125. package/web/app/immutable/chunks/{CPIZev3Z.js → tDrnMawv.js} +1 -1
  126. package/web/app/immutable/chunks/{C_1zy40-.js → vjpfI6xX.js} +1 -1
  127. package/web/app/immutable/chunks/{BM2XSA6g.js → xG-zLBf8.js} +1 -1
  128. package/web/app/immutable/chunks/{CEOk8g-Q.js → yDR0_Br6.js} +3 -3
  129. package/web/app/immutable/entry/{app.oKB02DpO.js → app.PgiJw0D4.js} +2 -2
  130. package/web/app/immutable/entry/start.C2TmF15J.js +1 -0
  131. package/web/app/immutable/nodes/{0.Cj75U9Pb.js → 0.cff5OhJc.js} +1 -1
  132. package/web/app/immutable/nodes/{1.COmRB5Gs.js → 1.D2tI4cty.js} +1 -1
  133. package/web/app/immutable/nodes/{10.B-EGmrBP.js → 10.BnJGsWqJ.js} +4 -4
  134. package/web/app/immutable/nodes/{11.CHJVqhXh.js → 11.D8yEv7E-.js} +1 -1
  135. package/web/app/immutable/nodes/{15.DvvqcqqW.js → 15.CozJxxNW.js} +1 -1
  136. package/web/app/immutable/nodes/{19.CFGkesVY.js → 19.DH3ipUNG.js} +2 -2
  137. package/web/app/immutable/nodes/{2.BSKohF8j.js → 2.DX0DfJJh.js} +4 -4
  138. package/web/app/immutable/nodes/{3.CgM283V9.js → 3.Bxlo4Xts.js} +1 -1
  139. package/web/app/immutable/nodes/{4.pSSQL5ZR.js → 4.BJEI4s-5.js} +1 -1
  140. package/web/app/immutable/nodes/{5.gjcZy0Yo.js → 5.CLAljKic.js} +1 -1
  141. package/web/app/immutable/nodes/{6.mfPH3Xl6.js → 6.DDVeuDZh.js} +1 -1
  142. package/web/app/immutable/nodes/{7.hkLeTg6x.js → 7.w-I6a2X1.js} +1 -1
  143. package/web/app/immutable/nodes/{8.CwwxHkuu.js → 8.BBjC7avZ.js} +1 -1
  144. package/web/app/immutable/nodes/{9.VYVO4dZo.js → 9.ByPAfGSa.js} +13 -13
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.MWx9NKvl.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intent-hq/web",
3
- "version": "2.383.7",
3
+ "version": "2.383.8",
4
4
  "description": "Intent in the browser: a standalone web server for Intent machines.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1 +1 @@
1
- import{h7 as O,gP as J,JJ as P,Kx as U,Dv as j,u4 as q,v1 as K,A_ as N,A$ as V,JH as z,JI as Q,B0 as X}from"./_LtUY0jS.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./VxaCN40t.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./BsOWc0fD.js";import{g as ne}from"./BhcBqtJg.js";import{bm as l}from"./C0QTy0Sy.js";import{z as oe,S as y}from"./C2jYl_tm.js";import{B as h,S as C,Q as ce}from"./Bqd7fdCF.js";import{al as le,aj as E}from"./DLS35Cs2.js";import{g as se}from"./wjh5cuBI.js";function A(e,a){const n=f.select(e.state),o=S.select(e.state);if(!o)return null;const c=n.indexOf(o),s=c+(a==="left"?-1:1),p=n[s];return c<0||!p?null:(e.dispatch(q(o,p,a==="left"?"before":"after")),o)}function B(e){const a=S.select(e);return a&&f.select(e).includes(a)?a:null}function m(e,a,n){const o=B(e.state),c=o?`/workspace/${o}`:ne(e.state);return a!==c&&n(c),o}function ie(e,a,n,o){return e.dispatch(O(a)),m(e,n,o),a}function I(e,a){const o=a.match(/^\/workspace\/([^/]+)/)?.[1];return o?o==="new"?null:o:null}function R(e,a,n,o){if(n==="/")return D(e,a==="next"?0:"last",n,o);e.dispatch(a==="next"?z():Q());const c=S.select(e.state);if(!c)return null;const s=`/workspace/${c}`;return n!==s&&o(s),c}function re(e,a,n){const o=I(e,a);return o?ie(e,o,a,n):null}function pe(e,a,n){const o=I(e,a);if(!o)return null;const c=Z.select(e.state,o);if(!c)return null;const s=c.tabs.find(v=>v.id===c.activeTabId),p=c.tabs.length===0&&c.activeTabId===null,g=M.select(e.state,o)>1&&(p||c.tabs.length===1&&s!==void 0&&s.closable!==!1);if((!s||s.closable===!1)&&!g)return null;const T=n??se(o)?.availableCanvasWidth??void 0;return e.dispatch(J(o,void 0,T)),s?.id??c.id}function ue(e,a){const n=e.state.panelLayout.byWorkspaceId[a];return!n||n.restoreStatus==="pending"?!1:ee.select(e.state,a).length===0}function de(e,a,n){B(e.state)||e.dispatch(P(0)),m(e,a,n)}function L(e,a,{navigate:n,closeWindow:o}){return o?(o(),"window"):(m(e,a,n),null)}function be(e,a,n){const o=I(e,a);return o?pe(e,a,n.availableCanvasWidth)!==null?"panel":ue(e,o)?(e.dispatch(O(o)),f.select(e.state).length>0?(de(e,a,n.navigate),"workspace"):L(e,a,n)??"workspace"):null:f.select(e.state).length>0?null:L(e,a,n)}function fe(e,a,n){return e.dispatch(X()),m(e,a,n)}function ke(e,a,n){const o=a.match(/^\/workspace\/([^/]+)/),c=o&&o[1]!=="new"?o[1]:null,s=Y.select(e.state),p=c?ae.select(e.state,c):null;return c&&p&&(!s||p.closedAt>=s.closedAt)?p.kind==="column"?(e.dispatch(N(c)),"column"):(e.dispatch(V(c)),p.kind):s?(fe(e,a,n),"workspace"):null}function _e(e,a){const n=a.match(/^\/workspace\/([^/]+)/),o=n&&n[1]!=="new"?n[1]:null;if(!o)return null;const c=K(o);return e.dispatch(c),te.select(e.state,o)}function D(e,a,n,o){const c=f.select(e.state),s=a==="last"?c.length-1:a;return s<0||s>=c.length?null:(e.dispatch(P(s)),m(e,n,o))}function We({isMac:e,register:a,store:n,getCurrentPath:o,navigate:c,openNewWorkspace:s,getRailMachineIds:p,onCreateAgent:g,onCreateNote:T,onCreateTerminal:v,onCreateBrowser:$,onWorkspaceTabMoved:W,closeWindow:F,resolveBinding:w}){const r=e?{meta:!0}:{ctrl:!0},G=oe("TOGGLE_SIDEBAR",e),k=t=>()=>t(o()),H=t=>()=>{const i=o().match(/^\/workspace\/([^/]+)/);i?.[1]&&i[1]!=="new"&&t(i[1])},u=t=>w?{binding:()=>w(t)}:{},_=t=>w?.(t)??ce(t);a({...u("global.new-space"),...r,key:"n",global:!0,description:l.workspace_shortcuts_newSpace_description(),action:s}),a({...u("panel.toggle-sidebar"),...G,global:!0,description:y.TOGGLE_SIDEBAR.label,action:()=>n.dispatch(U())}),a({...u("navigation.new-tab"),...r,key:"t",global:!0,description:l.workspace_shortcuts_newPanel_description(),action:k(t=>_e(n,t))});for(const[t,i,b,d]of[["workspace.new-agent","a",l.ui_shortcuts_newAgent_label(),g],["workspace.new-note","n",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_note_label()}),T],["workspace.new-terminal","t",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_terminal_label()}),v],["workspace.new-browser","b",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_browser_label()}),$]])d&&a({...u(t),...r,key:i,alt:!0,global:!0,allowInTerminal:!0,description:b,action:H(d)});a({...u("navigation.close-tab"),...r,key:"w",global:!0,description:l.workspace_shortcuts_closePanelTab_description(),action:k(t=>be(n,t,{navigate:c,closeWindow:F}))}),a({...u("navigation.close-space-tab"),...r,key:"w",shift:!0,global:!0,description:l.workspace_shortcuts_closeSpaceTab_description(),action:k(t=>re(n,t,c))}),a({...u("navigation.reopen-tab"),...r,key:"t",shift:!0,global:!0,description:l.workspace_shortcuts_reopenClosedTabOrSpace_description(),action:k(t=>ke(n,t,c))}),a({...u("navigation.move-space-tab-left"),...r,key:"ArrowLeft",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_LEFT.label,action:()=>{const t=A(n,"left");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}}),a({...u("navigation.move-space-tab-right"),...r,key:"ArrowRight",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_RIGHT.label,action:()=>{const t=A(n,"right");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}});for(const[t,i]of[["next",!1],["previous",!0]]){a({...u(t==="next"?"global.next-space":"global.previous-space"),key:"Tab",ctrl:!0,shift:i,global:!0,description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))});const b=t==="next"?"global.next-space-alt":"global.previous-space-alt";a({...u(b),...r,key:t==="next"?"}":"{",shift:!0,global:!0,allowInTerminal:!0,preferLocal:!0,enabled:d=>!w||!h(b,d,w,e),description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))})}const x=t=>{t===1?c("/"):D(n,t===9?"last":t-2,o(),c)};for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>_("navigation.go-to-device").replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>E.select(n.state)&&!h("navigation.go-to-device",i,_,e),description:l.machineRail_nav_ariaLabel(),action:()=>{const i=p?.()??le.select(n.state).map(d=>d.id),b=i[t===9?i.length-1:t-1];b&&n.dispatch(j(b))}});for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>C["navigation.go-to-device"].replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>!E.select(n.state)&&_("navigation.go-to-tab")===C["navigation.go-to-tab"]&&!h("navigation.go-to-device",i,_,e),description:l.ui_shortcuts_goToTab_label(),action:()=>x(t)});for(let t=1;t<=9;t++)a({binding:()=>_("navigation.go-to-tab").replace(/([1-8])-9$/,String(t)),...r,alt:!0,key:String(t),global:!0,allowInTerminal:!0,enabled:i=>!h("navigation.go-to-tab",i,_,e),description:t===1?l.home_navigation_description():t===9?l.workspace_shortcuts_selectLastSpaceTab_description():l.workspace_shortcuts_selectSpaceTab_description({digit:t}),action:()=>x(t)})}export{be as c,We as r};
1
+ import{h7 as O,gP as J,JJ as P,Kx as U,Dv as j,u4 as q,v1 as K,A_ as N,A$ as V,JH as z,JI as Q,B0 as X}from"./_LtUY0jS.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./VxaCN40t.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./BsOWc0fD.js";import{g as ne}from"./PWCv1nwS.js";import{bm as l}from"./C0QTy0Sy.js";import{z as oe,S as y}from"./C2jYl_tm.js";import{B as h,S as C,Q as ce}from"./Bqd7fdCF.js";import{al as le,aj as E}from"./C2o4LFKC.js";import{g as se}from"./wjh5cuBI.js";function A(e,a){const n=f.select(e.state),o=S.select(e.state);if(!o)return null;const c=n.indexOf(o),s=c+(a==="left"?-1:1),p=n[s];return c<0||!p?null:(e.dispatch(q(o,p,a==="left"?"before":"after")),o)}function B(e){const a=S.select(e);return a&&f.select(e).includes(a)?a:null}function m(e,a,n){const o=B(e.state),c=o?`/workspace/${o}`:ne(e.state);return a!==c&&n(c),o}function ie(e,a,n,o){return e.dispatch(O(a)),m(e,n,o),a}function I(e,a){const o=a.match(/^\/workspace\/([^/]+)/)?.[1];return o?o==="new"?null:o:null}function R(e,a,n,o){if(n==="/")return D(e,a==="next"?0:"last",n,o);e.dispatch(a==="next"?z():Q());const c=S.select(e.state);if(!c)return null;const s=`/workspace/${c}`;return n!==s&&o(s),c}function re(e,a,n){const o=I(e,a);return o?ie(e,o,a,n):null}function pe(e,a,n){const o=I(e,a);if(!o)return null;const c=Z.select(e.state,o);if(!c)return null;const s=c.tabs.find(v=>v.id===c.activeTabId),p=c.tabs.length===0&&c.activeTabId===null,g=M.select(e.state,o)>1&&(p||c.tabs.length===1&&s!==void 0&&s.closable!==!1);if((!s||s.closable===!1)&&!g)return null;const T=n??se(o)?.availableCanvasWidth??void 0;return e.dispatch(J(o,void 0,T)),s?.id??c.id}function ue(e,a){const n=e.state.panelLayout.byWorkspaceId[a];return!n||n.restoreStatus==="pending"?!1:ee.select(e.state,a).length===0}function de(e,a,n){B(e.state)||e.dispatch(P(0)),m(e,a,n)}function L(e,a,{navigate:n,closeWindow:o}){return o?(o(),"window"):(m(e,a,n),null)}function be(e,a,n){const o=I(e,a);return o?pe(e,a,n.availableCanvasWidth)!==null?"panel":ue(e,o)?(e.dispatch(O(o)),f.select(e.state).length>0?(de(e,a,n.navigate),"workspace"):L(e,a,n)??"workspace"):null:f.select(e.state).length>0?null:L(e,a,n)}function fe(e,a,n){return e.dispatch(X()),m(e,a,n)}function ke(e,a,n){const o=a.match(/^\/workspace\/([^/]+)/),c=o&&o[1]!=="new"?o[1]:null,s=Y.select(e.state),p=c?ae.select(e.state,c):null;return c&&p&&(!s||p.closedAt>=s.closedAt)?p.kind==="column"?(e.dispatch(N(c)),"column"):(e.dispatch(V(c)),p.kind):s?(fe(e,a,n),"workspace"):null}function _e(e,a){const n=a.match(/^\/workspace\/([^/]+)/),o=n&&n[1]!=="new"?n[1]:null;if(!o)return null;const c=K(o);return e.dispatch(c),te.select(e.state,o)}function D(e,a,n,o){const c=f.select(e.state),s=a==="last"?c.length-1:a;return s<0||s>=c.length?null:(e.dispatch(P(s)),m(e,n,o))}function We({isMac:e,register:a,store:n,getCurrentPath:o,navigate:c,openNewWorkspace:s,getRailMachineIds:p,onCreateAgent:g,onCreateNote:T,onCreateTerminal:v,onCreateBrowser:$,onWorkspaceTabMoved:W,closeWindow:F,resolveBinding:w}){const r=e?{meta:!0}:{ctrl:!0},G=oe("TOGGLE_SIDEBAR",e),k=t=>()=>t(o()),H=t=>()=>{const i=o().match(/^\/workspace\/([^/]+)/);i?.[1]&&i[1]!=="new"&&t(i[1])},u=t=>w?{binding:()=>w(t)}:{},_=t=>w?.(t)??ce(t);a({...u("global.new-space"),...r,key:"n",global:!0,description:l.workspace_shortcuts_newSpace_description(),action:s}),a({...u("panel.toggle-sidebar"),...G,global:!0,description:y.TOGGLE_SIDEBAR.label,action:()=>n.dispatch(U())}),a({...u("navigation.new-tab"),...r,key:"t",global:!0,description:l.workspace_shortcuts_newPanel_description(),action:k(t=>_e(n,t))});for(const[t,i,b,d]of[["workspace.new-agent","a",l.ui_shortcuts_newAgent_label(),g],["workspace.new-note","n",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_note_label()}),T],["workspace.new-terminal","t",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_terminal_label()}),v],["workspace.new-browser","b",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_browser_label()}),$]])d&&a({...u(t),...r,key:i,alt:!0,global:!0,allowInTerminal:!0,description:b,action:H(d)});a({...u("navigation.close-tab"),...r,key:"w",global:!0,description:l.workspace_shortcuts_closePanelTab_description(),action:k(t=>be(n,t,{navigate:c,closeWindow:F}))}),a({...u("navigation.close-space-tab"),...r,key:"w",shift:!0,global:!0,description:l.workspace_shortcuts_closeSpaceTab_description(),action:k(t=>re(n,t,c))}),a({...u("navigation.reopen-tab"),...r,key:"t",shift:!0,global:!0,description:l.workspace_shortcuts_reopenClosedTabOrSpace_description(),action:k(t=>ke(n,t,c))}),a({...u("navigation.move-space-tab-left"),...r,key:"ArrowLeft",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_LEFT.label,action:()=>{const t=A(n,"left");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}}),a({...u("navigation.move-space-tab-right"),...r,key:"ArrowRight",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_RIGHT.label,action:()=>{const t=A(n,"right");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}});for(const[t,i]of[["next",!1],["previous",!0]]){a({...u(t==="next"?"global.next-space":"global.previous-space"),key:"Tab",ctrl:!0,shift:i,global:!0,description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))});const b=t==="next"?"global.next-space-alt":"global.previous-space-alt";a({...u(b),...r,key:t==="next"?"}":"{",shift:!0,global:!0,allowInTerminal:!0,preferLocal:!0,enabled:d=>!w||!h(b,d,w,e),description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))})}const x=t=>{t===1?c("/"):D(n,t===9?"last":t-2,o(),c)};for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>_("navigation.go-to-device").replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>E.select(n.state)&&!h("navigation.go-to-device",i,_,e),description:l.machineRail_nav_ariaLabel(),action:()=>{const i=p?.()??le.select(n.state).map(d=>d.id),b=i[t===9?i.length-1:t-1];b&&n.dispatch(j(b))}});for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>C["navigation.go-to-device"].replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>!E.select(n.state)&&_("navigation.go-to-tab")===C["navigation.go-to-tab"]&&!h("navigation.go-to-device",i,_,e),description:l.ui_shortcuts_goToTab_label(),action:()=>x(t)});for(let t=1;t<=9;t++)a({binding:()=>_("navigation.go-to-tab").replace(/([1-8])-9$/,String(t)),...r,alt:!0,key:String(t),global:!0,allowInTerminal:!0,enabled:i=>!h("navigation.go-to-tab",i,_,e),description:t===1?l.home_navigation_description():t===9?l.workspace_shortcuts_selectLastSpaceTab_description():l.workspace_shortcuts_selectSpaceTab_description({digit:t}),action:()=>x(t)})}export{be as c,We as r};
@@ -1,4 +1,4 @@
1
- import{g as ie}from"./CaCH7xka.js";import{s as re}from"./DGSdOlov.js";import{b as p,ay as b,X as $,a1 as ae,aP as ne,bh as oe,V as le,a_ as ce,U as he,aZ as de,b0 as ue,Y as fe,T as pe,z as j,r as Se,aW as vt,am as ge,aU as ye,ab as me,aG as Te}from"./Cpw-AI-k.js";import{c as Ee}from"./3FaPVDTk.js";import{aR as _e}from"./BfSTFUKA.js";var At=(function(){var t=p(function(V,o,f,n){for(f=f||{},n=V.length;n--;f[V[n]]=o);return f},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],c=[1,9],h=[1,11],u=[1,16],l=[1,17],m=[1,18],y=[1,19],_=[1,33],L=[1,20],N=[1,21],D=[1,22],S=[1,23],w=[1,24],C=[1,26],F=[1,27],I=[1,28],P=[1,29],v=[1,30],z=[1,31],at=[1,32],nt=[1,35],ot=[1,36],lt=[1,37],ct=[1,38],K=[1,34],g=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ht=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],It=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,f,n,T,E,i,B){var d=i.length-1;switch(E){case 3:return T.setRootDoc(i[d]),i[d];case 4:this.$=[];break;case 5:i[d]!="nl"&&(i[d-1].push(i[d]),this.$=i[d-1]);break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:const Q=i[d-1];Q.description=T.trimColon(i[d]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:const Tt=T.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var G=i[d],X=i[d-2].trim();if(i[d].match(":")){var ut=i[d].split(":");G=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,7]),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(g,[2,11]),t(g,[2,12],{14:[1,40],15:[1,41]}),t(g,[2,16]),{18:[1,42]},t(g,[2,18],{20:[1,43]}),{23:[1,44]},t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(g,[2,28]),{34:[1,49]},{36:[1,50]},t(g,[2,31]),{13:51,24:_,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ht,[2,44],{58:[1,56]}),t(ht,[2,45],{58:[1,57]}),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,41]),t(g,[2,6]),t(g,[2,13]),{13:58,24:_,57:K},t(g,[2,17]),t(It,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(g,[2,29]),t(g,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(g,[2,14],{14:[1,71]}),{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,72],22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(g,[2,34]),t(g,[2,35]),t(g,[2,36]),t(g,[2,37]),t(ht,[2,46]),t(ht,[2,47]),t(g,[2,15]),t(g,[2,19]),t(It,r,{7:78}),t(g,[2,26]),t(g,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,81],22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,32]),t(g,[2,33]),t(g,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,f){if(f.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=f,n}},"parseError"),parse:p(function(o){var f=this,n=[0],T=[],E=[null],i=[],B=this.table,d="",G=0,X=0,ut=2,Q=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(o,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var ee=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(R){n.length=n.length-2*R,E.length=E.length-R,i.length=i.length-R}p(se,"popStack");function Rt(){var R;return R=T.pop()||k.lex()||Q,typeof R!="number"&&(R instanceof Array&&(T=R,R=T.pop()),R=f.symbols_[R]||R),R}p(Rt,"lex");for(var x,U,O,bt,J={},ft,Y,Nt,pt;;){if(U=n[n.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((x===null||typeof x>"u")&&(x=Rt()),O=B[U]&&B[U][x]),typeof O>"u"||!O.length||!O[0]){var kt="";pt=[];for(ft in B[U])this.terminals_[ft]&&ft>ut&&pt.push("'"+this.terminals_[ft]+"'");k.showPosition?kt="Parse error on line "+(G+1)+`:
1
+ import{g as ie}from"./m6pGB8MK.js";import{s as re}from"./D2EoEx7R.js";import{b as p,ay as b,X as $,a1 as ae,aP as ne,bh as oe,V as le,a_ as ce,U as he,aZ as de,b0 as ue,Y as fe,T as pe,z as j,r as Se,aW as vt,am as ge,aU as ye,ab as me,aG as Te}from"./C89-HR3N.js";import{c as Ee}from"./DDYaIqxc.js";import{aR as _e}from"./CaiHVgqy.js";var At=(function(){var t=p(function(V,o,f,n){for(f=f||{},n=V.length;n--;f[V[n]]=o);return f},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],c=[1,9],h=[1,11],u=[1,16],l=[1,17],m=[1,18],y=[1,19],_=[1,33],L=[1,20],N=[1,21],D=[1,22],S=[1,23],w=[1,24],C=[1,26],F=[1,27],I=[1,28],P=[1,29],v=[1,30],z=[1,31],at=[1,32],nt=[1,35],ot=[1,36],lt=[1,37],ct=[1,38],K=[1,34],g=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ht=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],It=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,f,n,T,E,i,B){var d=i.length-1;switch(E){case 3:return T.setRootDoc(i[d]),i[d];case 4:this.$=[];break;case 5:i[d]!="nl"&&(i[d-1].push(i[d]),this.$=i[d-1]);break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:const Q=i[d-1];Q.description=T.trimColon(i[d]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:const Tt=T.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var G=i[d],X=i[d-2].trim();if(i[d].match(":")){var ut=i[d].split(":");G=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,7]),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(g,[2,11]),t(g,[2,12],{14:[1,40],15:[1,41]}),t(g,[2,16]),{18:[1,42]},t(g,[2,18],{20:[1,43]}),{23:[1,44]},t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(g,[2,28]),{34:[1,49]},{36:[1,50]},t(g,[2,31]),{13:51,24:_,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ht,[2,44],{58:[1,56]}),t(ht,[2,45],{58:[1,57]}),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,41]),t(g,[2,6]),t(g,[2,13]),{13:58,24:_,57:K},t(g,[2,17]),t(It,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(g,[2,29]),t(g,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(g,[2,14],{14:[1,71]}),{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,72],22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(g,[2,34]),t(g,[2,35]),t(g,[2,36]),t(g,[2,37]),t(ht,[2,46]),t(ht,[2,47]),t(g,[2,15]),t(g,[2,19]),t(It,r,{7:78}),t(g,[2,26]),t(g,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,81],22:y,24:_,25:L,26:N,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,32]),t(g,[2,33]),t(g,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,f){if(f.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=f,n}},"parseError"),parse:p(function(o){var f=this,n=[0],T=[],E=[null],i=[],B=this.table,d="",G=0,X=0,ut=2,Q=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(o,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var ee=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(R){n.length=n.length-2*R,E.length=E.length-R,i.length=i.length-R}p(se,"popStack");function Rt(){var R;return R=T.pop()||k.lex()||Q,typeof R!="number"&&(R instanceof Array&&(T=R,R=T.pop()),R=f.symbols_[R]||R),R}p(Rt,"lex");for(var x,U,O,bt,J={},ft,Y,Nt,pt;;){if(U=n[n.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((x===null||typeof x>"u")&&(x=Rt()),O=B[U]&&B[U][x]),typeof O>"u"||!O.length||!O[0]){var kt="";pt=[];for(ft in B[U])this.terminals_[ft]&&ft>ut&&pt.push("'"+this.terminals_[ft]+"'");k.showPosition?kt="Parse error on line "+(G+1)+`:
2
2
  `+k.showPosition()+`
3
3
  Expecting `+pt.join(", ")+", got '"+(this.terminals_[x]||x)+"'":kt="Parse error on line "+(G+1)+": Unexpected "+(x==Q?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(kt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:pt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+x);switch(O[0]){case 1:n.push(x),E.push(k.yytext),i.push(k.yylloc),n.push(O[1]),x=null,X=k.yyleng,d=k.yytext,G=k.yylineno,_t=k.yylloc;break;case 2:if(Y=this.productions_[O[1]][1],J.$=E[E.length-Y],J._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},ee&&(J._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),bt=this.performAction.apply(J,[d,X,G,W.yy,O[1],E,i].concat(Tt)),typeof bt<"u")return bt;Y&&(n=n.slice(0,-1*Y*2),E=E.slice(0,-1*Y),i=i.slice(0,-1*Y)),n.push(this.productions_[O[1]][0]),E.push(J.$),i.push(J._$),Nt=B[n[n.length-2]][n[n.length-1]],n.push(Nt);break;case 3:return!0}}return!0},"parse")},te=(function(){var V={EOF:1,parseError:p(function(f,n){if(this.yy.parser)this.yy.parser.parseError(f,n);else throw new Error(f)},"parseError"),setInput:p(function(o,f){return this.yy=f||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var f=o.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:p(function(o){var f=o.length,n=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===T.length?this.yylloc.first_column:0)+T[T.length-n.length].length-n[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var o=this.pastInput(),f=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{t as Ge,bo as w,bm as c,bw as qe,b as He,br as ir,bs as mt,bq as zr}from"./C0QTy0Sy.js";import{bs as Ke,ay as X,be as wt,b$ as lt,b_ as H,bO as Q,W as k,bS as y,aD as e,a7 as ht,bl as Ie,bn as je,c9 as f,aA as p,aB as te,ca as Re,c0 as xt,bH as l,a5 as ae,bA as ie,bV as q,br as Lt,bk as Wr,bj as Gr,bf as Do,bo as qr,c5 as gt,aw as tr,bz as Mo,cd as Zt}from"./3SdAC2_C.js";import{i as be}from"./bhKPSdq4.js";import{c as ee}from"./CUkDMZwP.js";import{g as Ir,i as Vo,e as yt,I as zo}from"./B6S6VNu7.js";import{f as _t,s as Oe,g as Wo}from"./7UPrdiE9.js";import{b as Ct}from"./Dn334wJv.js";import{b as kr}from"./DDxtqhsd.js";import{k as Go}from"./-K3ARgq0.js";import{c as Ot}from"./ChTqQfQN.js";import{a as qo}from"./CC7to1B5.js";import{f as Ne}from"./CttA-M7l.js";import{F as Ho}from"./C2jYl_tm.js";import{m as ct}from"./DlUZpQ7U.js";import{t as Ko}from"./CrD0jtXE.js";import{cp as Hr,F as ye,a8 as jo,aZ as Zo,ar as Xo,cK as Jo,aM as Yo,a_ as rr,a0 as sr,a2 as lr,b1 as Kr,aw as Qo,aC as jr,cT as en,ci as Zr,bS as Xr,cn as tn}from"./U9jJmfYa.js";import"./DI_O2uCQ.js";import{Jv as Se,f$ as rn,bD as on,A1 as nn,zj as an,Lw as Pr,dU as sn,bX as ln,Lv as dn,u$ as un,Lt as Er,gH as cn,ul as fn,Lu as gn,L9 as Lr,Ls as Fr}from"./_LtUY0jS.js";import"./Bsh6nUhU.js";import{R as vn,g as Xt,h as vt,f as wn,e as et,l as Jr,d as Yr,K as pn,i as bn,k as mn,j as hn,M as Qr,E as _n}from"./DCL0Px6m.js";import{a as eo,B as Ft}from"./B5aYN90J.js";import{bL as yn}from"./C91EC830.js";import{a5 as xn,w as Cn}from"./Bwa_PJLB.js";import{m as In,z as kn}from"./BsOWc0fD.js";import{I as At}from"./B2w13ngc.js";import{d as Pn}from"./CQ409-Pj.js";import{H as En,I as Ln}from"./Bqd7fdCF.js";import{a as Fn,e as Sn,h as Rn,g as $n,k as Tn,p as Un,b as An}from"./D4WPlvMg.js";import{e as Bn}from"./CRdOY_2z.js";import{i as or}from"./CL3a4Hm1.js";import{i as On,a as Nn}from"./C1JG3JxG.js";import{B as Dn}from"./6D8I0EJP.js";import"./Dhy-QJgd.js";import{l as Ve}from"./CE7dsja4.js";import{M as to}from"./BotfI-oJ.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{b as Mn}from"./B-4NNXpn.js";import"./lJeex2Gh.js";import{t as Vn,b as zn}from"./CXXVPWBH.js";import{T as Wn}from"./CDLANF8s.js";import{c as Gn,d as qn}from"./DHLXX1td.js";import{o as Sr,s as ft,n as Tt}from"./CIyUrgF0.js";import{g as Hn}from"./DWGXN6Nr.js";import{f as Kn}from"./BhcBqtJg.js";import{ay as jn,$ as Zn}from"./CEOk8g-Q.js";import{a_ as Xn}from"./Cppy6ZYG.js";function Jn(o,t){return o.loadURL(t)}function Yn(o){return{previousUrlProp:o||null}}function Rr(o,t){o.previousUrlProp=t}function Qn(o,t,n){const v=n||t;return o.previousUrlProp===v?null:(o.previousUrlProp=v,v)}function ea(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ro=Ot("TabBoundsReporter"),ta=150;function Jt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(v=>{ro.debug("Failed to report tab bounds",{tabId:o,error:v})})}function $r(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ro.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function oo(o,t){let n=t,v;const h=typeof ResizeObserver>"u"?void 0:new ResizeObserver(E=>{if(!n)return;const b=E[E.length-1]?.contentRect;if(!b)return;const S=n;clearTimeout(v),v=setTimeout(()=>{Jt(S,b.width,b.height)},ta)});if(h?.observe(o),n){const E=o.getBoundingClientRect();Jt(n,E.width,E.height)}return{update(E){if(E!==n&&(clearTimeout(v),n&&$r(n),n=E,n)){const b=o.getBoundingClientRect();Jt(n,b.width,b.height)}},destroy(){clearTimeout(v),h?.disconnect(),n&&$r(n)}}}function no(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function st(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||ao(o,t)}function ao(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return eo.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Bt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function ra(o){return{...o,width:o.height,height:o.width}}var oa=te('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),Yt=te("<!> <!> <!>",1),na=te('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),Qt=te("<!> <!>",1);function dr(o,t){if(new.target)return Ge({component:dr,...o});Ke(t,!0);let n=w(t,"viewport",7),v=w(t,"onViewportChange",7),h=w(t,"onCustom",7);const E=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function S(u){if(u==="fit")return v()({mode:"fit"});const P=Bt.find(Z=>Z.id===u);P&&v()({mode:"preset",presetId:P.id,width:P.width,height:P.height})}var A={get viewport(){return n()},set viewport(u){n(u),p()},get onViewportChange(){return v()},set onViewportChange(u){v(u),p()},get onCustom(){return h()},set onCustom(u){h(u),p()},$set:qe,$on:(u,P)=>He(t,u,P)},g=Yt(),s=X(g);ee(s,()=>vn,(u,P)=>{P(u,{get value(){return e(b)},onValueChange:S,children:(Z,C)=>{var I=Yt(),L=X(I);ee(L,()=>Xt,(N,z)=>{z(N,{value:"fit",children:(oe,ce)=>{wt();var M=lt();H(J=>Q(M,J),[()=>c.browser_viewport_fitPanel_label()]),k(oe,M)},$$slots:{default:!0}})});var U=y(L,2);Ir(U,17,()=>E,Vo,(N,z)=>{var oe=Yt(),ce=X(oe);ee(ce,()=>vt,(d,V)=>{V(d,{})});var M=y(ce,2);ee(M,()=>wn,(d,V)=>{V(d,{children:(i,R)=>{wt();var Y=lt();H(ue=>Q(Y,ue),[()=>e(z)==="phone"?c.browser_viewport_phoneGroup_label():e(z)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),k(i,Y)},$$slots:{default:!0}})});var J=y(M,2);Ir(J,17,()=>Bt.filter(d=>d.category===e(z)),d=>d.id,(d,V)=>{var i=ht(),R=X(i);ee(R,()=>Xt,(Y,ue)=>{ue(Y,{get value(){return e(V).id},children:(W,K)=>{var pe=oa(),_=X(pe),$=Ie(_,!0),F=y(_,2),we=Ie(F,!0);H(x=>{Q($,e(V).name),Q(we,x)},[()=>c.browser_viewport_dimensions_label({width:Ve(e(V).width),height:Ve(e(V).height)})]),k(W,pe)},$$slots:{default:!0}})}),k(d,i)}),k(N,oe)});var re=y(U,2);{var de=N=>{var z=Qt(),oe=X(z);ee(oe,()=>vt,(M,J)=>{J(M,{})});var ce=y(oe,2);ee(ce,()=>Xt,(M,J)=>{J(M,{value:"custom",get onSelect(){return h()},children:(d,V)=>{var i=na(),R=X(i),Y=Ie(R,!0),ue=y(R,2),W=Ie(ue,!0);H((K,pe)=>{Q(Y,K),Q(W,pe)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:Ve(n().width),height:Ve(n().height)})]),k(d,i)},$$slots:{default:!0}})}),k(N,z)};be(re,N=>{n().mode==="custom"&&N(de)})}k(Z,I)},$$slots:{default:!0}})});var O=y(s,2);{var j=u=>{var P=Qt(),Z=X(P);ee(Z,()=>vt,(I,L)=>{L(I,{})});var C=y(Z,2);ee(C,()=>et,(I,L)=>{L(I,{get onSelect(){return h()},children:(U,re)=>{wt();var de=lt();H(N=>Q(de,N),[()=>c.browser_viewport_custom_label()]),k(U,de)},$$slots:{default:!0}})}),k(u,P)};be(O,u=>{n().mode!=="custom"&&u(j)})}var B=y(O,2);{var T=u=>{var P=Qt(),Z=X(P);ee(Z,()=>vt,(I,L)=>{L(I,{})});var C=y(Z,2);{let I=f(()=>c.browser_viewport_rotate_label());ee(C,()=>to,(L,U)=>{U(L,{get icon(){return Hr},get label(){return e(I)},onSelect:()=>v()(ra(n()))})})}k(u,P)};be(B,u=>{n().mode!=="fit"&&u(T)})}return k(o,g),je(A)}var aa=te('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function ur(o,t){if(new.target)return Ge({component:ur,...o});Ke(t,!0);let n=w(t,"open",15,!1),v=w(t,"viewport",7),h=w(t,"onViewportChange",7),E=w(t,"returnFocus",7);const b=320,S=3840;let A=q(1280),g=q(800),s=q(null);function O(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=S}const j=f(()=>O(e(A))&&O(e(g)));Re(()=>{if(n())return()=>{xt().then(()=>{E()?.isConnected&&E().focus()})}}),Re(()=>{n()||(l(A,v().mode==="fit"?1280:v().width,!0),l(g,v().mode==="fit"?800:v().height,!0))});function B(){!e(j)||e(A)===null||e(g)===null||(h()({mode:"custom",width:e(A),height:e(g)}),n(!1))}var T={get open(){return n()},set open(u=!1){n(u),p()},get viewport(){return v()},set viewport(u){v(u),p()},get onViewportChange(){return h()},set onViewportChange(u){h(u),p()},get returnFocus(){return E()},set returnFocus(u){E(u),p()},$set:qe,$on:(u,P)=>He(t,u,P)};{let u=f(()=>c.browser_viewport_custom_label()),P=f(()=>c.browser_viewport_sizeRange_description({min:Ve(b),max:Ve(S)})),Z=f(()=>c.browser_viewport_apply_label());Mn(o,{get title(){return e(u)},get description(){return e(P)},get submitLabel(){return e(Z)},get canSubmit(){return e(j)},onSubmit:B,get initialFocus(){return e(s)},get open(){return n()},set open(C){n(C)},children:(C,I)=>{var L=aa(),U=ae(L),re=ae(U),de=Ie(re,!0),N=y(re,2);{let J=f(()=>!O(e(A)));At(N,{type:"number",min:b,max:S,step:"1",get"aria-invalid"(){return e(J)},get value(){return e(A)},set value(d){l(A,d,!0)},get ref(){return e(s)},set ref(d){l(s,d,!0)}})}ie(U);var z=y(U,2),oe=ae(z),ce=Ie(oe,!0),M=y(oe,2);{let J=f(()=>!O(e(g)));At(M,{type:"number",min:b,max:S,step:"1",get"aria-invalid"(){return e(J)},get value(){return e(g)},set value(d){l(g,d,!0)}})}ie(z),ie(L),H((J,d)=>{Q(de,J),Q(ce,d)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),k(C,L)},$$slots:{default:!0}})}return je(T)}var Ut=te("<!> <!>",1),it=te("<!> ",1),ia=te('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),sa=te("<!> <!> <!> <!> <!>",1),la=te('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),da=te("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function io(o,t){if(new.target)return Ge({component:io,...o});Ke(t,!0);let n=w(t,"errorCount",7,0),v=w(t,"disabled",7,!1),h=w(t,"collapsed",7,!1),E=w(t,"canGoBack",7,!1),b=w(t,"canGoForward",7,!1),S=w(t,"canSelectElement",7,!1),A=w(t,"selectingElement",7,!1),g=w(t,"viewport",23,()=>({mode:"fit"})),s=w(t,"onGoBack",7),O=w(t,"onGoForward",7),j=w(t,"onToggleElementPicker",7),B=w(t,"onViewportChange",7),T=w(t,"onOpenExternal",7),u=w(t,"onCopyUrl",7),P=w(t,"onScreenshot",7),Z=w(t,"onOpenConsole",7),C=w(t,"onOpenSource",7),I=w(t,"onOpenInspector",7),L=w(t,"onReloadWithoutCache",7);const U=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:Ve(n())}):c.browser_overflow_trigger_ariaLabel()),re=f(()=>g().mode==="preset"?Bt.find(i=>i.id===g().presetId):void 0),de=f(()=>g().mode==="fit"?c.browser_viewport_fitPanel_label():e(re)?.name??c.browser_viewport_dimensions_label({width:Ve(g().width),height:Ve(g().height)}));let N=q(!1),z=q(null),oe=q(!1);async function ce(){l(oe,!1),await xt(),l(N,!0)}var M={get errorCount(){return n()},set errorCount(i=0){n(i),p()},get disabled(){return v()},set disabled(i=!1){v(i),p()},get collapsed(){return h()},set collapsed(i=!1){h(i),p()},get canGoBack(){return E()},set canGoBack(i=!1){E(i),p()},get canGoForward(){return b()},set canGoForward(i=!1){b(i),p()},get canSelectElement(){return S()},set canSelectElement(i=!1){S(i),p()},get selectingElement(){return A()},set selectingElement(i=!1){A(i),p()},get viewport(){return g()},set viewport(i={mode:"fit"}){g(i),p()},get onGoBack(){return s()},set onGoBack(i){s(i),p()},get onGoForward(){return O()},set onGoForward(i){O(i),p()},get onToggleElementPicker(){return j()},set onToggleElementPicker(i){j(i),p()},get onViewportChange(){return B()},set onViewportChange(i){B(i),p()},get onOpenExternal(){return T()},set onOpenExternal(i){T(i),p()},get onCopyUrl(){return u()},set onCopyUrl(i){u(i),p()},get onScreenshot(){return P()},set onScreenshot(i){P(i),p()},get onOpenConsole(){return Z()},set onOpenConsole(i){Z(i),p()},get onOpenSource(){return C()},set onOpenSource(i){C(i),p()},get onOpenInspector(){return I()},set onOpenInspector(i){I(i),p()},get onReloadWithoutCache(){return L()},set onReloadWithoutCache(i){L(i),p()},$set:qe,$on:(i,R)=>He(t,i,R)},J=Ut(),d=X(J);ee(d,()=>Qr,(i,R)=>{R(i,{get open(){return e(oe)},set open(Y){l(oe,Y,!0)},children:(Y,ue)=>{var W=Ut(),K=X(W);{const _=($,F)=>{let we=()=>(F?.()).props;{let x=f(()=>c.browser_overflow_trigger_tooltip());Ne($,ir(we,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return v()},get tooltip(){return e(x)},tooltipSide:"bottom",get"aria-label"(){return e(U)},"data-testid":"browser-overflow-trigger",get ref(){return e(z)},set ref(se){l(z,se,!0)},children:(se,G)=>{var ke=Ut(),Pe=X(ke);pn(Pe,{class:"size-3.5"});var ze=y(Pe,2);{var Ze=Be=>{Dn(Be,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ee,tt)=>{wt();var $e=lt();H(Me=>Q($e,Me),[()=>n()>9?"9+":Ve(n())]),k(Ee,$e)},$$slots:{default:!0}})};be(ze,Be=>{n()>0&&Be(Ze)})}k(se,ke)},$$slots:{default:!0}}))}};ee(K,()=>Jr,($,F)=>{F($,{child:_,$$slots:{child:!0}})})}var pe=y(K,2);ee(pe,()=>Yr,(_,$)=>{$(_,{align:"end",class:"w-56",onCloseAutoFocus:F=>e(N)&&F.preventDefault(),children:(F,we)=>{var x=da(),se=X(x);{var G=fe=>{var me=sa(),xe=X(me);{let he=f(()=>!E());ee(xe,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},get onSelect(){return s()},children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return sr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var Xe=y(xe,2);{let he=f(()=>!b());ee(Xe,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},get onSelect(){return O()},children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return lr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var ge=y(Xe,2);{let he=f(()=>!S());ee(ge,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},onSelect:()=>void j()?.(),children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return rr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var ve=y(ge,2);ee(ve,()=>bn,(he,Ae)=>{Ae(he,{children:(We,nt)=>{var rt=Ut(),De=X(rt);{let Je=f(()=>!B());ee(De,()=>mn,(Ye,dt)=>{dt(Ye,{get disabled(){return e(Je)},children:(pt,Pt)=>{var ut=ia(),It=X(ut);ye(It,{get icon(){return Kr},size:"xs",class:"w-4 text-muted-foreground"});var Et=y(It,2),kt=Ie(Et,!0);H(Rt=>Q(kt,Rt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(de)})]),k(pt,ut)},$$slots:{default:!0}})})}var Ce=y(De,2);ee(Ce,()=>hn,(Je,Ye)=>{Ye(Je,{class:"w-64",children:(dt,pt)=>{dr(dt,{get viewport(){return g()},onViewportChange:Pt=>B()?.(Pt),onCustom:ce})},$$slots:{default:!0}})}),k(We,rt)},$$slots:{default:!0}})});var Ue=y(ve,2);ee(Ue,()=>vt,(he,Ae)=>{Ae(he,{})}),k(fe,me)};be(se,fe=>{h()&&fe(G)})}var ke=y(se,2);ee(ke,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void T()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return jo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_openExternal_label()]),k(xe,ge)},$$slots:{default:!0}})});var Pe=y(ke,2);ee(Pe,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void u()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Zo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_copyUrl_label()]),k(xe,ge)},$$slots:{default:!0}})});var ze=y(Pe,2);ee(ze,()=>vt,(fe,me)=>{me(fe,{})});var Ze=y(ze,2);ee(Ze,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void P()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Xo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_screenshot_label()]),k(xe,ge)},$$slots:{default:!0}})});var Be=y(Ze,2);ee(Be,()=>vt,(fe,me)=>{me(fe,{})});var Ee=y(Be,2);ee(Ee,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void Z()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_console_label()]),k(xe,ge)},$$slots:{default:!0}})});var tt=y(Ee,2);ee(tt,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void C()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_source_label()]),k(xe,ge)},$$slots:{default:!0}})});var $e=y(tt,2);ee($e,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void I()(),children:(xe,Xe)=>{var ge=la(),ve=X(ge);ye(ve,{get icon(){return rr},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve,2),he=Ie(Ue,!0);wt(2),H(Ae=>Q(he,Ae),[()=>c.browser_overflow_inspector_label()]),k(xe,ge)},$$slots:{default:!0}})});var Me=y($e,2);ee(Me,()=>vt,(fe,me)=>{me(fe,{})});var Te=y(Me,2);ee(Te,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void L()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Hr},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),k(xe,ge)},$$slots:{default:!0}})}),k(F,x)},$$slots:{default:!0}})}),k(Y,W)},$$slots:{default:!0}})});var V=y(d,2);return ur(V,{get viewport(){return g()},onViewportChange:i=>B()?.(i),get returnFocus(){return e(z)},get open(){return e(N)},set open(i){l(N,i,!0)}}),k(o,J),je(M)}var ua=te('<span class="truncate"> </span> <!>',1),Tr=te("<!> <!>",1);function so(o,t){if(new.target)return Ge({component:so,...o});Ke(t,!0);let n=w(t,"viewport",7),v=w(t,"onViewportChange",7),h=q(!1),E=q(!1),b=q(null);const S=f(()=>n().mode==="preset"?Bt.find(P=>P.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:Ve(n().width),height:Ve(n().height)})),g=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(S)?e(S).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(g));async function O(){l(h,!1),await xt(),l(E,!0)}var j={get viewport(){return n()},set viewport(P){n(P),p()},get onViewportChange(){return v()},set onViewportChange(P){v(P),p()},$set:qe,$on:(P,Z)=>He(t,P,Z)},B=Tr(),T=X(B);ee(T,()=>Qr,(P,Z)=>{Z(P,{get open(){return e(h)},set open(C){l(h,C,!0)},children:(C,I)=>{var L=Tr(),U=X(L);{const de=(N,z)=>{let oe=()=>(z?.()).props;{let ce=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Ne(N,ir(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(ce)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(M){l(b,M,!0)},children:(M,J)=>{var d=ua(),V=X(d),i=Ie(V,!0),R=y(V,2);ye(R,{get icon(){return Qo},size:"xs",class:"shrink-0"}),H(()=>Q(i,e(g))),k(M,d)},$$slots:{default:!0}}))}};ee(U,()=>Jr,(N,z)=>{z(N,{child:de,$$slots:{child:!0}})})}var re=y(U,2);ee(re,()=>Yr,(de,N)=>{N(de,{align:"end",class:"w-64",onCloseAutoFocus:z=>e(E)&&z.preventDefault(),children:(z,oe)=>{dr(z,{get viewport(){return n()},get onViewportChange(){return v()},onCustom:O})},$$slots:{default:!0}})}),k(C,L)},$$slots:{default:!0}})});var u=y(T,2);return ur(u,{get viewport(){return n()},get onViewportChange(){return v()},get returnFocus(){return e(b)},get open(){return e(E)},set open(P){l(E,P,!0)}}),k(o,B),je(j)}var ca=te('<span data-browser-viewport-readout=""> </span> <!>',1),fa=te('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function lo(o,t){if(new.target)return Ge({component:lo,...o});Ke(t,!0);const n=320,v=3840,h=150,E=24;let b=w(t,"viewport",7),S=w(t,"onViewportChange",7),A=w(t,"chromeOutside",7,!1),g=w(t,"children",7),s=q(Lt(b().mode==="fit"?n:b().width)),O=q(Lt(b().mode==="fit"?n:b().height)),j,B=q(0),T=q(0),u=q(!1),P=null,Z=0,C=0,I=0,L=0,U;const re=f(()=>b().mode==="fit"),de=f(()=>c.browser_viewport_dimensions_label({width:Ve(e(s)),height:Ve(e(O))})),N=f(()=>A()?Math.max(0,e(T)-E):e(T)),z=f(()=>!e(re)&&e(B)>0&&e(N)>0?Math.min(1,e(B)/e(s),e(N)/e(O)):1),oe=f(()=>e(s)*e(z)),ce=f(()=>e(O)*e(z));Re(()=>{e(u)||b().mode==="fit"||(l(s,b().width,!0),l(O,b().height,!0))});function M(x){return Math.min(v,Math.max(n,Math.round(x)))}function J(){S()({mode:"custom",width:e(s),height:e(O)})}function d(){clearTimeout(U),U=setTimeout(J,h)}function V(x){e(re)||x.button!==0||(x.preventDefault(),l(u,!0),P=x.pointerId,Z=x.clientX,C=x.clientY,I=e(s),L=e(O),x.currentTarget instanceof HTMLElement&&x.currentTarget.setPointerCapture?.(x.pointerId))}function i(x){!e(u)||x.pointerId!==P||(l(s,M(I+x.clientX-Z),!0),l(O,M(L+x.clientY-C),!0),d())}function R(x){if(!e(u)||x.pointerId!==P)return;clearTimeout(U),l(u,!1),P=null;const se=x.currentTarget;se instanceof HTMLElement&&se.hasPointerCapture?.(x.pointerId)&&se.releasePointerCapture&&se.releasePointerCapture(x.pointerId),J()}Wr(()=>{const x=(G,ke)=>{l(B,G,!0),l(T,ke,!0)};x(j.clientWidth,j.clientHeight);const se=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([G])=>{x(G?.contentRect.width??j.clientWidth,G?.contentRect.height??j.clientHeight)});return se?.observe(j),()=>se?.disconnect()}),Gr(()=>clearTimeout(U));var Y={get viewport(){return b()},set viewport(x){b(x),p()},get onViewportChange(){return S()},set onViewportChange(x){S(x),p()},get chromeOutside(){return A()},set chromeOutside(x=!1){A(x),p()},get children(){return g()},set children(x){g(x),p()},$set:qe,$on:(x,se)=>He(t,x,se)},ue=fa();{const x=G=>{var ke=ca(),Pe=X(ke),ze=Ie(Pe,!0),Ze=y(Pe,2);{let Be=f(()=>A()?"top-full":"bottom-0"),Ee=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Ne(Ze,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(Be)??""}`},get"aria-label"(){return e(Ee)},"data-testid":"browser-device-resize-handle",onpointerdown:V,onpointermove:i,onpointerup:R,onpointercancel:R})}H(()=>{_t(Pe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),Q(ze,e(de))}),k(G,ke)};var W=ae(ue),K=ae(W);let se;var pe=ae(K);Ko(pe,()=>g()??Do);var _=y(pe,2);{var $=G=>{x(G)};be(_,G=>{!e(re)&&!A()&&G($)})}ie(K);var F=y(K,2);{var we=G=>{x(G)};be(F,G=>{!e(re)&&A()&&G(we)})}ie(W),ie(ue),Ct(ue,G=>j=G,()=>j),H(()=>{_t(W,1,`relative ${e(re)?"h-full w-full":""} ${A()&&!e(re)?"mb-6":""}`),_t(K,1,`relative overflow-hidden bg-background ${e(re)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Oe(K,"data-browser-device-frame",e(re)?void 0:""),Oe(K,"data-width",e(re)?void 0:e(s)),Oe(K,"data-height",e(re)?void 0:e(O)),se=Wo(K,"",se,{width:e(re)?void 0:`${e(oe)}px`,height:e(re)?void 0:`${e(ce)}px`})})}return H(()=>_t(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(re)?"bg-background":"bg-muted/40"}`)),k(o,ue),je(Y)}const er=Ot("BrowserViewSlot"),Ur=()=>new Promise(o=>requestAnimationFrame(()=>o())),Ar=async()=>{await Ur(),await Ur()};function Br(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Or(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function ga(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function va(o,t){let n=Nr(o,t),v=`${t.workspaceId}\0${t.tabId}`;return{update(h){const E=`${h.workspaceId}\0${h.tabId}`;if(E===v){n.update(h);return}n.destroy(),v=E,n=Nr(o,h)},destroy(){n.destroy()}}}function Nr(o,t){let n=t;const v=Fn(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(v.webview);let h=null,E=Promise.resolve(),b="live",S=0,A=null,g=null,s=!1;const O=()=>{A?.remove(),A=null},j=C=>{h=C;const I=n.tabId;return E=Rn(I,C.rect,C.visible).catch(L=>er.debug("Could not place the browser page",{tabId:I,error:L})),E},B=()=>{if(g=null,s)return;const C=Or(o),I=n.visible&&C!==null&&ga(o)&&b!=="frozen"&&v.ready;v.ready&&(!h||h.visible!==I||C&&!Br(h.rect,C))&&(Br(h?.rect??null,C)||zn(),j({rect:C??h?.rect??null,visible:I})),g=requestAnimationFrame(B)};g=requestAnimationFrame(B);const T=async C=>{if(b="freezing",v.ready&&h?.visible)try{const I=await v.webview.capturePage?.();if(C!==S||s)return;const L=I?.toDataURL()??"";if(L){const U=document.createElement("img");if(U.alt="",U.setAttribute("aria-hidden","true"),U.dataset.browserViewSnapshot="",U.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",U.src=L,await U.decode().catch(()=>{}),C!==S||s||(O(),o.append(U),A=U,await Ar(),C!==S||s))return}}catch(I){er.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}C!==S||s||(b="frozen")},u=async C=>{if(b="thawing",v.ready&&n.visible){const I=Or(o);I&&await j({rect:I,visible:!0}),await Ar()}C!==S||s||(O(),b="live")},P=Vn({element:o,onCoveredChange(C){const I=++S;C?T(I):u(I)}});return{update(C){n=C},destroy:()=>{const C=n.tabId;s=!0,g!==null&&cancelAnimationFrame(g),g=null,P(),O(),v.dispose(),n.onWebview?.(null),E.then(()=>Sn(C).catch(I=>er.debug("Could not take the browser page off screen",{tabId:C,error:I})))}}}var wa=te('<div class="relative h-full w-full overflow-hidden"></div>');function uo(o,t){if(new.target)return Ge({component:uo,...o});Ke(t,!0);let n=w(t,"tabId",7),v=w(t,"workspaceId",7),h=w(t,"url",7),E=w(t,"pinned",7),b=w(t,"visible",7),S=w(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),p()},get workspaceId(){return v()},set workspaceId(s){v(s),p()},get url(){return h()},set url(s){h(s),p()},get pinned(){return E()},set pinned(s){E(s),p()},get visible(){return b()},set visible(s){b(s),p()},get webview(){return S()},set webview(s=null){S(s),p()},$set:qe,$on:(s,O)=>He(t,s,O)},g=wa();return yt(g,(s,O)=>va?.(s,O),()=>({tabId:n(),workspaceId:v(),url:h(),...E()===void 0?{}:{pinned:E()},visible:b(),onWebview:s=>S(s)})),yt(g,(s,O)=>oo?.(s,O),n),H(()=>Oe(g,"data-browser-view-slot",n())),k(o,g),je(A)}function co(o,t){if(new.target)return Ge({component:co,...o});Ke(t,!0);let n=w(t,"active",7),v=w(t,"disabled",7),h=w(t,"onToggle",7);var E={get active(){return n()},set active(b){n(b),p()},get disabled(){return v()},set disabled(b){v(b),p()},get onToggle(){return h()},set onToggle(b){h(b),p()},$set:qe,$on:(b,S)=>He(t,b,S)};{let b=f(()=>n()?"bg-muted text-foreground":""),S=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Ne(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return h()},get disabled(){return v()},get tooltip(){return e(S)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(g,s)=>{ye(g,{get icon(){return rr},size:"xs"})},$$slots:{default:!0}})}return je(E)}var pa=te('<span class="sr-only"> </span>'),ba=te('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ma=te("<!> <!>",1),ha=te('<span class="inline-flex shrink-0"><!> <!></span>');function cr(o,t){const n=qr();if(new.target)return Ge({component:cr,...o});Ke(t,!0);let v=w(t,"label",7),h=w(t,"description",7),E=w(t,"ariaLabel",23,v),b=w(t,"tone",7,"info"),S=w(t,"actionLabel",7),A=w(t,"onAction",7),g=w(t,"actionFocusTarget",7),s=w(t,"descriptionId",7),O=q(!1),j=!1;async function B(){j=!0,l(O,!1),await xt(),g()?.focus(),A()?.()}var T={get label(){return v()},set label(I){v(I),p()},get description(){return h()},set description(I){h(I),p()},get ariaLabel(){return E()},set ariaLabel(I=v){E(I),p()},get tone(){return b()},set tone(I="info"){b(I),p()},get actionLabel(){return S()},set actionLabel(I){S(I),p()},get onAction(){return A()},set onAction(I){A(I),p()},get actionFocusTarget(){return g()},set actionFocusTarget(I){g(I),p()},get descriptionId(){return s()},set descriptionId(I){s(I),p()},$set:qe,$on:(I,L)=>He(t,I,L)},u=ha(),P=ae(u);{var Z=I=>{var L=pa(),U=Ie(L,!0);H(()=>{Oe(L,"id",n),Oe(L,"role",b()==="error"?"alert":"status"),Q(U,h())}),k(I,L)};be(P,I=>{s()||I(Z)})}var C=y(P,2);return ee(C,()=>qn,(I,L)=>{L(I,{get open(){return e(O)},set open(U){l(O,U,!0)},children:(U,re)=>{var de=ma(),N=X(de);{const oe=(ce,M)=>{let J=()=>(M?.()).props;{let d=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),V=f(()=>s()??n);Ne(ce,ir(J,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(d)},get"aria-label"(){return E()},get"aria-describedby"(){return e(V)},get tooltip(){return h()},get tooltipDisabled(){return e(O)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(i,R)=>{{let Y=f(()=>b()==="error"?jr:b()==="warning"?en:Kr);ye(i,{get icon(){return e(Y)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};ee(N,()=>Wn,(ce,M)=>{M(ce,{child:oe,$$slots:{child:!0}})})}var z=y(N,2);ee(z,()=>Gn,(oe,ce)=>{ce(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return E()},onCloseAutoFocus:M=>{j&&g()&&(M.preventDefault(),g().focus()),j=!1},children:(M,J)=>{var d=ba(),V=X(d),i=Ie(V,!0),R=y(V,2);{var Y=ue=>{Ne(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void B(),children:(W,K)=>{wt();var pe=lt();H(()=>Q(pe,S())),k(W,pe)},$$slots:{default:!0}})};be(R,ue=>{S()&&A()&&ue(Y)})}H(()=>Q(i,h())),k(M,d)},$$slots:{default:!0}})}),k(U,de)},$$slots:{default:!0}})}),ie(u),H(()=>Oe(u,"data-browser-status",b())),k(o,u),je(T)}function _a(o,t,n){const v=n.width>0?t.width/n.width:1,h=n.height>0?t.height/n.height:1,E=Math.max(0,Math.floor(o.x*v)),b=Math.max(0,Math.floor(o.y*h)),S=Math.min(t.width,Math.ceil((o.x+o.width)*v)),A=Math.min(t.height,Math.ceil((o.y+o.height)*h));return{x:E,y:b,width:Math.max(0,S-E),height:Math.max(0,A-b)}}const ya=Sr({selector:ft().min(1),domPath:ft().min(1),tagName:ft().min(1),id:ft(),className:ft(),textSnippet:ft().max(120),rect:Sr({x:Tt().finite(),y:Tt().finite(),width:Tt().finite().nonnegative(),height:Tt().finite().nonnegative()}).strict(),pageUrl:ft().min(1),sourceRef:ft().min(1).optional()}).strict(),Dr="__INTENT_ELEMENT_PICKED__:";function xa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Dr))return null;let t;try{t=JSON.parse(o.slice(Dr.length))}catch{t=null}const n=ya.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const Ca=String.raw`
1
+ import{t as Ge,bo as w,bm as c,bw as qe,b as He,br as ir,bs as mt,bq as zr}from"./C0QTy0Sy.js";import{bs as Ke,ay as X,be as wt,b$ as lt,b_ as H,bO as Q,W as k,bS as y,aD as e,a7 as ht,bl as Ie,bn as je,c9 as f,aA as p,aB as te,ca as Re,c0 as xt,bH as l,a5 as ae,bA as ie,bV as q,br as Lt,bk as Wr,bj as Gr,bf as Do,bo as qr,c5 as gt,aw as tr,bz as Mo,cd as Zt}from"./3SdAC2_C.js";import{i as be}from"./bhKPSdq4.js";import{c as ee}from"./CUkDMZwP.js";import{g as Ir,i as Vo,e as yt,I as zo}from"./B6S6VNu7.js";import{f as _t,s as Oe,g as Wo}from"./7UPrdiE9.js";import{b as Ct}from"./Dn334wJv.js";import{b as kr}from"./DDxtqhsd.js";import{k as Go}from"./-K3ARgq0.js";import{c as Ot}from"./ChTqQfQN.js";import{a as qo}from"./CC7to1B5.js";import{f as Ne}from"./CttA-M7l.js";import{F as Ho}from"./C2jYl_tm.js";import{m as ct}from"./DlUZpQ7U.js";import{t as Ko}from"./CrD0jtXE.js";import{cp as Hr,F as ye,a8 as jo,aZ as Zo,ar as Xo,cK as Jo,aM as Yo,a_ as rr,a0 as sr,a2 as lr,b1 as Kr,aw as Qo,aC as jr,cT as en,ci as Zr,bS as Xr,cn as tn}from"./U9jJmfYa.js";import"./DI_O2uCQ.js";import{Jv as Se,f$ as rn,bD as on,A1 as nn,zj as an,Lw as Pr,dU as sn,bX as ln,Lv as dn,u$ as un,Lt as Er,gH as cn,ul as fn,Lu as gn,L9 as Lr,Ls as Fr}from"./_LtUY0jS.js";import"./Bsh6nUhU.js";import{R as vn,g as Xt,h as vt,f as wn,e as et,l as Jr,d as Yr,K as pn,i as bn,k as mn,j as hn,M as Qr,E as _n}from"./DCL0Px6m.js";import{a as eo,B as Ft}from"./B5aYN90J.js";import{bL as yn}from"./BpfNraM2.js";import{a5 as xn,w as Cn}from"./Df8HaglQ.js";import{m as In,z as kn}from"./BsOWc0fD.js";import{I as At}from"./B2w13ngc.js";import{d as Pn}from"./CQ409-Pj.js";import{H as En,I as Ln}from"./Bqd7fdCF.js";import{a as Fn,e as Sn,h as Rn,g as $n,k as Tn,p as Un,b as An}from"./D4WPlvMg.js";import{e as Bn}from"./CRdOY_2z.js";import{i as or}from"./CL3a4Hm1.js";import{i as On,a as Nn}from"./C1JG3JxG.js";import{B as Dn}from"./6D8I0EJP.js";import"./Dhy-QJgd.js";import{l as Ve}from"./CE7dsja4.js";import{M as to}from"./BotfI-oJ.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{b as Mn}from"./B-4NNXpn.js";import"./lJeex2Gh.js";import{t as Vn,b as zn}from"./CXXVPWBH.js";import{T as Wn}from"./CDLANF8s.js";import{c as Gn,d as qn}from"./DHLXX1td.js";import{o as Sr,s as ft,n as Tt}from"./CIyUrgF0.js";import{g as Hn}from"./DWGXN6Nr.js";import{f as Kn}from"./PWCv1nwS.js";import{ay as jn,$ as Zn}from"./yDR0_Br6.js";import{a_ as Xn}from"./Cppy6ZYG.js";function Jn(o,t){return o.loadURL(t)}function Yn(o){return{previousUrlProp:o||null}}function Rr(o,t){o.previousUrlProp=t}function Qn(o,t,n){const v=n||t;return o.previousUrlProp===v?null:(o.previousUrlProp=v,v)}function ea(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ro=Ot("TabBoundsReporter"),ta=150;function Jt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(v=>{ro.debug("Failed to report tab bounds",{tabId:o,error:v})})}function $r(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ro.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function oo(o,t){let n=t,v;const h=typeof ResizeObserver>"u"?void 0:new ResizeObserver(E=>{if(!n)return;const b=E[E.length-1]?.contentRect;if(!b)return;const S=n;clearTimeout(v),v=setTimeout(()=>{Jt(S,b.width,b.height)},ta)});if(h?.observe(o),n){const E=o.getBoundingClientRect();Jt(n,E.width,E.height)}return{update(E){if(E!==n&&(clearTimeout(v),n&&$r(n),n=E,n)){const b=o.getBoundingClientRect();Jt(n,b.width,b.height)}},destroy(){clearTimeout(v),h?.disconnect(),n&&$r(n)}}}function no(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function st(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||ao(o,t)}function ao(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return eo.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Bt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function ra(o){return{...o,width:o.height,height:o.width}}var oa=te('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),Yt=te("<!> <!> <!>",1),na=te('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),Qt=te("<!> <!>",1);function dr(o,t){if(new.target)return Ge({component:dr,...o});Ke(t,!0);let n=w(t,"viewport",7),v=w(t,"onViewportChange",7),h=w(t,"onCustom",7);const E=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function S(u){if(u==="fit")return v()({mode:"fit"});const P=Bt.find(Z=>Z.id===u);P&&v()({mode:"preset",presetId:P.id,width:P.width,height:P.height})}var A={get viewport(){return n()},set viewport(u){n(u),p()},get onViewportChange(){return v()},set onViewportChange(u){v(u),p()},get onCustom(){return h()},set onCustom(u){h(u),p()},$set:qe,$on:(u,P)=>He(t,u,P)},g=Yt(),s=X(g);ee(s,()=>vn,(u,P)=>{P(u,{get value(){return e(b)},onValueChange:S,children:(Z,C)=>{var I=Yt(),L=X(I);ee(L,()=>Xt,(N,z)=>{z(N,{value:"fit",children:(oe,ce)=>{wt();var M=lt();H(J=>Q(M,J),[()=>c.browser_viewport_fitPanel_label()]),k(oe,M)},$$slots:{default:!0}})});var U=y(L,2);Ir(U,17,()=>E,Vo,(N,z)=>{var oe=Yt(),ce=X(oe);ee(ce,()=>vt,(d,V)=>{V(d,{})});var M=y(ce,2);ee(M,()=>wn,(d,V)=>{V(d,{children:(i,R)=>{wt();var Y=lt();H(ue=>Q(Y,ue),[()=>e(z)==="phone"?c.browser_viewport_phoneGroup_label():e(z)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),k(i,Y)},$$slots:{default:!0}})});var J=y(M,2);Ir(J,17,()=>Bt.filter(d=>d.category===e(z)),d=>d.id,(d,V)=>{var i=ht(),R=X(i);ee(R,()=>Xt,(Y,ue)=>{ue(Y,{get value(){return e(V).id},children:(W,K)=>{var pe=oa(),_=X(pe),$=Ie(_,!0),F=y(_,2),we=Ie(F,!0);H(x=>{Q($,e(V).name),Q(we,x)},[()=>c.browser_viewport_dimensions_label({width:Ve(e(V).width),height:Ve(e(V).height)})]),k(W,pe)},$$slots:{default:!0}})}),k(d,i)}),k(N,oe)});var re=y(U,2);{var de=N=>{var z=Qt(),oe=X(z);ee(oe,()=>vt,(M,J)=>{J(M,{})});var ce=y(oe,2);ee(ce,()=>Xt,(M,J)=>{J(M,{value:"custom",get onSelect(){return h()},children:(d,V)=>{var i=na(),R=X(i),Y=Ie(R,!0),ue=y(R,2),W=Ie(ue,!0);H((K,pe)=>{Q(Y,K),Q(W,pe)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:Ve(n().width),height:Ve(n().height)})]),k(d,i)},$$slots:{default:!0}})}),k(N,z)};be(re,N=>{n().mode==="custom"&&N(de)})}k(Z,I)},$$slots:{default:!0}})});var O=y(s,2);{var j=u=>{var P=Qt(),Z=X(P);ee(Z,()=>vt,(I,L)=>{L(I,{})});var C=y(Z,2);ee(C,()=>et,(I,L)=>{L(I,{get onSelect(){return h()},children:(U,re)=>{wt();var de=lt();H(N=>Q(de,N),[()=>c.browser_viewport_custom_label()]),k(U,de)},$$slots:{default:!0}})}),k(u,P)};be(O,u=>{n().mode!=="custom"&&u(j)})}var B=y(O,2);{var T=u=>{var P=Qt(),Z=X(P);ee(Z,()=>vt,(I,L)=>{L(I,{})});var C=y(Z,2);{let I=f(()=>c.browser_viewport_rotate_label());ee(C,()=>to,(L,U)=>{U(L,{get icon(){return Hr},get label(){return e(I)},onSelect:()=>v()(ra(n()))})})}k(u,P)};be(B,u=>{n().mode!=="fit"&&u(T)})}return k(o,g),je(A)}var aa=te('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function ur(o,t){if(new.target)return Ge({component:ur,...o});Ke(t,!0);let n=w(t,"open",15,!1),v=w(t,"viewport",7),h=w(t,"onViewportChange",7),E=w(t,"returnFocus",7);const b=320,S=3840;let A=q(1280),g=q(800),s=q(null);function O(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=S}const j=f(()=>O(e(A))&&O(e(g)));Re(()=>{if(n())return()=>{xt().then(()=>{E()?.isConnected&&E().focus()})}}),Re(()=>{n()||(l(A,v().mode==="fit"?1280:v().width,!0),l(g,v().mode==="fit"?800:v().height,!0))});function B(){!e(j)||e(A)===null||e(g)===null||(h()({mode:"custom",width:e(A),height:e(g)}),n(!1))}var T={get open(){return n()},set open(u=!1){n(u),p()},get viewport(){return v()},set viewport(u){v(u),p()},get onViewportChange(){return h()},set onViewportChange(u){h(u),p()},get returnFocus(){return E()},set returnFocus(u){E(u),p()},$set:qe,$on:(u,P)=>He(t,u,P)};{let u=f(()=>c.browser_viewport_custom_label()),P=f(()=>c.browser_viewport_sizeRange_description({min:Ve(b),max:Ve(S)})),Z=f(()=>c.browser_viewport_apply_label());Mn(o,{get title(){return e(u)},get description(){return e(P)},get submitLabel(){return e(Z)},get canSubmit(){return e(j)},onSubmit:B,get initialFocus(){return e(s)},get open(){return n()},set open(C){n(C)},children:(C,I)=>{var L=aa(),U=ae(L),re=ae(U),de=Ie(re,!0),N=y(re,2);{let J=f(()=>!O(e(A)));At(N,{type:"number",min:b,max:S,step:"1",get"aria-invalid"(){return e(J)},get value(){return e(A)},set value(d){l(A,d,!0)},get ref(){return e(s)},set ref(d){l(s,d,!0)}})}ie(U);var z=y(U,2),oe=ae(z),ce=Ie(oe,!0),M=y(oe,2);{let J=f(()=>!O(e(g)));At(M,{type:"number",min:b,max:S,step:"1",get"aria-invalid"(){return e(J)},get value(){return e(g)},set value(d){l(g,d,!0)}})}ie(z),ie(L),H((J,d)=>{Q(de,J),Q(ce,d)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),k(C,L)},$$slots:{default:!0}})}return je(T)}var Ut=te("<!> <!>",1),it=te("<!> ",1),ia=te('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),sa=te("<!> <!> <!> <!> <!>",1),la=te('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),da=te("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function io(o,t){if(new.target)return Ge({component:io,...o});Ke(t,!0);let n=w(t,"errorCount",7,0),v=w(t,"disabled",7,!1),h=w(t,"collapsed",7,!1),E=w(t,"canGoBack",7,!1),b=w(t,"canGoForward",7,!1),S=w(t,"canSelectElement",7,!1),A=w(t,"selectingElement",7,!1),g=w(t,"viewport",23,()=>({mode:"fit"})),s=w(t,"onGoBack",7),O=w(t,"onGoForward",7),j=w(t,"onToggleElementPicker",7),B=w(t,"onViewportChange",7),T=w(t,"onOpenExternal",7),u=w(t,"onCopyUrl",7),P=w(t,"onScreenshot",7),Z=w(t,"onOpenConsole",7),C=w(t,"onOpenSource",7),I=w(t,"onOpenInspector",7),L=w(t,"onReloadWithoutCache",7);const U=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:Ve(n())}):c.browser_overflow_trigger_ariaLabel()),re=f(()=>g().mode==="preset"?Bt.find(i=>i.id===g().presetId):void 0),de=f(()=>g().mode==="fit"?c.browser_viewport_fitPanel_label():e(re)?.name??c.browser_viewport_dimensions_label({width:Ve(g().width),height:Ve(g().height)}));let N=q(!1),z=q(null),oe=q(!1);async function ce(){l(oe,!1),await xt(),l(N,!0)}var M={get errorCount(){return n()},set errorCount(i=0){n(i),p()},get disabled(){return v()},set disabled(i=!1){v(i),p()},get collapsed(){return h()},set collapsed(i=!1){h(i),p()},get canGoBack(){return E()},set canGoBack(i=!1){E(i),p()},get canGoForward(){return b()},set canGoForward(i=!1){b(i),p()},get canSelectElement(){return S()},set canSelectElement(i=!1){S(i),p()},get selectingElement(){return A()},set selectingElement(i=!1){A(i),p()},get viewport(){return g()},set viewport(i={mode:"fit"}){g(i),p()},get onGoBack(){return s()},set onGoBack(i){s(i),p()},get onGoForward(){return O()},set onGoForward(i){O(i),p()},get onToggleElementPicker(){return j()},set onToggleElementPicker(i){j(i),p()},get onViewportChange(){return B()},set onViewportChange(i){B(i),p()},get onOpenExternal(){return T()},set onOpenExternal(i){T(i),p()},get onCopyUrl(){return u()},set onCopyUrl(i){u(i),p()},get onScreenshot(){return P()},set onScreenshot(i){P(i),p()},get onOpenConsole(){return Z()},set onOpenConsole(i){Z(i),p()},get onOpenSource(){return C()},set onOpenSource(i){C(i),p()},get onOpenInspector(){return I()},set onOpenInspector(i){I(i),p()},get onReloadWithoutCache(){return L()},set onReloadWithoutCache(i){L(i),p()},$set:qe,$on:(i,R)=>He(t,i,R)},J=Ut(),d=X(J);ee(d,()=>Qr,(i,R)=>{R(i,{get open(){return e(oe)},set open(Y){l(oe,Y,!0)},children:(Y,ue)=>{var W=Ut(),K=X(W);{const _=($,F)=>{let we=()=>(F?.()).props;{let x=f(()=>c.browser_overflow_trigger_tooltip());Ne($,ir(we,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return v()},get tooltip(){return e(x)},tooltipSide:"bottom",get"aria-label"(){return e(U)},"data-testid":"browser-overflow-trigger",get ref(){return e(z)},set ref(se){l(z,se,!0)},children:(se,G)=>{var ke=Ut(),Pe=X(ke);pn(Pe,{class:"size-3.5"});var ze=y(Pe,2);{var Ze=Be=>{Dn(Be,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ee,tt)=>{wt();var $e=lt();H(Me=>Q($e,Me),[()=>n()>9?"9+":Ve(n())]),k(Ee,$e)},$$slots:{default:!0}})};be(ze,Be=>{n()>0&&Be(Ze)})}k(se,ke)},$$slots:{default:!0}}))}};ee(K,()=>Jr,($,F)=>{F($,{child:_,$$slots:{child:!0}})})}var pe=y(K,2);ee(pe,()=>Yr,(_,$)=>{$(_,{align:"end",class:"w-56",onCloseAutoFocus:F=>e(N)&&F.preventDefault(),children:(F,we)=>{var x=da(),se=X(x);{var G=fe=>{var me=sa(),xe=X(me);{let he=f(()=>!E());ee(xe,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},get onSelect(){return s()},children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return sr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var Xe=y(xe,2);{let he=f(()=>!b());ee(Xe,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},get onSelect(){return O()},children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return lr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var ge=y(Xe,2);{let he=f(()=>!S());ee(ge,()=>et,(Ae,We)=>{We(Ae,{get disabled(){return e(he)},onSelect:()=>void j()?.(),children:(nt,rt)=>{var De=it(),Ce=X(De);ye(Ce,{get icon(){return rr},size:"xs",class:"w-4 text-muted-foreground"});var Je=y(Ce);H(Ye=>Q(Je,` ${Ye??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),k(nt,De)},$$slots:{default:!0}})})}var ve=y(ge,2);ee(ve,()=>bn,(he,Ae)=>{Ae(he,{children:(We,nt)=>{var rt=Ut(),De=X(rt);{let Je=f(()=>!B());ee(De,()=>mn,(Ye,dt)=>{dt(Ye,{get disabled(){return e(Je)},children:(pt,Pt)=>{var ut=ia(),It=X(ut);ye(It,{get icon(){return Kr},size:"xs",class:"w-4 text-muted-foreground"});var Et=y(It,2),kt=Ie(Et,!0);H(Rt=>Q(kt,Rt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(de)})]),k(pt,ut)},$$slots:{default:!0}})})}var Ce=y(De,2);ee(Ce,()=>hn,(Je,Ye)=>{Ye(Je,{class:"w-64",children:(dt,pt)=>{dr(dt,{get viewport(){return g()},onViewportChange:Pt=>B()?.(Pt),onCustom:ce})},$$slots:{default:!0}})}),k(We,rt)},$$slots:{default:!0}})});var Ue=y(ve,2);ee(Ue,()=>vt,(he,Ae)=>{Ae(he,{})}),k(fe,me)};be(se,fe=>{h()&&fe(G)})}var ke=y(se,2);ee(ke,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void T()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return jo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_openExternal_label()]),k(xe,ge)},$$slots:{default:!0}})});var Pe=y(ke,2);ee(Pe,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void u()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Zo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_copyUrl_label()]),k(xe,ge)},$$slots:{default:!0}})});var ze=y(Pe,2);ee(ze,()=>vt,(fe,me)=>{me(fe,{})});var Ze=y(ze,2);ee(Ze,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void P()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Xo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_screenshot_label()]),k(xe,ge)},$$slots:{default:!0}})});var Be=y(Ze,2);ee(Be,()=>vt,(fe,me)=>{me(fe,{})});var Ee=y(Be,2);ee(Ee,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void Z()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_console_label()]),k(xe,ge)},$$slots:{default:!0}})});var tt=y(Ee,2);ee(tt,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void C()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_source_label()]),k(xe,ge)},$$slots:{default:!0}})});var $e=y(tt,2);ee($e,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void I()(),children:(xe,Xe)=>{var ge=la(),ve=X(ge);ye(ve,{get icon(){return rr},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve,2),he=Ie(Ue,!0);wt(2),H(Ae=>Q(he,Ae),[()=>c.browser_overflow_inspector_label()]),k(xe,ge)},$$slots:{default:!0}})});var Me=y($e,2);ee(Me,()=>vt,(fe,me)=>{me(fe,{})});var Te=y(Me,2);ee(Te,()=>et,(fe,me)=>{me(fe,{onSelect:()=>void L()(),children:(xe,Xe)=>{var ge=it(),ve=X(ge);ye(ve,{get icon(){return Hr},size:"xs",class:"w-4 text-muted-foreground"});var Ue=y(ve);H(he=>Q(Ue,` ${he??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),k(xe,ge)},$$slots:{default:!0}})}),k(F,x)},$$slots:{default:!0}})}),k(Y,W)},$$slots:{default:!0}})});var V=y(d,2);return ur(V,{get viewport(){return g()},onViewportChange:i=>B()?.(i),get returnFocus(){return e(z)},get open(){return e(N)},set open(i){l(N,i,!0)}}),k(o,J),je(M)}var ua=te('<span class="truncate"> </span> <!>',1),Tr=te("<!> <!>",1);function so(o,t){if(new.target)return Ge({component:so,...o});Ke(t,!0);let n=w(t,"viewport",7),v=w(t,"onViewportChange",7),h=q(!1),E=q(!1),b=q(null);const S=f(()=>n().mode==="preset"?Bt.find(P=>P.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:Ve(n().width),height:Ve(n().height)})),g=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(S)?e(S).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(g));async function O(){l(h,!1),await xt(),l(E,!0)}var j={get viewport(){return n()},set viewport(P){n(P),p()},get onViewportChange(){return v()},set onViewportChange(P){v(P),p()},$set:qe,$on:(P,Z)=>He(t,P,Z)},B=Tr(),T=X(B);ee(T,()=>Qr,(P,Z)=>{Z(P,{get open(){return e(h)},set open(C){l(h,C,!0)},children:(C,I)=>{var L=Tr(),U=X(L);{const de=(N,z)=>{let oe=()=>(z?.()).props;{let ce=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Ne(N,ir(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(ce)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(M){l(b,M,!0)},children:(M,J)=>{var d=ua(),V=X(d),i=Ie(V,!0),R=y(V,2);ye(R,{get icon(){return Qo},size:"xs",class:"shrink-0"}),H(()=>Q(i,e(g))),k(M,d)},$$slots:{default:!0}}))}};ee(U,()=>Jr,(N,z)=>{z(N,{child:de,$$slots:{child:!0}})})}var re=y(U,2);ee(re,()=>Yr,(de,N)=>{N(de,{align:"end",class:"w-64",onCloseAutoFocus:z=>e(E)&&z.preventDefault(),children:(z,oe)=>{dr(z,{get viewport(){return n()},get onViewportChange(){return v()},onCustom:O})},$$slots:{default:!0}})}),k(C,L)},$$slots:{default:!0}})});var u=y(T,2);return ur(u,{get viewport(){return n()},get onViewportChange(){return v()},get returnFocus(){return e(b)},get open(){return e(E)},set open(P){l(E,P,!0)}}),k(o,B),je(j)}var ca=te('<span data-browser-viewport-readout=""> </span> <!>',1),fa=te('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function lo(o,t){if(new.target)return Ge({component:lo,...o});Ke(t,!0);const n=320,v=3840,h=150,E=24;let b=w(t,"viewport",7),S=w(t,"onViewportChange",7),A=w(t,"chromeOutside",7,!1),g=w(t,"children",7),s=q(Lt(b().mode==="fit"?n:b().width)),O=q(Lt(b().mode==="fit"?n:b().height)),j,B=q(0),T=q(0),u=q(!1),P=null,Z=0,C=0,I=0,L=0,U;const re=f(()=>b().mode==="fit"),de=f(()=>c.browser_viewport_dimensions_label({width:Ve(e(s)),height:Ve(e(O))})),N=f(()=>A()?Math.max(0,e(T)-E):e(T)),z=f(()=>!e(re)&&e(B)>0&&e(N)>0?Math.min(1,e(B)/e(s),e(N)/e(O)):1),oe=f(()=>e(s)*e(z)),ce=f(()=>e(O)*e(z));Re(()=>{e(u)||b().mode==="fit"||(l(s,b().width,!0),l(O,b().height,!0))});function M(x){return Math.min(v,Math.max(n,Math.round(x)))}function J(){S()({mode:"custom",width:e(s),height:e(O)})}function d(){clearTimeout(U),U=setTimeout(J,h)}function V(x){e(re)||x.button!==0||(x.preventDefault(),l(u,!0),P=x.pointerId,Z=x.clientX,C=x.clientY,I=e(s),L=e(O),x.currentTarget instanceof HTMLElement&&x.currentTarget.setPointerCapture?.(x.pointerId))}function i(x){!e(u)||x.pointerId!==P||(l(s,M(I+x.clientX-Z),!0),l(O,M(L+x.clientY-C),!0),d())}function R(x){if(!e(u)||x.pointerId!==P)return;clearTimeout(U),l(u,!1),P=null;const se=x.currentTarget;se instanceof HTMLElement&&se.hasPointerCapture?.(x.pointerId)&&se.releasePointerCapture&&se.releasePointerCapture(x.pointerId),J()}Wr(()=>{const x=(G,ke)=>{l(B,G,!0),l(T,ke,!0)};x(j.clientWidth,j.clientHeight);const se=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([G])=>{x(G?.contentRect.width??j.clientWidth,G?.contentRect.height??j.clientHeight)});return se?.observe(j),()=>se?.disconnect()}),Gr(()=>clearTimeout(U));var Y={get viewport(){return b()},set viewport(x){b(x),p()},get onViewportChange(){return S()},set onViewportChange(x){S(x),p()},get chromeOutside(){return A()},set chromeOutside(x=!1){A(x),p()},get children(){return g()},set children(x){g(x),p()},$set:qe,$on:(x,se)=>He(t,x,se)},ue=fa();{const x=G=>{var ke=ca(),Pe=X(ke),ze=Ie(Pe,!0),Ze=y(Pe,2);{let Be=f(()=>A()?"top-full":"bottom-0"),Ee=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Ne(Ze,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(Be)??""}`},get"aria-label"(){return e(Ee)},"data-testid":"browser-device-resize-handle",onpointerdown:V,onpointermove:i,onpointerup:R,onpointercancel:R})}H(()=>{_t(Pe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),Q(ze,e(de))}),k(G,ke)};var W=ae(ue),K=ae(W);let se;var pe=ae(K);Ko(pe,()=>g()??Do);var _=y(pe,2);{var $=G=>{x(G)};be(_,G=>{!e(re)&&!A()&&G($)})}ie(K);var F=y(K,2);{var we=G=>{x(G)};be(F,G=>{!e(re)&&A()&&G(we)})}ie(W),ie(ue),Ct(ue,G=>j=G,()=>j),H(()=>{_t(W,1,`relative ${e(re)?"h-full w-full":""} ${A()&&!e(re)?"mb-6":""}`),_t(K,1,`relative overflow-hidden bg-background ${e(re)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Oe(K,"data-browser-device-frame",e(re)?void 0:""),Oe(K,"data-width",e(re)?void 0:e(s)),Oe(K,"data-height",e(re)?void 0:e(O)),se=Wo(K,"",se,{width:e(re)?void 0:`${e(oe)}px`,height:e(re)?void 0:`${e(ce)}px`})})}return H(()=>_t(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(re)?"bg-background":"bg-muted/40"}`)),k(o,ue),je(Y)}const er=Ot("BrowserViewSlot"),Ur=()=>new Promise(o=>requestAnimationFrame(()=>o())),Ar=async()=>{await Ur(),await Ur()};function Br(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Or(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function ga(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function va(o,t){let n=Nr(o,t),v=`${t.workspaceId}\0${t.tabId}`;return{update(h){const E=`${h.workspaceId}\0${h.tabId}`;if(E===v){n.update(h);return}n.destroy(),v=E,n=Nr(o,h)},destroy(){n.destroy()}}}function Nr(o,t){let n=t;const v=Fn(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(v.webview);let h=null,E=Promise.resolve(),b="live",S=0,A=null,g=null,s=!1;const O=()=>{A?.remove(),A=null},j=C=>{h=C;const I=n.tabId;return E=Rn(I,C.rect,C.visible).catch(L=>er.debug("Could not place the browser page",{tabId:I,error:L})),E},B=()=>{if(g=null,s)return;const C=Or(o),I=n.visible&&C!==null&&ga(o)&&b!=="frozen"&&v.ready;v.ready&&(!h||h.visible!==I||C&&!Br(h.rect,C))&&(Br(h?.rect??null,C)||zn(),j({rect:C??h?.rect??null,visible:I})),g=requestAnimationFrame(B)};g=requestAnimationFrame(B);const T=async C=>{if(b="freezing",v.ready&&h?.visible)try{const I=await v.webview.capturePage?.();if(C!==S||s)return;const L=I?.toDataURL()??"";if(L){const U=document.createElement("img");if(U.alt="",U.setAttribute("aria-hidden","true"),U.dataset.browserViewSnapshot="",U.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",U.src=L,await U.decode().catch(()=>{}),C!==S||s||(O(),o.append(U),A=U,await Ar(),C!==S||s))return}}catch(I){er.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}C!==S||s||(b="frozen")},u=async C=>{if(b="thawing",v.ready&&n.visible){const I=Or(o);I&&await j({rect:I,visible:!0}),await Ar()}C!==S||s||(O(),b="live")},P=Vn({element:o,onCoveredChange(C){const I=++S;C?T(I):u(I)}});return{update(C){n=C},destroy:()=>{const C=n.tabId;s=!0,g!==null&&cancelAnimationFrame(g),g=null,P(),O(),v.dispose(),n.onWebview?.(null),E.then(()=>Sn(C).catch(I=>er.debug("Could not take the browser page off screen",{tabId:C,error:I})))}}}var wa=te('<div class="relative h-full w-full overflow-hidden"></div>');function uo(o,t){if(new.target)return Ge({component:uo,...o});Ke(t,!0);let n=w(t,"tabId",7),v=w(t,"workspaceId",7),h=w(t,"url",7),E=w(t,"pinned",7),b=w(t,"visible",7),S=w(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),p()},get workspaceId(){return v()},set workspaceId(s){v(s),p()},get url(){return h()},set url(s){h(s),p()},get pinned(){return E()},set pinned(s){E(s),p()},get visible(){return b()},set visible(s){b(s),p()},get webview(){return S()},set webview(s=null){S(s),p()},$set:qe,$on:(s,O)=>He(t,s,O)},g=wa();return yt(g,(s,O)=>va?.(s,O),()=>({tabId:n(),workspaceId:v(),url:h(),...E()===void 0?{}:{pinned:E()},visible:b(),onWebview:s=>S(s)})),yt(g,(s,O)=>oo?.(s,O),n),H(()=>Oe(g,"data-browser-view-slot",n())),k(o,g),je(A)}function co(o,t){if(new.target)return Ge({component:co,...o});Ke(t,!0);let n=w(t,"active",7),v=w(t,"disabled",7),h=w(t,"onToggle",7);var E={get active(){return n()},set active(b){n(b),p()},get disabled(){return v()},set disabled(b){v(b),p()},get onToggle(){return h()},set onToggle(b){h(b),p()},$set:qe,$on:(b,S)=>He(t,b,S)};{let b=f(()=>n()?"bg-muted text-foreground":""),S=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Ne(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return h()},get disabled(){return v()},get tooltip(){return e(S)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(g,s)=>{ye(g,{get icon(){return rr},size:"xs"})},$$slots:{default:!0}})}return je(E)}var pa=te('<span class="sr-only"> </span>'),ba=te('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ma=te("<!> <!>",1),ha=te('<span class="inline-flex shrink-0"><!> <!></span>');function cr(o,t){const n=qr();if(new.target)return Ge({component:cr,...o});Ke(t,!0);let v=w(t,"label",7),h=w(t,"description",7),E=w(t,"ariaLabel",23,v),b=w(t,"tone",7,"info"),S=w(t,"actionLabel",7),A=w(t,"onAction",7),g=w(t,"actionFocusTarget",7),s=w(t,"descriptionId",7),O=q(!1),j=!1;async function B(){j=!0,l(O,!1),await xt(),g()?.focus(),A()?.()}var T={get label(){return v()},set label(I){v(I),p()},get description(){return h()},set description(I){h(I),p()},get ariaLabel(){return E()},set ariaLabel(I=v){E(I),p()},get tone(){return b()},set tone(I="info"){b(I),p()},get actionLabel(){return S()},set actionLabel(I){S(I),p()},get onAction(){return A()},set onAction(I){A(I),p()},get actionFocusTarget(){return g()},set actionFocusTarget(I){g(I),p()},get descriptionId(){return s()},set descriptionId(I){s(I),p()},$set:qe,$on:(I,L)=>He(t,I,L)},u=ha(),P=ae(u);{var Z=I=>{var L=pa(),U=Ie(L,!0);H(()=>{Oe(L,"id",n),Oe(L,"role",b()==="error"?"alert":"status"),Q(U,h())}),k(I,L)};be(P,I=>{s()||I(Z)})}var C=y(P,2);return ee(C,()=>qn,(I,L)=>{L(I,{get open(){return e(O)},set open(U){l(O,U,!0)},children:(U,re)=>{var de=ma(),N=X(de);{const oe=(ce,M)=>{let J=()=>(M?.()).props;{let d=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),V=f(()=>s()??n);Ne(ce,ir(J,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(d)},get"aria-label"(){return E()},get"aria-describedby"(){return e(V)},get tooltip(){return h()},get tooltipDisabled(){return e(O)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(i,R)=>{{let Y=f(()=>b()==="error"?jr:b()==="warning"?en:Kr);ye(i,{get icon(){return e(Y)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};ee(N,()=>Wn,(ce,M)=>{M(ce,{child:oe,$$slots:{child:!0}})})}var z=y(N,2);ee(z,()=>Gn,(oe,ce)=>{ce(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return E()},onCloseAutoFocus:M=>{j&&g()&&(M.preventDefault(),g().focus()),j=!1},children:(M,J)=>{var d=ba(),V=X(d),i=Ie(V,!0),R=y(V,2);{var Y=ue=>{Ne(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void B(),children:(W,K)=>{wt();var pe=lt();H(()=>Q(pe,S())),k(W,pe)},$$slots:{default:!0}})};be(R,ue=>{S()&&A()&&ue(Y)})}H(()=>Q(i,h())),k(M,d)},$$slots:{default:!0}})}),k(U,de)},$$slots:{default:!0}})}),ie(u),H(()=>Oe(u,"data-browser-status",b())),k(o,u),je(T)}function _a(o,t,n){const v=n.width>0?t.width/n.width:1,h=n.height>0?t.height/n.height:1,E=Math.max(0,Math.floor(o.x*v)),b=Math.max(0,Math.floor(o.y*h)),S=Math.min(t.width,Math.ceil((o.x+o.width)*v)),A=Math.min(t.height,Math.ceil((o.y+o.height)*h));return{x:E,y:b,width:Math.max(0,S-E),height:Math.max(0,A-b)}}const ya=Sr({selector:ft().min(1),domPath:ft().min(1),tagName:ft().min(1),id:ft(),className:ft(),textSnippet:ft().max(120),rect:Sr({x:Tt().finite(),y:Tt().finite(),width:Tt().finite().nonnegative(),height:Tt().finite().nonnegative()}).strict(),pageUrl:ft().min(1),sourceRef:ft().min(1).optional()}).strict(),Dr="__INTENT_ELEMENT_PICKED__:";function xa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Dr))return null;let t;try{t=JSON.parse(o.slice(Dr.length))}catch{t=null}const n=ya.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const Ca=String.raw`
2
2
  (function() {
3
3
  var PICKED_PREFIX = '__INTENT_ELEMENT_PICKED__:';
4
4
  var CANCELLED = '__INTENT_ELEMENT_PICK_CANCELLED__';
@@ -1 +1 @@
1
- import{b as o}from"./Cpw-AI-k.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
1
+ import{b as o}from"./C89-HR3N.js";var c=1;function i(){if(!(typeof globalThis>"u"))return globalThis}o(i,"getCaptureGlobal");function p(){return!!i()?.mermaidCaptureSizes}o(p,"shouldCaptureSizes");function u(){return typeof location>"u"?"browser-dev":`${location.pathname}${location.search}`}o(u,"capturedFromLocation");function d(n,r){const t=i();if(!t)return;const e=r.node(),s=((e&&"ownerSVGElement"in e?e.ownerSVGElement:null)??e)?.id??"(unknown)";t.mermaidCapturedSizes??=[];const a={svgId:s,sizes:n};t.mermaidCapturedSizes.push(a),t.mermaidLastCapturedSizes=a}o(d,"emitCapturedSizes");function m(n,r){const t=[];for(const e of r.nodes)e.isGroup||t.push({id:e.id,width:e.width??0,height:e.height??0});t.length!==0&&d({metadata:{captureVersion:c,capturedAt:new Date().toISOString(),capturedFrom:u()},nodes:t},n)}o(m,"captureNodeSizes");export{m as captureNodeSizes,p as shouldCaptureSizes};
@@ -1,4 +1,4 @@
1
- import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./C0QTy0Sy.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Yr,c5 as Ut,a as En,$ as wa,cd as Yt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./bhKPSdq4.js";import{k as ya}from"./-K3ARgq0.js";import{c as Ct}from"./CUkDMZwP.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./7UPrdiE9.js";import{t as $t,k as Vs}from"./CrD0jtXE.js";import{h as qs}from"./C2jYl_tm.js";import{b as Zs,a as Hs}from"./Dhy-QJgd.js";import{a as Gr,o as Jr,S as Gn,E as Ws,e as Rn}from"./DCL0Px6m.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import"./lJeex2Gh.js";import{r as Ks,e as Xs}from"./90dwRRI_.js";import{m as Gt}from"./DlUZpQ7U.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{jy as ir,Jv as le,i as Aa,u$ as Qs,bq as Ys,jB as Gs,yV as Js,yX as eo,ju as to,U as ea,V as ta,kc as tr,k8 as Jn,jY as na,kg as no,jL as ro,kd as ao,x4 as so,x5 as oo,x2 as io,jM as lo,kb as ra,k5 as co,jz as uo,nf as go,ne as po,jv as aa,rL as fo,k2 as vo,jA as mo,j$ as ho,jJ as sa,Lu as _o,jG as bo,ka as wo}from"./_LtUY0jS.js";import{a_ as lr,dH as yo,O as xo,cU as Ao}from"./Cppy6ZYG.js";import{E as ka}from"./B9qXV8kb.js";import"./Bsh6nUhU.js";import{m as Sn,bF as ko,B as Io,bE as Ro,e as So,ai as Mo,bD as Co,bL as Po}from"./C91EC830.js";import{u as Ia}from"./B9ZFoPLo.js";import{d1 as Ra,al as Do,c$ as $o,a1 as Eo,bH as nr,be as cr,bj as Sa,bb as To,bk as zo,bA as Uo,by as Oo,bd as Lo,ba as No,cs as Bo,bv as Fo,bx as jo,bI as Vo,bD as qo,bl as Zo,bm as Ma,bL as Ho,bE as Wo,bz as Ko,bh as Xo,bG as Qo,bg as Yo,bn as oa,bi as ia,bf as la,bs as Go}from"./BfSTFUKA.js";import{e as Jo}from"./DB7RVYiL.js";import{h as Ca,e as Pa,g as gt,i as gn,I as Da}from"./B6S6VNu7.js";import{b as Qt}from"./Dn334wJv.js";import{f as Oe,ae as ei}from"./CttA-M7l.js";import{T as ti}from"./CW0Mb2k4.js";import"./BWYuMy_r.js";import{c as ni}from"./D-62MVd3.js";import{P as zn}from"./ujhgjK1k.js";import{l as pn,k as $a,q as rr,i as ri}from"./CE7dsja4.js";import{F as kt,cn as ai,aS as si,bj as oi,Q as ii,cj as Ea,b7 as li,aZ as ci,bY as di,bF as ui,cd as gi,a6 as pi,$ as fi,d3 as vi,ad as mi}from"./U9jJmfYa.js";import{A as fn}from"./wl2qP2wF.js";import{B as Ta}from"./6D8I0EJP.js";import{parseIntentLink as hi}from"./CteMcmUe.js";import{h as _i}from"./C3KL0Dob.js";import{M as bi}from"./CqhHB0m1.js";import{a as wi}from"./lQcc1B6x.js";import{T as za}from"./CDLANF8s.js";import{c as Ua,d as Oa}from"./DHLXX1td.js";import"./DU3vNstz.js";import{i as yi}from"./BjLb7AHW.js";import{a2 as xi}from"./BtI19qHa.js";import{a as Ai,A as ca}from"./CEl8yEuC.js";import{I as ki}from"./B2w13ngc.js";import{S as Ii}from"./BAwmUXtg.js";import{C as Ri}from"./B0-WaGMs.js";import{D as Si,p as Mi}from"./CzMfcD76.js";import{h as da,C as Ci}from"./CEOk8g-Q.js";import{g as Pi}from"./DWGXN6Nr.js";import{u as Di,n as $i}from"./BsOWc0fD.js";const Ei=/^!\[([^\]\n]*)\]\((workspace-asset:\/\/[^\s()]+)\)$/,Ti={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ar(s,n){const l=s.split(`
1
+ import{t as et,bo as c,bw as tt,b as nt,bp as ma,bm as h,br as $n,bq as or,bs as be}from"./C0QTy0Sy.js";import{bs as rt,aD as e,a5 as Q,bS as S,bA as K,W as g,bn as at,c9 as i,aA as d,a7 as ke,ay as ee,be as je,b$ as Ve,aC as mt,ai as Bs,bo as ha,ca as Ue,bH as H,bf as _a,b_ as B,aj as Fs,bV as Ae,bO as q,aB as j,aw as Mt,bl as ue,cb as ba,am as Yr,c5 as Ut,a as En,$ as wa,cd as Yt,c0 as Xt,br as js}from"./3SdAC2_C.js";import{i as U}from"./bhKPSdq4.js";import{k as ya}from"./-K3ARgq0.js";import{c as Ct}from"./CUkDMZwP.js";import{b as xa,f as bt,c as un,s as we,g as Tn}from"./7UPrdiE9.js";import{t as $t,k as Vs}from"./CrD0jtXE.js";import{h as qs}from"./C2jYl_tm.js";import{b as Zs,a as Hs}from"./Dhy-QJgd.js";import{a as Gr,o as Jr,S as Gn,E as Ws,e as Rn}from"./DCL0Px6m.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import"./lJeex2Gh.js";import{r as Ks,e as Xs}from"./90dwRRI_.js";import{m as Gt}from"./DlUZpQ7U.js";import"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{jy as ir,Jv as le,i as Aa,u$ as Qs,bq as Ys,jB as Gs,yV as Js,yX as eo,ju as to,U as ea,V as ta,kc as tr,k8 as Jn,jY as na,kg as no,jL as ro,kd as ao,x4 as so,x5 as oo,x2 as io,jM as lo,kb as ra,k5 as co,jz as uo,nf as go,ne as po,jv as aa,rL as fo,k2 as vo,jA as mo,j$ as ho,jJ as sa,Lu as _o,jG as bo,ka as wo}from"./_LtUY0jS.js";import{a_ as lr,dH as yo,O as xo,cU as Ao}from"./Cppy6ZYG.js";import{E as ka}from"./B9qXV8kb.js";import"./Bsh6nUhU.js";import{m as Sn,bF as ko,B as Io,bE as Ro,e as So,ai as Mo,bD as Co,bL as Po}from"./BpfNraM2.js";import{u as Ia}from"./B9ZFoPLo.js";import{d1 as Ra,al as Do,c$ as $o,a1 as Eo,bH as nr,be as cr,bj as Sa,bb as To,bk as zo,bA as Uo,by as Oo,bd as Lo,ba as No,cs as Bo,bv as Fo,bx as jo,bI as Vo,bD as qo,bl as Zo,bm as Ma,bL as Ho,bE as Wo,bz as Ko,bh as Xo,bG as Qo,bg as Yo,bn as oa,bi as ia,bf as la,bs as Go}from"./CaiHVgqy.js";import{e as Jo}from"./DB7RVYiL.js";import{h as Ca,e as Pa,g as gt,i as gn,I as Da}from"./B6S6VNu7.js";import{b as Qt}from"./Dn334wJv.js";import{f as Oe,ae as ei}from"./CttA-M7l.js";import{T as ti}from"./CW0Mb2k4.js";import"./BWYuMy_r.js";import{c as ni}from"./D-62MVd3.js";import{P as zn}from"./ujhgjK1k.js";import{l as pn,k as $a,q as rr,i as ri}from"./CE7dsja4.js";import{F as kt,cn as ai,aS as si,bj as oi,Q as ii,cj as Ea,b7 as li,aZ as ci,bY as di,bF as ui,cd as gi,a6 as pi,$ as fi,d3 as vi,ad as mi}from"./U9jJmfYa.js";import{A as fn}from"./wl2qP2wF.js";import{B as Ta}from"./6D8I0EJP.js";import{parseIntentLink as hi}from"./j9JAHeUU.js";import{h as _i}from"./CKyxiFOy.js";import{M as bi}from"./Ok-Tb49z.js";import{a as wi}from"./BLUz30qV.js";import{T as za}from"./CDLANF8s.js";import{c as Ua,d as Oa}from"./DHLXX1td.js";import"./DU3vNstz.js";import{i as yi}from"./BjLb7AHW.js";import{a2 as xi}from"./BkfS5KoW.js";import{a as Ai,A as ca}from"./DBvm0g7B.js";import{I as ki}from"./B2w13ngc.js";import{S as Ii}from"./BAwmUXtg.js";import{C as Ri}from"./B0-WaGMs.js";import{D as Si,p as Mi}from"./D3qmsAQt.js";import{h as da,C as Ci}from"./yDR0_Br6.js";import{g as Pi}from"./DWGXN6Nr.js";import{u as Di,n as $i}from"./BsOWc0fD.js";const Ei=/^!\[([^\]\n]*)\]\((workspace-asset:\/\/[^\s()]+)\)$/,Ti={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp"};function ar(s,n){const l=s.split(`
2
2
  `),r=[];let a=l.length;for(;a>0;){const f=Ei.exec(l[a-1]);if(!f||!Ra(f[2],n))break;r.unshift({name:f[1],url:f[2]}),a--}if(!r.length)return{text:s,images:r};const u=l.slice(0,a).join(`
3
3
  `);return{text:u.endsWith(`
4
4
  `)?u.slice(0,-1):u,images:r}}function Mn(s,n){if(!n.length)return s;const l=n.map(({name:r,url:a})=>`![${r.replace(/[[\]()\\\n\r]/g,"").trim()||"image"}](${a})`);return s?`${s}
@@ -1,2 +1,2 @@
1
- import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./_LtUY0jS.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./DFUCAM2K.js";import{bO as Ea,b$ as La,dH as Ma}from"./Cppy6ZYG.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./BsOWc0fD.js";import{m as sr}from"./DlUZpQ7U.js";import{f as Te}from"./CttA-M7l.js";import{h as Ua}from"./C2jYl_tm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./DCL0Px6m.js";import{c as Xa}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{$ as Ya}from"./BtI19qHa.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./D32iIfZB.js";import{M as Qa}from"./CqhHB0m1.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./Dhy-QJgd.js";import{M as Bt}from"./BotfI-oJ.js";import{V as eo}from"./BY98dnH8.js";import{bT as to,b7 as ro}from"./BfSTFUKA.js";import{g as ao}from"./CRdOY_2z.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./BFPO9C1I.js";import{b as lo,h as so}from"./BMF9dBr3.js";import{t as co}from"./DpPV7WHr.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
1
+ import{t as Xt,bo as de,_ as aa,bw as Yt,bs as ge,bq as pr,b as Gt,bm as d}from"./C0QTy0Sy.js";import{bs as Jt,ca as se,aD as e,bH as c,a5 as F,bA as k,W as s,bn as Zt,bV as j,c9 as i,aA as ce,c6 as Ht,ay as ve,be as ot,b$ as ct,b_ as I,bO as m,bS as g,bl as C,aB as x,bj as oa,aw as ut,ai as ia,c5 as ur,a as Lr,a7 as Ue,aj as yt,cd as na,br as la,bf as sa}from"./3SdAC2_C.js";import{i as Y}from"./bhKPSdq4.js";import{k as Mr}from"./-K3ARgq0.js";import{g as Ut}from"./B6S6VNu7.js";import{c as Nt}from"./CUkDMZwP.js";import{s as Qe,g as jt,f as Kt}from"./7UPrdiE9.js";import{b as Rr}from"./Dn334wJv.js";import{Jv as R,nX as jr,we as Ur,wd as Vr,LL as da,LM as ca,eJ as ua,eK as fa,Lb as yr,m5 as nr,Cx as $r,sG as kr,oj as va,A2 as pa,ac as Ir,nZ as ga,K2 as ma,Ki as _a,nx as ha,iW as wa,vG as ba,Av as xa,La as Pa}from"./_LtUY0jS.js";import{g as ya}from"./DWGXN6Nr.js";import{a as $a,h as ka,j as Ia,c as Sa,d as Ca,i as Fa,e as Da,f as Sr,g as Ta,b as lr}from"./DFUCAM2K.js";import{bO as Ea,b$ as La,dH as Ma}from"./Cppy6ZYG.js";import{w as Cr,d as Ra}from"./wEnqV1Ol.js";import{f as ja}from"./BsOWc0fD.js";import{m as sr}from"./DlUZpQ7U.js";import{f as Te}from"./CttA-M7l.js";import{h as Ua}from"./C2jYl_tm.js";import"./CrD0jtXE.js";import{F as dt,ac as Va,au as za,aZ as Aa,b3 as Ot,ct as Wa,cu as Na,bm as Ba,cS as Ha,c9 as Oa}from"./U9jJmfYa.js";import{E as qa,b as Ka,S as Fr}from"./DCL0Px6m.js";import{c as Xa}from"./ChTqQfQN.js";import"./DI_O2uCQ.js";import{$ as Ya}from"./BkfS5KoW.js";import{i as dr,b as Ga,a as Ja}from"./H2jLkRRS.js";import{C as fr,p as Za}from"./D32iIfZB.js";import{M as Qa}from"./Ok-Tb49z.js";import{l as cr,m as zr}from"./CE7dsja4.js";import"./Bsh6nUhU.js";import"./Dhy-QJgd.js";import{M as Bt}from"./BotfI-oJ.js";import{V as eo}from"./BY98dnH8.js";import{bT as to,b7 as ro}from"./CaiHVgqy.js";import{g as ao}from"./CRdOY_2z.js";import{H as oo}from"./Bqd7fdCF.js";import{g as io,W as no}from"./BFPO9C1I.js";import{b as lo,h as so}from"./BMF9dBr3.js";import{t as co}from"./DpPV7WHr.js";const Dr=1024*1024,uo=5e3;function fo(A,_){if(A.length>Dr||new TextEncoder().encode(A).byteLength>Dr){_(null);return}let re;try{re=new Worker(new URL("/app/immutable/workers/html-file-preview.worker-BfFljPK-.js",import.meta.url),{type:"module"})}catch{_(null);return}let Be=!1;const ee=setTimeout(()=>O(null),uo);function P(){Be||(Be=!0,clearTimeout(ee),re.terminate())}function O(ae){Be||(P(),_(ae))}return re.onmessage=({data:ae})=>O(ae),re.onerror=ae=>{ae.preventDefault(),O(null)},re.postMessage(A),P}const Ar=R.createSelector((A,_)=>jr(A.pdfPreview.previews,_));var vo=x('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),po=x('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function vr(A,_){if(new.target)return Xt({component:vr,...A});Jt(_,!0);const re=()=>ge(ye,"$preview",Be),[Be,ee]=pr();let P=de(_,"workspaceId",7),O=de(_,"filePath",7),ae=de(_,"gitRootId",7);const Ee=crypto.randomUUID(),ye=Ar(Ee),be=new WeakMap;let oe=j(null),et=j(void 0),U=j(1),B=j(1),pe=j(!0),xe=j(!1),Le=j(null),W=j(0);const $e=i(()=>re()?.error??e(Le)),Ce=i(()=>e($e)==="missing"?d.file_pdf_missing_error():e($e)==="large"?d.file_pdf_large_error():e($e)==="invalid"?d.file_pdf_invalid_error():e($e)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());se(()=>{const v=P(),f=O();e(W);const ie=crypto.randomUUID();return R.dispatch(Ur(Ee,ie,v,f,...ae()?[{gitRootId:ae()}]:[])),()=>{R.dispatch(Vr(Ee,ie))}}),se(()=>{const v=re()?.url;let f=!1,ie;if(c(oe,null),c(Le,null),c(pe,!0),c(U,1),c(B,1),!!v)return(async()=>{try{const{loadPdfDocument:y}=await aa(async()=>{const{loadPdfDocument:N}=await import("./cb1JHFKl.js");return{loadPdfDocument:N}},[],import.meta.url);if(f)return;ie=y(v);const G=await ie.promise;f||c(oe,G)}catch(y){if(f)return;c(Le,y instanceof Error&&y.name==="PasswordException"?"password":y instanceof Error&&y.name==="InvalidPDFException"?"invalid":"load",!0)}finally{f||c(pe,!1)}})(),()=>{f=!0,ie?.destroy()}}),se(()=>{const v=e(oe),f=e(et),ie=e(U),y=e(B);if(!v||!f)return;let G=!1,N,D;const fe=()=>{if(!D)return;const J=(be.get(D)??1)-1;J?be.set(D,J):(be.delete(D),D.cleanup()),D=void 0};return c(xe,!0),(async()=>{try{if(D=await v.getPage(ie),be.set(D,(be.get(D)??0)+1),G){fe();return}const J=D.getViewport({scale:y}),ne=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));f.width=Math.ceil(J.width*ne),f.height=Math.ceil(J.height*ne),f.style.width=`${J.width}px`,f.style.height=`${J.height}px`,N=D.render({canvas:f,viewport:J,transform:[ne,0,0,ne,0,0]}),await N.promise}catch{G||c(Le,"invalid")}finally{G||c(xe,!1)}})(),()=>{G=!0,N?.cancel(),N?N.promise.then(fe,fe):fe()}});var qe={get workspaceId(){return P()},set workspaceId(v){P(v),ce()},get filePath(){return O()},set filePath(v){O(v),ce()},get gitRootId(){return ae()},set gitRootId(v){ae(v),ce()},$set:Yt,$on:(v,f)=>Gt(_,v,f)},Ve=po(),Ke=F(Ve);{var ue=v=>{{const f=y=>{ot();var G=ct();I(()=>m(G,e(Ce))),s(y,G)};let ie=i(()=>d.ui_combobox_retry_label());qa(v,{onRetry:()=>Ht(W),get retryLabel(){return e(ie)},class:"m-auto",message:f,$$slots:{message:!0}})}},a=v=>{{let f=i(()=>d.file_pdf_loading_label());Ka(v,{get label(){return e(f)},count:1,class:"p-4"})}},l=v=>{var f=vo(),ie=ve(f),y=F(ie);{let me=i(()=>e(U)<=1);Te(y,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U,-1),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_previous_label()]),s(Me,_e)},$$slots:{default:!0}})}var G=g(y,2),N=C(G,!0),D=g(G,2);{let me=i(()=>e(U)>=e(oe).numPages);Te(D,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>Ht(U),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.file_pdf_next_label()]),s(Me,_e)},$$slots:{default:!0}})}var fe=g(D,2);{let me=i(()=>e(B)<=.25);Te(fe,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.max(.25,e(B)-.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}var J=g(fe,2),ne=C(J,!0),ft=g(J,2);{let me=i(()=>e(B)>=3);Te(ft,{variant:"ghost",size:"compact",get disabled(){return e(me)},onclick:()=>c(B,Math.min(3,e(B)+.25),!0),children:(Me,tt)=>{ot();var _e=ct();I(Re=>m(_e,Re),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Me,_e)},$$slots:{default:!0}})}k(ie);var vt=g(ie,2),pt=F(vt);let bt;Rr(pt,me=>c(et,me),()=>e(et)),k(vt),I((me,Me,tt)=>{m(N,me),m(ne,Me),Qe(vt,"aria-busy",e(xe)),Qe(pt,"aria-label",tt),bt=jt(pt,"",bt,{visibility:e(xe)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:cr(e(U)),total:cr(e(oe).numPages)}),()=>zr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:O(),page:cr(e(U))})]),s(v,f)};Y(Ke,v=>{e($e)?v(ue):e(pe)||re()?.status==="loading"?v(a,1):e(oe)&&v(l,2)})}k(Ve),s(A,Ve);var q=Zt(qe);return ee(),q}const go=R.createSelector((A,_)=>jr(A.videoPreview.previews,_));var mo=x('<p role="status"> </p>'),_o=x('<p role="alert"> </p>'),ho=x('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),wo=x('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),bo=x('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Wr(A,_){if(new.target)return Xt({component:Wr,...A});Jt(_,!0);const re=()=>ge(et,"$preview",Be),[Be,ee]=pr();let P=de(_,"sourceUrl",7),O=de(_,"fileName",7),ae=de(_,"allowDownload",7),Ee=de(_,"downloading",7),ye=de(_,"onDownload",7),be=j(null);const oe=crypto.randomUUID(),et=go(oe),U=i(()=>re()?.status==="loading"),B=i(()=>e(be)??re()?.error);let pe=!1,xe=!1;oa(()=>{xe=!0,R.dispatch(da(oe))});function Le(){if(xe||e(U))return;const a=P().startsWith("workspace-file://")?new URL(P()):null;if(pe||!a||!a.pathname.toLowerCase().endsWith(".mp4")){c(be,"unsupported");return}pe=!0,a.searchParams.set("preview","h264"),R.dispatch(ca(oe,a.hostname,a.toString()))}function W(a){if(xe)return;const l=a.currentTarget.error?.code;l===2?c(be,"network"):l!==1&&Le()}var $e={get sourceUrl(){return P()},set sourceUrl(a){P(a),ce()},get fileName(){return O()},set fileName(a){O(a),ce()},get allowDownload(){return ae()},set allowDownload(a){ae(a),ce()},get downloading(){return Ee()},set downloading(a){Ee(a),ce()},get onDownload(){return ye()},set onDownload(a){ye(a),ce()},$set:Yt,$on:(a,l)=>Gt(_,a,l)},Ce=bo(),qe=F(Ce);{var Ve=a=>{var l=ho(),q=F(l),v=C(q,!0),f=g(q,2);{var ie=D=>{var fe=mo(),J=C(fe,!0);I(ne=>m(J,ne),[()=>d.editor_fileViewer_videoPreparing_label()]),s(D,fe)},y=D=>{var fe=_o(),J=C(fe,!0);I(ne=>m(J,ne),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(D,fe)};Y(f,D=>{e(U)?D(ie):D(y,-1)})}var G=g(f,2);{var N=D=>{Te(D,{variant:"secondary",size:"sm",get onclick(){return ye()},get disabled(){return Ee()},children:(fe,J)=>{ot();var ne=ct();I(ft=>m(ne,ft),[()=>d.layout_fileTab_downloadFile_label()]),s(fe,ne)},$$slots:{default:!0}})};Y(G,D=>{ae()&&D(N)})}k(l),I(()=>m(v,O())),s(a,l)},Ke=a=>{var l=wo(),q=C(l,!0);I(v=>{Qe(l,"src",re()?.url??P()),m(q,v)},[()=>d.editor_fileViewer_videoUnsupported_label()]),ut("error",l,W),ut("loadedmetadata",l,v=>{v.currentTarget.videoWidth===0&&Le()}),s(a,l)};Y(qe,a=>{e(B)||e(U)?a(Ve):a(Ke,-1)})}k(Ce),s(A,Ce);var ue=Zt($e);return ee(),ue}var xo=x('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Po=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),yo=x('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),$o=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),ko=x("<!> ",1),Io=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),So=x('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),Co=x('<td class="border border-border px-2 py-1 text-xs"> </td>'),Fo=x("<tr></tr>"),Do=x('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),To=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Eo=x('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),Lo=x('<div class="h-full flex flex-col"><!></div>');function qt(A,_){if(new.target)return Xt({component:qt,...A});Jt(_,!0);const re=t=>{var o=xo(),u=ve(o);{let V=i(()=>d.editor_fileViewer_zoomOut_tooltip());Te(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:fe,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Wa},size:"sm"})},$$slots:{default:!0}})}var w=g(u,2),$=C(w,!0),E=g(w,2);{let V=i(()=>d.editor_fileViewer_zoomIn_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:D,get title(){return e(V)},children:(T,K)=>{dt(T,{get icon(){return Na},size:"sm"})},$$slots:{default:!0}})}ot(2),I(()=>m($,e(Le))),s(t,o)},Be=Xa("FileViewer");let ee=de(_,"filePath",7),P=de(_,"fileContent",7,""),O=de(_,"sourceUrl",7),ae=de(_,"language",7),Ee=de(_,"isBinary",7),ye=de(_,"allowDownload",7,!0),be=de(_,"onDownload",7),oe=de(_,"downloading",7,!1);const et=t=>{const o=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(o)?"image":o==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(o)?"video":["mp3","wav","ogg","m4a","flac"].includes(o)?"audio":o==="pdf"?"pdf":["md","markdown"].includes(o)?"markdown":o==="json"?"json":o==="csv"?"csv":["yaml","yml"].includes(o)?"yaml":o==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(o)?"archive":["exe","dll","so","dylib","wasm"].includes(o)?"binary":"text"},U=i(()=>et(ee())),B=i(()=>ee().split("/").pop()||d.editor_fileViewer_unknown_fallback());let pe=j(100),xe=j(0);const Le=i(()=>zr(e(pe)/100,{style:"percent",maximumFractionDigits:0}));let W=j(!1),$e=j(0),Ce=j(0),qe=j(0),Ve=j(0),Ke=j(!1),ue=null;function a(){const t=ue;ue=null,c(Ke,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function l(t){if(t.button!==0||!t.isPrimary||ue)return;const o=t.currentTarget;o.setPointerCapture(t.pointerId),ue={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:o},c(Ke,!0),t.preventDefault()}function q(t){if(!(!ue||t.pointerId!==ue.pointerId)){if((t.buttons&1)===0){a();return}c(qe,ue.viewport.scrollLeft,!0),c(Ve,ue.viewport.scrollTop,!0),c($e,e($e)+(t.clientX-ue.x)),c(Ce,e(Ce)+(t.clientY-ue.y)),ue.x=t.clientX,ue.y=t.clientY}}function v(t){t.pointerId===ue?.pointerId&&a()}se(()=>{ee(),O(),e(pe),e(xe),c(qe,0),c(Ve,0)}),se(()=>(ee(),O(),ur(()=>{a(),c($e,0),c(Ce,0)}),a));const f=t=>{const o=t.split(".").pop()?.toLowerCase();return o==="jpg"||o==="jpeg"?"image/jpeg":o==="png"?"image/png":o==="gif"?"image/gif":o==="webp"?"image/webp":"application/octet-stream"},ie=t=>{const o=t.split(".").pop()?.toLowerCase();if(o==="mp4")return"video/mp4";if(o==="webm")return"video/webm"},y=()=>{if(O())return O();if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():Ee()?`data:${f(ee())};base64,${P()}`:`data:${f(ee())};base64,${P()}`;if(P()instanceof ArrayBuffer){const o=new Uint8Array(P()).reduce((w,$)=>w+String.fromCharCode($),""),u=btoa(o);return`data:${f(ee())};base64,${u}`}return""},G=()=>{if(O())return O();const t=ie(ee());if(!t)return"";if(typeof P()=="string")return P().startsWith("data:")||P().startsWith("http")?P():`data:${t};base64,${P()}`;const o=new Uint8Array(P()),u=[],w=32768;for(let $=0;$<o.length;$+=w)u.push(String.fromCharCode(...o.subarray($,$+w)));return`data:${t};base64,${btoa(u.join(""))}`},N=()=>{const t=typeof P()=="string"?new TextEncoder().encode(P()):new Uint8Array(P()),o=[],u=32768;for(let w=0;w<t.length;w+=u)o.push(String.fromCharCode(...t.subarray(w,w+u)));return`data:image/svg+xml;base64,${btoa(o.join(""))}`},D=()=>{c(pe,Math.min(e(pe)+25,500),!0)},fe=()=>{c(pe,Math.max(e(pe)-25,25),!0)},J=()=>{c(xe,(e(xe)+90)%360)},ne=()=>{if(!ye()||oe())return;if(be()){be()();return}const t=document.createElement("a");t.href=e(U)==="video"?G():e(U)==="svg"?N():y(),t.download=e(B),t.click()},ft=async()=>{try{const t=y(),o=new Image;o.crossOrigin="anonymous";const u=await new Promise((w,$)=>{o.onload=()=>{const E=document.createElement("canvas");E.width=o.naturalWidth,E.height=o.naturalHeight;const V=E.getContext("2d");if(!V){$(new Error("Failed to get canvas context"));return}V.drawImage(o,0,0),E.toBlob(T=>{T?w(T):$(new Error("Failed to create blob from canvas"))},"image/png",1)},o.onerror=()=>$(new Error("Failed to load image")),o.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),c(W,!0),setTimeout(()=>c(W,!1),2e3)}catch(t){Be.error("Failed to copy image:",t)}},vt=t=>{try{const o=JSON.parse(t);return JSON.stringify(o,null,2)}catch{return t}},pt=t=>t.split(`
2
2
  `).map(u=>u.split(",").map(w=>w.trim()));var bt={get filePath(){return ee()},set filePath(t){ee(t),ce()},get fileContent(){return P()},set fileContent(t=""){P(t),ce()},get sourceUrl(){return O()},set sourceUrl(t){O(t),ce()},get language(){return ae()},set language(t){ae(t),ce()},get isBinary(){return Ee()},set isBinary(t){Ee(t),ce()},get allowDownload(){return ye()},set allowDownload(t=!0){ye(t),ce()},get onDownload(){return be()},set onDownload(t){be(t),ce()},get downloading(){return oe()},set downloading(t=!1){oe(t),ce()},$set:Yt,$on:(t,o)=>Gt(_,t,o)},me=Lo();ut("blur",Lr,a);var Me=F(me);{var tt=t=>{var o=Po(),u=F(o),w=F(u);re(w);var $=g(w,2);{let Pe=i(()=>d.editor_fileViewer_rotate_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:J,get title(){return e(Pe)},children:(Ae,Ye)=>{dt(Ae,{get icon(){return Va},size:"sm"})},$$slots:{default:!0}})}var E=g($,4);{let Pe=i(()=>d.editor_fileViewer_copyImage_tooltip());Te(E,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ft,get title(){return e(Pe)},children:(Ae,Ye)=>{var rt=Ue(),Ge=ve(rt);{var kt=Fe=>{dt(Fe,{get icon(){return za},size:"sm",class:"text-green-500"})},Vt=Fe=>{dt(Fe,{get icon(){return Aa},size:"sm"})};Y(Ge,Fe=>{e(W)?Fe(kt):Fe(Vt,-1)})}s(Ae,rt)},$$slots:{default:!0}})}var V=g(E,2);{let Pe=i(()=>!ye()||oe()),Ae=i(()=>d.editor_fileViewer_download_tooltip());Te(V,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(Pe)},get title(){return e(Ae)},children:(Ye,rt)=>{dt(Ye,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var T=g(V,2),K=C(T,!0);k(u);var L=g(u,2),he=C(L);k(o),I(Pe=>{m(K,e(B)),Kt(L,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(L,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(he,"src",Pe),Qe(he,"alt",e(B)),jt(he,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100}) rotate(${e(xe)??""}deg); transition: transform 0.2s;`)},[()=>y()]),yt("pointerdown",L,l),yt("pointermove",L,q),yt("pointerup",L,v),ut("pointercancel",L,v),ut("lostpointercapture",L,v),s(t,o)},_e=t=>{var o=yo(),u=F(o),w=F(u);re(w);var $=g(w,2);{let L=i(()=>!ye()||oe()),he=i(()=>d.editor_fileViewer_download_tooltip());Te($,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ne,get disabled(){return e(L)},get title(){return e(he)},children:(Pe,Ae)=>{dt(Pe,{get icon(){return Ot},size:"sm"})},$$slots:{default:!0}})}var E=g($,2),V=C(E,!0);k(u);var T=g(u,2),K=C(T);k(o),I(L=>{m(V,e(B)),Kt(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Ke)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),jt(T,`--pan-scroll-x: ${e(qe)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),Qe(K,"src",L),Qe(K,"alt",e(B)),jt(K,`translate: ${e($e)??""}px ${e(Ce)??""}px; transform: scale(${e(pe)/100});`)},[()=>N()]),yt("pointerdown",T,l),yt("pointermove",T,q),yt("pointerup",T,v),ut("pointercancel",T,v),ut("lostpointercapture",T,v),s(t,o)},Re=t=>{const o=i(G);var u=Ue(),w=ve(u);Mr(w,()=>ee()+e(o),$=>{Wr($,{get sourceUrl(){return e(o)},get fileName(){return e(B)},get allowDownload(){return ye()},get downloading(){return oe()},onDownload:ne})}),s(t,u)},Qt=t=>{var o=$o(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=F($),V=g(E);k($),k(o),I((T,K)=>{m(w,e(B)),Qe(E,"src",T),m(V,` ${K??""}`)},[()=>y(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,o)},$t=t=>{var o=Io(),u=g(F(o),2),w=C(u,!0),$=g(u,2);{let E=i(()=>!ye()||oe());Te($,{size:"sm",variant:"secondary",onclick:ne,get disabled(){return e(E)},children:(V,T)=>{var K=ko(),L=ve(K);dt(L,{get icon(){return Ot},size:"sm",class:"mr-2"});var he=g(L);I(Pe=>m(he,` ${Pe??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(V,K)},$$slots:{default:!0}})}k(o),I(E=>m(w,E),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,o)},er=t=>{{let o=i(()=>vt(P().toString()));fr(t,{get value(){return e(o)},language:"json",get fileName(){return ee()},lineNumbers:!0,readOnly:!0})}},tr=t=>{const o=i(()=>pt(P().toString()));var u=Do(),w=F(u),$=F(w),E=F($);Ut(E,23,()=>e(o)[0]||[],(T,K)=>`header-${K}-${T}`,(T,K)=>{var L=So(),he=C(L,!0);I(()=>m(he,e(K))),s(T,L)}),k(E),k($);var V=g($);Ut(V,23,()=>e(o).slice(1),(T,K)=>`row-${K}`,(T,K,L)=>{var he=Fo();Ut(he,23,()=>e(K),(Pe,Ae)=>`cell-${e(L)}-${Ae}`,(Pe,Ae)=>{var Ye=Co(),rt=C(Ye,!0);I(()=>m(rt,e(Ae))),s(Pe,Ye)}),k(he),s(T,he)}),k(V),k(w),k(u),s(t,u)},Xe=t=>{var o=To(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_archive_label()]),s(t,o)},ze=t=>{var o=Eo(),u=g(F(o),2),w=C(u,!0),$=g(u,2),E=C($,!0);k(o),I(V=>{m(w,e(B)),m(E,V)},[()=>d.editor_fileViewer_binary_label()]),s(t,o)},rr=t=>{{let o=i(()=>P().toString());fr(t,{get value(){return e(o)},get language(){return ae()},get fileName(){return ee()},lineNumbers:!0,highlightActiveLine:!0})}};Y(Me,t=>{e(U)==="image"?t(tt):e(U)==="svg"?t(_e,1):e(U)==="video"?t(Re,2):e(U)==="audio"?t(Qt,3):e(U)==="pdf"?t($t,4):e(U)==="json"?t(er,5):e(U)==="csv"?t(tr,6):e(U)==="archive"?t(Xe,7):e(U)==="binary"?t(ze,8):t(rr,-1)})}return k(me),s(A,me),Zt(bt)}ia(["pointerdown","pointermove","pointerup"]);const Mo=/access denied|permission denied|outside (?:the )?workspace/i,Ro=/file not found|no such file or directory/i;function jo(A){return Mo.test(A)?"access-denied":A===d.files_read_notFound_error()||Ro.test(A)?"not-found":"generic"}function Uo(A){switch(A){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var Vo=x("<!> <!>",1),zo=x("<!> <!> <!>",1),Ao=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),Tr=x('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),Wo=x('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),Er=x('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),No=x('<div class="flex items-center gap-3"><!> <!></div>'),Bo=x('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Ho=x('<p class="text-xs"> </p>'),Oo=x("<li><!></li>"),qo=x('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Ko=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),Xo=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),Yo=x('<div class="h-full overflow-auto p-4"><!></div>'),Go=x("<div><!></div>"),Jo=x('<iframe sandbox="" referrerpolicy="no-referrer"></iframe>'),Zo=x('<div class="absolute inset-0 flex items-center justify-center text-subtle" role="status"> </div>'),Qo=x('<div class="relative size-full"><!> <!> <!></div>');function ei(A,_){if(new.target)return Xt({component:ei,...A});Jt(_,!0);const re=()=>ge(tr,"$workspace",W),Be=()=>ge(D,"$fileContentStore",W),ee=()=>ge(fe,"$fileLoadingStore",W),P=()=>ge(J,"$fileSavingStore",W),O=()=>ge(ne,"$fileErrorStore",W),ae=()=>ge(ft,"$fileErrorInfoStore",W),Ee=()=>ge(vt,"$homeView$",W),ye=()=>ge(pt,"$fileNotFoundCandidatesStore",W),be=()=>ge(bt,"$isFileBinaryStore",W),oe=()=>ge(me,"$isFileDirtyStore",W),et=()=>ge(Me,"$fileLastUpdatedStore",W),U=()=>ge(tt,"$ftChanges$",W),B=()=>ge(er,"$gutterRead$",W),pe=()=>ge(Ke,"$lineWrapping",W),xe=()=>ge(ue,"$diffIndicators",W),Le=()=>ge(Qt,"$rootMediaPreview",W),[W,$e]=pr(),Ce=(r,n=sa)=>{var b=Or,S=qr;{let le=i(()=>xe()?e(rt):[]),ke=i(()=>n()&&v());Rr(fr(r,{get value(){return b()},set value(Z){S(Z)},get language(){return e(or)},get readOnly(){return e(y)},get fileName(){return a().filePath},get workspaceId(){return l()},get filePath(){return a().filePath},get lineWrapping(){return pe()},get lineChanges(){return e(le)},get jumpTo(){return e(kt)},get externalContentVersion(){return e(Pe)},get isPanelFocused(){return e(ke)}}),Z=>c(Ye,Z,!0),()=>e(Ye))}},qe=r=>{var n=Vo(),b=ve(n);{var S=Z=>{var He=Ue(),Je=ve(He);Nt(Je,()=>Bt,(nt,Tt)=>{Tt(nt,{get icon(){return Ba},get label(){return e(Ae)},disabled:!0})}),s(Z,He)};Y(b,Z=>{!e(It)&&!e(y)&&!e(L)&&Z(S)})}var le=g(b,2);{var ke=Z=>{{let He=i(()=>e(_t)?d.ui_viewSettings_htmlPreview_label():void 0),Je=i(()=>!e(We)),nt=i(()=>!e(y)&&!e(We));eo(Z,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(wr)},get previewLabel(){return e(He)},get previewEnabled(){return e(Fe)},onTogglePreview:()=>c(Fe,!e(Fe)),get showWrap(){return e(Je)},get wrapEnabled(){return pe()},onToggleWrap:()=>R.dispatch(_a()),get showDiff(){return e(nt)},get diffEnabled(){return xe()},onToggleDiff:()=>R.dispatch(ma())})}};Y(le,Z=>{a().filePath&&!e(It)&&!e(L)&&Z(ke)})}s(r,n)},Ve=r=>{var n=Ue(),b=ve(n);{var S=le=>{var ke=zo(),Z=ve(ke);{var He=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_goToChanges_tooltip());Nt(ht,()=>Bt,(Lt,Mt)=>{Mt(Lt,{get icon(){return Oa},get label(){return e(Et)},onclick:Gr})})}s(Oe,at)};Y(Z,Oe=>{e(Hr)&&Oe(He)})}var Je=g(Z,2);{var nt=Oe=>{var at=Ue(),ht=ve(at);{let Et=i(()=>d.layout_fileTab_downloadFile_label()),Lt=i(()=>!e(Ct)||e(mt));Nt(ht,()=>Bt,(Mt,ir)=>{ir(Mt,{get icon(){return Ot},get label(){return e(Et)},onclick:At,get disabled(){return e(Lt)}})})}s(Oe,at)};Y(Je,Oe=>{e(it)&&Oe(nt)})}var Tt=g(Je,2);{let Oe=i(()=>d.layout_fileTab_deleteFile_tooltip());Nt(Tt,()=>Bt,(at,ht)=>{ht(at,{get icon(){return Ha},get label(){return e(Oe)},onclick:Jr,destructive:!0})})}s(le,ke)};Y(b,le=>{a().filePath&&!e(It)&&!e(y)&&le(S)})}s(r,n)},Ke=to(),ue=ro();let a=de(_,"tab",7),l=de(_,"workspaceId",7),q=de(_,"isActive",7),v=de(_,"isPanelFocused",7);se(()=>{const r=l();if(!(!q()||!r||e(f)))return R.dispatch(ua(r,"files")),()=>R.dispatch(fa(r,"files"))});const f=i(()=>typeof a().data?.gitRootId=="string"?a().data.gitRootId:void 0),ie=i(()=>typeof a().data?.gitRootPath=="string"?a().data.gitRootPath:void 0),y=i(()=>!!e(f)),G=i(()=>a().filePath?ja(a().filePath,e(f)):a().filePath),N=na(e(G));se(()=>{N.set(e(G))});const D=$a(l(),N),fe=ka(l(),N),J=Ia(l(),N),ne=Sa(l(),N),ft=Ca(l(),N),vt=co(l()),pt=Fa(l(),N),bt=Da(l(),N),me=Sr(l(),N),Me=Ta(l(),N),tt=Ea(l()),_e=ya(),Re=crypto.randomUUID(),Qt=Ar(Re),$t=`file-gutter:${crypto.randomUUID()}`,er=La(l(),$t),tr=Ma(l()),Xe=i(()=>re()?.worktreePath||re()?.repositoryPath||re()?.path||null),ze=i(Be),rr=io();se(()=>{e(ze)!==null&&e(ze)!==void 0&&rr?.markContentLoaded()});const t=i(ee),o=i(P),u=i(O),w=i(()=>e(u)?jo(e(u)):"generic"),$=i(()=>e(u)?lo(ae()):null);let E=j(0),V=!1;se(()=>{const r=Ee();if(!r||r.unavailable){V=!1;return}e($)&&!V&&(V=!0,ur(()=>Ht(E)))});const T=5,K=i(()=>(ye()??[]).slice(0,T)),L=i(be),he=i(oe),Pe=i(et),Ae=i(()=>e(o)?d.ui_saveIndicator_saving_tooltip():e(he)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let Ye=j(null),rt=j(la([])),Ge=j(null),kt=j(void 0),Vt=j(void 0),Fe=j(!0),gr=j(null);se(()=>{const r=a().data?.line,n=a().data?.jumpTimestamp;!r||n!==void 0&&n===e(Vt)||(c(Vt,n,!0),c(kt,{line:r},!0),c(Fe,!1))});const gt=i(()=>e(f)?Cr(a().filePath,e(ie)):null),It=i(()=>e(f)?!e(gt):!!(a().filePath&&(Ga(a().filePath)||e(Xe)&&Ja(a().filePath,e(Xe))))),St=i(()=>a().filePath&&e(Xe)?dr(a().filePath)?a().filePath:`${e(Xe)}/${a().filePath}`:null),xt=i(()=>!!a().filePath&&/\.pdf$/i.test(a().filePath)),Pt=i(()=>!!a().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(a().filePath)),it=i(()=>l()&&/^[A-Za-z0-9._-]+$/.test(l())?Cr(a().filePath,e(Xe)):null),Nr=i(()=>!e(f)&&e(it)?e(it).split("/").slice(0,-1).join("/"):void 0),ar=i(()=>e(xt)||e(Pt)?e(it):null),mr=i(()=>e(f)&&e(Pt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[a().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);se(()=>{if(!q()||!e(f)||!e(gt)||!e(mr))return;const r=crypto.randomUUID();return R.dispatch(Ur(Re,r,l(),e(gt),{gitRootId:e(f),mimeType:e(mr)})),()=>R.dispatch(Vr(Re,r))});let mt=j(!1);const Ct=i(()=>!!e(it)&&!e(t)&&(!e(Pt)||e(Ge)===e(it))),_r=i(()=>e(Ge)&&l()?`workspace-file://${l()}/${e(Ge).split("/").map(encodeURIComponent).join("/")}`:null),or=i(()=>a().filePath?ga(a().filePath):"plaintext"),hr=i(()=>e(or)==="markdown"),_t=i(()=>/\.html?$/i.test(a().filePath??""));let Ft=j(void 0);const zt=i(()=>e(Ft)?.source===e(ze)),wr=i(()=>e(hr)||e(_t)&&!(e(zt)&&e(Ft)?.document===null)),We=i(()=>e(wr)&&e(Fe));se(()=>{if(!q()||!e(_t)||!e(We)||e(L)||e(u))return;const r=e(ze);if(!(r===null||e(zt)))return fo(r,n=>{c(Ft,{source:r,document:n}),n===null&&c(Fe,!1)})}),se(()=>{e(_t)&&!e(We)&&a().filePath&&c(gr,a().filePath,!0)}),se(()=>{if(!e(_t)||!e(We)||!q()||!v())return;function r(n){const b=n.detail?.line;b&&(c(kt,{line:b},!0),c(Fe,!1))}return window.addEventListener("workspace:go-to-line",r),()=>window.removeEventListener("workspace:go-to-line",r)}),se(()=>{if(!q()||e(xt)||e(f))return;const r=e(ar),n=a().filePath,b=l(),S=a().id;if(c(Ge,null),!r||!n||!b)return;let le=!1;const ke=()=>!le&&l()===b&&a().id===S&&a().filePath===n;return(async()=>{let Z=!1;try{Z=(await Ua("file.stat",{workspaceId:b,path:r}))?.isFile===!0}catch{}if(!ke())return;if(Z){c(Ge,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){c(Ge,r,!0);return}const{candidates:He,truncated:Je}=await Ya(b,r);if(ke()){if(!Je&&He.length===1){R.dispatch(yr(b,n,He[0],S));return}c(Ge,r,!0)}})(),()=>{le=!0}});function Br(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const Dt=i(()=>e(y)||!a().filePath?null:U().find(r=>Br(r,a().filePath))??null),Hr=i(()=>!!e(Dt));se(()=>{if(e(y))return;const r=l(),n=a().filePath,b=e(Xe);return()=>{if(!r||!n)return;const S=lr.select(R.state,r,n);if(S?.kind!=="editable-text")return;const le=nr(S.localContent),ke=Sr.select(R.state,r,n),Z=dr(n)?n:b?`${b}/${n}`:null;ke&&Z&&R.dispatch($r(r,n,Z,le))}}),se(()=>{const r=a().filePath,n=e(St),b=l();if(e(E),!q())return;const S=!e(f)&&!!r&&dr(r)&&!e(Xe);r&&b&&!e(It)&&!e(Pt)&&!e(xt)&&!S&&(e(f)&&e(gt)&&e(G)?R.dispatch(kr(b,e(G),n??r,{gitRoot:{id:e(f),relativePath:e(gt)}})):R.dispatch(kr(b,r,n??r)))});function Or(){return e(ze)??""}function qr(r){e(y)||e(L)||!a().filePath||!l()||!e(St)||R.dispatch(Pa(l(),a().filePath,nr(r)))}function Kr(){if(e(y)||e(L)||!a().filePath||!e(St)||e(ze)===null||e(o))return;const r=lr.select(R.state,l(),a().filePath);r?.kind==="editable-text"&&R.dispatch($r(l(),a().filePath,e(St),nr(r.localContent)))}function Xr(r){const n=a().filePath;!n||!l()||(R.dispatch(xa(l(),n)),R.dispatch(yr(l(),n,r,a().id)))}se(()=>{const r=a().filePath,n=e(Dt);if(!r||!n){c(rt,[],!0);return}if(!q())return;const b=l(),S=crypto.randomUUID();return R.dispatch(va(b,$t,S,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{R.dispatch(pa(b,$t,S))}}),se(()=>{const r=B(),n=r?.result?.kind==="diffs"?r.result.chunks:[],b=n.find(S=>S.file===a().filePath)??n[0];c(rt,b?Za(b.chunks.map(S=>({oldStart:S.oldStart,oldLines:S.oldLines,newStart:S.newStart,newLines:S.newLines,lines:S.lines.map(le=>(le.type===Ir.Addition?"+":le.type===Ir.Deletion?"-":" ")+le.content)}))):[],!0)});function Yr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),b=ke=>oo(r,ao(ke),n);if(b("editor.save")){r.preventDefault(),e(he)&&!e(o)&&Kr();return}const S=b("editor.undo")?"undo":b("editor.redo")?"redo":b("editor.toggle-task-list")?"toggle-task-list":b("editor.copy")?"copy":b("editor.select-all")?"select-all":null;if(!S||e(y)&&S!=="copy"&&S!=="select-all")return;S!=="toggle-task-list"&&e(Ye)?.runShortcut(S)&&r.preventDefault()}function Gr(r){if(!a().filePath||!e(Dt))return;const n=r?.metaKey||r?.ctrlKey||!1,S=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;R.dispatch(ba(l(),e(Dt),{filePath:a().filePath,changeId:e(Dt).id,openInAdjacentPanel:n,sourcePanelId:S}))}async function At(){const r=e(it);if(!(e(y)||!r||!l()||!e(Ct)||e(mt))){c(mt,!0);try{const n=await Ra(l(),r,e(Xe));!n?.success&&!n?.canceled&&sr.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{sr.error(d.layout_fileTab_downloadFailed_error())}finally{c(mt,!1)}}}function Jr(){const r=e(St);if(e(y)||!a().filePath||!l()||!r)return;const n=ha(lr.select(R.state,l(),a().filePath));if(!n){sr.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}R.dispatch(wa(l(),a().filePath,{absolutePath:r,tabId:a().id,snapshot:n}))}se(()=>{if(!_e||!q())return;const r={isDirty:!e(y)&&e(he),isSaving:!e(y)&&e(o)};ur(()=>{_e.registerActions({display:qe,actions:Ve}),_e.registerState(r)})});var Zr={get tab(){return a()},set tab(r){a(r),ce()},get workspaceId(){return l()},set workspaceId(r){l(r),ce()},get isActive(){return q()},set isActive(r){q(r),ce()},get isPanelFocused(){return v()},set isPanelFocused(r){v(r),ce()},$set:Yt,$on:(r,n)=>Gt(_,r,n)},br=Ue();ut("keydown",Lr,r=>q()&&Yr(r));var Qr=ve(br);{var ea=r=>{var n=Ue(),b=ve(n);Mr(b,()=>a().filePath,S=>{var le=Ue(),ke=ve(le);{var Z=h=>{var p=Ao(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0);k(p),I(te=>{m(X,te),m(je,a().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(h,p)},He=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(gt)},get gitRootId(){return e(f)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Je=h=>{var p=Ue(),M=ve(p);{var X=te=>{var Ie=Tr(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_errorLoading_label()]),s(te,Ie)},z=te=>{qt(te,{get filePath(){return a().filePath},get sourceUrl(){return Le().url},allowDownload:!1})},je=te=>{var Ie=Wo(),H=F(Ie),we=C(H,!0);k(Ie),I(Q=>m(we,Q),[()=>d.layout_fileTab_preparing_label()]),s(te,Ie)};Y(M,te=>{Le()?.error?te(X):Le()?.url?te(z,1):te(je,-1)})}s(h,p)},nt=h=>{var p=Ue(),M=ve(p);{var X=z=>{vr(z,{get workspaceId(){return l()},get filePath(){return e(ar)}})};Y(M,z=>{q()&&z(X)})}s(h,p)},Tt=h=>{var p=Tr(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.file_pdf_load_error()]),s(h,p)},Oe=h=>{{let p=i(()=>e(Ge)??a().filePath),M=i(()=>!e(y)&&e(Ct));qt(h,{get filePath(){return e(p)},get sourceUrl(){return e(_r)},onDownload:At,get allowDownload(){return e(M)},get downloading(){return e(mt)}})}},at=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)},ht=h=>{var p=Bo(),M=F(p);Ut(M,20,()=>[...Array(20).keys()],X=>X,(X,z)=>{var je=No(),te=F(je);Fr(te,{class:"h-3 w-8 shrink-0"});var Ie=g(te,2);Fr(Ie,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),k(je),s(X,je)}),k(M),k(p),s(h,p)},Et=h=>{{let p=i(()=>so(e($)));no(h,{get view(){return e(p)}})}},Lt=h=>{var p=Ko(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=Q=>{var lt=Ho(),Ze=C(lt,!0);I(()=>m(Ze,e(u))),s(Q,lt)};Y(te,Q=>{e(w)==="generic"&&Q(Ie)})}var H=g(te,2);{var we=Q=>{var lt=qo(),Ze=ve(lt),Rt=C(Ze,!0),Wt=g(Ze,2);Ut(Wt,20,()=>e(K),wt=>wt,(wt,De)=>{var Se=Oo(),Ne=F(Se);Te(Ne,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Xr(De),children:(st,xr)=>{ot();var Pr=ct();I(()=>m(Pr,De)),s(st,Pr)},$$slots:{default:!0}}),k(Se),s(wt,Se)}),k(Wt),I(wt=>m(Rt,wt),[()=>d.layout_fileTab_didYouMean_label()]),s(Q,lt)};Y(H,Q=>{e(K).length>0&&Q(we)})}k(p),I(Q=>{m(X,Q),m(je,a().filePath)},[()=>Uo(e(w))]),s(h,p)},Mt=h=>{var p=Xo(),M=F(p),X=C(M,!0),z=g(M,2),je=C(z,!0),te=g(z,2);{var Ie=H=>{{let we=i(()=>!e(Ct)||e(mt));Te(H,{variant:"secondary",size:"sm",onclick:At,get disabled(){return e(we)},children:(Q,lt)=>{ot();var Ze=ct();I(Rt=>m(Ze,Rt),[()=>d.layout_fileTab_downloadFile_label()]),s(Q,Ze)},$$slots:{default:!0}})}};Y(te,H=>{!e(y)&&e(it)&&H(Ie)})}k(p),I(H=>{m(X,H),m(je,a().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(h,p)},ir=h=>{const p=i(()=>a().filePath?.toLowerCase().endsWith(".svg"));var M=Ue(),X=ve(M);{var z=H=>{{let we=i(()=>a().filePath||""),Q=i(()=>!e(y)&&e(Ct));qt(H,{get filePath(){return e(we)},get fileContent(){return e(ze)},get language(){return e(or)},get isBinary(){return e(L)},onDownload:At,get allowDownload(){return e(Q)},get downloading(){return e(mt)}})}},je=H=>{var we=Yo(),Q=F(we);Qa(Q,{get content(){return e(ze)},get workspaceId(){return l()},get relativeMediaBase(){return e(Nr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),k(we),s(H,we)},te=H=>{var we=Qo(),Q=F(we);{var lt=De=>{var Se=Go();let Ne;var st=F(Se);Ce(st,()=>!e(We)),k(Se),I(()=>{Ne=Kt(Se,1,"size-full",null,Ne,{invisible:e(We)}),Se.inert=e(We)}),s(De,Se)};Y(Q,De=>{(!e(We)||e(gr)===a().filePath)&&De(lt)})}var Ze=g(Q,2);{var Rt=De=>{const Se=i(()=>e(We)&&e(zt));var Ne=Jo();let st;I(xr=>{Qe(Ne,"title",xr),Qe(Ne,"srcdoc",e(Ft).document),st=Kt(Ne,1,"absolute inset-0 block size-full border-0 bg-background",null,st,{invisible:!e(Se)}),Ne.inert=!e(Se)},[()=>d.ui_viewSettings_htmlPreview_label()]),s(De,Ne)};Y(Ze,De=>{e(Ft)?.document!=null&&De(Rt)})}var Wt=g(Ze,2);{var wt=De=>{var Se=Zo(),Ne=C(Se,!0);I(st=>m(Ne,st),[()=>d.layout_fileTab_preparing_label()]),s(De,Se)};Y(Wt,De=>{e(We)&&!e(zt)&&De(wt)})}k(we),s(H,we)},Ie=H=>{Ce(H,()=>!0)};Y(X,H=>{e(p)?H(z):e(hr)&&e(We)?H(je,1):e(_t)?H(te,2):H(Ie,-1)})}s(h,M)},ra=h=>{var p=Er(),M=F(p),X=C(M,!0);k(p),I(z=>m(X,z),[()=>d.layout_fileTab_preparing_label()]),s(h,p)};Y(ke,h=>{e(It)?h(Z):e(f)&&e(xt)&&e(gt)?h(He,1):e(f)&&e(Pt)?h(Je,2):e(xt)&&e(ar)?h(nt,3):e(xt)?h(Tt,4):e(_r)?h(Oe,5):e(Pt)?h(at,6):e(t)&&(!e(_t)||e(ze)===null)?h(ht,7):e($)?h(Et,8):e(u)?h(Lt,9):e(L)?h(Mt,10):e(ze)!==null?h(ir,11):h(ra,-1)})}s(S,le)}),s(r,n)};Y(Qr,r=>{a().filePath&&r(ea)})}s(A,br);var ta=Zt(Zr);return $e(),ta}export{ei as default};
@@ -1 +1 @@
1
- import{aB as v,b as y}from"./Cpw-AI-k.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
1
+ import{aB as v,b as y}from"./C89-HR3N.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};