@intent-hq/web 2.390.0 → 2.390.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/{DvhzK-4t.js → 1B7vLvp_.js} +1 -1
  3. package/web/app/immutable/chunks/{DQTlXZTK.js → 2q3SGbtI.js} +1 -1
  4. package/web/app/immutable/chunks/{Cp0zjovM.js → 7pl09QeT.js} +1 -1
  5. package/web/app/immutable/chunks/{sLmWN1ks.js → 9mJbO8Tf.js} +1 -1
  6. package/web/app/immutable/chunks/{C_O50F5M.js → B1bJpz3G.js} +1 -1
  7. package/web/app/immutable/chunks/{BABPbAn1.js → B557jpav.js} +1 -1
  8. package/web/app/immutable/chunks/{Cqrn6Iuw.js → B8lliwzm.js} +1 -1
  9. package/web/app/immutable/chunks/{DXLbZrSI.js → BAAIhuts.js} +1 -1
  10. package/web/app/immutable/chunks/{CAUT4r9n.js → BB3L0Ahp.js} +1 -1
  11. package/web/app/immutable/chunks/{DAHeBTvv.js → BB6LoQke.js} +1 -1
  12. package/web/app/immutable/chunks/{BpQNd38A.js → BB9aoG-e.js} +1 -1
  13. package/web/app/immutable/chunks/{C7KJ2WWY.js → BBPVt-9A.js} +1 -1
  14. package/web/app/immutable/chunks/{CsJwP4fg.js → BEP4JwDJ.js} +1 -1
  15. package/web/app/immutable/chunks/{C3WhRTo5.js → BEQVnLdV.js} +1 -1
  16. package/web/app/immutable/chunks/{CCdFHP5T.js → BESb5QC3.js} +1 -1
  17. package/web/app/immutable/chunks/{DZ-x-eWR.js → BI0SpAnv.js} +1 -1
  18. package/web/app/immutable/chunks/{Dv1h77Vp.js → BIU3Z0JX.js} +1 -1
  19. package/web/app/immutable/chunks/{-Zg6rfog.js → BJ_X8eP6.js} +1 -1
  20. package/web/app/immutable/chunks/{BgL-Z3DM.js → BNs9wOFa.js} +1 -1
  21. package/web/app/immutable/chunks/{CgrukgLv.js → BNu1GhJn.js} +1 -1
  22. package/web/app/immutable/chunks/{BBRFTdr4.js → BObTlShq.js} +1 -1
  23. package/web/app/immutable/chunks/{BxQzAB5H.js → BOmWUtDJ.js} +1 -1
  24. package/web/app/immutable/chunks/{CjGXnvXd.js → BPcIfv-A.js} +2 -2
  25. package/web/app/immutable/chunks/{HlKQh-jr.js → BQh5T3Ji.js} +1 -1
  26. package/web/app/immutable/chunks/{Dnkb7G58.js → BRaBCoIn.js} +1 -1
  27. package/web/app/immutable/chunks/{BIkp_Hmt.js → BRc67QBD.js} +1 -1
  28. package/web/app/immutable/chunks/{BI8cL-JN.js → BT9lzXEu.js} +1 -1
  29. package/web/app/immutable/chunks/{C97rJdwd.js → BTaBiqZj.js} +2 -2
  30. package/web/app/immutable/chunks/{BIjxJZ5i.js → BVXKWrt4.js} +1 -1
  31. package/web/app/immutable/chunks/{BjuRA2LN.js → BWmW9W02.js} +1 -1
  32. package/web/app/immutable/chunks/{DGdVv1yv.js → BYpFXq6h.js} +1 -1
  33. package/web/app/immutable/chunks/{6zHrL7ht.js → BYpep93f.js} +1 -1
  34. package/web/app/immutable/chunks/{CovKrpBE.js → BZYS48ON.js} +1 -1
  35. package/web/app/immutable/chunks/{Dn2kTCYW.js → Bcb_9iMJ.js} +1 -1
  36. package/web/app/immutable/chunks/{CqCb3N-V.js → BgXuXJpo.js} +4 -4
  37. package/web/app/immutable/chunks/{DOy5PC7K.js → Bh9phZlQ.js} +1 -1
  38. package/web/app/immutable/chunks/{BD_S4uTD.js → BhiYNovM.js} +1 -1
  39. package/web/app/immutable/chunks/{D09F61W3.js → Bq7odTLd.js} +1 -1
  40. package/web/app/immutable/chunks/{7MNwLg3l.js → BqMJVUEP.js} +1 -1
  41. package/web/app/immutable/chunks/{CfXgD_Pw.js → BtmBRuf6.js} +1 -1
  42. package/web/app/immutable/chunks/{BsouhNTN.js → Bub6uL1r.js} +1 -1
  43. package/web/app/immutable/chunks/{B75YmuDW.js → Bw9XtMey.js} +3 -3
  44. package/web/app/immutable/chunks/{CRPm4Pj6.js → BxmKCIlL.js} +1 -1
  45. package/web/app/immutable/chunks/{Cjn3mkT-.js → C3L0F6Xc.js} +1 -1
  46. package/web/app/immutable/chunks/{Bizymm2G.js → C4iFTj8I.js} +1 -1
  47. package/web/app/immutable/chunks/{BR96U9Wd.js → C9_ZEBkB.js} +1 -1
  48. package/web/app/immutable/chunks/{CaTfcRGE.js → CEpPVlB6.js} +2 -2
  49. package/web/app/immutable/chunks/{C8ukaQ4v.js → CHW1UVsO.js} +1 -1
  50. package/web/app/immutable/chunks/{D7TF3ktW.js → CL3wj1V-.js} +1 -1
  51. package/web/app/immutable/chunks/{CebXSmXo.js → CLJCnlVH.js} +1 -1
  52. package/web/app/immutable/chunks/{BX0V9vST.js → CMdo0m6e.js} +2 -2
  53. package/web/app/immutable/chunks/{Bq4K4JBr.js → CXEn_RGs.js} +1 -1
  54. package/web/app/immutable/chunks/{DpkDQyZQ.js → CXP7dPfG.js} +1 -1
  55. package/web/app/immutable/chunks/{DZaRsTHz.js → CXz-0Ag_.js} +1 -1
  56. package/web/app/immutable/chunks/{CSEXx_lD.js → CZ9ViN3z.js} +1 -1
  57. package/web/app/immutable/chunks/{C4u2zmyj.js → CZfxrP3m.js} +1 -1
  58. package/web/app/immutable/chunks/{DR942Ajh.js → CbTbQhqy.js} +1 -1
  59. package/web/app/immutable/chunks/{D9ejVVI8.js → CdGOAvU7.js} +1 -1
  60. package/web/app/immutable/chunks/{D-osFWh4.js → Cfr2GX8P.js} +1 -1
  61. package/web/app/immutable/chunks/{C8LWodzW.js → CgwVRyOb.js} +2 -2
  62. package/web/app/immutable/chunks/{CmfAV5b9.js → CiCk9_hF.js} +1 -1
  63. package/web/app/immutable/chunks/{5Rw929MQ.js → Cio-rWcY.js} +1 -1
  64. package/web/app/immutable/chunks/{BcEFHs1M.js → CkkpCaXs.js} +1 -1
  65. package/web/app/immutable/chunks/{DJwakuJL.js → Cn9MHQyc.js} +1 -1
  66. package/web/app/immutable/chunks/{DVx4z2O_.js → CpIiMADc.js} +1 -1
  67. package/web/app/immutable/chunks/{BPXITtd5.js → CpTvA0xC.js} +1 -1
  68. package/web/app/immutable/chunks/{Y3Xkuhtt.js → CqKjG3GQ.js} +1 -1
  69. package/web/app/immutable/chunks/{PslMlnNq.js → CvorDgLi.js} +1 -1
  70. package/web/app/immutable/chunks/{BAwfT99s.js → CwxM4cLW.js} +1 -1
  71. package/web/app/immutable/chunks/{Bs_2q1R8.js → CyBTM61A.js} +1 -1
  72. package/web/app/immutable/chunks/{BnknS-C6.js → D0qNo7Oy.js} +1 -1
  73. package/web/app/immutable/chunks/{Bc1BuSIT.js → D2YgP7DB.js} +1 -1
  74. package/web/app/immutable/chunks/{Bm6N2soI.js → D6txwX4Y.js} +4 -4
  75. package/web/app/immutable/chunks/{BgnV10Sc.js → D8EcsS7V.js} +2 -2
  76. package/web/app/immutable/chunks/{CZtfaUbt.js → D8rVwrWL.js} +1 -1
  77. package/web/app/immutable/chunks/{nBmxMCff.js → D8xPzBy1.js} +1 -1
  78. package/web/app/immutable/chunks/{Bs_TRDLE.js → D9y3xvsP.js} +1 -1
  79. package/web/app/immutable/chunks/{Klbdavqn.js → DBAONTYG.js} +1 -1
  80. package/web/app/immutable/chunks/{BotNUGl4.js → DC_9qNLq.js} +3 -3
  81. package/web/app/immutable/chunks/{ggXs_b9y.js → DFFA_QTd.js} +1 -1
  82. package/web/app/immutable/chunks/{BrtJC6OX.js → DRDYIFn4.js} +1 -1
  83. package/web/app/immutable/chunks/{WbzVOnzB.js → DWF5uerC.js} +2 -2
  84. package/web/app/immutable/chunks/{D69-2bhh.js → DX2vfFPI.js} +1 -1
  85. package/web/app/immutable/chunks/{D-9KNtuV.js → Dc4V5sMu.js} +1 -1
  86. package/web/app/immutable/chunks/{XwUFesej.js → Dcy1uNRG.js} +1 -1
  87. package/web/app/immutable/chunks/{B6c2kL4w.js → DhSY0ZEq.js} +2 -2
  88. package/web/app/immutable/chunks/{BLg51chm.js → Dj-KLToz.js} +3 -3
  89. package/web/app/immutable/chunks/{prVatUwz.js → DmapvbAr.js} +1 -1
  90. package/web/app/immutable/chunks/{BEhUDDmK.js → DmrchYzR.js} +1 -1
  91. package/web/app/immutable/chunks/{8NmvrAbf.js → DogIXhAJ.js} +1 -1
  92. package/web/app/immutable/chunks/{D4xriAny.js → Dp8b1GoU.js} +1 -1
  93. package/web/app/immutable/chunks/{vCzBOtB7.js → DpIgdPs7.js} +1 -1
  94. package/web/app/immutable/chunks/{CzEoKeV2.js → DrA_ZV1y.js} +3 -3
  95. package/web/app/immutable/chunks/{Dzy45J4U.js → DrgHk1UN.js} +1 -1
  96. package/web/app/immutable/chunks/{E1ou7S5Q.js → DuiDS_zT.js} +2 -2
  97. package/web/app/immutable/chunks/{BTEHnOFb.js → DvNAieWn.js} +1 -1
  98. package/web/app/immutable/chunks/{DyLaiVzG.js → DxKtLuP2.js} +1 -1
  99. package/web/app/immutable/chunks/{D9vbo-CC.js → DzDSM2LC.js} +3 -3
  100. package/web/app/immutable/chunks/{Bwe7RKw-.js → FXkLEPTk.js} +1 -1
  101. package/web/app/immutable/chunks/{YmRtKLCw.js → F__rjLBg.js} +1 -1
  102. package/web/app/immutable/chunks/{DhZ3_JXX.js → GgbLp4i9.js} +1 -1
  103. package/web/app/immutable/chunks/{Qe8C2Z8H.js → IXIWcEcs.js} +1 -1
  104. package/web/app/immutable/chunks/{DPqjG1Qz.js → KqqODIKw.js} +1 -1
  105. package/web/app/immutable/chunks/{BYxTMRdy.js → LXflBOtX.js} +1 -1
  106. package/web/app/immutable/chunks/{RhUR09AA.js → M9xgh-VN.js} +1 -1
  107. package/web/app/immutable/chunks/{DFOcWzwz.js → MakwazGY.js} +1 -1
  108. package/web/app/immutable/chunks/{2kr9sl0a.js → OyqO3fO-.js} +1 -1
  109. package/web/app/immutable/chunks/{B1cYD5sf.js → TsuJPtsq.js} +1 -1
  110. package/web/app/immutable/chunks/{C3s2I-px.js → Tt-VDGAY.js} +1 -1
  111. package/web/app/immutable/chunks/{DZ6KouyB.js → UuRFnpzE.js} +1 -1
  112. package/web/app/immutable/chunks/{C-llZXnj.js → VTkMkEPR.js} +1 -1
  113. package/web/app/immutable/chunks/{CnpTi_2q.js → WdSh5fl1.js} +2 -2
  114. package/web/app/immutable/chunks/{Cb0GBy9I.js → WoMkq5ac.js} +2 -2
  115. package/web/app/immutable/chunks/{Br0totzy.js → da_tvSiq.js} +1 -1
  116. package/web/app/immutable/chunks/{ByGh65n0.js → fAzcgPHK.js} +7 -7
  117. package/web/app/immutable/chunks/{j1QbeoGS.js → goTVlBLf.js} +1 -1
  118. package/web/app/immutable/chunks/{Bi8MRKMx.js → hk_M7mFx.js} +1 -1
  119. package/web/app/immutable/chunks/{Ve-0_aGT.js → iOLvSy8g.js} +3 -3
  120. package/web/app/immutable/chunks/{CyzdJWF0.js → iXPhOXJa.js} +1 -1
  121. package/web/app/immutable/chunks/{BKKERvpk.js → kjO__HeE.js} +1 -1
  122. package/web/app/immutable/chunks/{D5Jqamkx.js → l0vFyEGM.js} +1 -1
  123. package/web/app/immutable/chunks/{Bttnblj5.js → llldKyz-.js} +1 -1
  124. package/web/app/immutable/chunks/{Gz_O-dMq.js → pTmKTjdu.js} +1 -1
  125. package/web/app/immutable/chunks/{DWP4pi_Q.js → s6kPQOkv.js} +1 -1
  126. package/web/app/immutable/chunks/{C6dmVB1C.js → vIaOEmEw.js} +4 -4
  127. package/web/app/immutable/chunks/{D06KyCnD.js → xfg66reS.js} +1 -1
  128. package/web/app/immutable/chunks/{J2joGn0l.js → xvadpoNC.js} +1 -1
  129. package/web/app/immutable/entry/{app.Ck7KNM4b.js → app.qraxYAYk.js} +2 -2
  130. package/web/app/immutable/entry/start.BWAelo_H.js +1 -0
  131. package/web/app/immutable/nodes/{0.BL1rQnVQ.js → 0.DJcM2RkQ.js} +1 -1
  132. package/web/app/immutable/nodes/{1.BLzCq48F.js → 1.Jq1-N2Pd.js} +1 -1
  133. package/web/app/immutable/nodes/{10.CQRco_pp.js → 10.C_zzc0gt.js} +1 -1
  134. package/web/app/immutable/nodes/{11.CqlkrbW8.js → 11.6gj6bfPq.js} +1 -1
  135. package/web/app/immutable/nodes/{15.Bl9Ro66C.js → 15.DzaMQCp_.js} +1 -1
  136. package/web/app/immutable/nodes/{19.CeE6vjuX.js → 19.cFDk8lfW.js} +2 -2
  137. package/web/app/immutable/nodes/{2.DjFjqnV0.js → 2.ByMlaGl6.js} +1 -1
  138. package/web/app/immutable/nodes/{3.BCbxJGeq.js → 3.9JGSdcGo.js} +1 -1
  139. package/web/app/immutable/nodes/{4.CL0JqE8n.js → 4.CBjeaWO7.js} +1 -1
  140. package/web/app/immutable/nodes/{5.hD1YagZR.js → 5.rzCmecJm.js} +1 -1
  141. package/web/app/immutable/nodes/{6.776DAlfQ.js → 6.ltNDZwKc.js} +1 -1
  142. package/web/app/immutable/nodes/{7.5BWaKbyF.js → 7.KOkYCHHg.js} +1 -1
  143. package/web/app/immutable/nodes/{8.C_V2pSbF.js → 8.DAi8MaAi.js} +1 -1
  144. package/web/app/immutable/nodes/{9.CBuIBgSj.js → 9.BzVFDUkR.js} +2 -2
  145. package/web/app/version.json +1 -1
  146. package/web/index.html +9 -9
  147. package/web/app/immutable/entry/start.DjIjqTgP.js +0 -1
@@ -1,4 +1,4 @@
1
- var z1=Object.defineProperty;var js=t=>{throw TypeError(t)};var R1=(t,e,r)=>e in t?z1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>R1(t,typeof e!="symbol"?e+"":e,r),D1=(t,e,r)=>e.has(t)||js("Cannot "+r);var Vs=(t,e,r)=>e.has(t)?js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);var tn=(t,e,r)=>(D1(t,e,"access private method"),r);import{cR as Vt,b4 as N1,dJ as Xl,a7 as _n,a5 as Ia,a6 as P1,a4 as _1,aa as L1,am as O1,a1 as $1,ea as B1,X as q1,bn as Yl,cU as qr,dI as Zl,b3 as F1,b8 as H1,cC as U1,cS as W1,cn as G1,dD as si,e2 as j1,dX as V1,aK as X0,ax as K1,aF as _i,dH as Ql,ee as Jl,dV as X1,ed as Y1}from"./C2UL5Ler.js";import{D as Ks,b3 as Z1,bd as Q1,aB as J1}from"./BIjxJZ5i.js";import{M as eh,G as hn,I as th}from"./Bqd7fdCF.js";import{zz as y0,JH as E,n_ as ve,nZ as xe,aU as rh,m as ec,I as De,br as gn,kf as Li,mf as w0,ar as Xt,me as Xs,mo as Ys,ml as Zs,jO as tc,gA as oi,I2 as nh,tK as ah,B1 as ih,p1 as sh,n3 as k0,CB as oh,iO as lh,my as ch,m9 as uh}from"./B9vHutcJ.js";import{bm as ie}from"./CLAmm_T1.js";import{l as rt}from"./Cu5e4npY.js";import{m as hh,f as Tr}from"./BbhtQrkZ.js";import{a as vn}from"./BdWqymET.js";import{o as pe,r as Kt,e as bn,s as V,_ as Je,l as yn,g as dh,n as Le,c as dr,b as Ve,u as ph,d as mh}from"./CIyUrgF0.js";import{j as rc}from"./uXuxG9cN.js";import{u as fh}from"./BGrimfDs.js";import{selectActiveWorkspaceIds as gh}from"./aZdb_rCN.js";import{i as je}from"./CL3a4Hm1.js";import{l as za,c as Oi}from"./ChTqQfQN.js";import"./KnkAG0HD.js";import{e as vh,h as Er}from"./DONrLvvt.js";import{h as wn}from"./TB9r2XJy.js";import{i as Qs}from"./BBWuirRW.js";import{f as $i,o as nc,p as ac,h as bh,m as ic,i as yh,k as wh}from"./DQw0Iiac.js";const Ze=[];for(let t=0;t<256;++t)Ze.push((t+256).toString(16).slice(1));function kh(t,e=0){return(Ze[t[e+0]]+Ze[t[e+1]]+Ze[t[e+2]]+Ze[t[e+3]]+"-"+Ze[t[e+4]]+Ze[t[e+5]]+"-"+Ze[t[e+6]]+Ze[t[e+7]]+"-"+Ze[t[e+8]]+Ze[t[e+9]]+"-"+Ze[t[e+10]]+Ze[t[e+11]]+Ze[t[e+12]]+Ze[t[e+13]]+Ze[t[e+14]]+Ze[t[e+15]]).toLowerCase()}const xh=new Uint8Array(16);function Sh(){return crypto.getRandomValues(xh)}function Bi(t,e,r){return crypto.randomUUID?crypto.randomUUID():Ah(t)}function Ah(t,e,r){t=t||{};const n=t.random??t.rng?.()??Sh();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kh(n)}function qi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=qi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?eh(r.replace(/\.git\/?$/,""),e):null}function f3(t,e){return t.type==="local"?t.plainFolder?"folder":"local":qi(t,e)?.provider==="gitlab"?"gitlab":"github"}function sc(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g3(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=sc(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v3(t){return t.type==="local"&&t.path?t.path:void 0}const Th=["/.clones/","/.repo-cache/"];function b3(t){const e=t.replaceAll("\\","/");return Th.some(r=>e.includes(r))}function y3(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function Eh(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w3(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??Eh(r)}}function k3(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,sc(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Ch="known-repos",Mh=6e4;function Ih({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=y0(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(y0(s),s);for(const s of e.repos)a.set(y0(s),s)}const i=[...a.values()].filter(s=>!r[y0(s)]);return n==="all"?i:i.slice(0,9)}function x3(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S3({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<Mh?"skip":"load"}function A3(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=qi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function zh({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ks)?Ks:null;return s===null||!i(s)?null:s}const T3=E.createSelector(t=>t.workspaceInitializer.hydrated),E3=E.createSelector(t=>t.workspaceInitializer.compactFormState),C3=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),M3=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I3=E.createSelector(t=>t.workspaceInitializer.branchByRepo),z3=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),R3=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D3=E.createSelector((t,e)=>xe(t.workspaceInitializer.recentRepoRefreshes,e)),N3=E.createSelector((t,e)=>xe(t.workspaceInitializer.directoryStatusChecks,e)),P3=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),_3=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),L3=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),O3=E.createSelector(t=>t.workspaceInitializer.agentByRepo),$3=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B3=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q3=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F3=E.createSelector((t,e)=>({restore:xe(t.workspaceInitializer.draftRestores,e),clear:xe(t.workspaceInitializer.draftClears,e)})),H3=E.createSelector((t,e,r)=>{const n=xe(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationOutcomes,e)),W3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationResumes,e)),G3=E.createSelector(t=>zh({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:Q1.select(t),orchestratorId:Z1.select(t)?.id??null})),Rh=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Vt.select(t);return e&&r&&N1.select(t)?JSON.stringify([r,e]):null}),j3=E.createSelector(t=>{const e=Rh.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Dh=E.createSelector(t=>{const e=xe(t.workspaceInitializer.recentRepoRefreshes,Ch),r=Vt.select(t);return Ih({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V3=E.createSelector(t=>Xl.select(t)?Dh.select(t):[]),K3=E.createSelector(t=>J1.select(t)||void 0),Js="workspace-debug-flags",x0={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class Nh{constructor(){le(this,"flags");le(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return x0;try{const e=localStorage.getItem(Js);if(e)return{...x0,...JSON.parse(e)}}catch(e){za.error("Failed to load debug flags:",e)}return x0}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem(Js,JSON.stringify(this.flags))}catch(e){za.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...x0},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),za.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const Ra=new Nh;function X3(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function Ph(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Y3(t){if(!t||t.trim().length===0)return ie.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ie.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ie.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ie.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ie.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ie.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ie.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ie.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ie.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ie.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ie.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ie.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ie.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ie.workspace_sidebarHeader_branchTooLong_error()}function Z3(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function li(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q3(t,e){return`${e}:${t.agentId??"manual"}`}function _h(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function Lh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function Oh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J3(t,e,r,n){const a=_h(t,e),i=n?` (origin/${n})`:"";return r?a===1?ie.workspace_sidebarChanges_addToPr_one({suffix:i}):ie.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ie.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ie.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e6(t,e,r){const n=Lh(t,e),a=r?` (origin/${r})`:"";return n===1?ie.workspace_sidebarChanges_undoPush_one({suffix:a}):ie.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t6(t,e){const r=Oh(t,e);return r===1?ie.workspace_sidebarChanges_undoCommit_one():ie.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r6(t,e){return e===0&&t.length>0}function n6(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a6(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i6(t,e,r){return r?.path===t&&r?.staged===e}function s6(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o6(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function $h(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l6(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=$h(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:li(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Fi(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:li(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c6(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??rh.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function Bh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function Da(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=_n(i),c=o.toLowerCase(),h=a.find(d=>!!o&&d.url.toLowerCase()===c||(i.resource||i.monitorAvailability?d.monitorIdentity===Ia(i):!d.resource&&!d.monitorAvailability&&(s?!d.crossRepo&&d.number===i.prNumber:d.crossRepo===i.repo&&d.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?Ia(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${P1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?Ia(i):void 0,url:o,htmlUrl:o,status:Bh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Fi(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Fi(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u6(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const k of n)k.repoOwner&&k.repoName&&s.add(`${k.repoOwner}/${k.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(k=>k.crossRepo)){o=[];for(const k of t)k.crossRepo?s.has(k.crossRepo.toLowerCase())?c.push(k):h.push(k):o.push(k)}const d=[],v=[],m=[];for(const k of e){const I=k.repo.toLowerCase();_n(k)&&o.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&(!i||I===i)?d.push(k):_n(k)&&c.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&s.has(I)?v.push(k):m.push(k)}const w=Da(o,d,r),A=r?.split("/")[0],C=new Set([...w,...c,...h].map(k=>`${(k.crossRepo??r??"").toLowerCase()}#${k.number}`)),M=[...c];for(const k of n){if(!k.repoOwner||!k.repoName)continue;const I=`${k.repoOwner}/${k.repoName}`;for(const R of k.pullRequests??[]){const Z=`${I.toLowerCase()}#${R.number}`;if(C.has(Z))continue;C.add(Z);const K=R.url||`https://github.com/${I}/pull/${R.number}`,ee=i!==void 0&&I.toLowerCase()===i;M.push({number:R.number,title:a(R),url:K,htmlUrl:K,status:li(R.status),createdAt:R.createdAt,updatedAt:R.updatedAt,crossRepo:ee?void 0:I,crossRepoDisplay:ee?void 0:Fi(I,A)})}}return{own:w,otherRoots:Da(M,v,r),otherTracked:Da(h,m,r)}}function eo(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h6(t){const e=t.status==="merged"?ie.workspace_prSection_merged_label():t.status==="closed"?ie.workspace_prSection_closed_label():t.status==="draft"?ie.workspace_prSection_statusDraft_label():eo(t)?ie.workspace_prSection_statusQueued_label():ie.workspace_prSection_statusOpen_label(),r=[_1(t)??e],n=eo(t)?hh(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ie.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ie.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ie.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ie.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ie.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ie.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ie.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(Ph(a.mergeBlockedReason))),r.join(`
1
+ var z1=Object.defineProperty;var js=t=>{throw TypeError(t)};var R1=(t,e,r)=>e in t?z1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var le=(t,e,r)=>R1(t,typeof e!="symbol"?e+"":e,r),D1=(t,e,r)=>e.has(t)||js("Cannot "+r);var Vs=(t,e,r)=>e.has(t)?js("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);var tn=(t,e,r)=>(D1(t,e,"access private method"),r);import{cR as Vt,b4 as N1,dJ as Xl,a7 as _n,a5 as Ia,a6 as P1,a4 as _1,aa as L1,am as O1,a1 as $1,ea as B1,X as q1,bn as Yl,cU as qr,dI as Zl,b3 as F1,b8 as H1,cC as U1,cS as W1,cn as G1,dD as si,e2 as j1,dX as V1,aK as X0,ax as K1,aF as _i,dH as Ql,ee as Jl,dV as X1,ed as Y1}from"./C2UL5Ler.js";import{D as Ks,b3 as Z1,bd as Q1,aB as J1}from"./BVXKWrt4.js";import{M as eh,G as hn,I as th}from"./Bqd7fdCF.js";import{zz as y0,JH as E,n_ as ve,nZ as xe,aU as rh,m as ec,I as De,br as gn,kf as Li,mf as w0,ar as Xt,me as Xs,mo as Ys,ml as Zs,jO as tc,gA as oi,I2 as nh,tK as ah,B1 as ih,p1 as sh,n3 as k0,CB as oh,iO as lh,my as ch,m9 as uh}from"./B9vHutcJ.js";import{bm as ie}from"./CLAmm_T1.js";import{l as rt}from"./Cu5e4npY.js";import{m as hh,f as Tr}from"./BbhtQrkZ.js";import{a as vn}from"./BdWqymET.js";import{o as pe,r as Kt,e as bn,s as V,_ as Je,l as yn,g as dh,n as Le,c as dr,b as Ve,u as ph,d as mh}from"./CIyUrgF0.js";import{j as rc}from"./uXuxG9cN.js";import{u as fh}from"./BGrimfDs.js";import{selectActiveWorkspaceIds as gh}from"./aZdb_rCN.js";import{i as je}from"./CL3a4Hm1.js";import{l as za,c as Oi}from"./ChTqQfQN.js";import"./KnkAG0HD.js";import{e as vh,h as Er}from"./DONrLvvt.js";import{h as wn}from"./TB9r2XJy.js";import{i as Qs}from"./BBWuirRW.js";import{f as $i,o as nc,p as ac,h as bh,m as ic,i as yh,k as wh}from"./DQw0Iiac.js";const Ze=[];for(let t=0;t<256;++t)Ze.push((t+256).toString(16).slice(1));function kh(t,e=0){return(Ze[t[e+0]]+Ze[t[e+1]]+Ze[t[e+2]]+Ze[t[e+3]]+"-"+Ze[t[e+4]]+Ze[t[e+5]]+"-"+Ze[t[e+6]]+Ze[t[e+7]]+"-"+Ze[t[e+8]]+Ze[t[e+9]]+"-"+Ze[t[e+10]]+Ze[t[e+11]]+Ze[t[e+12]]+Ze[t[e+13]]+Ze[t[e+14]]+Ze[t[e+15]]).toLowerCase()}const xh=new Uint8Array(16);function Sh(){return crypto.getRandomValues(xh)}function Bi(t,e,r){return crypto.randomUUID?crypto.randomUUID():Ah(t)}function Ah(t,e,r){t=t||{};const n=t.random??t.rng?.()??Sh();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,kh(n)}function qi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=qi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?eh(r.replace(/\.git\/?$/,""),e):null}function f3(t,e){return t.type==="local"?t.plainFolder?"folder":"local":qi(t,e)?.provider==="gitlab"?"gitlab":"github"}function sc(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function g3(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=sc(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function v3(t){return t.type==="local"&&t.path?t.path:void 0}const Th=["/.clones/","/.repo-cache/"];function b3(t){const e=t.replaceAll("\\","/");return Th.some(r=>e.includes(r))}function y3(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function Eh(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function w3(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??Eh(r)}}function k3(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,sc(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const Ch="known-repos",Mh=6e4;function Ih({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=y0(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(y0(s),s);for(const s of e.repos)a.set(y0(s),s)}const i=[...a.values()].filter(s=>!r[y0(s)]);return n==="all"?i:i.slice(0,9)}function x3(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function S3({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<Mh?"skip":"load"}function A3(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=qi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function zh({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ks)?Ks:null;return s===null||!i(s)?null:s}const T3=E.createSelector(t=>t.workspaceInitializer.hydrated),E3=E.createSelector(t=>t.workspaceInitializer.compactFormState),C3=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),M3=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),I3=E.createSelector(t=>t.workspaceInitializer.branchByRepo),z3=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),R3=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),D3=E.createSelector((t,e)=>xe(t.workspaceInitializer.recentRepoRefreshes,e)),N3=E.createSelector((t,e)=>xe(t.workspaceInitializer.directoryStatusChecks,e)),P3=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),_3=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),L3=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),O3=E.createSelector(t=>t.workspaceInitializer.agentByRepo),$3=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),B3=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),q3=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),F3=E.createSelector((t,e)=>({restore:xe(t.workspaceInitializer.draftRestores,e),clear:xe(t.workspaceInitializer.draftClears,e)})),H3=E.createSelector((t,e,r)=>{const n=xe(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),U3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationOutcomes,e)),W3=E.createSelector((t,e)=>xe(t.workspaceInitializer.initializationResumes,e)),G3=E.createSelector(t=>zh({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:Q1.select(t),orchestratorId:Z1.select(t)?.id??null})),Rh=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Vt.select(t);return e&&r&&N1.select(t)?JSON.stringify([r,e]):null}),j3=E.createSelector(t=>{const e=Rh.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Dh=E.createSelector(t=>{const e=xe(t.workspaceInitializer.recentRepoRefreshes,Ch),r=Vt.select(t);return Ih({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),V3=E.createSelector(t=>Xl.select(t)?Dh.select(t):[]),K3=E.createSelector(t=>J1.select(t)||void 0),Js="workspace-debug-flags",x0={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class Nh{constructor(){le(this,"flags");le(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return x0;try{const e=localStorage.getItem(Js);if(e)return{...x0,...JSON.parse(e)}}catch(e){za.error("Failed to load debug flags:",e)}return x0}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem(Js,JSON.stringify(this.flags))}catch(e){za.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...x0},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),za.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const Ra=new Nh;function X3(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function Ph(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Y3(t){if(!t||t.trim().length===0)return ie.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ie.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ie.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ie.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ie.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ie.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ie.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ie.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ie.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ie.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ie.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ie.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ie.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ie.workspace_sidebarHeader_branchTooLong_error()}function Z3(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function li(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function Q3(t,e){return`${e}:${t.agentId??"manual"}`}function _h(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function Lh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function Oh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function J3(t,e,r,n){const a=_h(t,e),i=n?` (origin/${n})`:"";return r?a===1?ie.workspace_sidebarChanges_addToPr_one({suffix:i}):ie.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ie.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ie.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function e6(t,e,r){const n=Lh(t,e),a=r?` (origin/${r})`:"";return n===1?ie.workspace_sidebarChanges_undoPush_one({suffix:a}):ie.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function t6(t,e){const r=Oh(t,e);return r===1?ie.workspace_sidebarChanges_undoCommit_one():ie.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function r6(t,e){return e===0&&t.length>0}function n6(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function a6(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function i6(t,e,r){return r?.path===t&&r?.staged===e}function s6(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function o6(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function $h(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function l6(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=$h(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:li(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Fi(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:li(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function c6(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??rh.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function Bh(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function Da(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=_n(i),c=o.toLowerCase(),h=a.find(d=>!!o&&d.url.toLowerCase()===c||(i.resource||i.monitorAvailability?d.monitorIdentity===Ia(i):!d.resource&&!d.monitorAvailability&&(s?!d.crossRepo&&d.number===i.prNumber:d.crossRepo===i.repo&&d.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?Ia(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${P1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?Ia(i):void 0,url:o,htmlUrl:o,status:Bh(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Fi(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Fi(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function u6(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const k of n)k.repoOwner&&k.repoName&&s.add(`${k.repoOwner}/${k.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(k=>k.crossRepo)){o=[];for(const k of t)k.crossRepo?s.has(k.crossRepo.toLowerCase())?c.push(k):h.push(k):o.push(k)}const d=[],v=[],m=[];for(const k of e){const I=k.repo.toLowerCase();_n(k)&&o.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&(!i||I===i)?d.push(k):_n(k)&&c.some(R=>R.url===_n(k))||!k.resource&&!k.monitorAvailability&&s.has(I)?v.push(k):m.push(k)}const w=Da(o,d,r),A=r?.split("/")[0],C=new Set([...w,...c,...h].map(k=>`${(k.crossRepo??r??"").toLowerCase()}#${k.number}`)),M=[...c];for(const k of n){if(!k.repoOwner||!k.repoName)continue;const I=`${k.repoOwner}/${k.repoName}`;for(const R of k.pullRequests??[]){const Z=`${I.toLowerCase()}#${R.number}`;if(C.has(Z))continue;C.add(Z);const K=R.url||`https://github.com/${I}/pull/${R.number}`,ee=i!==void 0&&I.toLowerCase()===i;M.push({number:R.number,title:a(R),url:K,htmlUrl:K,status:li(R.status),createdAt:R.createdAt,updatedAt:R.updatedAt,crossRepo:ee?void 0:I,crossRepoDisplay:ee?void 0:Fi(I,A)})}}return{own:w,otherRoots:Da(M,v,r),otherTracked:Da(h,m,r)}}function eo(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function h6(t){const e=t.status==="merged"?ie.workspace_prSection_merged_label():t.status==="closed"?ie.workspace_prSection_closed_label():t.status==="draft"?ie.workspace_prSection_statusDraft_label():eo(t)?ie.workspace_prSection_statusQueued_label():ie.workspace_prSection_statusOpen_label(),r=[_1(t)??e],n=eo(t)?hh(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ie.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ie.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ie.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ie.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ie.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ie.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ie.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ie.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(Ph(a.mergeBlockedReason))),r.join(`
2
2
  `)}function d6(t,e){return e.has(t??"manual")}function p6(t,e){return{path:t.relativePath,additions:t.stats.additions,deletions:t.stats.deletions,staged:e,status:t.status,attribution:t.attribution?.agent?{agentId:t.attribution.agent.agentId,agentName:t.attribution.agent.agentName,sessionId:t.attribution.agent.sessionId,turnNumber:t.attribution.agent.turnNumber,timestamp:t.attribution.timestamp}:void 0}}const oc=500;function m6(t,e=oc){const r=Math.max(0,Math.floor(e));return t.length<=r?{visible:t,shown:t.length,hiddenCount:0}:{visible:t.slice(0,r),shown:r,hiddenCount:t.length-r}}function f6(t,e,r=oc){let n=Math.max(0,Math.floor(r)),a=0,i=0;return{groups:t.map(o=>{if(e(o))return{group:o,visibleFiles:[]};const c=Math.min(n,o.files.length);return n-=c,a+=c,i+=o.files.length-c,{group:o,visibleFiles:c===o.files.length?o.files:o.files.slice(0,c)}}),shown:a,hiddenCount:i}}function g6(t){if(t.hiddenCount<=0)return"";const e=rt(t.shown),r=rt(t.shown+t.hiddenCount);return t.hiddenCount===1?ie.workspace_fileChanges_hiddenFiles_one({shown:e,total:r}):ie.workspace_fileChanges_hiddenFiles_many({shown:e,total:r,count:rt(t.hiddenCount)})}function qh(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function ci(t){return t.startsWith("@")?t.slice(1):t}function Fh(t,e,r,n){const a=t.fullPath||t.path||t.filename;if(a)return ci(String(a));const i=[r,e,n.trim()].map(ci).filter(Boolean),s=i.find(o=>o.includes("/"))??i[0];return s?L1(s).path:void 0}function Hh(t){const e=t.line??t.startLine??t.range?.start;return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Uh(t){if(!t||t.getAttribute("data-mention")===null)return null;const e=t.getAttribute("data-type")||"",r=t.getAttribute("data-id")||"",n=t.getAttribute("data-label")||"",a=t.getAttribute("data-uri")||"",i=qh(t.getAttribute("data-meta")),s={type:e,id:r,label:n,uri:a,meta:i},o=a.startsWith("intent://")?a:typeof i.fullUrl=="string"&&i.fullUrl.startsWith("intent://")?i.fullUrl:void 0;if(o&&(s.intentUrl=o),e==="file"||e==="file-range"){const c=Fh(i,n,r,t.textContent||"");c&&(s.filePath=c);const h=Hh(i);h!==void 0&&(s.line=h)}else if(e==="folder"||e==="source-folder"){const c=i.fullPath||i.path||r||n,h=c?ci(String(c)).replace(/\/+$/,""):"";h&&(s.folderPath=h)}else if(e==="note"||e==="note-range"){const c=i.noteId||r;c&&(s.note=i.isExternalLink&&i.workspaceId?{id:c,workspaceId:String(i.workspaceId)}:{id:c})}return s}function v6(t){return{sidebarTabId:"files",type:"file",filePath:`${t}/`}}function Hi(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Fr=Hi();function lc(t){Fr=t}var Nr={exec:()=>null};function Cr(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),a=e[n];return a||(a=t(n),e[n]=a),a}}function oe(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Ue.caret,"$1"),r=r.replace(a,s),n},getRegex:()=>new RegExp(r,e)};return n}var cc=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ue={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Cr(t=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}(?:</?(?:${Wi})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Cr(t=>new RegExp(`^ {0,${t}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Wh=/^(?:[ \t]*(?:\n|$))+/,Gh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,jh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,Kn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Vh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ui=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Wi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xn=oe(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Wi).getRegex(),uc=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,hc=oe(uc).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,Xn).getRegex(),Kh=oe(uc).replace(/bull/g,Ui).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,Xn).getRegex(),Gi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Xh=/^[^\n]+/,ji=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,Yh=oe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ji).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),Zh=oe(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Ui).getRegex(),Vi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qh=oe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Vi).replace("tag",Wi).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),dc=t=>oe(Gi).replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html",Xn).getRegex(),Jh=dc(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ed=dc(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),td=oe(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",ed).getRegex(),Ki={blockquote:td,code:Gh,def:Yh,fences:jh,heading:Vh,hr:Kn,html:Qh,lheading:hc,list:Zh,newline:Wh,paragraph:Jh,table:Nr,text:Xh},to=oe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",Xn).getRegex(),rd={...Ki,lheading:Kh,table:to,paragraph:oe(Gi).replace("hr",Kn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",to).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",Xn).getRegex()},nd={...Ki,html:oe(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",Vi).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oe(Gi).replace("hr",Kn).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",hc).getRegex()},ad=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,id=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pc=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,sd=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pt=/[\p{P}\p{S}]/u,kn=/[\s\p{P}\p{S}]/u,Yn=/[^\s\p{P}\p{S}]/u,od=oe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kn).getRegex(),ld=/[\p{Pi}\p{Ps}"']/u,mc=/(?!~)[\p{P}\p{S}]/u,cd=/(?!~)[\s\p{P}\p{S}]/u,ud=/(?:[^\s\p{P}\p{S}]|~)/u,hd=oe(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",cc?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),fc=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dd=oe(fc,"u").replace(/punct/g,Pt).getRegex(),pd=oe(fc,"u").replace(/punct/g,mc).getRegex(),md=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,fd=oe(md,"u").replace(/openQuote/g,ld).replace(/punct/g,Pt).getRegex(),gc="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",gd=oe(gc,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),vd=oe(gc,"gu").replace(/notPunctSpace/g,ud).replace(/punctSpace/g,cd).replace(/punct/g,mc).getRegex(),bd="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",yd=oe(bd,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),wd=oe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),kd="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",xd=oe(kd,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),Sd=oe(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pt).getRegex(),Ad="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Td=oe(Ad,"gu").replace(/notPunctSpace/g,Yn).replace(/punctSpace/g,kn).replace(/punct/g,Pt).getRegex(),Ed=oe(/\\(punct)/,"gu").replace(/punct/g,Pt).getRegex(),Cd=oe(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,Pt).getRegex(),Md=oe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Id=oe(Vi).replace("(?:-->|$)","-->").getRegex(),zd=oe("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Id).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vc=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,q0=oe(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",vc).getRegex(),Rd=oe(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",q0).replace("href",/<(?:\\.|[^\n<>\\])*>|(?!<)[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Dd=oe(/^!?\[(label)\]\[(ref)\]/).replace("label",q0).replace("ref",ji).getRegex(),Nd=oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ji).getRegex(),ro=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Pd=oe(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",vc).getRegex(),_d=oe("reflink|nolink(?!\\()","g").replace("reflink",oe(/^!?\[(label)\]\[(ref)\]/).replace("label",Pd).replace("ref",ro).getRegex()).replace("nolink",oe(/^!?\[(ref)\](?:\[\])?/).replace("ref",ro).getRegex()).getRegex(),no=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ld=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Od=oe(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,Ld).getRegex(),Xi={_backpedal:Nr,anyPunctuation:Ed,anyPunctuationOutsideCode:Cd,autolink:Md,blockSkip:hd,br:pc,code:id,del:Nr,delLDelim:Nr,delRDelim:Nr,emStrongLDelim:dd,emStrongRDelimAst:gd,emStrongRDelimUnd:wd,escape:ad,link:Rd,nolink:Nd,punctuation:od,reflink:Dd,reflinkSearch:_d,tag:zd,text:sd,url:Nr},$d={...Xi,emStrongLDelim:fd,emStrongRDelimAst:yd,emStrongRDelimUnd:xd,link:oe(/^!?\[(label)\]\((.*?)\)/).replace("label",q0).getRegex(),reflink:oe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q0).getRegex()},ui={...Xi,emStrongRDelimAst:vd,emStrongLDelim:pd,delLDelim:Sd,delRDelim:Td,url:oe(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Od).replace("protocol",no).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:oe(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",no).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",cc?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Bd={...ui,br:oe(pc).replace("{2,}","*").getRegex(),text:oe(ui.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},S0={normal:Ki,gfm:rd,pedantic:nd},Mn={normal:Xi,gfm:ui,breaks:Bd,pedantic:$d},qd={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ao=t=>qd[t];function mt(t,e){if(e){if(Ue.escapeTest.test(t))return t.replace(Ue.escapeReplace,ao)}else if(Ue.escapeTestNoEncode.test(t))return t.replace(Ue.escapeReplaceNoEncode,ao);return t}function Fd(t){return Ue.numericCharacterReference.test(t)?t.replace(Ue.numericCharacterReferenceOrAmpersand,(e,r,n)=>{if(r===void 0&&n===void 0)return"&amp;";let a=r===void 0?Number.parseInt(n,16):Number.parseInt(r,10);return a===0||a>1114111||a>=55296&&a<=57343?"�":a===38?"&amp;":String.fromCodePoint(a)}):t}function io(t){try{t=encodeURI(t).replace(Ue.percentDecode,"%")}catch{return null}return t}function so(t,e){let r=t.replace(Ue.findPipe,(i,s,o)=>{let c=!1,h=s;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split(Ue.splitPipe),a=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;a<n.length;a++)n[a]=n[a].trim().replace(Ue.slashPipe,"|");return n}function qt(t,e,r){let n=t.length;if(n===0)return"";let a=0;for(;a<n&&t.charAt(n-a-1)===e;)a++;return t.slice(0,n-a)}function oo(t){let e=t.split(`
4
4
  `),r=e.length-1;for(;r>=0&&Ue.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/E1ou7S5Q.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BIjxJZ5i.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DQw0Iiac.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/KnkAG0HD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/WbzVOnzB.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
- import{bm as o,t as st,bo as K,bw as nt,b as ot,bq as Ft,bs as Fe,_ as Ut}from"./CLAmm_T1.js";import{bs as it,a5 as f,aD as t,bA as v,b_ as T,W as y,bn as ct,c9 as k,aA as H,aB as S,ca as Ue,bk as Vt,c6 as Yt,cd as Pe,bV as Gt,bS as g,ay as ge,bl as M,bO as N}from"./3SdAC2_C.js";import{i as $}from"./BFgvMDua.js";import{e as Ve,g as Ye}from"./B1CKzIA2.js";import{c as Qt,e as Jt,f as lt,g as Xt,s as x}from"./CcJmuwXr.js";import{a_ as Zt,db as ea,X as ta,aI as aa,dE as ra,a3 as sa,dI as dt}from"./C2UL5Ler.js";import{t as Ge}from"./DAsc1V4f.js";import{b as na,A as oa}from"./BhCMc9G0.js";import{p as Qe}from"./Bm6N2soI.js";import{aM as ia,aJ as ca,aK as Je,a0 as la}from"./DQw0Iiac.js";import{S as le}from"./Dd-LQrG1.js";import"./TB9r2XJy.js";import{f as Xe}from"./nxtepGjE.js";import{l as B,n as da}from"./Cu5e4npY.js";import{sd as ut,JH as W,mP as ua,fV as pa,nM as va,v1 as ma,c as _a,wE as ga,tG as fa,rW as wa}from"./B9vHutcJ.js";import{c as ba}from"./ChTqQfQN.js";import{o as ka}from"./Dzy45J4U.js";import{aR as ha,aS as Ze,bC as ya,aB as xa,bB as Sa,aG as Aa,d3 as Ca,cT as Ra,F as fe,ay as et,bK as Ia}from"./DPttSllj.js";import{selectCurrentWorkspaceTabId as Pa}from"./aZdb_rCN.js";import{p as qa}from"./Klbdavqn.js";import{i as Ma}from"./D9vbo-CC.js";const Na=new Set(["failed","blocked","needs_attention","in_progress"]),Wa={failed:{visual:"icon",icon:Ra,className:"text-foreground"},blocked:{visual:"icon",icon:Ca,className:"text-danger"},needs_attention:{visual:"icon",icon:Aa,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Sa,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:xa,className:"text-success"},pr_queued:{visual:"icon",icon:ya,className:"text-info"},pr_ready:{visual:"icon",icon:Ze,className:"text-success"},pr_open:{visual:"icon",icon:Ze,className:"text-info"},pr_merged:{visual:"icon",icon:ha,className:"text-purple-500"}};function Ta(r){switch(r){case"failed":return o.workspace_statusIcon_failed_label();case"blocked":return o.workspace_statusIcon_blocked_label();case"needs_attention":return o.workspace_statusIcon_needsAttention_label();case"in_progress":return o.workspace_statusIcon_inProgress_label();case"waiting":return o.workspace_taskStatus_waiting_label();case"unread":return o.layout_activeCard_unread_header();case"not_started":return o.workspace_statusIcon_notStarted_label();case"idle":return o.workspace_statusIcon_idle_label();case"complete":return o.workspace_statusIcon_complete_label();case"pr_queued":return o.workspace_statusIcon_prQueued_label();case"pr_ready":return o.workspace_statusIcon_prReady_label();case"pr_open":return o.workspace_statusIcon_prOpen_label();case"pr_merged":return o.workspace_statusIcon_prMerged_label()}}function Oa(r){const n=ut(r.displayStatus)?r.displayStatus:"not_started";return Na.has(n)?n:r.attention==="unread"?"unread":r.waiting===!0?"waiting":n}function pt(r){const n=r==="waiting"||r==="unread"||ut(r)?r:"not_started",b=Ta(n);return{state:n,...Wa[n],label:b,tooltip:b,accessibleName:b}}var Ea=S('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),Da=S("<span><!></span>");function vt(r,n){if(new.target)return st({component:vt,...r});it(n,!0);let b=K(n,"status",7),m=K(n,"size",7,14),w=K(n,"decorative",7,!1),u=K(n,"class",7);const i=k(()=>pt(b()));var a={get status(){return b()},set status(_){b(_),H()},get size(){return m()},set size(_=14){m(_),H()},get decorative(){return w()},set decorative(_=!1){w(_),H()},get class(){return u()},set class(_){u(_),H()},$set:nt,$on:(_,G)=>ot(n,_,G)},p=Da(),re=f(p);{var se=_=>{var G=Ea();y(_,G)},ne=_=>{fe(_,{get icon(){return t(i).icon},class:"size-full!"})};$(re,_=>{t(i).visual==="dot"?_(se):t(i).icon&&_(ne,1)})}return v(p),T(_=>{lt(p,1,_,"svelte-14zk5l0"),Xt(p,`width: ${m()??""}px; height: ${m()??""}px;`),x(p,"role",w()?void 0:"img"),x(p,"aria-label",w()?void 0:t(i).accessibleName),x(p,"aria-hidden",w()?"true":void 0),x(p,"title",w()?void 0:t(i).tooltip),x(p,"data-workspace-status",t(i).state),x(p,"data-workspace-status-visual",t(i).visual),x(p,"data-workspace-status-icon",t(i).icon?.iconName)},[()=>Qt(Jt("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",t(i).className,u()))]),y(r,p),ct(a)}const Me=6e4,Ne=60*Me,We=24*Ne,tt=30*We;function La(r,n=new Date){if(r==null)return null;const b=r instanceof Date?r:new Date(r),m=b.getTime(),w=n.getTime();if(!Number.isFinite(m)||!Number.isFinite(w))return null;const u=Math.max(0,w-m);let i;u<Me?i="<1m":u<Ne?i=`${B(Math.floor(u/Me))}m`:u<We?i=`${B(Math.floor(u/Ne))}h`:u<tt?i=`${B(Math.floor(u/We))}d`:i=`${B(Math.floor(u/tt))}mo`;const a=m>w?n:b,p=da(a,{now:n});return p?{compact:i,accessible:p,dateTime:b.toISOString()}:null}var $a=S('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),Ka=S('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),Ha=S('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),Ba=S('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),at=S('<div role="listitem"><!></div>'),za=S('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),ja=S('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),Fa=S('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),Ua=S('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),Va=S('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),Ya=S('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),Ga=S('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),Qa=S('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),Ja=S('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function Xa(r,n){if(new.target)return st({component:Xa,...r});it(n,!0);const b=()=>Fe(gt,"$workspaceAgents$",w),m=()=>Fe(ft,"$prMonitors$",w),[w,u]=Ft(),i=ba("WorkspaceHoverCard");let a=K(n,"workspace",7),p=K(n,"isLoading",7,!1),re=K(n,"activeAgentIds",23,()=>[]),se=K(n,"loadAgentSessions",7,!0),ne=K(n,"onkeydown",7),_=K(n,"staticData",7,!1);const G=Pe("");function mt(){return _()?Pe([]):Zt(G)}function _t(){return _()?Pe([]):ea(G)}const gt=mt(),ft=_t();Ue(()=>G.set(a()?.id??""));let Te=Gt(0);Vt(()=>Qe.subscribe(()=>Yt(Te)));let wt=k(()=>a()?.agentSummary?.agentIds??[]),Oe=k(()=>(t(Te),a()?Qe.getStreamingAgentIdsForWorkspace(a().id):[])),Ee=null,we=new Set;Ue(()=>{if(!a()||!se())return;const e=String(a().id);Ee!==e&&(Ee=e,we=new Set);for(const c of new Set([...t(wt).slice(0,6),...re(),...t(Oe)]))we.has(c)||(W.dispatch(ua(e,c)),we.add(c))});function bt(e){return[e.name,e.context,e.questionMeta?.accessible,e.updated.accessible].filter(Boolean).join(". ")}function kt(e){return e?e.kind==="attention"?e.attention.reason?.trim()||null:"text"in e&&e.text.trim()||null:null}function ht(e){return La(e.lastActivity||e.updatedAt||e.createdAt)??{compact:"—",accessible:o.workspace_hoverCard_noRecentActivity_label()}}function yt(e){const c=String(e.status).toLowerCase(),l=va(e),h=na(e),D=h==="question"?ia(e):null,I=kt(aa.select(W.state,String(e.id)));let P,z,q,A,O,J,j=!1;if(h==="question"){P="attention",z="question",q=D?.questions[0]?.question.trim()||I||o.workspace_hoverCard_question_label(),A="question",O=1;const de=D?.questions.length??0;de>1&&(J={compact:`${B(1)}/${B(de)}`,accessible:o.chat_questionWizard_stepCounter_label({current:1,total:de})})}else if(h==="attention-discussion")P="attention",z="discussion",q=l?.reason?.trim()||o.chat_agentCard_attentionDiscussion_label(),A="attention-discussion",O=1;else if(h==="attention-blocker"||c==="blocked")P="attention",z="blocker",q=l?.reason?.trim()||o.chat_agentCard_attentionBlocker_label(),A="attention-blocker",O=0;else if(e.hasUnread)P="attention",z="unread",q=I||o.chat_newMessagesDivider_label(),j=!!I,A="unread",O=2;else if(e.isStreaming||e.isProcessing||re().includes(String(e.id))||t(Oe).includes(String(e.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(c))P="active",q=I||o.workspace_devScripts_running_label(),j=!!I,A=e.isProcessing?"responding":"running",O=3;else if(["waiting","pending","queued","starting"].includes(c))P="waiting",q=I||o.workspace_taskStatus_waiting_label(),j=!!I,A="waiting",O=4;else return null;const ye=e.agentMetadata??e.metadata;return{id:String(e.id),name:e.name?.trim()||o.workspace_fileChanges_agent_label(),group:P,attentionKind:z,avatarState:A,specialist:ye?.specialist,context:q,questionMeta:J,contextIsPreview:j,updated:ht(e),priority:O}}let xt=k(()=>{const e=a()?.agentSummary,c=new Map;if(Array.isArray(e?.agents))for(const l of e.agents)l&&typeof l=="object"&&typeof l.id=="string"&&c.set(l.id,l.parentAgentId);return b().filter(l=>{const h=c.get(String(l.id));return!(pa(l)!=="topLevel"||typeof h=="string"&&h||l.pendingDeleteAt||l.retiredAt||String(l.status).toLowerCase()==="deleted")})}),be=k(()=>t(xt).map(yt).filter(e=>e!==null).sort((e,c)=>e.priority-c.priority)),St=k(()=>t(be).slice(0,6)),De=k(()=>Math.max(0,t(be).length-6)),At=k(()=>a()?.repositoryName?a().repositoryOwner?`${a().repositoryOwner} / ${a().repositoryName}`:a().repositoryName:o.workspace_hoverCard_localRepository_label()),Le=k(()=>Oa(a()??{})),Ct=k(()=>pt(t(Le))),ke=k(()=>a()?.statusMessage?.trim()||"");function $e(e){if(!e)return null;const c=e.activePullRequest??e.pullRequests?.[0]??null;return c||(e.prStatus?{id:`legacy-pr-${e.prNumber??"workspace"}`,number:e.prNumber??0,url:e.prUrl??"",title:o.workspace_hoverCard_pullRequest_label(),status:e.prStatus,createdAt:e.updatedAt,updatedAt:e.updatedAt}:null)}let Rt=k(()=>a()?_()?$e(a()):ra.select(W.state,a().id)??$e(a()):null),Q=k(()=>{if(!a()||ta(a()))return[];const e=a().repositoryOwner&&a().repositoryName?`${a().repositoryOwner}/${a().repositoryName}`:void 0;return Ma({workspacePRs:a().pullRequests,activePR:t(Rt),monitors:m(),workspaceRepo:e,buildPrUrl:(c,l)=>qa(c,a().repositoryOwner,a().repositoryName,l),getDisplayTitle:c=>c.title})}),It=k(()=>t(Q).slice(0,3)),Ke=k(()=>Math.max(0,t(Q).length-3)),He=k(()=>t(be).length>0),Be=k(()=>t(Q).length>0),ze=k(()=>t(He)||t(Be));function je(e){const c=e.resource?.repository.provider==="gitlab"?`${e.repo} !${e.number}`:e.repo?o.workspace_card_prBadge_repoLine_tooltip({repo:e.repo,number:e.number}):o.workspace_card_prBadge_label({number:` #${e.number}`});return[sa(c,e),e.title,e.details].filter(Boolean).join(`
3
- `)}function Pt(e,c){if(e.stopPropagation(),!a()||!se())return;const l=a().id;Pa.select(W.state)!==l&&ka(l).catch(h=>{i.warn("Failed to switch workspace for hover-card agent",{agentId:c,error:h})}),W.dispatch(ma(l,{agentId:c}))}function qt(e,c){if(e.stopPropagation(),!a()||!c.url)return;const l=a().id;Ut(async()=>{const{handleLink:h}=await import("./E1ou7S5Q.js").then(D=>D.l);return{handleLink:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url).then(({handleLink:h})=>h(c.url,{workspaceId:l,event:e}))}var Mt={get workspace(){return a()},set workspace(e){a(e),H()},get isLoading(){return p()},set isLoading(e=!1){p(e),H()},get activeAgentIds(){return re()},set activeAgentIds(e=[]){re(e),H()},get loadAgentSessions(){return se()},set loadAgentSessions(e=!0){se(e),H()},get onkeydown(){return ne()},set onkeydown(e){ne(e),H()},get staticData(){return _()},set staticData(e=!1){_(e),H()},$set:nt,$on:(e,c)=>ot(n,e,c)},he=Ja(),Nt=f(he);{var Wt=e=>{var c=$a(),l=f(c),h=f(l),D=f(h);le(D,{class:"h-7 min-w-0 max-w-64 flex-1"});var I=g(D,2);le(I,{class:"h-5 w-20 shrink-0"}),v(h);var P=g(h,2);le(P,{class:"h-4 w-40"});var z=g(P,2);le(z,{class:"mt-2 h-10 w-full"}),v(l);var q=g(l,4),A=f(q),O=f(A);le(O,{class:"h-10 w-full"}),v(A);var J=g(A,2),j=f(J);le(j,{class:"h-10 w-full"}),v(J),v(q),v(c),y(e,c)},Tt=e=>{var c=Qa(),l=ge(c);let h;var D=f(l),I=f(D),P=f(I),z=M(P,!0),q=g(P,2),A=f(q),O=M(A,!0),J=g(A);vt(J,{get status(){return t(Le)},size:16,decorative:!0}),v(q),v(I);var j=g(I,2),ye=M(j,!0),de=g(j,2);{var Et=F=>{var oe=Ka(),me=M(oe,!0);Ve(oe,(_e,xe)=>Ge?.(_e,xe),()=>t(ke)),T(()=>N(me,t(ke))),y(F,oe)};$(de,F=>{t(ke)&&F(Et)})}v(D),v(l);var Dt=g(l,2);{var Lt=F=>{var oe=Ga(),me=g(ge(oe),2),_e=f(me);{var xe=X=>{var U=ja(),Y=f(U);Ye(Y,21,()=>t(St),d=>d.id,(d,s)=>{var C=at(),Z=f(C);{let ee=k(()=>bt(t(s)));Xe(Z,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return t(ee)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return t(s).group},get"data-attention-kind"(){return t(s).attentionKind},get onkeydown(){return ne()},onclick:V=>Pt(V,t(s).id),children:(V,ue)=>{var E=Ba(),R=ge(E),L=f(R);{let ae=k(()=>t(s).specialist??null);oa(L,{get agentId(){return t(s).id},variant:"compact",get state(){return t(s).avatarState},get specialist(){return t(ae)}})}v(R);var ie=g(R),Ce=M(ie,!0),te=g(ie),Re=M(te,!0),pe=g(te,2),ve=f(pe),Ie=M(ve,!0);Ve(ve,(ae,ce)=>Ge?.(ae,ce),()=>t(s).context);var Ht=g(ve);{var Bt=ae=>{var ce=Ha(),zt=f(ce),jt=M(zt,!0);v(ce),T(()=>{x(ce,"aria-label",t(s).questionMeta.accessible),N(jt,t(s).questionMeta.compact)}),y(ae,ce)};$(Ht,ae=>{t(s).questionMeta&&ae(Bt)})}v(pe),T(()=>{N(Ce,t(s).name),x(te,"datetime",t(s).updated.dateTime),x(te,"aria-label",t(s).updated.accessible),N(Re,t(s).updated.compact),x(pe,"data-workspace-hover-card-agent-preview",t(s).contextIsPreview||void 0),N(Ie,t(s).context)}),y(V,E)},$$slots:{default:!0}})}v(C),y(d,C)}),v(Y);var Se=g(Y,2);{var Ae=d=>{var s=za(),C=f(s),Z=M(C,!0),ee=g(C,2);fe(ee,{get icon(){return et},size:10}),v(s),T(V=>N(Z,V),[()=>o.workspace_hoverCard_moreAgents_label({count:B(t(De))})]),y(d,s)};$(Se,d=>{t(De)&&d(Ae)})}v(U),T(d=>x(U,"aria-label",d),[()=>o.workspace_multiSelectSidebar_agentsTab_label()]),y(X,U)};$(_e,X=>{t(He)&&X(xe)})}var $t=g(_e,2);{var Kt=X=>{var U=Ya(),Y=f(U);Ye(Y,21,()=>t(It),d=>d.identity,(d,s)=>{var C=at();{const ue=E=>{var R=Fa(),L=ge(R);fe(L,{get icon(){return t(s).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${t(s).foregroundClass??""}`}});var ie=g(L,2),Ce=M(ie,!0),te=g(ie,2),Re=M(te,!0),pe=g(te,2),ve=M(pe,!0);T(Ie=>{N(Ce,Ie),N(Re,t(s).accessibleStateLabel),N(ve,t(s).numberLabel??`#${t(s).number}`)},[()=>t(s).title||(t(s).resource?.repository.provider==="gitlab"?o.workspace_hoverCard_mergeRequest_label():o.workspace_hoverCard_pullRequest_label())]),y(E,R)};var Z=f(C);{var ee=E=>{{let R=k(()=>je(t(s)));Xe(E,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return t(R)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return t(s).identity},get"data-pr-status"(){return t(s).status},get onkeydown(){return ne()},onclick:L=>qt(L,t(s)),children:(L,ie)=>{ue(L)},$$slots:{default:!0}})}},V=E=>{var R=Ua(),L=f(R);ue(L),v(R),T(()=>{x(R,"data-pr-identity",t(s).identity),x(R,"data-pr-status",t(s).status)}),y(E,R)};$(Z,E=>{t(s).url?E(ee):E(V,-1)})}v(C)}T(ue=>x(C,"aria-label",ue),[()=>t(s).url?void 0:je(t(s))]),y(d,C)}),v(Y);var Se=g(Y,2);{var Ae=d=>{var s=Va(),C=f(s),Z=M(C,!0),ee=g(C,2);fe(ee,{get icon(){return et},size:10}),v(s),T(V=>N(Z,V),[()=>o.workspace_hoverCard_moreItems_label({count:B(t(Ke))})]),y(d,s)};$(Se,d=>{t(Ke)&&d(Ae)})}v(U),T((d,s)=>{x(U,"aria-label",d),x(Y,"aria-label",s)},[()=>t(Q).every(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_mergeRequests_label():t(Q).some(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_reviews_label():o.workspace_hoverCard_pullRequests_label(),()=>t(Q).every(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_mergeRequests_label():t(Q).some(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_reviews_label():o.workspace_hoverCard_pullRequests_label()]),y(X,U)};$($t,X=>{t(Be)&&X(Kt)})}v(me),y(F,oe)};$(Dt,F=>{t(ze)&&F(Lt)})}T(F=>{h=lt(l,1,"min-w-0 px-5 pt-4",null,h,{"pb-4":!t(ze)}),N(z,F),N(O,t(Ct).label),N(ye,t(At))},[()=>a().title||o.workspace_links_untitled_label()]),y(e,c)};$(Nt,e=>{p()||!a()?e(Wt):e(Tt,-1)})}v(he),y(r,he);var Ot=ct(Mt);return u(),Ot}const rt=800,xr=175,Za=300;function er(){let r=0,n=null;const b=new Set,m=new Set;function w(){return r>0||n!==null?0:rt}function u(){const a=w();b.forEach(p=>p(a))}function i(){n!==null&&(clearTimeout(n),n=null)}return{get currentOpenDelay(){return w()},subscribe(a){return b.add(a),a(w()),()=>b.delete(a)},notifyOpened(){const a=r===0&&n===null;i(),r+=1,a&&u()},notifyClosed(){r!==0&&(r-=1,!(r>0)&&(i(),n=setTimeout(()=>{n=null,u()},Za)))},deferClose(a){return m.add(a),()=>m.delete(a)},settleDeferredCloses(){const a=[...m];m.clear(),a.forEach(p=>p())},reset(){const a=w()!==rt;i(),r=0,m.clear(),a&&u()}}}const Sr=er();function qe(r){const n=dt.select(W.state,r);return n!==void 0&&wa(n)}function tr(r,n){if(!qe(r))return[];const b=ca.select(W.state,r),m=Je.select(W.state,r),w=la.select(W.state),u=[];for(let i=0;i<_a;i+=1){const a=w[i],p=a&&a!==r?dt.select(W.state,a):void 0;u.push({id:`assign-micro-key-${i+1}`,label:p?o.workspace_card_assignOccupiedMicroKey_label({number:B(i+1),title:p.title}):o.workspace_card_assignMicroKeyNumber_label({number:B(i+1)}),checked:b===i,closeOnSelect:!0,onClick:()=>{qe(r)&&W.dispatch(ga(i,r)),n()}})}return m!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:o.workspace_card_unassignMicroKey_label(),onClick:()=>{qe(r)&&Je.select(W.state,r)===m&&W.dispatch(fa(m)),n()}})),u}function Ar(r,{connected:n,onClose:b}){if(!n)return[];const m=tr(r,b);if(m.length===0)return[];const w=m.filter(i=>"id"in i&&i.id!=="unassign-micro-key"),u=m.find(i=>"id"in i&&i.id==="unassign-micro-key");return[{id:"assign-micro-key",label:o.workspace_card_assignMicroKey_label(),icon:Ia,onClick:()=>{},selection:"single",submenu:w},...u?[u]:[]]}export{xr as W,rt as a,Xa as b,vt as c,tr as d,Ar as e,pt as g,Oa as r,Sr as w};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DuiDS_zT.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BVXKWrt4.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DQw0Iiac.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/KnkAG0HD.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DWF5uerC.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
2
+ import{bm as o,t as st,bo as K,bw as nt,b as ot,bq as Ft,bs as Fe,_ as Ut}from"./CLAmm_T1.js";import{bs as it,a5 as f,aD as t,bA as v,b_ as T,W as y,bn as ct,c9 as k,aA as H,aB as S,ca as Ue,bk as Vt,c6 as Yt,cd as Pe,bV as Gt,bS as g,ay as ge,bl as M,bO as N}from"./3SdAC2_C.js";import{i as $}from"./BFgvMDua.js";import{e as Ve,g as Ye}from"./B1CKzIA2.js";import{c as Qt,e as Jt,f as lt,g as Xt,s as x}from"./CcJmuwXr.js";import{a_ as Zt,db as ea,X as ta,aI as aa,dE as ra,a3 as sa,dI as dt}from"./C2UL5Ler.js";import{t as Ge}from"./DAsc1V4f.js";import{b as na,A as oa}from"./BhCMc9G0.js";import{p as Qe}from"./D6txwX4Y.js";import{aM as ia,aJ as ca,aK as Je,a0 as la}from"./DQw0Iiac.js";import{S as le}from"./Dd-LQrG1.js";import"./TB9r2XJy.js";import{f as Xe}from"./nxtepGjE.js";import{l as B,n as da}from"./Cu5e4npY.js";import{sd as ut,JH as W,mP as ua,fV as pa,nM as va,v1 as ma,c as _a,wE as ga,tG as fa,rW as wa}from"./B9vHutcJ.js";import{c as ba}from"./ChTqQfQN.js";import{o as ka}from"./DrgHk1UN.js";import{aR as ha,aS as Ze,bC as ya,aB as xa,bB as Sa,aG as Aa,d3 as Ca,cT as Ra,F as fe,ay as et,bK as Ia}from"./DPttSllj.js";import{selectCurrentWorkspaceTabId as Pa}from"./aZdb_rCN.js";import{p as qa}from"./DBAONTYG.js";import{i as Ma}from"./DzDSM2LC.js";const Na=new Set(["failed","blocked","needs_attention","in_progress"]),Wa={failed:{visual:"icon",icon:Ra,className:"text-foreground"},blocked:{visual:"icon",icon:Ca,className:"text-danger"},needs_attention:{visual:"icon",icon:Aa,className:"text-warning-ink"},in_progress:{visual:"dot",icon:null,className:"workspace-status-color-active"},waiting:{visual:"icon",icon:Sa,className:"text-muted-foreground"},unread:{visual:"dot",icon:null,className:"workspace-status-color-unread"},not_started:{visual:"dot",icon:null,className:"text-muted-foreground/35"},idle:{visual:"dot",icon:null,className:"text-muted-foreground/35"},complete:{visual:"icon",icon:xa,className:"text-success"},pr_queued:{visual:"icon",icon:ya,className:"text-info"},pr_ready:{visual:"icon",icon:Ze,className:"text-success"},pr_open:{visual:"icon",icon:Ze,className:"text-info"},pr_merged:{visual:"icon",icon:ha,className:"text-purple-500"}};function Ta(r){switch(r){case"failed":return o.workspace_statusIcon_failed_label();case"blocked":return o.workspace_statusIcon_blocked_label();case"needs_attention":return o.workspace_statusIcon_needsAttention_label();case"in_progress":return o.workspace_statusIcon_inProgress_label();case"waiting":return o.workspace_taskStatus_waiting_label();case"unread":return o.layout_activeCard_unread_header();case"not_started":return o.workspace_statusIcon_notStarted_label();case"idle":return o.workspace_statusIcon_idle_label();case"complete":return o.workspace_statusIcon_complete_label();case"pr_queued":return o.workspace_statusIcon_prQueued_label();case"pr_ready":return o.workspace_statusIcon_prReady_label();case"pr_open":return o.workspace_statusIcon_prOpen_label();case"pr_merged":return o.workspace_statusIcon_prMerged_label()}}function Oa(r){const n=ut(r.displayStatus)?r.displayStatus:"not_started";return Na.has(n)?n:r.attention==="unread"?"unread":r.waiting===!0?"waiting":n}function pt(r){const n=r==="waiting"||r==="unread"||ut(r)?r:"not_started",b=Ta(n);return{state:n,...Wa[n],label:b,tooltip:b,accessibleName:b}}var Ea=S('<span class="workspace-status-dot svelte-14zk5l0" data-workspace-status-dot=""></span>'),Da=S("<span><!></span>");function vt(r,n){if(new.target)return st({component:vt,...r});it(n,!0);let b=K(n,"status",7),m=K(n,"size",7,14),w=K(n,"decorative",7,!1),u=K(n,"class",7);const i=k(()=>pt(b()));var a={get status(){return b()},set status(_){b(_),H()},get size(){return m()},set size(_=14){m(_),H()},get decorative(){return w()},set decorative(_=!1){w(_),H()},get class(){return u()},set class(_){u(_),H()},$set:nt,$on:(_,G)=>ot(n,_,G)},p=Da(),re=f(p);{var se=_=>{var G=Ea();y(_,G)},ne=_=>{fe(_,{get icon(){return t(i).icon},class:"size-full!"})};$(re,_=>{t(i).visual==="dot"?_(se):t(i).icon&&_(ne,1)})}return v(p),T(_=>{lt(p,1,_,"svelte-14zk5l0"),Xt(p,`width: ${m()??""}px; height: ${m()??""}px;`),x(p,"role",w()?void 0:"img"),x(p,"aria-label",w()?void 0:t(i).accessibleName),x(p,"aria-hidden",w()?"true":void 0),x(p,"title",w()?void 0:t(i).tooltip),x(p,"data-workspace-status",t(i).state),x(p,"data-workspace-status-visual",t(i).visual),x(p,"data-workspace-status-icon",t(i).icon?.iconName)},[()=>Qt(Jt("workspace-status-icon inline-flex shrink-0 items-center justify-center forced-colors:text-[CanvasText]",t(i).className,u()))]),y(r,p),ct(a)}const Me=6e4,Ne=60*Me,We=24*Ne,tt=30*We;function La(r,n=new Date){if(r==null)return null;const b=r instanceof Date?r:new Date(r),m=b.getTime(),w=n.getTime();if(!Number.isFinite(m)||!Number.isFinite(w))return null;const u=Math.max(0,w-m);let i;u<Me?i="<1m":u<Ne?i=`${B(Math.floor(u/Me))}m`:u<We?i=`${B(Math.floor(u/Ne))}h`:u<tt?i=`${B(Math.floor(u/We))}d`:i=`${B(Math.floor(u/tt))}mo`;const a=m>w?n:b,p=da(a,{now:n});return p?{compact:i,accessible:p,dateTime:b.toISOString()}:null}var $a=S('<div><div class="grid gap-0.5 px-5 pt-4"><div class="flex min-w-0 items-center justify-between gap-3"><!> <!></div> <!> <!></div> <div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><div class="grid" data-workspace-hover-card-activity=""><!></div> <div class="pull-requests grid" data-workspace-hover-card-pr-column=""><!></div></div></div>'),Ka=S('<p class="type-caption mt-1 min-w-0 line-clamp-3 text-muted-foreground" data-workspace-hover-card-summary=""> </p>'),Ha=S('<span class="shrink-0 text-muted-foreground" data-workspace-hover-card-question-meta=""><span aria-hidden="true"> </span></span>'),Ba=S('<span class="row-span-2 flex h-(--text-caption-line-height) items-center" aria-hidden="true"><!></span><span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-agent-name=""> </span><time class="type-caption whitespace-nowrap text-muted-foreground" data-workspace-hover-card-agent-time=""> </time> <span class="agent-detail type-caption flex min-w-0 items-start gap-1.5 text-muted-foreground svelte-1vax087" data-workspace-hover-card-agent-detail=""><span class="min-w-0 truncate" data-workspace-hover-card-agent-context=""> </span><!></span>',1),at=S('<div role="listitem"><!></div>'),za=S('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-overflow=""><span> </span> <!></div>'),ja=S('<section class="activity min-w-0" data-workspace-hover-card-activity="" data-workspace-hover-card-agent-table=""><div class="-mx-2 grid gap-2" role="list"></div> <!></section>'),Fa=S('<!> <span class="type-caption min-w-0 truncate text-foreground" data-workspace-hover-card-pr-title=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-status=""> </span> <span class="type-caption shrink-0 text-muted-foreground" data-workspace-hover-card-pr-number=""> </span>',1),Ua=S('<div class="grid w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center gap-x-2 rounded-sm px-2 py-0 text-left" data-workspace-hover-card-pr-row=""><!></div>'),Va=S('<div class="type-caption mt-3 flex items-center justify-between text-muted-foreground" data-workspace-hover-card-pr-overflow=""><span> </span> <!></div>'),Ya=S('<section class="pull-requests min-w-0" data-workspace-hover-card-pr-column=""><div class="-mx-2 grid min-w-0 gap-2" role="list" data-workspace-hover-card-pr-list=""></div> <!></section>'),Ga=S('<div class="my-3 border-t border-border" data-workspace-hover-card-divider=""></div> <div class="body-grid grid min-w-0 grid-cols-1 items-stretch gap-3 px-5 pb-4" data-workspace-hover-card-columns=""><!> <!></div>',1),Qa=S('<header data-workspace-hover-card-header=""><div class="min-w-0" data-workspace-hover-card-identity=""><div class="flex min-w-0 items-center justify-between gap-3"><h2 class="type-body min-w-0 truncate font-medium text-foreground" data-workspace-hover-card-title=""> </h2> <span class="type-caption flex shrink-0 items-center gap-1.5 text-muted-foreground" data-workspace-hover-card-status=""><span class="truncate" data-workspace-hover-card-status-label=""> </span><!></span></div> <div class="type-caption mt-0.5 min-w-0 truncate text-muted-foreground" data-workspace-hover-card-repo=""> </div> <!></div></header> <!>',1),Ja=S('<section class="workspace-hover-card shrink-0 overflow-hidden rounded-md bg-background text-left text-foreground shadow-(--elevation-overlay) ring-1 ring-border svelte-1vax087" data-workspace-hover-card="" data-workspace-hover-card-layout="landscape"><!></section>');function Xa(r,n){if(new.target)return st({component:Xa,...r});it(n,!0);const b=()=>Fe(gt,"$workspaceAgents$",w),m=()=>Fe(ft,"$prMonitors$",w),[w,u]=Ft(),i=ba("WorkspaceHoverCard");let a=K(n,"workspace",7),p=K(n,"isLoading",7,!1),re=K(n,"activeAgentIds",23,()=>[]),se=K(n,"loadAgentSessions",7,!0),ne=K(n,"onkeydown",7),_=K(n,"staticData",7,!1);const G=Pe("");function mt(){return _()?Pe([]):Zt(G)}function _t(){return _()?Pe([]):ea(G)}const gt=mt(),ft=_t();Ue(()=>G.set(a()?.id??""));let Te=Gt(0);Vt(()=>Qe.subscribe(()=>Yt(Te)));let wt=k(()=>a()?.agentSummary?.agentIds??[]),Oe=k(()=>(t(Te),a()?Qe.getStreamingAgentIdsForWorkspace(a().id):[])),Ee=null,we=new Set;Ue(()=>{if(!a()||!se())return;const e=String(a().id);Ee!==e&&(Ee=e,we=new Set);for(const c of new Set([...t(wt).slice(0,6),...re(),...t(Oe)]))we.has(c)||(W.dispatch(ua(e,c)),we.add(c))});function bt(e){return[e.name,e.context,e.questionMeta?.accessible,e.updated.accessible].filter(Boolean).join(". ")}function kt(e){return e?e.kind==="attention"?e.attention.reason?.trim()||null:"text"in e&&e.text.trim()||null:null}function ht(e){return La(e.lastActivity||e.updatedAt||e.createdAt)??{compact:"—",accessible:o.workspace_hoverCard_noRecentActivity_label()}}function yt(e){const c=String(e.status).toLowerCase(),l=va(e),h=na(e),D=h==="question"?ia(e):null,I=kt(aa.select(W.state,String(e.id)));let P,z,q,A,O,J,j=!1;if(h==="question"){P="attention",z="question",q=D?.questions[0]?.question.trim()||I||o.workspace_hoverCard_question_label(),A="question",O=1;const de=D?.questions.length??0;de>1&&(J={compact:`${B(1)}/${B(de)}`,accessible:o.chat_questionWizard_stepCounter_label({current:1,total:de})})}else if(h==="attention-discussion")P="attention",z="discussion",q=l?.reason?.trim()||o.chat_agentCard_attentionDiscussion_label(),A="attention-discussion",O=1;else if(h==="attention-blocker"||c==="blocked")P="attention",z="blocker",q=l?.reason?.trim()||o.chat_agentCard_attentionBlocker_label(),A="attention-blocker",O=0;else if(e.hasUnread)P="attention",z="unread",q=I||o.chat_newMessagesDivider_label(),j=!!I,A="unread",O=2;else if(e.isStreaming||e.isProcessing||re().includes(String(e.id))||t(Oe).includes(String(e.id))||["active","busy","processing","responding","running","streaming","in_progress"].includes(c))P="active",q=I||o.workspace_devScripts_running_label(),j=!!I,A=e.isProcessing?"responding":"running",O=3;else if(["waiting","pending","queued","starting"].includes(c))P="waiting",q=I||o.workspace_taskStatus_waiting_label(),j=!!I,A="waiting",O=4;else return null;const ye=e.agentMetadata??e.metadata;return{id:String(e.id),name:e.name?.trim()||o.workspace_fileChanges_agent_label(),group:P,attentionKind:z,avatarState:A,specialist:ye?.specialist,context:q,questionMeta:J,contextIsPreview:j,updated:ht(e),priority:O}}let xt=k(()=>{const e=a()?.agentSummary,c=new Map;if(Array.isArray(e?.agents))for(const l of e.agents)l&&typeof l=="object"&&typeof l.id=="string"&&c.set(l.id,l.parentAgentId);return b().filter(l=>{const h=c.get(String(l.id));return!(pa(l)!=="topLevel"||typeof h=="string"&&h||l.pendingDeleteAt||l.retiredAt||String(l.status).toLowerCase()==="deleted")})}),be=k(()=>t(xt).map(yt).filter(e=>e!==null).sort((e,c)=>e.priority-c.priority)),St=k(()=>t(be).slice(0,6)),De=k(()=>Math.max(0,t(be).length-6)),At=k(()=>a()?.repositoryName?a().repositoryOwner?`${a().repositoryOwner} / ${a().repositoryName}`:a().repositoryName:o.workspace_hoverCard_localRepository_label()),Le=k(()=>Oa(a()??{})),Ct=k(()=>pt(t(Le))),ke=k(()=>a()?.statusMessage?.trim()||"");function $e(e){if(!e)return null;const c=e.activePullRequest??e.pullRequests?.[0]??null;return c||(e.prStatus?{id:`legacy-pr-${e.prNumber??"workspace"}`,number:e.prNumber??0,url:e.prUrl??"",title:o.workspace_hoverCard_pullRequest_label(),status:e.prStatus,createdAt:e.updatedAt,updatedAt:e.updatedAt}:null)}let Rt=k(()=>a()?_()?$e(a()):ra.select(W.state,a().id)??$e(a()):null),Q=k(()=>{if(!a()||ta(a()))return[];const e=a().repositoryOwner&&a().repositoryName?`${a().repositoryOwner}/${a().repositoryName}`:void 0;return Ma({workspacePRs:a().pullRequests,activePR:t(Rt),monitors:m(),workspaceRepo:e,buildPrUrl:(c,l)=>qa(c,a().repositoryOwner,a().repositoryName,l),getDisplayTitle:c=>c.title})}),It=k(()=>t(Q).slice(0,3)),Ke=k(()=>Math.max(0,t(Q).length-3)),He=k(()=>t(be).length>0),Be=k(()=>t(Q).length>0),ze=k(()=>t(He)||t(Be));function je(e){const c=e.resource?.repository.provider==="gitlab"?`${e.repo} !${e.number}`:e.repo?o.workspace_card_prBadge_repoLine_tooltip({repo:e.repo,number:e.number}):o.workspace_card_prBadge_label({number:` #${e.number}`});return[sa(c,e),e.title,e.details].filter(Boolean).join(`
3
+ `)}function Pt(e,c){if(e.stopPropagation(),!a()||!se())return;const l=a().id;Pa.select(W.state)!==l&&ka(l).catch(h=>{i.warn("Failed to switch workspace for hover-card agent",{agentId:c,error:h})}),W.dispatch(ma(l,{agentId:c}))}function qt(e,c){if(e.stopPropagation(),!a()||!c.url)return;const l=a().id;Ut(async()=>{const{handleLink:h}=await import("./DuiDS_zT.js").then(D=>D.l);return{handleLink:h}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]),import.meta.url).then(({handleLink:h})=>h(c.url,{workspaceId:l,event:e}))}var Mt={get workspace(){return a()},set workspace(e){a(e),H()},get isLoading(){return p()},set isLoading(e=!1){p(e),H()},get activeAgentIds(){return re()},set activeAgentIds(e=[]){re(e),H()},get loadAgentSessions(){return se()},set loadAgentSessions(e=!0){se(e),H()},get onkeydown(){return ne()},set onkeydown(e){ne(e),H()},get staticData(){return _()},set staticData(e=!1){_(e),H()},$set:nt,$on:(e,c)=>ot(n,e,c)},he=Ja(),Nt=f(he);{var Wt=e=>{var c=$a(),l=f(c),h=f(l),D=f(h);le(D,{class:"h-7 min-w-0 max-w-64 flex-1"});var I=g(D,2);le(I,{class:"h-5 w-20 shrink-0"}),v(h);var P=g(h,2);le(P,{class:"h-4 w-40"});var z=g(P,2);le(z,{class:"mt-2 h-10 w-full"}),v(l);var q=g(l,4),A=f(q),O=f(A);le(O,{class:"h-10 w-full"}),v(A);var J=g(A,2),j=f(J);le(j,{class:"h-10 w-full"}),v(J),v(q),v(c),y(e,c)},Tt=e=>{var c=Qa(),l=ge(c);let h;var D=f(l),I=f(D),P=f(I),z=M(P,!0),q=g(P,2),A=f(q),O=M(A,!0),J=g(A);vt(J,{get status(){return t(Le)},size:16,decorative:!0}),v(q),v(I);var j=g(I,2),ye=M(j,!0),de=g(j,2);{var Et=F=>{var oe=Ka(),me=M(oe,!0);Ve(oe,(_e,xe)=>Ge?.(_e,xe),()=>t(ke)),T(()=>N(me,t(ke))),y(F,oe)};$(de,F=>{t(ke)&&F(Et)})}v(D),v(l);var Dt=g(l,2);{var Lt=F=>{var oe=Ga(),me=g(ge(oe),2),_e=f(me);{var xe=X=>{var U=ja(),Y=f(U);Ye(Y,21,()=>t(St),d=>d.id,(d,s)=>{var C=at(),Z=f(C);{let ee=k(()=>bt(t(s)));Xe(Z,{variant:"plain",wrapContent:!1,class:"grid h-auto! min-h-8 w-full min-w-0 cursor-pointer grid-cols-[1rem_minmax(0,1fr)_auto] items-start justify-normal gap-x-2 gap-y-0 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return t(ee)},"data-workspace-hover-card-agent-row":!0,get"data-agent-group-row"(){return t(s).group},get"data-attention-kind"(){return t(s).attentionKind},get onkeydown(){return ne()},onclick:V=>Pt(V,t(s).id),children:(V,ue)=>{var E=Ba(),R=ge(E),L=f(R);{let ae=k(()=>t(s).specialist??null);oa(L,{get agentId(){return t(s).id},variant:"compact",get state(){return t(s).avatarState},get specialist(){return t(ae)}})}v(R);var ie=g(R),Ce=M(ie,!0),te=g(ie),Re=M(te,!0),pe=g(te,2),ve=f(pe),Ie=M(ve,!0);Ve(ve,(ae,ce)=>Ge?.(ae,ce),()=>t(s).context);var Ht=g(ve);{var Bt=ae=>{var ce=Ha(),zt=f(ce),jt=M(zt,!0);v(ce),T(()=>{x(ce,"aria-label",t(s).questionMeta.accessible),N(jt,t(s).questionMeta.compact)}),y(ae,ce)};$(Ht,ae=>{t(s).questionMeta&&ae(Bt)})}v(pe),T(()=>{N(Ce,t(s).name),x(te,"datetime",t(s).updated.dateTime),x(te,"aria-label",t(s).updated.accessible),N(Re,t(s).updated.compact),x(pe,"data-workspace-hover-card-agent-preview",t(s).contextIsPreview||void 0),N(Ie,t(s).context)}),y(V,E)},$$slots:{default:!0}})}v(C),y(d,C)}),v(Y);var Se=g(Y,2);{var Ae=d=>{var s=za(),C=f(s),Z=M(C,!0),ee=g(C,2);fe(ee,{get icon(){return et},size:10}),v(s),T(V=>N(Z,V),[()=>o.workspace_hoverCard_moreAgents_label({count:B(t(De))})]),y(d,s)};$(Se,d=>{t(De)&&d(Ae)})}v(U),T(d=>x(U,"aria-label",d),[()=>o.workspace_multiSelectSidebar_agentsTab_label()]),y(X,U)};$(_e,X=>{t(He)&&X(xe)})}var $t=g(_e,2);{var Kt=X=>{var U=Ya(),Y=f(U);Ye(Y,21,()=>t(It),d=>d.identity,(d,s)=>{var C=at();{const ue=E=>{var R=Fa(),L=ge(R);fe(L,{get icon(){return t(s).statusIcon},size:16,get class(){return`shrink-0 justify-self-start ${t(s).foregroundClass??""}`}});var ie=g(L,2),Ce=M(ie,!0),te=g(ie,2),Re=M(te,!0),pe=g(te,2),ve=M(pe,!0);T(Ie=>{N(Ce,Ie),N(Re,t(s).accessibleStateLabel),N(ve,t(s).numberLabel??`#${t(s).number}`)},[()=>t(s).title||(t(s).resource?.repository.provider==="gitlab"?o.workspace_hoverCard_mergeRequest_label():o.workspace_hoverCard_pullRequest_label())]),y(E,R)};var Z=f(C);{var ee=E=>{{let R=k(()=>je(t(s)));Xe(E,{variant:"plain",wrapContent:!1,class:"grid h-auto! w-full min-w-0 grid-cols-[1rem_minmax(0,1fr)_auto_auto] items-center justify-normal gap-x-2 whitespace-normal rounded-sm border-0! px-2! py-0! text-left font-normal transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",get"aria-label"(){return t(R)},"data-workspace-hover-card-pr-row":!0,get"data-pr-identity"(){return t(s).identity},get"data-pr-status"(){return t(s).status},get onkeydown(){return ne()},onclick:L=>qt(L,t(s)),children:(L,ie)=>{ue(L)},$$slots:{default:!0}})}},V=E=>{var R=Ua(),L=f(R);ue(L),v(R),T(()=>{x(R,"data-pr-identity",t(s).identity),x(R,"data-pr-status",t(s).status)}),y(E,R)};$(Z,E=>{t(s).url?E(ee):E(V,-1)})}v(C)}T(ue=>x(C,"aria-label",ue),[()=>t(s).url?void 0:je(t(s))]),y(d,C)}),v(Y);var Se=g(Y,2);{var Ae=d=>{var s=Va(),C=f(s),Z=M(C,!0),ee=g(C,2);fe(ee,{get icon(){return et},size:10}),v(s),T(V=>N(Z,V),[()=>o.workspace_hoverCard_moreItems_label({count:B(t(Ke))})]),y(d,s)};$(Se,d=>{t(Ke)&&d(Ae)})}v(U),T((d,s)=>{x(U,"aria-label",d),x(Y,"aria-label",s)},[()=>t(Q).every(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_mergeRequests_label():t(Q).some(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_reviews_label():o.workspace_hoverCard_pullRequests_label(),()=>t(Q).every(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_mergeRequests_label():t(Q).some(d=>d.resource?.repository.provider==="gitlab")?o.workspace_hoverCard_reviews_label():o.workspace_hoverCard_pullRequests_label()]),y(X,U)};$($t,X=>{t(Be)&&X(Kt)})}v(me),y(F,oe)};$(Dt,F=>{t(ze)&&F(Lt)})}T(F=>{h=lt(l,1,"min-w-0 px-5 pt-4",null,h,{"pb-4":!t(ze)}),N(z,F),N(O,t(Ct).label),N(ye,t(At))},[()=>a().title||o.workspace_links_untitled_label()]),y(e,c)};$(Nt,e=>{p()||!a()?e(Wt):e(Tt,-1)})}v(he),y(r,he);var Ot=ct(Mt);return u(),Ot}const rt=800,xr=175,Za=300;function er(){let r=0,n=null;const b=new Set,m=new Set;function w(){return r>0||n!==null?0:rt}function u(){const a=w();b.forEach(p=>p(a))}function i(){n!==null&&(clearTimeout(n),n=null)}return{get currentOpenDelay(){return w()},subscribe(a){return b.add(a),a(w()),()=>b.delete(a)},notifyOpened(){const a=r===0&&n===null;i(),r+=1,a&&u()},notifyClosed(){r!==0&&(r-=1,!(r>0)&&(i(),n=setTimeout(()=>{n=null,u()},Za)))},deferClose(a){return m.add(a),()=>m.delete(a)},settleDeferredCloses(){const a=[...m];m.clear(),a.forEach(p=>p())},reset(){const a=w()!==rt;i(),r=0,m.clear(),a&&u()}}}const Sr=er();function qe(r){const n=dt.select(W.state,r);return n!==void 0&&wa(n)}function tr(r,n){if(!qe(r))return[];const b=ca.select(W.state,r),m=Je.select(W.state,r),w=la.select(W.state),u=[];for(let i=0;i<_a;i+=1){const a=w[i],p=a&&a!==r?dt.select(W.state,a):void 0;u.push({id:`assign-micro-key-${i+1}`,label:p?o.workspace_card_assignOccupiedMicroKey_label({number:B(i+1),title:p.title}):o.workspace_card_assignMicroKeyNumber_label({number:B(i+1)}),checked:b===i,closeOnSelect:!0,onClick:()=>{qe(r)&&W.dispatch(ga(i,r)),n()}})}return m!==null&&(u.push({type:"separator"}),u.push({id:"unassign-micro-key",label:o.workspace_card_unassignMicroKey_label(),onClick:()=>{qe(r)&&Je.select(W.state,r)===m&&W.dispatch(fa(m)),n()}})),u}function Ar(r,{connected:n,onClose:b}){if(!n)return[];const m=tr(r,b);if(m.length===0)return[];const w=m.filter(i=>"id"in i&&i.id!=="unassign-micro-key"),u=m.find(i=>"id"in i&&i.id==="unassign-micro-key");return[{id:"assign-micro-key",label:o.workspace_card_assignMicroKey_label(),icon:Ia,onClick:()=>{},selection:"single",submenu:w},...u?[u]:[]]}export{xr as W,rt as a,Xa as b,vt as c,tr as d,Ar as e,pt as g,Oa as r,Sr as w};
@@ -1,2 +1,2 @@
1
- import{t as ht,bo as _,bm as g,bw as bt,b as xt}from"./CLAmm_T1.js";import{bs as yt,a7 as kt,ay as Q,W as p,bn as At,aA as h,a5 as q,bS as u,bl as S,bA as W,aD as e,b_ as D,bO as x,aB as k,bH as et,c9 as y,bV as at,be as wt,b$ as It}from"./3SdAC2_C.js";import{i as f}from"./BFgvMDua.js";import{I as Bt,g as Ct}from"./B1CKzIA2.js";import{n as Pt,j as zt}from"./CfNIzRu8.js";import{f as F}from"./nxtepGjE.js";import"./TB9r2XJy.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import{F as rt,ce as Rt,cq as St,au as Wt}from"./DPttSllj.js";import{A as Dt}from"./9YT9B_ti.js";import{D as Ht}from"./C8ukaQ4v.js";import{JH as Lt,v1 as $t}from"./B9vHutcJ.js";import{g as Nt}from"./DgAgTFcK.js";var jt=k('<span class="type-caption shrink-0 font-medium text-success"> </span>'),qt=k('<!> <span class="type-body flex-1 truncate text-left font-medium text-foreground"> </span> <span class="type-caption shrink-0 tabular-nums"><span class="text-success"> </span> <span class="ml-1 text-danger"> </span></span> <!>',1),Ft=k("<!> ",1),Mt=k('<div class="mb-2 flex gap-1"></div>'),Ot=k('<div class="border-t border-border p-2"><!> <!></div>'),Vt=k('<div class="ws-block-widget type-body my-2 overflow-hidden rounded-md border border-border bg-card text-foreground shadow-(--elevation-raised)"><div class="flex min-h-9 items-center gap-2 px-3 py-1.5"><!> <!> <!></div> <!></div>'),Et=k('<div class="ws-block-widget type-caption my-2 text-muted-foreground"> </div>');function Jt(U,n){if(new.target)return ht({component:Jt,...U});yt(n,!0);let A=_(n,"patches",7),M=_(n,"label",23,()=>g.ui_patchBlock_label()),O=_(n,"lastApply",7),w=_(n,"linkedAgentId",7),H=_(n,"workspaceId",7),P=_(n,"applying",7,!1),L=_(n,"onApply",7),$=_(n,"onRevert",7),V=at(!1),E=at(0),z=y(()=>A()?.[e(E)]),J=y(()=>O()?.status==="success");function st(t){const o=t.split(`
1
+ import{t as ht,bo as _,bm as g,bw as bt,b as xt}from"./CLAmm_T1.js";import{bs as yt,a7 as kt,ay as Q,W as p,bn as At,aA as h,a5 as q,bS as u,bl as S,bA as W,aD as e,b_ as D,bO as x,aB as k,bH as et,c9 as y,bV as at,be as wt,b$ as It}from"./3SdAC2_C.js";import{i as f}from"./BFgvMDua.js";import{I as Bt,g as Ct}from"./B1CKzIA2.js";import{n as Pt,j as zt}from"./CfNIzRu8.js";import{f as F}from"./nxtepGjE.js";import"./TB9r2XJy.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import{F as rt,ce as Rt,cq as St,au as Wt}from"./DPttSllj.js";import{A as Dt}from"./9YT9B_ti.js";import{D as Ht}from"./CHW1UVsO.js";import{JH as Lt,v1 as $t}from"./B9vHutcJ.js";import{g as Nt}from"./DgAgTFcK.js";var jt=k('<span class="type-caption shrink-0 font-medium text-success"> </span>'),qt=k('<!> <span class="type-body flex-1 truncate text-left font-medium text-foreground"> </span> <span class="type-caption shrink-0 tabular-nums"><span class="text-success"> </span> <span class="ml-1 text-danger"> </span></span> <!>',1),Ft=k("<!> ",1),Mt=k('<div class="mb-2 flex gap-1"></div>'),Ot=k('<div class="border-t border-border p-2"><!> <!></div>'),Vt=k('<div class="ws-block-widget type-body my-2 overflow-hidden rounded-md border border-border bg-card text-foreground shadow-(--elevation-raised)"><div class="flex min-h-9 items-center gap-2 px-3 py-1.5"><!> <!> <!></div> <!></div>'),Et=k('<div class="ws-block-widget type-caption my-2 text-muted-foreground"> </div>');function Jt(U,n){if(new.target)return ht({component:Jt,...U});yt(n,!0);let A=_(n,"patches",7),M=_(n,"label",23,()=>g.ui_patchBlock_label()),O=_(n,"lastApply",7),w=_(n,"linkedAgentId",7),H=_(n,"workspaceId",7),P=_(n,"applying",7,!1),L=_(n,"onApply",7),$=_(n,"onRevert",7),V=at(!1),E=at(0),z=y(()=>A()?.[e(E)]),J=y(()=>O()?.status==="success");function st(t){const o=t.split(`
2
2
  `);let v=0,b=0;for(const I of o)I.startsWith("+")&&!I.startsWith("+++")?v++:I.startsWith("-")&&!I.startsWith("---")&&b++;return{addCount:v,removeCount:b}}let X=y(()=>e(z)?st(e(z).diff):{addCount:0,removeCount:0}),T=y(()=>P()?{label:g.ui_patchBlock_applying_label(),icon:null}:e(J)?{label:g.ui_patchBlock_revert_label(),icon:St}:{label:g.ui_patchBlock_apply_label(),icon:Wt}),nt=y(()=>!!(L()||$()));function ot(){et(V,!e(V))}function it(){e(J)?$()?.():L()?.()}var lt={get patches(){return A()},set patches(t){A(t),h()},get label(){return M()},set label(t=g.ui_patchBlock_label()){M(t),h()},get lastApply(){return O()},set lastApply(t){O(t),h()},get linkedAgentId(){return w()},set linkedAgentId(t){w(t),h()},get workspaceId(){return H()},set workspaceId(t){H(t),h()},get applying(){return P()},set applying(t=!1){P(t),h()},get onApply(){return L()},set onApply(t){L(t),h()},get onRevert(){return $()},set onRevert(t){$(t),h()},$set:bt,$on:(t,o)=>xt(n,t,o)},Y=kt(),ct=Q(Y);{var dt=t=>{var o=Vt(),v=q(o),b=q(v);{var I=a=>{{let c=y(()=>g.ui_patchBlock_viewAgent_tooltip());F(a,{variant:"plain",size:"icon-compact",iconOnly:!0,class:"size-4! shrink-0 rounded-sm! transition-opacity hover:opacity-80",onclick:i=>{H()&&Lt.dispatch($t(H(),{agentId:w(),...Nt(i)}))},get title(){return e(c)},children:(i,m)=>{Dt(i,{get agentId(){return w()},variant:"compact"})},$$slots:{default:!0}})}};f(b,a=>{w()&&a(I)})}var Z=u(b,2);F(Z,{variant:"plain",size:"compact",class:"h-auto! min-w-0 flex-1 shrink items-center justify-start gap-2 px-0! py-0! text-muted-foreground transition-colors hover:text-foreground",truncateLabel:!1,labelClass:"flex min-w-0 flex-1 items-center gap-2",onclick:ot,children:(a,c)=>{var i=qt(),m=Q(i);{var B=l=>{rt(l,{get icon(){return Rt},size:10,class:"text-muted-foreground"})};f(m,l=>{w()||l(B)})}var C=u(m,2),s=S(C,!0),d=u(C,2),r=q(d),R=S(r),N=u(r,2),G=S(N);W(d);var K=u(d,2);{var tt=l=>{var j=jt(),_t=S(j,!0);D(gt=>x(_t,gt),[()=>g.ui_patchBlock_applied_label()]),p(l,j)};f(K,l=>{e(J)&&l(tt)})}D(()=>{x(s,M()),x(R,`+${e(X).addCount??""}`),x(G,`-${e(X).removeCount??""}`)}),p(a,i)},$$slots:{default:!0}});var ut=u(Z,2);{var ft=a=>{F(a,{variant:"ghost-light",size:"sm",class:"type-caption shrink-0",onclick:it,get disabled(){return P()},children:(c,i)=>{var m=Ft(),B=Q(m);{var C=r=>{Bt(r,{size:12})},s=r=>{rt(r,{get icon(){return e(T).icon},size:"xs"})};f(B,r=>{P()?r(C):e(T).icon&&r(s,1)})}var d=u(B);D(()=>x(d,` ${e(T).label??""}`)),p(c,m)},$$slots:{default:!0}})};f(ut,a=>{e(nt)&&a(ft)})}W(v);var vt=u(v,2);{var mt=a=>{var c=Ot(),i=q(c);{var m=s=>{var d=Mt();Ct(d,23,A,(r,R)=>`patch-${R}-${r.filePath}`,(r,R,N)=>{{let G=y(()=>e(N)===e(E)?"default":"ghost-light");F(r,{get variant(){return e(G)},size:"sm",class:"type-caption",onclick:()=>et(E,e(N),!0),children:(K,tt)=>{wt();var l=It();D(j=>x(l,j),[()=>e(R).filePath.split("/").pop()]),p(K,l)},$$slots:{default:!0}})}}),W(d),p(s,d)};f(i,s=>{A().length>1&&s(m)})}var B=u(i,2);{var C=s=>{Ht(s,{get patch(){return e(z).diff},get fileName(){return e(z).filePath},showHeader:!0,showStats:!0,showLineNumbers:!0,maxHeight:"300px",collapsible:!1,class:"overflow-hidden rounded-sm border border-border"})};f(B,s=>{e(z)&&s(C)})}W(c),Pt(3,c,()=>zt,()=>({tier:"moderate"})),p(a,c)};f(vt,a=>{e(V)&&a(mt)})}W(o),p(t,o)},pt=t=>{var o=Et(),v=S(o,!0);D(b=>x(v,b),[()=>g.ui_patchBlock_invalid_error()]),p(t,o)};f(ct,t=>{A()?.length?t(dt):t(pt,-1)})}return p(U,Y),At(lt)}export{Jt as P};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/uvhZkGDU.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/D4ytz2EC.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BbhtQrkZ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js"])))=>i.map(i=>d[i]);
2
- var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./B9vHutcJ.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./C2UL5Ler.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BBFoj-dS.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./CZr8f1ch.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./ClxyT-Se.js";import{f as un}from"./B_vpadVO.js";import{bm as h,_ as fe}from"./CLAmm_T1.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./Klbdavqn.js";import{W as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./TB9r2XJy.js";import{l as H,i as An,n as In}from"./Cu5e4npY.js";import{b as Tn}from"./BbhtQrkZ.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./Bm6N2soI.js";import{b as Ue,c as xn,a as Pn}from"./_UjuBCOJ.js";import{m as Bn}from"./DQw0Iiac.js";import{m as On}from"./96V4v2iI.js";import"./3SdAC2_C.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import"./ChTqQfQN.js";import"./BbYWP3Ow.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Dqi2LMpO.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
2
+ var Rt=Object.defineProperty;var xt=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>xt(e,typeof t!="symbol"?t+"":t,n);import{JH as A,m as be,nZ as R,wu as Pt,CB as Ge,ww as Bt,DP as Ye,cK as Ot,cL as Lt,n_ as Je,nM as Ut,i as ke,fV as $t,ma as Nt,cS as Ht}from"./B9vHutcJ.js";import{J as Ft,Z as Kt,dX as Be,cU as pe,dI as Wt,ax as qt,be as Xe,I as jt,e9 as Vt}from"./C2UL5Ler.js";import{e as zt,b as ae,F as Gt,y as re,_ as _e,G as Yt,C as Jt,W as Qe,v as Xt,u as Qt,M as Zt}from"./BBFoj-dS.js";import{D as Oe,a as en,d as tn}from"./CQcEqK4G.js";import{m as nn,g as Ze,r as an,k as rn,D as sn}from"./CZr8f1ch.js";import{e as on}from"./CL3a4Hm1.js";import{z as et,O as cn,R as ln}from"./Bqd7fdCF.js";import{a as dn}from"./ClxyT-Se.js";import{f as un}from"./B_vpadVO.js";import{bm as h,_ as fe}from"./CLAmm_T1.js";import{a8 as tt,aA as se,I as he,a as nt,n as at,cT as rt,e as st,aI as ot,M as mn,aa as pn,aV as Le,d as le,C as fn,cU as hn,U as gn,a4 as yn,aJ as wn,b_ as bn}from"./DBAONTYG.js";import{W as kn,L as _n,w as vn,R as Sn,h as it,M as Mn}from"./TB9r2XJy.js";import{l as H,i as An,n as In}from"./Cu5e4npY.js";import{b as Tn}from"./BbhtQrkZ.js";import{K as Cn,P as En,as as Dn,aC as Rn}from"./D6txwX4Y.js";import{b as Ue,c as xn,a as Pn}from"./_UjuBCOJ.js";import{m as Bn}from"./DQw0Iiac.js";import{m as On}from"./96V4v2iI.js";import"./3SdAC2_C.js";import"./CcJmuwXr.js";import"./BwNrQXlF.js";import"./ChTqQfQN.js";import"./BbYWP3Ow.js";import{i as ct}from"./Dms_DO28.js";import{C as Ln}from"./B5aYN90J.js";import{i as Un}from"./Dqi2LMpO.js";import{o as L,e as $n,l as z,s as C,n as ce,b as Nn,d as Hn,c as Fn}from"./CIyUrgF0.js";const Vr=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),zr=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Gr=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const o of Object.values(s.panels))for(const i of o.tabs)i.type==="agent"&&i.agentId&&t.push(i.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}});function Yr(e,t){if(e)return e.model}function Kn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Jr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?Ft(e):!1)&&!Kn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function Xr(e){return Kt(e.messageMetadata)}function Wn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Qr(e){return Wn({...e,createdAt:Date.parse(e.queuedAt)})}const qn=8*1024*1024,jn=3*1024*1024;function Vn(e){return Math.ceil(Math.max(0,e)/3)*4}function zn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=jn&&typeof t=="number"&&t===Vn(e.size)?t:null}async function lt(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const o=dn(e.source,e.saved);if(o.length>1e4)throw new Error("media-animation-layer-limit");const i=[];for(const c of o)s(),i.push({...c,png:await nn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:zt,jobId:t,media:e,layers:i});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const ve={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function $e(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function Gn(e){const t=e.video==="full"?h.dock_captureEditor_videoFull_label():h.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?h.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?h.dock_captureEditor_voiceTranscript_label():h.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Yn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const V=un;function Zr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,o=t.speech.error??t.speech.capability?.reason??null,i=Yn(t.captureError,t.clips.find(y=>y.status==="failed"&&y.error==="permission")?.error??null,o,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",g=c?.error==="permission"&&c.kind==="pick",p=o?.startsWith("speech-permission")?"speech":o?.startsWith("microphone-permission")||o==="permission"?"microphone":void 0,m={},w={},f=(y,D,$)=>{m[y]=D,$&&(w[y]=$)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),g&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(o&&r.speechError?.(o))??s.speechPermission,p));const k=y=>{const D=w[y];D&&e.actions.onOpenSettings(D)},_=new Set(t.evidenceOwnedItemIds),I=t.clips.find(y=>y.status==="recording"),S=t.clips.length>=ae.clips,v=t.capabilities,B=t.speech.available,E=new Set(t.clips.filter(y=>y.status==="recording"||y.status==="placing"||!!y.media).flatMap(y=>y.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:y,marks:D})=>!!y.media||y.source!=="annotate"||!E.has(y.id)||D.some(({mark:$})=>!$.clipId)).map(({image:y,marks:D})=>({kind:"image",id:y.contextItemId,url:a.previews[y.id]??"",markCount:D.length,owner:"evidence",...a.previews[y.id]?{}:{status:"placing"}})),...t.clips.filter(y=>!y.discarding).map(y=>({kind:"clip",id:y.contextItemId??y.id,duration:V(y.status==="recording"?$e(y,a.now):y.durationMs),recording:y.status==="recording",...y.media?.saved?{summary:Gn(y.media.saved)}:{},...y.status==="ready"&&ge(e.workspaceId,y.path)?{url:ge(e.workspaceId,y.path)}:{},owner:"evidence",...y.status==="placing"?{status:"placing"}:{},...y.status==="failed"?{status:"failed",...y.error==="limit"?{error:h.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(y=>!_.has(y.id)).map(y=>({...y.imageData&&y.imageMimeType?{kind:"image",id:y.id,url:`data:${y.imageMimeType};base64,${y.imageData}`,markCount:0,file:{name:y.label,imageData:y.imageData,imageMimeType:y.imageMimeType}}:{kind:"file",id:y.id,name:y.label},owner:"attachment",...y.placementStatus==="placing"?{status:"placing"}:{},...y.placementStatus==="failed"?{status:"failed",error:y.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...i?{settingsPane:i}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!v.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!v.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!v.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!v.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:V(I?$e(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?V(a.now-t.dictation.startedAt):V(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,Jn=["image/png","image/jpeg","image/webp"],Ne=e=>Jn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function es(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const w=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:w,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:w,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),g=r[s.image.id];return!c?.imageData||!u||!g?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(g),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const o=n.clips.find(c=>c.id===e||c.contextItemId===e);if(o){const c=o.status==="ready"?ge(t.workspaceId,o.path):null;if(!c)return null;const d=a.find(g=>g.id===o.contextItemId),u=await t.fetchBytes(c);if(!Qn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${o.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:o.durationMs,hasMicAudio:o.hasMicAudio}}const i=a.find(c=>c.id===e),l=Ne(i?.imageMimeType);return i?.imageData&&l?{kind:"image",name:i.label||"image",mimeType:l,bytes:He(i.imageData)}:null}async function Xn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Qn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function ts(e){try{return(await Se()?.invoke(ve.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Zn(){try{return await Se()?.invoke(ve.CLIPBOARD_READ,{})??null}catch{return null}}async function ns(e){try{const t=await Se()?.invoke(ve.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function ea(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function as(e,{onIntentMedia:t,isCurrent:n,read:a=Zn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,o=Array.from(r.files),i=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await ea(o,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of o)c.items.add(u);for(const[u,g]of i)c.setData(u,g);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function ta(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function na(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function dt(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function aa(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const ut={placeAttachment:ot,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=ut){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},o=async m=>hn(m,r)?Le(e,r,a.getAttachmentInfo):void 0;if(dt(n.data)<=mn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const w=await o(m);if(w)return w;throw m}const i=ta(n.data),l=await aa(i);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,i.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&pn(m)){const w=await Le(e,r,a.getAttachmentInfo);if(w)return w}throw m}const u=Math.min(gn,d),g=Math.ceil(i.byteLength/u);let p=!1;try{for(let m=0;m<g;m++){const w=i.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,na(w),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const w=p?await o(m):void 0;if(w)return w;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ra(e,t){return yn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function sa(e,t){return e instanceof Ae?e.retryBlocks:t}async function oa(e,t,n=ut,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],o=[],i=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),o.push(p);continue}const d=c,u=d.placementFileName??ra(d.mimeType,l),g=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...g!==void 0?{idempotencyKey:g}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),o.push(m)}catch(p){const m=fn(p);i.push(m?`${u} (${m})`:u),o.push(g!==void 0?{...d,placementIdempotencyKey:g,placementFileName:u}:d)}}if(i.length>0)throw new Ae(h.chat_imagePlacement_failed_error({names:i.join(", ")}),o);return le(a),s}const rs=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:dt,imageRetryBlocks:sa,placeImageAttachment:Me,toImageReferenceBlocks:oa},Symbol.toStringTag,{value:"Module"}));function mt(){try{return kn()}catch{return null}}function ia(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:mt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const K={current:e=>mt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>_n(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,ot),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function Y(e){return K.current(e)}function ca(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:R(n.drafts,Gt(e,t))?.clearRevision??0,binding:ia()}}function ss(e,t,n){const a=ca(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&Y(n.binding)}function pt(e,t){return()=>{if(!e.current(t))throw new Ie}}const ft=Object.freeze({rawRetention:!1,chiefAttachments:!1});function os(e){return e!==ft}const de=new Map;function ht(e,t=K){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=pt(t,e);a=(async()=>{r();const o=await t.capabilities();r();const i=o?.server?.capabilities;if(!i||typeof i!="object")throw new Error("unobserved");return{rawRetention:i.rawScreenshotRetention===1,chiefAttachments:i.chiefAttachments===1}})().catch(()=>(de.delete(n),ft)),de.set(n,a)}return a}class ee extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function gt(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function la(e){const t=String(e?.message??"");return gt(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function da(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ua extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function ma(e){const t=e.api??K,n=e.now??Date.now,a=pt(t,e.binding);a();const r=await ht(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),o=[];for(const i of e.images){const l=e.records[i.image.id];let c=l&&l.signature===i.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:i.image.id,signature:i.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const g=c.compositeKey,p=t.mintKey(g??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}.${We(i.composite.mimeType)}`,{data:i.composite.base64,mimeType:i.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??i.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&i.raw&&!c.raw&&!c.rawSettled){const g=c.rawKey,p=t.mintKey(g??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;g&&p===g&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${i.image.id.slice(0,8)}-original.${We(i.raw.mimeType)}`,{data:i.raw.base64,mimeType:i.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const w=da(m,u,n());if(w==="expired")d({...c,rawSettled:!0});else if(w)d({...c,raw:w});else throw new ee("echo")}catch(w){if(la(w))d({...c,rawSettled:!0});else throw w instanceof ee?w:gt(w)?new ee("refused"):w}}else throw new ee("unkeyed")}}catch(u){throw u instanceof Ie?u:new ua(i.image.id,u)}o.push(c)}return o}async function is(e,t,n,a){const r=()=>{if(!K.current(a))throw new Ie};r();const s=await K.placeImage(e,t,{...n,idempotencyKey:K.mintKey()},r);return r(),s}const pa=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),fa=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function oe(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!pa.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>fa.has(r)?r:"other")].join(":")}function cs(e,t){return e instanceof O?{stage:e.stage,code:oe(e.code)}:{stage:t,code:oe(e)}}function W(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=_e(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ha(e,t,n,a,r,s){const o={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let i="validate";try{const l=()=>{if(!r()||!Y(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(i="validate",s?.stage(i),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||W(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let g=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&g.voice==="transcript"&&d.transcript?.status!=="ready"){if(i="transcribe",s?.stage(i),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(g=re(u,u.capturedMarks??[],d.transcript))}i="plan",s?.stage(i);const m=_e(g,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const w={id:c.id,kind:u.kind,video:g.video,voice:g.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:_})=>({n:f,id:k.id,at_ms:_,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){i="screenshot-source",s?.stage(i);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const _=await Xn(k.url);l();const I={base64:Ze(_.buffer.slice(_.byteOffset,_.byteOffset+_.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};i="screenshot-render",s?.stage(i),o.images[c.id]=await an(u,g,I),l()}else{if(!m.clips.length){w.video_attachment_id=null,w.frames=[],w.kept_ms=[],o.metadata.push(w);continue}const f={...d,saved:g};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await lt(f,p,a,()=>r()&&Y(n),S=>{i=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,i="placement",s?.stage(i);const _=[k.value.video,...k.value.frames],I=[];for(let S=0;S<_.length;S++){l();const v=_[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":v.mimeType==="image/jpeg"?"jpg":"png"}`,E=await wn(e,B,{sourcePath:v.sourcePath,mimeType:v.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&Y(n));l(),S===0?o.files.push({type:"file",attachmentId:E.attachmentId,fileName:B,mimeType:E.mimeType??v.mimeType,size:E.size}):(o.frames.push({type:"image",attachmentId:E.attachmentId,mimeType:v.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),o.framePromptBytes.push(zn(v))),I.push(E.attachmentId)}w.video_attachment_id=I[0],w.frames=k.value.frames.map((S,v)=>({mark_id:S.markId,attachment_id:I[v+1]})),w.kept_ms=m.clips}o.metadata.push(w)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return o}catch(l){throw l instanceof O?l:new O(i,oe(l))}}const ue=1568,ga=.85;async function ya(e,t){const n=Math.round(e.length*3/4/1024),a=await wa(e,t),{width:r,height:s}=a,o=r>ue||s>ue;let i=r,l=s;if(o){const f=ue/Math.max(r,s);i=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(i,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,i,l);let u=t;ba(d,i,l)||(u="image/jpeg");const g=await c.convertToBlob({type:u,quality:u==="image/jpeg"?ga:void 0}),p=g.type||u,m=await ka(g),w=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${i}×${l} | ${t} → ${p} | ${n} KB → ${w} KB`),{base64:m,mimeType:p}}async function wa(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ba(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ka(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function _a(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],o=i=>i*n;for(const{n:i,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:o(c.x),y:o(c.y),w:o(c.w),h:o(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:o(m.x),y:o(m.y)})),width:T.pen*r});else{const m={x:o(c.from.x),y:o(c.from.y)},w={x:o(c.to.x),y:o(c.to.y)};s.push({kind:"arrow",from:m,to:w,head:Ia(m,w,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=o(l.bounds.x+l.bounds.w),g=o(l.bounds.y),p=tn({x:o(l.bounds.x),y:g,w:u-o(l.bounds.x),h:o(l.bounds.h)},{x:0,y:0,w:o(e.width),h:o(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(i),font:d*T.badgeTextScale})}return s}function va(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((o,i)=>i?e.lineTo(o.x,o.y):e.moveTo(o.x,o.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(en(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function Sa(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function Ma(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function yt(e,t,n,a,r=0){await rn();const s=await Sa(e.base64,e.mimeType);try{const o=Math.min(1,a/Math.max(t.width,t.height)),i=new OffscreenCanvas(Math.max(1,Math.round(t.width*o)),Math.max(1,Math.round(t.height*o))),l=i.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,i.width,i.height),va(l,_a(t,n,o,r)),i}finally{s.close()}}async function Aa(e,t,n){const a=await yt(e,t,n,Math.max(t.width,t.height));return ya(await Ma(a),"image/png")}async function ls(e,t,n,a=384){const r=await yt(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Ia(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function ds(e,t){const n=Yt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!W(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function us({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:o,service:i,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!Y(o))throw new O("validate","media-send-retired")};if(u(),n?.images.some(b=>b.mediaError)||n?.clips.some(b=>b.mediaError))throw new O("validate","invalid-saved-edit");const g=b=>!!b.media&&!W(b.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(b=>[b.id,a.find(M=>M.id===b.contextItemId)?.attachmentId??null]))}:null;for(const b of n?.clips??[]){if(!b.media||!W(b.media))continue;const M=a.find(Q=>Q.id===b.contextItemId);if(!M||M.attachmentId!==b.media.source.attachmentId||M.path!==b.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ha(e,n,o,i,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},w=new Set(n?.clips.filter(b=>g(b)||!!b.media&&W(b.media)).map(b=>b.id)),f=new Set(n?.clips.filter(b=>w.has(b.id)).flatMap(b=>(b.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(b=>b.source!=="annotate"||!!b.media||!f.has(b.id)||n.marks.some(M=>M.imageId===b.id&&!(M.clipId&&w.has(M.clipId))));d?.stage("burn");let _=[];try{_=n?await Ta({...n,images:k},a,m.images):[]}catch(b){throw new O("burn",oe(b))}if(m.framePromptBytes.reduce((b,M)=>b+(M??0),0)>qn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(b=>b.media).map(b=>b.id)),v=n?{...n,images:k.map(b=>m.images[b.id]?{...b,width:m.images[b.id].width,height:m.images[b.id].height}:b),clips:n.clips.filter(b=>!g(b)),marks:n.marks.filter(b=>!S.has(b.imageId)&&!n.clips.some(M=>g(M)&&M.id===b.clipId))}:null;u();const B=m.metadata.some(b=>typeof b.transcript=="string"&&b.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!_.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let E=_,P=null;d?.stage("placement");const xe=n?await ht(o):null;if(u(),n&&(e!==be||xe?.chiefAttachments)){const b=await ma({workspaceId:e,binding:o,images:k.map((M,Q)=>{const Z=a.find(Dt=>Dt.id===M.contextItemId);return{image:M,signature:Jt(n,M.id),composite:{base64:_[Q].data,mimeType:_[Q].mimeType},raw:!M.media&&Z?.imageData&&Z.imageMimeType?{base64:Z.imageData,mimeType:Z.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),E=b.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(b.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const y=new Map(n?Qe(n).map(({n:b,mark:M})=>[M.id,b]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:y}:p&&{...p,markNumbers:y},$=n&&D?{...s,imageBlocks:[...E,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Qt(v,D),m.metadata.length?`[Edited capture outputs]
3
3
  ${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
4
4
 
5
5
  `),messageMetadata:{...s.messageMetadata,...Xt(v,D),edited_captures:m.metadata}}:s;return u(),$}async function Ta(e,t,n={}){const a=Qe(e);return Promise.all(e.images.map(async r=>{if(n[r.id])return{type:"image",...n[r.id]};const s=t.find(i=>i.id===r.contextItemId);if(!s?.imageData||!s.imageMimeType)throw new Error("dock-evidence-missing-pixels");const o=await Aa({base64:s.imageData,mimeType:s.imageMimeType},r,a.filter(({mark:i})=>i.imageId===r.id));return{type:"image",data:o.base64,mimeType:o.mimeType}}))}function Ca(){return et()}function ms(e){const{clip:t}=e;if(t.status!=="ready"||!t.path)return null;const n=e.marks.filter(s=>s.clipId===t.id&&typeof s.clipMs=="number").sort((s,o)=>s.clipMs-o.clipMs).map(s=>({id:s.id,tool:s.tool,atMs:s.clipMs,...s.element?.name?{label:s.element.name.slice(0,200)}:{}})),a=Zt(e.evidence??void 0,t.id),r=a?t.media:void 0;return{kind:"recording",workspaceId:e.workspaceId,agentId:e.agentId,attachmentId:a?.attachmentId??t.id,sourceRevision:a?`${a.id}:${a.revision}`:t.path,attachmentPath:t.path,title:"",durationMs:t.durationMs,marks:n,provenance:a?{...a.audio==="unknown"?{}:{hasMicAudio:a.audio==="available"},visuals:a.visuals}:{hasMicAudio:t.hasMicAudio,visuals:n.length>0?"baked-marks":"clean"},...a&&r?{source:a,saved:r.saved??null,transcript:r.transcript??null}:{}}}async function ps(e){if(!Ca())return{ok:!1,error:"unavailable"};try{return await on().invoke(sn.OPEN,e)??{ok:!1,error:"unavailable"}}catch{return{ok:!1,error:"transport"}}}function fs(e){let t=null,n=null;const a=i=>e.releaseMediaJob?.(i).catch(()=>{});function r(){const i=t;t=null,!(!i||i.taken||i.stopped)&&(i.stopped=!0,clearTimeout(i.timer),a(i.id))}function s(i,l,c){if(t?.key===i||n===i||(r(),n=null,!e.adoptMediaJob||!e.exportMedia||!c()||W(l)))return;const d=structuredClone(l),u=d.saved??re(d.source,d.source.capturedMarks??[],d.transcript),g=_e(u,d.source,d.transcript);if(d.source.kind!=="recording"||d.source.visuals!=="clean"||g.errors.length||!g.clips.length||u.voice==="transcript"&&d.transcript?.status!=="ready")return;const p={...d,saved:u},m=crypto.randomUUID(),w={key:i,mediaKey:JSON.stringify(p),id:m,current:c,taken:!1,stopped:!1,settled:!1,failed:!1,timer:setTimeout(()=>{t===w&&(n=i,r())},3e4),result:Promise.resolve({error:new Error("not-started")})};t=w,w.result=lt(p,m,e,()=>!w.stopped&&w.current()).then(async f=>w.stopped||!w.current()?(await a(m),{error:new Error("media-send-retired")}):{value:f},async f=>(w.failed=!0,t===w&&(n=i),await a(m),{error:f})).finally(()=>{w.settled=!0})}async function o(i,l,c){const d=t;if(!d||d.key!==i||d.mediaKey!==JSON.stringify(l)||d.stopped||d.taken||!c())return null;if(d.failed&&d.settled)return r(),null;d.taken=!0,d.current=c,clearTimeout(d.timer),t=null;const u=await d.result;if("error"in u)throw u.error;try{if(!c())throw new Error("media-send-retired");const g=await e.adoptMediaJob?.(d.id);if(!c())throw new Error("media-send-retired");return!g?.ok||!g.value?(await a(d.id),null):u.value}catch(g){throw await a(d.id),g}}return{warm:s,take:o,cancel:r}}function hs(e={}){const t=a=>cn(a,typeof e=="function"?e():e),n=a=>vn(t(a));return{actionHints:{get capture(){return{label:h.dock_composer_screenshotAction_label(),shortcut:t("dock.capture")}},get record(){return{label:h.ui_shortcuts_dockRecord_label(),shortcut:t("dock.record")}},get dictate(){return{label:h.dock_shortcut_dictate_label()}}},get capture(){return h.dock_composer_capture_tooltip({shortcut:n("dock.capture")})},captureMode:{get window(){return h.dock_composer_captureWindow_tooltip({shortcut:n("dock.capture")})},get region(){return h.dock_composer_captureRegion_tooltip({shortcut:n("dock.capture")})}},captureModes:{fullscreen:h.dock_composer_captureFullscreen_label(),window:h.dock_composer_captureWindow_label(),region:h.dock_composer_captureRegion_label()},captureOptions:h.dock_composer_captureModes_ariaLabel(),captureLimit:h.dock_composer_captureLimit_tooltip(),clipLimit:h.dock_composer_clipLimit_tooltip({limit:H(ae.clips)}),get record(){return h.dock_composer_record_tooltip({shortcut:n("dock.record")})},stopRecording:h.dock_composer_stopRecording_tooltip(),annotationTools:h.annotation_toolbar_ariaLabel(),annotateCurrent:a=>h.dock_composer_annotate_ariaLabel({tool:a}),tools:{pick:h.dock_composer_pick_label(),box:h.dock_composer_box_label(),pen:h.dock_composer_pen_label(),arrow:h.annotation_arrow_label()},get dictate(){return h.dock_shortcut_dictate_label()},stopDictating:h.dock_composer_stopDictating_tooltip(),annotating:h.dock_composer_annotating_status(),recording:h.dock_composer_recording_status(),markUp:h.dock_composer_markUp_label(),remove:h.chat_contextChip_remove_label(),play:h.dock_composer_play_label(),edit:h.dock_composer_edit_label(),done:h.dock_composer_done_label(),attachments:h.context_attachments_title_label(),retry:h.chat_shared_retry_label(),attachmentPending:h.dock_composer_attachmentPending_status(),attachmentFailed:h.dock_composer_attachmentFailed_error(),image:a=>h.dock_composer_image_ariaLabel({n:H(a)}),clip:a=>h.dock_composer_clip_ariaLabel({duration:a}),recordingReference:(a,r)=>r?h.dock_composer_recordingEnd_chip({n:H(a)}):h.dock_composer_recordingStart_chip({n:H(a)}),speechError:a=>a.includes("permission")?h.dock_composer_speechPermission_error():["unsupported-platform","helper-missing","recognizer-unavailable","locale-unsupported","assets-unavailable","unavailable"].includes(a)?h.dock_composer_speechUnavailable_error():h.dock_composer_speechFailed_error()}}function gs(e,t){return{enabled:e,limit:ae.files,excludedIds:t,unavailableMessage:h.dock_composer_filesUnavailable_error(),limitMessage:h.dock_composer_fileLimit_error({limit:H(ae.files)})}}function Ea(e){try{return new URL(e.pageUrl).hostname||e.pageUrl}catch{return e.pageUrl}}function ys(e,t){return e.targetAgentId===t}function ws(e){const t=e.element,n=e.viewport,a=Ea(e),r=t?`<${t.tagName.toLowerCase()}> · ${a}`:e.title||a,s=["<browser-element-capture>",`Page URL: ${e.pageUrl}`,`Page title: ${e.title}`,...t?[`DOM path: ${t.domPath}`,`CSS selector: ${t.selector}`,`Text snippet: ${t.textSnippet}`,...t.sourceRef?[`Source ref: ${t.sourceRef}`]:[],...n?[`Viewport: ${n.width}×${n.height}`]:[],`Element bounds: ${t.rect.width}×${t.rect.height} at (${t.rect.x}, ${t.rect.y})`]:[],"</browser-element-capture>"].join(`
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CaTfcRGE.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BbhtQrkZ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/CnpTi_2q.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/uvhZkGDU.js","/app/immutable/chunks/D4ytz2EC.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/CjGXnvXd.js"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"./CLAmm_T1.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const v=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function E(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){v.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./CaTfcRGE.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url);if(await n(t,{preserveFocus:!0,background:e.assistantContent===!0,agentId:e.assistantAgentId})){if(e.assistantContent)return;const{openPanel:o}=await i(async()=>{const{openPanel:a}=await import("./B9vHutcJ.js").then(r=>r.Jf);return{openPanel:a}},__vite__mapDeps([3,4,2,5,6,7,8,1,9,10,11]),import.meta.url),{store:f}=await i(async()=>{const{store:a}=await import("./D4ytz2EC.js");return{store:a}},__vite__mapDeps([44,3,4,2,5,6,7,8,1,9,10,11,45,46]),import.meta.url);f.dispatch(o("chief"));const{goto:p}=await i(async()=>{const{goto:a}=await import("./CjGXnvXd.js").then(r=>r.n);return{goto:a}},__vite__mapDeps([47,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(s(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!s(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(_,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./CjGXnvXd.js").then(o=>o.n);return{goto:n}},__vite__mapDeps([47,2]),import.meta.url);return e.state?u(t,{state:e.state}):u(t)}const b=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:_,isHudWindowRenderer:d,isSettingsRoute:s,navigateToRoute:E},Symbol.toStringTag,{value:"Module"}));export{_ as S,s as a,y as b,l as c,h as d,T as e,b as f,d as i,E as n};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CEpPVlB6.js","/app/immutable/chunks/CLAmm_T1.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/B9vHutcJ.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BBFoj-dS.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BwNrQXlF.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BbhtQrkZ.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/TB9r2XJy.js","/app/immutable/chunks/UTM5G-w-.js","/app/immutable/chunks/CcJmuwXr.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/_UjuBCOJ.js","/app/immutable/chunks/WdSh5fl1.js","/app/immutable/chunks/96V4v2iI.js","/app/immutable/chunks/BFgvMDua.js","/app/immutable/chunks/nxtepGjE.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B1CKzIA2.js","/app/immutable/chunks/BwH4Bvte.js","/app/immutable/chunks/CIbfGsF-.js","/app/immutable/chunks/Cu5e4npY.js","/app/immutable/chunks/BbYWP3Ow.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DPttSllj.js","/app/immutable/chunks/CfNIzRu8.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/C2UL5Ler.js","/app/immutable/chunks/BGrimfDs.js","/app/immutable/chunks/aZdb_rCN.js","/app/immutable/chunks/BPQFiQQc.js","/app/immutable/chunks/uvhZkGDU.js","/app/immutable/chunks/D4ytz2EC.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BPcIfv-A.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./CLAmm_T1.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const v=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function E(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){v.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./CEpPVlB6.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url);if(await n(t,{preserveFocus:!0,background:e.assistantContent===!0,agentId:e.assistantAgentId})){if(e.assistantContent)return;const{openPanel:o}=await i(async()=>{const{openPanel:a}=await import("./B9vHutcJ.js").then(r=>r.Jf);return{openPanel:a}},__vite__mapDeps([3,4,2,5,6,7,8,1,9,10,11]),import.meta.url),{store:f}=await i(async()=>{const{store:a}=await import("./D4ytz2EC.js");return{store:a}},__vite__mapDeps([44,3,4,2,5,6,7,8,1,9,10,11,45,46]),import.meta.url);f.dispatch(o("chief"));const{goto:p}=await i(async()=>{const{goto:a}=await import("./BPcIfv-A.js").then(r=>r.n);return{goto:a}},__vite__mapDeps([47,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(s(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!s(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(_,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./BPcIfv-A.js").then(o=>o.n);return{goto:n}},__vite__mapDeps([47,2]),import.meta.url);return e.state?u(t,{state:e.state}):u(t)}const b=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:_,isHudWindowRenderer:d,isSettingsRoute:s,navigateToRoute:E},Symbol.toStringTag,{value:"Module"}));export{_ as S,s as a,y as b,l as c,h as d,T as e,b as f,d as i,E as n};