@intent-hq/web 2.383.3 → 2.383.5

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/{BZskJqHK.js → -Q8WHsT1.js} +2 -2
  3. package/web/app/immutable/chunks/{uA-KbK5l.js → -afdnSwu.js} +1 -1
  4. package/web/app/immutable/chunks/{DPPrfCEc.js → -tAyw6ob.js} +1 -1
  5. package/web/app/immutable/chunks/{BOYBHPRf.js → 3o8kzB3n.js} +1 -1
  6. package/web/app/immutable/chunks/{Dkwg3iDV.js → 3vWQiXY2.js} +3 -3
  7. package/web/app/immutable/chunks/{SDWlqEse.js → 5c25JTI1.js} +1 -1
  8. package/web/app/immutable/chunks/{DCq92KiG.js → 7dpPwFPi.js} +1 -1
  9. package/web/app/immutable/chunks/{sjYi8iFk.js → B-MmNWOm.js} +1 -1
  10. package/web/app/immutable/chunks/{ChUo5Z7l.js → B265Nxi3.js} +1 -1
  11. package/web/app/immutable/chunks/{CKG0fjh3.js → B2DRKAdQ.js} +1 -1
  12. package/web/app/immutable/chunks/{CKaMWgJQ.js → B5MrjS7j.js} +1 -1
  13. package/web/app/immutable/chunks/{DUdBCfQ2.js → B5YNqIIm.js} +1 -1
  14. package/web/app/immutable/chunks/{BwOKiDn9.js → B8V-jGiS.js} +1 -1
  15. package/web/app/immutable/chunks/{DLbnXb7P.js → B9YYIjUd.js} +3 -3
  16. package/web/app/immutable/chunks/{DpCuuI0h.js → BHt4i6xN.js} +1 -1
  17. package/web/app/immutable/chunks/{CXR8jfrb.js → BIQB3Kx5.js} +1 -1
  18. package/web/app/immutable/chunks/{DKYFDagY.js → BKPEtXUT.js} +1 -1
  19. package/web/app/immutable/chunks/{BDgY7Zd8.js → BNVrbjR5.js} +2 -2
  20. package/web/app/immutable/chunks/{DGXU2Eur.js → BRJQPxpd.js} +1 -1
  21. package/web/app/immutable/chunks/{CrJMkG_1.js → BTv8uh2C.js} +6 -6
  22. package/web/app/immutable/chunks/{m6g2qs4v.js → BWbkCnfm.js} +1 -1
  23. package/web/app/immutable/chunks/{B2EqH2B9.js → BXCVSrGo.js} +1 -1
  24. package/web/app/immutable/chunks/{D83rapov.js → BYChQVmd.js} +1 -1
  25. package/web/app/immutable/chunks/{DVnAuhkJ.js → BYdTf9Vr.js} +1 -1
  26. package/web/app/immutable/chunks/{DD98YGoG.js → BZC6DuKQ.js} +1 -1
  27. package/web/app/immutable/chunks/{Bok48R2D.js → B_JCVgq0.js} +1 -1
  28. package/web/app/immutable/chunks/{D59f5vu3.js → B_kMSQKD.js} +1 -1
  29. package/web/app/immutable/chunks/{Byun8_as.js → BaW_cM4B.js} +1 -1
  30. package/web/app/immutable/chunks/{DhN_Bb70.js → BacafptN.js} +4 -4
  31. package/web/app/immutable/chunks/{mlIdQnJX.js → Bg_lZIRf.js} +2 -2
  32. package/web/app/immutable/chunks/{eBfEHUcb.js → BhSvmxU-.js} +4 -4
  33. package/web/app/immutable/chunks/{DQ0P5vIc.js → BiQUDh4s.js} +1 -1
  34. package/web/app/immutable/chunks/{p-4Usjf1.js → Bj84UPYb.js} +1 -1
  35. package/web/app/immutable/chunks/{CW2OkXuF.js → BjfHx7zJ.js} +1 -1
  36. package/web/app/immutable/chunks/{v1V9O0KC.js → BmkXo3Yq.js} +1 -1
  37. package/web/app/immutable/chunks/{CpxEaO9r.js → BpcUO3Xs.js} +1 -1
  38. package/web/app/immutable/chunks/{CzXkTVR8.js → BqRWw-wJ.js} +1 -1
  39. package/web/app/immutable/chunks/{DWG0la6r.js → Bv1ckDXI.js} +1 -1
  40. package/web/app/immutable/chunks/{Dj5oY4MN.js → BwfxdDPw.js} +1 -1
  41. package/web/app/immutable/chunks/{C_1Oardw.js → BxoyDHGw.js} +1 -1
  42. package/web/app/immutable/chunks/{BDUjjuc4.js → Bygq9d8w.js} +1 -1
  43. package/web/app/immutable/chunks/{BthP56U0.js → Bymbu99U.js} +1 -1
  44. package/web/app/immutable/chunks/{Jmsfhy4p.js → C0LshS-P.js} +1 -1
  45. package/web/app/immutable/chunks/{BJA4-3TS.js → C0cGUVCr.js} +1 -1
  46. package/web/app/immutable/chunks/{WAmymGEm.js → C0o77pad.js} +1 -1
  47. package/web/app/immutable/chunks/{CMiAv123.js → C3upI-xJ.js} +1 -1
  48. package/web/app/immutable/chunks/{DCQ9cJhS.js → C4LrSRW3.js} +1 -1
  49. package/web/app/immutable/chunks/{DcTV3q3a.js → C7Zl7z5c.js} +1 -1
  50. package/web/app/immutable/chunks/{CGslv4Qq.js → C9dAybnM.js} +2 -2
  51. package/web/app/immutable/chunks/{CfdQaRg7.js → CApA6QD2.js} +4 -4
  52. package/web/app/immutable/chunks/{B1Gvj9xq.js → CBB3lnfZ.js} +3 -3
  53. package/web/app/immutable/chunks/{BvWOwOTx.js → CFUZ-wx4.js} +3 -3
  54. package/web/app/immutable/chunks/{AqAgOqAP.js → CG-tM1HG.js} +2 -2
  55. package/web/app/immutable/chunks/{CLeH6OyR.js → CHKnj_kH.js} +1 -1
  56. package/web/app/immutable/chunks/{BzVtDZxE.js → CJtViYfh.js} +1 -1
  57. package/web/app/immutable/chunks/{D6J72aTz.js → CLkfOjAo.js} +3 -3
  58. package/web/app/immutable/chunks/{JhwNDffI.js → CMEtJ5i1.js} +1 -1
  59. package/web/app/immutable/chunks/{DEIwQ6hO.js → CP9Lq5G_.js} +1 -1
  60. package/web/app/immutable/chunks/{CgLuwxkV.js → CWdKrGNN.js} +1 -1
  61. package/web/app/immutable/chunks/{a6nBCKTJ.js → CfiKUG8A.js} +1 -1
  62. package/web/app/immutable/chunks/{CiieGSUV.js → Cg871q2J.js} +1 -1
  63. package/web/app/immutable/chunks/{ufC4F9mx.js → Cgxwerkr.js} +2 -2
  64. package/web/app/immutable/chunks/{BTTEE7GF.js → ClJhkXR5.js} +1 -1
  65. package/web/app/immutable/chunks/{QXKw7ybW.js → ClMg21pU.js} +1 -1
  66. package/web/app/immutable/chunks/{BT9OtIDj.js → CmVBRNuA.js} +1 -1
  67. package/web/app/immutable/chunks/{BZ1qE3sd.js → CnZI1GOS.js} +1 -1
  68. package/web/app/immutable/chunks/{C19Fl1wo.js → Cngzlos4.js} +1 -1
  69. package/web/app/immutable/chunks/{hrbt6TUA.js → CpJb1fZG.js} +1 -1
  70. package/web/app/immutable/chunks/{BammBnda.js → Cq88mLGj.js} +3 -3
  71. package/web/app/immutable/chunks/{-2V-BAm8.js → CqnrQ6ti.js} +3 -3
  72. package/web/app/immutable/chunks/{Bp3ZrlmO.js → CsD5HG3r.js} +1 -1
  73. package/web/app/immutable/chunks/{CslzdKY2.js → CwTtJpch.js} +1 -1
  74. package/web/app/immutable/chunks/{gRz70TuX.js → CwtLM6uA.js} +1 -1
  75. package/web/app/immutable/chunks/{C89qw-SN.js → Cx37GTsM.js} +1 -1
  76. package/web/app/immutable/chunks/{LFBaWgJg.js → D6G8WbHL.js} +1 -1
  77. package/web/app/immutable/chunks/{CUHgqEKH.js → D8UBdXB2.js} +1 -1
  78. package/web/app/immutable/chunks/{yYvyTKgb.js → D96pHovR.js} +1 -1
  79. package/web/app/immutable/chunks/{C_-1gUwp.js → DAJnPbZk.js} +3 -3
  80. package/web/app/immutable/chunks/{CnljYLZs.js → DATzIj-C.js} +1 -1
  81. package/web/app/immutable/chunks/{DUxx6wT8.js → DDfr81XI.js} +1 -1
  82. package/web/app/immutable/chunks/{D4QkxipA.js → DFi1P2MD.js} +1 -1
  83. package/web/app/immutable/chunks/{BFU4GSWL.js → DH5O4f99.js} +1 -1
  84. package/web/app/immutable/chunks/{BGxmHLUr.js → DMV7vEM7.js} +1 -1
  85. package/web/app/immutable/chunks/{DlrDVrrH.js → DPCOdXX2.js} +1 -1
  86. package/web/app/immutable/chunks/{CEAKAkFK.js → DT3Kx0Qe.js} +1 -1
  87. package/web/app/immutable/chunks/{Df5fc__K.js → DW25C9MI.js} +2 -2
  88. package/web/app/immutable/chunks/{C-n5-Nyi.js → DY-t7Was.js} +1 -1
  89. package/web/app/immutable/chunks/{CImg9Ht4.js → DZYWuj4L.js} +1 -1
  90. package/web/app/immutable/chunks/{zw9aQKYl.js → DaFpSJap.js} +1 -1
  91. package/web/app/immutable/chunks/{CDXv1PW9.js → Dac_vP74.js} +1 -1
  92. package/web/app/immutable/chunks/{BkfSBkLs.js → DbZ5HUqx.js} +2 -2
  93. package/web/app/immutable/chunks/{D1QHqX16.js → DibfmKHg.js} +1 -1
  94. package/web/app/immutable/chunks/{Dcuzm8gD.js → Dirmxn0x.js} +1 -1
  95. package/web/app/immutable/chunks/{pf1qexdH.js → DizKilK3.js} +1 -1
  96. package/web/app/immutable/chunks/{C7cQ3lDB.js → Dj14JHUo.js} +1 -1
  97. package/web/app/immutable/chunks/{CKOijLzA.js → Do2giiGP.js} +1 -1
  98. package/web/app/immutable/chunks/{bB4pIooo.js → Dp-6l6dc.js} +1 -1
  99. package/web/app/immutable/chunks/{0l7ZqDIV.js → DqWLkzGY.js} +1 -1
  100. package/web/app/immutable/chunks/{CpdAeaX0.js → Dql2ogGT.js} +1 -1
  101. package/web/app/immutable/chunks/{wh8BTzW1.js → Dr8j8hDa.js} +2 -2
  102. package/web/app/immutable/chunks/{BdgSVihu.js → Du0DJF2z.js} +1 -1
  103. package/web/app/immutable/chunks/{Ax0sJJJl.js → DzB2TE-q.js} +13 -13
  104. package/web/app/immutable/chunks/{-NFtmIGG.js → DzbS0qCL.js} +1 -1
  105. package/web/app/immutable/chunks/{BhHscwNa.js → GuiAAF9e.js} +1 -1
  106. package/web/app/immutable/chunks/{Dipy9ZkR.js → IK5u1LkS.js} +1 -1
  107. package/web/app/immutable/chunks/{B4rcpoVl.js → KEaRLIGy.js} +1 -1
  108. package/web/app/immutable/chunks/{BB7BFhCP.js → MEqItsKn.js} +1 -1
  109. package/web/app/immutable/chunks/{CiNhMqq1.js → RWObpdxy.js} +1 -1
  110. package/web/app/immutable/chunks/{DR9rgOUR.js → SqlvGXMi.js} +1 -1
  111. package/web/app/immutable/chunks/{BktdbaP2.js → UMwTu6TE.js} +1 -1
  112. package/web/app/immutable/chunks/{B7AnydIV.js → W0L8GDXP.js} +1 -1
  113. package/web/app/immutable/chunks/{BMiKKOoz.js → WGwfzXjP.js} +1 -1
  114. package/web/app/immutable/chunks/{DLZnxjXG.js → WiA7_4AK.js} +1 -1
  115. package/web/app/immutable/chunks/{CWmACcmS.js → Yyy6gahW.js} +1 -1
  116. package/web/app/immutable/chunks/{38Vg2YF4.js → Z0_LIT6x.js} +2 -2
  117. package/web/app/immutable/chunks/{BD1NjrB7.js → ZxEOlEA2.js} +1 -1
  118. package/web/app/immutable/chunks/{BCo0L43p.js → cfdblcWY.js} +1 -1
  119. package/web/app/immutable/chunks/{BQ9VbGlu.js → iHxbYHJ6.js} +1 -1
  120. package/web/app/immutable/chunks/{yC4xveeV.js → iN763416.js} +1 -1
  121. package/web/app/immutable/chunks/{BwyO9iAx.js → j65te9ZT.js} +1 -1
  122. package/web/app/immutable/chunks/{CtIGR2R7.js → lzAd2Up3.js} +1 -1
  123. package/web/app/immutable/chunks/{BB5q5DsO.js → nTGBknlr.js} +1 -1
  124. package/web/app/immutable/chunks/{Cuvcpuwl.js → p7SBTgaC.js} +1 -1
  125. package/web/app/immutable/chunks/{D3a_DhRG.js → pUxZXv-3.js} +1 -1
  126. package/web/app/immutable/chunks/{D23uZeQI.js → u2aKD69u.js} +1 -1
  127. package/web/app/immutable/chunks/{B4mnoVZK.js → u8znU8zy.js} +1 -1
  128. package/web/app/immutable/chunks/{DqRH8mOo.js → wqIK2bns.js} +1 -1
  129. package/web/app/immutable/entry/{app.CeAiZV-v.js → app.Cqjdbldk.js} +2 -2
  130. package/web/app/immutable/entry/start.D0BpS8PF.js +1 -0
  131. package/web/app/immutable/nodes/{0.D2I9SFzE.js → 0.CIMKJ2v2.js} +1 -1
  132. package/web/app/immutable/nodes/{1.CHeML-3-.js → 1.C-zZe4mL.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CPMi8QX9.js → 10.CRicXMMy.js} +4 -4
  134. package/web/app/immutable/nodes/{11.DOD-sh-z.js → 11.CFkPUf9W.js} +1 -1
  135. package/web/app/immutable/nodes/{15.BXDyjjHm.js → 15.BDAlg-ra.js} +1 -1
  136. package/web/app/immutable/nodes/{19.BEUhM4Xw.js → 19.DJgRbiNE.js} +2 -2
  137. package/web/app/immutable/nodes/{2.CeC42N_5.js → 2.Dl71tIky.js} +4 -4
  138. package/web/app/immutable/nodes/{3.-_yjscmj.js → 3.DNld1BNY.js} +1 -1
  139. package/web/app/immutable/nodes/{4.CdQdgUhv.js → 4.Dqn6Xii_.js} +1 -1
  140. package/web/app/immutable/nodes/{5.jUP9W-D7.js → 5.B0BP_LYC.js} +1 -1
  141. package/web/app/immutable/nodes/{6.B0WnMraI.js → 6.NwMlYZya.js} +1 -1
  142. package/web/app/immutable/nodes/{7.DAEOmrZS.js → 7.CP-QZto7.js} +1 -1
  143. package/web/app/immutable/nodes/{8.D1Q1AivC.js → 8.BsQgGFet.js} +1 -1
  144. package/web/app/immutable/nodes/{9.C5Qv23W5.js → 9.DY6xrFrM.js} +4 -4
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.DrVPJx5Z.js +0 -1
@@ -1 +1 @@
1
- import{t as Ot,bo as R,bm as u,bw as Ft,b as Rt}from"./C0QTy0Sy.js";import{bs as Gt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Mt,aA as G,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./3SdAC2_C.js";import{i as W}from"./bhKPSdq4.js";import{I as or,g as Xe}from"./B6S6VNu7.js";import{c as Ee}from"./CUkDMZwP.js";import{n as Oe,j as Ze,h as $t}from"./DLwWVKiF.js";import{f as Fe,c as gt,s as nr}from"./7UPrdiE9.js";import{b as xt}from"./Dn334wJv.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./U9jJmfYa.js";import{f as ye}from"./FzlZUztb.js";import"./DCRuihKm.js";import"./QeBH-DWE.js";import{M as nt}from"./D6J72aTz.js";import{M as dr}from"./CDjpuJh0.js";import{w as _e}from"./BhHscwNa.js";import{h as Ct,i as Et,g as Tt,P as At}from"./BmTMWrby.js";import{C as ht}from"./DTuql3Rj.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./wl2qP2wF.js";import"./CrD0jtXE.js";import{f as vr}from"./C6mS8uZB.js";import{Jv as _r}from"./tr-2J8Mf.js";import{dS as mr}from"./BaujsV9k.js";import{S as et,j as fr,a as jt}from"./DhN_Bb70.js";import{R as qe,c as it,m as gr,bE as tt}from"./Dkwg3iDV.js";import"./BCo0L43p.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),wr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),yr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Gt(P,!0);const at=pr("SetupScriptAgent");let Ae=R(P,"repoPath",7),Re=R(P,"onScriptGenerated",7),Ge=R(P,"onClose",7),Me=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){Re()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),G()},get onScriptGenerated(){return Re()},set onScriptGenerated(s){Re(s),G()},get onClose(){return Ge()},set onClose(s){Ge(s),G()},$set:Ft,$on:(s,v)=>Rt(P,s,v)},ce=yr(),xe=c(ce),be=c(xe),De=c(be);ur(De,{variant:"standard",get agentId(){return e(Me)}});var Le=n(De,2),je=S(Le,!0),he=n(Le,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var Y=n(be,2),ke=c(Y);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());ye(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Ge()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(Y),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var M=br(),Q=S(M,!0);g(()=>m(Q,e(ae))),o(B,M)},se=B=>{var M=hr(),Q=c(M);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(M),g(we=>m(ze,we),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,M)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Je=n($e,2);{var pe=s=>{var v=wr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),M=S(B,!0);l(q);var Q=n(q,2);ye(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Ye=Be();g(ct=>m(Ye,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Ye)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),we=n(Se,2),lt=c(we);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(we),l(v),g(()=>{m(M,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Je,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Mt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Rr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Gr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Mr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Dr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Lr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Gt(P,!0);const at=(t,a=sr)=>{{const y=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Dt():we(a().id),leading:y,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Ye),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:w=>{Te(w,{get icon(){return cr},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(w,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),w=>w.id,(w,d)=>{at(w,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Oe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var D=n(x,2),ue=c(D);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:w=>{Te(w,{get icon(){return bt},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(w,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let w=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(w)},onclick:()=>{r(ke,!0),r(Y,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(D),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),D=S(k,!0);l(i);var ue=n(i,2);ye(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(Y,!1)},children:(w,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(w,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=w=>{St(w,{get repoPath(){return O()},onScriptGenerated:Lt,onClose:()=>r(Y,!1)})},F=w=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);ye(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var L=Be();g(ee=>m(L,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,L)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),L=U(oe);Ee(L,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var J=Tr();Xe(J,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var yt=It(),kt=U(yt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Yt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Jt=n(kt,2);Ee(Jt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Yt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,yt)},$$slots:{default:!0}})}),o(re,We)}),l(J),o(ne,J)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(w,d)};W(ve,w=>{e(Y)&&O()?w(I):w(F,-1)})}g(w=>{Fe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,w),m(D,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(y,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Je,h),()=>e(Je)),g(()=>Fe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},Re=t=>{var a=Or(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(Y,!1)}),l(p),Oe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());ye(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(Y,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(Y)&&O()?d(i):d(f,-1)})}l(y);var x=n(y,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(qe),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var D=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(B),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(e(M).name,e(M).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(D,d=>{e(M)&&d(ue)})}var ve=n(D,2),I=c(ve),F=S(I,!0),w=n(I,2);Xe(w,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);ye(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),L=S(oe,!0),ee=n(oe,2);{var te=J=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(J,re)};W(ee,J=>{e(p).projectType===ie()&&J(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(L,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Ge=t=>{var a=Gr(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(D,ue)=>{ue(D,{delayDuration:100,children:(ve,I)=>{var F=Ue(),w=U(F);Ee(w,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(L,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(L,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(L,ee)=>{var te=Rr(),ne=U(te),Ce=S(ne,!0),J=n(ne,2),re=c(J),Ne=n(re),We=S(Ne,!0);l(J),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(L,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(y);var $=n(y,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Me=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Mr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),Oe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Oe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Dr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),o(h,$)};W(y,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Fe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=R(P,"repoPath",7,""),ae=R(P,"repositoryKey",7),me=R(P,"githubUrl",7,null),ie=R(P,"projectType",7,void 0),le=R(P,"repoConfigScript",7,null),C=R(P,"value",15,""),fe=R(P,"expanded",15,!1),ge=R(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=R(P,"scriptNameSource",15,"named"),xe=R(P,"isCustomScript",15,!1),be=R(P,"compact",7,!1),De=R(P,"triggerClass",7,""),Le=R(P,"contentOnly",7,!1),je=R(P,"contentClass",7,""),he=R(P,"presentation",7,"editor"),de=R(P,"onchange",7),Y=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Je=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",M=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(M)&&t.set(B,{content:e(M).content,label:e(M).name,source:e(M).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function we(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Je)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Ye=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(M)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const y=`template-${a.id}`;(y===Pe||y===e(s))&&t.push({id:y,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Ye).some(a=>a.id===`template-${t.id}`)));function Dt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(Y,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Lt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const y=!!le(),j=e(M);if(mt(()=>{if(r(v,!1),r(se,!0),y)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),y&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),G()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),G()},get githubUrl(){return me()},set githubUrl(t=null){me(t),G()},get projectType(){return ie()},set projectType(t=void 0){ie(t),G()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),G()},get value(){return C()},set value(t=""){C(t),G()},get expanded(){return fe()},set expanded(t=!1){fe(t),G()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),G()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),G()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),G()},get compact(){return be()},set compact(t=!1){be(t),G()},get triggerClass(){return De()},set triggerClass(t=""){De(t),G()},get contentOnly(){return Le()},set contentOnly(t=!1){Le(t),G()},get contentClass(){return je()},set contentClass(t=""){je(t),G()},get presentation(){return he()},set presentation(t="editor"){he(t),G()},get onchange(){return de()},set onchange(t){de(t),G()},$set:Ft,$on:(t,a)=>Rt(P,t,a)},wt=Ue(),Wt=U(wt);{var qt=t=>{var a=Ue(),y=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),D=c(k);Ae(D),l(k),g(()=>Fe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Oe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(y,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),y=U(a),j=c(y);ye(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${De()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Lr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var D=n(k,2),ue=S(D,!0),ve=n(D,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(y);var $=n(y,2);{var _=i=>{var f=Wr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Fe(y,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Le()?t(qt):t(Kt,-1)})}return o(He,wt),Mt(zt)}rr(["keydown"]);export{Kr as default};
1
+ import{t as Ot,bo as R,bm as u,bw as Ft,b as Rt}from"./C0QTy0Sy.js";import{bs as Gt,bV as K,br as rt,bk as er,bj as tr,bH as r,a5 as c,aD as e,bS as n,bl as S,bA as l,b_ as g,bO as m,W as o,bn as Mt,aA as G,c9 as z,be as Ve,b$ as Be,aB as b,c5 as mt,ca as ft,a7 as Ue,ay as U,ai as rr,aj as ar,bf as sr}from"./3SdAC2_C.js";import{i as W}from"./bhKPSdq4.js";import{I as or,g as Xe}from"./B6S6VNu7.js";import{c as Ee}from"./CUkDMZwP.js";import{n as Oe,j as Ze,h as $t}from"./DLwWVKiF.js";import{f as Fe,c as gt,s as nr}from"./7UPrdiE9.js";import{b as xt}from"./Dn334wJv.js";import{F as Te,cR as ir,au as lr,cK as bt,c$ as Pt,cd as cr}from"./U9jJmfYa.js";import{f as ye}from"./FzlZUztb.js";import"./DCRuihKm.js";import"./QeBH-DWE.js";import{M as nt}from"./CLkfOjAo.js";import{M as dr}from"./CDjpuJh0.js";import{w as _e}from"./GuiAAF9e.js";import{h as Ct,i as Et,g as Tt,P as At}from"./BmTMWrby.js";import{C as ht}from"./DTuql3Rj.js";import{c as pr}from"./ChTqQfQN.js";import{A as ur}from"./wl2qP2wF.js";import"./CrD0jtXE.js";import{f as vr}from"./C6mS8uZB.js";import{Jv as _r}from"./tr-2J8Mf.js";import{dS as mr}from"./BaujsV9k.js";import{S as et,j as fr,a as jt}from"./BacafptN.js";import{R as qe,c as it,m as gr,bE as tt}from"./3vWQiXY2.js";import"./cfdblcWY.js";var xr=b('<div class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></div>'),br=b('<div class="text-sm text-danger bg-danger-background/10 rounded-md p-3"> </div>'),hr=b('<div class="flex items-center gap-2 text-subtle"><!> <span class="text-sm"> </span></div>'),Sr=b('<div class="p-4 max-h-60 overflow-y-auto overscroll-contain"><!></div>'),wr=b('<div class="p-3 bg-muted/30"><div class="flex items-center justify-between mb-2"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span></div> <!></div> <p class="text-xs text-subtle mb-2"> </p> <div class="h-32 rounded border border-border overflow-hidden"><!></div></div>'),yr=b('<div class="flex flex-col bg-background border border-border rounded-lg overflow-hidden"><div class="flex items-center justify-between px-3 py-2 border-b border-border bg-muted/30"><div class="flex items-center gap-2"><!> <span class="text-sm font-medium"> </span> <!></div> <div class="flex items-center gap-1"><!></div></div> <!> <!></div>');function St(He,P){if(new.target)return Ot({component:St,...He});Gt(P,!0);const at=pr("SetupScriptAgent");let Ae=R(P,"repoPath",7),Re=R(P,"onScriptGenerated",7),Ge=R(P,"onClose",7),Me=K(rt(crypto.randomUUID())),O=K(!1),ae=K(null),me=!1,ie=K(null);er(()=>{me=!0,C()}),tr(()=>{me=!1});async function le(){try{const v=mr.select(_r.state).find(E=>E.repositoryPath===Ae()||E.path===Ae()||E.worktreePath===Ae());return v?String(v.id):null}catch{return null}}async function C(){r(O,!0),r(ae,null),r(ie,null);try{const s=await le();if(!me)return;if(!s){r(ae,u.workspace_setupScriptAgent_noWorkspace_error(),!0),r(O,!1);return}const v=await vr.setupScripts.generate(s);if(!me)return;if(!v||!v.script){r(ae,u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1);return}r(ie,{name:v.projectType?u.workspace_setupScriptAgent_projectTypeSetup_label({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedSetup_label(),description:v.projectType?u.workspace_setupScriptAgent_generatedForProject_description({projectType:v.projectType}):u.workspace_setupScriptAgent_generatedFromAnalysis_description(),content:v.script},!0),r(O,!1)}catch(s){if(at.error("Failed to generate setup script",s),!me)return;r(ae,s instanceof Error?s.message:u.workspace_setupScriptAgent_generateFailed_error(),!0),r(O,!1)}}function fe(s){Re()?.(s)}var ge={get repoPath(){return Ae()},set repoPath(s){Ae(s),G()},get onScriptGenerated(){return Re()},set onScriptGenerated(s){Re(s),G()},get onClose(){return Ge()},set onClose(s){Ge(s),G()},$set:Ft,$on:(s,v)=>Rt(P,s,v)},ce=yr(),xe=c(ce),be=c(xe),De=c(be);ur(De,{variant:"standard",get agentId(){return e(Me)}});var Le=n(De,2),je=S(Le,!0),he=n(Le,2);{var de=s=>{var v=xr();o(s,v)};W(he,s=>{e(O)&&s(de)})}l(be);var Y=n(be,2),ke=c(Y);{let s=z(()=>u.workspace_setupScriptAgent_close_ariaLabel());ye(ke,{variant:"ghost-light",size:"icon-sm",iconOnly:!0,get"aria-label"(){return e(s)},get onclick(){return Ge()},children:(v,E)=>{Te(v,{get icon(){return ir}})},$$slots:{default:!0}})}l(Y),l(xe);var $e=n(xe,2);{var Ie=s=>{var v=Sr(),E=c(v);{var q=B=>{var M=br(),Q=S(M,!0);g(()=>m(Q,e(ae))),o(B,M)},se=B=>{var M=hr(),Q=c(M);or(Q,{size:16,class:"text-primary"});var Se=n(Q,2),ze=S(Se,!0);l(M),g(we=>m(ze,we),[()=>u.workspace_setupScriptAgent_analyzing_label()]),o(B,M)};W(E,B=>{e(ae)?B(q):B(se,-1)})}l(v),o(s,v)};W($e,s=>{(e(ae)||e(O))&&s(Ie)})}var Je=n($e,2);{var pe=s=>{var v=wr(),E=c(v),q=c(E),se=c(q);Te(se,{get icon(){return lr},class:"text-green-500"});var B=n(se,2),M=S(B,!0);l(q);var Q=n(q,2);ye(Q,{variant:"primary",size:"sm",onclick:()=>fe(e(ie)),class:"h-7",children:(Pe,st)=>{Ve();var Ye=Be();g(ct=>m(Ye,ct),[()=>u.workspace_setupScriptAgent_createScript_label()]),o(Pe,Ye)},$$slots:{default:!0}}),l(E);var Se=n(E,2),ze=S(Se,!0),we=n(Se,2),lt=c(we);ht(lt,{get value(){return e(ie).content},language:"shell",readOnly:!0,lineNumbers:!1}),l(we),l(v),g(()=>{m(M,e(ie).name),m(ze,e(ie).description)}),o(s,v)};W(Je,s=>{e(ie)&&!e(O)&&s(pe)})}return l(ce),g(s=>m(je,s),[()=>u.workspace_setupScriptAgent_title()]),o(He,ce),Mt(ge)}var kr=b('<span class="block truncate"> </span>'),$r=b("<div></div>"),Pr=b('<div role="group"></div> <div class="mt-2 border-t border-border pt-2"><!></div> <!> <div class="mt-2 border-t border-border pt-2"><!> <!></div>',1),Cr=b('<code class="type-caption text-muted-foreground"> </code>'),Er=b('<p> </p> <code class="type-caption"> </code>',1),It=b("<!> <!>",1),Tr=b('<div class="mt-2 flex flex-wrap gap-2 px-2"></div>'),Ar=b('<div class="h-44 min-w-0 overflow-hidden rounded-(--radius-medium) border border-border bg-background py-2"><!></div> <div class="mt-2 px-1"><!> <!></div>',1),jr=b('<div class="mb-2 flex items-center justify-between gap-3 px-2"><div class="min-w-0"><h3> </h3> <p class="type-caption truncate text-muted-foreground"> </p></div> <!></div> <!>',1),Ke=b("<div><!></div>"),Ir=b("<!> ",1),Nt=b('<div class="min-w-0 w-full"><span class="text-sm"> </span> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Ut=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>'),Nr=b('<span class="type-caption px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium shrink-0"> </span>'),Ur=b('<div class="min-w-0 w-full"><div class="flex flex-wrap items-center gap-x-2 gap-y-1"><span class="text-sm"> </span> <!></div> <p class="text-xs text-subtle mt-0.5"> </p></div>'),Or=b('<div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <p class="text-xs text-subtle px-2 mb-2"> </p> <!></div> <!> <!> <div class="mb-4"><h4 class="type-caption font-medium text-muted-foreground mb-1.5 px-2"> </h4> <!></div>',1),Fr=b('<code class="type-caption px-1.5 py-0.5 rounded bg-background/80 text-muted-foreground font-mono cursor-pointer hover:bg-background hover:text-foreground transition-colors"> </code>'),Rr=b('<p class="text-xs"> </p> <p class="mt-1 text-xs text-muted-foreground"> <code class="type-caption"> </code></p>',1),Gr=b('<div class="flex flex-wrap items-center gap-x-3 gap-y-1.5 px-3 py-1.5 bg-muted/30 shrink-0"><span class="type-caption font-medium text-muted-foreground shrink-0"> </span> <div class="flex flex-wrap gap-1.5"></div></div> <div class="flex-1 min-h-0 min-w-0 overflow-hidden py-3 bg-background"><!></div>',1),Mr=b('<div class="flex min-h-0 min-w-0 flex-col overflow-y-auto"><!></div> <div class="flex min-h-0 min-w-0 flex-col"><!></div>',1),Dr=b('<div class="flex flex-col min-h-0 min-w-0 overflow-y-auto p-2 md:pr-4"><!></div> <div class="flex flex-col min-w-0 min-h-0"><!></div>',1),Lr=b('<!> <span class="text-sm font-normal text-subtle"> </span> <span class="text-subtle font-normal"> </span>',1),zr=b('<div class="mt-1 pl-7 space-y-3"><!></div>'),Wr=b('<div class="space-y-3"><!></div>'),qr=b("<div><!> <!></div> <!>",1);function Kr(He,P){if(new.target)return Ot({component:Kr,...He});Gt(P,!0);const at=(t,a=sr)=>{{const y=_=>{Te(_,{get icon(){return bt},get class(){return _e.icon}})},j=_=>{var i=kr(),f=S(i,!0);g(()=>m(f,a().name)),o(_,i)},T=_=>{{let i=z(()=>e(st)===a().id?"checked":"empty");dr(_,{get state(){return e(i)}})}};let h=z(()=>e(st)===a().id),$=z(()=>e(st)===a().id);nt(t,{get selected(){return e(h)},get"aria-pressed"(){return e($)},get"data-setup-source"(){return a().id},get class(){return _e.row},onclick:()=>a().id==="custom"?Dt():we(a().id),leading:y,title:j,trailing:T,$$slots:{leading:!0,title:!0,trailing:!0}})}},Ae=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Pr(),_=U($);Xe(_,21,()=>e(Ye),I=>I.id,(I,F)=>{at(I,()=>e(F))}),l(_);var i=n(_,2),f=c(i);nt(f,{get"aria-expanded"(){return e($e)},get class(){return _e.row},onclick:()=>r($e,!e($e)),leading:w=>{Te(w,{get icon(){return cr},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptEditor_templates_label()]),o(w,d)},$$slots:{leading:!0,title:!0}}),l(i);var x=n(i,2);{var k=I=>{var F=$r();Xe(F,21,()=>e(ct),w=>w.id,(w,d)=>{at(w,()=>({id:`template-${e(d).id}`,name:e(d).name}))}),l(F),Oe(3,F,()=>Ze,()=>({tier:"moderate"})),o(I,F)};W(x,I=>{e($e)&&I(k)})}var D=n(x,2),ue=c(D);nt(ue,{get class(){return _e.row},onclick:()=>r(ke,!0),leading:w=>{Te(w,{get icon(){return bt},get class(){return _e.icon}})},title:w=>{Ve();var d=Be();g(p=>m(d,p),[()=>u.workspace_setupScriptPicker_edit_label()]),o(w,d)},$$slots:{leading:!0,title:!0}});var ve=n(ue,2);{const I=d=>{Te(d,{get icon(){return Pt},get class(){return _e.icon}})},F=d=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(d,p)};let w=z(()=>!O());nt(ve,{get class(){return _e.row},get disabled(){return e(w)},onclick:()=>{r(ke,!0),r(Y,!0)},leading:I,title:F,$$slots:{leading:!0,title:!0}})}l(D),g(I=>nr(_,"aria-label",I),[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(h,$)},T=h=>{var $=jr(),_=U($),i=c(_),f=c(i),x=S(f,!0),k=n(f,2),D=S(k,!0);l(i);var ue=n(i,2);ye(ue,{variant:"ghost",size:"sm",onclick:()=>{r(ke,!1),r(Y,!1)},children:(w,d)=>{Ve();var p=Be();g(N=>m(p,N),[()=>u.workspace_setupScriptPicker_choose_label()]),o(w,p)},$$slots:{default:!0}}),l(_);var ve=n(_,2);{var I=w=>{St(w,{get repoPath(){return O()},onScriptGenerated:Lt,onClose:()=>r(Y,!1)})},F=w=>{var d=Ar(),p=U(d),N=c(p);xt(ht(N,{language:"shell",lineNumbers:!1,get lineWrapping(){return e(Se)},get value(){return C()},set value(A){C(A)}}),A=>r(pe,A,!0),()=>e(pe)),l(p);var X=n(p,2),H=c(X);ye(H,{variant:"ghost",size:"sm",get active(){return e(Ie)},get"aria-expanded"(){return e(Ie)},onclick:()=>r(Ie,!e(Ie)),children:(A,oe)=>{Ve();var L=Be();g(ee=>m(L,ee),[()=>u.workspace_setupScriptEditor_variables_label()]),o(A,L)},$$slots:{default:!0}});var V=n(H,2);{var Z=A=>{var oe=Ue(),L=U(oe);Ee(L,()=>At,(ee,te)=>{te(ee,{delayDuration:100,children:(ne,Ce)=>{var J=Tr();Xe(J,21,()=>jt,re=>re.name,(re,Ne)=>{var We=Ue(),pt=U(We);Ee(pt,()=>Ct,(Vt,Bt)=>{Bt(Vt,{children:(Ht,Vr)=>{var yt=It(),kt=U(yt);Ee(kt,()=>Et,(ut,vt)=>{vt(ut,{children:(_t,Yt)=>{var Qe=Cr(),ot=S(Qe);g(()=>m(ot,`$${e(Ne).name??""}`)),o(_t,Qe)},$$slots:{default:!0}})});var Jt=n(kt,2);Ee(Jt,()=>Tt,(ut,vt)=>{vt(ut,{side:"top",class:"max-w-xs",children:(_t,Yt)=>{var Qe=Er(),ot=U(Qe),Qt=S(ot,!0),Xt=n(ot,2),Zt=S(Xt,!0);g(()=>{m(Qt,e(Ne).description),m(Zt,e(Ne).example)}),o(_t,Qe)},$$slots:{default:!0}})}),o(Ht,yt)},$$slots:{default:!0}})}),o(re,We)}),l(J),o(ne,J)},$$slots:{default:!0}})}),o(A,oe)};W(V,A=>{e(Ie)&&A(Z)})}l(X),o(w,d)};W(ve,w=>{e(Y)&&O()?w(I):w(F,-1)})}g(w=>{Fe(f,1,gt(_e.title),"svelte-1yy464i"),m(x,w),m(D,e(ze))},[()=>u.workspace_setupScriptPicker_commands_label()]),o(h,$)};W(y,h=>{e(ke)?h(T,-1):h(j)})}l(a),xt(a,h=>r(Je,h),()=>e(Je)),g(()=>Fe(a,1,`${_e.rows} min-w-0`,"svelte-1yy464i")),o(t,a)},Re=t=>{var a=Or(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2),$=S(h,!0),_=n(h,2);{var i=d=>{var p=Ke(),N=c(p);St(N,{get repoPath(){return O()},onScriptGenerated:X=>{r(se,!0),r(s,""),C(X.content),r(E,X.name,!0),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())},onClose:()=>r(Y,!1)}),l(p),Oe(3,p,()=>Ze,()=>({tier:"moderate"})),o(d,p)},f=d=>{{let p=z(()=>!O());ye(d,{variant:"ghost",size:"sm",class:"w-full justify-start text-subtle",onclick:()=>r(Y,!0),get disabled(){return e(p)},children:(N,X)=>{var H=Ir(),V=U(H);Te(V,{get icon(){return Pt},class:"mr-1.5"});var Z=n(V);g(A=>m(Z,` ${A??""}`),[()=>u.workspace_setupScriptEditor_autoGenerate_label()]),o(N,H)},$$slots:{default:!0}})}};W(_,d=>{e(Y)&&O()?d(i):d(f,-1)})}l(y);var x=n(y,2);{var k=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===qe),Z=z(()=>e(s)===qe);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(qe),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(it,"repo-config"),()=>u.workspace_setupScriptEditor_repoConfig_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_repoConfig_label()]),o(d,p)};W(x,d=>{le()&&d(k)})}var D=n(x,2);{var ue=d=>{var p=Ut(),N=c(p),X=S(N,!0),H=n(N,2);{let V=z(()=>e(s)===B),Z=z(()=>e(s)===B);ye(H,{variant:"ghost",truncateLabel:!1,get active(){return e(V)},get"aria-pressed"(){return e(Z)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(B),children:(A,oe)=>{var L=Nt(),ee=c(L),te=S(ee,!0),ne=n(ee,2),Ce=S(ne,!0);l(L),g((J,re)=>{m(te,J),m(Ce,re)},[()=>tt(e(M).name,e(M).nameSource),()=>u.workspace_setupScriptEditor_lastUsed_description()]),o(A,L)},$$slots:{default:!0}})}l(p),g(V=>m(X,V),[()=>u.workspace_setupScriptEditor_lastUsed_label()]),o(d,p)};W(D,d=>{e(M)&&d(ue)})}var ve=n(D,2),I=c(ve),F=S(I,!0),w=n(I,2);Xe(w,17,()=>et,d=>d.id,(d,p)=>{{let N=z(()=>e(s)===`template-${e(p).id}`),X=z(()=>e(s)===`template-${e(p).id}`);ye(d,{variant:"ghost",truncateLabel:!1,get active(){return e(N)},get"aria-pressed"(){return e(X)},class:"w-full h-auto justify-start whitespace-normal text-left px-2 py-1.5",onclick:()=>we(`template-${e(p).id}`),children:(H,V)=>{var Z=Ur(),A=c(Z),oe=c(A),L=S(oe,!0),ee=n(oe,2);{var te=J=>{var re=Nr(),Ne=S(re,!0);g(We=>m(Ne,We),[()=>u.workspace_setupScriptEditor_recommended_label()]),o(J,re)};W(ee,J=>{e(p).projectType===ie()&&J(te)})}l(A);var ne=n(A,2),Ce=S(ne,!0);l(Z),g(()=>{m(L,e(p).name),m(Ce,e(p).description)}),o(H,Z)},$$slots:{default:!0}})}}),l(ve),g((d,p,N)=>{m(T,d),m($,p),m(F,N)},[()=>u.workspace_setupScriptEditor_generate_label(),()=>u.workspace_setupScriptEditor_generate_description(),()=>u.workspace_setupScriptEditor_templates_label()]),o(t,a)},Ge=t=>{var a=Gr(),y=U(a),j=c(y),T=S(j,!0),h=n(j,2);Xe(h,21,()=>jt,i=>i.name,(i,f)=>{var x=Ue(),k=U(x);Ee(k,()=>At,(D,ue)=>{ue(D,{delayDuration:100,children:(ve,I)=>{var F=Ue(),w=U(F);Ee(w,()=>Ct,(d,p)=>{p(d,{delayDuration:100,children:(N,X)=>{var H=It(),V=U(H);Ee(V,()=>Et,(A,oe)=>{oe(A,{children:(L,ee)=>{var te=Fr(),ne=S(te);g(()=>m(ne,`$${e(f).name??""}`)),o(L,te)},$$slots:{default:!0}})});var Z=n(V,2);Ee(Z,()=>Tt,(A,oe)=>{oe(A,{side:"bottom",class:"max-w-xs z-[200]",children:(L,ee)=>{var te=Rr(),ne=U(te),Ce=S(ne,!0),J=n(ne,2),re=c(J),Ne=n(re),We=S(Ne,!0);l(J),g(pt=>{m(Ce,e(f).description),m(re,`${pt??""} `),m(We,e(f).example)},[()=>u.workspace_setupScriptEditor_example_before()]),o(L,te)},$$slots:{default:!0}})}),o(N,H)},$$slots:{default:!0}})}),o(ve,F)},$$slots:{default:!0}})}),o(i,x)}),l(h),l(y);var $=n(y,2),_=c($);xt(ht(_,{language:"shell",lineNumbers:!0,get lineWrapping(){return e(Se)},get value(){return C()},set value(i){C(i)}}),i=>r(pe,i,!0),()=>e(pe)),l($),g(i=>m(T,i),[()=>u.workspace_setupScriptEditor_variables_label()]),ar("keydown",$,i=>{i.altKey&&i.key==="z"&&(i.preventDefault(),r(Se,!e(Se)))}),o(t,a)},Me=t=>{var a=Ke(),y=c(a);{var j=h=>{var $=Mr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),Oe(1,_,()=>$t,()=>({tier:"moderate",axis:"x",distance:-8})),Oe(1,f,()=>$t,()=>({tier:"moderate",axis:"x"})),o(h,$)},T=h=>{var $=Dr(),_=U($),i=c(_);Re(i),l(_);var f=n(_,2),x=c(f);Ge(x),l(f),o(h,$)};W(y,h=>{he()==="workspace"?h(j):h(T,-1)})}l(a),g(()=>Fe(a,1,gt(he()==="workspace"?"setup-workspace-layout":"grid flex-1 min-h-0 min-w-0 grid-cols-1 grid-rows-[minmax(0,1fr)_minmax(0,2fr)] md:grid-cols-[minmax(0,2fr)_minmax(0,3fr)] md:grid-rows-1"),"svelte-1yy464i")),o(t,a)};let O=R(P,"repoPath",7,""),ae=R(P,"repositoryKey",7),me=R(P,"githubUrl",7,null),ie=R(P,"projectType",7,void 0),le=R(P,"repoConfigScript",7,null),C=R(P,"value",15,""),fe=R(P,"expanded",15,!1),ge=R(P,"scriptName",31,()=>rt(u.workspace_setupScriptEditor_custom_name())),ce=R(P,"scriptNameSource",15,"named"),xe=R(P,"isCustomScript",15,!1),be=R(P,"compact",7,!1),De=R(P,"triggerClass",7,""),Le=R(P,"contentOnly",7,!1),je=R(P,"contentClass",7,""),he=R(P,"presentation",7,"editor"),de=R(P,"onchange",7),Y=K(!1),ke=K(rt(mt(()=>xe()))),$e=K(!1),Ie=K(!1),Je=K(void 0),pe=K(void 0),s=K(""),v=K(!1),E=K(rt(ge())),q=K(rt(ce())),se=K(!1);const B="last-used",M=z(()=>{const t=ae()??O(),a=t?gr(t,me()):void 0;return a?.nameSource==="repo-config"?{...a,name:"Custom",nameSource:"custom"}:a}),Q=z(()=>{const t=new Map;return le()&&t.set(qe,{content:le(),label:it,source:"repo-config"}),e(M)&&t.set(B,{content:e(M).content,label:e(M).name,source:e(M).nameSource}),et.forEach(a=>{t.set(`template-${a.id}`,{content:fr(a),label:a.name,source:"named"})}),t});let Se=K(!0);const ze=z(()=>{if(e(v))return tt(e(E),e(q));if(!e(s))return u.workspace_setupScriptEditor_custom_name();const t=e(Q).get(e(s));return t?tt(t.label,t.source):u.workspace_setupScriptEditor_custom_name()});function we(t){r(s,t,!0),r(v,!1),r(se,!0);const a=e(Q).get(t);a&&(C(a.content),r(E,a.label,!0),r(q,a.source,!0),de()?.(C())),he()==="picker"?(r(ke,!1),r($e,!1),requestAnimationFrame(()=>e(Je)?.querySelector("[data-setup-source][aria-pressed=true]")?.focus())):requestAnimationFrame(()=>e(pe)?.focus())}function lt(t){if(e(s)&&e(s)!=="none"){const a=e(Q).get(e(s));a&&r(v,t!==a.content)}else t&&r(v,!0)}const Pe=(()=>{const t=et.find(a=>a.id==="generic");return t?`template-${t.id}`:""})(),st=z(()=>e(v)||!e(s)?"custom":e(s)),Ye=z(()=>{const t=[];le()&&t.push({id:qe,name:tt(it,"repo-config")}),e(M)&&t.push({id:B,name:u.workspace_setupScriptEditor_lastUsed_label()});for(const a of et){const y=`template-${a.id}`;(y===Pe||y===e(s))&&t.push({id:y,name:a.name})}return t.push({id:"custom",name:u.workspace_setupScriptPicker_custom_label()}),t}),ct=z(()=>et.filter(t=>!e(Ye).some(a=>a.id===`template-${t.id}`)));function Dt(){r(s,""),r(v,!0),r(E,"Custom"),r(q,"custom"),r(Y,!1),r(ke,!0),requestAnimationFrame(()=>e(pe)?.focus())}function Lt(t){r(se,!0),r(s,""),C(t.content),r(E,t.name,!0),r(q,"named"),r(v,!0),de()?.(C()),r(Y,!1),requestAnimationFrame(()=>e(pe)?.focus())}let dt=K(null);ft(()=>{const t=ae()??O();if(t===e(dt))return;const a=e(dt)===null&&(xe()||C().trim().length>0);if(r(dt,t,!0),a){mt(()=>{let T=!1;const h=C().trim();for(const[$,_]of e(Q).entries())if(h===_.content.trim()&&_.source===ce()&&_.label===ge()){r(s,$,!0),r(E,_.label,!0),r(q,_.source,!0),r(v,!1),T=!0;break}T||(r(v,!0),e(E)||(r(E,ge()||u.workspace_setupScriptEditor_custom_name(),!0),r(q,ge()?ce():"named",!0))),r(se,!0)});return}const y=!!le(),j=e(M);if(mt(()=>{if(r(v,!1),r(se,!0),y)r(s,qe,!0),r(E,it,!0),r(q,"repo-config");else if(j)r(s,B),r(E,j.name,!0),r(q,j.nameSource,!0);else if(Pe){r(s,Pe,!0);const T=e(Q).get(Pe);r(E,T?.label||u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}else r(E,u.workspace_setupScriptEditor_custom_name(),!0),r(q,"named")}),y&&le())C(le()),de()?.(C());else if(j)C(j.content),de()?.(C());else if(Pe){const T=e(Q).get(Pe);T&&(C(T.content),de()?.(C()))}}),ft(()=>{if(e(se)){r(se,!1);return}C()!==void 0&&lt(C())}),ft(()=>{ge(e(E)),ce(e(q)),xe(e(v))});var zt={get repoPath(){return O()},set repoPath(t=""){O(t),G()},get repositoryKey(){return ae()},set repositoryKey(t){ae(t),G()},get githubUrl(){return me()},set githubUrl(t=null){me(t),G()},get projectType(){return ie()},set projectType(t=void 0){ie(t),G()},get repoConfigScript(){return le()},set repoConfigScript(t=null){le(t),G()},get value(){return C()},set value(t=""){C(t),G()},get expanded(){return fe()},set expanded(t=!1){fe(t),G()},get scriptName(){return ge()},set scriptName(t=u.workspace_setupScriptEditor_custom_name()){ge(t),G()},get scriptNameSource(){return ce()},set scriptNameSource(t="named"){ce(t),G()},get isCustomScript(){return xe()},set isCustomScript(t=!1){xe(t),G()},get compact(){return be()},set compact(t=!1){be(t),G()},get triggerClass(){return De()},set triggerClass(t=""){De(t),G()},get contentOnly(){return Le()},set contentOnly(t=!1){Le(t),G()},get contentClass(){return je()},set contentClass(t=""){je(t),G()},get presentation(){return he()},set presentation(t="editor"){he(t),G()},get onchange(){return de()},set onchange(t){de(t),G()},$set:Ft,$on:(t,a)=>Rt(P,t,a)},wt=Ue(),Wt=U(wt);{var qt=t=>{var a=Ue(),y=U(a);{var j=T=>{var h=Ue(),$=U(h);{var _=x=>{var k=Ke(),D=c(k);Ae(D),l(k),g(()=>Fe(k,1,`${je()??""} min-w-0`,"svelte-1yy464i")),o(x,k)},i=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex min-h-0 min-w-0 flex-1 flex-col`,"svelte-1yy464i")),o(x,k)},f=x=>{var k=Ke(),D=c(k);Me(D),l(k),g(()=>Fe(k,1,`${je()??""} flex flex-col gap-3 flex-1 min-h-0 min-w-0`,"svelte-1yy464i")),Oe(3,k,()=>Ze,()=>({tier:"moderate"})),o(x,k)};W($,x=>{he()==="picker"?x(_):he()==="workspace"?x(i,1):x(f,-1)})}o(T,h)};W(y,T=>{fe()&&T(j)})}o(t,a)},Kt=t=>{var a=qr(),y=U(a),j=c(y);ye(j,{variant:"ghost",size:"sm",get class(){return`whitespace-nowrap hover:text-inherit! ${De()??""}`},onclick:()=>fe(!fe()),children:(i,f)=>{var x=Lr(),k=U(x);Te(k,{get icon(){return bt},size:"xs"});var D=n(k,2),ue=S(D,!0),ve=n(D,2),I=S(ve,!0);g(F=>{m(ue,F),m(I,e(ze))},[()=>u.workspace_setupScriptEditor_setupScript_label()]),o(i,x)},$$slots:{default:!0}});var T=n(j,2);{var h=i=>{var f=zr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W(T,i=>{fe()&&!be()&&i(h)})}l(y);var $=n(y,2);{var _=i=>{var f=Wr(),x=c(f);Me(x),l(f),Oe(3,f,()=>Ze,()=>({tier:"moderate"})),o(i,f)};W($,i=>{fe()&&be()&&i(_)})}g(()=>Fe(y,1,gt(be()?"":"w-full"))),o(t,a)};W(Wt,t=>{Le()?t(qt):t(Kt,-1)})}return o(He,wt),Mt(zt)}rr(["keydown"]);export{Kr as default};
@@ -1,2 +1,2 @@
1
- import{b as e,ay as s,aX as o,B as i}from"./eBfEHUcb.js";import{p as g}from"./BFeEPayU.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},v={version:"12.3.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,n)=>{s.debug(`rendering info diagram
1
+ import{b as e,ay as s,aX as o,B as i}from"./BhSvmxU-.js";import{p as g}from"./BFeEPayU.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},v={version:"12.3.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,n)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),f={draw:c},b={parser:p,db:m,renderer:f};export{b as diagram};
@@ -1,4 +1,4 @@
1
- import{e as Ie}from"./Dcuzm8gD.js";import{aZ as Me,U as Be,V as Ve,a_ as Ye,b as d,X as Ot,ay as de,B as Fe,h as Ue,al as je,o as Nt,b5 as ze,aV as me,aW as Jt,bi as We,z as te,n as pe}from"./eBfEHUcb.js";var jt=(function(){var t=d(function(_t,m,x,E){for(x=x||{},E=_t.length;E--;x[_t[E]]=m);return x},"o"),e=[1,24],a=[1,25],i=[1,26],u=[1,27],r=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],p=[1,68],g=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],X=[1,35],q=[1,36],H=[1,37],Q=[1,38],K=[1,39],G=[1,40],Z=[1,41],J=[1,42],$=[1,43],tt=[1,44],et=[1,45],nt=[1,46],st=[1,47],at=[1,48],rt=[1,50],it=[1,51],ot=[1,52],lt=[1,53],ct=[1,54],ut=[1,55],ht=[1,56],dt=[1,57],pt=[1,58],ft=[1,59],yt=[1,60],kt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Pt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],T=[1,83],k=[1,84],C=[1,85],R=[12,14,42],oe=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],xt=[12,33],qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,Dt){var f=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[f-3]);break;case 19:_.setTitle(o[f].substring(6)),this.$=o[f].substring(6);break;case 20:_.setAccDescription(o[f].substring(15)),this.$=o[f].substring(15);break;case 21:this.$=o[f].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[f].trim(),_.setAccDescription(this.$);break;case 28:o[f].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 29:o[f].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 30:_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 31:o[f].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[f]),this.$=o[f];break;case 32:_.addDeploymentNode("node",...o[f]),this.$=o[f];break;case 33:_.addDeploymentNode("nodeL",...o[f]),this.$=o[f];break;case 34:_.addDeploymentNode("nodeR",...o[f]),this.$=o[f];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[f]),this.$=o[f];break;case 40:_.addPersonOrSystem("external_person",...o[f]),this.$=o[f];break;case 41:_.addPersonOrSystem("system",...o[f]),this.$=o[f];break;case 42:_.addPersonOrSystem("system_db",...o[f]),this.$=o[f];break;case 43:_.addPersonOrSystem("system_queue",...o[f]),this.$=o[f];break;case 44:_.addPersonOrSystem("external_system",...o[f]),this.$=o[f];break;case 45:_.addPersonOrSystem("external_system_db",...o[f]),this.$=o[f];break;case 46:_.addPersonOrSystem("external_system_queue",...o[f]),this.$=o[f];break;case 47:_.addContainer("container",...o[f]),this.$=o[f];break;case 48:_.addContainer("container_db",...o[f]),this.$=o[f];break;case 49:_.addContainer("container_queue",...o[f]),this.$=o[f];break;case 50:_.addContainer("external_container",...o[f]),this.$=o[f];break;case 51:_.addContainer("external_container_db",...o[f]),this.$=o[f];break;case 52:_.addContainer("external_container_queue",...o[f]),this.$=o[f];break;case 53:_.addComponent("component",...o[f]),this.$=o[f];break;case 54:_.addComponent("component_db",...o[f]),this.$=o[f];break;case 55:_.addComponent("component_queue",...o[f]),this.$=o[f];break;case 56:_.addComponent("external_component",...o[f]),this.$=o[f];break;case 57:_.addComponent("external_component_db",...o[f]),this.$=o[f];break;case 58:_.addComponent("external_component_queue",...o[f]),this.$=o[f];break;case 60:_.addRel("rel",...o[f]),this.$=o[f];break;case 61:_.addRel("birel",...o[f]),this.$=o[f];break;case 62:_.addRel("rel_u",...o[f]),this.$=o[f];break;case 63:_.addRel("rel_d",...o[f]),this.$=o[f];break;case 64:_.addRel("rel_l",...o[f]),this.$=o[f];break;case 65:_.addRel("rel_r",...o[f]),this.$=o[f];break;case 66:_.addRel("rel_b",...o[f]),this.$=o[f];break;case 67:o[f].splice(0,1),_.addRel("rel",...o[f]),this.$=o[f];break;case 68:_.updateElStyle("update_el_style",...o[f]),this.$=o[f];break;case 69:_.updateRelStyle("update_rel_style",...o[f]),this.$=o[f];break;case 70:_.updateLayoutConfig("update_layout_config",...o[f]),this.$=o[f];break;case 71:this.$=[o[f]];break;case 72:o[f].unshift(o[f-1]),this.$=o[f];break;case 73:case 75:this.$=o[f].trim();break;case 74:let vt={};vt[o[f-1].trim()]=o[f].trim(),this.$=vt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:70,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:71,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:72,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:73,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(kt,[2,14]),t(Xt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Pt,[2,19]),t(Pt,[2,20]),{25:[1,78]},{27:[1,79]},t(Pt,[2,23]),{35:80,75:81,76:S,77:T,79:k,80:C},{35:86,75:81,76:S,77:T,79:k,80:C},{35:87,75:81,76:S,77:T,79:k,80:C},{35:88,75:81,76:S,77:T,79:k,80:C},{35:89,75:81,76:S,77:T,79:k,80:C},{35:90,75:81,76:S,77:T,79:k,80:C},{35:91,75:81,76:S,77:T,79:k,80:C},{35:92,75:81,76:S,77:T,79:k,80:C},{35:93,75:81,76:S,77:T,79:k,80:C},{35:94,75:81,76:S,77:T,79:k,80:C},{35:95,75:81,76:S,77:T,79:k,80:C},{35:96,75:81,76:S,77:T,79:k,80:C},{35:97,75:81,76:S,77:T,79:k,80:C},{35:98,75:81,76:S,77:T,79:k,80:C},{35:99,75:81,76:S,77:T,79:k,80:C},{35:100,75:81,76:S,77:T,79:k,80:C},{35:101,75:81,76:S,77:T,79:k,80:C},{35:102,75:81,76:S,77:T,79:k,80:C},{35:103,75:81,76:S,77:T,79:k,80:C},{35:104,75:81,76:S,77:T,79:k,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:T,79:k,80:C},{35:106,75:81,76:S,77:T,79:k,80:C},{35:107,75:81,76:S,77:T,79:k,80:C},{35:108,75:81,76:S,77:T,79:k,80:C},{35:109,75:81,76:S,77:T,79:k,80:C},{35:110,75:81,76:S,77:T,79:k,80:C},{35:111,75:81,76:S,77:T,79:k,80:C},{35:112,75:81,76:S,77:T,79:k,80:C},{35:113,75:81,76:S,77:T,79:k,80:C},{35:114,75:81,76:S,77:T,79:k,80:C},{35:115,75:81,76:S,77:T,79:k,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:T,79:k,80:C},{35:120,75:81,76:S,77:T,79:k,80:C},{35:121,75:81,76:S,77:T,79:k,80:C},{35:122,75:81,76:S,77:T,79:k,80:C},{35:123,75:81,76:S,77:T,79:k,80:C},{35:124,75:81,76:S,77:T,79:k,80:C},{35:125,75:81,76:S,77:T,79:k,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(Xt,[2,17],{21:22,19:130,22:e,23:a,24:i,26:u,28:r}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:a,24:i,26:u,28:r,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(Pt,[2,21]),t(Pt,[2,22]),t(R,[2,39]),t(oe,[2,71],{75:81,35:132,76:S,77:T,79:k,80:C}),t(Bt,[2,73]),{78:[1,133]},t(Bt,[2,75]),t(Bt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(xt,[2,28]),t(xt,[2,29]),t(xt,[2,30]),t(xt,[2,31]),t(xt,[2,32]),t(xt,[2,33]),t(xt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Xt,[2,18]),t(kt,[2,38]),t(oe,[2,72]),t(Bt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(qt,[2,25]),t(qt,[2,26],{12:[1,138]}),t(qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],Dt=this.table,f="",vt=0,le=0,De=2,ce=1,Ne=o.slice.call(arguments,1),A=Object.create(this.lexer),Et={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(Et.yy[Qt]=this.yy[Qt]);A.setInput(m,Et.yy),Et.yy.lexer=A,Et.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var Kt=A.yylloc;o.push(Kt);var Ae=A.options&&A.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(Le,"popStack");function ue(){var B;return B=_.pop()||A.lex()||ce,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(ue,"lex");for(var M,St,V,Gt,Ct={},Yt,z,he,Ft;;){if(St=E[E.length-1],this.defaultActions[St]?V=this.defaultActions[St]:((M===null||typeof M>"u")&&(M=ue()),V=Dt[St]&&Dt[St][M]),typeof V>"u"||!V.length||!V[0]){var Zt="";Ft=[];for(Yt in Dt[St])this.terminals_[Yt]&&Yt>De&&Ft.push("'"+this.terminals_[Yt]+"'");A.showPosition?Zt="Parse error on line "+(vt+1)+`:
1
+ import{e as Ie}from"./Dirmxn0x.js";import{aZ as Me,U as Be,V as Ve,a_ as Ye,b as d,X as Ot,ay as de,B as Fe,h as Ue,al as je,o as Nt,b5 as ze,aV as me,aW as Jt,bi as We,z as te,n as pe}from"./BhSvmxU-.js";var jt=(function(){var t=d(function(_t,m,x,E){for(x=x||{},E=_t.length;E--;x[_t[E]]=m);return x},"o"),e=[1,24],a=[1,25],i=[1,26],u=[1,27],r=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],p=[1,68],g=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],X=[1,35],q=[1,36],H=[1,37],Q=[1,38],K=[1,39],G=[1,40],Z=[1,41],J=[1,42],$=[1,43],tt=[1,44],et=[1,45],nt=[1,46],st=[1,47],at=[1,48],rt=[1,50],it=[1,51],ot=[1,52],lt=[1,53],ct=[1,54],ut=[1,55],ht=[1,56],dt=[1,57],pt=[1,58],ft=[1,59],yt=[1,60],kt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Pt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],T=[1,83],k=[1,84],C=[1,85],R=[12,14,42],oe=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],xt=[12,33],qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,Dt){var f=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[f-3]);break;case 19:_.setTitle(o[f].substring(6)),this.$=o[f].substring(6);break;case 20:_.setAccDescription(o[f].substring(15)),this.$=o[f].substring(15);break;case 21:this.$=o[f].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[f].trim(),_.setAccDescription(this.$);break;case 28:o[f].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 29:o[f].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 30:_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 31:o[f].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[f]),this.$=o[f];break;case 32:_.addDeploymentNode("node",...o[f]),this.$=o[f];break;case 33:_.addDeploymentNode("nodeL",...o[f]),this.$=o[f];break;case 34:_.addDeploymentNode("nodeR",...o[f]),this.$=o[f];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[f]),this.$=o[f];break;case 40:_.addPersonOrSystem("external_person",...o[f]),this.$=o[f];break;case 41:_.addPersonOrSystem("system",...o[f]),this.$=o[f];break;case 42:_.addPersonOrSystem("system_db",...o[f]),this.$=o[f];break;case 43:_.addPersonOrSystem("system_queue",...o[f]),this.$=o[f];break;case 44:_.addPersonOrSystem("external_system",...o[f]),this.$=o[f];break;case 45:_.addPersonOrSystem("external_system_db",...o[f]),this.$=o[f];break;case 46:_.addPersonOrSystem("external_system_queue",...o[f]),this.$=o[f];break;case 47:_.addContainer("container",...o[f]),this.$=o[f];break;case 48:_.addContainer("container_db",...o[f]),this.$=o[f];break;case 49:_.addContainer("container_queue",...o[f]),this.$=o[f];break;case 50:_.addContainer("external_container",...o[f]),this.$=o[f];break;case 51:_.addContainer("external_container_db",...o[f]),this.$=o[f];break;case 52:_.addContainer("external_container_queue",...o[f]),this.$=o[f];break;case 53:_.addComponent("component",...o[f]),this.$=o[f];break;case 54:_.addComponent("component_db",...o[f]),this.$=o[f];break;case 55:_.addComponent("component_queue",...o[f]),this.$=o[f];break;case 56:_.addComponent("external_component",...o[f]),this.$=o[f];break;case 57:_.addComponent("external_component_db",...o[f]),this.$=o[f];break;case 58:_.addComponent("external_component_queue",...o[f]),this.$=o[f];break;case 60:_.addRel("rel",...o[f]),this.$=o[f];break;case 61:_.addRel("birel",...o[f]),this.$=o[f];break;case 62:_.addRel("rel_u",...o[f]),this.$=o[f];break;case 63:_.addRel("rel_d",...o[f]),this.$=o[f];break;case 64:_.addRel("rel_l",...o[f]),this.$=o[f];break;case 65:_.addRel("rel_r",...o[f]),this.$=o[f];break;case 66:_.addRel("rel_b",...o[f]),this.$=o[f];break;case 67:o[f].splice(0,1),_.addRel("rel",...o[f]),this.$=o[f];break;case 68:_.updateElStyle("update_el_style",...o[f]),this.$=o[f];break;case 69:_.updateRelStyle("update_rel_style",...o[f]),this.$=o[f];break;case 70:_.updateLayoutConfig("update_layout_config",...o[f]),this.$=o[f];break;case 71:this.$=[o[f]];break;case 72:o[f].unshift(o[f-1]),this.$=o[f];break;case 73:case 75:this.$=o[f].trim();break;case 74:let vt={};vt[o[f-1].trim()]=o[f].trim(),this.$=vt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:70,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:71,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:72,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:73,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(kt,[2,14]),t(Xt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Pt,[2,19]),t(Pt,[2,20]),{25:[1,78]},{27:[1,79]},t(Pt,[2,23]),{35:80,75:81,76:S,77:T,79:k,80:C},{35:86,75:81,76:S,77:T,79:k,80:C},{35:87,75:81,76:S,77:T,79:k,80:C},{35:88,75:81,76:S,77:T,79:k,80:C},{35:89,75:81,76:S,77:T,79:k,80:C},{35:90,75:81,76:S,77:T,79:k,80:C},{35:91,75:81,76:S,77:T,79:k,80:C},{35:92,75:81,76:S,77:T,79:k,80:C},{35:93,75:81,76:S,77:T,79:k,80:C},{35:94,75:81,76:S,77:T,79:k,80:C},{35:95,75:81,76:S,77:T,79:k,80:C},{35:96,75:81,76:S,77:T,79:k,80:C},{35:97,75:81,76:S,77:T,79:k,80:C},{35:98,75:81,76:S,77:T,79:k,80:C},{35:99,75:81,76:S,77:T,79:k,80:C},{35:100,75:81,76:S,77:T,79:k,80:C},{35:101,75:81,76:S,77:T,79:k,80:C},{35:102,75:81,76:S,77:T,79:k,80:C},{35:103,75:81,76:S,77:T,79:k,80:C},{35:104,75:81,76:S,77:T,79:k,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:T,79:k,80:C},{35:106,75:81,76:S,77:T,79:k,80:C},{35:107,75:81,76:S,77:T,79:k,80:C},{35:108,75:81,76:S,77:T,79:k,80:C},{35:109,75:81,76:S,77:T,79:k,80:C},{35:110,75:81,76:S,77:T,79:k,80:C},{35:111,75:81,76:S,77:T,79:k,80:C},{35:112,75:81,76:S,77:T,79:k,80:C},{35:113,75:81,76:S,77:T,79:k,80:C},{35:114,75:81,76:S,77:T,79:k,80:C},{35:115,75:81,76:S,77:T,79:k,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:T,79:k,80:C},{35:120,75:81,76:S,77:T,79:k,80:C},{35:121,75:81,76:S,77:T,79:k,80:C},{35:122,75:81,76:S,77:T,79:k,80:C},{35:123,75:81,76:S,77:T,79:k,80:C},{35:124,75:81,76:S,77:T,79:k,80:C},{35:125,75:81,76:S,77:T,79:k,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(Xt,[2,17],{21:22,19:130,22:e,23:a,24:i,26:u,28:r}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:a,24:i,26:u,28:r,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(Pt,[2,21]),t(Pt,[2,22]),t(R,[2,39]),t(oe,[2,71],{75:81,35:132,76:S,77:T,79:k,80:C}),t(Bt,[2,73]),{78:[1,133]},t(Bt,[2,75]),t(Bt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(xt,[2,28]),t(xt,[2,29]),t(xt,[2,30]),t(xt,[2,31]),t(xt,[2,32]),t(xt,[2,33]),t(xt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Xt,[2,18]),t(kt,[2,38]),t(oe,[2,72]),t(Bt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(qt,[2,25]),t(qt,[2,26],{12:[1,138]}),t(qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],Dt=this.table,f="",vt=0,le=0,De=2,ce=1,Ne=o.slice.call(arguments,1),A=Object.create(this.lexer),Et={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(Et.yy[Qt]=this.yy[Qt]);A.setInput(m,Et.yy),Et.yy.lexer=A,Et.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var Kt=A.yylloc;o.push(Kt);var Ae=A.options&&A.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(Le,"popStack");function ue(){var B;return B=_.pop()||A.lex()||ce,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(ue,"lex");for(var M,St,V,Gt,Ct={},Yt,z,he,Ft;;){if(St=E[E.length-1],this.defaultActions[St]?V=this.defaultActions[St]:((M===null||typeof M>"u")&&(M=ue()),V=Dt[St]&&Dt[St][M]),typeof V>"u"||!V.length||!V[0]){var Zt="";Ft=[];for(Yt in Dt[St])this.terminals_[Yt]&&Yt>De&&Ft.push("'"+this.terminals_[Yt]+"'");A.showPosition?Zt="Parse error on line "+(vt+1)+`:
2
2
  `+A.showPosition()+`
3
3
  Expecting `+Ft.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Zt="Parse error on line "+(vt+1)+": Unexpected "+(M==ce?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Zt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:Kt,expected:Ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+St+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,le=A.yyleng,f=A.yytext,vt=A.yylineno,Kt=A.yylloc;break;case 2:if(z=this.productions_[V[1]][1],Ct.$=D[D.length-z],Ct._$={first_line:o[o.length-(z||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(z||1)].first_column,last_column:o[o.length-1].last_column},Ae&&(Ct._$.range=[o[o.length-(z||1)].range[0],o[o.length-1].range[1]]),Gt=this.performAction.apply(Ct,[f,le,vt,Et.yy,V[1],D,o].concat(Ne)),typeof Gt<"u")return Gt;z&&(E=E.slice(0,-1*z*2),D=D.slice(0,-1*z),o=o.slice(0,-1*z)),E.push(this.productions_[V[1]][0]),D.push(Ct.$),o.push(Ct._$),he=Dt[E[E.length-2]][E[E.length-1]],E.push(he);break;case 3:return!0}}return!0},"parse")},Pe=(function(){var _t={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,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:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=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),E.length-1&&(this.yylineno-=E.length-1);var D=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:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CgLuwxkV.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CGslv4Qq.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/a6nBCKTJ.js"])))=>i.map(i=>d[i]);
2
- import{bm as c,_ as p}from"./C0QTy0Sy.js";import{m as k}from"./BmTMWrby.js";import"./3SdAC2_C.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import{Q as A}from"./DCRuihKm.js";import"./ChTqQfQN.js";import"./B4SiDSWP.js";import{m as L,Jv as d,vI as g,vK as v}from"./tr-2J8Mf.js";import{a9 as R}from"./BaujsV9k.js";import{selectCurrentWorkspaceTabId as P}from"./S845NCb3.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./CgLuwxkV.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./C6mS8uZB.js").then(o=>o.s);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./a6nBCKTJ.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./a6nBCKTJ.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./a6nBCKTJ.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./DCRuihKm.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CWdKrGNN.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/C9dAybnM.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/CfiKUG8A.js"])))=>i.map(i=>d[i]);
2
+ import{bm as c,_ as p}from"./C0QTy0Sy.js";import{m as k}from"./BmTMWrby.js";import"./3SdAC2_C.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import{Q as A}from"./DCRuihKm.js";import"./ChTqQfQN.js";import"./B4SiDSWP.js";import{m as L,Jv as d,vI as g,vK as v}from"./tr-2J8Mf.js";import{a9 as R}from"./BaujsV9k.js";import{selectCurrentWorkspaceTabId as P}from"./S845NCb3.js";const F="intent://local/note/{note-id}",S="intent://local/{workspace-id}/note/{note-id}";function f(){return c.ui_linkHandler_invalidFormat_error({shortFormat:F,longFormat:S})}class u extends Error{constructor(r){super(r),this.name="NotFoundError"}}function W(e){try{const r=new URL(e.replace("intent://","http://")),t=r.hostname,n=r.pathname.replace(/^\/+/,"").split("/").filter(l=>l.length>0),a=e.replace("intent://","").split(/[?#]/)[0].split("/").slice(1);if(!t||n.length<2)return{type:"unknown",orgId:t||"",resourceId:"",valid:!1,error:f()};let o,s,i,_,w;if(a[0]==="workspace"&&(a.length===2||a.length===3&&a[2]==="")){const l=O(a[1]);if(!l)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};o=l,s="workspace",i=l}else if(a[0]==="file")s="file",i=m(a.slice(1));else if(a.length>=3&&I(a[0])&&a[1]==="file")o=a[0],s="file",i=m(a.slice(2));else if(a.length===5&&a[1]==="agent"&&a[3]==="message"&&I(a[0])&&I(a[2])&&I(a[4])&&n.length===5&&n[1]==="agent"&&n[3]==="message")o=n[0],s="message",_=n[2],i=n[4];else if(n[0]==="note"||n[0]==="task")s=n[0],i=n[1];else if(n.length>=3&&(n[1]==="note"||n[1]==="task"))o=n[0],s=n[1],i=n[2];else return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:f()};if(!i||i.trim().length===0)return{type:"unknown",orgId:t,resourceId:"",valid:!1,error:c.ui_linkHandler_emptyResourceId_error()};if(s==="note"||s==="task")return{type:s,orgId:t,workspaceId:o,resourceId:i,valid:!0};if(s==="file"){const l=/^#L\d+(?:-\d+|C\d+)?$/.test(r.hash)?r.hash:"",E=a.slice(o?2:1).join("/"),h=A(E+l);return i=m(h.path.split("/")),w=h.line,H(i)?{type:"file",orgId:t,workspaceId:o,resourceId:i,...w!==void 0?{line:w}:{},valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:"",valid:!1,error:c.ui_linkHandler_invalidFilePath_error()}}return s==="workspace"&&o?{type:"workspace",orgId:t,workspaceId:o,resourceId:i,valid:!0}:s==="message"&&o&&_?{type:"message",orgId:t,workspaceId:o,resourceId:i,agentId:_,valid:!0}:{type:"unknown",orgId:t,workspaceId:o,resourceId:i,valid:!1,error:c.ui_linkHandler_unknownResourceType_error({type:s})}}catch(r){return{type:"unknown",orgId:"",resourceId:"",valid:!1,error:r instanceof Error?r.message:c.ui_linkHandler_parseFailed_error()}}}function m(e){return e.map(r=>decodeURIComponent(r)).join("/")}function H(e){return/^[A-Za-z]:/.test(e)?!1:e.split(/[\\/]/).every(t=>t.length>0&&t!=="."&&t!=="..")}const j=new Set([L,"new"]);function O(e){if(e===void 0||!I(e))return null;const r=decodeURIComponent(e);return j.has(r)?null:r}function I(e){let r;try{r=decodeURIComponent(e)}catch{return!1}return r.length>0&&r!=="."&&r!==".."&&!/[\\/]/.test(r)}async function T(e,r={}){if(!e.startsWith("intent://"))return!1;const t=W(e);if(!t.valid)return k.error(c.ui_linkHandler_invalidLink_title(),{description:t.error||c.ui_linkHandler_invalidLink_description()}),!0;try{switch(t.type){case"note":case"task":await N(t,r);break;case"file":await b(t,r);break;case"workspace":await C(t.resourceId);break;case"message":{const{openMessage:n}=await p(async()=>{const{openMessage:a}=await import("./CWdKrGNN.js");return{openMessage:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]),import.meta.url);await n({workspaceId:t.workspaceId,agentId:t.agentId,messageId:t.resourceId});break}default:k.error(c.ui_linkHandler_unsupportedLink_title(),{description:c.ui_linkHandler_unsupportedLink_description({type:t.type})})}}catch(n){n instanceof u?k.error(c.ui_linkHandler_notFound_title(),{description:n.message}):k.error(c.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:c.ui_linkHandler_unknownError_label()})}return!0}function Q(e,r){return R(e,r)}function Z(){return async(e,r,t)=>{const a=t.target.closest("a");return a?.href?.startsWith("intent://")?(t.preventDefault(),await T(a.href)):!1}}async function C(e){const{appClient:r}=await p(async()=>{const{appClient:a}=await import("./C6mS8uZB.js").then(o=>o.s);return{appClient:a}},__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23]),import.meta.url);if(!await r.workspaces.get(e).catch(()=>null))throw new u(c.workspace_loader_notFound_title());const{openAndShowWorkspace:n}=await p(async()=>{const{openAndShowWorkspace:a}=await import("./CfiKUG8A.js").then(o=>o.s);return{openAndShowWorkspace:a}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await n(e)}async function N(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const a=!t||e.workspaceId!==t;if(!await y(e.workspaceId,e.resourceId))throw new u(c.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:e.workspaceId}));if(a){const{openAndShowWorkspace:s}=await p(async()=>{const{openAndShowWorkspace:i}=await import("./CfiKUG8A.js").then(_=>_.s);return{openAndShowWorkspace:i}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);await s(e.workspaceId,{query:{note:e.resourceId}})}else d.dispatch(v(e.workspaceId,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());if(!await y(t,e.resourceId))throw new u(c.ui_linkHandler_noteNotFoundCurrent_error({noteId:e.resourceId}));d.dispatch(v(t,e.resourceId,{openInAdjacentPanel:r.openInAdjacentPanel??!1,openInNewAdjacentPanel:r.openInNewAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function b(e,r){const t=r.workspaceId??P.select(d.state)??void 0;if(e.workspaceId){const n=!t||e.workspaceId!==t;if(n){const{openAndShowWorkspace:a}=await p(async()=>{const{openAndShowWorkspace:o}=await import("./CfiKUG8A.js").then(s=>s.s);return{openAndShowWorkspace:o}},__vite__mapDeps([34,7,5,6,8,9,10,11,4,12,13,14,32,33]),import.meta.url);if(!await a(e.workspaceId))return}d.dispatch(g(e.workspaceId,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:n?!1:r.openInAdjacentPanel??!1,sourcePanelId:n?void 0:r.sourcePanelId}));return}if(!t)throw new u(c.ui_linkHandler_noSpaceOpen_error());d.dispatch(g(t,e.resourceId,{filePathIsLiteral:!0,...e.line!==void 0?{line:e.line}:{},openInAdjacentPanel:r.openInAdjacentPanel??!1,sourcePanelId:r.sourcePanelId}))}async function y(e,r){try{const{backendRequest:t}=await p(async()=>{const{backendRequest:o}=await import("./DCRuihKm.js").then(s=>s.j);return{backendRequest:o}},__vite__mapDeps([15,4,5,14,10,16,13,17,11,18,19]),import.meta.url),n=await t("note.get",{workspaceId:e,noteId:r}),a=n&&typeof n=="object"&&"note"in n?n.note:n;return a!=null&&typeof a=="object"}catch{return!1}}export{u as NotFoundError,Z as createIntentLinkClickHandler,Q as generateNoteLink,T as handleIntentLink,W as parseIntentLink};
@@ -1 +1 @@
1
- import{b as i}from"./eBfEHUcb.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
1
+ import{b as i}from"./BhSvmxU-.js";function t(c,e){c.accDescr&&e.setAccDescription?.(c.accDescr),c.accTitle&&e.setAccTitle?.(c.accTitle),c.title&&e.setDiagramTitle?.(c.title)}i(t,"populateCommonDb");export{t as p};
@@ -1 +1 @@
1
- var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{m as ce,N as le,T as de,d as ue,o as pe,w as ge}from"./BmTMWrby.js";import"./3SdAC2_C.js";import{bm as n,_ as he}from"./C0QTy0Sy.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import"./DCRuihKm.js";import{c as V}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{Jv as a,uA as fe,nY as y,nX as k,mp as Se,yX as C,yY as N,yV as be,yU as me,yW as ve,rT as _e,c8 as Ae,c7 as ye,cm as ke,cl as we,n_ as w}from"./tr-2J8Mf.js";import{cU as Ee,cJ as Ce,bJ as Pe,cl as Re,cB as Me,cn as Te,cS as Q,aJ as Ie,c3 as Fe,c_ as De}from"./BaujsV9k.js";import{a as Le,i as Oe}from"./CL3a4Hm1.js";import{i as D}from"./BBWuirRW.js";import{n as xe}from"./CGslv4Qq.js";import{x as We,aO as Ne,c as Be,aD as Ge,B as Ve,y as Ue,z as He}from"./DKHY8q_S.js";import{a0 as qe,K as Y,a1 as $e,ay as U,Z as ze,a3 as je,L as Ke,$ as Ze,aA as Qe,x as Ye}from"./DCK8dPAL.js";const Je=5,L=120,Xe=4e3,j=.2,et=.8;function tt(e,t,r=Je){const s=e.length>0?t/(2*e.length):0,i=Xe/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let $=0;for(let F=f;F<b;F+=1)$+=e[F]??0;const z=($/(b-f)/255-j)/(et-j);return Number.isFinite(z)?Math.min(1,Math.max(0,z)):0})}const rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:le,TOAST_COUNTDOWN_CLASS:de,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:ue,notify:ce,notifyMetadata:pe,withToastCountdown:ge},Symbol.toStringTag,{value:"Module"})),Dr=a.createSelector(e=>Ee.select(e)?.capabilities.gitlabCheckout===!0),Lr=a.createSelector(e=>e.gitlabAuth.host),Or=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),xr=a.createSelector(e=>fe(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Nr=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Br=a.createSelector(e=>e.gitlabAuth.isConfigured),Gr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Vr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Ur=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Hr=a.createSelector(e=>e.gitlabAuth.user),qr=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const $r=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],J=new Set(["pr-reviewer"]),zr="developer";function jr(e){return A.find(t=>t.id===e)}const st=a.createSelector(e=>e.githubAuth.mutationRequestId),it=a.createSelector(e=>e.githubAuth.callbacksCancelled),at=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),nt=a.createSelector(e=>e.githubAuth.statusSettled===!0),ot=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),ct=a.createSelector(e=>e.githubAuth.user),lt=a.createSelector(e=>e.githubAuth.isAuthenticating),dt=a.createSelector(e=>e.githubAuth.deviceFlow),ut=a.createSelector(e=>e.githubAuth.error),Kr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:it,selectGitHubAuthDeviceFlow:dt,selectGitHubAuthError:ut,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:lt,selectGitHubAuthIsDisconnecting:at,selectGitHubAuthMutationRequestId:st,selectGitHubAuthRequiresDaemonAuth:ot,selectGitHubAuthStatusSettled:nt,selectGitHubAuthUser:ct},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function pt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&pt(e.modelOptions,r.modelOptions):!1}const Zr=a.createSelector(e=>e.specialists.bundledSpecialists),gt=a.createSelector(e=>e.specialists.fileSpecialists),Qr=a.createSelector(e=>y(gt.select(e))),Yr=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Jr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Xr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),es=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ts=a.createSelector(e=>e.specialists.specialistsFolderPath),rs=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const O=a.createSelector((e,t)=>!(J.has(t)&&!X.select(e)));function ht(e,t){return t?e:e.filter(r=>!J.has(r.id))}function ft(e,t){return ht(e,t).filter(r=>!r.hidden)}function ss(e,t){return ft(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),is=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),St=a.createSelector((e,t)=>{const r=k(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&y(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),as=a.createSelector((e,t)=>St.select(e,t)?.name??null),ns=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),os=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),cs=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ls=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const ds=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),us=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!k(e.specialists.fileSpecialists,t)),ps=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=k(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return k(e.specialists.fileSpecialists,t)}),gs=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),hs=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=k(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),fs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Ce.select(e,o,r);const l=Pe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=k(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:bt.select(e,t)}),bt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:qe.select(e)?Y.select(e):""}),Ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),bs=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Se),ms=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),x=V("Clipboard");async function vs(e){let t;if(Le())try{const r=await Oe("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,x.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw x.error("Browser clipboard write failed",r,{electronError:t}),r}throw x.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _s=a.createSelector(e=>e.directoryPicker.source??"daemon"),As=a.createSelector(e=>e.directoryPicker.listing),ys=a.createSelector(e=>e.directoryPicker.loading),ks=a.createSelector(e=>e.directoryPicker.error),ws=a.createSelector(e=>e.directoryPicker.pathError),Es=a.createSelector(e=>e.directoryPicker.createError),mt=V("WorkspaceValidation");async function Cs(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return vt(s)?At(s):yt(s,t,r)}function vt(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function _t(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function At(e){return _t(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function yt(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(mt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ps(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Rs(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Ms(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ts(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Is(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function wt(e){return e===void 0||!kt.includes(e)}function Fs(e){return e.status==="restarting"?"restarting":wt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function Et(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ds=a.createSelector(e=>e.voiceSettings.isLoading),Ls=a.createSelector(e=>e.voiceSettings.available),Os=a.createSelector(e=>e.voiceSettings.provider),xs=a.createSelector(e=>e.voiceSettings.engine),Ws=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Ns=a.createSelector(e=>e.voiceSettings.keyConfigured),Bs=a.createSelector(e=>e.voiceSettings.vocabulary),Gs=a.createSelector(e=>e.voiceSettings.openaiModel),Vs=a.createSelector(e=>e.voiceSettings.language),Us=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Hs=a.createSelector(e=>e.voiceSettings.inputDeviceId),qs=a.createSelector(e=>e.voiceSettings.inputDevices),$s=a.createSelector(e=>e.voiceSettings.busyProvider),zs=a.createSelector(e=>e.voiceSettings.error),js=a.createSelector(e=>Re.select(e)?"unavailable":Et(e.voiceSettings)),B="intent.voice.inputDevice";let G;function Ct(){if(G!==void 0)return G;try{const e=localStorage.getItem(B);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ks(e){G=e;try{e===null?localStorage.removeItem(B):localStorage.setItem(B,e)}catch{}}let R=null;function Zs(e){R=e}function Qs(){const e=R;return R=null,e}function Pt(){R=null}const Rt=300,Mt=300;class Tt{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Rt,this.doublePressWindowMs=t.doublePressWindowMs??Mt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let M=null;function Ys(e){M=e}function Js(){const e=M;return M=null,e}function It(){M=null}const Ft=66;function Dt(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(tt(g,l.sampleRate))},Ft);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Lt=12e4,Ot=["audio/webm;codecs=opus","audio/webm"];function Xs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Wt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ot.find(e=>MediaRecorder.isTypeSupported(e))}class Nt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Lt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Wt(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Dt(t,this.onLevels)),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.stopMeter?.(),this.stopMeter=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Tt({onRecordStart:()=>{E&&Ut(E)},onRecordStop:e=>{ee(E,e)}});function ei(){return p!==null}function ti(){return p}function ri(e){E=e,_+=1,_===1&&I.keyDown()}function si(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Ut(e,t="key"){if(p!==null)return;It(),Pt();const r=new Nt({deviceId:Ct(),onLevels:s=>{p===r&&e.dispatch(me(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(N());return}e.dispatch(be({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(ve({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(N())}})}function ee(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(N());return}m=t,r.stop()}function ii(){ee(null,Vt)}function ai(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ht=V("HardwareConsoleVoiceSetupToast"),qt="hardware-console-voice-setup";let W=null;function $t(){return W||(W=he(()=>Promise.resolve().then(()=>rt),void 0,import.meta.url).then(e=>e.notify)),W}function zt(){xe("/settings?tab=connections#voice").catch(e=>{Ht.error("Failed to open voice settings from setup toast",e)})}function jt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function ni(){$t().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:qt,action:jt()})})}const oi=a.createSelector(e=>e.externalEditors.selectedAction),Kt=a.createSelector(e=>e.externalEditors.editors),Zt=a.createSelector(e=>{const t=y(Kt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),ci=a.createSelector(e=>e.externalEditors.editorOrder??[]),li=a.createSelector(e=>e.externalEditors.loading),di=a.createSelector(e=>e.externalEditors.lastFetched),Qt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ui=a.createSelector((e,t)=>{if(!(t?Me.select(e,t):Te.select(e))||_e())return[];const s=Qt.select(e);return Zt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function pi(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Yt=0;function Jt(e,t){const r=++Yt;return a.dispatch(ye(e,t,r)),r}function gi(e,t,r){a.dispatch(Ae(e,t,r))}async function te(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(ke({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??Jt(e,t)}))).status==="success"}finally{a.dispatch(we(i,o))}}async function hi(e,t,r,s,i){return te(e,t,{kind:"effort",effort:r,previous:s},i)}async function fi(e,t,r,s,i){return te(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Xt=a.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Si=a.createSelector((e,t)=>Xt.select(e,t).some(r=>r.status==="pending")),bi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ie.select(e,t),o=We.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Ne(l),g=c?Be(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!Fe.select(e,r)}});function er(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const mi=a.createSelector(e=>$e.select(e)?null:U.select(e)),tr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),vi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),_i=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===tr.select(e)),re=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:De.select(e)),se=a.createSelector((e,t)=>{if(!t)return Y.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return ze.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),ie=a.createSelector((e,t)=>{if(!t)return je.select(e);const r=q.select(e,t),s=se.select(e,t),i=S.select(e,t)?.readiness??{};return re.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ai=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return re.select(e,t).filter(i=>er(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),yi=a.createSelector((e,t)=>t?ie.select(e,t):Ke.select(e)),ki=a.createSelector((e,t)=>v.select(e,t)),wi=a.createSelector((e,t)=>t?!!S.select(e,t):Ze.select(e)),Ei=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=S.select(e,t)?.settings??[],s=se.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),Ci=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):Ve.select(e)),Pi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Ue.select(e)),Ri=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):He.select(e)),Mi=a.createSelector((e,t,r)=>{if(!r)return Qe.select(e,t);const s=q.select(e,r),i=S.select(e,r);return ie.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&Ye(o,i?.readiness[o]?.authenticated))}),Ti=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),rr={},Ii=a.createSelector(e=>e.providerSettings?.profiles?.status??rr),Z={},sr=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Fi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Di=a.createSelector(e=>e.mcpSettings.loading),Li=a.createSelector(e=>e.mcpSettings.error),Oi=a.createSelector(e=>e.mcpSettings.mutationError??null),xi=a.createSelector(e=>e.mcpSettings.enabled),ir=a.createSelector(e=>e.mcpSettings.disabledServers),ar=a.createSelector(e=>e.mcpSettings.statusMap),nr=a.createSelector(e=>e.mcpSettings.toolsMap),or=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),cr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),Wi=a.createSelector((e,t)=>Object.keys(cr.select(e,t))),Ni=a.createSelector(e=>{const t=sr.select(e),r=ar.select(e),s=nr.select(e),i=ir.select(e),o=or.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Bi=a.createSelector(e=>e.mcpSettings.lastImportedCount),Gi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Vi=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function lr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(lr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ur(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&dr(t,i.idPattern));return s?{...s,id:t}:void 0}function Ui(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function pr(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const gr=new Set(T.flatMap(e=>e.route?[pr(e.route)]:[])),hr=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Hi(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return gr.has(r)?s?!!ur(s):!0:hr.some(i=>i.test(r))}const qi=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],fr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],$i=Object.fromEntries(fr.map(e=>[e.path,e.defaultValue]));export{Ri as $,Hi as A,Xs as B,Ct as C,zr as D,Jt as E,fr as F,J as G,_t as H,fi as I,gi as J,Et as K,ur as L,Rs as M,Ks as N,Si as O,Xt as P,bi as Q,Zr as R,A as S,es as T,yi as U,se as V,q as W,Ai as X,ie as Y,re as Z,Pi as _,Je as a,sr as a$,Ci as a0,Mi as a1,Ti as a2,wi as a3,Ei as a4,ki as a5,Jr as a6,rs as a7,Es as a8,ks as a9,qr as aA,Lr as aB,xr as aC,Gr as aD,Wr as aE,Br as aF,Or as aG,Hr as aH,Dr as aI,$r as aJ,ps as aK,Qt as aL,Zt as aM,ui as aN,li as aO,ds as aP,us as aQ,di as aR,Vi as aS,Gi as aT,ir as aU,xi as aV,Li as aW,or as aX,Bi as aY,Di as aZ,Oi as a_,As as aa,ys as ab,ws as ac,_s as ad,ci as ae,ls as af,fs as ag,ns as ah,js as ai,os as aj,cs as ak,Qr as al,Xr as am,H as an,it as ao,dt as ap,ut as aq,X as ar,lt as as,at,st as au,ot as av,ct as aw,Nr as ax,Vr as ay,Ur as az,$i as b,Ni as b0,ar as b1,nr as b2,oi as b3,is as b4,Ii as b5,mi as b6,St as b7,bs as b8,ms as b9,Fi as bA,Zs as bB,Ys as bC,ni as bD,Ut as bE,ii as bF,Ms as bG,Ps as bH,Ts as bI,Cs as bJ,jt as bK,vs as bL,hs as ba,Ss as bb,as as bc,gs as bd,v as be,ts as bf,Yr as bg,$s as bh,xs as bi,Hs as bj,qs as bk,Ns as bl,Vs as bm,Gs as bn,Ws as bo,Os as bp,Ls as bq,zs as br,Ds as bs,Bs as bt,Us as bu,S as bv,tr as bw,_i as bx,vi as by,Wi as bz,qi as c,hi as d,ai as e,Pt as f,It as g,Qs as h,Js as i,ss as j,ft as k,ht as l,ti as m,Ui as n,Is as o,Fs as p,jr as q,Kr as r,ri as s,si as t,rt as u,wt as v,er as w,ei as x,pi as y,K as z};
1
+ var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{m as ce,N as le,T as de,d as ue,o as pe,w as ge}from"./BmTMWrby.js";import"./3SdAC2_C.js";import{bm as n,_ as he}from"./C0QTy0Sy.js";import"./7UPrdiE9.js";import"./CrD0jtXE.js";import"./DCRuihKm.js";import{c as V}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{Jv as a,uA as fe,nY as y,nX as k,mp as Se,yX as C,yY as N,yV as be,yU as me,yW as ve,rT as _e,c8 as Ae,c7 as ye,cm as ke,cl as we,n_ as w}from"./tr-2J8Mf.js";import{cU as Ee,cJ as Ce,bJ as Pe,cl as Re,cB as Me,cn as Te,cS as Q,aJ as Ie,c3 as Fe,c_ as De}from"./BaujsV9k.js";import{a as Le,i as Oe}from"./CL3a4Hm1.js";import{i as D}from"./BBWuirRW.js";import{n as xe}from"./C9dAybnM.js";import{x as We,aO as Ne,c as Be,aD as Ge,B as Ve,y as Ue,z as He}from"./DKHY8q_S.js";import{a0 as qe,K as Y,a1 as $e,ay as U,Z as ze,a3 as je,L as Ke,$ as Ze,aA as Qe,x as Ye}from"./DCK8dPAL.js";const Je=5,L=120,Xe=4e3,j=.2,et=.8;function tt(e,t,r=Je){const s=e.length>0?t/(2*e.length):0,i=Xe/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let $=0;for(let F=f;F<b;F+=1)$+=e[F]??0;const z=($/(b-f)/255-j)/(et-j);return Number.isFinite(z)?Math.min(1,Math.max(0,z)):0})}const rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:le,TOAST_COUNTDOWN_CLASS:de,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:ue,notify:ce,notifyMetadata:pe,withToastCountdown:ge},Symbol.toStringTag,{value:"Module"})),Dr=a.createSelector(e=>Ee.select(e)?.capabilities.gitlabCheckout===!0),Lr=a.createSelector(e=>e.gitlabAuth.host),Or=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),xr=a.createSelector(e=>fe(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Nr=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Br=a.createSelector(e=>e.gitlabAuth.isConfigured),Gr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Vr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Ur=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Hr=a.createSelector(e=>e.gitlabAuth.user),qr=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const $r=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],J=new Set(["pr-reviewer"]),zr="developer";function jr(e){return A.find(t=>t.id===e)}const st=a.createSelector(e=>e.githubAuth.mutationRequestId),it=a.createSelector(e=>e.githubAuth.callbacksCancelled),at=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),nt=a.createSelector(e=>e.githubAuth.statusSettled===!0),ot=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),ct=a.createSelector(e=>e.githubAuth.user),lt=a.createSelector(e=>e.githubAuth.isAuthenticating),dt=a.createSelector(e=>e.githubAuth.deviceFlow),ut=a.createSelector(e=>e.githubAuth.error),Kr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:it,selectGitHubAuthDeviceFlow:dt,selectGitHubAuthError:ut,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:lt,selectGitHubAuthIsDisconnecting:at,selectGitHubAuthMutationRequestId:st,selectGitHubAuthRequiresDaemonAuth:ot,selectGitHubAuthStatusSettled:nt,selectGitHubAuthUser:ct},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function pt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&pt(e.modelOptions,r.modelOptions):!1}const Zr=a.createSelector(e=>e.specialists.bundledSpecialists),gt=a.createSelector(e=>e.specialists.fileSpecialists),Qr=a.createSelector(e=>y(gt.select(e))),Yr=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Jr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Xr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),es=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ts=a.createSelector(e=>e.specialists.specialistsFolderPath),rs=a.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});a.createSelector(e=>e.specialists.providerModelOverrides);const O=a.createSelector((e,t)=>!(J.has(t)&&!X.select(e)));function ht(e,t){return t?e:e.filter(r=>!J.has(r.id))}function ft(e,t){return ht(e,t).filter(r=>!r.hidden)}function ss(e,t){return ft(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=y(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&O.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),is=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),St=a.createSelector((e,t)=>{const r=k(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&y(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),as=a.createSelector((e,t)=>St.select(e,t)?.name??null),ns=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),os=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),cs=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ls=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const ds=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),us=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!k(e.specialists.fileSpecialists,t)),ps=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=k(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return k(e.specialists.fileSpecialists,t)}),gs=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),hs=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=k(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),fs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Ce.select(e,o,r);const l=Pe.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=k(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:bt.select(e,t)}),bt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:qe.select(e)?Y.select(e):""}),Ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?y(r):[]}),bs=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Se),ms=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),x=V("Clipboard");async function vs(e){let t;if(Le())try{const r=await Oe("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,x.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw x.error("Browser clipboard write failed",r,{electronError:t}),r}throw x.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _s=a.createSelector(e=>e.directoryPicker.source??"daemon"),As=a.createSelector(e=>e.directoryPicker.listing),ys=a.createSelector(e=>e.directoryPicker.loading),ks=a.createSelector(e=>e.directoryPicker.error),ws=a.createSelector(e=>e.directoryPicker.pathError),Es=a.createSelector(e=>e.directoryPicker.createError),mt=V("WorkspaceValidation");async function Cs(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return vt(s)?At(s):yt(s,t,r)}function vt(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function _t(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function At(e){return _t(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function yt(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(mt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ps(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Rs(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Ms(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ts(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Is(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function wt(e){return e===void 0||!kt.includes(e)}function Fs(e){return e.status==="restarting"?"restarting":wt(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function Et(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Ds=a.createSelector(e=>e.voiceSettings.isLoading),Ls=a.createSelector(e=>e.voiceSettings.available),Os=a.createSelector(e=>e.voiceSettings.provider),xs=a.createSelector(e=>e.voiceSettings.engine),Ws=a.createSelector(e=>e.voiceSettings.osEngineAvailable),Ns=a.createSelector(e=>e.voiceSettings.keyConfigured),Bs=a.createSelector(e=>e.voiceSettings.vocabulary),Gs=a.createSelector(e=>e.voiceSettings.openaiModel),Vs=a.createSelector(e=>e.voiceSettings.language),Us=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Hs=a.createSelector(e=>e.voiceSettings.inputDeviceId),qs=a.createSelector(e=>e.voiceSettings.inputDevices),$s=a.createSelector(e=>e.voiceSettings.busyProvider),zs=a.createSelector(e=>e.voiceSettings.error),js=a.createSelector(e=>Re.select(e)?"unavailable":Et(e.voiceSettings)),B="intent.voice.inputDevice";let G;function Ct(){if(G!==void 0)return G;try{const e=localStorage.getItem(B);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Ks(e){G=e;try{e===null?localStorage.removeItem(B):localStorage.setItem(B,e)}catch{}}let R=null;function Zs(e){R=e}function Qs(){const e=R;return R=null,e}function Pt(){R=null}const Rt=300,Mt=300;class Tt{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Rt,this.doublePressWindowMs=t.doublePressWindowMs??Mt,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let M=null;function Ys(e){M=e}function Js(){const e=M;return M=null,e}function It(){M=null}const Ft=66;function Dt(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(tt(g,l.sampleRate))},Ft);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Lt=12e4,Ot=["audio/webm;codecs=opus","audio/webm"];function Xs(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Wt(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Ot.find(e=>MediaRecorder.isTypeSupported(e))}class Nt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Lt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Wt(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Dt(t,this.onLevels)),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.stopMeter?.(),this.stopMeter=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Tt({onRecordStart:()=>{E&&Ut(E)},onRecordStop:e=>{ee(E,e)}});function ei(){return p!==null}function ti(){return p}function ri(e){E=e,_+=1,_===1&&I.keyDown()}function si(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Ut(e,t="key"){if(p!==null)return;It(),Pt();const r=new Nt({deviceId:Ct(),onLevels:s=>{p===r&&e.dispatch(me(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(N());return}e.dispatch(be({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(ve({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(N())}})}function ee(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(N());return}m=t,r.stop()}function ii(){ee(null,Vt)}function ai(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ht=V("HardwareConsoleVoiceSetupToast"),qt="hardware-console-voice-setup";let W=null;function $t(){return W||(W=he(()=>Promise.resolve().then(()=>rt),void 0,import.meta.url).then(e=>e.notify)),W}function zt(){xe("/settings?tab=connections#voice").catch(e=>{Ht.error("Failed to open voice settings from setup toast",e)})}function jt(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function ni(){$t().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:qt,action:jt()})})}const oi=a.createSelector(e=>e.externalEditors.selectedAction),Kt=a.createSelector(e=>e.externalEditors.editors),Zt=a.createSelector(e=>{const t=y(Kt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),ci=a.createSelector(e=>e.externalEditors.editorOrder??[]),li=a.createSelector(e=>e.externalEditors.loading),di=a.createSelector(e=>e.externalEditors.lastFetched),Qt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),ui=a.createSelector((e,t)=>{if(!(t?Me.select(e,t):Te.select(e))||_e())return[];const s=Qt.select(e);return Zt.select(e).filter(i=>i.installed&&!s.includes(i.id))});function pi(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Yt=0;function Jt(e,t){const r=++Yt;return a.dispatch(ye(e,t,r)),r}function gi(e,t,r){a.dispatch(Ae(e,t,r))}async function te(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(ke({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??Jt(e,t)}))).status==="success"}finally{a.dispatch(we(i,o))}}async function hi(e,t,r,s,i){return te(e,t,{kind:"effort",effort:r,previous:s},i)}async function fi(e,t,r,s,i){return te(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Xt=a.createSelector((e,t)=>y(e.agentModel.mutations).filter(r=>r.consumerId===t)),Si=a.createSelector((e,t)=>Xt.select(e,t).some(r=>r.status==="pending")),bi=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ie.select(e,t),o=We.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Ne(l),g=c?Be(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!Fe.select(e,r)}});function er(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const mi=a.createSelector(e=>$e.select(e)?null:U.select(e)),tr=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),vi=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),_i=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===tr.select(e)),re=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:De.select(e)),se=a.createSelector((e,t)=>{if(!t)return Y.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return ze.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),ie=a.createSelector((e,t)=>{if(!t)return je.select(e);const r=q.select(e,t),s=se.select(e,t),i=S.select(e,t)?.readiness??{};return re.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ai=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return re.select(e,t).filter(i=>er(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),yi=a.createSelector((e,t)=>t?ie.select(e,t):Ke.select(e)),ki=a.createSelector((e,t)=>v.select(e,t)),wi=a.createSelector((e,t)=>t?!!S.select(e,t):Ze.select(e)),Ei=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=S.select(e,t)?.settings??[],s=se.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),Ci=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):Ve.select(e)),Pi=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Ue.select(e)),Ri=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):He.select(e)),Mi=a.createSelector((e,t,r)=>{if(!r)return Qe.select(e,t);const s=q.select(e,r),i=S.select(e,r);return ie.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&Ye(o,i?.readiness[o]?.authenticated))}),Ti=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),rr={},Ii=a.createSelector(e=>e.providerSettings?.profiles?.status??rr),Z={},sr=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Fi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Di=a.createSelector(e=>e.mcpSettings.loading),Li=a.createSelector(e=>e.mcpSettings.error),Oi=a.createSelector(e=>e.mcpSettings.mutationError??null),xi=a.createSelector(e=>e.mcpSettings.enabled),ir=a.createSelector(e=>e.mcpSettings.disabledServers),ar=a.createSelector(e=>e.mcpSettings.statusMap),nr=a.createSelector(e=>e.mcpSettings.toolsMap),or=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),cr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),Wi=a.createSelector((e,t)=>Object.keys(cr.select(e,t))),Ni=a.createSelector(e=>{const t=sr.select(e),r=ar.select(e),s=nr.select(e),i=ir.select(e),o=or.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Bi=a.createSelector(e=>e.mcpSettings.lastImportedCount),Gi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Vi=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function lr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function dr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(lr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ur(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&dr(t,i.idPattern));return s?{...s,id:t}:void 0}function Ui(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function pr(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const gr=new Set(T.flatMap(e=>e.route?[pr(e.route)]:[])),hr=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Hi(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return gr.has(r)?s?!!ur(s):!0:hr.some(i=>i.test(r))}const qi=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],fr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],$i=Object.fromEntries(fr.map(e=>[e.path,e.defaultValue]));export{Ri as $,Hi as A,Xs as B,Ct as C,zr as D,Jt as E,fr as F,J as G,_t as H,fi as I,gi as J,Et as K,ur as L,Rs as M,Ks as N,Si as O,Xt as P,bi as Q,Zr as R,A as S,es as T,yi as U,se as V,q as W,Ai as X,ie as Y,re as Z,Pi as _,Je as a,sr as a$,Ci as a0,Mi as a1,Ti as a2,wi as a3,Ei as a4,ki as a5,Jr as a6,rs as a7,Es as a8,ks as a9,qr as aA,Lr as aB,xr as aC,Gr as aD,Wr as aE,Br as aF,Or as aG,Hr as aH,Dr as aI,$r as aJ,ps as aK,Qt as aL,Zt as aM,ui as aN,li as aO,ds as aP,us as aQ,di as aR,Vi as aS,Gi as aT,ir as aU,xi as aV,Li as aW,or as aX,Bi as aY,Di as aZ,Oi as a_,As as aa,ys as ab,ws as ac,_s as ad,ci as ae,ls as af,fs as ag,ns as ah,js as ai,os as aj,cs as ak,Qr as al,Xr as am,H as an,it as ao,dt as ap,ut as aq,X as ar,lt as as,at,st as au,ot as av,ct as aw,Nr as ax,Vr as ay,Ur as az,$i as b,Ni as b0,ar as b1,nr as b2,oi as b3,is as b4,Ii as b5,mi as b6,St as b7,bs as b8,ms as b9,Fi as bA,Zs as bB,Ys as bC,ni as bD,Ut as bE,ii as bF,Ms as bG,Ps as bH,Ts as bI,Cs as bJ,jt as bK,vs as bL,hs as ba,Ss as bb,as as bc,gs as bd,v as be,ts as bf,Yr as bg,$s as bh,xs as bi,Hs as bj,qs as bk,Ns as bl,Vs as bm,Gs as bn,Ws as bo,Os as bp,Ls as bq,zs as br,Ds as bs,Bs as bt,Us as bu,S as bv,tr as bw,_i as bx,vi as by,Wi as bz,qi as c,hi as d,ai as e,Pt as f,It as g,Qs as h,Js as i,ss as j,ft as k,ht as l,ti as m,Ui as n,Is as o,Fs as p,jr as q,Kr as r,ri as s,si as t,rt as u,wt as v,er as w,ei as x,pi as y,K as z};
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./DCq92KiG.js";import{d as mt,g as lt,f as xt,e as kt}from"./Dcuzm8gD.js";import{U as _t,aZ as vt,V as bt,a_ as wt,Y as Tt,b0 as St,b as s,X as R,aW as H,B as $t,r as Mt,d as it}from"./eBfEHUcb.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./7dpPwFPi.js";import{d as mt,g as lt,f as xt,e as kt}from"./Dirmxn0x.js";import{U as _t,aZ as vt,V as bt,a_ as wt,Y as Tt,b0 as St,b as s,X as R,aW as H,B as $t,r as Mt,d as it}from"./BhSvmxU-.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,W;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var X="";W=[];for(N in v[A])this.terminals_[N]&&N>yt&&W.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+W.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:W})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,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:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=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),l.length-1&&(this.yylineno-=l.length-1);var d=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:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(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:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{f as p}from"./C6mS8uZB.js";import{A as s,z as l}from"./pf1qexdH.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./ChUo5Z7l.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
1
+ import{f as p}from"./C6mS8uZB.js";import{A as s,z as l}from"./DizKilK3.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./B265Nxi3.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};