@intent-hq/web 2.380.0 → 2.380.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/{CDH3wgh9.js → 2V-FT4ZN.js} +1 -1
  3. package/web/app/immutable/chunks/{C3bHv6vj.js → 2tIg3zRC.js} +1 -1
  4. package/web/app/immutable/chunks/{BnnqUrrA.js → 3XDqrO07.js} +1 -1
  5. package/web/app/immutable/chunks/{DkIpepCI.js → 4IwpvVwZ.js} +1 -1
  6. package/web/app/immutable/chunks/{CujTNdGM.js → 4TQ-wOQj.js} +1 -1
  7. package/web/app/immutable/chunks/{B30IEaPI.js → 4dEsEkEW.js} +1 -1
  8. package/web/app/immutable/chunks/{wlRwGgvg.js → 8yY720EA.js} +1 -1
  9. package/web/app/immutable/chunks/{CPN1a4ER.js → 9Z-CGmW0.js} +1 -1
  10. package/web/app/immutable/chunks/{jnsZrPVB.js → 9kN-cZth.js} +1 -1
  11. package/web/app/immutable/chunks/{BQ_H_anx.js → B2KdznJa.js} +1 -1
  12. package/web/app/immutable/chunks/{Ble6-g5B.js → B4vl19YV.js} +1 -1
  13. package/web/app/immutable/chunks/{CYzN5BWb.js → B6aNgl-u.js} +6 -6
  14. package/web/app/immutable/chunks/{BYdTAlbb.js → B6kWt-NF.js} +1 -1
  15. package/web/app/immutable/chunks/{CUPLSgMR.js → BCME5FCI.js} +2 -2
  16. package/web/app/immutable/chunks/{BZIO5H42.js → BEWzvyPM.js} +1 -1
  17. package/web/app/immutable/chunks/{DPjD0DQx.js → BGIIIhAt.js} +3 -3
  18. package/web/app/immutable/chunks/{CqoNhUOR.js → BHM1cyPv.js} +1 -1
  19. package/web/app/immutable/chunks/{rull8DFa.js → BHQUrNk1.js} +3 -3
  20. package/web/app/immutable/chunks/{DECU-iIP.js → BNq2Q1Ih.js} +1 -1
  21. package/web/app/immutable/chunks/{CCQ7UDrk.js → BO6AmRhX.js} +1 -1
  22. package/web/app/immutable/chunks/{C3YmofVF.js → BOzhtrmb.js} +1 -1
  23. package/web/app/immutable/chunks/{BUvix1Kg.js → BPsBKYg_.js} +1 -1
  24. package/web/app/immutable/chunks/{D6N7T3x-.js → BT-SBMwG.js} +1 -1
  25. package/web/app/immutable/chunks/{DBOKH6iU.js → BUrKWYyT.js} +1 -1
  26. package/web/app/immutable/chunks/{DquFvZKr.js → BUs9PHLx.js} +1 -1
  27. package/web/app/immutable/chunks/{BXTpY5y8.js → BVVQo5Xu.js} +1 -1
  28. package/web/app/immutable/chunks/{e0tyUrux.js → BVZYGKUs.js} +1 -1
  29. package/web/app/immutable/chunks/{BYqjqyqc.js → BVls_E6i.js} +1 -1
  30. package/web/app/immutable/chunks/{CUwvPGZB.js → BYW8f2oV.js} +2 -2
  31. package/web/app/immutable/chunks/{Zxq4ML42.js → BYeqTXC2.js} +1 -1
  32. package/web/app/immutable/chunks/{CK_RweuK.js → BYm3oGAs.js} +1 -1
  33. package/web/app/immutable/chunks/{CE6R-dRp.js → BZUgE8w7.js} +1 -1
  34. package/web/app/immutable/chunks/{Be831IP4.js → BbCHGRAU.js} +1 -1
  35. package/web/app/immutable/chunks/{CLfdXuzT.js → Bd-3nxyB.js} +1 -1
  36. package/web/app/immutable/chunks/{BiBcmvkl.js → Bondcgar.js} +1 -1
  37. package/web/app/immutable/chunks/{B3Jw9XtV.js → BpY_21Cw.js} +4 -4
  38. package/web/app/immutable/chunks/{B7X-AK1d.js → Bs12y6Hh.js} +3 -3
  39. package/web/app/immutable/chunks/{C8C4dK2T.js → Btjc8Ky7.js} +1 -1
  40. package/web/app/immutable/chunks/{s3btz0Xv.js → BvGA2PYn.js} +1 -1
  41. package/web/app/immutable/chunks/{vNGikJQC.js → BvjokUWx.js} +1 -1
  42. package/web/app/immutable/chunks/{DNqGTO8s.js → Bwkbh1IC.js} +1 -1
  43. package/web/app/immutable/chunks/{ssAJdhye.js → C3btDKsC.js} +2 -2
  44. package/web/app/immutable/chunks/{DZMawptX.js → C5UZ-z7q.js} +2 -2
  45. package/web/app/immutable/chunks/{7bi3ZM7b.js → C7tMlsfz.js} +1 -1
  46. package/web/app/immutable/chunks/{BfAkJ2nl.js → C7vUMkVq.js} +1 -1
  47. package/web/app/immutable/chunks/{DvzNnLaI.js → CABtGAhT.js} +1 -1
  48. package/web/app/immutable/chunks/{Da34V0LY.js → CBpGFpXN.js} +1 -1
  49. package/web/app/immutable/chunks/{CNkRMqxA.js → CC0zIW-Q.js} +1 -1
  50. package/web/app/immutable/chunks/{AVD8By0j.js → CK0iX2TE.js} +1 -1
  51. package/web/app/immutable/chunks/{SRwBzLT8.js → CM22-mrT.js} +1 -1
  52. package/web/app/immutable/chunks/{DLpVNAiX.js → CMYiw90g.js} +1 -1
  53. package/web/app/immutable/chunks/{C6D8Jg6d.js → CN4T3mPu.js} +1 -1
  54. package/web/app/immutable/chunks/{5xu6eN4Z.js → COAAEUqs.js} +1 -1
  55. package/web/app/immutable/chunks/{BiGdiG6Z.js → CP6uC9cs.js} +1 -1
  56. package/web/app/immutable/chunks/{CFtiaJsb.js → CT1DR1ub.js} +1 -1
  57. package/web/app/immutable/chunks/{DASiBrIg.js → CU8fY_M-.js} +1 -1
  58. package/web/app/immutable/chunks/{ByytepOR.js → CXHQfPPq.js} +1 -1
  59. package/web/app/immutable/chunks/{CL7ZHYqg.js → CY6yMXcg.js} +1 -1
  60. package/web/app/immutable/chunks/{FRR_nxmc.js → CYkq1Sp7.js} +1 -1
  61. package/web/app/immutable/chunks/{CztIXNWc.js → Cd3YgLQX.js} +1 -1
  62. package/web/app/immutable/chunks/{BRRF7Md4.js → CdaU-PJY.js} +1 -1
  63. package/web/app/immutable/chunks/{CcxCR0t4.js → CeRXl9-a.js} +4 -4
  64. package/web/app/immutable/chunks/{D_4kRlvm.js → CeyWhdyo.js} +3 -3
  65. package/web/app/immutable/chunks/{DGR5PXqy.js → CgfPG4f5.js} +1 -1
  66. package/web/app/immutable/chunks/{DMvzpJTu.js → ChbSsiLP.js} +1 -1
  67. package/web/app/immutable/chunks/{B9NJITfb.js → ChsjUXyy.js} +1 -1
  68. package/web/app/immutable/chunks/{DWFswrSL.js → CjVluV7J.js} +1 -1
  69. package/web/app/immutable/chunks/{DnURDD89.js → ClRyc1RP.js} +3 -3
  70. package/web/app/immutable/chunks/{CBavoRbP.js → CpggW3GS.js} +1 -1
  71. package/web/app/immutable/chunks/{wY2249Ev.js → CpkJczBg.js} +1 -1
  72. package/web/app/immutable/chunks/{CLII-C57.js → CszQUuHS.js} +1 -1
  73. package/web/app/immutable/chunks/{C_KorY3-.js → Cvu5TPZ8.js} +1 -1
  74. package/web/app/immutable/chunks/{DpeKTeH0.js → Cw8_SJ4E.js} +1 -1
  75. package/web/app/immutable/chunks/{CfCVG4Rx.js → Cz2wArhm.js} +1 -1
  76. package/web/app/immutable/chunks/{DItMEnLb.js → D1bYGUz7.js} +1 -1
  77. package/web/app/immutable/chunks/{Do-rG8en.js → D4xidzA_.js} +1 -1
  78. package/web/app/immutable/chunks/{BH8UijQb.js → D5caROAF.js} +4 -4
  79. package/web/app/immutable/chunks/{C9GkUc94.js → D5xVaXHm.js} +1 -1
  80. package/web/app/immutable/chunks/{D5zI85k6.js → D7DlvngK.js} +1 -1
  81. package/web/app/immutable/chunks/{DgHJcjPY.js → D9uTgrXZ.js} +1 -1
  82. package/web/app/immutable/chunks/{DOdPMDnB.js → DBfX4Zz1.js} +1 -1
  83. package/web/app/immutable/chunks/{C4Sy5w4s.js → DDZsOuFy.js} +1 -1
  84. package/web/app/immutable/chunks/{DhP0_QuO.js → DGsSBTnE.js} +1 -1
  85. package/web/app/immutable/chunks/{CgsTiBK2.js → DH97ZRMJ.js} +2 -2
  86. package/web/app/immutable/chunks/{BsfvLYaY.js → DKEI0MVx.js} +1 -1
  87. package/web/app/immutable/chunks/{C4yj51Vt.js → DKushSGX.js} +1 -1
  88. package/web/app/immutable/chunks/{CRT5yBYQ.js → DLNiSKjY.js} +1 -1
  89. package/web/app/immutable/chunks/{BaqP50r9.js → DP1oZD4h.js} +1 -1
  90. package/web/app/immutable/chunks/{-Wss3p71.js → DU4vrWyh.js} +13 -13
  91. package/web/app/immutable/chunks/{2txgxj9r.js → DX_XAJ78.js} +2 -2
  92. package/web/app/immutable/chunks/{BBJQ4-nf.js → DXlnaAqr.js} +1 -1
  93. package/web/app/immutable/chunks/{CVS0TTpd.js → DXxcUvjl.js} +1 -1
  94. package/web/app/immutable/chunks/{CbJ0LpjU.js → D_kqKAPb.js} +1 -1
  95. package/web/app/immutable/chunks/{iMaMvcYZ.js → DcVQUcOT.js} +1 -1
  96. package/web/app/immutable/chunks/{DnuHjHFq.js → Df0tkK9d.js} +1 -1
  97. package/web/app/immutable/chunks/{D57UIjlo.js → DfaT6T2d.js} +1 -1
  98. package/web/app/immutable/chunks/{CB1h-wDc.js → DgHQu-vA.js} +1 -1
  99. package/web/app/immutable/chunks/{B2jkYe3V.js → Dlr9TJoI.js} +1 -1
  100. package/web/app/immutable/chunks/{DuWApQdO.js → DlzMT6wV.js} +1 -1
  101. package/web/app/immutable/chunks/{Ctn4iaf0.js → Dm-G_mI5.js} +1 -1
  102. package/web/app/immutable/chunks/{DPmIsnKt.js → DmRVnIPJ.js} +1 -1
  103. package/web/app/immutable/chunks/{DE1M1ef4.js → Dpx4iP0s.js} +1 -1
  104. package/web/app/immutable/chunks/{i6OXlSBf.js → Drd1b60V.js} +1 -1
  105. package/web/app/immutable/chunks/{CbGMjgt3.js → DuXKOgBL.js} +1 -1
  106. package/web/app/immutable/chunks/{CUWIRmNB.js → DwHA7V2D.js} +1 -1
  107. package/web/app/immutable/chunks/{lW75E5gc.js → Dzs4VSAo.js} +1 -1
  108. package/web/app/immutable/chunks/{Cg-C81DM.js → Erflp_L7.js} +1 -1
  109. package/web/app/immutable/chunks/{BrXTXdts.js → H8SQAotj.js} +3 -3
  110. package/web/app/immutable/chunks/{Dvkoo7QM.js → HW5J3T7a.js} +3 -3
  111. package/web/app/immutable/chunks/{DrXnULBv.js → JPasKHb8.js} +2 -2
  112. package/web/app/immutable/chunks/{CWGQdEyp.js → MUcwQb8t.js} +2 -2
  113. package/web/app/immutable/chunks/{D5Ys3IYT.js → P555Pw2w.js} +2 -2
  114. package/web/app/immutable/chunks/{50tAdUJR.js → Q4J_06hE.js} +1 -1
  115. package/web/app/immutable/chunks/{TArFmpEa.js → Qq8kw_LR.js} +1 -1
  116. package/web/app/immutable/chunks/{W3kZhUkG.js → S_Knf_qw.js} +1 -1
  117. package/web/app/immutable/chunks/{B6vL_HfU.js → UEAQx6Yh.js} +2 -2
  118. package/web/app/immutable/chunks/{DFlCKbS0.js → Uqxgj6Y3.js} +1 -1
  119. package/web/app/immutable/chunks/{D43gBypv.js → XnLS-7bS.js} +1 -1
  120. package/web/app/immutable/chunks/{B-SBCaz1.js → YloBm2cw.js} +1 -1
  121. package/web/app/immutable/chunks/{8530J6R1.js → _xgByTRL.js} +1 -1
  122. package/web/app/immutable/chunks/{BTW7La6X.js → aUozHpqP.js} +1 -1
  123. package/web/app/immutable/chunks/{loKq3Zo5.js → aci0ifiz.js} +1 -1
  124. package/web/app/immutable/chunks/{DIZUkYZL.js → euj4yvIS.js} +1 -1
  125. package/web/app/immutable/chunks/{CaYNEsBV.js → hyWBwv6O.js} +3 -3
  126. package/web/app/immutable/chunks/{CLtpiLYb.js → nTzhI5F1.js} +1 -1
  127. package/web/app/immutable/chunks/{C79aLQt9.js → ofygnKUk.js} +1 -1
  128. package/web/app/immutable/chunks/{B-JWrZED.js → vtO9QTmA.js} +1 -1
  129. package/web/app/immutable/entry/{app.CkDtO1q-.js → app.BdrQALQh.js} +2 -2
  130. package/web/app/immutable/entry/start.BqlnF3U7.js +1 -0
  131. package/web/app/immutable/nodes/{0.DvPi8w3E.js → 0.DBZauBI2.js} +1 -1
  132. package/web/app/immutable/nodes/{1.C2bqEog8.js → 1.CPgNb4Lf.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CP4ExDBx.js → 10.DZuMROM9.js} +4 -4
  134. package/web/app/immutable/nodes/{11.Bho5JmtI.js → 11.DPsQWzO9.js} +1 -1
  135. package/web/app/immutable/nodes/{15.DtNQM8td.js → 15.BThkGFQN.js} +1 -1
  136. package/web/app/immutable/nodes/{19.BLmPxWGI.js → 19.CnfYy9JE.js} +2 -2
  137. package/web/app/immutable/nodes/{2.Dda6sH4i.js → 2.BU41VxwM.js} +4 -4
  138. package/web/app/immutable/nodes/{3.BDe_dAcT.js → 3.BlGAsrV5.js} +1 -1
  139. package/web/app/immutable/nodes/{4.C28j9ioo.js → 4.C9rwZlbu.js} +1 -1
  140. package/web/app/immutable/nodes/{5.CE6HGShw.js → 5.B9pXjqPK.js} +1 -1
  141. package/web/app/immutable/nodes/{6.Dz-oxHb7.js → 6.5nx1seqd.js} +1 -1
  142. package/web/app/immutable/nodes/{7.y6iKMGgi.js → 7.DaUM6jFq.js} +1 -1
  143. package/web/app/immutable/nodes/{8.i_Gce-pE.js → 8.BHoZX-hs.js} +1 -1
  144. package/web/app/immutable/nodes/{9.Dc1bO94U.js → 9.E1SwTSp3.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.BS0qtVof.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/D7fB2Oi-.js","/app/immutable/chunks/Dv_tIgjy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BsmBUb2A.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DLx1kqr5.js","/app/immutable/chunks/BPxuNmyn.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/9Uwn0gv1.js","/app/immutable/chunks/CWhRK5Rp.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CXuejdJ2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BqA-3o9l.js","/app/immutable/chunks/B80pUkKE.js","/app/immutable/chunks/DpKzpN4e.js","/app/immutable/chunks/D7nvPiBp.js","/app/immutable/chunks/52P8Bm3E.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CTbHaK7N.js","/app/immutable/chunks/JGtSKGY1.js","/app/immutable/chunks/DDG5E98v.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/ChmjyeX7.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CIlKWLok.js","/app/immutable/chunks/QuFGwYvH.js","/app/immutable/chunks/BN3mO2La.js","/app/immutable/chunks/K5B2RlhX.js","/app/immutable/chunks/pHQ-QxAF.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/Dk6jt2Sr.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/BnnqUrrA.js","/app/immutable/chunks/C3YmofVF.js","/app/immutable/chunks/I4WMrmBa.js","/app/immutable/chunks/Z_oRTxSz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/D6gLzTDC.js","/app/immutable/chunks/KS3jDVZW.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CaXlovz7.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/CUPLSgMR.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/Bsz2ybz8.js","/app/immutable/chunks/3W8n_N-7.js","/app/immutable/chunks/CxTWC0xh.js","/app/immutable/chunks/BivYofy-.js"])))=>i.map(i=>d[i]);
2
- var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./Dv_tIgjy.js";import{Jv as k,CE as M}from"./CWhRK5Rp.js";import{h as O}from"./D7fB2Oi-.js";import{O as W}from"./Bsz2ybz8.js";import{cO as L}from"./DMvzpJTu.js";import{v as x,b7 as U,be as j}from"./C3YmofVF.js";import{a as z}from"./_Ouyy06X.js";const D={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const N="*",Ce=["member","note","agent","file","folder","script","terminal",N,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(N)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),E=this.applyFuzzyMatching(e,S),A=Q(E,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(A,this.config.maxResultsPerKind):A.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./D7fB2Oi-.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./9Uwn0gv1.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BqA-3o9l.js").then(n=>n.ee),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./9Uwn0gv1.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./CWhRK5Rp.js").then(n=>n.MD),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[D.USE_DEFAULT_CONTEXT,D.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./DDG5E98v.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./Dk6jt2Sr.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./BnnqUrrA.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BqA-3o9l.js").then(o=>o.eb);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/D7fB2Oi-.js","/app/immutable/chunks/Dv_tIgjy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BsmBUb2A.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DLx1kqr5.js","/app/immutable/chunks/BPxuNmyn.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/9Uwn0gv1.js","/app/immutable/chunks/CWhRK5Rp.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CXuejdJ2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BqA-3o9l.js","/app/immutable/chunks/B80pUkKE.js","/app/immutable/chunks/DpKzpN4e.js","/app/immutable/chunks/D7nvPiBp.js","/app/immutable/chunks/52P8Bm3E.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CTbHaK7N.js","/app/immutable/chunks/JGtSKGY1.js","/app/immutable/chunks/DDG5E98v.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/ChmjyeX7.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CIlKWLok.js","/app/immutable/chunks/QuFGwYvH.js","/app/immutable/chunks/BN3mO2La.js","/app/immutable/chunks/K5B2RlhX.js","/app/immutable/chunks/pHQ-QxAF.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/Dk6jt2Sr.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/3XDqrO07.js","/app/immutable/chunks/BOzhtrmb.js","/app/immutable/chunks/I4WMrmBa.js","/app/immutable/chunks/Z_oRTxSz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/D6gLzTDC.js","/app/immutable/chunks/KS3jDVZW.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CaXlovz7.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/BCME5FCI.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/Bsz2ybz8.js","/app/immutable/chunks/3W8n_N-7.js","/app/immutable/chunks/CxTWC0xh.js","/app/immutable/chunks/BivYofy-.js"])))=>i.map(i=>d[i]);
2
+ var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./Dv_tIgjy.js";import{Jv as k,CE as M}from"./CWhRK5Rp.js";import{h as O}from"./D7fB2Oi-.js";import{O as W}from"./Bsz2ybz8.js";import{cO as L}from"./ChbSsiLP.js";import{v as x,b7 as U,be as j}from"./BOzhtrmb.js";import{a as z}from"./_Ouyy06X.js";const D={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const N="*",Ce=["member","note","agent","file","folder","script","terminal",N,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(N)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),E=this.applyFuzzyMatching(e,S),A=Q(E,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(A,this.config.maxResultsPerKind):A.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./D7fB2Oi-.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./9Uwn0gv1.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BqA-3o9l.js").then(n=>n.ee),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./9Uwn0gv1.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./CWhRK5Rp.js").then(n=>n.MD),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[D.USE_DEFAULT_CONTEXT,D.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./DDG5E98v.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./Dk6jt2Sr.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./3XDqrO07.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BqA-3o9l.js").then(o=>o.eb);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
@@ -1,4 +1,4 @@
1
- import{b as p,ay as C,aX as H,W as _,r as q,a6 as G,B as U,aV as j,X as K}from"./B3Jw9XtV.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
1
+ import{b as p,ay as C,aX as H,W as _,r as q,a6 as G,B as U,aV as j,X as K}from"./BpY_21Cw.js";var A="",M="",O="",D=[],b=new Map,v=p(e=>j(e,K()),"sanitizeText"),y=p(e=>{switch(e.type){case"terminal":return{...e,value:v(e.value)};case"nonterminal":return{...e,name:v(e.name)};case"sequence":return{...e,elements:e.elements.map(y)};case"choice":return{...e,alternatives:e.alternatives.map(y)};case"optional":return{...e,element:y(e.element)};case"repetition":return{...e,element:y(e.element),separator:e.separator?y(e.separator):void 0};case"special":return{...e,text:v(e.text)}}},"sanitizeAstNode"),J=p(()=>{A="",M="",O="",D.length=0,b.clear(),q(),C.debug("[Railroad] Database cleared")},"clear"),Y=p(e=>{A=v(e),C.debug("[Railroad] Title set:",e)},"setTitle"),P=p(()=>A,"getTitle"),Q=p(e=>{const i={...e,name:v(e.name),definition:y(e.definition),comment:e.comment?v(e.comment):void 0};C.debug("[Railroad] Adding rule:",i.name),b.has(i.name)&&C.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),D.push(i),b.set(i.name,i)},"addRule"),Z=p(()=>D,"getRules"),V=p(e=>b.get(e),"getRule"),ee=p(e=>{M=v(e).replace(/^\s+/g,""),C.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=p(()=>M,"getAccTitle"),re=p(e=>{O=v(e).replace(/\n\s+/g,`
2
2
  `),C.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=p(()=>O,"getAccDescription"),ae=Y,ne=P,oe={clear:J,setTitle:Y,getTitle:P,addRule:Q,getRules:Z,getRule:V,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ae,getDiagramTitle:ne},f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5},le=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,se=/^[\w "',.-]+$/,de=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),L=p(e=>e?Object.keys(e).every(i=>i==="railroad"||de.has(i)):!1,"isRailroadStyleOptions"),ce=p(e=>e?"railroad"in e&&e.railroad?e.railroad:L(e)?e:{}:{},"extractRailroadOverrides"),me=p(e=>{if(!e||L(e))return{};const{railroad:i,svgId:n,theme:a,look:t,...r}=e;return r},"extractThemeOverrides"),m=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return le.test(n)?n:i},"sanitizeColorValue"),X=p((e,i)=>{if(typeof e!="string")return i;const n=e.trim();return se.test(n)?n:i},"sanitizeFontFamilyValue"),F=p((e,i)=>{const n=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(n)&&n>=0?n:i},"sanitizeNumberValue"),he=p(e=>{const i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=p(e=>{const i=X(e.fontFamily,f.fontFamily),n=he(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:n,terminalFill:m(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:m(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:m(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:m(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:m(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:m(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:m(e.lineColor,f.lineColor),markerFill:m(e.lineColor,f.markerFill),commentFill:m(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:m(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:m(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:m(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:m(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:m(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),E=p(e=>{const i=_(),n={...G(),...i.themeVariables??{},...me(e)},a=pe(n),t={...i.railroad??{},...ce(e)};return{compactMode:t.compactMode??a.compactMode,padding:F(t.padding,a.padding),verticalSeparation:F(t.verticalSeparation,a.verticalSeparation),horizontalSeparation:F(t.horizontalSeparation,a.horizontalSeparation),arcRadius:F(t.arcRadius,a.arcRadius),fontSize:F(t.fontSize,a.fontSize),fontFamily:X(t.fontFamily,a.fontFamily),terminalFill:m(t.terminalFill,a.terminalFill),terminalStroke:m(t.terminalStroke,a.terminalStroke),terminalTextColor:m(t.terminalTextColor,a.terminalTextColor),nonTerminalFill:m(t.nonTerminalFill,a.nonTerminalFill),nonTerminalStroke:m(t.nonTerminalStroke,a.nonTerminalStroke),nonTerminalTextColor:m(t.nonTerminalTextColor,a.nonTerminalTextColor),lineColor:m(t.lineColor,a.lineColor),strokeWidth:F(t.strokeWidth,a.strokeWidth),markerFill:m(t.markerFill,a.markerFill),commentFill:m(t.commentFill,a.commentFill),commentStroke:m(t.commentStroke,a.commentStroke),commentTextColor:m(t.commentTextColor,a.commentTextColor),specialFill:m(t.specialFill,a.specialFill),specialStroke:m(t.specialStroke,a.specialStroke),ruleNameColor:m(t.ruleNameColor,a.ruleNameColor),showMarkers:t.showMarkers??a.showMarkers,markerRadius:F(t.markerRadius,a.markerRadius)}},"buildRailroadStyleOptions"),Te=p(e=>{const{fontFamily:i,fontSize:n,terminalFill:a,terminalStroke:t,terminalTextColor:r,nonTerminalFill:o,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:h,markerFill:u,commentFill:c,commentStroke:w,commentTextColor:d,specialFill:T,specialStroke:z,ruleNameColor:S}=E(e);return`
3
3
  .railroad-diagram {
4
4
  font-family: ${i};
@@ -1,4 +1,4 @@
1
- import{g as Ni}from"./iMaMvcYZ.js";import{s as Ci}from"./CqoNhUOR.js";import{U as Zs,aZ as jt,V as Qs,a_ as Gt,Y as bi,b0 as vi,b as h,aU as je,ay as _i,X as en,a1 as xi,aP as Mi,bh as wi,aV as Ui,r as Pi,O as Di,am as Fi,W as Bi,ab as $i,aG as ji,aA as Gi,aW as Wi}from"./B3Jw9XtV.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class M extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class q extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof q)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof M)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class xe{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof M||s instanceof se||s instanceof ne||s instanceof q||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof M||s instanceof q?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof q)return"MANY_SEP";if(s instanceof M)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof q)this.walkManySep(n,a,t);else if(n instanceof M)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Je(s){if(s instanceof K)return Je(s.referencedRule);if(s instanceof k)return qi(s);if(Hi(s))return Yi(s);if(Xi(s))return Ji(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(Je(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function Ji(s){const e=s.definition.map(t=>Je(t));return[...new Set(e.flat())]}function qi(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),l=Je(r);this.follows[i]=l}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function S(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=S("0");s<=S("9");s++)gt.push(s);const At=[S("_")].concat(gt);for(let s=S("a");s<=S("z");s++)At.push(s);for(let s=S("A");s<=S("Z");s++)At.push(s);const Os=[S(" "),S("\f"),S(`
1
+ import{g as Ni}from"./DcVQUcOT.js";import{s as Ci}from"./BHM1cyPv.js";import{U as Zs,aZ as jt,V as Qs,a_ as Gt,Y as bi,b0 as vi,b as h,aU as je,ay as _i,X as en,a1 as xi,aP as Mi,bh as wi,aV as Ui,r as Pi,O as Di,am as Fi,W as Bi,ab as $i,aG as ji,aA as Gi,aW as Wi}from"./BpY_21Cw.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class M extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class q extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof q)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof M)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class xe{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof M||s instanceof se||s instanceof ne||s instanceof q||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof M||s instanceof q?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof q)return"MANY_SEP";if(s instanceof M)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof q)this.walkManySep(n,a,t);else if(n instanceof M)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Je(s){if(s instanceof K)return Je(s.referencedRule);if(s instanceof k)return qi(s);if(Hi(s))return Yi(s);if(Xi(s))return Ji(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(Je(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function Ji(s){const e=s.definition.map(t=>Je(t));return[...new Set(e.flat())]}function qi(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),l=Je(r);this.follows[i]=l}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function S(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=S("0");s<=S("9");s++)gt.push(s);const At=[S("_")].concat(gt);for(let s=S("a");s<=S("z");s++)At.push(s);for(let s=S("A");s<=S("Z");s++)At.push(s);const Os=[S(" "),S("\f"),S(`
2
2
  `),S("\r"),S(" "),S("\v"),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S("\u2028"),S("\u2029"),S(" "),S(" "),S(" "),S("\uFEFF")],sa=/[0-9a-fA-F]/,tt=/[0-9]/,na=/[1-9]/;class ia{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Fe(n,"global");break;case"i":Fe(n,"ignoreCase");break;case"m":Fe(n,"multiLine");break;case"u":Fe(n,"unicode");break;case"y":Fe(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Se(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return ta()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Se(t);break}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[S(`
3
3
  `),S("\r"),S("\u2028"),S("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=gt;break;case"D":e=gt,t=!0;break;case"s":e=Os;break;case"S":e=Os,t=!0;break;case"w":e=At;break;case"W":e=At,t=!0;break}if(Se(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=S("\f");break;case"n":e=S(`
4
4
  `);break;case"r":e=S("\r");break;case"t":e=S(" ");break;case"v":e=S("\v");break}if(Se(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:S("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:S(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
@@ -1,4 +1,4 @@
1
- import{g as fe}from"./B-JWrZED.js";import{b as o,ay as te,X as U,aX as ye,ad as be,ah as me,aL as ke,b3 as Ee,O as K,aV as F,ax as _e,J as Se,an as Ne,au as ce,H as le}from"./B3Jw9XtV.js";var $=(function(){var e=o(function(O,s,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=s);return n},"o"),h=[1,4],p=[1,13],i=[1,12],d=[1,15],k=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],E=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],H=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(s,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(E,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(E,[2,19]),e(E,[2,21],{15:30,24:G}),e(E,[2,22]),e(E,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(E,[2,16],{15:37,24:G}),e(E,[2,17]),e(E,[2,18]),e(E,[2,20],{24:H}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(E,[2,15],{24:H}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(s,n){if(n.recoverable)this.trace(s);else{var r=new Error(s);throw r.hash=n,r}},"parseError"),parse:o(function(s){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,ie=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(s,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var _,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=ae()),x=M[P]&&M[P][_]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`:
1
+ import{g as fe}from"./vtO9QTmA.js";import{b as o,ay as te,X as U,aX as ye,ad as be,ah as me,aL as ke,b3 as Ee,O as K,aV as F,ax as _e,J as Se,an as Ne,au as ce,H as le}from"./BpY_21Cw.js";var $=(function(){var e=o(function(O,s,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=s);return n},"o"),h=[1,4],p=[1,13],i=[1,12],d=[1,15],k=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],E=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],H=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(s,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(E,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(E,[2,19]),e(E,[2,21],{15:30,24:G}),e(E,[2,22]),e(E,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(E,[2,16],{15:37,24:G}),e(E,[2,17]),e(E,[2,18]),e(E,[2,20],{24:H}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(E,[2,15],{24:H}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(s,n){if(n.recoverable)this.trace(s);else{var r=new Error(s);throw r.hash=n,r}},"parseError"),parse:o(function(s){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,ie=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(s,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var _,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=ae()),x=M[P]&&M[P][_]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+X.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(_==re?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[_]||_,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+_);switch(x[0]){case 1:r.push(_),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),_=null,ie=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,ie,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(j.$),t.push(j._$),oe=M[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var n=s.length,r=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b as a,aW as o}from"./B3Jw9XtV.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
1
+ import{b as a,aW as o}from"./BpY_21Cw.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
@@ -1 +1 @@
1
- import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{Jv as s}from"./CWhRK5Rp.js";import{c as t}from"./wY2249Ev.js";function C(o,i){return t(s,o,{navigate:i,...a("windowChrome")?{closeWindow:()=>r(e.WINDOW.CLOSE)}:{}})}export{C as closeActiveTab};
1
+ import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{Jv as s}from"./CWhRK5Rp.js";import{c as t}from"./CpkJczBg.js";function C(o,i){return t(s,o,{navigate:i,...a("windowChrome")?{closeWindow:()=>r(e.WINDOW.CLOSE)}:{}})}export{C as closeActiveTab};
@@ -1,4 +1,4 @@
1
- var W_=Object.defineProperty;var Fg=n=>{throw TypeError(n)};var U_=(n,r,a)=>r in n?W_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>U_(n,typeof r!="symbol"?r+"":r,a),z_=(n,r,a)=>r.has(n)||Fg("Cannot "+a);var To=(n,r,a)=>(z_(n,r,"read from private field"),a?a.call(n):r.get(n)),Dg=(n,r,a)=>r.has(n)?Fg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as un,bo as Z,bw as gn,bp as uf,b as pn,bm as u,bq as Ur,bs as ue,br as qi}from"./Dv_tIgjy.js";import{bs as fn,a5 as S,bf as fs,bA as y,W as p,bn as vn,aA as ee,aB as E,ca as se,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as dn,b_ as L,bO as j,c5 as it,bH as w,bV as me,bj as Es,bk as ro,b$ as ln,ai as Bd,aj as ps,bo as jl,br as Mr,c0 as Dt,ak as j_,cb as sd,aw as wi,a as G_}from"./3SdAC2_C.js";import{i as B}from"./D7nvPiBp.js";import{k as xi}from"./D6gLzTDC.js";import{g as Dn,i as V_,I as eo,p as Lo,e as Eo}from"./52P8Bm3E.js";import{n as Nt,l as ma,c as to,j as Ng,k as Fo,h as K_}from"./CaXlovz7.js";import{b as gf,e as Wd,f as ke,s as ze,c as zt,g as gs}from"./DLx1kqr5.js";import{b as Q_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as J_,U as Y_,Z as X_,X as Z_,Y as ew,I as Bg,o as tw,l as nw,a2 as rw,x as Wg,$ as aw,a0 as Ug,r as sw,s as ow}from"./Dvkoo7QM.js";import{Jv as F,fo as iw,eW as lw,f3 as cw,eX as dw,f1 as uw,f0 as gw,eZ as pw,e$ as fw,eY as vw,ru as hw,c6 as mw,i as $i,J4 as _w,Dc as pf,Dh as ww,Dj as zg,Dg as bw,Di as yw,vD as Iw,vF as Sw,Cp as ff,cp as $w,cn as kw,By as xw,bE as Cw,A3 as Pw,Ce as od,u$ as Rw,cq as jg,dB as Tw,dC as Aw,Co as Mw,el as Ew,CI as qw,CH as Lw,CM as Hw,CL as Ow,cQ as Fw,cT as Dw,nC as Nw,er as Bw,wR as Ww,CN as Uw,wT as zw,CO as jw,cU as Gw,cV as Vw,nK as Kw,Ah as Qw,Iq as Jw,Ag as Yw,Dt as Xw,wm as Zw,wn as eb,y$ as tb,z3 as id,wi as nb,wj as rb,rS as ab,rf as sb,rd as ob,f_ as ib,HO as lb,Lj as cb,GM as db,gn as ub,p2 as gb,Jj as pb,oj as fb,A2 as vb,ft as Gg,r2 as Vg,fm as hb,fl as mb,tB as _b,g3 as Kg,re as wb,fe as bb,C9 as yb,m as Ib,nL as Sb,zH as $b,yZ as kb,Ez as xb,Eo as Qg,xh as Cb,xi as Jg,u_ as Yg,p3 as Pb,DF as Rb,gj as Tb,g1 as Ab,eU as Mb,cM as Eb,A6 as qb,Lo as Lb,Cu as Hb,LG as Ob,y2 as Fb,ga as Db,fd as Nb,cL as Bb,cI as Wb,cH as Ub,vr as zb,xo as jb,xm as Gb,cF as Vb,cE as Kb,z5 as Qb,z0 as Jb,xn as Yb}from"./CWhRK5Rp.js";import{a as Ud}from"./CC7to1B5.js";import{aM as Xb,aL as Zb,bg as ey,a7 as ty,aD as ny,aO as ry,M as vf,a0 as hf,b8 as ay,b2 as sy,as as Xg,P as bl,b0 as Zg,a$ as ep,a_ as tp}from"./BH8UijQb.js";import{l as mf,G as oy,I as Cd,at as iy,b1 as El,a9 as _f,S as ly,aW as ld,aq as cy,aJ as dy,C as uy,z as wf,s as gy,A as py,v as fy,a$ as vy,aH as bf,aG as yf,aI as hy,j as np,aM as cd,aT as rp,aS as yl,aU as ap,Q as sp,d as my,e as _y,ax as wy,V as op,aE as by,c as yy,m as Iy,aV as ip,ap as Sy,aw as lp,a as $y,aA as ky,ad as cp,aD as xy,aX as dp,a_ as up,n as gp,ae as Cy,R as Py,ay as pp,am as Ry,O as Ty,as as Ay,h as My,q as Ey,$ as dd,_ as qy,aC as fp,a8 as Ly,f as Hy,i as Oy,a6 as Fy,ac as Dy}from"./B7X-AK1d.js";import{f as Ny,o as By,E as Wy,C as Uy,m as zy,a2 as vp,aa as jy,K as Gy,e as Vy,y as Ky}from"./ChmjyeX7.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as If,O as Sf,W as Qy,bv as Jy,aF as $f,dH as kf,aU as qo,e8 as Yy,dw as xf,aw as zd,dV as jd,aN as Cf,cP as Xy,V as ha,a3 as Xs,B as Zy,a7 as eI,a4 as tI,M as nI,a6 as rI,ar as aI,aG as Pf,aO as ql,b6 as sI,ay as Rf,r as oI,n as Pd,H as iI,dY as lI,aQ as cI,aK as dI,c9 as uI,aW as gI,bM as pI,bK as fI,bL as vI,c8 as hI,c7 as mI,cN as _I,cM as wI,aS as bI,bb as yI,bd as II,bg as SI,bc as $I,bl as kI,bf as xI,be as CI,bh as PI,bi as RI,bk as TI,bj as AI,ax as MI,cj as EI,ck as qI,dv as LI,du as HI,a$ as OI,G as FI,b3 as DI,cf as NI,C as hp,d0 as BI,ba as ds,b$ as WI,X as UI,bq as zI,E as jI,ad as GI,t as VI,cW as KI,d3 as mp,Q as _p,dt as QI,cQ as ud}from"./BqA-3o9l.js";import{u as Tf,a as Il,ag as JI,x as YI,ad as Af,af as XI,ac as Mf,a4 as ZI,F as wp,D as eS,e as tS,n as nS,s as rS,m as aS,Y as sS,k as oS}from"./Cg-C81DM.js";import{a2 as iS,b5 as lS,cM as cS,a_ as dS,b4 as uS,c2 as gS,c9 as pS,w as fS,x as vS,cd as hS}from"./DMvzpJTu.js";import{n as mS,P as Ef,F as _S,ai as wS,r as bS,ac as yS}from"./CXuejdJ2.js";import{I as IS,s as SS,H as bp}from"./Bqd7fdCF.js";import{e as $S}from"./CL3a4Hm1.js";import{e as kS,f as xS}from"./0Z0gfzJL.js";import{s as CS,o as Zs,b as PS,g as Nl,d as RS,l as bi}from"./CIyUrgF0.js";import{a5 as TS,a7 as AS,D as MS,N as ES,ac as yp,X as qS,i as LS,r as dr,v as Ri,u as na,p as ki,x as br,S as Gd,m as Gl,s as Ho,y as Ti,o as ao,n as so,t as Ip,aa as oo,w as io,a9 as Vd,q as _a,z as Oo,J as Rd,_ as Sp,g as HS,F as OS,U as qf,I as Lf,a8 as Hf,a6 as Ll,O as FS,E as Of,V as DS,A as NS,b as BS,ab as WS,ad as Sl,G as US,e as gd,l as zS,C as jS,f as Ys,j as $p,H as us,Q as GS,d as $l,c as VS,a as kp,h as KS,L as QS,Y as xp,a4 as pd,a1 as Cp,a0 as JS,a3 as Pp,$ as Rp,T as YS,B as XS,k as ZS,a2 as e$,K as t$,R as n$,P as r$,W as a$}from"./C6D8Jg6d.js";import{m as s$}from"./Dms_DO28.js";import{g as Ff}from"./BtoHpP4W.js";import{b as o$}from"./CxTWC0xh.js";import{g as i$}from"./Dk6jt2Sr.js";import{a as l$}from"./DhJScVOu.js";import{q as Df,d as ur,r as c$,e as Bl,j as d$,g as Td,i as u$,f as Ad,c as g$,A as p$,O as Tp,k as f$}from"./D43gBypv.js";import{P as v$}from"./B7Hu5ie3.js";import{e as h$}from"./CZWVWqa-.js";import{b as m$,a as _$,g as w$,c as b$,i as y$}from"./CLi-M9va.js";import{R as I$,g as S$,W as kl,c as $$}from"./BTW7La6X.js";import"./Bq_LXeQl.js";import"./CJm4uIn-.js";import{s as Ai}from"./BPxuNmyn.js";import{F as k$,h as x$}from"./D7fB2Oi-.js";import"./Btdq1w8A.js";import{C as C$,e as Br,L as P$,l as Vl,d as Kl,K as Ql,h as Kd,M as Jl,S as Da}from"./Cv8U-Bhv.js";import{D as R$}from"./7J-n_WZL.js";import{f as Ap}from"./CBFFWZgt.js";import"./DU3vNstz.js";import{i as Nf}from"./BjLb7AHW.js";import{h as Mp,i as Ep,g as qp,P as Lp,C as T$,m as Hl,R as A$}from"./I4WMrmBa.js";import{f as bt,ae as M$}from"./Z_oRTxSz.js";import{F as ct,bs as E$,cd as q$,aw as Na,a2 as Bf,c9 as L$,bf as H$,be as O$,bg as F$,aO as Hp,aj as fd,aB as vd,bB as Wf,d3 as Wl,cF as D$,aM as Op,cb as Fp,cK as Ul,bu as N$,aS as B$,d0 as W$,a8 as Uf,ac as U$,ag as z$,cr as j$,ba as G$,aC as zf,cT as Dp,cz as V$,ax as K$,cD as Q$,c3 as J$}from"./B80pUkKE.js";import{c as jf}from"./ChTqQfQN.js";import"./KS3jDVZW.js";import{c as Et}from"./DpKzpN4e.js";import{a5 as Gf,bg as Y$,ar as X$,k as Z$,Y as ek,W as tk,a2 as nk,Z as rk,bw as ak,V as sk,a1 as ok,ah as ik}from"./C3YmofVF.js";import{d as zl,f as lk,e as ck}from"./D5zI85k6.js";import{A as dk}from"./Ddh10uX0.js";import{D as uk}from"./Bbnh6hIR.js";import"./Cm6Te9Vq.js";import{a as gk,C as pk}from"./CgTkwFoW.js";import"./B23aic_N.js";import{C as fk}from"./D37tfO3G.js";import{h as Md,r as vk,a as hk}from"./B6vL_HfU.js";import{s as mk}from"./hwNPEYu3.js";import{I as _k,a as Vf}from"./C76HLoEq.js";import{L as wk}from"./PCtE9_eA.js";import{g as bk,f as yk,b as Ik}from"./Bsz2ybz8.js";import{s as Mi,g as Yn,i as Sk,j as $k,e as Np,r as Bp,f as kk,d as xk,a as hd,h as Ck}from"./i6OXlSBf.js";import{i as Wp,a as Pk}from"./Bu13V5mO.js";import{seekConversationToMessage as Up}from"./CfCVG4Rx.js";import{l as Jt,o as md,h as Qd,n as Ed,q as Rk}from"./JGtSKGY1.js";import{o as Tk}from"./DrXnULBv.js";import{A as Kf}from"./DvxySjLz.js";import{b as Qf}from"./C8mPociq.js";import{g as Ak,e as Jf,v as Mk,f as Ek,N as qk,M as Lk,K as Hk,k as Yf,l as Ok,H as Xf,s as Zf}from"./l-ihYetV.js";import{selectCurrentWorkspaceTabId as _d}from"./3W8n_N-7.js";import{o as Fk}from"./Zxq4ML42.js";import{d as Dk}from"./B0Z-1lwJ.js";import{P as Nk}from"./HW7u71-8.js";import{g as Bk}from"./D6N7T3x-.js";import{H as ev,M as Wk,y as Uk,J as zk,g as jk,i as Gk,u as Vk,e as tv,c as nv,d as Kk}from"./C2IakNsF.js";import{c as Qk,h as Jd,f as rv,Q as Jk}from"./BivYofy-.js";import{t as Yk}from"./DAsc1V4f.js";import{s as Xk}from"./BsieX9dN.js";import{i as av}from"./Cjgh9KMf.js";import{d as Zk,i as ex,r as tx}from"./CTbHaK7N.js";import{g as nx}from"./BH7eVR7o.js";var rx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ax=E("<div><!></div>");function sv(n,r){if(new.target)return un({component:sv,...n});fn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=uf(r,rx);var f={get ref(){return a()},set ref(h=null){a(h),ee()},get class(){return i()},set class(h){i(h),ee()},get children(){return c()},set children(h){c(h),ee()},$set:gn,$on:(h,P)=>pn(r,h,P)},g=ax();gf(g,h=>({"data-slot":"card-header",class:h,...l}),[()=>Wd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",fk,i())]);var b=S(g);return Ai(b,()=>c()??fs),y(g),wr(g,h=>a(h),()=>a()),p(n,g),vn(f)}var sx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ox=E("<div><!></div>");function ov(n,r){if(new.target)return un({component:ov,...n});fn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=uf(r,sx);var f={get ref(){return a()},set ref(h=null){a(h),ee()},get class(){return i()},set class(h){i(h),ee()},get children(){return c()},set children(h){c(h),ee()},$set:gn,$on:(h,P)=>pn(r,h,P)},g=ox();gf(g,h=>({"data-slot":"card-title",class:h,...l}),[()=>Wd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var b=S(g);return Ai(b,()=>c()??fs),y(g),wr(g,h=>a(h),()=>a()),p(n,g),vn(f)}const xl=IS.CHAT_MEDIA,wd=CS().min(1).max(512);Zs({workspaceId:wd,agentId:wd,draftId:Nl(),principalId:wd,media:PS(mS).min(1).max(20)}).strict();const ix=Zs({sessionId:Nl()}).strict();ix.extend({control:RS("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:kS}).strict(),Zs({action:bi("transcribe"),request:xS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Yd(n,r,a,i=async(c,l)=>typeof window>"u"||SS(window)!=="electron"?{ok:!1,error:"unavailable"}:$S().invoke(c,l)){let c=null,l=null,f=!1;async function g(){f=!0,a.removeEventListener("abort",b);const x=c;c=null,x&&await i(xl.CLOSE,{sessionId:x}).catch(()=>{})}const b=()=>{g()};a.addEventListener("abort",b,{once:!0});const h=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(h(),c)return c;if(l)return l;l=(async()=>{const x=await i(xl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");c=x.value.sessionId;try{return h(),c}catch(D){throw await g(),D}})();try{return await l}finally{l=null}}async function I(x){const D=await P();h();const N=await i(xl.CONTROL,{sessionId:D,control:x});return h(),N}return{service:{exportMedia:x=>I({action:"export",request:x}),adoptMediaJob:x=>I({action:"adopt",jobId:x}),transcribeMedia:x=>I({action:"transcribe",request:x}),releaseMediaJob:async x=>c?await i(xl.CONTROL,{sessionId:c,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>I({action:"readiness"})}}const bd=new Set;async function lx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:g}=i,b=Pi(F.state),h=Dl.select(F.state,f),P=If.select(F.state),I=mf(),q=JSON.stringify([b,f,g]);if(!b||!h||!P||l.wsId!==f||bd.has(q))return!1;bd.add(q);const x=new AbortController,D=()=>x.abort();a.addEventListener("abort",D,{once:!0});const N=()=>!a.aborted&&!x.signal.aborted&&Pi(F.state)===b&&Dl.select(F.state,f)===h&&_f(I)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{N()||x.abort()});let O=null;try{if(!N()||iS(c))return!1;const V=Tf(i.attachments),ie=Ef(_S(f,g),V,c.map(pe=>({contextItemId:pe.id,attachmentId:pe.attachmentId,path:pe.path}))),R=new Set([...ie.images,...ie.clips].map(pe=>pe.contextItemId));if(V.some(([pe])=>!R.has(pe))||ie.images.some(pe=>pe.mediaError)||ie.clips.some(pe=>pe.mediaError)||!wS(l.text,ie))throw new Error("invalid-evidence");if(O=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!N())return!1;const k=await Ny.agents.get(g,f);if(!N())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const Q=ie.clips.flatMap(pe=>pe.media?[pe.media]:[]);Q.length&&!O&&(O=Yd({workspaceId:f,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},N,x.signal));const ge=oy(c,ie),Re=Cd(ge),he=await iy({workspaceId:f,agentId:g,evidence:ie,clickedItems:c,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Re.imageBlocks,fileBlocks:Re.fileBlocks},binding:I,service:O?.service??null,current:N,onRecord:()=>{}});return!he||!N()?!1:El(F,g,he)}catch{return N()&&F.dispatch(iw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",D),await O?.dispose(),bd.delete(q)}}const iv=1e4,zp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function jp(n){return TS(n.messageMetadata)}function cx(n,r){if(n.some(jp)){const a=n[0];return a&&!jp(a)&&Gp(a,r)?[a.id]:[]}return n.filter(a=>Gp(a,r)).map(a=>a.id)}function dx(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Gp(n,r){return!n.requeuedAfterFailure&&AS(n,r)}function ux(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,f=r.blocked||r.interrupted,g=r.timeoutMs??iv;let b=n.prediction;if(b){const x=new Set(i.map(O=>O.id)),D=b.ids.filter(O=>x.has(O)&&!c.has(O)),N=l-b.startedAt>=g,T=n.wasBusy&&!a;!D.length||N||f&&!a||T?b=null:D.length!==b.ids.length&&(b={...b,ids:D})}const h=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,I=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!b&&h&&!f&&!I){const x=cx(i,l).filter(D=>!c.has(D));x.length&&(b={ids:x,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&I,prediction:b};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class gx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{c=setTimeout(()=>f(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function px(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Vp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var fx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function lv(n,r){if(new.target)return un({component:lv,...n});fn(r,!0);const a=()=>ue(P,"$typing$",i),[i,c]=Ur();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),g=Z(r,"class",7,"");const b=Bn(""),h=Bn("");se(()=>{b.set(l())}),se(()=>{h.set(f())});const P=lS(b,h),I=o(()=>h$(a()));var q={get workspaceId(){return l()},set workspaceId(O){l(O),ee()},get agentId(){return f()},set agentId(O){f(O),ee()},get class(){return g()},set class(O=""){g(O),ee()},$set:gn,$on:(O,V)=>pn(r,O,V)},x=Wt(),D=ye(x);{var N=O=>{var V=fx(),ie=S(V),R=S(ie);v$(R,{get people(){return a()},size:12,decorative:!0}),y(ie);var k=_(ie,2),Q=de(k,!0);dn(2),y(V),L(()=>{ke(V,1,`${Df} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(I))}),p(O,V)};B(D,O=>{e(I)&&O(N)})}p(n,x);var T=vn(q);return c(),T}const vx=50,hx=5e3,mx=500,_x=()=>({authority:()=>Pi(F.state),persistSnapshot:cy,dispatch:n=>F.dispatch(n),ownerView:n=>dy.withStore(F)(n)});function wx(n){const r=n.store??_x(),a=crypto.randomUUID();let i=me(!1),c=me(!1),l=me(!1),f=null,g=null,b=0,h=!1,P=null,I=null,q=null,x=0,D=null,N=null;const T={};let O,V=me([]),ie=null,R=0,k="",Q=0,ge="";const Re=()=>{const W=n.workspaceId(),C=n.agentId();if(!W||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||h)return null;const Me=n.inputValue(),H=pe(),Y=O?.shared,X=Y?.workspaceId===W&&Y.agentId===C?Y.lifetime:null,Ie=JSON.stringify([re,W,C,x,X,H.map(z=>[z.id,z.attachmentId,z.path])]);Ie!==ge&&(ge=Ie,Q+=1);const Ne=JSON.stringify([re,W,C,Me,H,x]);return Ne!==k&&(k=Ne,R+=1),{authority:re,ownerId:a,workspaceId:W,agentId:C,text:Me,attachments:JSON.parse(JSON.stringify(H)),generation:R,attachmentEpoch:Q}};let he=null;const pe=()=>JI(n.contextItems(),YI(n.contextItems(),e(V))),qe=W=>{if(O=W,!W||h)return;const C=W.restore;if(N&&C?.requestId===N.requestId&&C.status!=="pending"){const{apply:H}=N;N=null,w(c,!1),C.status==="restored"&&w(V,C.draft?.attachments??[]),H(C)}const re=W.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(ie!==H){ie=H;const Y=he??f,X=Y&&n.inputValue()===Y.text&&JSON.stringify(pe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:X&&(b+=1,q&&clearTimeout(q),w(V,re.snapshot.attachments),he=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(V))),n.applyEditorContent(re.snapshot.text))}}it(Re);const Me=[];for(const H of W.saves){if(H.status==="pending")continue;Me.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}Me.length>0&&queueMicrotask(()=>r.dispatch(uw(a,Me)))},fe=(W,C,re)=>{const Me=crypto.randomUUID();N={requestId:Me,apply:re},w(c,!0),r.dispatch(pw(a,Me,W,C))},oe=()=>{N&&(N=null,w(c,!1),r.dispatch(vw(a)))},Te=()=>{const W=D;W&&(D=null,r.dispatch(fw(a)),O?.saves.some(C=>C.id===W)||delete T[W])};r.dispatch(lw(a));const J=r.ownerView(a).subscribe(W=>it(()=>qe(W))),ae=()=>{I&&(clearTimeout(I),I=null),w(l,!1)},Ae=()=>{D&&(D=null,r.dispatch(gw(a)))};se(()=>{const W=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!W){it(()=>{b+=1,g=null,oe(),P&&clearTimeout(P),P=null,ae(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!C||!re)return;const Me=`${C}\0${re}`;if(g===Me)return;const H=g!==null;g=Me;const Y=++b;it(()=>{f=null,he=null,ie=null,w(V,[]),P&&clearTimeout(P),ae(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const X=ly(C,re);if(X){w(V,X.attachments),w(i,!1);const Ne=n.contextItems().length>0,z=X.text,Se=JSON.stringify(X.attachments);n.setInputValue(X.text),Ne||n.setContextItems(Il(X.attachments)),n.applyEditorContent(X.text),f={text:X.text,attachmentsJson:Se},fe(C,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(h||!(n.active?.()??!0)||g!==Me||b!==Y)return;const at=De?.text??"",Xe=De?.attachments??[],Fe=JSON.stringify(Xe);ld(C,re,{text:at,attachments:Xe});const Pe=n.inputValue()===z&&JSON.stringify(pe())===Se;Ne||!Pe||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Fe!==Se&&n.setContextItems(Il(Xe)),f={text:at,attachmentsJson:Fe})});return}w(i,!0),I=setTimeout(()=>{I=null,(n.active?.()??!0)&&w(l,!0)},mx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ae())},hx);const Ie=()=>{!(n.active?.()??!0)||g!==Me||b!==Y||(P&&clearTimeout(P),w(i,!1),ae())};fe(C,re,Ne=>{if(Ne.status!=="restored"){Ie();return}const z=Ne.draft;if(h||!(n.active?.()??!0)||g!==Me||b!==Y)return;const Se=!!n.inputValue();if(!Se&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Se&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},vx)),f===null){const Ce=z?.text??"",De=z?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(De)},ld(C,re,{text:Ce,attachments:De})}Ie()})})}),se(()=>{const W=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Me=e(i);if(!W){it(Te);return}if(!C||!re)return;const H=n.inputValue(),Y=pe();if(it(Re),it(Te),Me||f===null&&!H&&Y.length===0)return;const X=JSON.stringify(Y);if(f!==null&&f.text===H&&f.attachmentsJson===X)return;JSON.stringify(e(V))!==X&&w(V,Y);const Ie=`${C}\0${re}`,Ne=x,z=crypto.randomUUID();T[z]=Se=>{if(n.active?.()??!0){if(Se.status==="saved"){g===Ie&&x===Ne&&(f={text:H,attachmentsJson:X});return}n.onSaveError?.(new Error(Se.error))}},it(()=>{D=z,r.dispatch(cw(a,z,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:H,attachments:Y,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),se(()=>()=>{h=!0,P&&clearTimeout(P),I&&clearTimeout(I),q&&clearTimeout(q),Ae(),J(),r.dispatch(dw(a))});const He=W=>{const C=Re();return C!==null&&C.authority===W.authority&&C.ownerId===W.ownerId&&C.workspaceId===W.workspaceId&&C.agentId===W.agentId&&C.generation===W.generation&&C.text===W.text&&JSON.stringify(C.attachments)===JSON.stringify(W.attachments)};return{captureDraft:Re,isCurrentDraft:He,updateAttachmentScreen(W,C,re){return!He(W)||!W.attachments.some(Me=>Me.id===C)?null:(w(V,W.attachments.map(Me=>Me.id===C?{...Me,screen:structuredClone(re)}:Me)),Re())},async flushDraft(W){if(!He(W))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,W.workspaceId,W.agentId,W,W.authority),He(W)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(b+=1,x+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ae(),Te(),g!==null){const[W,C]=g.split("\0");ld(W,C,{text:"",attachments:[]}),he=null,w(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=Ef(JSON.stringify([n.workspaceId,n.agentId]),Tf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function bx(n,r,a){const i=F.state.principal.snapshot,c=()=>Pi(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,f=Yd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await f.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(b=>b.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Kp(n){let r=me(null),a=me(!1),i=me(!1),c=null,l=!0,f=0,g=null;Es(()=>{l=!1,f++}),se(()=>{const I=n.capture();e(r)&&(!I||I.authority!==e(r).capture.authority||I.ownerId!==e(r).capture.ownerId||I.workspaceId!==e(r).capture.workspaceId||I.agentId!==e(r).capture.agentId||I.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function b(I){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),x=Ei(q),D=x?.clips.find(V=>V.contextItemId===I);if(!q||!D?.media||!x)return;const N=uy({workspaceId:q.workspaceId,agentId:q.agentId,clip:D,evidence:x,marks:x.marks}),T=wf(q.workspaceId,D.path);if(!N||!T)return;const O=++f;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||f!==O||!n.drafts.isCurrentDraft(q))return;const V=await(n.prepareOutput??bx)(q,D.media,n.drafts);if(!l||f!==O||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:ie,...R}=N;w(r,{capture:q,contextItemId:I,snapshot:{...R,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===O&&w(i,!0)}finally{l&&f===O&&w(a,!1)}}async function h(I){const q=crypto.randomUUID(),x=e(r),D=n.drafts.captureDraft();if(!x||!D||D.authority!==x.capture.authority||D.ownerId!==x.capture.ownerId||D.workspaceId!==x.capture.workspaceId||D.agentId!==x.capture.agentId||D.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const N=Ei(D),T=N?.clips.find(Q=>Q.contextItemId===x.contextItemId);if(!N||!T?.media)return{requestId:q,result:"stale-source"};const V=g?.openId===x.snapshot.openId&&g.inputRevision===I.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...I,revision:T.media.saved?.revision??0}:I,ie=bS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:D.workspaceId,agentId:D.agentId},sourceId:I.sourceId,sourceRevision:I.sourceRevision,expectedEditRevision:V.revision,edit:V});if(ie.status!=="saved")return{requestId:q,result:ie.status==="invalid-edit"?"failed":ie.status};const R=yS({...N,clips:N.clips.map(Q=>Q.id===T.id?{...Q,media:ie.media}:Q)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(D,x.contextItemId,R);if(!k)return{requestId:q,result:"stale-source"};g={openId:x.snapshot.openId,media:ie.media,inputRevision:I.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(k);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!Q||Q.attachmentEpoch!==x.capture.attachmentEpoch||Q.authority!==k.authority||Q.ownerId!==k.ownerId||Q.workspaceId!==k.workspaceId||Q.agentId!==k.agentId||JSON.stringify(Q.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(R)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:ie.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(I){return n.disabled()||!n.onRemove(I)?!1:(e(r)?.contextItemId===I&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:b,save:h,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var yx=E('<p role="alert"> </p>'),Ix=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),Sx=E("<!> <!> <!>",1);function cv(n,r){if(new.target)return un({component:cv,...n});fn(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),c=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Kp),g=Z(r,"beforeOpen",7),b=Z(r,"onReviewChange",7);const h=it(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:R=>l()(R),beforeOpen:()=>g()?.()??Promise.resolve()}));se(()=>{const R=h.opening,k=h.session;it(()=>b()?.(R,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const P=o(gy),I=o(()=>Ei(a())),q=o(()=>e(I)?.clips.map(R=>({id:R.contextItemId,kind:"clip",owner:"evidence",duration:Ap(R.durationMs),recording:!1,url:a()?wf(a().workspaceId,R.path):void 0,...R.media?.saved?{summary:py(R.media.saved)}:{}}))??[]);let x=me(null);var D={get capture(){return a()},set capture(R){a(R),ee()},get drafts(){return i()},set drafts(R){i(R),ee()},get disabled(){return c()},set disabled(R=!1){c(R),ee()},get onRemove(){return l()},set onRemove(R){l(R),ee()},get controllerFactory(){return f()},set controllerFactory(R=Kp){f(R),ee()},get beforeOpen(){return g()},set beforeOpen(R){g(R),ee()},get onReviewChange(){return b()},set onReviewChange(R){b(R),ee()},$set:gn,$on:(R,k)=>pn(r,R,k)},N=Sx(),T=ye(N);{let R=o(()=>c()||h.opening);MS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(R)},onEdit:k=>void h.open(k),onMarkUp:k=>void h.open(k),get onRemove(){return h.remove}})}var O=_(T,2);{var V=R=>{var k=yx(),Q=de(k,!0);L(ge=>j(Q,ge),[()=>u.dock_captureEditor_saveFailed_label()]),p(R,k)};B(O,R=>{h.problem&&R(V)})}var ie=_(O,2);{let R=o(()=>!!h.session),k=o(()=>u.dock_captureEditor_recording_title({duration:h.session?Ap(h.session.snapshot.durationMs??0):""}));C$(ie,{get open(){return e(R)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>h.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),h.restoreFocus()},get contentRef(){return e(x)},set contentRef(Q){w(x,Q,!0)},children:(Q,ge)=>{var Re=Wt(),he=ye(Re);{var pe=qe=>{var fe=Wt(),oe=ye(fe);xi(oe,()=>h.session.snapshot.openId,Te=>{var J=Ix(),ae=S(J);R$(ae,{get snapshot(){return h.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>h.close(),get onSave(){return h.save},onDelete:async()=>!!h.session&&h.remove(h.session.contextItemId)}),y(J),p(Te,J)}),p(qe,fe)};B(he,qe=>{h.session&&qe(pe)})}p(Q,Re)},$$slots:{default:!0}})}return p(n,N),vn(D)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function $x(n){let r=me(!1),a=me(!1),i=me(null),c=!1,l=0,f=null,g=null;async function b(I){I.abort.abort(),I.slot?.cancel(),await I.native?.dispose()}async function h(){l++;const I=g;g=null,I&&await b(I)}ro(()=>{const I=()=>{w(r,document.hasFocus(),!0)};return I(),window.addEventListener("focus",I),window.addEventListener("blur",I),()=>{window.removeEventListener("focus",I),window.removeEventListener("blur",I)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&h()});return Es(()=>{c=!0,P(),h()}),se(()=>{const I=n.capture(),q=I?Cl(I):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);it(()=>{if(!x||!I){h();return}if(g?.key===q)return;if(f===q){h();return}h();const N=Ei(I)?.clips.flatMap(Re=>!Re.mediaError&&Re.media?[Re.media]:[])??[],T=N[0],O=F.state.principal.snapshot,V=Dl.select(F.state,I.workspaceId);if(!T||!O||!V||n.drafts.gateActive)return;const ie=mf(),R=new AbortController,k=()=>!c&&!R.signal.aborted&&Pi(F.state)===I.authority&&Dl.select(F.state,I.workspaceId)===V&&_f(ie)&&!!n.capture()&&Cl(n.capture())===q,Q={key:q,capture:I,abort:R,native:null,slot:null,current:k};g=Q;const ge=l;n.drafts.flushDraft(I).then(async Re=>{if(!(g!==Q||ge!==l||!k())){if(!Re){f=q,await h();return}Q.native=Yd({workspaceId:I.workspaceId,agentId:I.agentId,draftId:crypto.randomUUID(),principalId:O.principal.id,media:structuredClone(N)},k,R.signal),Q.slot=fy(Q.native.service),f=q,Q.slot.warm(q,T,k)}}).catch(()=>{g===Q&&h()})})}),{cancel:h,async beforeEditorOpen(){w(a,!0),f=null,await h()},editorState(I,q){w(a,I,!0);const x=q?Cl(q.capture):null;q&&e(i)?.openId!==q.openId&&(f=null),w(i,q&&x?{openId:q.openId,key:x}:null)},take(I,q){const x=g;if(!x?.native||!x.slot||x.key!==Cl(I)||!x.current())return h(),null;g=null,l++;const D=x.native,N=x.slot,T=()=>x.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...D.service,takePreparedRecording:O=>N.take(x.key,O,()=>!q.aborted&&x.current())},async dispose(){q.removeEventListener("abort",T),await b(x)}}}}}var kx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function dv(n,r){if(new.target)return un({component:dv,...n});fn(r,!1);var a={$set:gn,$on:(f,g)=>pn(r,f,g)};Nf();var i=kx(),c=S(i),l=de(c,!0);return y(i),L(f=>j(l,f),[()=>u.chat_draftGate_loading_label()]),p(n,i),vn(a)}var xx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function qd(n,r){if(new.target)return un({component:qd,...n});fn(r,!1);var a={$set:gn,$on:(f,g)=>pn(r,f,g)};Nf();var i=xx(),c=_(S(i),2),l=de(c,!0);return dn(2),y(i),L((f,g)=>{ze(i,"aria-label",f),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),vn(a)}function Cx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Px(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Rx(n,r){return r&&n.includes(r)?r:null}function Qp(n,r,a){return r-n<=a}const Tx=.2;function Jp(n,r,a){const i=Math.max(0,a-r),c=n-Tx*r;return Math.min(Math.max(0,c),i)}function Ax(n,r,a){return n!==null&&a&&n===r}function Mx(n){return n?hw(n)&&mw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Ex(n){const r=[],a=new Set;let i,c;for(const O of n.messages){if(O.agentId&&O.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(O.id))continue;a.add(O.id),n.breakBeforeMessageIds?.has(O.id)&&(i=void 0,c=void 0);const V=ES(O);if(V?.kind!=="turn-failure")c=void 0;else{const ie=i?.seq!==void 0&&O.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(O.seq)&&O.seq===i.seq+1;(!c||!ie)&&(c={key:JSON.stringify([n.agentId,"notice",O.id]),anchorMessageId:O.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:O.id,reason:V.reason,timestamp:O.timestamp}),c.recordedFailureCount+=1}i=O}const l=new Map;for(const O of n.queue){if(!O.requeuedAfterFailure)continue;const V=O.turnId||void 0,ie=JSON.stringify([n.agentId,V?"turn":"queue",V??O.id]);let R=l.get(ie);R||(R={key:ie,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(ie,R)),R.queueIds.includes(O.id)||R.queueIds.push(O.id)}const f=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,b=g?.status===$i.Error,h=n.transientError||b&&g.stopReason||null,P=b&&!h,I=b&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=I?yp(I):null,x=q&&h&&h===g?.stopReason?r.flatMap(O=>O.records).filter(O=>O.reason===h&&yp(O.timestamp)===q):[],D=x.length===1?x[0].messageId:void 0,T=(g?Sf(g):!1)?"attempting":f.length?"queued":h||P?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:h,needsFallbackReason:P,timestamp:I,noticeId:D}}}function qx(n,r){const a=n.hiddenTail[0]?.id,i=Ex({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(b=>b.messageId!==c)})).filter(g=>g.records.length>0),f=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(b=>b.messageId).filter(b=>!f.has(b))))}}var Lx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Hx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Ox=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Fx=E('<div class="mb-5"><!></div>'),Dx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Nx=E("<!> <!>",1),Bx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Wx=E("<!> <span> </span>",1),Ux=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function uv(n,r){if(new.target)return un({component:uv,...n});fn(r,!0);const a=()=>ue(x,"$userOverrides$",f),i=()=>ue(q,"$specialists$",f),c=()=>ue(O,"$isGitHubAuth$",f),l=()=>ue(V,"$recentSpecialistIds$",f),[f,g]=Ur();let b=Z(r,"onSpecialistChange",7),h=Z(r,"session",7),P=Z(r,"workspaceId",7);const I=Bn(P()??"");se(()=>I.set(P()??""));const q=Gf(I),x=Y$();se(()=>{a()});const D=o(()=>{if(!h()||Qy(h()))return null;const W=h().metadata?.specialist||h().agentMetadata?.specialist;return W&&i().find(C=>C.id===W)||null});async function N(W){W?await zl({specialist:W,hash:"specialists"}):await zl({view:"create-specialist"})}let T=me(!1);const O=X$(),V=cS(),ie=o(()=>_w(Z$(i(),c()),l()));let R=me(!1);const k=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(D)?.name??u.chat_shared_general_fallback()),ge=o(()=>e(D)?.description??u.chat_shared_noSpecializedBehavior_label()),Re=o(()=>e(D)?e(D).defaultBehaviorPrompt||"":e(k));var he={get onSpecialistChange(){return b()},set onSpecialistChange(W){b(W),ee()},get session(){return h()},set session(W){h(W),ee()},get workspaceId(){return P()},set workspaceId(W){P(W),ee()},$set:gn,$on:(W,C)=>pn(r,W,C)},pe=Ux(),qe=S(pe);{var fe=W=>{var C=Fx(),re=S(C);uk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(R)},set open(Y){w(R,Y,!0)},trigger:(Y,X)=>{let Ie=()=>(X?.()).props;{let Ne=o(()=>Wd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));bt(Y,qi(Ie,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Ne)},"data-testid":"specialist-picker-trigger",children:(z,Se)=>{var Ce=Lx(),De=ye(Ce),at=S(De);{let Ge=o(()=>e(D)?.id??null),Qe=o(()=>e(D)?.icon??null);dk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(Ge)},get icon(){return e(Qe)}})}y(De);var Xe=_(De,2),Fe=S(Xe),Pe=de(Fe,!0),G=_(Fe,2),te=de(G,!0);y(Xe);var Oe=_(Xe,2),we=S(Oe);ct(we,{get icon(){return Na},size:10}),y(Oe),L(()=>{j(Pe,e(Q)),j(te,e(ge))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var X=Ox(),Ie=S(X),Ne=S(Ie),z=de(Ne,!0),Se=_(Ne,2),Ce=de(Se,!0);y(Ie);var De=_(Ie,2),at=S(De);{let Pe=o(()=>e(D)?.id??null);J_(at,{get specialists(){return e(ie)},get value(){return e(Pe)},onchange:G=>{w(R,!1),b()?.(G)}})}y(De);var Xe=_(De,2),Fe=S(Xe);Et(Fe,()=>Br,(Pe,G)=>{G(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(R,!1),N()},children:(te,Oe)=>{var we=Hx(),Ge=ye(we),Qe=S(Ge);ct(Qe,{get icon(){return q$},size:12}),y(Ge);var dt=_(Ge,2),ft=de(dt,!0);L(lt=>j(ft,lt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(te,we)},$$slots:{default:!0}})}),y(Xe),y(X),L((Pe,G)=>{j(z,Pe),j(Ce,G)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,X)},$$slots:{trigger:!0,content:!0}}),y(C),p(W,C)};B(qe,W=>{b()&&W(fe)})}var oe=_(qe,2);{var Te=W=>{var C=Wt(),re=ye(C);{let Me=o(()=>u.chat_specialistSelector_prompt_label());Et(re,()=>pk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(X,Ie)=>{var Ne=Nx(),z=ye(Ne);Et(z,()=>sv,(Ce,De)=>{De(Ce,{children:(at,Xe)=>{var Fe=Wt(),Pe=ye(Fe);Et(Pe,()=>ov,(G,te)=>{te(G,{class:"type-caption font-medium",children:(Oe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>u.chat_specialistSelector_prompt_label()]),p(Oe,Ge)},$$slots:{default:!0}})}),p(at,Fe)},$$slots:{default:!0}})});var Se=_(z,2);Et(Se,()=>gk,(Ce,De)=>{De(Ce,{children:(at,Xe)=>{var Fe=Dx(),Pe=ye(Fe),G=de(Pe,!0),te=_(Pe,2);bt(te,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Oe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Oe,Ge)},$$slots:{default:!0}}),L(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Re))}),p(at,Fe)},$$slots:{default:!0}})}),p(X,Ne)},$$slots:{default:!0}})})}p(W,C)},J=W=>{var C=Bx(),re=de(C,!0);L(()=>j(re,e(Re))),p(W,C)};B(oe,W=>{e(D)?W(Te):W(J,-1)})}var ae=_(oe,2);{var Ae=W=>{bt(W,{variant:"ghost-light",size:"sm",onclick:()=>N(e(D).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Me=Wx(),H=ye(Me);ct(H,{get icon(){return E$},size:12,class:"opacity-60"});var Y=_(H,2),X=de(Y,!0);L(Ie=>j(X,Ie),[()=>u.chat_regularAgentWelcome_customize_label()]),p(C,Me)},$$slots:{default:!0}})};B(ae,W=>{e(D)&&W(Ae)})}y(pe),p(n,pe);var He=vn(he);return g(),He}var zx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),jx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Gx=E('<span class="type-caption"> </span>'),Vx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Kx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Xd(n,r){if(new.target)return un({component:Xd,...n});fn(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),c=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),g=Z(r,"reserveShortcutHintSpace",7,!1),b=Z(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",I=d$.replace("text-ui","type-caption");function q(k){i()(k)}function x(k,Q){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),q(Q))}function D(k,Q){k.preventDefault(),k.stopPropagation(),Md(Q,{workspaceId:b(),event:k})}function N(k,Q){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Md(Q,{workspaceId:b(),event:k}))}function T(k){return k<3}var O={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return c()},set onEdit(k){c(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(k=!1){g(k),ee()},get workspaceId(){return b()},set workspaceId(k){b(k),ee()},$set:gn,$on:(k,Q)=>pn(r,k,Q)},V=Wt(),ie=ye(V);{var R=k=>{var Q=Kx(),ge=S(Q);{const Re=(pe,qe)=>{let fe=()=>(qe?.()).item,oe=()=>(qe?.()).index;const Te=o(()=>ey(fe())),J=o(()=>e(Te)[0]?.type==="text"?e(Te)[0].content:"");var ae=Vx(),Ae=S(ae),He=S(Ae);ct(He,{get icon(){return Bf},size:16,get class(){return ur}}),y(Ae);var W=_(Ae,2),C=S(W),re=de(C,!0),Me=_(C);Dn(Me,17,()=>e(Te).slice(e(J)?1:0),V_,(z,Se)=>{var Ce=Wt(),De=ye(Ce);{var at=Fe=>{const Pe=o(()=>Zb(e(Se).url));var G=zx(),te=de(G,!0);L(()=>{ze(G,"href",e(Pe)),ze(G,"title",e(Pe)),j(te,e(Se).label)}),ps("click",G,Oe=>D(Oe,e(Pe))),ps("keydown",G,Oe=>N(Oe,e(Pe))),p(Fe,G)},Xe=Fe=>{var Pe=ln();L(()=>j(Pe,e(Se).content)),p(Fe,Pe)};B(De,Fe=>{e(Se).type==="link"?Fe(at):Fe(Xe,-1)})}p(z,Ce)}),y(W);var H=_(W,2);{var Y=z=>{var Se=jx();let Ce;var De=de(Se);L(()=>{Ce=ke(Se,1,`${I??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),ze(Se,"aria-hidden",f()?void 0:"true"),ze(Se,"data-hint-visible",f()),j(De,`${P}${oe()+1}`)}),p(z,Se)},X=o(()=>T(oe())&&(f()||g()));B(H,z=>{e(X)&&z(Y)})}var Ie=_(H,2);{var Ne=z=>{M$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());bt(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(fe())},get"aria-label"(){return e(at)},children:(Xe,Fe)=>{ct(Xe,{get icon(){return L$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Gx(),Xe=de(at,!0);L(Fe=>j(Xe,Fe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Ie,z=>{c()&&z(Ne)})}y(ae),L(z=>{ke(ae,1,`${Df} ${c$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Ae,1,`${Bl??""} mt-px self-start`),ze(C,"aria-label",z),j(re,e(J))},[()=>Xb(fe())]),ps("click",C,z=>{z.stopPropagation(),q(fe())}),ps("keydown",C,z=>x(z,fe())),p(pe,ae)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");P$(ge,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Re,$$slots:{row:!0}})}y(Q),Nt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Nt(2,Q,()=>to,()=>({tier:"fast"})),p(k,Q)};B(ie,k=>{a().length>0&&k(R)})}return p(n,V),vn(O)}Bd(["click","keydown"]);var Qx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function gv(n,r){if(new.target)return un({component:gv,...n});fn(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function f(q){const x=e(c).find(D=>D.label===q);x&&a()(x.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),ee()},get compact(){return i()},set compact(q=!1){i(q),ee()},$set:gn,$on:(q,x)=>pn(r,q,x)},b=Qx(),h=S(b),P=de(h,!0),I=_(h,2);return Xd(I,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),y(b),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,b),vn(g)}const Zd=2e3,Jx=4e3,Yx=Jx-Zd-2;function Xx(n,r=Zd){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(b=>b.type==="text").map(b=>b.text||b.content||"").join(""),g=(l.role==="assistant"?Y_(f).cleanedContent:f).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function Zx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
1
+ var W_=Object.defineProperty;var Fg=n=>{throw TypeError(n)};var U_=(n,r,a)=>r in n?W_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>U_(n,typeof r!="symbol"?r+"":r,a),z_=(n,r,a)=>r.has(n)||Fg("Cannot "+a);var To=(n,r,a)=>(z_(n,r,"read from private field"),a?a.call(n):r.get(n)),Dg=(n,r,a)=>r.has(n)?Fg("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as un,bo as Z,bw as gn,bp as uf,b as pn,bm as u,bq as Ur,bs as ue,br as qi}from"./Dv_tIgjy.js";import{bs as fn,a5 as S,bf as fs,bA as y,W as p,bn as vn,aA as ee,aB as E,ca as se,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as _,bl as de,be as dn,b_ as L,bO as j,c5 as it,bH as w,bV as me,bj as Es,bk as ro,b$ as ln,ai as Bd,aj as ps,bo as jl,br as Mr,c0 as Dt,ak as j_,cb as sd,aw as wi,a as G_}from"./3SdAC2_C.js";import{i as B}from"./D7nvPiBp.js";import{k as xi}from"./D6gLzTDC.js";import{g as Dn,i as V_,I as eo,p as Lo,e as Eo}from"./52P8Bm3E.js";import{n as Nt,l as ma,c as to,j as Ng,k as Fo,h as K_}from"./CaXlovz7.js";import{b as gf,e as Wd,f as ke,s as ze,c as zt,g as gs}from"./DLx1kqr5.js";import{b as Q_}from"./goTpbPhD.js";import{b as wr}from"./Dn334wJv.js";import{m as J_,U as Y_,Z as X_,X as Z_,Y as ew,I as Bg,o as tw,l as nw,a2 as rw,x as Wg,$ as aw,a0 as Ug,r as sw,s as ow}from"./HW5J3T7a.js";import{Jv as F,fo as iw,eW as lw,f3 as cw,eX as dw,f1 as uw,f0 as gw,eZ as pw,e$ as fw,eY as vw,ru as hw,c6 as mw,i as $i,J4 as _w,Dc as pf,Dh as ww,Dj as zg,Dg as bw,Di as yw,vD as Iw,vF as Sw,Cp as ff,cp as $w,cn as kw,By as xw,bE as Cw,A3 as Pw,Ce as od,u$ as Rw,cq as jg,dB as Tw,dC as Aw,Co as Mw,el as Ew,CI as qw,CH as Lw,CM as Hw,CL as Ow,cQ as Fw,cT as Dw,nC as Nw,er as Bw,wR as Ww,CN as Uw,wT as zw,CO as jw,cU as Gw,cV as Vw,nK as Kw,Ah as Qw,Iq as Jw,Ag as Yw,Dt as Xw,wm as Zw,wn as eb,y$ as tb,z3 as id,wi as nb,wj as rb,rS as ab,rf as sb,rd as ob,f_ as ib,HO as lb,Lj as cb,GM as db,gn as ub,p2 as gb,Jj as pb,oj as fb,A2 as vb,ft as Gg,r2 as Vg,fm as hb,fl as mb,tB as _b,g3 as Kg,re as wb,fe as bb,C9 as yb,m as Ib,nL as Sb,zH as $b,yZ as kb,Ez as xb,Eo as Qg,xh as Cb,xi as Jg,u_ as Yg,p3 as Pb,DF as Rb,gj as Tb,g1 as Ab,eU as Mb,cM as Eb,A6 as qb,Lo as Lb,Cu as Hb,LG as Ob,y2 as Fb,ga as Db,fd as Nb,cL as Bb,cI as Wb,cH as Ub,vr as zb,xo as jb,xm as Gb,cF as Vb,cE as Kb,z5 as Qb,z0 as Jb,xn as Yb}from"./CWhRK5Rp.js";import{a as Ud}from"./CC7to1B5.js";import{aM as Xb,aL as Zb,bg as ey,a7 as ty,aD as ny,aO as ry,M as vf,a0 as hf,b8 as ay,b2 as sy,as as Xg,P as bl,b0 as Zg,a$ as ep,a_ as tp}from"./D5caROAF.js";import{l as mf,G as oy,I as Cd,at as iy,b1 as El,a9 as _f,S as ly,aW as ld,aq as cy,aJ as dy,C as uy,z as wf,s as gy,A as py,v as fy,a$ as vy,aH as bf,aG as yf,aI as hy,j as np,aM as cd,aT as rp,aS as yl,aU as ap,Q as sp,d as my,e as _y,ax as wy,V as op,aE as by,c as yy,m as Iy,aV as ip,ap as Sy,aw as lp,a as $y,aA as ky,ad as cp,aD as xy,aX as dp,a_ as up,n as gp,ae as Cy,R as Py,ay as pp,am as Ry,O as Ty,as as Ay,h as My,q as Ey,$ as dd,_ as qy,aC as fp,a8 as Ly,f as Hy,i as Oy,a6 as Fy,ac as Dy}from"./Bs12y6Hh.js";import{f as Ny,o as By,E as Wy,C as Uy,m as zy,a2 as vp,aa as jy,K as Gy,e as Vy,y as Ky}from"./ChmjyeX7.js";import{g as Pi}from"./DypB-Dwi.js";import{dW as Dl,cU as If,O as Sf,W as Qy,bv as Jy,aF as $f,dH as kf,aU as qo,e8 as Yy,dw as xf,aw as zd,dV as jd,aN as Cf,cP as Xy,V as ha,a3 as Xs,B as Zy,a7 as eI,a4 as tI,M as nI,a6 as rI,ar as aI,aG as Pf,aO as ql,b6 as sI,ay as Rf,r as oI,n as Pd,H as iI,dY as lI,aQ as cI,aK as dI,c9 as uI,aW as gI,bM as pI,bK as fI,bL as vI,c8 as hI,c7 as mI,cN as _I,cM as wI,aS as bI,bb as yI,bd as II,bg as SI,bc as $I,bl as kI,bf as xI,be as CI,bh as PI,bi as RI,bk as TI,bj as AI,ax as MI,cj as EI,ck as qI,dv as LI,du as HI,a$ as OI,G as FI,b3 as DI,cf as NI,C as hp,d0 as BI,ba as ds,b$ as WI,X as UI,bq as zI,E as jI,ad as GI,t as VI,cW as KI,d3 as mp,Q as _p,dt as QI,cQ as ud}from"./BqA-3o9l.js";import{u as Tf,a as Il,ag as JI,x as YI,ad as Af,af as XI,ac as Mf,a4 as ZI,F as wp,D as eS,e as tS,n as nS,s as rS,m as aS,Y as sS,k as oS}from"./Erflp_L7.js";import{a2 as iS,b5 as lS,cM as cS,a_ as dS,b4 as uS,c2 as gS,c9 as pS,w as fS,x as vS,cd as hS}from"./ChbSsiLP.js";import{n as mS,P as Ef,F as _S,ai as wS,r as bS,ac as yS}from"./CXuejdJ2.js";import{I as IS,s as SS,H as bp}from"./Bqd7fdCF.js";import{e as $S}from"./CL3a4Hm1.js";import{e as kS,f as xS}from"./0Z0gfzJL.js";import{s as CS,o as Zs,b as PS,g as Nl,d as RS,l as bi}from"./CIyUrgF0.js";import{a5 as TS,a7 as AS,D as MS,N as ES,ac as yp,X as qS,i as LS,r as dr,v as Ri,u as na,p as ki,x as br,S as Gd,m as Gl,s as Ho,y as Ti,o as ao,n as so,t as Ip,aa as oo,w as io,a9 as Vd,q as _a,z as Oo,J as Rd,_ as Sp,g as HS,F as OS,U as qf,I as Lf,a8 as Hf,a6 as Ll,O as FS,E as Of,V as DS,A as NS,b as BS,ab as WS,ad as Sl,G as US,e as gd,l as zS,C as jS,f as Ys,j as $p,H as us,Q as GS,d as $l,c as VS,a as kp,h as KS,L as QS,Y as xp,a4 as pd,a1 as Cp,a0 as JS,a3 as Pp,$ as Rp,T as YS,B as XS,k as ZS,a2 as e$,K as t$,R as n$,P as r$,W as a$}from"./CN4T3mPu.js";import{m as s$}from"./Dms_DO28.js";import{g as Ff}from"./BtoHpP4W.js";import{b as o$}from"./CxTWC0xh.js";import{g as i$}from"./Dk6jt2Sr.js";import{a as l$}from"./DhJScVOu.js";import{q as Df,d as ur,r as c$,e as Bl,j as d$,g as Td,i as u$,f as Ad,c as g$,A as p$,O as Tp,k as f$}from"./XnLS-7bS.js";import{P as v$}from"./B7Hu5ie3.js";import{e as h$}from"./CZWVWqa-.js";import{b as m$,a as _$,g as w$,c as b$,i as y$}from"./CLi-M9va.js";import{R as I$,g as S$,W as kl,c as $$}from"./aUozHpqP.js";import"./Bq_LXeQl.js";import"./CJm4uIn-.js";import{s as Ai}from"./BPxuNmyn.js";import{F as k$,h as x$}from"./D7fB2Oi-.js";import"./Btdq1w8A.js";import{C as C$,e as Br,L as P$,l as Vl,d as Kl,K as Ql,h as Kd,M as Jl,S as Da}from"./Cv8U-Bhv.js";import{D as R$}from"./7J-n_WZL.js";import{f as Ap}from"./CBFFWZgt.js";import"./DU3vNstz.js";import{i as Nf}from"./BjLb7AHW.js";import{h as Mp,i as Ep,g as qp,P as Lp,C as T$,m as Hl,R as A$}from"./I4WMrmBa.js";import{f as bt,ae as M$}from"./Z_oRTxSz.js";import{F as ct,bs as E$,cd as q$,aw as Na,a2 as Bf,c9 as L$,bf as H$,be as O$,bg as F$,aO as Hp,aj as fd,aB as vd,bB as Wf,d3 as Wl,cF as D$,aM as Op,cb as Fp,cK as Ul,bu as N$,aS as B$,d0 as W$,a8 as Uf,ac as U$,ag as z$,cr as j$,ba as G$,aC as zf,cT as Dp,cz as V$,ax as K$,cD as Q$,c3 as J$}from"./B80pUkKE.js";import{c as jf}from"./ChTqQfQN.js";import"./KS3jDVZW.js";import{c as Et}from"./DpKzpN4e.js";import{a5 as Gf,bg as Y$,ar as X$,k as Z$,Y as ek,W as tk,a2 as nk,Z as rk,bw as ak,V as sk,a1 as ok,ah as ik}from"./BOzhtrmb.js";import{d as zl,f as lk,e as ck}from"./D7DlvngK.js";import{A as dk}from"./Ddh10uX0.js";import{D as uk}from"./Bbnh6hIR.js";import"./Cm6Te9Vq.js";import{a as gk,C as pk}from"./CgTkwFoW.js";import"./B23aic_N.js";import{C as fk}from"./D37tfO3G.js";import{h as Md,r as vk,a as hk}from"./UEAQx6Yh.js";import{s as mk}from"./hwNPEYu3.js";import{I as _k,a as Vf}from"./C76HLoEq.js";import{L as wk}from"./PCtE9_eA.js";import{g as bk,f as yk,b as Ik}from"./Bsz2ybz8.js";import{s as Mi,g as Yn,i as Sk,j as $k,e as Np,r as Bp,f as kk,d as xk,a as hd,h as Ck}from"./Drd1b60V.js";import{i as Wp,a as Pk}from"./Bu13V5mO.js";import{seekConversationToMessage as Up}from"./Cz2wArhm.js";import{l as Jt,o as md,h as Qd,n as Ed,q as Rk}from"./JGtSKGY1.js";import{o as Tk}from"./JPasKHb8.js";import{A as Kf}from"./DvxySjLz.js";import{b as Qf}from"./C8mPociq.js";import{g as Ak,e as Jf,v as Mk,f as Ek,N as qk,M as Lk,K as Hk,k as Yf,l as Ok,H as Xf,s as Zf}from"./l-ihYetV.js";import{selectCurrentWorkspaceTabId as _d}from"./3W8n_N-7.js";import{o as Fk}from"./BYeqTXC2.js";import{d as Dk}from"./B0Z-1lwJ.js";import{P as Nk}from"./HW7u71-8.js";import{g as Bk}from"./BT-SBMwG.js";import{H as ev,M as Wk,y as Uk,J as zk,g as jk,i as Gk,u as Vk,e as tv,c as nv,d as Kk}from"./C2IakNsF.js";import{c as Qk,h as Jd,f as rv,Q as Jk}from"./BivYofy-.js";import{t as Yk}from"./DAsc1V4f.js";import{s as Xk}from"./BsieX9dN.js";import{i as av}from"./Cjgh9KMf.js";import{d as Zk,i as ex,r as tx}from"./CTbHaK7N.js";import{g as nx}from"./BH7eVR7o.js";var rx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ax=E("<div><!></div>");function sv(n,r){if(new.target)return un({component:sv,...n});fn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=uf(r,rx);var f={get ref(){return a()},set ref(h=null){a(h),ee()},get class(){return i()},set class(h){i(h),ee()},get children(){return c()},set children(h){c(h),ee()},$set:gn,$on:(h,P)=>pn(r,h,P)},g=ax();gf(g,h=>({"data-slot":"card-header",class:h,...l}),[()=>Wd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",fk,i())]);var b=S(g);return Ai(b,()=>c()??fs),y(g),wr(g,h=>a(h),()=>a()),p(n,g),vn(f)}var sx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ox=E("<div><!></div>");function ov(n,r){if(new.target)return un({component:ov,...n});fn(r,!0);let a=Z(r,"ref",15,null),i=Z(r,"class",7),c=Z(r,"children",7),l=uf(r,sx);var f={get ref(){return a()},set ref(h=null){a(h),ee()},get class(){return i()},set class(h){i(h),ee()},get children(){return c()},set children(h){c(h),ee()},$set:gn,$on:(h,P)=>pn(r,h,P)},g=ox();gf(g,h=>({"data-slot":"card-title",class:h,...l}),[()=>Wd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var b=S(g);return Ai(b,()=>c()??fs),y(g),wr(g,h=>a(h),()=>a()),p(n,g),vn(f)}const xl=IS.CHAT_MEDIA,wd=CS().min(1).max(512);Zs({workspaceId:wd,agentId:wd,draftId:Nl(),principalId:wd,media:PS(mS).min(1).max(20)}).strict();const ix=Zs({sessionId:Nl()}).strict();ix.extend({control:RS("action",[Zs({action:bi("readiness")}).strict(),Zs({action:bi("export"),request:kS}).strict(),Zs({action:bi("transcribe"),request:xS}).strict(),Zs({action:bi("release"),jobId:Nl()}).strict(),Zs({action:bi("adopt"),jobId:Nl()}).strict()])}).strict();function Yd(n,r,a,i=async(c,l)=>typeof window>"u"||SS(window)!=="electron"?{ok:!1,error:"unavailable"}:$S().invoke(c,l)){let c=null,l=null,f=!1;async function g(){f=!0,a.removeEventListener("abort",b);const x=c;c=null,x&&await i(xl.CLOSE,{sessionId:x}).catch(()=>{})}const b=()=>{g()};a.addEventListener("abort",b,{once:!0});const h=()=>{if(f||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(h(),c)return c;if(l)return l;l=(async()=>{const x=await i(xl.BEGIN,n);if(!x.ok)throw new Error("media-export-unavailable");c=x.value.sessionId;try{return h(),c}catch(D){throw await g(),D}})();try{return await l}finally{l=null}}async function I(x){const D=await P();h();const N=await i(xl.CONTROL,{sessionId:D,control:x});return h(),N}return{service:{exportMedia:x=>I({action:"export",request:x}),adoptMediaJob:x=>I({action:"adopt",jobId:x}),transcribeMedia:x=>I({action:"transcribe",request:x}),releaseMediaJob:async x=>c?await i(xl.CONTROL,{sessionId:c,control:{action:"release",jobId:x}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>I({action:"readiness"})}}const bd=new Set;async function lx(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:f,agentId:g}=i,b=Pi(F.state),h=Dl.select(F.state,f),P=If.select(F.state),I=mf(),q=JSON.stringify([b,f,g]);if(!b||!h||!P||l.wsId!==f||bd.has(q))return!1;bd.add(q);const x=new AbortController,D=()=>x.abort();a.addEventListener("abort",D,{once:!0});const N=()=>!a.aborted&&!x.signal.aborted&&Pi(F.state)===b&&Dl.select(F.state,f)===h&&_f(I)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{N()||x.abort()});let O=null;try{if(!N()||iS(c))return!1;const V=Tf(i.attachments),ie=Ef(_S(f,g),V,c.map(pe=>({contextItemId:pe.id,attachmentId:pe.attachmentId,path:pe.path}))),R=new Set([...ie.images,...ie.clips].map(pe=>pe.contextItemId));if(V.some(([pe])=>!R.has(pe))||ie.images.some(pe=>pe.mediaError)||ie.clips.some(pe=>pe.mediaError)||!wS(l.text,ie))throw new Error("invalid-evidence");if(O=n.warm?.take(i,x.signal)??null,!await r.flushDraft(i)||!N())return!1;const k=await Ny.agents.get(g,f);if(!N())return!1;if(!k||k.workspaceId!==f||k.retiredAt||k.pendingDeleteAt||k.status==="deleted")throw new Error("unavailable");const Q=ie.clips.flatMap(pe=>pe.media?[pe.media]:[]);Q.length&&!O&&(O=Yd({workspaceId:f,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},N,x.signal));const ge=oy(c,ie),Re=Cd(ge),he=await iy({workspaceId:f,agentId:g,evidence:ie,clickedItems:c,sendItems:ge,clickedPayload:{...l,contextItems:ge,imageBlocks:Re.imageBlocks,fileBlocks:Re.fileBlocks},binding:I,service:O?.service??null,current:N,onRecord:()=>{}});return!he||!N()?!1:El(F,g,he)}catch{return N()&&F.dispatch(iw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",D),await O?.dispose(),bd.delete(q)}}const iv=1e4,zp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function jp(n){return TS(n.messageMetadata)}function cx(n,r){if(n.some(jp)){const a=n[0];return a&&!jp(a)&&Gp(a,r)?[a.id]:[]}return n.filter(a=>Gp(a,r)).map(a=>a.id)}function dx(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Gp(n,r){return!n.requeuedAfterFailure&&AS(n,r)}function ux(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,f=r.blocked||r.interrupted,g=r.timeoutMs??iv;let b=n.prediction;if(b){const x=new Set(i.map(O=>O.id)),D=b.ids.filter(O=>x.has(O)&&!c.has(O)),N=l-b.startedAt>=g,T=n.wasBusy&&!a;!D.length||N||f&&!a||T?b=null:D.length!==b.ids.length&&(b={...b,ids:D})}const h=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,I=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!b&&h&&!f&&!I){const x=cx(i,l).filter(D=>!c.has(D));x.length&&(b={ids:x,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&I,prediction:b};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class gx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(f=>{c=setTimeout(()=>f(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function px(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Vp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var fx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function lv(n,r){if(new.target)return un({component:lv,...n});fn(r,!0);const a=()=>ue(P,"$typing$",i),[i,c]=Ur();let l=Z(r,"workspaceId",7),f=Z(r,"agentId",7),g=Z(r,"class",7,"");const b=Bn(""),h=Bn("");se(()=>{b.set(l())}),se(()=>{h.set(f())});const P=lS(b,h),I=o(()=>h$(a()));var q={get workspaceId(){return l()},set workspaceId(O){l(O),ee()},get agentId(){return f()},set agentId(O){f(O),ee()},get class(){return g()},set class(O=""){g(O),ee()},$set:gn,$on:(O,V)=>pn(r,O,V)},x=Wt(),D=ye(x);{var N=O=>{var V=fx(),ie=S(V),R=S(ie);v$(R,{get people(){return a()},size:12,decorative:!0}),y(ie);var k=_(ie,2),Q=de(k,!0);dn(2),y(V),L(()=>{ke(V,1,`${Df} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(I))}),p(O,V)};B(D,O=>{e(I)&&O(N)})}p(n,x);var T=vn(q);return c(),T}const vx=50,hx=5e3,mx=500,_x=()=>({authority:()=>Pi(F.state),persistSnapshot:cy,dispatch:n=>F.dispatch(n),ownerView:n=>dy.withStore(F)(n)});function wx(n){const r=n.store??_x(),a=crypto.randomUUID();let i=me(!1),c=me(!1),l=me(!1),f=null,g=null,b=0,h=!1,P=null,I=null,q=null,x=0,D=null,N=null;const T={};let O,V=me([]),ie=null,R=0,k="",Q=0,ge="";const Re=()=>{const W=n.workspaceId(),C=n.agentId();if(!W||!C||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||h)return null;const Me=n.inputValue(),H=pe(),Y=O?.shared,X=Y?.workspaceId===W&&Y.agentId===C?Y.lifetime:null,Ie=JSON.stringify([re,W,C,x,X,H.map(z=>[z.id,z.attachmentId,z.path])]);Ie!==ge&&(ge=Ie,Q+=1);const Ne=JSON.stringify([re,W,C,Me,H,x]);return Ne!==k&&(k=Ne,R+=1),{authority:re,ownerId:a,workspaceId:W,agentId:C,text:Me,attachments:JSON.parse(JSON.stringify(H)),generation:R,attachmentEpoch:Q}};let he=null;const pe=()=>JI(n.contextItems(),YI(n.contextItems(),e(V))),qe=W=>{if(O=W,!W||h)return;const C=W.restore;if(N&&C?.requestId===N.requestId&&C.status!=="pending"){const{apply:H}=N;N=null,w(c,!1),C.status==="restored"&&w(V,C.draft?.attachments??[]),H(C)}const re=W.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(ie!==H){ie=H;const Y=he??f,X=Y&&n.inputValue()===Y.text&&JSON.stringify(pe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:X&&(b+=1,q&&clearTimeout(q),w(V,re.snapshot.attachments),he=f={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(V))},n.setInputValue(re.snapshot.text),n.setContextItems(Il(e(V))),n.applyEditorContent(re.snapshot.text))}}it(Re);const Me=[];for(const H of W.saves){if(H.status==="pending")continue;Me.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}Me.length>0&&queueMicrotask(()=>r.dispatch(uw(a,Me)))},fe=(W,C,re)=>{const Me=crypto.randomUUID();N={requestId:Me,apply:re},w(c,!0),r.dispatch(pw(a,Me,W,C))},oe=()=>{N&&(N=null,w(c,!1),r.dispatch(vw(a)))},Te=()=>{const W=D;W&&(D=null,r.dispatch(fw(a)),O?.saves.some(C=>C.id===W)||delete T[W])};r.dispatch(lw(a));const J=r.ownerView(a).subscribe(W=>it(()=>qe(W))),ae=()=>{I&&(clearTimeout(I),I=null),w(l,!1)},Ae=()=>{D&&(D=null,r.dispatch(gw(a)))};se(()=>{const W=n.active?.()??!0,C=n.workspaceId(),re=n.agentId();if(!W){it(()=>{b+=1,g=null,oe(),P&&clearTimeout(P),P=null,ae(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!C||!re)return;const Me=`${C}\0${re}`;if(g===Me)return;const H=g!==null;g=Me;const Y=++b;it(()=>{f=null,he=null,ie=null,w(V,[]),P&&clearTimeout(P),ae(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const X=ly(C,re);if(X){w(V,X.attachments),w(i,!1);const Ne=n.contextItems().length>0,z=X.text,Se=JSON.stringify(X.attachments);n.setInputValue(X.text),Ne||n.setContextItems(Il(X.attachments)),n.applyEditorContent(X.text),f={text:X.text,attachmentsJson:Se},fe(C,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(h||!(n.active?.()??!0)||g!==Me||b!==Y)return;const at=De?.text??"",Xe=De?.attachments??[],Fe=JSON.stringify(Xe);ld(C,re,{text:at,attachments:Xe});const Pe=n.inputValue()===z&&JSON.stringify(pe())===Se;Ne||!Pe||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Fe!==Se&&n.setContextItems(Il(Xe)),f={text:at,attachmentsJson:Fe})});return}w(i,!0),I=setTimeout(()=>{I=null,(n.active?.()??!0)&&w(l,!0)},mx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ae())},hx);const Ie=()=>{!(n.active?.()??!0)||g!==Me||b!==Y||(P&&clearTimeout(P),w(i,!1),ae())};fe(C,re,Ne=>{if(Ne.status!=="restored"){Ie();return}const z=Ne.draft;if(h||!(n.active?.()??!0)||g!==Me||b!==Y)return;const Se=!!n.inputValue();if(!Se&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Il(z.attachments)),!Se&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},vx)),f===null){const Ce=z?.text??"",De=z?.attachments??[];f={text:Ce,attachmentsJson:JSON.stringify(De)},ld(C,re,{text:Ce,attachments:De})}Ie()})})}),se(()=>{const W=n.active?.()??!0,C=n.workspaceId(),re=n.agentId(),Me=e(i);if(!W){it(Te);return}if(!C||!re)return;const H=n.inputValue(),Y=pe();if(it(Re),it(Te),Me||f===null&&!H&&Y.length===0)return;const X=JSON.stringify(Y);if(f!==null&&f.text===H&&f.attachmentsJson===X)return;JSON.stringify(e(V))!==X&&w(V,Y);const Ie=`${C}\0${re}`,Ne=x,z=crypto.randomUUID();T[z]=Se=>{if(n.active?.()??!0){if(Se.status==="saved"){g===Ie&&x===Ne&&(f={text:H,attachmentsJson:X});return}n.onSaveError?.(new Error(Se.error))}},it(()=>{D=z,r.dispatch(cw(a,z,{authority:r.authority?.()??void 0,workspaceId:C,agentId:re,text:H,attachments:Y,rollback:f?{text:f.text,attachments:JSON.parse(f.attachmentsJson)}:null}))})}),se(()=>()=>{h=!0,P&&clearTimeout(P),I&&clearTimeout(I),q&&clearTimeout(q),Ae(),J(),r.dispatch(dw(a))});const He=W=>{const C=Re();return C!==null&&C.authority===W.authority&&C.ownerId===W.ownerId&&C.workspaceId===W.workspaceId&&C.agentId===W.agentId&&C.generation===W.generation&&C.text===W.text&&JSON.stringify(C.attachments)===JSON.stringify(W.attachments)};return{captureDraft:Re,isCurrentDraft:He,updateAttachmentScreen(W,C,re){return!He(W)||!W.attachments.some(Me=>Me.id===C)?null:(w(V,W.attachments.map(Me=>Me.id===C?{...Me,screen:structuredClone(re)}:Me)),Re())},async flushDraft(W){if(!He(W))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,W.workspaceId,W.agentId,W,W.authority),He(W)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(b+=1,x+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ae(),Te(),g!==null){const[W,C]=g.split("\0");ld(W,C,{text:"",attachments:[]}),he=null,w(V,[]),f={text:"",attachmentsJson:"[]"}}}}}function Ei(n){if(!n)return null;const r=Ef(JSON.stringify([n.workspaceId,n.agentId]),Tf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function bx(n,r,a){const i=F.state.principal.snapshot,c=()=>Pi(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,f=Yd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await f.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(b=>b.sourceId===r.source.id)??{ready:!1}}finally{await f.dispose()}}function Kp(n){let r=me(null),a=me(!1),i=me(!1),c=null,l=!0,f=0,g=null;Es(()=>{l=!1,f++}),se(()=>{const I=n.capture();e(r)&&(!I||I.authority!==e(r).capture.authority||I.ownerId!==e(r).capture.ownerId||I.workspaceId!==e(r).capture.workspaceId||I.agentId!==e(r).capture.agentId||I.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function b(I){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),x=Ei(q),D=x?.clips.find(V=>V.contextItemId===I);if(!q||!D?.media||!x)return;const N=uy({workspaceId:q.workspaceId,agentId:q.agentId,clip:D,evidence:x,marks:x.marks}),T=wf(q.workspaceId,D.path);if(!N||!T)return;const O=++f;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||f!==O||!n.drafts.isCurrentDraft(q))return;const V=await(n.prepareOutput??bx)(q,D.media,n.drafts);if(!l||f!==O||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:ie,...R}=N;w(r,{capture:q,contextItemId:I,snapshot:{...R,openId:crypto.randomUUID(),mediaUrl:T,output:V,deleteReady:!0}})}catch{l&&f===O&&w(i,!0)}finally{l&&f===O&&w(a,!1)}}async function h(I){const q=crypto.randomUUID(),x=e(r),D=n.drafts.captureDraft();if(!x||!D||D.authority!==x.capture.authority||D.ownerId!==x.capture.ownerId||D.workspaceId!==x.capture.workspaceId||D.agentId!==x.capture.agentId||D.attachmentEpoch!==x.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const N=Ei(D),T=N?.clips.find(Q=>Q.contextItemId===x.contextItemId);if(!N||!T?.media)return{requestId:q,result:"stale-source"};const V=g?.openId===x.snapshot.openId&&g.inputRevision===I.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...I,revision:T.media.saved?.revision??0}:I,ie=bS(T.media,{openId:x.snapshot.openId,...x.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:D.workspaceId,agentId:D.agentId},sourceId:I.sourceId,sourceRevision:I.sourceRevision,expectedEditRevision:V.revision,edit:V});if(ie.status!=="saved")return{requestId:q,result:ie.status==="invalid-edit"?"failed":ie.status};const R=yS({...N,clips:N.clips.map(Q=>Q.id===T.id?{...Q,media:ie.media}:Q)})[x.contextItemId],k=n.drafts.updateAttachmentScreen(D,x.contextItemId,R);if(!k)return{requestId:q,result:"stale-source"};g={openId:x.snapshot.openId,media:ie.media,inputRevision:I.revision};try{if(!n.drafts.isCurrentDraft(k))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(k);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==x.snapshot.openId||!Q||Q.attachmentEpoch!==x.capture.attachmentEpoch||Q.authority!==k.authority||Q.ownerId!==k.ownerId||Q.workspaceId!==k.workspaceId||Q.agentId!==k.agentId||JSON.stringify(Q.attachments.find(ge=>ge.id===x.contextItemId)?.screen)!==JSON.stringify(R)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:ie.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(I){return n.disabled()||!n.onRemove(I)?!1:(e(r)?.contextItemId===I&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:b,save:h,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var yx=E('<p role="alert"> </p>'),Ix=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),Sx=E("<!> <!> <!>",1);function cv(n,r){if(new.target)return un({component:cv,...n});fn(r,!0);let a=Z(r,"capture",7),i=Z(r,"drafts",7),c=Z(r,"disabled",7,!1),l=Z(r,"onRemove",7),f=Z(r,"controllerFactory",7,Kp),g=Z(r,"beforeOpen",7),b=Z(r,"onReviewChange",7);const h=it(()=>f()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:R=>l()(R),beforeOpen:()=>g()?.()??Promise.resolve()}));se(()=>{const R=h.opening,k=h.session;it(()=>b()?.(R,k?.snapshot.output?.ready?{openId:k.snapshot.openId,capture:k.capture}:null))});const P=o(gy),I=o(()=>Ei(a())),q=o(()=>e(I)?.clips.map(R=>({id:R.contextItemId,kind:"clip",owner:"evidence",duration:Ap(R.durationMs),recording:!1,url:a()?wf(a().workspaceId,R.path):void 0,...R.media?.saved?{summary:py(R.media.saved)}:{}}))??[]);let x=me(null);var D={get capture(){return a()},set capture(R){a(R),ee()},get drafts(){return i()},set drafts(R){i(R),ee()},get disabled(){return c()},set disabled(R=!1){c(R),ee()},get onRemove(){return l()},set onRemove(R){l(R),ee()},get controllerFactory(){return f()},set controllerFactory(R=Kp){f(R),ee()},get beforeOpen(){return g()},set beforeOpen(R){g(R),ee()},get onReviewChange(){return b()},set onReviewChange(R){b(R),ee()},$set:gn,$on:(R,k)=>pn(r,R,k)},N=Sx(),T=ye(N);{let R=o(()=>c()||h.opening);MS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(R)},onEdit:k=>void h.open(k),onMarkUp:k=>void h.open(k),get onRemove(){return h.remove}})}var O=_(T,2);{var V=R=>{var k=yx(),Q=de(k,!0);L(ge=>j(Q,ge),[()=>u.dock_captureEditor_saveFailed_label()]),p(R,k)};B(O,R=>{h.problem&&R(V)})}var ie=_(O,2);{let R=o(()=>!!h.session),k=o(()=>u.dock_captureEditor_recording_title({duration:h.session?Ap(h.session.snapshot.durationMs??0):""}));C$(ie,{get open(){return e(R)},size:"editor",showCloseButton:!1,get title(){return e(k)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>h.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),h.restoreFocus()},get contentRef(){return e(x)},set contentRef(Q){w(x,Q,!0)},children:(Q,ge)=>{var Re=Wt(),he=ye(Re);{var pe=qe=>{var fe=Wt(),oe=ye(fe);xi(oe,()=>h.session.snapshot.openId,Te=>{var J=Ix(),ae=S(J);R$(ae,{get snapshot(){return h.session.snapshot},get shortcutDialog(){return e(x)},onClose:()=>h.close(),get onSave(){return h.save},onDelete:async()=>!!h.session&&h.remove(h.session.contextItemId)}),y(J),p(Te,J)}),p(qe,fe)};B(he,qe=>{h.session&&qe(pe)})}p(Q,Re)},$$slots:{default:!0}})}return p(n,N),vn(D)}const Cl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function $x(n){let r=me(!1),a=me(!1),i=me(null),c=!1,l=0,f=null,g=null;async function b(I){I.abort.abort(),I.slot?.cancel(),await I.native?.dispose()}async function h(){l++;const I=g;g=null,I&&await b(I)}ro(()=>{const I=()=>{w(r,document.hasFocus(),!0)};return I(),window.addEventListener("focus",I),window.addEventListener("blur",I),()=>{window.removeEventListener("focus",I),window.removeEventListener("blur",I)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&h()});return Es(()=>{c=!0,P(),h()}),se(()=>{const I=n.capture(),q=I?Cl(I):"",x=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);it(()=>{if(!x||!I){h();return}if(g?.key===q)return;if(f===q){h();return}h();const N=Ei(I)?.clips.flatMap(Re=>!Re.mediaError&&Re.media?[Re.media]:[])??[],T=N[0],O=F.state.principal.snapshot,V=Dl.select(F.state,I.workspaceId);if(!T||!O||!V||n.drafts.gateActive)return;const ie=mf(),R=new AbortController,k=()=>!c&&!R.signal.aborted&&Pi(F.state)===I.authority&&Dl.select(F.state,I.workspaceId)===V&&_f(ie)&&!!n.capture()&&Cl(n.capture())===q,Q={key:q,capture:I,abort:R,native:null,slot:null,current:k};g=Q;const ge=l;n.drafts.flushDraft(I).then(async Re=>{if(!(g!==Q||ge!==l||!k())){if(!Re){f=q,await h();return}Q.native=Yd({workspaceId:I.workspaceId,agentId:I.agentId,draftId:crypto.randomUUID(),principalId:O.principal.id,media:structuredClone(N)},k,R.signal),Q.slot=fy(Q.native.service),f=q,Q.slot.warm(q,T,k)}}).catch(()=>{g===Q&&h()})})}),{cancel:h,async beforeEditorOpen(){w(a,!0),f=null,await h()},editorState(I,q){w(a,I,!0);const x=q?Cl(q.capture):null;q&&e(i)?.openId!==q.openId&&(f=null),w(i,q&&x?{openId:q.openId,key:x}:null)},take(I,q){const x=g;if(!x?.native||!x.slot||x.key!==Cl(I)||!x.current())return h(),null;g=null,l++;const D=x.native,N=x.slot,T=()=>x.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...D.service,takePreparedRecording:O=>N.take(x.key,O,()=>!q.aborted&&x.current())},async dispose(){q.removeEventListener("abort",T),await b(x)}}}}}var kx=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function dv(n,r){if(new.target)return un({component:dv,...n});fn(r,!1);var a={$set:gn,$on:(f,g)=>pn(r,f,g)};Nf();var i=kx(),c=S(i),l=de(c,!0);return y(i),L(f=>j(l,f),[()=>u.chat_draftGate_loading_label()]),p(n,i),vn(a)}var xx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function qd(n,r){if(new.target)return un({component:qd,...n});fn(r,!1);var a={$set:gn,$on:(f,g)=>pn(r,f,g)};Nf();var i=xx(),c=_(S(i),2),l=de(c,!0);return dn(2),y(i),L((f,g)=>{ze(i,"aria-label",f),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),vn(a)}function Cx(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Px(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Rx(n,r){return r&&n.includes(r)?r:null}function Qp(n,r,a){return r-n<=a}const Tx=.2;function Jp(n,r,a){const i=Math.max(0,a-r),c=n-Tx*r;return Math.min(Math.max(0,c),i)}function Ax(n,r,a){return n!==null&&a&&n===r}function Mx(n){return n?hw(n)&&mw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Ex(n){const r=[],a=new Set;let i,c;for(const O of n.messages){if(O.agentId&&O.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(O.id))continue;a.add(O.id),n.breakBeforeMessageIds?.has(O.id)&&(i=void 0,c=void 0);const V=ES(O);if(V?.kind!=="turn-failure")c=void 0;else{const ie=i?.seq!==void 0&&O.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(O.seq)&&O.seq===i.seq+1;(!c||!ie)&&(c={key:JSON.stringify([n.agentId,"notice",O.id]),anchorMessageId:O.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:O.id,reason:V.reason,timestamp:O.timestamp}),c.recordedFailureCount+=1}i=O}const l=new Map;for(const O of n.queue){if(!O.requeuedAfterFailure)continue;const V=O.turnId||void 0,ie=JSON.stringify([n.agentId,V?"turn":"queue",V??O.id]);let R=l.get(ie);R||(R={key:ie,correlation:V?"turn":"queue-entry",turnId:V,queueIds:[],state:"queued"},l.set(ie,R)),R.queueIds.includes(O.id)||R.queueIds.push(O.id)}const f=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,b=g?.status===$i.Error,h=n.transientError||b&&g.stopReason||null,P=b&&!h,I=b&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=I?yp(I):null,x=q&&h&&h===g?.stopReason?r.flatMap(O=>O.records).filter(O=>O.reason===h&&yp(O.timestamp)===q):[],D=x.length===1?x[0].messageId:void 0,T=(g?Sf(g):!1)?"attempting":f.length?"queued":h||P?"action-needed":"inactive";return{history:r,queueRecovery:f,current:{state:T,error:h,needsFallbackReason:P,timestamp:I,noticeId:D}}}function qx(n,r){const a=n.hiddenTail[0]?.id,i=Ex({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(b=>b.messageId!==c)})).filter(g=>g.records.length>0),f=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(b=>b.messageId).filter(b=>!f.has(b))))}}var Lx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Hx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Ox=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Fx=E('<div class="mb-5"><!></div>'),Dx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Nx=E("<!> <!>",1),Bx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),Wx=E("<!> <span> </span>",1),Ux=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function uv(n,r){if(new.target)return un({component:uv,...n});fn(r,!0);const a=()=>ue(x,"$userOverrides$",f),i=()=>ue(q,"$specialists$",f),c=()=>ue(O,"$isGitHubAuth$",f),l=()=>ue(V,"$recentSpecialistIds$",f),[f,g]=Ur();let b=Z(r,"onSpecialistChange",7),h=Z(r,"session",7),P=Z(r,"workspaceId",7);const I=Bn(P()??"");se(()=>I.set(P()??""));const q=Gf(I),x=Y$();se(()=>{a()});const D=o(()=>{if(!h()||Qy(h()))return null;const W=h().metadata?.specialist||h().agentMetadata?.specialist;return W&&i().find(C=>C.id===W)||null});async function N(W){W?await zl({specialist:W,hash:"specialists"}):await zl({view:"create-specialist"})}let T=me(!1);const O=X$(),V=cS(),ie=o(()=>_w(Z$(i(),c()),l()));let R=me(!1);const k=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(D)?.name??u.chat_shared_general_fallback()),ge=o(()=>e(D)?.description??u.chat_shared_noSpecializedBehavior_label()),Re=o(()=>e(D)?e(D).defaultBehaviorPrompt||"":e(k));var he={get onSpecialistChange(){return b()},set onSpecialistChange(W){b(W),ee()},get session(){return h()},set session(W){h(W),ee()},get workspaceId(){return P()},set workspaceId(W){P(W),ee()},$set:gn,$on:(W,C)=>pn(r,W,C)},pe=Ux(),qe=S(pe);{var fe=W=>{var C=Fx(),re=S(C);uk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(R)},set open(Y){w(R,Y,!0)},trigger:(Y,X)=>{let Ie=()=>(X?.()).props;{let Ne=o(()=>Wd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));bt(Y,qi(Ie,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(Ne)},"data-testid":"specialist-picker-trigger",children:(z,Se)=>{var Ce=Lx(),De=ye(Ce),at=S(De);{let Ge=o(()=>e(D)?.id??null),Qe=o(()=>e(D)?.icon??null);dk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(Ge)},get icon(){return e(Qe)}})}y(De);var Xe=_(De,2),Fe=S(Xe),Pe=de(Fe,!0),G=_(Fe,2),te=de(G,!0);y(Xe);var Oe=_(Xe,2),we=S(Oe);ct(we,{get icon(){return Na},size:10}),y(Oe),L(()=>{j(Pe,e(Q)),j(te,e(ge))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var X=Ox(),Ie=S(X),Ne=S(Ie),z=de(Ne,!0),Se=_(Ne,2),Ce=de(Se,!0);y(Ie);var De=_(Ie,2),at=S(De);{let Pe=o(()=>e(D)?.id??null);J_(at,{get specialists(){return e(ie)},get value(){return e(Pe)},onchange:G=>{w(R,!1),b()?.(G)}})}y(De);var Xe=_(De,2),Fe=S(Xe);Et(Fe,()=>Br,(Pe,G)=>{G(Pe,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(R,!1),N()},children:(te,Oe)=>{var we=Hx(),Ge=ye(we),Qe=S(Ge);ct(Qe,{get icon(){return q$},size:12}),y(Ge);var dt=_(Ge,2),ft=de(dt,!0);L(lt=>j(ft,lt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(te,we)},$$slots:{default:!0}})}),y(Xe),y(X),L((Pe,G)=>{j(z,Pe),j(Ce,G)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,X)},$$slots:{trigger:!0,content:!0}}),y(C),p(W,C)};B(qe,W=>{b()&&W(fe)})}var oe=_(qe,2);{var Te=W=>{var C=Wt(),re=ye(C);{let Me=o(()=>u.chat_specialistSelector_prompt_label());Et(re,()=>pk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(Me)},children:(X,Ie)=>{var Ne=Nx(),z=ye(Ne);Et(z,()=>sv,(Ce,De)=>{De(Ce,{children:(at,Xe)=>{var Fe=Wt(),Pe=ye(Fe);Et(Pe,()=>ov,(G,te)=>{te(G,{class:"type-caption font-medium",children:(Oe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>u.chat_specialistSelector_prompt_label()]),p(Oe,Ge)},$$slots:{default:!0}})}),p(at,Fe)},$$slots:{default:!0}})});var Se=_(z,2);Et(Se,()=>gk,(Ce,De)=>{De(Ce,{children:(at,Xe)=>{var Fe=Dx(),Pe=ye(Fe),G=de(Pe,!0),te=_(Pe,2);bt(te,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Oe,we)=>{dn();var Ge=ln();L(Qe=>j(Ge,Qe),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Oe,Ge)},$$slots:{default:!0}}),L(()=>{ke(Pe,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(G,e(Re))}),p(at,Fe)},$$slots:{default:!0}})}),p(X,Ne)},$$slots:{default:!0}})})}p(W,C)},J=W=>{var C=Bx(),re=de(C,!0);L(()=>j(re,e(Re))),p(W,C)};B(oe,W=>{e(D)?W(Te):W(J,-1)})}var ae=_(oe,2);{var Ae=W=>{bt(W,{variant:"ghost-light",size:"sm",onclick:()=>N(e(D).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(C,re)=>{var Me=Wx(),H=ye(Me);ct(H,{get icon(){return E$},size:12,class:"opacity-60"});var Y=_(H,2),X=de(Y,!0);L(Ie=>j(X,Ie),[()=>u.chat_regularAgentWelcome_customize_label()]),p(C,Me)},$$slots:{default:!0}})};B(ae,W=>{e(D)&&W(Ae)})}y(pe),p(n,pe);var He=vn(he);return g(),He}var zx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),jx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Gx=E('<span class="type-caption"> </span>'),Vx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Kx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function Xd(n,r){if(new.target)return un({component:Xd,...n});fn(r,!0);let a=Z(r,"prompts",7),i=Z(r,"onSelect",7),c=Z(r,"onEdit",7),l=Z(r,"compact",7,!1),f=Z(r,"showShortcutHints",7,!1),g=Z(r,"reserveShortcutHintSpace",7,!1),b=Z(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",I=d$.replace("text-ui","type-caption");function q(k){i()(k)}function x(k,Q){k.key!=="Enter"&&k.key!==" "||(k.preventDefault(),q(Q))}function D(k,Q){k.preventDefault(),k.stopPropagation(),Md(Q,{workspaceId:b(),event:k})}function N(k,Q){(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),k.stopPropagation(),Md(Q,{workspaceId:b(),event:k}))}function T(k){return k<3}var O={get prompts(){return a()},set prompts(k){a(k),ee()},get onSelect(){return i()},set onSelect(k){i(k),ee()},get onEdit(){return c()},set onEdit(k){c(k),ee()},get compact(){return l()},set compact(k=!1){l(k),ee()},get showShortcutHints(){return f()},set showShortcutHints(k=!1){f(k),ee()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(k=!1){g(k),ee()},get workspaceId(){return b()},set workspaceId(k){b(k),ee()},$set:gn,$on:(k,Q)=>pn(r,k,Q)},V=Wt(),ie=ye(V);{var R=k=>{var Q=Kx(),ge=S(Q);{const Re=(pe,qe)=>{let fe=()=>(qe?.()).item,oe=()=>(qe?.()).index;const Te=o(()=>ey(fe())),J=o(()=>e(Te)[0]?.type==="text"?e(Te)[0].content:"");var ae=Vx(),Ae=S(ae),He=S(Ae);ct(He,{get icon(){return Bf},size:16,get class(){return ur}}),y(Ae);var W=_(Ae,2),C=S(W),re=de(C,!0),Me=_(C);Dn(Me,17,()=>e(Te).slice(e(J)?1:0),V_,(z,Se)=>{var Ce=Wt(),De=ye(Ce);{var at=Fe=>{const Pe=o(()=>Zb(e(Se).url));var G=zx(),te=de(G,!0);L(()=>{ze(G,"href",e(Pe)),ze(G,"title",e(Pe)),j(te,e(Se).label)}),ps("click",G,Oe=>D(Oe,e(Pe))),ps("keydown",G,Oe=>N(Oe,e(Pe))),p(Fe,G)},Xe=Fe=>{var Pe=ln();L(()=>j(Pe,e(Se).content)),p(Fe,Pe)};B(De,Fe=>{e(Se).type==="link"?Fe(at):Fe(Xe,-1)})}p(z,Ce)}),y(W);var H=_(W,2);{var Y=z=>{var Se=jx();let Ce;var De=de(Se);L(()=>{Ce=ke(Se,1,`${I??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!f()}),ze(Se,"aria-hidden",f()?void 0:"true"),ze(Se,"data-hint-visible",f()),j(De,`${P}${oe()+1}`)}),p(z,Se)},X=o(()=>T(oe())&&(f()||g()));B(H,z=>{e(X)&&z(Y)})}var Ie=_(H,2);{var Ne=z=>{M$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());bt(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:Xe=>{Xe.stopPropagation(),c()(fe())},get"aria-label"(){return e(at)},children:(Xe,Fe)=>{ct(Xe,{get icon(){return L$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Gx(),Xe=de(at,!0);L(Fe=>j(Xe,Fe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Ie,z=>{c()&&z(Ne)})}y(ae),L(z=>{ke(ae,1,`${Df} ${c$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),ke(Ae,1,`${Bl??""} mt-px self-start`),ze(C,"aria-label",z),j(re,e(J))},[()=>Xb(fe())]),ps("click",C,z=>{z.stopPropagation(),q(fe())}),ps("keydown",C,z=>x(z,fe())),p(pe,ae)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");P$(ge,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Re,$$slots:{row:!0}})}y(Q),Nt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Nt(2,Q,()=>to,()=>({tier:"fast"})),p(k,Q)};B(ie,k=>{a().length>0&&k(R)})}return p(n,V),vn(O)}Bd(["click","keydown"]);var Qx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function gv(n,r){if(new.target)return un({component:gv,...n});fn(r,!0);let a=Z(r,"onSelect",7),i=Z(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function f(q){const x=e(c).find(D=>D.label===q);x&&a()(x.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),ee()},get compact(){return i()},set compact(q=!1){i(q),ee()},$set:gn,$on:(q,x)=>pn(r,q,x)},b=Qx(),h=S(b),P=de(h,!0),I=_(h,2);return Xd(I,{get prompts(){return e(l)},onSelect:f,get compact(){return i()}}),y(b),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,b),vn(g)}const Zd=2e3,Jx=4e3,Yx=Jx-Zd-2;function Xx(n,r=Zd){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const f=(l.contentBlocks??[]).filter(b=>b.type==="text").map(b=>b.text||b.content||"").join(""),g=(l.role==="assistant"?Y_(f).cleanedContent:f).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function Zx(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
2
2
 
3
3
  `).slice(-Zd),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const c=`Suggested prompts:
4
4
  ${i.map(l=>`- ${l}`).join(`