@intent-hq/web 2.383.0 → 2.383.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{BlDljC9y.js → 0PdeE_M-.js} +1 -1
  3. package/web/app/immutable/chunks/{DMDFfHqn.js → 469banqV.js} +3 -3
  4. package/web/app/immutable/chunks/{DWiU4388.js → 6GlvsI2m.js} +1 -1
  5. package/web/app/immutable/chunks/{DdXBqrnq.js → 7GuT70Sz.js} +1 -1
  6. package/web/app/immutable/chunks/{lVh2oAeQ.js → B6qvxAO7.js} +1 -1
  7. package/web/app/immutable/chunks/{CRs9zG2A.js → B8VxRkn_.js} +1 -1
  8. package/web/app/immutable/chunks/{DF2_1gr9.js → BAP-Km9w.js} +1 -1
  9. package/web/app/immutable/chunks/{B2f9w8eB.js → BAzzHP-D.js} +1 -1
  10. package/web/app/immutable/chunks/{C_78iNNC.js → BBws4Cyt.js} +1 -1
  11. package/web/app/immutable/chunks/{CrkMZYjb.js → BCS2G1TZ.js} +1 -1
  12. package/web/app/immutable/chunks/{p9X2tUBM.js → BFgeFHTs.js} +1 -1
  13. package/web/app/immutable/chunks/{eTsHzcIE.js → BI0hvS48.js} +3 -3
  14. package/web/app/immutable/chunks/{BFIcslMA.js → BI3a2AWW.js} +1 -1
  15. package/web/app/immutable/chunks/{Ct_q9q1G.js → BK6a0pzX.js} +1 -1
  16. package/web/app/immutable/chunks/{DlliJA4a.js → BLyGObAP.js} +3 -3
  17. package/web/app/immutable/chunks/{B2kb4xeF.js → BNkpVy97.js} +1 -1
  18. package/web/app/immutable/chunks/{DY0qeQe8.js → BPzekfWN.js} +1 -1
  19. package/web/app/immutable/chunks/{BO_DS0RP.js → BTw9kxtg.js} +1 -1
  20. package/web/app/immutable/chunks/{Bir0Y4gf.js → BXhT5rHA.js} +1 -1
  21. package/web/app/immutable/chunks/{pYQh_Bw_.js → BY9RbRJy.js} +1 -1
  22. package/web/app/immutable/chunks/{AlEhxd2n.js → BYP8ebQS.js} +1 -1
  23. package/web/app/immutable/chunks/{B_LcgbLl.js → BbvEB4jz.js} +1 -1
  24. package/web/app/immutable/chunks/{DliHiH6M.js → BjRQQ_jq.js} +4 -4
  25. package/web/app/immutable/chunks/{hb4NYXGo.js → BkITif4J.js} +1 -1
  26. package/web/app/immutable/chunks/{DLbcryNV.js → BlRYe00B.js} +1 -1
  27. package/web/app/immutable/chunks/{UhL0ohiG.js → BlVYr5cA.js} +1 -1
  28. package/web/app/immutable/chunks/{S8ugWfAx.js → Bq_wOSEp.js} +1 -1
  29. package/web/app/immutable/chunks/{DVROSXw1.js → BtHTHBJp.js} +1 -1
  30. package/web/app/immutable/chunks/{Csc9ETIC.js → BvPbguyx.js} +1 -1
  31. package/web/app/immutable/chunks/{D_ovLyyd.js → BvbTU4IL.js} +1 -1
  32. package/web/app/immutable/chunks/{3xK9OOJy.js → BwhjiNjC.js} +1 -1
  33. package/web/app/immutable/chunks/{DIG1mTAN.js → BwtFad5m.js} +2 -2
  34. package/web/app/immutable/chunks/{Dqdvt4Zr.js → BxVnbYG1.js} +1 -1
  35. package/web/app/immutable/chunks/{BmUPAQa9.js → ByfS7UIX.js} +1 -1
  36. package/web/app/immutable/chunks/{BP4Hm_tD.js → C-O59F9J.js} +2 -2
  37. package/web/app/immutable/chunks/{CuW3cq2w.js → C6Qw0raF.js} +1 -1
  38. package/web/app/immutable/chunks/{DO19lrhU.js → C8JlOzbF.js} +1 -1
  39. package/web/app/immutable/chunks/{jn4zbMQy.js → C9h2rwKF.js} +1 -1
  40. package/web/app/immutable/chunks/{Ba8ctcpl.js → CBkpyV7r.js} +1 -1
  41. package/web/app/immutable/chunks/{baWz1QxB.js → CDAoSo12.js} +1 -1
  42. package/web/app/immutable/chunks/{CFvBUo4R.js → CDCEiDxP.js} +3 -3
  43. package/web/app/immutable/chunks/{L4HdMFBq.js → CDNvYbvS.js} +1 -1
  44. package/web/app/immutable/chunks/{C8HkqBCb.js → CEOBX1Pf.js} +1 -1
  45. package/web/app/immutable/chunks/{DUIwUF5m.js → CGIQkN5K.js} +1 -1
  46. package/web/app/immutable/chunks/{PO_5m99x.js → CHXhxB4Q.js} +1 -1
  47. package/web/app/immutable/chunks/{DE7dSDHO.js → CI9sv_EP.js} +1 -1
  48. package/web/app/immutable/chunks/{CPQ-kfy2.js → CJO6KBmw.js} +1 -1
  49. package/web/app/immutable/chunks/{1mf839wD.js → CJVoHxzN.js} +1 -1
  50. package/web/app/immutable/chunks/{DWWC1JsA.js → CKXQrY3X.js} +1 -1
  51. package/web/app/immutable/chunks/{IQ13JH5A.js → CL-lzPGU.js} +1 -1
  52. package/web/app/immutable/chunks/{DPA45OJk.js → CaNxJFJ1.js} +1 -1
  53. package/web/app/immutable/chunks/{CXS2Ba3S.js → CbO3oDHw.js} +1 -1
  54. package/web/app/immutable/chunks/{BWGnuS1v.js → CeHXXIxE.js} +1 -1
  55. package/web/app/immutable/chunks/{CYtPXqgK.js → CiSIqqOJ.js} +1 -1
  56. package/web/app/immutable/chunks/{lwlI9u_5.js → CjpxPpfy.js} +1 -1
  57. package/web/app/immutable/chunks/{Bu7LYnzn.js → Ck2X3Rvg.js} +1 -1
  58. package/web/app/immutable/chunks/{cebxNJuC.js → Ckb6le-m.js} +4 -4
  59. package/web/app/immutable/chunks/{BJ_CKcUH.js → CkmRZ_MC.js} +1 -1
  60. package/web/app/immutable/chunks/{C5yhcKTW.js → CnAbYuPp.js} +1 -1
  61. package/web/app/immutable/chunks/{D3O8Vtuw.js → CnqJXAKo.js} +1 -1
  62. package/web/app/immutable/chunks/{8r75D0ru.js → Cofxvpdb.js} +1 -1
  63. package/web/app/immutable/chunks/{DEVX5wOm.js → CrFyLBfi.js} +2 -2
  64. package/web/app/immutable/chunks/{D9XKwVJX.js → CxFOqPFP.js} +3 -3
  65. package/web/app/immutable/chunks/{CPTZJWC9.js → Cxf6ur9F.js} +1 -1
  66. package/web/app/immutable/chunks/{Bn880vDO.js → D-YGlaxj.js} +1 -1
  67. package/web/app/immutable/chunks/{Cs2lHsyA.js → D-dukRlA.js} +1 -1
  68. package/web/app/immutable/chunks/{DFcppVBl.js → D3C3nNLs.js} +1 -1
  69. package/web/app/immutable/chunks/{CAgnBDaV.js → D4FXvK9L.js} +3 -3
  70. package/web/app/immutable/chunks/{jcl0zObl.js → DDJ_XVek.js} +2 -2
  71. package/web/app/immutable/chunks/{DMQmPhTl.js → DEI5RmgA.js} +1 -1
  72. package/web/app/immutable/chunks/{BG9tvqwj.js → DJs4vEjF.js} +1 -1
  73. package/web/app/immutable/chunks/{W2WLehNu.js → DME_6OFx.js} +1 -1
  74. package/web/app/immutable/chunks/{D5xMHmv3.js → DMlkDPxV.js} +1 -1
  75. package/web/app/immutable/chunks/{CEgeN2ws.js → DOUbieNj.js} +1 -1
  76. package/web/app/immutable/chunks/{DIFhl0he.js → DOhJfAZG.js} +1 -1
  77. package/web/app/immutable/chunks/{B5M0SkuR.js → DPZcepbV.js} +1 -1
  78. package/web/app/immutable/chunks/{BtTA7CNV.js → DPyomP91.js} +1 -1
  79. package/web/app/immutable/chunks/{CuewocoW.js → DPzOIlu9.js} +1 -1
  80. package/web/app/immutable/chunks/{BJWt3PU_.js → DSAj_NCN.js} +1 -1
  81. package/web/app/immutable/chunks/{eQVXRlbn.js → DUhA4bgN.js} +1 -1
  82. package/web/app/immutable/chunks/{BA-rwlhs.js → DaaqgDka.js} +1 -1
  83. package/web/app/immutable/chunks/{wUSGg9l9.js → Ddq8SBEz.js} +1 -1
  84. package/web/app/immutable/chunks/{DOEI9gYY.js → DduCxuVq.js} +1 -1
  85. package/web/app/immutable/chunks/{DpHn84BV.js → Dhzl8ugO.js} +1 -1
  86. package/web/app/immutable/chunks/{COhRCR9P.js → Di8eJPr0.js} +2 -2
  87. package/web/app/immutable/chunks/{DlJZrxef.js → Div5PXT-.js} +2 -2
  88. package/web/app/immutable/chunks/{puJFvQs5.js → DjHhZWUX.js} +1 -1
  89. package/web/app/immutable/chunks/{ChTVnFH2.js → Djg1-55Y.js} +1 -1
  90. package/web/app/immutable/chunks/{Cmq0pZIQ.js → DlEmrQXN.js} +2 -2
  91. package/web/app/immutable/chunks/{CMrw-y4l.js → Dm7KqEFT.js} +13 -13
  92. package/web/app/immutable/chunks/{BsN2abqQ.js → DmXAUF0G.js} +1 -1
  93. package/web/app/immutable/chunks/{k0JmlCVk.js → DmaEU7hb.js} +1 -1
  94. package/web/app/immutable/chunks/{C0I_aIej.js → DqMqjmmT.js} +2 -2
  95. package/web/app/immutable/chunks/{sdV4t8T0.js → Dr0V5Z_Q.js} +1 -1
  96. package/web/app/immutable/chunks/{BETzmOvF.js → DrHfN5GT.js} +1 -1
  97. package/web/app/immutable/chunks/{BfvZe-kN.js → DsT1iX_Q.js} +6 -6
  98. package/web/app/immutable/chunks/{BSKf8bnG.js → Dsf8OM9-.js} +1 -1
  99. package/web/app/immutable/chunks/{BUQUek8g.js → Du_rNq8q.js} +1 -1
  100. package/web/app/immutable/chunks/{DK-ttWlY.js → DwImHc9s.js} +1 -1
  101. package/web/app/immutable/chunks/{DvSURWC2.js → Dzk9iuw9.js} +3 -3
  102. package/web/app/immutable/chunks/{9bukzQMK.js → Fdd73CJo.js} +1 -1
  103. package/web/app/immutable/chunks/{DpyfxjgC.js → H9IjxeQk.js} +1 -1
  104. package/web/app/immutable/chunks/{DGa13zF2.js → KH7BHXXb.js} +1 -1
  105. package/web/app/immutable/chunks/{U_OQY9n3.js → KSLBBJRy.js} +1 -1
  106. package/web/app/immutable/chunks/{BAOaoX22.js → M-TVgx-R.js} +1 -1
  107. package/web/app/immutable/chunks/{BeNn_MBw.js → MI7EtNv0.js} +1 -1
  108. package/web/app/immutable/chunks/{CtNkh9GR.js → MQBseMlG.js} +1 -1
  109. package/web/app/immutable/chunks/{CE7VCun2.js → P-T74LCo.js} +3 -3
  110. package/web/app/immutable/chunks/{Bz7R1ahj.js → Rx5mQeGT.js} +4 -4
  111. package/web/app/immutable/chunks/{BwG2vfja.js → Su2XS_Ru.js} +1 -1
  112. package/web/app/immutable/chunks/{9gSjzhYc.js → T8d_aLDP.js} +1 -1
  113. package/web/app/immutable/chunks/{duDdSCAT.js → TiuNiN7j.js} +1 -1
  114. package/web/app/immutable/chunks/{DjxLojU4.js → W7maz5hp.js} +1 -1
  115. package/web/app/immutable/chunks/{DeHvIzqj.js → WVvubfLN.js} +2 -2
  116. package/web/app/immutable/chunks/{BURZJh0r.js → XHPDEELd.js} +1 -1
  117. package/web/app/immutable/chunks/{pwJelZzH.js → Zx9hB63s.js} +1 -1
  118. package/web/app/immutable/chunks/{wIMcEpgB.js → azpKokvz.js} +1 -1
  119. package/web/app/immutable/chunks/{Db3Wob9h.js → bF6PpsOD.js} +1 -1
  120. package/web/app/immutable/chunks/{CxOmNieJ.js → h06E2ICA.js} +1 -1
  121. package/web/app/immutable/chunks/{4BrIaRe_.js → i_QPvq4q.js} +1 -1
  122. package/web/app/immutable/chunks/{BX-LCSle.js → nImP7yvb.js} +1 -1
  123. package/web/app/immutable/chunks/{Bs2WE18g.js → nbomrtth.js} +1 -1
  124. package/web/app/immutable/chunks/{M5Dwuu-X.js → oOhxfFIU.js} +1 -1
  125. package/web/app/immutable/chunks/{0HRWclfL.js → q6F-1__g.js} +1 -1
  126. package/web/app/immutable/chunks/{68Tuqjp3.js → x63yRqVE.js} +1 -1
  127. package/web/app/immutable/chunks/{DSbNJBwA.js → yaHL2zPw.js} +1 -1
  128. package/web/app/immutable/chunks/{nXfD7jHz.js → zHu1d_6X.js} +2 -2
  129. package/web/app/immutable/entry/{app.PfV9Bd5g.js → app.CgYQGiwi.js} +2 -2
  130. package/web/app/immutable/entry/start.C_kFKw1E.js +1 -0
  131. package/web/app/immutable/nodes/{0.N3QFhxpx.js → 0.DOOOI3Bo.js} +1 -1
  132. package/web/app/immutable/nodes/{1.Cuki-Q-c.js → 1.DCbWOuyY.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CzZBTiyD.js → 10.DkhUAhty.js} +4 -4
  134. package/web/app/immutable/nodes/{11.Cc53X5P2.js → 11.DDwWhO0Z.js} +1 -1
  135. package/web/app/immutable/nodes/{15.D2GMHiSb.js → 15.Dw1bH9Zl.js} +1 -1
  136. package/web/app/immutable/nodes/{19.DvFJngD4.js → 19.BDZr-fpl.js} +2 -2
  137. package/web/app/immutable/nodes/{2.B94-26jU.js → 2.BXcXLNQd.js} +4 -4
  138. package/web/app/immutable/nodes/{3.D7lbuuWp.js → 3.DSd1hRZn.js} +1 -1
  139. package/web/app/immutable/nodes/{4.YSZzuDIT.js → 4.BkWwx_VF.js} +1 -1
  140. package/web/app/immutable/nodes/{5.ymicNL_Y.js → 5.y9tMc2yb.js} +1 -1
  141. package/web/app/immutable/nodes/{6.CtS0PFqR.js → 6.BosoYTZK.js} +1 -1
  142. package/web/app/immutable/nodes/{7.BVAyauMB.js → 7.BX-dUHAQ.js} +1 -1
  143. package/web/app/immutable/nodes/{8.CHlBOO6u.js → 8.DUR07SoM.js} +1 -1
  144. package/web/app/immutable/nodes/{9.CNAqB0x1.js → 9.Cw56XQ1G.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.kviRYMjm.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/lwlI9u_5.js","/app/immutable/chunks/cebxNJuC.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DVROSXw1.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.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/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/p9X2tUBM.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/COhRCR9P.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DKHY8q_S.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/EK6zOAHM.js","/app/immutable/chunks/DCK8dPAL.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/Ba8ctcpl.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/fiz8N_zQ.js","/app/immutable/chunks/CAvYeStH.js","/app/immutable/chunks/BAKPnd3w.js","/app/immutable/chunks/A9niI_uA.js","/app/immutable/chunks/Co4vj0dC.js","/app/immutable/chunks/QeBH-DWE.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/lJeex2Gh.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/CJ4Z96pe.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/c5QZsH9t.js","/app/immutable/chunks/Bsh6nUhU.js","/app/immutable/chunks/CDjpuJh0.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/CHLX1QZz.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/CU5jKGma.js","/app/immutable/chunks/DIG1mTAN.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/BFEzojY2.js","/app/immutable/chunks/Cf4fmkfL.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css"])))=>i.map(i=>d[i]);
2
- import{_ as Z}from"./C0QTy0Sy.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./cebxNJuC.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./lwlI9u_5.js");return{captureNodeSizes:b}},__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,35,36,37,38,39,40,41,42,43,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,75,76,77,78]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CjpxPpfy.js","/app/immutable/chunks/Ckb6le-m.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BtHTHBJp.js","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.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/CrD0jtXE.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/BFgeFHTs.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/Di8eJPr0.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DKHY8q_S.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/EK6zOAHM.js","/app/immutable/chunks/DCK8dPAL.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/C6mS8uZB.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/CBkpyV7r.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/fiz8N_zQ.js","/app/immutable/chunks/CAvYeStH.js","/app/immutable/chunks/BAKPnd3w.js","/app/immutable/chunks/A9niI_uA.js","/app/immutable/chunks/Co4vj0dC.js","/app/immutable/chunks/QeBH-DWE.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/lJeex2Gh.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/CJ4Z96pe.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/c5QZsH9t.js","/app/immutable/chunks/Bsh6nUhU.js","/app/immutable/chunks/CDjpuJh0.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/CHLX1QZz.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/CU5jKGma.js","/app/immutable/chunks/BwtFad5m.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/BFEzojY2.js","/app/immutable/chunks/Cf4fmkfL.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css"])))=>i.map(i=>d[i]);
2
+ import{_ as Z}from"./C0QTy0Sy.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./Ckb6le-m.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./CjpxPpfy.js");return{captureNodeSizes:b}},__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,35,36,37,38,39,40,41,42,43,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,75,76,77,78]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
@@ -1,4 +1,4 @@
1
- import{k as qa,s as fa}from"./3xK9OOJy.js";import{p as ma,g as Ct,I as Wa,X as Ka,e as Nn}from"./B6S6VNu7.js";import{aB as Qa,cW as Ga,A as Va,a_ as xn,bZ as Xa,v as Ya}from"./DVROSXw1.js";import{bm as c,t as Pt,bo as w,bw as Tt,b as Rt,bq as qn,bs as Re,br as Ja}from"./C0QTy0Sy.js";import{bo as Wn,bs as Ot,a5 as O,bl as U,bS as b,bA as $,b_ as x,aD as e,W as l,ay as H,a7 as Oe,bO as L,bn as Lt,c9 as u,aA as k,aB as _,ca as ze,bH as h,b$ as Kt,bV as le,cd as Mt,br as va,be as un,c5 as Za,bi as En,bj as er,bf as hn,am as ta,ax as na,ai as tr,aj as nr,c0 as ar}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{t as _a}from"./CrD0jtXE.js";import{e as rr}from"./BFEzojY2.js";import{s as q,g as en,f as ve,b as sr}from"./7UPrdiE9.js";import{a as or,n as ha}from"./DLwWVKiF.js";import{r as ir,o as lr,A as aa,L as dr}from"./nXfD7jHz.js";import{t as Dn}from"./DAsc1V4f.js";import{R as ra}from"./BmTMWrby.js";import{I as ba}from"./BAKPnd3w.js";import"./A9niI_uA.js";import{aO as wn,cN as ur,ax as cr,aM as pr,cH as gr,cI as fr,as as mr,au as vr,aC as _r,aI as hr,s as br,O as wr,e8 as kr,X as xr,cy as yr,c4 as $r}from"./BaujsV9k.js";import{Jv as J,cp as zn,cn as wa,cq as kn,ru as Ar,DU as Sr,fU as ka,DZ as Ir,bE as Cr,A3 as Pr,mO as sa,uq as Tr,ct as Rr,u$ as oa,nK as Or,DE as Lr,DX as Nr,cb as Er}from"./tr-2J8Mf.js";import{A as Dr,b as Mr}from"./BYq9VtBF.js";import{y as Fr}from"./Bqd7fdCF.js";import{l as zr}from"./BcpfdNy8.js";import{f as ia}from"./DE7dSDHO.js";import{h as Br,g as jr}from"./DA5opfEp.js";import{o as Hr,S as Ur}from"./CFvBUo4R.js";import"./CJ4Z96pe.js";import{ae as qr,ah as Wr,f as Mn,a1 as Kr}from"./FzlZUztb.js";import{h as Qr,F as la}from"./DCRuihKm.js";import"./lJeex2Gh.js";import{C as Gr,k as Vr,j as Xr,i as Yr}from"./fiz8N_zQ.js";import{L as Jr}from"./CmrjfWYI.js";import{c as de}from"./CUkDMZwP.js";import{c as Bn,b as da,d as jn,a as Hn,A as xa}from"./jn4zbMQy.js";import{l as Wt,b as Zr}from"./CE7dsja4.js";import{F as es,bc as ts}from"./p9X2tUBM.js";import{D as ns}from"./C4JbSg3f.js";import{b as as}from"./No1eCFy3.js";import{T as rs}from"./CRZZ_hOy.js";import"./BWYuMy_r.js";import{cl as ya,cP as ss,cO as os,bR as is,M as ls,F as yn,b5 as ds,au as us,aK as cs,aG as ps,cT as gs,be as fs,aA as ms,aL as vs,b1 as _s,ah as ua,a8 as hs,c6 as bs,ag as ws,cF as ks,an as xs,cS as ys,aD as $s}from"./U9jJmfYa.js";import{b as As}from"./Dn334wJv.js";import"./QeBH-DWE.js";import{S as bn}from"./tZyAiGvb.js";import{E as Ss}from"./c5QZsH9t.js";import"./Bsh6nUhU.js";import{f as Is}from"./DvUGkiYP.js";import{P as Cs}from"./D51XIZYq.js";import{b as Ps,P as Ts}from"./BP5uGGO_.js";import{h as Rs,H as Os,g as Ls}from"./eElW3aeh.js";const Ns=80,Es=10,Ds=new Qa(Ga,{renderer:{html({text:a}){return Va(a)},image({tokens:a}){return this.parser.parseInline(a)}}});function Kn(a){const n=document.createElement("template");n.innerHTML=Ds.parseInline(a,{async:!1});for(const o of n.content.querySelectorAll("br"))o.replaceWith(" ");return(n.content.textContent??"").replace(/\s+/g," ").trim()}function Ft(a){return a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`+([^`]*?)`+/g,"$1").replace(/<[^>]+>/g,"").replace(/\\([\\`*_[\]{}()#+\-.!>])/g,"$1").replace(/[*~]/g,"").replace(/(^|[^A-Za-z0-9])_+/g,"$1").replace(/_+([^A-Za-z0-9]|$)/g,"$1").replace(/\s+/g," ").trim()}function Un(a,n){return a.slice(n).replace(/^(?:[ \t]*(?:\r\n|\n|\r))+/,"")}function Sn(a,n){return!n||n.length>Ns||n.split(/\s+/).length>Es||/[.!?;]$/.test(n)?!1:!/^[ \t]*(?:[-+*][ \t]+|\d+[.)][ \t]+|>|```|~~~|\|)/.test(a)}function tl(a){const o=a.trim().match(/^\*\*([^\r\n]+)\*\*$/);if(!o)return null;const i=Ft(o[1]);return Sn(o[0],i)?i:null}function Qn(a,n=!1,o=!0){const i=a.match(/^(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",r=a.slice(i.length).match(/^\*\*([^\r\n]+)\*\*[ \t]*(?:(?:\r\n|\n|\r)|$)/);if(!r)return null;if(n){const v=r[1],f=v.match(/\\+$/)?.[0].length??0;if(v!==v.trim()||v.includes("**")||v.startsWith("*")||v.endsWith("*")||f%2!==0)return null}const p=Ft(r[1]);return Sn(r[0],p)?{title:n&&o?Kn(r[1]):p,body:Un(a,i.length+r[0].length)}:null}function ca(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0),d=i.heading?{body:i.body}:Qn(o,!0,!1);if(!d)return null;n.push(o.slice(0,o.length-d.body.length)),o=d.body}return n.length?n:null}function nl(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0,Kn),d=i.heading?{title:i.heading,body:i.body}:Qn(o,!0);if(!d)return null;n.push(d.title),o=d.body}return n.length?n:null}function al(a){const n=Fs(a),o=[];let i=a;for(n.heading&&(o.push({title:n.heading,body:""}),i=n.body);i;){const d=Qn(i);if(!d||d.body.length>=i.length)break;o.push({title:d.title,body:""}),i=d.body}if(o.length===0){const d=a.trim(),r=Ft(d);return!d.includes(`
1
+ import{k as qa,s as fa}from"./BwhjiNjC.js";import{p as ma,g as Ct,I as Wa,X as Ka,e as Nn}from"./B6S6VNu7.js";import{aB as Qa,cW as Ga,A as Va,a_ as xn,bZ as Xa,v as Ya}from"./BtHTHBJp.js";import{bm as c,t as Pt,bo as w,bw as Tt,b as Rt,bq as qn,bs as Re,br as Ja}from"./C0QTy0Sy.js";import{bo as Wn,bs as Ot,a5 as O,bl as U,bS as b,bA as $,b_ as x,aD as e,W as l,ay as H,a7 as Oe,bO as L,bn as Lt,c9 as u,aA as k,aB as _,ca as ze,bH as h,b$ as Kt,bV as le,cd as Mt,br as va,be as un,c5 as Za,bi as En,bj as er,bf as hn,am as ta,ax as na,ai as tr,aj as nr,c0 as ar}from"./3SdAC2_C.js";import{i as M}from"./bhKPSdq4.js";import{t as _a}from"./CrD0jtXE.js";import{e as rr}from"./BFEzojY2.js";import{s as q,g as en,f as ve,b as sr}from"./7UPrdiE9.js";import{a as or,n as ha}from"./DLwWVKiF.js";import{r as ir,o as lr,A as aa,L as dr}from"./zHu1d_6X.js";import{t as Dn}from"./DAsc1V4f.js";import{R as ra}from"./BmTMWrby.js";import{I as ba}from"./BAKPnd3w.js";import"./A9niI_uA.js";import{aO as wn,cN as ur,ax as cr,aM as pr,cH as gr,cI as fr,as as mr,au as vr,aC as _r,aI as hr,s as br,O as wr,e8 as kr,X as xr,cy as yr,c4 as $r}from"./BaujsV9k.js";import{Jv as J,cp as zn,cn as wa,cq as kn,ru as Ar,DU as Sr,fU as ka,DZ as Ir,bE as Cr,A3 as Pr,mO as sa,uq as Tr,ct as Rr,u$ as oa,nK as Or,DE as Lr,DX as Nr,cb as Er}from"./tr-2J8Mf.js";import{A as Dr,b as Mr}from"./BYq9VtBF.js";import{y as Fr}from"./Bqd7fdCF.js";import{l as zr}from"./BcpfdNy8.js";import{f as ia}from"./CI9sv_EP.js";import{h as Br,g as jr}from"./DA5opfEp.js";import{o as Hr,S as Ur}from"./CDCEiDxP.js";import"./CJ4Z96pe.js";import{ae as qr,ah as Wr,f as Mn,a1 as Kr}from"./FzlZUztb.js";import{h as Qr,F as la}from"./DCRuihKm.js";import"./lJeex2Gh.js";import{C as Gr,k as Vr,j as Xr,i as Yr}from"./fiz8N_zQ.js";import{L as Jr}from"./CmrjfWYI.js";import{c as de}from"./CUkDMZwP.js";import{c as Bn,b as da,d as jn,a as Hn,A as xa}from"./C9h2rwKF.js";import{l as Wt,b as Zr}from"./CE7dsja4.js";import{F as es,bc as ts}from"./BFgeFHTs.js";import{D as ns}from"./C4JbSg3f.js";import{b as as}from"./No1eCFy3.js";import{T as rs}from"./CRZZ_hOy.js";import"./BWYuMy_r.js";import{cl as ya,cP as ss,cO as os,bR as is,M as ls,F as yn,b5 as ds,au as us,aK as cs,aG as ps,cT as gs,be as fs,aA as ms,aL as vs,b1 as _s,ah as ua,a8 as hs,c6 as bs,ag as ws,cF as ks,an as xs,cS as ys,aD as $s}from"./U9jJmfYa.js";import{b as As}from"./Dn334wJv.js";import"./QeBH-DWE.js";import{S as bn}from"./tZyAiGvb.js";import{E as Ss}from"./c5QZsH9t.js";import"./Bsh6nUhU.js";import{f as Is}from"./DvUGkiYP.js";import{P as Cs}from"./D51XIZYq.js";import{b as Ps,P as Ts}from"./BP5uGGO_.js";import{h as Rs,H as Os,g as Ls}from"./eElW3aeh.js";const Ns=80,Es=10,Ds=new Qa(Ga,{renderer:{html({text:a}){return Va(a)},image({tokens:a}){return this.parser.parseInline(a)}}});function Kn(a){const n=document.createElement("template");n.innerHTML=Ds.parseInline(a,{async:!1});for(const o of n.content.querySelectorAll("br"))o.replaceWith(" ");return(n.content.textContent??"").replace(/\s+/g," ").trim()}function Ft(a){return a.replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]+)\]\([^)]*\)/g,"$1").replace(/`+([^`]*?)`+/g,"$1").replace(/<[^>]+>/g,"").replace(/\\([\\`*_[\]{}()#+\-.!>])/g,"$1").replace(/[*~]/g,"").replace(/(^|[^A-Za-z0-9])_+/g,"$1").replace(/_+([^A-Za-z0-9]|$)/g,"$1").replace(/\s+/g," ").trim()}function Un(a,n){return a.slice(n).replace(/^(?:[ \t]*(?:\r\n|\n|\r))+/,"")}function Sn(a,n){return!n||n.length>Ns||n.split(/\s+/).length>Es||/[.!?;]$/.test(n)?!1:!/^[ \t]*(?:[-+*][ \t]+|\d+[.)][ \t]+|>|```|~~~|\|)/.test(a)}function tl(a){const o=a.trim().match(/^\*\*([^\r\n]+)\*\*$/);if(!o)return null;const i=Ft(o[1]);return Sn(o[0],i)?i:null}function Qn(a,n=!1,o=!0){const i=a.match(/^(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",r=a.slice(i.length).match(/^\*\*([^\r\n]+)\*\*[ \t]*(?:(?:\r\n|\n|\r)|$)/);if(!r)return null;if(n){const v=r[1],f=v.match(/\\+$/)?.[0].length??0;if(v!==v.trim()||v.includes("**")||v.startsWith("*")||v.endsWith("*")||f%2!==0)return null}const p=Ft(r[1]);return Sn(r[0],p)?{title:n&&o?Kn(r[1]):p,body:Un(a,i.length+r[0].length)}:null}function ca(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0),d=i.heading?{body:i.body}:Qn(o,!0,!1);if(!d)return null;n.push(o.slice(0,o.length-d.body.length)),o=d.body}return n.length?n:null}function nl(a){const n=[];let o=a;for(;o.trim();){const i=Gn(o,!0,Kn),d=i.heading?{title:i.heading,body:i.body}:Qn(o,!0);if(!d)return null;n.push(d.title),o=d.body}return n.length?n:null}function al(a){const n=Fs(a),o=[];let i=a;for(n.heading&&(o.push({title:n.heading,body:""}),i=n.body);i;){const d=Qn(i);if(!d||d.body.length>=i.length)break;o.push({title:d.title,body:""}),i=d.body}if(o.length===0){const d=a.trim(),r=Ft(d);return!d.includes(`
2
2
  `)&&Sn(d,r)?[{title:r,body:""}]:d?[{title:null,body:d}]:[]}return o[o.length-1].body=i.trim(),o}function Ms(a){const n=a.replace(/^ {0,3}/,"");return!/^(?:\s|>|`{3}|~{3}|(?:[-+*]|\d+[.)])(?:[ \t]|$)|#{1,6}(?:[ \t]|$)|<|\[[^\]]*\]:)/.test(n)&&!/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})$/.test(n)}function Gn(a,n=!1,o=Ft){const i=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",d=a.slice(i.length);if(n&&/^(?: {4}| {0,3}\t)/.test(d))return{heading:null,body:a};const r=d.match(/^[ \t]{0,3}#{1,6}[ \t]+([^\r\n]*?)(?:[ \t]+#+)?[ \t]*(?:\r\n|\n|\r|$)/);if(r&&Ft(r[1]))return{heading:o(r[1]),body:Un(a,i.length+r[0].length)};const p=d.match(/^([^\r\n]+)(?:\r\n|\n|\r)([ \t]{0,3})(?:=+|-+)[ \t]*(?:\r\n|\n|\r|$)/);return p&&(!n||Ms(p[1])&&!p[2].includes(" "))&&Ft(p[1])?{heading:o(p[1]),body:Un(a,i.length+p[0].length)}:{heading:null,body:a}}function Fs(a,{preserveInlineText:n=!1}={}){const o=n?Kn:Ft,i=Gn(a,!1,o);if(i.heading)return i;const d=a.match(/^(?:\uFEFF)?(?:[ \t]*(?:\r\n|\n|\r))*/)?.[0]??"",p=a.slice(d.length).match(/^([^\r\n]+)(?:\r\n|\n|\r)(?:[ \t]*(?:\r\n|\n|\r))+/);if(p){const v=Ft(p[1]),f=a.slice(d.length+p[0].length);if(f.trim()&&Sn(p[1],v))return{heading:o(p[1]),body:f}}return{heading:null,body:a}}const Qt="[--operational-row-inline-padding:var(--chat-operational-row-inline-padding,0.5rem)] [--operational-leading-slot-size:1.25rem] [--operational-leading-half-slot-size:0.625rem] [--operational-leading-gap:var(--chat-operational-leading-gap,0.5rem)]",rl="type-body font-family-child font-normal text-muted-foreground",sl=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ol=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1.5`,il=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))] pt-1`,ll=`${Qt} relative min-w-0 max-w-full`,dl=`${Qt} min-w-0 max-w-full pl-[calc(var(--operational-row-inline-padding)+var(--operational-leading-slot-size)+var(--operational-leading-gap))]`,ul=`${Qt} operational-group-child-row ml-2 min-w-0 w-[calc(100%-0.5rem)] max-w-[calc(100%-0.5rem)]`,cl="pt-6",pl="text-muted-foreground",gl="text-muted-foreground",$a="font-normal text-muted-foreground",fl="tool-call-container group relative block w-full min-w-0 max-w-full overflow-hidden type-body font-family-child font-normal text-muted-foreground",ml="h-[16px]! w-[16px]! shrink-0",vl=`${Qt} relative grid h-7 w-full min-w-0 max-w-full grid-cols-[var(--operational-leading-slot-size)_minmax(0,1fr)_auto] items-center gap-[var(--operational-leading-gap)] overflow-hidden rounded-md px-[var(--operational-row-inline-padding)] type-body transition-colors duration-[var(--motion-fast)] motion-reduce:transition-none`,_l=`a11y-ignore pointer-events-none flex size-[var(--operational-leading-slot-size)] min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center [&_svg]:size-[16px]! ${$a}`,hl=`type-body block min-w-0 max-w-full truncate overflow-hidden text-ellipsis whitespace-nowrap border-0 bg-transparent p-0 text-left ${$a}`,bl="type-body flex min-w-0 shrink-0 items-center gap-1 whitespace-nowrap",wl="h-[16px]! w-[16px]! shrink-0 opacity-60 transition-transform duration-[var(--motion-fast)] motion-reduce:transition-none";function kl(a){return qa(a,{axis:"y",duration:ma()?0:150})}function cn(a){return a.type==="thinking"||a.type==="tool_use"||a.type==="content_group"}function xl(a){const n=a?.[0];return!n||cn(n)?"":"pt-4"}function yl(a,n,o=()=>!0){const i=a[n];if(!i||!o(i)||!cn(i))return!1;let d=n-1;for(;d>=0&&!o(a[d]);)d-=1;return d>=0&&cn(a[d])}function $l(a,n,o=()=>!0,i=!1){const d=a[n];if(!d||!o(d))return"";let r=n-1;for(;r>=0&&!o(a[r]);)r-=1;if(r<0)return"";const p=a[r];if(p.type==="thinking"&&d.type==="thinking")return i||ca(p.text??p.content??"")!==null&&ca(d.text??d.content??"")!==null?"":"pt-14";const v=cn(p),f=cn(d);return v&&f?"":p.type==="thinking"&&!f?"pt-6":v||f?"pt-4":"pt-1"}const Al="shrink-0 whitespace-nowrap text-ui text-subtle focus-visible:outline-none focus-visible:text-foreground";function zs(a){if(a?.status==="halted")return c.agent_node_halted_label();if(a?.status==="resuming")return c.agent_node_resuming_label();if(a?.placement?.target==="remote"||Fr(a?.placement?.target)){if(a.placementError)return c.remoteAgent_status_failed();if(a.cloudStart)return c.remoteAgent_status_starting();if(a.effectiveIsolation==="pending")return a.setup?.state==="pending"?c.remoteAgent_status_preparingCheckout():a.setup?.state==="running"?c.remoteAgent_status_runningSetup():c.remoteAgent_status_starting()}if(a?.placement&&a.effectiveIsolation==="pending")return c.agent_node_provisioning_label()}var Bs=_('<span class="owner-fill block h-full svelte-sxf8s9"></span>'),js=_('<span class="shrink-0 text-xs text-muted-foreground"> </span>'),Hs=_('<span class="flex items-center gap-2"><span class="group-key size-1.5 shrink-0 rounded-full svelte-sxf8s9"></span> <span class="min-w-0 flex-1"> </span> <!> <span> </span></span>'),Us=_('<dd class="col-span-2 pl-[1.125rem] text-xs text-muted-foreground wrap-anywhere"> </dd>'),qs=_(`<div class="grid grid-cols-[1fr_auto] items-baseline gap-x-3 py-0.5 text-sm"><dt class="relative min-w-0 pl-[1.125rem] wrap-anywhere before:absolute before:top-2 before:left-0 before:size-1 before:rounded-full before:bg-muted-foreground before:content-['']"> </dt> <dd> </dd> <!></div>`),Ws=_('<dl class="ml-3.5 text-foreground"></dl>'),Fn=_("<!> <!>",1),Ks=_('<span class="flex items-center gap-2"><span class="min-w-0 flex-1"> </span> <span class="shrink-0 tabular-nums text-muted-foreground"> </span></span>'),Qs=_('<div class="min-w-0"><dt class="truncate text-sm text-foreground"> </dt> <dd class="text-xs text-muted-foreground wrap-anywhere"> </dd></div>'),Gs=_('<dl class="ml-3.5 flex flex-col gap-2"></dl>'),Vs=_('<section class="min-w-0" data-testid="prompt-breakdown"><div class="mb-3 flex items-baseline justify-between gap-3"><h3 class="text-sm font-medium"> </h3> <span class="shrink-0 text-sm tabular-nums text-muted-foreground"> </span></div> <div class="owner-strip mb-2 flex h-1.5 w-full overflow-hidden svelte-sxf8s9" role="img"></div> <!></section>');function Aa(a,n){const o=Wn();if(new.target)return Pt({component:Aa,...a});Ot(n,!0);let i=w(n,"breakdown",7);const d="type-body font-normal text-foreground data-[state=open]:font-normal";function r(T){return Zr(T,{maximumFractionDigits:T<1e4?1:0})}function p(T){return T==="native"?c.agent_contextBreakdown_owner_native_label():T==="intent"?c.agent_contextBreakdown_owner_intent_label():c.agent_contextBreakdown_owner_user_label()}const v=u(()=>i().owners.map(T=>c.agent_contextBreakdown_ownerShare_label({owner:p(T.owner),tokens:r(T.estTokens)})).join(", "));var f={get breakdown(){return i()},set breakdown(T){i(T),k()},$set:Tt,$on:(T,m)=>Rt(n,T,m)},S=Vs(),y=O(S),g=O(y),E=U(g,!0),F=b(g,2),Ce=U(F,!0);$(y);var D=b(y,2);Ct(D,21,()=>i().owners,T=>T.owner,(T,m)=>{var me=Bs();let ue;x(()=>{q(me,"data-owner",e(m).owner),ue=en(me,"",ue,{"flex-grow":e(m).share})}),l(T,me)}),$(D);var P=b(D,2);return de(P,()=>xa,(T,m)=>{m(T,{type:"multiple",children:(me,ue)=>{var R=Fn(),_e=H(R);Ct(_e,17,()=>i().groups,pe=>pe.kind,(pe,G)=>{var W=Oe(),ne=H(W);de(ne,()=>Bn,(ge,Fe)=>{Fe(ge,{get value(){return e(G).kind},get"data-prompt-group"(){return e(G).kind},children:(ot,Q)=>{var I=Fn(),ae=H(I);de(ae,()=>da,(he,N)=>{N(he,{level:4,children:(Le,Y)=>{var K=Oe(),Z=H(K);de(Z,()=>jn,(V,oe)=>{oe(V,{inset:!1,class:d,children:(ee,Ne)=>{var be=Hs(),je=O(be),et=b(je,2),ut=U(et,!0),tt=b(et,2);{var at=ct=>{var Nt=js(),yt=U(Nt,!0);x(X=>L(yt,X),[()=>c.agent_contextBreakdown_notCounted_label()]),l(ct,Nt)};M(tt,ct=>{e(G).kind==="native"&&ct(at)})}var Ee=b(tt,2),Gt=U(Ee,!0);$(be),x((ct,Nt)=>{q(je,"data-kind",e(G).kind),L(ut,ct),ve(Ee,1,`shrink-0 tabular-nums ${e(G).kind==="native"?"text-muted-foreground":""}`),L(Gt,Nt)},[()=>p(e(G).kind),()=>r(e(G).estTokens)]),l(ee,be)},$$slots:{default:!0}})}),l(Le,K)},$$slots:{default:!0}})});var Be=b(ae,2);de(Be,()=>Hn,(he,N)=>{N(he,{inset:!1,children:(Le,Y)=>{var K=Ws();Ct(K,21,()=>e(G).rows,Z=>Z.key,(Z,V)=>{var oe=qs(),ee=O(oe),Ne=U(ee,!0),be=b(ee,2),je=U(be,!0),et=b(be,2);{var ut=tt=>{var at=Us(),Ee=U(at,!0);x(()=>L(Ee,e(V).hint)),l(tt,at)};M(et,tt=>{e(V).hint&&tt(ut)})}$(oe),x(tt=>{L(Ne,e(V).label),ve(be,1,`tabular-nums ${e(V).counted?"":"text-muted-foreground"}`),L(je,tt)},[()=>r(e(V).estTokens)]),l(Z,oe)}),$(K),l(Le,K)},$$slots:{default:!0}})}),l(ot,I)},$$slots:{default:!0}})}),l(pe,W)});var ce=b(_e,2);{var xe=pe=>{var G=Oe(),W=H(G);de(W,()=>Bn,(ne,ge)=>{ge(ne,{value:"hidden-skills",class:"mt-1",children:(Fe,ot)=>{var Q=Fn(),I=H(Q);de(I,()=>da,(Be,he)=>{he(Be,{level:4,children:(N,Le)=>{var Y=Oe(),K=H(Y);de(K,()=>jn,(Z,V)=>{V(Z,{inset:!1,class:d,children:(oe,ee)=>{var Ne=Ks(),be=O(Ne),je=U(be,!0),et=b(be,2),ut=U(et,!0);$(Ne),x((tt,at)=>{L(je,tt),L(ut,at)},[()=>c.agent_contextBreakdown_hiddenSkills_title(),()=>Wt(i().hiddenSkills.length)]),l(oe,Ne)},$$slots:{default:!0}})}),l(N,Y)},$$slots:{default:!0}})});var ae=b(I,2);de(ae,()=>Hn,(Be,he)=>{he(Be,{inset:!1,children:(N,Le)=>{var Y=Gs();Ct(Y,21,()=>i().hiddenSkills,K=>K.name,(K,Z)=>{var V=Qs(),oe=O(V),ee=U(oe,!0),Ne=b(oe,2),be=U(Ne,!0);$(V),x(je=>{L(ee,e(Z).name),L(be,je)},[()=>[e(Z).detail,e(Z).fix].filter(Boolean).join(" · ")]),l(K,V)}),$(Y),l(N,Y)},$$slots:{default:!0}})}),l(Fe,Q)},$$slots:{default:!0}})}),l(pe,G)};M(ce,pe=>{i().hiddenSkills.length>0&&pe(xe)})}l(me,R)},$$slots:{default:!0}})}),$(S),x((T,m)=>{q(S,"aria-labelledby",`${o}-title`),q(g,"id",`${o}-title`),L(E,T),L(Ce,m),q(D,"aria-label",e(v))},[()=>c.agent_contextBreakdown_title(),()=>c.agent_contextBreakdown_tokens_label({tokens:r(i().estTokens)})]),l(a,S),Lt(f)}const Xs=["intent","user"],Ys=["systemPrompt","toolDescription","provider"],Js=["native","user","intent"],$n=a=>typeof a=="object"&&a!==null&&!Array.isArray(a),An=a=>typeof a=="number"&&Number.isFinite(a)&&a>=0,Zs=a=>a==="intent"||a==="user";function eo(a,n){if(!$n(a))return null;const{id:o,label:i,owner:d,location:r,chars:p,estTokens:v,controlHint:f}=a;if(typeof o!="string"||typeof i!="string"||!Zs(d)||typeof r!="string"||!Ys.includes(r)||!An(p)||!An(v))return null;const S=$n(f)&&typeof f.text=="string"&&f.text;return{key:`${n}:${o}`,id:o,label:i,owner:d,chars:p,estTokens:v,counted:r!=="provider",...S?{hint:S}:{}}}function to(a){if(!$n(a))return null;const{name:n,reason:o,detail:i,fix:d}=a;return[n,o,i,d].some(r=>typeof r!="string")?null:{name:n,reason:o,detail:i,fix:d}}function no(a){if(!$n(a)||a.available!==!0)return null;const{totalChars:n,estTokens:o,sections:i,hiddenSkills:d}=a;if(!An(n)||!An(o)||!Array.isArray(i)||!Array.isArray(d))return null;const r=i.map(eo).filter(f=>f!==null).sort((f,S)=>S.chars-f.chars),p=Xs.map(f=>{const S=r.filter(g=>g.counted&&g.owner===f),y=S.reduce((g,E)=>g+E.chars,0);return{owner:f,chars:y,estTokens:S.reduce((g,E)=>g+E.estTokens,0),share:n>0?y/n:0}}).filter(f=>f.chars>0),v=Js.map(f=>{const S=r.filter(y=>f==="native"?!y.counted:y.counted&&y.owner===f);return{kind:f,chars:S.reduce((y,g)=>y+g.chars,0),estTokens:S.reduce((y,g)=>y+g.estTokens,0),rows:S}}).filter(f=>f.rows.length>0);return{totalChars:n,estTokens:o,rows:r,groups:v,owners:p,hiddenSkills:d.map(to).filter(f=>f!==null)}}async function ao(a){try{const n=await Qr("agent.getSession",{agentId:a});return no(n?.session?.promptBreakdown)}catch{return null}}const pa=es.map(a=>({key:a.path.replace(/^agentFeatures\./,""),label:a.label,description:a.description}));function ro(a){const n=a.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").toLowerCase().trim();return n.charAt(0).toUpperCase()+n.slice(1)}function so(a){const n=a??{},o=pa.map(r=>({key:r.key,label:r.label(),description:r.description(),enabled:n[r.key]===!0,known:!0})),i=new Set(pa.map(r=>r.key)),d=[];for(const[r,p]of Object.entries(n))i.has(r)||d.push({key:r,label:ro(r),description:null,enabled:p===!0,known:!1});return d.sort((r,p)=>r.label.localeCompare(p.label)),o.concat(d)}var oo=_('<div class="mb-6 border-b border-border pb-6"><!></div>'),io=_("<span> </span>"),lo=_('<!> <span class="sr-only"> </span>',1),uo=_('<div role="listitem" class="text-xs text-subtle" aria-hidden="true">—</div>'),co=_('<section class="min-w-0"><h4 class="text-sm font-medium mb-3"> </h4> <div role="list" class="space-y-2"></div></section>'),po=_('<div class="@container"><!> <section><h3 class="text-sm font-medium"> </h3> <p class="mb-4 mt-1 text-sm text-muted-foreground"> </p> <div class="grid grid-cols-1 gap-6 @min-[28rem]:grid-cols-2" data-testid="harness-features-list"></div></section></div>');function Sa(a,n){const o=Wn();if(new.target)return Pt({component:Sa,...a});Ot(n,!0);let i=w(n,"open",15,!1),d=w(n,"static",7,!1),r=w(n,"version",7),p=w(n,"features",7,null),v=w(n,"agentId",7),f=w(n,"breakdown",7),S=le(null);const y=u(()=>f()===void 0&&!!v());ze(()=>{if(!i()||!e(y)||!v())return;const D=v();let P=!0;return ao(D).then(T=>{P&&h(S,{agentId:D,view:T},!0)}),()=>{P=!1}});const g=u(()=>f()!==void 0?f():e(y)&&e(S)&&e(S).agentId===v()?e(S).view:null),E=u(()=>so(p())),F=u(()=>[{enabled:!0,label:c.chat_shared_valueOn_label(),rows:e(E).filter(D=>D.enabled)},{enabled:!1,label:c.chat_shared_valueOff_label(),rows:e(E).filter(D=>!D.enabled)}]);var Ce={get open(){return i()},set open(D=!1){i(D),k()},get static(){return d()},set static(D=!1){d(D),k()},get version(){return r()},set version(D){r(D),k()},get features(){return p()},set features(D=null){p(D),k()},get agentId(){return v()},set agentId(D){v(D),k()},get breakdown(){return f()},set breakdown(D){f(D),k()},$set:Tt,$on:(D,P)=>Rt(n,D,P)};{let D=u(()=>c.chat_harnessFeaturesModal_title({version:r()}));Gr(a,{get static(){return d()},get title(){return e(D)},size:"wide",get open(){return i()},set open(P){i(P)},children:(P,T)=>{var m=po(),me=O(m);{var ue=W=>{var ne=oo(),ge=O(ne);Aa(ge,{get breakdown(){return e(g)}}),$(ne),l(W,ne)};M(me,W=>{e(g)&&W(ue)})}var R=b(me,2),_e=O(R),ce=U(_e,!0),xe=b(_e,2),pe=U(xe,!0),G=b(xe,2);Ct(G,21,()=>e(F),W=>W.enabled,(W,ne)=>{var ge=co(),Fe=O(ge),ot=U(Fe,!0),Q=b(Fe,2);Ct(Q,21,()=>e(ne).rows,I=>I.key,(I,ae)=>{Jr(I,{role:"listitem",class:"min-h-0 px-0 py-0 [&_.truncate]:whitespace-normal","data-testid":"harness-feature-state",get"data-feature"(){return e(ae).key},get"data-enabled"(){return e(ae).enabled},title:he=>{var N=Oe(),Le=H(N);{var Y=Z=>{var V=lo(),oe=H(V);qr(oe,{get content(){return e(ae).description},side:"top",size:"sm",children:(be,je)=>{var et=io(),ut=U(et,!0);x(()=>L(ut,e(ae).label)),l(be,et)},$$slots:{default:!0}});var ee=b(oe,2),Ne=U(ee,!0);x(()=>L(Ne,e(ae).description)),l(Z,V)},K=Z=>{var V=Kt();x(()=>L(V,e(ae).label)),l(Z,V)};M(Le,Z=>{e(ae).description?Z(Y):Z(K,-1)})}l(he,N)},$$slots:{title:!0}})},I=>{var ae=uo();l(I,ae)}),$(Q),$(ge),x(()=>{q(ge,"aria-label",e(ne).label),L(ot,e(ne).label)}),l(W,ge)}),$(G),$(R),$(m),x((W,ne)=>{q(R,"aria-labelledby",`${o}-capabilities`),q(_e,"id",`${o}-capabilities`),L(ce,W),L(pe,ne)},[()=>c.chat_harnessFeaturesModal_capabilities_title(),()=>c.chat_harnessFeaturesModal_description()]),l(P,m)},$$slots:{default:!0}})}return Lt(Ce)}var go=_('<p role="alert" class="type-body text-danger"> </p>');function Ia(a,n){if(new.target)return Pt({component:Ia,...a});Ot(n,!0);const o=()=>Re(g,"$outcome$",i),[i,d]=qn();let r=w(n,"open",15,!1),p=w(n,"agentName",7),v=w(n,"workspaceId",7),f=w(n,"agentId",7);const S=crypto.randomUUID(),y=Mt(""),g=xn(y,S),E=u(()=>o()?.workspaceId===v()&&o().agentId===f()?o():void 0),F=u(()=>e(E)?.status==="pending"),Ce=u(()=>e(E)?.status==="failed"?e(E).error:"");ze(()=>{const m=v();return f(),y.set(m),()=>J.dispatch(zn(m,S))}),ze(()=>{e(E)?.status==="succeeded"&&(r(!1),J.dispatch(wa(v(),S,e(E).requestId)))});function D(){const m=xn.select(J.state,v(),S);m?.agentId===f()&&m.status==="pending"||J.dispatch(kn(v(),S,crypto.randomUUID(),f(),{kind:"retire"}))}var P={get open(){return r()},set open(m=!1){r(m),k()},get agentName(){return p()},set agentName(m){p(m),k()},get workspaceId(){return v()},set workspaceId(m){v(m),k()},get agentId(){return f()},set agentId(m){f(m),k()},$set:Tt,$on:(m,me)=>Rt(n,m,me)};{const m=ce=>{var xe=Oe(),pe=H(xe);{var G=W=>{var ne=go(),ge=U(ne,!0);x(()=>L(ge,e(Ce))),l(W,ne)};M(pe,W=>{e(Ce)&&W(G)})}l(ce,xe)};let me=u(()=>c.modals_retireAgent_title()),ue=u(()=>c.modals_retireAgent_description({name:p()})),R=u(()=>c.modals_retireAgent_confirm_label()),_e=u(()=>c.modals_bulkActionConfirm_cancel_label());ns(a,{get title(){return e(me)},get description(){return e(ue)},get confirmLabel(){return e(R)},get cancelLabel(){return e(_e)},focusSubmit:!1,focusCancel:!0,get busy(){return e(F)},onConfirm:D,get open(){return r()},set open(ce){r(ce)},details:m,$$slots:{details:!0}})}var T=Lt(P);return d(),T}function fo({agentName:a,specialist:n}){const o=n?`{ topLevel: true, specialist: ${JSON.stringify(n)} }`:"{ topLevel: true }",i=n?`and keep the same specialist (${JSON.stringify(n)})`:"and, if you were created with a specialist, pass that exact same `specialist` value in the options";return`Please replace yourself with a fresh top-level agent and run a gradual, coordinated hand-off:
3
3
 
4
4
  1. Create your replacement now: call \`ws.agent.create(${JSON.stringify(a)}, kickoffMessage, ${o})\`. The first argument must be your EXACT current name (${JSON.stringify(a)}) ${i}. Write the kickoff message as a thorough context hand-off: the overall goal, the current state of the work, key notes and files, decisions already made, and open threads.
@@ -1 +1 @@
1
- import{t as lt,bo as _,bw as dt,b as ct,bm as e,br as ft,bs as Ae,bq as Lt}from"./C0QTy0Sy.js";import{bs as pt,ay as Je,be as S,b$ as A,b_ as n,bO as i,W as s,bS as o,bl as D,bn as ut,aA as v,a7 as Et,aD as t,c9 as y,aB as b,a5 as h,bA as x,bf as gt,bo as Gt,bV as tt,br as It,ca as bt,bH as Ke,bk as Ut}from"./3SdAC2_C.js";import{g as zt,i as Tt,I as mt}from"./B6S6VNu7.js";import{c as Ft}from"./CUkDMZwP.js";import{s as ot,f as Ot,c as Bt}from"./7UPrdiE9.js";import{f as U}from"./FzlZUztb.js";import"./DCRuihKm.js";import"./lJeex2Gh.js";import{b as Mt}from"./Co4vj0dC.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{b as Rt}from"./No1eCFy3.js";import{i as k}from"./bhKPSdq4.js";import{b as Ht}from"./D3yXvqwY.js";import{F as Nt,ay as Jt}from"./U9jJmfYa.js";import"./CrD0jtXE.js";import{F as ht,G as qt}from"./jn4zbMQy.js";import"./QeBH-DWE.js";/* empty css */import{C as Wt}from"./BmTMWrby.js";import{L as xt}from"./DsGUBv3k.js";import{I as rt}from"./BAKPnd3w.js";import"./CHLX1QZz.js";import"./BWYuMy_r.js";import{h as Vt}from"./DIG1mTAN.js";import{Jv as Pe,fB as kt,J as jt,eo as yt,r5 as Qt,uA as Xt,Jm as Yt,oD as Zt,hR as er}from"./tr-2J8Mf.js";import{aC as $t,aD as Kt,aE as tr,ax as rr,ay as Pt,az as sr,aA as ar,aI as ir}from"./p9X2tUBM.js";var nr=b('<!> <p class="type-body"> </p>',1);function or(c,a){if(new.target)return lt({component:or,...c});pt(a,!0);let O=_(a,"open",15,!1),G=_(a,"static",7,!1),W=_(a,"title",7),m=_(a,"message",7),I=_(a,"buttons",7),f=_(a,"cancelIndex",7,0),ae=_(a,"onSelect",7);function V(l){O(!1),ae()?.(l)}var he={get open(){return O()},set open(l=!1){O(l),v()},get static(){return G()},set static(l=!1){G(l),v()},get title(){return W()},set title(l){W(l),v()},get message(){return m()},set message(l){m(l),v()},get buttons(){return I()},set buttons(l){I(l),v()},get cancelIndex(){return f()},set cancelIndex(l=0){f(l),v()},get onSelect(){return ae()},set onSelect(l){ae(l),v()},$set:dt,$on:(l,j)=>ct(a,l,j)};return Rt(c,{get static(){return G()},role:"alertdialog",get title(){return W()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>V(I().length-1),onCancel:()=>V(f()),get open(){return O()},set open(j){O(j)},footer:j=>{var $=Et(),B=Je($);zt(B,17,I,Tt,(ie,ne,te)=>{{let xe=y(()=>te===f()?"ghost":te===I().length-1?"primary":"outline");U(ie,{get variant(){return t(xe)},onclick:()=>V(te),children:(De,M)=>{S();var we=A();n(()=>i(we,t(ne))),s(De,we)},$$slots:{default:!0}})}}),s(j,$)},children:(j,$)=>{var B=nr(),ie=Je(B);Ft(ie,()=>Mt,(xe,De)=>{De(xe,{class:"sr-only",children:(M,we)=>{S();var Oe=A();n(()=>i(Oe,m())),s(M,Oe)},$$slots:{default:!0}})});var ne=o(ie,2),te=D(ne,!0);n(()=>i(te,m())),s(j,B)},$$slots:{footer:!0,default:!0}}),ut(he)}const Fe={anthropicKeys:"https://console.anthropic.com/settings/keys",openAiKeys:"https://platform.openai.com/api-keys",openAiTokens:"https://developers.openai.com/codex/enterprise/access-tokens",xaiConsole:"https://console.x.ai",factoryKeys:"https://app.factory.ai/settings/api-keys",cursorDashboard:"https://cursor.com/dashboard?tab=integrations",auggieAuth:"https://docs.augmentcode.com/cli/setup-auggie/authentication"},lr="claude setup-token",dr="auggie token print";function cr(c,a){if(a==="differentLogin")return e.settings_providerProfileKinds_differentLogin_description();if(a==="token")return c==="codex"?e.settings_providerProfileKinds_tokenCodex_description():c==="auggie"?e.settings_providerProfileKinds_tokenAuggie_description():e.settings_providerProfileKinds_tokenClaude_description();switch(c){case"codex":return e.settings_providerProfileKinds_apiKeyCodex_description();case"grok":return e.settings_providerProfileKinds_apiKeyGrok_description();case"droid":return e.settings_providerProfileKinds_apiKeyDroid_description();case"cursor":return e.settings_providerProfileKinds_apiKeyCursor_description();default:return e.settings_providerProfileKinds_apiKeyClaude_description()}}function pr(c,a){return a==="apiKey"?e.settings_providerProfileKinds_apiKey_label():c==="auggie"?e.settings_providerProfileKinds_tokenAuggie_label():e.settings_providerProfileKinds_token_label()}function cs(c,a){return c!=="claude"&&c!=="codex"?cr(c,a):a==="token"?c==="codex"?e.settings_providerProfileKinds_tokenCodexDialog_description():e.settings_providerProfileKinds_tokenClaudeDialog_description():c==="codex"?e.settings_providerProfileKinds_apiKeyCodexDialog_description():e.settings_providerProfileKinds_apiKeyClaudeDialog_description()}function ur(c,a){if(a==="token")return c==="codex"?{steps:[e.settings_providerProfileKinds_tokenCodexStep1_label()],link:{href:Fe.openAiTokens,label:e.settings_providerProfileKinds_openAiAccessTokens_link()},eligibility:e.settings_providerProfileKinds_tokenCodexEligibility_description()}:c==="auggie"?{steps:[e.settings_providerProfileKinds_tokenAuggieStep1_label(),e.settings_providerProfileKinds_tokenAuggieStep2_label()],command:dr,link:{href:Fe.auggieAuth,label:e.settings_providerProfileKinds_auggieAuthDocs_link()}}:{steps:[e.settings_providerProfileKinds_tokenClaudeStep1_label(),e.settings_providerProfileKinds_tokenClaudeStep2_label()],command:lr};switch(c){case"codex":return{steps:[e.settings_providerProfileKinds_apiKeyCodexStep1_label(),e.settings_providerProfileKinds_apiKeyCodexStep2_label()],link:{href:Fe.openAiKeys,label:e.settings_providerProfileKinds_openAiApiKeys_link()}};case"grok":return{steps:[e.settings_providerProfileKinds_apiKeyGrokStep1_label(),e.settings_providerProfileKinds_apiKeyGrokStep2_label()],link:{href:Fe.xaiConsole,label:e.settings_providerProfileKinds_xaiConsole_link()}};case"droid":return{steps:[e.settings_providerProfileKinds_apiKeyDroidStep1_label(),e.settings_providerProfileKinds_apiKeyDroidStep2_label()],link:{href:Fe.factoryKeys,label:e.settings_providerProfileKinds_factoryApiKeys_link()}};case"cursor":return{steps:[e.settings_providerProfileKinds_apiKeyCursorStep1_label(),e.settings_providerProfileKinds_apiKeyCursorStep2_label()],link:{href:Fe.cursorDashboard,label:e.settings_providerProfileKinds_cursorDashboard_link()}};default:return{steps:[e.settings_providerProfileKinds_apiKeyClaudeStep1_label(),e.settings_providerProfileKinds_apiKeyClaudeStep2_label()],link:{href:Fe.anthropicKeys,label:e.settings_providerProfileKinds_anthropicConsole_link()}}}}function _r(c,a){return a?c==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeStep3_label():e.settings_providerProfileKinds_tokenClaudeStep3_label():e.settings_providerProfileKinds_pasteNoCheck_label()}function ps(c,a){if(a==="token")return c==="codex"?e.settings_providerProfileKinds_tokenNotJwt_error():c==="auggie"?e.settings_providerProfileKinds_tokenShapeAuggie_error():e.settings_providerProfileKinds_tokenShapeClaude_error();switch(c){case"codex":return e.settings_providerProfileKinds_keyShapeCodex_error();case"grok":return e.settings_providerProfileKinds_keyShapeGrok_error();case"droid":return e.settings_providerProfileKinds_keyShapeDroid_error();case"cursor":return e.settings_providerProfileKinds_keyShapeCursor_error();default:return e.settings_providerProfileKinds_keyShapeClaude_error()}}var vr=b('<p class="type-body text-muted-foreground" data-testid="provider-profile-token-eligibility"> </p>'),fr=b('<span class="mt-1 flex items-center gap-2" data-testid="provider-profile-setup-token"><code class="rounded border border-border bg-muted px-1.5 py-0.5 font-mono type-caption text-foreground"> </code> <!></span>'),Ct=b("<li> </li>"),gr=b('<section class="space-y-2" data-testid="provider-profile-secret-steps"><h3 class="type-body font-medium! text-foreground"> </h3> <ol class="type-body list-decimal space-y-1 pl-5 text-muted-foreground"><li> <!></li> <!> <!></ol> <!></section>'),St=b('<div class="flex items-center gap-2"><!> <!></div>'),br=b('<div class="space-y-2" data-testid="provider-profile-secret-saved"><p class="type-body text-foreground"> </p> <div class="flex items-center gap-3"><span class="type-body font-mono text-muted-foreground"> </span> <!></div></div>'),mr=b('<span class="type-body text-muted-foreground"> </span> <!>',1),hr=b('<span class="type-body font-mono text-muted-foreground"> </span> <!> <!>',1),xr=b('<div class="flex flex-wrap items-center gap-3" data-testid="provider-profile-base-url-saved"><span class="type-body text-foreground"> </span> <!></div>'),kr=b('<details class="group rounded-md border border-border" data-testid="provider-profile-custom-endpoint"><summary class="flex cursor-pointer list-none items-center gap-2 px-3 py-2 type-body text-foreground [&amp;::-webkit-details-marker]:hidden"><!> </summary> <div class="space-y-2 border-t border-border px-3 py-3"><p class="type-caption text-muted-foreground"> </p> <!></div></details>'),yr=b('<div class="space-y-5" data-testid="provider-profile-secret"><!> <!> <!> <!></div>');function $r(c,a){if(new.target)return lt({component:$r,...c});pt(a,!0);let O=_(a,"provider",7),G=_(a,"kind",7),W=_(a,"mode",7),m=_(a,"secret",15,""),I=_(a,"secretSaved",7,!1),f=_(a,"replacing",15,!1),ae=_(a,"secretError",7),V=_(a,"baseUrl",15,""),he=_(a,"baseUrlSaved",7,!1),l=_(a,"baseUrlAction",15,"keep"),j=_(a,"customEndpointOpen",15,!1),$=_(a,"disabled",7,!1),B=_(a,"secretDisabled",23,$),ie=_(a,"keyCheck",7,!0),ne=_(a,"pasteStep",7,!0),te=_(a,"customEndpoint",7,!0);const xe="https://",De=y(()=>O()==="claude"&&G()==="apiKey"),M=y(()=>ur(O(),G())),we=y(()=>_r(G(),ie())),Oe=y(()=>W()==="add"||!I()||f()),Ve=y(()=>pr(O(),G()));function st(){f(!1),m("")}var at={get provider(){return O()},set provider(r){O(r),v()},get kind(){return G()},set kind(r){G(r),v()},get mode(){return W()},set mode(r){W(r),v()},get secret(){return m()},set secret(r=""){m(r),v()},get secretSaved(){return I()},set secretSaved(r=!1){I(r),v()},get replacing(){return f()},set replacing(r=!1){f(r),v()},get secretError(){return ae()},set secretError(r){ae(r),v()},get baseUrl(){return V()},set baseUrl(r=""){V(r),v()},get baseUrlSaved(){return he()},set baseUrlSaved(r=!1){he(r),v()},get baseUrlAction(){return l()},set baseUrlAction(r="keep"){l(r),v()},get customEndpointOpen(){return j()},set customEndpointOpen(r=!1){j(r),v()},get disabled(){return $()},set disabled(r=!1){$(r),v()},get secretDisabled(){return B()},set secretDisabled(r=$){B(r),v()},get keyCheck(){return ie()},set keyCheck(r=!0){ie(r),v()},get pasteStep(){return ne()},set pasteStep(r=!0){ne(r),v()},get customEndpoint(){return te()},set customEndpoint(r=!0){te(r),v()},$set:dt,$on:(r,P)=>ct(a,r,P)},Be=yr(),Le=h(Be);{var je=r=>{var P=vr(),R=D(P,!0);n(()=>i(R,t(M).eligibility)),s(r,P)};k(Le,r=>{t(M).eligibility&&r(je)})}var _e=o(Le,2);{var Me=r=>{var P=gr(),R=h(P),oe=D(R,!0),Q=o(R,2),X=h(Q),le=h(X),ke=o(le);{var N=g=>{var w=fr(),J=h(w),T=D(J,!0),de=o(J,2);Wt(de,{get text(){return t(M).command},size:"sm"}),x(w),n(()=>i(T,t(M).command)),s(g,w)};k(ke,g=>{t(M).command&&g(N)})}x(X);var ve=o(X,2);{var re=g=>{var w=Ct(),J=D(w,!0);n(()=>i(J,t(M).steps[1])),s(g,w)};k(ve,g=>{t(M).steps[1]&&g(re)})}var z=o(ve,2);{var H=g=>{var w=Ct(),J=D(w,!0);n(()=>i(J,t(we))),s(g,w)};k(z,g=>{ne()&&g(H)})}x(Q);var ye=o(Q,2);{var Ee=g=>{U(g,{variant:"link",size:"sm",get href(){return t(M).link.href},target:"_blank",rel:"noopener noreferrer",class:"h-auto px-0",children:(w,J)=>{S();var T=A();n(()=>i(T,t(M).link.label)),s(w,T)},$$slots:{default:!0}})};k(ye,g=>{t(M).link&&g(Ee)})}x(P),n(g=>{i(oe,g),i(le,`${t(M).steps[0]??""} `)},[()=>G()==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeSteps_label():e.settings_providerProfileKinds_tokenSteps_label()]),s(r,P)};k(_e,r=>{(W()==="add"||f())&&r(Me)})}var K=o(_e,2);{var Qe=r=>{ht(r,{get label(){return t(Ve)},get error(){return ae()},control:(R,oe=gt)=>{var Q=St(),X=h(Q);rt(X,ft(oe,{type:"password",autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return B()},"data-testid":"provider-profile-secret-input",get value(){return m()},set value(N){m(N)}}));var le=o(X,2);{var ke=N=>{U(N,{variant:"ghost-light",size:"sm",get disabled(){return B()},onclick:st,children:(ve,re)=>{S();var z=A();n(H=>i(z,H),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(ve,z)},$$slots:{default:!0}})};k(le,N=>{W()==="edit"&&I()&&N(ke)})}x(Q),s(R,Q)},$$slots:{control:!0}})},qe=r=>{var P=br(),R=h(P),oe=D(R,!0),Q=o(R,2),X=h(Q),le=D(X,!0),ke=o(X,2);U(ke,{variant:"outline",size:"sm",get disabled(){return $()},onclick:()=>f(!0),children:(N,ve)=>{S();var re=A();n(z=>i(re,z),[()=>e.settings_providerProfileKinds_replace_label()]),s(N,re)},$$slots:{default:!0}}),x(Q),x(P),n(N=>{i(oe,t(Ve)),i(le,N)},[()=>e.settings_providerProfileKinds_saved_label()]),s(r,P)};k(K,r=>{t(Oe)?r(Qe):r(qe,-1)})}var it=o(K,2);{var Xe=r=>{var P=kr(),R=h(P),oe=h(R);Nt(oe,{get icon(){return Jt},class:"size-3 transition-transform group-open:rotate-90"});var Q=o(oe);x(R);var X=o(R,2),le=h(X),ke=D(le,!0),N=o(le,2);{var ve=z=>{var H=xr(),ye=h(H),Ee=D(ye,!0),g=o(ye,2);{var w=T=>{var de=mr(),Y=Je(de),Ce=D(Y,!0),Ge=o(Y,2);U(Ge,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>l("keep"),children:(fe,ge)=>{S();var Re=A();n($e=>i(Re,$e),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(fe,Re)},$$slots:{default:!0}}),n(fe=>i(Ce,fe),[()=>e.settings_providerProfileKinds_baseUrlRemoved_label()]),s(T,de)},J=T=>{var de=hr(),Y=Je(de),Ce=D(Y,!0),Ge=o(Y,2);U(Ge,{variant:"outline",size:"sm",get disabled(){return $()},onclick:()=>l("replace"),children:(ge,Re)=>{S();var $e=A();n(u=>i($e,u),[()=>e.settings_providerProfileKinds_replace_label()]),s(ge,$e)},$$slots:{default:!0}});var fe=o(Ge,2);U(fe,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>l("remove"),children:(ge,Re)=>{S();var $e=A();n(u=>i($e,u),[()=>e.settings_providerProfiles_remove_label()]),s(ge,$e)},$$slots:{default:!0}}),n(ge=>i(Ce,ge),[()=>e.settings_providerProfileKinds_saved_label()]),s(T,de)};k(g,T=>{l()==="remove"?T(w):T(J,-1)})}x(H),n(T=>i(Ee,T),[()=>e.settings_providerProfileKinds_baseUrl_label()]),s(z,H)},re=z=>{{const H=(Ee,g=gt)=>{var w=St(),J=h(w);rt(J,ft(g,{type:"url",placeholder:xe,autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return $()},"data-testid":"provider-profile-base-url-input",get value(){return V()},set value(Y){V(Y)}}));var T=o(J,2);{var de=Y=>{U(Y,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>{l("keep"),V("")},children:(Ce,Ge)=>{S();var fe=A();n(ge=>i(fe,ge),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(Ce,fe)},$$slots:{default:!0}})};k(T,Y=>{W()==="edit"&&he()&&Y(de)})}x(w),s(Ee,w)};let ye=y(()=>e.settings_providerProfileKinds_baseUrl_label());ht(z,{get label(){return t(ye)},control:H,$$slots:{control:!0}})}};k(N,z=>{W()==="edit"&&he()&&l()!=="replace"?z(ve):z(re,-1)})}x(X),x(P),n((z,H)=>{i(Q,` ${z??""}`),i(ke,H)},[()=>e.settings_providerProfileKinds_customEndpoint_label(),()=>e.settings_providerProfileKinds_customEndpoint_description()]),Ht("open","toggle",P,j,j),s(r,P)};k(it,r=>{t(De)&&te()&&r(Xe)})}return x(Be),n(()=>ot(Be,"data-kind",G())),s(c,Be),ut(at)}var Kr=b('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Pr=b('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),Cr=b('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),Sr=b('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),Ar=b('<p class="text-xs text-danger" role="alert"> </p>'),Dr=b('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),wr=b('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),Lr=b('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),Er=b('<p class="text-sm text-subtle" role="status"> </p>'),Gr=b('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),Ir=b('<p class="text-sm text-danger" role="alert"> </p>'),Ur=b('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function zr(c,a){const O=Gt();if(new.target)return lt({component:zr,...c});pt(a,!0);const G=()=>Ae(De,"$storedInstance$",l),W=()=>Ae(st,"$deviceGrantSupported$",l),m=()=>Ae(Be,"$instanceSetupSupported$",l),I=()=>Ae(M,"$isAuthenticating$",l),f=()=>Ae(we,"$isCancelling$",l),ae=()=>Ae(Ve,"$deviceFlow$",l),V=()=>Ae(Oe,"$cancelOutcome$",l),he=()=>Ae(at,"$error$",l),[l,j]=Lt();let $=_(a,"compact",7,!1),B=_(a,"onCancel",7);const ie=`${O}-host`,ne=`${O}-host-help`,te=`${O}-host-error`,xe=`${O}-token`,De=$t(),M=Kt(),we=tr(),Oe=rr(),Ve=Pt(),st=sr(),at=ar(),Be=ir();let Le=tt(It($t.select(Pe.state))),je=tt(!1),_e=tt(""),Me=tt(!1);const K=y(()=>Xt(t(Le))),Qe=y(()=>t(Me)||t(K)===G()&&W()===!1),qe=y(()=>t(K)?Zt(t(K)):null),it=y(()=>m()&&t(K)!==null&&t(_e).trim().length>0);bt(()=>{const u=G();t(je)||Ke(Le,u,!0)}),bt(()=>{m()||Ke(_e,"")}),Ut(()=>{const u=()=>{const d=Pe.state;Kt.select(d)&&Pt.select(d)&&Pe.dispatch(kt())};return window.addEventListener("focus",u),()=>window.removeEventListener("focus",u)});function Xe(){!m()||!t(K)||t(K)===G()||I()||f()||Pe.dispatch(Qt(t(K)))}function r(){Ke(je,!0),Ke(_e,"")}function P(){!m()||!t(K)||I()||f()||Pe.dispatch(Yt(t(K)))}function R(){const u=t(_e).trim();!m()||!u||!t(K)||I()||f()||(Pe.dispatch(er(t(K),u)),Ke(_e,""))}function oe(){!m()||f()||(I()&&Pe.dispatch(yt()),Ke(Me,!0))}function Q(){Ke(Me,!1)}function X(){f()||Pe.dispatch(yt())}function le(){t(qe)&&Vt(t(qe),{})}function ke(u){u.key==="Enter"&&(u.preventDefault(),Xe(),t(Qe)?document.getElementById(xe)?.focus():P())}function N(u){u.key==="Enter"&&(u.preventDefault(),R())}const ve=y(()=>$()?"sm":"xl"),re=y(()=>$()?"sm":"default");var z={get compact(){return $()},set compact(u=!1){$(u),v()},get onCancel(){return B()},set onCancel(u){B(u),v()},$set:dt,$on:(u,d)=>ct(a,u,d)},H=Ur();{const u=d=>{U(d,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return f()},onclick:X,children:(p,C)=>{S();var F=A();n(ce=>i(F,ce),[()=>f()?e.lib_gitlabConnect_cancelling_label():e.lib_gitlabConnect_cancel_label()]),s(p,F)},$$slots:{default:!0}})};var ye=h(H);{var Ee=d=>{var p=Kr(),C=D(p,!0);n(F=>i(C,F),[()=>e.lib_gitlabConnect_updateRequired_description()]),s(d,p)};k(ye,d=>{m()||d(Ee)})}var g=o(ye,2);{var w=d=>{var p=Pr(),C=D(p,!0);n(()=>i(C,G())),s(d,p)};k(g,d=>{(I()||f())&&d(w)})}var J=o(g,2);{var T=d=>{var p=Cr(),C=h(p);{let Ue=y(()=>e.lib_gitlabConnect_openGitlab_label());qt(C,{get userCode(){return ae().userCode},get verificationUri(){return ae().verificationUri},get openLabel(){return t(Ue)},get compact(){return $()}})}var F=o(C,2),ce=h(F);mt(ce,{size:16,class:"shrink-0"});var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{let Ue=y(()=>f()||!m());U(Ie,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(Ue)},onclick:oe,children:(nt,_t)=>{S();var L=A();n(q=>i(L,q),[()=>e.lib_gitlabConnect_useToken_label()]),s(nt,L)},$$slots:{default:!0}})}var We=o(Ie,2);u(We),x(F),x(p),n(Ue=>i(He,Ue),[()=>e.lib_gitlabConnect_waitingForAuthorization_label()]),s(d,p)},de=d=>{var p=Sr(),C=h(p);mt(C,{size:16,class:"shrink-0"});var F=o(C,2),ce=D(F,!0),se=o(F,2);u(se),x(p),n(He=>i(ce,He),[()=>e.lib_gitlabConnect_connecting_label()]),s(d,p)},Y=d=>{var p=Lr(),C=Je(p),F=h(C);xt(F,{get for(){return ie},children:(L,q)=>{S();var Z=A();n(pe=>i(Z,pe),[()=>e.lib_gitlabConnect_host_label()]),s(L,Z)},$$slots:{default:!0}});var ce=o(F,2);{let L=y(()=>!m()),q=y(()=>!t(K)||void 0),Z=y(()=>t(K)?ne:`${ne} ${te}`);rt(ce,{get id(){return ie},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(L)},get"aria-invalid"(){return t(q)},get"aria-describedby"(){return t(Z)},get placeholder(){return jt},oninput:r,onchange:Xe,onkeydown:ke,get value(){return t(Le)},set value(pe){Ke(Le,pe,!0)}})}var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{var We=L=>{var q=Ar(),Z=D(q,!0);n(pe=>{ot(q,"id",te),i(Z,pe)},[()=>e.lib_gitlabConnect_invalidInstance_error()]),s(L,q)};k(Ie,L=>{t(K)||L(We)})}x(C);var Ue=o(C,2);{var nt=L=>{var q=Dr(),Z=Je(q),pe=h(Z);xt(pe,{get for(){return xe},children:(E,me)=>{S();var Ne=A();n(ee=>i(Ne,ee),[()=>e.lib_gitlabConnect_token_label()]),s(E,Ne)},$$slots:{default:!0}});var Ye=o(pe,2);{let E=y(()=>!m());rt(Ye,{get id(){return xe},type:"password",autocomplete:"off",get disabled(){return t(E)},placeholder:"glpat-...",onkeydown:N,get value(){return t(_e)},set value(me){Ke(_e,me,!0)}})}var Ze=o(Ye,2),be=h(Ze),ze=o(be);{var et=E=>{U(E,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:le,children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_createToken_label({host:t(K)})]),s(me,ee)},$$slots:{default:!0}})};k(ze,E=>{t(qe)&&t(K)&&E(et)})}x(Ze),x(Z);var ue=o(Z,2),Se=h(ue);{let E=y(()=>!t(it));U(Se,{variant:"primary",get size(){return t(ve)},type:"button",onclick:R,get disabled(){return t(E)},children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_connect_label()]),s(me,ee)},$$slots:{default:!0}})}var vt=o(Se,2);{var At=E=>{U(E,{variant:"ghost",get size(){return t(re)},type:"button",onclick:Q,children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_useDevice_label()]),s(me,ee)},$$slots:{default:!0}})};k(vt,E=>{t(Me)&&!(t(K)===G()&&W()===!1)&&E(At)})}var Dt=o(vt,2);{var wt=E=>{U(E,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return B()},children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_cancel_label()]),s(me,ee)},$$slots:{default:!0}})};k(Dt,E=>{B()&&E(wt)})}x(ue),n(E=>i(be,`${E??""} `),[()=>e.lib_gitlabConnect_token_description()]),s(L,q)},_t=L=>{var q=wr(),Z=h(q);{let be=y(()=>!t(K)||!m());U(Z,{variant:"primary",get size(){return t(ve)},type:"button",onclick:P,get disabled(){return t(be)},children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_connect_label()]),s(ze,ue)},$$slots:{default:!0}})}var pe=o(Z,2);{let be=y(()=>!m());U(pe,{variant:"ghost",get size(){return t(re)},type:"button",get disabled(){return t(be)},onclick:oe,children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_useToken_label()]),s(ze,ue)},$$slots:{default:!0}})}var Ye=o(pe,2);{var Ze=be=>{U(be,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return B()},children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_cancel_label()]),s(ze,ue)},$$slots:{default:!0}})};k(Ye,be=>{B()&&be(Ze)})}x(q),s(L,q)};k(Ue,L=>{t(Qe)?L(nt):L(_t,-1)})}n(L=>{ot(se,"id",ne),i(He,L)},[()=>e.lib_gitlabConnect_host_description()]),s(d,p)};k(J,d=>{(I()||f())&&ae()?d(T):I()||f()?d(de,1):d(Y,-1)})}var Ce=o(J,2);{var Ge=d=>{var p=Er(),C=D(p,!0);n(F=>i(C,F),[()=>e.lib_gitlabConnect_cancelled_label()]),s(d,p)},fe=d=>{var p=Gr(),C=h(p),F=D(C,!0),ce=o(C,2);U(ce,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return f()},onclick:()=>Pe.dispatch(kt()),children:(se,He)=>{S();var Ie=A();n(We=>i(Ie,We),[()=>e.lib_gitlabConnect_checkStatus_label()]),s(se,Ie)},$$slots:{default:!0}}),x(p),n(se=>i(F,se),[()=>V()==="already-started"?e.lib_gitlabConnect_alreadyStarted_description():e.lib_gitlabConnect_cancelFailed_description()]),s(d,p)};k(Ce,d=>{V()==="cancelled"?d(Ge):(V()==="already-started"||V()==="failed")&&d(fe,1)})}var ge=o(Ce,2);{var Re=d=>{var p=Ir(),C=D(p,!0);n(()=>i(C,he())),s(d,p)};k(ge,d=>{he()&&d(Re)})}x(H)}n(()=>Ot(H,1,Bt($()?"space-y-2":"space-y-4"))),s(c,H);var $e=ut(z);return j(),$e}export{zr as G,or as M,$r as P,pr as a,ps as b,cr as k,cs as s};
1
+ import{t as lt,bo as _,bw as dt,b as ct,bm as e,br as ft,bs as Ae,bq as Lt}from"./C0QTy0Sy.js";import{bs as pt,ay as Je,be as S,b$ as A,b_ as n,bO as i,W as s,bS as o,bl as D,bn as ut,aA as v,a7 as Et,aD as t,c9 as y,aB as b,a5 as h,bA as x,bf as gt,bo as Gt,bV as tt,br as It,ca as bt,bH as Ke,bk as Ut}from"./3SdAC2_C.js";import{g as zt,i as Tt,I as mt}from"./B6S6VNu7.js";import{c as Ft}from"./CUkDMZwP.js";import{s as ot,f as Ot,c as Bt}from"./7UPrdiE9.js";import{f as U}from"./FzlZUztb.js";import"./DCRuihKm.js";import"./lJeex2Gh.js";import{b as Mt}from"./Co4vj0dC.js";import"./A9niI_uA.js";import"./CJ4Z96pe.js";import{b as Rt}from"./No1eCFy3.js";import{i as k}from"./bhKPSdq4.js";import{b as Ht}from"./D3yXvqwY.js";import{F as Nt,ay as Jt}from"./U9jJmfYa.js";import"./CrD0jtXE.js";import{F as ht,G as qt}from"./C9h2rwKF.js";import"./QeBH-DWE.js";/* empty css */import{C as Wt}from"./BmTMWrby.js";import{L as xt}from"./DsGUBv3k.js";import{I as rt}from"./BAKPnd3w.js";import"./CHLX1QZz.js";import"./BWYuMy_r.js";import{h as Vt}from"./BwtFad5m.js";import{Jv as Pe,fB as kt,J as jt,eo as yt,r5 as Qt,uA as Xt,Jm as Yt,oD as Zt,hR as er}from"./tr-2J8Mf.js";import{aC as $t,aD as Kt,aE as tr,ax as rr,ay as Pt,az as sr,aA as ar,aI as ir}from"./BFgeFHTs.js";var nr=b('<!> <p class="type-body"> </p>',1);function or(c,a){if(new.target)return lt({component:or,...c});pt(a,!0);let O=_(a,"open",15,!1),G=_(a,"static",7,!1),W=_(a,"title",7),m=_(a,"message",7),I=_(a,"buttons",7),f=_(a,"cancelIndex",7,0),ae=_(a,"onSelect",7);function V(l){O(!1),ae()?.(l)}var he={get open(){return O()},set open(l=!1){O(l),v()},get static(){return G()},set static(l=!1){G(l),v()},get title(){return W()},set title(l){W(l),v()},get message(){return m()},set message(l){m(l),v()},get buttons(){return I()},set buttons(l){I(l),v()},get cancelIndex(){return f()},set cancelIndex(l=0){f(l),v()},get onSelect(){return ae()},set onSelect(l){ae(l),v()},$set:dt,$on:(l,j)=>ct(a,l,j)};return Rt(c,{get static(){return G()},role:"alertdialog",get title(){return W()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>V(I().length-1),onCancel:()=>V(f()),get open(){return O()},set open(j){O(j)},footer:j=>{var $=Et(),B=Je($);zt(B,17,I,Tt,(ie,ne,te)=>{{let xe=y(()=>te===f()?"ghost":te===I().length-1?"primary":"outline");U(ie,{get variant(){return t(xe)},onclick:()=>V(te),children:(De,M)=>{S();var we=A();n(()=>i(we,t(ne))),s(De,we)},$$slots:{default:!0}})}}),s(j,$)},children:(j,$)=>{var B=nr(),ie=Je(B);Ft(ie,()=>Mt,(xe,De)=>{De(xe,{class:"sr-only",children:(M,we)=>{S();var Oe=A();n(()=>i(Oe,m())),s(M,Oe)},$$slots:{default:!0}})});var ne=o(ie,2),te=D(ne,!0);n(()=>i(te,m())),s(j,B)},$$slots:{footer:!0,default:!0}}),ut(he)}const Fe={anthropicKeys:"https://console.anthropic.com/settings/keys",openAiKeys:"https://platform.openai.com/api-keys",openAiTokens:"https://developers.openai.com/codex/enterprise/access-tokens",xaiConsole:"https://console.x.ai",factoryKeys:"https://app.factory.ai/settings/api-keys",cursorDashboard:"https://cursor.com/dashboard?tab=integrations",auggieAuth:"https://docs.augmentcode.com/cli/setup-auggie/authentication"},lr="claude setup-token",dr="auggie token print";function cr(c,a){if(a==="differentLogin")return e.settings_providerProfileKinds_differentLogin_description();if(a==="token")return c==="codex"?e.settings_providerProfileKinds_tokenCodex_description():c==="auggie"?e.settings_providerProfileKinds_tokenAuggie_description():e.settings_providerProfileKinds_tokenClaude_description();switch(c){case"codex":return e.settings_providerProfileKinds_apiKeyCodex_description();case"grok":return e.settings_providerProfileKinds_apiKeyGrok_description();case"droid":return e.settings_providerProfileKinds_apiKeyDroid_description();case"cursor":return e.settings_providerProfileKinds_apiKeyCursor_description();default:return e.settings_providerProfileKinds_apiKeyClaude_description()}}function pr(c,a){return a==="apiKey"?e.settings_providerProfileKinds_apiKey_label():c==="auggie"?e.settings_providerProfileKinds_tokenAuggie_label():e.settings_providerProfileKinds_token_label()}function cs(c,a){return c!=="claude"&&c!=="codex"?cr(c,a):a==="token"?c==="codex"?e.settings_providerProfileKinds_tokenCodexDialog_description():e.settings_providerProfileKinds_tokenClaudeDialog_description():c==="codex"?e.settings_providerProfileKinds_apiKeyCodexDialog_description():e.settings_providerProfileKinds_apiKeyClaudeDialog_description()}function ur(c,a){if(a==="token")return c==="codex"?{steps:[e.settings_providerProfileKinds_tokenCodexStep1_label()],link:{href:Fe.openAiTokens,label:e.settings_providerProfileKinds_openAiAccessTokens_link()},eligibility:e.settings_providerProfileKinds_tokenCodexEligibility_description()}:c==="auggie"?{steps:[e.settings_providerProfileKinds_tokenAuggieStep1_label(),e.settings_providerProfileKinds_tokenAuggieStep2_label()],command:dr,link:{href:Fe.auggieAuth,label:e.settings_providerProfileKinds_auggieAuthDocs_link()}}:{steps:[e.settings_providerProfileKinds_tokenClaudeStep1_label(),e.settings_providerProfileKinds_tokenClaudeStep2_label()],command:lr};switch(c){case"codex":return{steps:[e.settings_providerProfileKinds_apiKeyCodexStep1_label(),e.settings_providerProfileKinds_apiKeyCodexStep2_label()],link:{href:Fe.openAiKeys,label:e.settings_providerProfileKinds_openAiApiKeys_link()}};case"grok":return{steps:[e.settings_providerProfileKinds_apiKeyGrokStep1_label(),e.settings_providerProfileKinds_apiKeyGrokStep2_label()],link:{href:Fe.xaiConsole,label:e.settings_providerProfileKinds_xaiConsole_link()}};case"droid":return{steps:[e.settings_providerProfileKinds_apiKeyDroidStep1_label(),e.settings_providerProfileKinds_apiKeyDroidStep2_label()],link:{href:Fe.factoryKeys,label:e.settings_providerProfileKinds_factoryApiKeys_link()}};case"cursor":return{steps:[e.settings_providerProfileKinds_apiKeyCursorStep1_label(),e.settings_providerProfileKinds_apiKeyCursorStep2_label()],link:{href:Fe.cursorDashboard,label:e.settings_providerProfileKinds_cursorDashboard_link()}};default:return{steps:[e.settings_providerProfileKinds_apiKeyClaudeStep1_label(),e.settings_providerProfileKinds_apiKeyClaudeStep2_label()],link:{href:Fe.anthropicKeys,label:e.settings_providerProfileKinds_anthropicConsole_link()}}}}function _r(c,a){return a?c==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeStep3_label():e.settings_providerProfileKinds_tokenClaudeStep3_label():e.settings_providerProfileKinds_pasteNoCheck_label()}function ps(c,a){if(a==="token")return c==="codex"?e.settings_providerProfileKinds_tokenNotJwt_error():c==="auggie"?e.settings_providerProfileKinds_tokenShapeAuggie_error():e.settings_providerProfileKinds_tokenShapeClaude_error();switch(c){case"codex":return e.settings_providerProfileKinds_keyShapeCodex_error();case"grok":return e.settings_providerProfileKinds_keyShapeGrok_error();case"droid":return e.settings_providerProfileKinds_keyShapeDroid_error();case"cursor":return e.settings_providerProfileKinds_keyShapeCursor_error();default:return e.settings_providerProfileKinds_keyShapeClaude_error()}}var vr=b('<p class="type-body text-muted-foreground" data-testid="provider-profile-token-eligibility"> </p>'),fr=b('<span class="mt-1 flex items-center gap-2" data-testid="provider-profile-setup-token"><code class="rounded border border-border bg-muted px-1.5 py-0.5 font-mono type-caption text-foreground"> </code> <!></span>'),Ct=b("<li> </li>"),gr=b('<section class="space-y-2" data-testid="provider-profile-secret-steps"><h3 class="type-body font-medium! text-foreground"> </h3> <ol class="type-body list-decimal space-y-1 pl-5 text-muted-foreground"><li> <!></li> <!> <!></ol> <!></section>'),St=b('<div class="flex items-center gap-2"><!> <!></div>'),br=b('<div class="space-y-2" data-testid="provider-profile-secret-saved"><p class="type-body text-foreground"> </p> <div class="flex items-center gap-3"><span class="type-body font-mono text-muted-foreground"> </span> <!></div></div>'),mr=b('<span class="type-body text-muted-foreground"> </span> <!>',1),hr=b('<span class="type-body font-mono text-muted-foreground"> </span> <!> <!>',1),xr=b('<div class="flex flex-wrap items-center gap-3" data-testid="provider-profile-base-url-saved"><span class="type-body text-foreground"> </span> <!></div>'),kr=b('<details class="group rounded-md border border-border" data-testid="provider-profile-custom-endpoint"><summary class="flex cursor-pointer list-none items-center gap-2 px-3 py-2 type-body text-foreground [&amp;::-webkit-details-marker]:hidden"><!> </summary> <div class="space-y-2 border-t border-border px-3 py-3"><p class="type-caption text-muted-foreground"> </p> <!></div></details>'),yr=b('<div class="space-y-5" data-testid="provider-profile-secret"><!> <!> <!> <!></div>');function $r(c,a){if(new.target)return lt({component:$r,...c});pt(a,!0);let O=_(a,"provider",7),G=_(a,"kind",7),W=_(a,"mode",7),m=_(a,"secret",15,""),I=_(a,"secretSaved",7,!1),f=_(a,"replacing",15,!1),ae=_(a,"secretError",7),V=_(a,"baseUrl",15,""),he=_(a,"baseUrlSaved",7,!1),l=_(a,"baseUrlAction",15,"keep"),j=_(a,"customEndpointOpen",15,!1),$=_(a,"disabled",7,!1),B=_(a,"secretDisabled",23,$),ie=_(a,"keyCheck",7,!0),ne=_(a,"pasteStep",7,!0),te=_(a,"customEndpoint",7,!0);const xe="https://",De=y(()=>O()==="claude"&&G()==="apiKey"),M=y(()=>ur(O(),G())),we=y(()=>_r(G(),ie())),Oe=y(()=>W()==="add"||!I()||f()),Ve=y(()=>pr(O(),G()));function st(){f(!1),m("")}var at={get provider(){return O()},set provider(r){O(r),v()},get kind(){return G()},set kind(r){G(r),v()},get mode(){return W()},set mode(r){W(r),v()},get secret(){return m()},set secret(r=""){m(r),v()},get secretSaved(){return I()},set secretSaved(r=!1){I(r),v()},get replacing(){return f()},set replacing(r=!1){f(r),v()},get secretError(){return ae()},set secretError(r){ae(r),v()},get baseUrl(){return V()},set baseUrl(r=""){V(r),v()},get baseUrlSaved(){return he()},set baseUrlSaved(r=!1){he(r),v()},get baseUrlAction(){return l()},set baseUrlAction(r="keep"){l(r),v()},get customEndpointOpen(){return j()},set customEndpointOpen(r=!1){j(r),v()},get disabled(){return $()},set disabled(r=!1){$(r),v()},get secretDisabled(){return B()},set secretDisabled(r=$){B(r),v()},get keyCheck(){return ie()},set keyCheck(r=!0){ie(r),v()},get pasteStep(){return ne()},set pasteStep(r=!0){ne(r),v()},get customEndpoint(){return te()},set customEndpoint(r=!0){te(r),v()},$set:dt,$on:(r,P)=>ct(a,r,P)},Be=yr(),Le=h(Be);{var je=r=>{var P=vr(),R=D(P,!0);n(()=>i(R,t(M).eligibility)),s(r,P)};k(Le,r=>{t(M).eligibility&&r(je)})}var _e=o(Le,2);{var Me=r=>{var P=gr(),R=h(P),oe=D(R,!0),Q=o(R,2),X=h(Q),le=h(X),ke=o(le);{var N=g=>{var w=fr(),J=h(w),T=D(J,!0),de=o(J,2);Wt(de,{get text(){return t(M).command},size:"sm"}),x(w),n(()=>i(T,t(M).command)),s(g,w)};k(ke,g=>{t(M).command&&g(N)})}x(X);var ve=o(X,2);{var re=g=>{var w=Ct(),J=D(w,!0);n(()=>i(J,t(M).steps[1])),s(g,w)};k(ve,g=>{t(M).steps[1]&&g(re)})}var z=o(ve,2);{var H=g=>{var w=Ct(),J=D(w,!0);n(()=>i(J,t(we))),s(g,w)};k(z,g=>{ne()&&g(H)})}x(Q);var ye=o(Q,2);{var Ee=g=>{U(g,{variant:"link",size:"sm",get href(){return t(M).link.href},target:"_blank",rel:"noopener noreferrer",class:"h-auto px-0",children:(w,J)=>{S();var T=A();n(()=>i(T,t(M).link.label)),s(w,T)},$$slots:{default:!0}})};k(ye,g=>{t(M).link&&g(Ee)})}x(P),n(g=>{i(oe,g),i(le,`${t(M).steps[0]??""} `)},[()=>G()==="apiKey"?e.settings_providerProfileKinds_apiKeyClaudeSteps_label():e.settings_providerProfileKinds_tokenSteps_label()]),s(r,P)};k(_e,r=>{(W()==="add"||f())&&r(Me)})}var K=o(_e,2);{var Qe=r=>{ht(r,{get label(){return t(Ve)},get error(){return ae()},control:(R,oe=gt)=>{var Q=St(),X=h(Q);rt(X,ft(oe,{type:"password",autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return B()},"data-testid":"provider-profile-secret-input",get value(){return m()},set value(N){m(N)}}));var le=o(X,2);{var ke=N=>{U(N,{variant:"ghost-light",size:"sm",get disabled(){return B()},onclick:st,children:(ve,re)=>{S();var z=A();n(H=>i(z,H),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(ve,z)},$$slots:{default:!0}})};k(le,N=>{W()==="edit"&&I()&&N(ke)})}x(Q),s(R,Q)},$$slots:{control:!0}})},qe=r=>{var P=br(),R=h(P),oe=D(R,!0),Q=o(R,2),X=h(Q),le=D(X,!0),ke=o(X,2);U(ke,{variant:"outline",size:"sm",get disabled(){return $()},onclick:()=>f(!0),children:(N,ve)=>{S();var re=A();n(z=>i(re,z),[()=>e.settings_providerProfileKinds_replace_label()]),s(N,re)},$$slots:{default:!0}}),x(Q),x(P),n(N=>{i(oe,t(Ve)),i(le,N)},[()=>e.settings_providerProfileKinds_saved_label()]),s(r,P)};k(K,r=>{t(Oe)?r(Qe):r(qe,-1)})}var it=o(K,2);{var Xe=r=>{var P=kr(),R=h(P),oe=h(R);Nt(oe,{get icon(){return Jt},class:"size-3 transition-transform group-open:rotate-90"});var Q=o(oe);x(R);var X=o(R,2),le=h(X),ke=D(le,!0),N=o(le,2);{var ve=z=>{var H=xr(),ye=h(H),Ee=D(ye,!0),g=o(ye,2);{var w=T=>{var de=mr(),Y=Je(de),Ce=D(Y,!0),Ge=o(Y,2);U(Ge,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>l("keep"),children:(fe,ge)=>{S();var Re=A();n($e=>i(Re,$e),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(fe,Re)},$$slots:{default:!0}}),n(fe=>i(Ce,fe),[()=>e.settings_providerProfileKinds_baseUrlRemoved_label()]),s(T,de)},J=T=>{var de=hr(),Y=Je(de),Ce=D(Y,!0),Ge=o(Y,2);U(Ge,{variant:"outline",size:"sm",get disabled(){return $()},onclick:()=>l("replace"),children:(ge,Re)=>{S();var $e=A();n(u=>i($e,u),[()=>e.settings_providerProfileKinds_replace_label()]),s(ge,$e)},$$slots:{default:!0}});var fe=o(Ge,2);U(fe,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>l("remove"),children:(ge,Re)=>{S();var $e=A();n(u=>i($e,u),[()=>e.settings_providerProfiles_remove_label()]),s(ge,$e)},$$slots:{default:!0}}),n(ge=>i(Ce,ge),[()=>e.settings_providerProfileKinds_saved_label()]),s(T,de)};k(g,T=>{l()==="remove"?T(w):T(J,-1)})}x(H),n(T=>i(Ee,T),[()=>e.settings_providerProfileKinds_baseUrl_label()]),s(z,H)},re=z=>{{const H=(Ee,g=gt)=>{var w=St(),J=h(w);rt(J,ft(g,{type:"url",placeholder:xe,autocomplete:"off",spellcheck:!1,class:"font-mono",get disabled(){return $()},"data-testid":"provider-profile-base-url-input",get value(){return V()},set value(Y){V(Y)}}));var T=o(J,2);{var de=Y=>{U(Y,{variant:"ghost-light",size:"sm",get disabled(){return $()},onclick:()=>{l("keep"),V("")},children:(Ce,Ge)=>{S();var fe=A();n(ge=>i(fe,ge),[()=>e.settings_providerProfileKinds_keepSaved_label()]),s(Ce,fe)},$$slots:{default:!0}})};k(T,Y=>{W()==="edit"&&he()&&Y(de)})}x(w),s(Ee,w)};let ye=y(()=>e.settings_providerProfileKinds_baseUrl_label());ht(z,{get label(){return t(ye)},control:H,$$slots:{control:!0}})}};k(N,z=>{W()==="edit"&&he()&&l()!=="replace"?z(ve):z(re,-1)})}x(X),x(P),n((z,H)=>{i(Q,` ${z??""}`),i(ke,H)},[()=>e.settings_providerProfileKinds_customEndpoint_label(),()=>e.settings_providerProfileKinds_customEndpoint_description()]),Ht("open","toggle",P,j,j),s(r,P)};k(it,r=>{t(De)&&te()&&r(Xe)})}return x(Be),n(()=>ot(Be,"data-kind",G())),s(c,Be),ut(at)}var Kr=b('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Pr=b('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),Cr=b('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),Sr=b('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),Ar=b('<p class="text-xs text-danger" role="alert"> </p>'),Dr=b('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),wr=b('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),Lr=b('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),Er=b('<p class="text-sm text-subtle" role="status"> </p>'),Gr=b('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),Ir=b('<p class="text-sm text-danger" role="alert"> </p>'),Ur=b('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function zr(c,a){const O=Gt();if(new.target)return lt({component:zr,...c});pt(a,!0);const G=()=>Ae(De,"$storedInstance$",l),W=()=>Ae(st,"$deviceGrantSupported$",l),m=()=>Ae(Be,"$instanceSetupSupported$",l),I=()=>Ae(M,"$isAuthenticating$",l),f=()=>Ae(we,"$isCancelling$",l),ae=()=>Ae(Ve,"$deviceFlow$",l),V=()=>Ae(Oe,"$cancelOutcome$",l),he=()=>Ae(at,"$error$",l),[l,j]=Lt();let $=_(a,"compact",7,!1),B=_(a,"onCancel",7);const ie=`${O}-host`,ne=`${O}-host-help`,te=`${O}-host-error`,xe=`${O}-token`,De=$t(),M=Kt(),we=tr(),Oe=rr(),Ve=Pt(),st=sr(),at=ar(),Be=ir();let Le=tt(It($t.select(Pe.state))),je=tt(!1),_e=tt(""),Me=tt(!1);const K=y(()=>Xt(t(Le))),Qe=y(()=>t(Me)||t(K)===G()&&W()===!1),qe=y(()=>t(K)?Zt(t(K)):null),it=y(()=>m()&&t(K)!==null&&t(_e).trim().length>0);bt(()=>{const u=G();t(je)||Ke(Le,u,!0)}),bt(()=>{m()||Ke(_e,"")}),Ut(()=>{const u=()=>{const d=Pe.state;Kt.select(d)&&Pt.select(d)&&Pe.dispatch(kt())};return window.addEventListener("focus",u),()=>window.removeEventListener("focus",u)});function Xe(){!m()||!t(K)||t(K)===G()||I()||f()||Pe.dispatch(Qt(t(K)))}function r(){Ke(je,!0),Ke(_e,"")}function P(){!m()||!t(K)||I()||f()||Pe.dispatch(Yt(t(K)))}function R(){const u=t(_e).trim();!m()||!u||!t(K)||I()||f()||(Pe.dispatch(er(t(K),u)),Ke(_e,""))}function oe(){!m()||f()||(I()&&Pe.dispatch(yt()),Ke(Me,!0))}function Q(){Ke(Me,!1)}function X(){f()||Pe.dispatch(yt())}function le(){t(qe)&&Vt(t(qe),{})}function ke(u){u.key==="Enter"&&(u.preventDefault(),Xe(),t(Qe)?document.getElementById(xe)?.focus():P())}function N(u){u.key==="Enter"&&(u.preventDefault(),R())}const ve=y(()=>$()?"sm":"xl"),re=y(()=>$()?"sm":"default");var z={get compact(){return $()},set compact(u=!1){$(u),v()},get onCancel(){return B()},set onCancel(u){B(u),v()},$set:dt,$on:(u,d)=>ct(a,u,d)},H=Ur();{const u=d=>{U(d,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return f()},onclick:X,children:(p,C)=>{S();var F=A();n(ce=>i(F,ce),[()=>f()?e.lib_gitlabConnect_cancelling_label():e.lib_gitlabConnect_cancel_label()]),s(p,F)},$$slots:{default:!0}})};var ye=h(H);{var Ee=d=>{var p=Kr(),C=D(p,!0);n(F=>i(C,F),[()=>e.lib_gitlabConnect_updateRequired_description()]),s(d,p)};k(ye,d=>{m()||d(Ee)})}var g=o(ye,2);{var w=d=>{var p=Pr(),C=D(p,!0);n(()=>i(C,G())),s(d,p)};k(g,d=>{(I()||f())&&d(w)})}var J=o(g,2);{var T=d=>{var p=Cr(),C=h(p);{let Ue=y(()=>e.lib_gitlabConnect_openGitlab_label());qt(C,{get userCode(){return ae().userCode},get verificationUri(){return ae().verificationUri},get openLabel(){return t(Ue)},get compact(){return $()}})}var F=o(C,2),ce=h(F);mt(ce,{size:16,class:"shrink-0"});var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{let Ue=y(()=>f()||!m());U(Ie,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(Ue)},onclick:oe,children:(nt,_t)=>{S();var L=A();n(q=>i(L,q),[()=>e.lib_gitlabConnect_useToken_label()]),s(nt,L)},$$slots:{default:!0}})}var We=o(Ie,2);u(We),x(F),x(p),n(Ue=>i(He,Ue),[()=>e.lib_gitlabConnect_waitingForAuthorization_label()]),s(d,p)},de=d=>{var p=Sr(),C=h(p);mt(C,{size:16,class:"shrink-0"});var F=o(C,2),ce=D(F,!0),se=o(F,2);u(se),x(p),n(He=>i(ce,He),[()=>e.lib_gitlabConnect_connecting_label()]),s(d,p)},Y=d=>{var p=Lr(),C=Je(p),F=h(C);xt(F,{get for(){return ie},children:(L,q)=>{S();var Z=A();n(pe=>i(Z,pe),[()=>e.lib_gitlabConnect_host_label()]),s(L,Z)},$$slots:{default:!0}});var ce=o(F,2);{let L=y(()=>!m()),q=y(()=>!t(K)||void 0),Z=y(()=>t(K)?ne:`${ne} ${te}`);rt(ce,{get id(){return ie},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(L)},get"aria-invalid"(){return t(q)},get"aria-describedby"(){return t(Z)},get placeholder(){return jt},oninput:r,onchange:Xe,onkeydown:ke,get value(){return t(Le)},set value(pe){Ke(Le,pe,!0)}})}var se=o(ce,2),He=D(se,!0),Ie=o(se,2);{var We=L=>{var q=Ar(),Z=D(q,!0);n(pe=>{ot(q,"id",te),i(Z,pe)},[()=>e.lib_gitlabConnect_invalidInstance_error()]),s(L,q)};k(Ie,L=>{t(K)||L(We)})}x(C);var Ue=o(C,2);{var nt=L=>{var q=Dr(),Z=Je(q),pe=h(Z);xt(pe,{get for(){return xe},children:(E,me)=>{S();var Ne=A();n(ee=>i(Ne,ee),[()=>e.lib_gitlabConnect_token_label()]),s(E,Ne)},$$slots:{default:!0}});var Ye=o(pe,2);{let E=y(()=>!m());rt(Ye,{get id(){return xe},type:"password",autocomplete:"off",get disabled(){return t(E)},placeholder:"glpat-...",onkeydown:N,get value(){return t(_e)},set value(me){Ke(_e,me,!0)}})}var Ze=o(Ye,2),be=h(Ze),ze=o(be);{var et=E=>{U(E,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:le,children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_createToken_label({host:t(K)})]),s(me,ee)},$$slots:{default:!0}})};k(ze,E=>{t(qe)&&t(K)&&E(et)})}x(Ze),x(Z);var ue=o(Z,2),Se=h(ue);{let E=y(()=>!t(it));U(Se,{variant:"primary",get size(){return t(ve)},type:"button",onclick:R,get disabled(){return t(E)},children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_connect_label()]),s(me,ee)},$$slots:{default:!0}})}var vt=o(Se,2);{var At=E=>{U(E,{variant:"ghost",get size(){return t(re)},type:"button",onclick:Q,children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_useDevice_label()]),s(me,ee)},$$slots:{default:!0}})};k(vt,E=>{t(Me)&&!(t(K)===G()&&W()===!1)&&E(At)})}var Dt=o(vt,2);{var wt=E=>{U(E,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return B()},children:(me,Ne)=>{S();var ee=A();n(Te=>i(ee,Te),[()=>e.lib_gitlabConnect_cancel_label()]),s(me,ee)},$$slots:{default:!0}})};k(Dt,E=>{B()&&E(wt)})}x(ue),n(E=>i(be,`${E??""} `),[()=>e.lib_gitlabConnect_token_description()]),s(L,q)},_t=L=>{var q=wr(),Z=h(q);{let be=y(()=>!t(K)||!m());U(Z,{variant:"primary",get size(){return t(ve)},type:"button",onclick:P,get disabled(){return t(be)},children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_connect_label()]),s(ze,ue)},$$slots:{default:!0}})}var pe=o(Z,2);{let be=y(()=>!m());U(pe,{variant:"ghost",get size(){return t(re)},type:"button",get disabled(){return t(be)},onclick:oe,children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_useToken_label()]),s(ze,ue)},$$slots:{default:!0}})}var Ye=o(pe,2);{var Ze=be=>{U(be,{variant:"ghost",get size(){return t(re)},type:"button",get onclick(){return B()},children:(ze,et)=>{S();var ue=A();n(Se=>i(ue,Se),[()=>e.lib_gitlabConnect_cancel_label()]),s(ze,ue)},$$slots:{default:!0}})};k(Ye,be=>{B()&&be(Ze)})}x(q),s(L,q)};k(Ue,L=>{t(Qe)?L(nt):L(_t,-1)})}n(L=>{ot(se,"id",ne),i(He,L)},[()=>e.lib_gitlabConnect_host_description()]),s(d,p)};k(J,d=>{(I()||f())&&ae()?d(T):I()||f()?d(de,1):d(Y,-1)})}var Ce=o(J,2);{var Ge=d=>{var p=Er(),C=D(p,!0);n(F=>i(C,F),[()=>e.lib_gitlabConnect_cancelled_label()]),s(d,p)},fe=d=>{var p=Gr(),C=h(p),F=D(C,!0),ce=o(C,2);U(ce,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return f()},onclick:()=>Pe.dispatch(kt()),children:(se,He)=>{S();var Ie=A();n(We=>i(Ie,We),[()=>e.lib_gitlabConnect_checkStatus_label()]),s(se,Ie)},$$slots:{default:!0}}),x(p),n(se=>i(F,se),[()=>V()==="already-started"?e.lib_gitlabConnect_alreadyStarted_description():e.lib_gitlabConnect_cancelFailed_description()]),s(d,p)};k(Ce,d=>{V()==="cancelled"?d(Ge):(V()==="already-started"||V()==="failed")&&d(fe,1)})}var ge=o(Ce,2);{var Re=d=>{var p=Ir(),C=D(p,!0);n(()=>i(C,he())),s(d,p)};k(ge,d=>{he()&&d(Re)})}x(H)}n(()=>Ot(H,1,Bt($()?"space-y-2":"space-y-4"))),s(c,H);var $e=ut(z);return j(),$e}export{zr as G,or as M,$r as P,pr as a,ps as b,cr as k,cs as s};
@@ -1 +1 @@
1
- import{t as bt,bo as b,bw as _t,bq as gt,b as vt,bm as x,bs as me,br as Te}from"./C0QTy0Sy.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as L,ay as _,W as r,bn as It,aA as g,aD as t,bS as N,a5 as be,bH as Be,bA as _e,b_ as W,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./3SdAC2_C.js";import{i as z}from"./bhKPSdq4.js";import{g as $t}from"./B6S6VNu7.js";import{t as We}from"./CrD0jtXE.js";import{c as S}from"./CUkDMZwP.js";import{f as Pt,s as De,b as At}from"./7UPrdiE9.js";import{cK as Et,bn as Ot,aM as Ft,F as ne,aZ as Tt,aN as Bt,bo as Dt,a8 as Ge,aw as Lt}from"./U9jJmfYa.js";import{W as Nt,T as zt,G as St,C as Rt,X as Ht,J as Mt,V as Wt}from"./Y5Ky10uA.js";import{f as ge}from"./FzlZUztb.js";import"./DCRuihKm.js";import{D as Gt}from"./Cqa6LF3b.js";import{g as Vt,R as jt,k as Jt,j as Kt,i as qt,h as Ve}from"./fiz8N_zQ.js";import{m as ve}from"./BmTMWrby.js";import{c as Ut}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{Jv as je,ng as Xt,Ga as Yt}from"./tr-2J8Mf.js";import{w as Zt}from"./Bqd7fdCF.js";import{i as U}from"./CL3a4Hm1.js";import{b3 as Qt,aN as er,aL as tr}from"./p9X2tUBM.js";import{cB as rr}from"./BaujsV9k.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:St,terminal:zt,warp:Nt},nr={vscode:Wt,jetbrains:Mt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function Je(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Le="finder",lr={id:Le,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Le)||se.has(Le)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),mr=E("<span><!></span>"),br=E('<img class="w-4 h-4"/>'),_r=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return bt({component:wr,...O});ht(s,!0);const se=()=>me(Ue,"$installedEditors$",ie),X=()=>me(Xe,"$hiddenEditorIds$",ie),Y=()=>me(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>me(qe,"$openAction",ie),[ie,Ke]=gt(),le=(e,d=kt)=>{var u=L(),p=_(u);S(p,()=>jt,(te,j)=>{j(te,{get value(){return t(v).id},children:(F,D)=>{var k=L(),T=_(k);$t(T,17,d,C=>C.id,(C,c)=>{var J=L(),h=_(J);{const $=a=>{var i=L(),y=_(i);{var H=l=>{var A=dr();W(()=>De(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},m=l=>{const A=o(()=>t(c).icon);var M=L(),B=_(M);S(B,()=>t(A),(K,re)=>{re(K,{size:16})}),r(l,M)},P=l=>{{let A=o(()=>t(c).faIcon??Je(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};z(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(m,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());S(h,()=>Vt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var m=pr(),P=_(m),l=oe(P,!0),A=N(P,2);{var M=B=>{var K=ur(),re=oe(K,!0);W(()=>ae(re,t(c).shortcut)),r(B,K)};z(A,B=>{t(c).shortcut&&B(M)})}W(()=>ae(l,t(c).label)),r(y,m)},$$slots:{leading:!0,default:!0}})})}r(C,J)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=b(s,"filePath",7),ce=b(s,"workspaceId",7,""),de=b(s,"isDirectory",7,!0),we=b(s,"workspaceFolderPath",7),xe=b(s,"class",7,""),ue=b(s,"headerText",7),Ie=b(s,"usePortal",7,!0),ke=b(s,"side",7,"bottom"),G=b(s,"variant",7,"default"),Z=b(s,"branchName",7),Ce=b(s,"compact",7,!1),$e=b(s,"embedded",7,!1),Q=b(s,"inline",7,!1),V=b(s,"iconOnly",7,!1),R=b(s,"children",7,void 0);const ze=o(()=>G()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const qe=Qt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{je.dispatch(Xt())});function Ze(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Qe=Zt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Ze),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Dt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Z()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Bt}]:[]];return!Qe||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),Se=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Z()&&(await navigator.clipboard.writeText(Z()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?Be(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){je.dispatch(Yt(e)),Oe(e),Be(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return G()},set variant(e="default"){G(e),g()},get branchName(){return Z()},set branchName(e){Z(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Q()},set inline(e=!1){Q(e),g()},get iconOnly(){return V()},set iconOnly(e=!1){V(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:_t,$on:(e,d)=>vt(s,e,d)},He=L(),ot=_(He);{var at=e=>{var d=he(),u=_(d);{var p=j=>{var F=he(),D=_(F);S(D,()=>qt,(T,C)=>{C(T,{children:(c,J)=>{var h=he(),$=_(h);S($,()=>Jt,(a,i)=>{i(a,{get icon(){return Ge},children:(y,H)=>{var m=fr(),P=oe(m,!0);W(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,m)},$$slots:{default:!0}})});var n=N($,2);S(n,()=>Kt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=N(D,2);S(k,()=>Ve,(T,C)=>{C(T,{})}),r(j,F)};z(u,j=>{t(fe).length&&j(p)})}var te=N(u,2);le(te,()=>t(Se)),r(e,d)},nt=e=>{var d=yr(),u=be(d);{const p=(F,D)=>{let k=()=>(D?.()).props;var T=L(),C=_(T);{var c=n=>{var a=mr();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=be(a);We(i,R),_e(a),r(n,a)},J=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>V()&&G()!=="sidebar"?"plain":"ghost"),y=o(()=>V()?G()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>V()&&G()==="sidebar"&&t(ee)),m=o(()=>!V()),P=o(()=>V()?G()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(m)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var M=L(),B=_(M);We(B,R),r(l,M)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ge},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=be(a);{let m=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(ze)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(m)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,M)=>{var B=_r(),K=_(B);{var re=w=>{var q=br();W(()=>{De(q,"src",`data:image/png;base64,${t(v).iconBase64??""}`),De(q,"alt",t(v).label)}),r(w,q)},it=w=>{const q=o(()=>t(v).icon);var Me=L(),pt=_(Me);S(pt,()=>t(q),(ft,mt)=>{mt(ft,{size:14})}),r(w,Me)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let q=o(()=>Je(t(v).category));ne(w,{get icon(){return t(q)},class:"w-3.5 h-3.5 opacity-60"})}};z(K,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=N(K,2),ut=oe(dt,!0);W(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,B)},$$slots:{default:!0}})}var y=N(i,2);{var H=m=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(m,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(ze)??""}`},children:(l,A)=>{ne(l,{get icon(){return Lt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};z(y,m=>{t(f).length>1&&m(H)})}_e(a),r(n,a)};z(C,n=>{Q()&&R()?n(c):R()?n(J,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var D=hr(),k=be(D);{var T=h=>{var $=vr(),n=oe($,!0);W(()=>ae(n,ue())),r(h,$)};z(k,h=>{ue()&&h(T)})}var C=N(k,2);{var c=h=>{var $=he(),n=_($);le(n,()=>t(fe));var a=N(n,2);S(a,()=>Ve,(i,y)=>{y(i,{})}),r(h,$)};z(C,h=>{t(fe).length&&h(c)})}var J=N(C,2);le(J,()=>t(Se)),_e(D),r(F,D)};let j=o(()=>Q()&&R()?"contents!":"");Gt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(j)},get open(){return t(ee)},set open(F){Be(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}_e(d),W(()=>Pt(d,1,`${Q()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};z(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return Ke(),st}export{wr as O,sr as a,Je as r,ir as s};
1
+ import{t as bt,bo as b,bw as _t,bq as gt,b as vt,bm as x,bs as me,br as Te}from"./C0QTy0Sy.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as L,ay as _,W as r,bn as It,aA as g,aD as t,bS as N,a5 as be,bH as Be,bA as _e,b_ as W,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./3SdAC2_C.js";import{i as z}from"./bhKPSdq4.js";import{g as $t}from"./B6S6VNu7.js";import{t as We}from"./CrD0jtXE.js";import{c as S}from"./CUkDMZwP.js";import{f as Pt,s as De,b as At}from"./7UPrdiE9.js";import{cK as Et,bn as Ot,aM as Ft,F as ne,aZ as Tt,aN as Bt,bo as Dt,a8 as Ge,aw as Lt}from"./U9jJmfYa.js";import{W as Nt,T as zt,G as St,C as Rt,X as Ht,J as Mt,V as Wt}from"./Y5Ky10uA.js";import{f as ge}from"./FzlZUztb.js";import"./DCRuihKm.js";import{D as Gt}from"./Cqa6LF3b.js";import{g as Vt,R as jt,k as Jt,j as Kt,i as qt,h as Ve}from"./fiz8N_zQ.js";import{m as ve}from"./BmTMWrby.js";import{c as Ut}from"./ChTqQfQN.js";import"./B4SiDSWP.js";import{Jv as je,ng as Xt,Ga as Yt}from"./tr-2J8Mf.js";import{w as Zt}from"./Bqd7fdCF.js";import{i as U}from"./CL3a4Hm1.js";import{b3 as Qt,aN as er,aL as tr}from"./BFgeFHTs.js";import{cB as rr}from"./BaujsV9k.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:St,terminal:zt,warp:Nt},nr={vscode:Wt,jetbrains:Mt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function Je(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Le="finder",lr={id:Le,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Le)||se.has(Le)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),mr=E("<span><!></span>"),br=E('<img class="w-4 h-4"/>'),_r=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return bt({component:wr,...O});ht(s,!0);const se=()=>me(Ue,"$installedEditors$",ie),X=()=>me(Xe,"$hiddenEditorIds$",ie),Y=()=>me(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>me(qe,"$openAction",ie),[ie,Ke]=gt(),le=(e,d=kt)=>{var u=L(),p=_(u);S(p,()=>jt,(te,j)=>{j(te,{get value(){return t(v).id},children:(F,D)=>{var k=L(),T=_(k);$t(T,17,d,C=>C.id,(C,c)=>{var J=L(),h=_(J);{const $=a=>{var i=L(),y=_(i);{var H=l=>{var A=dr();W(()=>De(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},m=l=>{const A=o(()=>t(c).icon);var M=L(),B=_(M);S(B,()=>t(A),(K,re)=>{re(K,{size:16})}),r(l,M)},P=l=>{{let A=o(()=>t(c).faIcon??Je(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};z(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(m,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());S(h,()=>Vt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var m=pr(),P=_(m),l=oe(P,!0),A=N(P,2);{var M=B=>{var K=ur(),re=oe(K,!0);W(()=>ae(re,t(c).shortcut)),r(B,K)};z(A,B=>{t(c).shortcut&&B(M)})}W(()=>ae(l,t(c).label)),r(y,m)},$$slots:{leading:!0,default:!0}})})}r(C,J)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=b(s,"filePath",7),ce=b(s,"workspaceId",7,""),de=b(s,"isDirectory",7,!0),we=b(s,"workspaceFolderPath",7),xe=b(s,"class",7,""),ue=b(s,"headerText",7),Ie=b(s,"usePortal",7,!0),ke=b(s,"side",7,"bottom"),G=b(s,"variant",7,"default"),Z=b(s,"branchName",7),Ce=b(s,"compact",7,!1),$e=b(s,"embedded",7,!1),Q=b(s,"inline",7,!1),V=b(s,"iconOnly",7,!1),R=b(s,"children",7,void 0);const ze=o(()=>G()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const qe=Qt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{je.dispatch(Xt())});function Ze(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Qe=Zt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Ze),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Dt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Z()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Bt}]:[]];return!Qe||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),Se=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Z()&&(await navigator.clipboard.writeText(Z()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?Be(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){je.dispatch(Yt(e)),Oe(e),Be(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return G()},set variant(e="default"){G(e),g()},get branchName(){return Z()},set branchName(e){Z(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Q()},set inline(e=!1){Q(e),g()},get iconOnly(){return V()},set iconOnly(e=!1){V(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:_t,$on:(e,d)=>vt(s,e,d)},He=L(),ot=_(He);{var at=e=>{var d=he(),u=_(d);{var p=j=>{var F=he(),D=_(F);S(D,()=>qt,(T,C)=>{C(T,{children:(c,J)=>{var h=he(),$=_(h);S($,()=>Jt,(a,i)=>{i(a,{get icon(){return Ge},children:(y,H)=>{var m=fr(),P=oe(m,!0);W(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,m)},$$slots:{default:!0}})});var n=N($,2);S(n,()=>Kt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=N(D,2);S(k,()=>Ve,(T,C)=>{C(T,{})}),r(j,F)};z(u,j=>{t(fe).length&&j(p)})}var te=N(u,2);le(te,()=>t(Se)),r(e,d)},nt=e=>{var d=yr(),u=be(d);{const p=(F,D)=>{let k=()=>(D?.()).props;var T=L(),C=_(T);{var c=n=>{var a=mr();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=be(a);We(i,R),_e(a),r(n,a)},J=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>V()&&G()!=="sidebar"?"plain":"ghost"),y=o(()=>V()?G()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>V()&&G()==="sidebar"&&t(ee)),m=o(()=>!V()),P=o(()=>V()?G()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(m)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var M=L(),B=_(M);We(B,R),r(l,M)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ge},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=be(a);{let m=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(ze)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(m)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,M)=>{var B=_r(),K=_(B);{var re=w=>{var q=br();W(()=>{De(q,"src",`data:image/png;base64,${t(v).iconBase64??""}`),De(q,"alt",t(v).label)}),r(w,q)},it=w=>{const q=o(()=>t(v).icon);var Me=L(),pt=_(Me);S(pt,()=>t(q),(ft,mt)=>{mt(ft,{size:14})}),r(w,Me)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let q=o(()=>Je(t(v).category));ne(w,{get icon(){return t(q)},class:"w-3.5 h-3.5 opacity-60"})}};z(K,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=N(K,2),ut=oe(dt,!0);W(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,B)},$$slots:{default:!0}})}var y=N(i,2);{var H=m=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(m,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(ze)??""}`},children:(l,A)=>{ne(l,{get icon(){return Lt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};z(y,m=>{t(f).length>1&&m(H)})}_e(a),r(n,a)};z(C,n=>{Q()&&R()?n(c):R()?n(J,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var D=hr(),k=be(D);{var T=h=>{var $=vr(),n=oe($,!0);W(()=>ae(n,ue())),r(h,$)};z(k,h=>{ue()&&h(T)})}var C=N(k,2);{var c=h=>{var $=he(),n=_($);le(n,()=>t(fe));var a=N(n,2);S(a,()=>Ve,(i,y)=>{y(i,{})}),r(h,$)};z(C,h=>{t(fe).length&&h(c)})}var J=N(C,2);le(J,()=>t(Se)),_e(D),r(F,D)};let j=o(()=>Q()&&R()?"contents!":"");Gt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(j)},get open(){return t(ee)},set open(F){Be(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}_e(d),W(()=>Pt(d,1,`${Q()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};z(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return Ke(),st}export{wr as O,sr as a,Je as r,ir as s};
@@ -1,4 +1,4 @@
1
- import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./cebxNJuC.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
1
+ import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./Ckb6le-m.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
2
2
  M`,t,n),e.push(`
3
3
  m`,-s,0),e.push(`
4
4
  a`,s,s,0,1,0,s*2,0),e.push(`
@@ -1 +1 @@
1
- import{aB as v,b as y}from"./cebxNJuC.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
1
+ import{aB as v,b as y}from"./Ckb6le-m.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
@@ -1 +1 @@
1
- import{h7 as O,gP as J,JJ as P,Kx as U,Dv as j,u4 as q,v1 as K,A_ as N,A$ as V,JH as z,JI as Q,B0 as X}from"./tr-2J8Mf.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./S845NCb3.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./EK6zOAHM.js";import{g as ne}from"./DE7dSDHO.js";import{bm as l}from"./C0QTy0Sy.js";import{z as oe,S as y}from"./DCRuihKm.js";import{B as h,S as C,Q as ce}from"./Bqd7fdCF.js";import{al as le,aj as E}from"./DEVX5wOm.js";import{g as se}from"./hHMYoFyG.js";function A(e,a){const n=f.select(e.state),o=S.select(e.state);if(!o)return null;const c=n.indexOf(o),s=c+(a==="left"?-1:1),p=n[s];return c<0||!p?null:(e.dispatch(q(o,p,a==="left"?"before":"after")),o)}function B(e){const a=S.select(e);return a&&f.select(e).includes(a)?a:null}function m(e,a,n){const o=B(e.state),c=o?`/workspace/${o}`:ne(e.state);return a!==c&&n(c),o}function ie(e,a,n,o){return e.dispatch(O(a)),m(e,n,o),a}function I(e,a){const o=a.match(/^\/workspace\/([^/]+)/)?.[1];return o?o==="new"?null:o:null}function R(e,a,n,o){if(n==="/")return D(e,a==="next"?0:"last",n,o);e.dispatch(a==="next"?z():Q());const c=S.select(e.state);if(!c)return null;const s=`/workspace/${c}`;return n!==s&&o(s),c}function re(e,a,n){const o=I(e,a);return o?ie(e,o,a,n):null}function pe(e,a,n){const o=I(e,a);if(!o)return null;const c=Z.select(e.state,o);if(!c)return null;const s=c.tabs.find(v=>v.id===c.activeTabId),p=c.tabs.length===0&&c.activeTabId===null,g=M.select(e.state,o)>1&&(p||c.tabs.length===1&&s!==void 0&&s.closable!==!1);if((!s||s.closable===!1)&&!g)return null;const T=n??se(o)?.availableCanvasWidth??void 0;return e.dispatch(J(o,void 0,T)),s?.id??c.id}function ue(e,a){const n=e.state.panelLayout.byWorkspaceId[a];return!n||n.restoreStatus==="pending"?!1:ee.select(e.state,a).length===0}function de(e,a,n){B(e.state)||e.dispatch(P(0)),m(e,a,n)}function L(e,a,{navigate:n,closeWindow:o}){return o?(o(),"window"):(m(e,a,n),null)}function be(e,a,n){const o=I(e,a);return o?pe(e,a,n.availableCanvasWidth)!==null?"panel":ue(e,o)?(e.dispatch(O(o)),f.select(e.state).length>0?(de(e,a,n.navigate),"workspace"):L(e,a,n)??"workspace"):null:f.select(e.state).length>0?null:L(e,a,n)}function fe(e,a,n){return e.dispatch(X()),m(e,a,n)}function ke(e,a,n){const o=a.match(/^\/workspace\/([^/]+)/),c=o&&o[1]!=="new"?o[1]:null,s=Y.select(e.state),p=c?ae.select(e.state,c):null;return c&&p&&(!s||p.closedAt>=s.closedAt)?p.kind==="column"?(e.dispatch(N(c)),"column"):(e.dispatch(V(c)),p.kind):s?(fe(e,a,n),"workspace"):null}function _e(e,a){const n=a.match(/^\/workspace\/([^/]+)/),o=n&&n[1]!=="new"?n[1]:null;if(!o)return null;const c=K(o);return e.dispatch(c),te.select(e.state,o)}function D(e,a,n,o){const c=f.select(e.state),s=a==="last"?c.length-1:a;return s<0||s>=c.length?null:(e.dispatch(P(s)),m(e,n,o))}function We({isMac:e,register:a,store:n,getCurrentPath:o,navigate:c,openNewWorkspace:s,getRailMachineIds:p,onCreateAgent:g,onCreateNote:T,onCreateTerminal:v,onCreateBrowser:$,onWorkspaceTabMoved:W,closeWindow:F,resolveBinding:w}){const r=e?{meta:!0}:{ctrl:!0},G=oe("TOGGLE_SIDEBAR",e),k=t=>()=>t(o()),H=t=>()=>{const i=o().match(/^\/workspace\/([^/]+)/);i?.[1]&&i[1]!=="new"&&t(i[1])},u=t=>w?{binding:()=>w(t)}:{},_=t=>w?.(t)??ce(t);a({...u("global.new-space"),...r,key:"n",global:!0,description:l.workspace_shortcuts_newSpace_description(),action:s}),a({...u("panel.toggle-sidebar"),...G,global:!0,description:y.TOGGLE_SIDEBAR.label,action:()=>n.dispatch(U())}),a({...u("navigation.new-tab"),...r,key:"t",global:!0,description:l.workspace_shortcuts_newPanel_description(),action:k(t=>_e(n,t))});for(const[t,i,b,d]of[["workspace.new-agent","a",l.ui_shortcuts_newAgent_label(),g],["workspace.new-note","n",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_note_label()}),T],["workspace.new-terminal","t",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_terminal_label()}),v],["workspace.new-browser","b",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_browser_label()}),$]])d&&a({...u(t),...r,key:i,alt:!0,global:!0,allowInTerminal:!0,description:b,action:H(d)});a({...u("navigation.close-tab"),...r,key:"w",global:!0,description:l.workspace_shortcuts_closePanelTab_description(),action:k(t=>be(n,t,{navigate:c,closeWindow:F}))}),a({...u("navigation.close-space-tab"),...r,key:"w",shift:!0,global:!0,description:l.workspace_shortcuts_closeSpaceTab_description(),action:k(t=>re(n,t,c))}),a({...u("navigation.reopen-tab"),...r,key:"t",shift:!0,global:!0,description:l.workspace_shortcuts_reopenClosedTabOrSpace_description(),action:k(t=>ke(n,t,c))}),a({...u("navigation.move-space-tab-left"),...r,key:"ArrowLeft",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_LEFT.label,action:()=>{const t=A(n,"left");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}}),a({...u("navigation.move-space-tab-right"),...r,key:"ArrowRight",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_RIGHT.label,action:()=>{const t=A(n,"right");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}});for(const[t,i]of[["next",!1],["previous",!0]]){a({...u(t==="next"?"global.next-space":"global.previous-space"),key:"Tab",ctrl:!0,shift:i,global:!0,description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))});const b=t==="next"?"global.next-space-alt":"global.previous-space-alt";a({...u(b),...r,key:t==="next"?"}":"{",shift:!0,global:!0,allowInTerminal:!0,preferLocal:!0,enabled:d=>!w||!h(b,d,w,e),description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))})}const x=t=>{t===1?c("/"):D(n,t===9?"last":t-2,o(),c)};for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>_("navigation.go-to-device").replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>E.select(n.state)&&!h("navigation.go-to-device",i,_,e),description:l.machineRail_nav_ariaLabel(),action:()=>{const i=p?.()??le.select(n.state).map(d=>d.id),b=i[t===9?i.length-1:t-1];b&&n.dispatch(j(b))}});for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>C["navigation.go-to-device"].replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>!E.select(n.state)&&_("navigation.go-to-tab")===C["navigation.go-to-tab"]&&!h("navigation.go-to-device",i,_,e),description:l.ui_shortcuts_goToTab_label(),action:()=>x(t)});for(let t=1;t<=9;t++)a({binding:()=>_("navigation.go-to-tab").replace(/([1-8])-9$/,String(t)),...r,alt:!0,key:String(t),global:!0,allowInTerminal:!0,enabled:i=>!h("navigation.go-to-tab",i,_,e),description:t===1?l.home_navigation_description():t===9?l.workspace_shortcuts_selectLastSpaceTab_description():l.workspace_shortcuts_selectSpaceTab_description({digit:t}),action:()=>x(t)})}export{be as c,We as r};
1
+ import{h7 as O,gP as J,JJ as P,Kx as U,Dv as j,u4 as q,v1 as K,A_ as N,A$ as V,JH as z,JI as Q,B0 as X}from"./tr-2J8Mf.js";import{selectWorkspaceTabOrder as f,selectCurrentWorkspaceTabId as S,selectLastClosedWorkspaceTab as Y}from"./S845NCb3.js";import{i as Z,q as M,b as ee,j as te,l as ae}from"./EK6zOAHM.js";import{g as ne}from"./CI9sv_EP.js";import{bm as l}from"./C0QTy0Sy.js";import{z as oe,S as y}from"./DCRuihKm.js";import{B as h,S as C,Q as ce}from"./Bqd7fdCF.js";import{al as le,aj as E}from"./CrFyLBfi.js";import{g as se}from"./hHMYoFyG.js";function A(e,a){const n=f.select(e.state),o=S.select(e.state);if(!o)return null;const c=n.indexOf(o),s=c+(a==="left"?-1:1),p=n[s];return c<0||!p?null:(e.dispatch(q(o,p,a==="left"?"before":"after")),o)}function B(e){const a=S.select(e);return a&&f.select(e).includes(a)?a:null}function m(e,a,n){const o=B(e.state),c=o?`/workspace/${o}`:ne(e.state);return a!==c&&n(c),o}function ie(e,a,n,o){return e.dispatch(O(a)),m(e,n,o),a}function I(e,a){const o=a.match(/^\/workspace\/([^/]+)/)?.[1];return o?o==="new"?null:o:null}function R(e,a,n,o){if(n==="/")return D(e,a==="next"?0:"last",n,o);e.dispatch(a==="next"?z():Q());const c=S.select(e.state);if(!c)return null;const s=`/workspace/${c}`;return n!==s&&o(s),c}function re(e,a,n){const o=I(e,a);return o?ie(e,o,a,n):null}function pe(e,a,n){const o=I(e,a);if(!o)return null;const c=Z.select(e.state,o);if(!c)return null;const s=c.tabs.find(v=>v.id===c.activeTabId),p=c.tabs.length===0&&c.activeTabId===null,g=M.select(e.state,o)>1&&(p||c.tabs.length===1&&s!==void 0&&s.closable!==!1);if((!s||s.closable===!1)&&!g)return null;const T=n??se(o)?.availableCanvasWidth??void 0;return e.dispatch(J(o,void 0,T)),s?.id??c.id}function ue(e,a){const n=e.state.panelLayout.byWorkspaceId[a];return!n||n.restoreStatus==="pending"?!1:ee.select(e.state,a).length===0}function de(e,a,n){B(e.state)||e.dispatch(P(0)),m(e,a,n)}function L(e,a,{navigate:n,closeWindow:o}){return o?(o(),"window"):(m(e,a,n),null)}function be(e,a,n){const o=I(e,a);return o?pe(e,a,n.availableCanvasWidth)!==null?"panel":ue(e,o)?(e.dispatch(O(o)),f.select(e.state).length>0?(de(e,a,n.navigate),"workspace"):L(e,a,n)??"workspace"):null:f.select(e.state).length>0?null:L(e,a,n)}function fe(e,a,n){return e.dispatch(X()),m(e,a,n)}function ke(e,a,n){const o=a.match(/^\/workspace\/([^/]+)/),c=o&&o[1]!=="new"?o[1]:null,s=Y.select(e.state),p=c?ae.select(e.state,c):null;return c&&p&&(!s||p.closedAt>=s.closedAt)?p.kind==="column"?(e.dispatch(N(c)),"column"):(e.dispatch(V(c)),p.kind):s?(fe(e,a,n),"workspace"):null}function _e(e,a){const n=a.match(/^\/workspace\/([^/]+)/),o=n&&n[1]!=="new"?n[1]:null;if(!o)return null;const c=K(o);return e.dispatch(c),te.select(e.state,o)}function D(e,a,n,o){const c=f.select(e.state),s=a==="last"?c.length-1:a;return s<0||s>=c.length?null:(e.dispatch(P(s)),m(e,n,o))}function We({isMac:e,register:a,store:n,getCurrentPath:o,navigate:c,openNewWorkspace:s,getRailMachineIds:p,onCreateAgent:g,onCreateNote:T,onCreateTerminal:v,onCreateBrowser:$,onWorkspaceTabMoved:W,closeWindow:F,resolveBinding:w}){const r=e?{meta:!0}:{ctrl:!0},G=oe("TOGGLE_SIDEBAR",e),k=t=>()=>t(o()),H=t=>()=>{const i=o().match(/^\/workspace\/([^/]+)/);i?.[1]&&i[1]!=="new"&&t(i[1])},u=t=>w?{binding:()=>w(t)}:{},_=t=>w?.(t)??ce(t);a({...u("global.new-space"),...r,key:"n",global:!0,description:l.workspace_shortcuts_newSpace_description(),action:s}),a({...u("panel.toggle-sidebar"),...G,global:!0,description:y.TOGGLE_SIDEBAR.label,action:()=>n.dispatch(U())}),a({...u("navigation.new-tab"),...r,key:"t",global:!0,description:l.workspace_shortcuts_newPanel_description(),action:k(t=>_e(n,t))});for(const[t,i,b,d]of[["workspace.new-agent","a",l.ui_shortcuts_newAgent_label(),g],["workspace.new-note","n",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_note_label()}),T],["workspace.new-terminal","t",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_terminal_label()}),v],["workspace.new-browser","b",l.layout_panelEmptyState_newItem_tooltip({label:l.layout_panelEmptyState_browser_label()}),$]])d&&a({...u(t),...r,key:i,alt:!0,global:!0,allowInTerminal:!0,description:b,action:H(d)});a({...u("navigation.close-tab"),...r,key:"w",global:!0,description:l.workspace_shortcuts_closePanelTab_description(),action:k(t=>be(n,t,{navigate:c,closeWindow:F}))}),a({...u("navigation.close-space-tab"),...r,key:"w",shift:!0,global:!0,description:l.workspace_shortcuts_closeSpaceTab_description(),action:k(t=>re(n,t,c))}),a({...u("navigation.reopen-tab"),...r,key:"t",shift:!0,global:!0,description:l.workspace_shortcuts_reopenClosedTabOrSpace_description(),action:k(t=>ke(n,t,c))}),a({...u("navigation.move-space-tab-left"),...r,key:"ArrowLeft",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_LEFT.label,action:()=>{const t=A(n,"left");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}}),a({...u("navigation.move-space-tab-right"),...r,key:"ArrowRight",alt:!0,shift:!0,global:!0,description:y.MOVE_SPACE_TAB_RIGHT.label,action:()=>{const t=A(n,"right");t&&W?.({workspaceId:t,position:f.select(n.state).indexOf(t)+1})}});for(const[t,i]of[["next",!1],["previous",!0]]){a({...u(t==="next"?"global.next-space":"global.previous-space"),key:"Tab",ctrl:!0,shift:i,global:!0,description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))});const b=t==="next"?"global.next-space-alt":"global.previous-space-alt";a({...u(b),...r,key:t==="next"?"}":"{",shift:!0,global:!0,allowInTerminal:!0,preferLocal:!0,enabled:d=>!w||!h(b,d,w,e),description:t==="next"?l.workspace_shortcuts_nextSpaceTab_description():l.workspace_shortcuts_previousSpaceTab_description(),action:k(d=>R(n,t,d,c))})}const x=t=>{t===1?c("/"):D(n,t===9?"last":t-2,o(),c)};for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>_("navigation.go-to-device").replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>E.select(n.state)&&!h("navigation.go-to-device",i,_,e),description:l.machineRail_nav_ariaLabel(),action:()=>{const i=p?.()??le.select(n.state).map(d=>d.id),b=i[t===9?i.length-1:t-1];b&&n.dispatch(j(b))}});for(let t=1;t<=9;t++)a({...r,key:String(t),binding:()=>C["navigation.go-to-device"].replace(/([1-8])-9$/,String(t)),global:!0,allowInTerminal:!0,enabled:i=>!E.select(n.state)&&_("navigation.go-to-tab")===C["navigation.go-to-tab"]&&!h("navigation.go-to-device",i,_,e),description:l.ui_shortcuts_goToTab_label(),action:()=>x(t)});for(let t=1;t<=9;t++)a({binding:()=>_("navigation.go-to-tab").replace(/([1-8])-9$/,String(t)),...r,alt:!0,key:String(t),global:!0,allowInTerminal:!0,enabled:i=>!h("navigation.go-to-tab",i,_,e),description:t===1?l.home_navigation_description():t===9?l.workspace_shortcuts_selectLastSpaceTab_description():l.workspace_shortcuts_selectSpaceTab_description({digit:t}),action:()=>x(t)})}export{be as c,We as r};