@intent-hq/web 2.342.8 → 2.342.10
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.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{Dfs3_YYJ.js → 0THIUDHC.js} +1 -1
- package/web/app/immutable/chunks/{CPNo3Wxe.js → 1liB3Nap.js} +1 -1
- package/web/app/immutable/chunks/{Zz2ufh_s.js → 2zBnfhc0.js} +1 -1
- package/web/app/immutable/chunks/{DP9aVWvY.js → 40Nd55Kt.js} +2 -2
- package/web/app/immutable/chunks/{DorrRHA9.js → AQT4HclA.js} +1 -1
- package/web/app/immutable/chunks/{Dm9UWIDS.js → B-a4oBhE.js} +1 -1
- package/web/app/immutable/chunks/{TudrisM3.js → B205Hay6.js} +1 -1
- package/web/app/immutable/chunks/{B_FQfWfg.js → B4BIeyFw.js} +1 -1
- package/web/app/immutable/chunks/{D_cxHEqU.js → B4PJH7D3.js} +12 -12
- package/web/app/immutable/chunks/{Cn2QoVqR.js → B5LF76XB.js} +4 -4
- package/web/app/immutable/chunks/{CEQ56sKb.js → B6xfCcCc.js} +1 -1
- package/web/app/immutable/chunks/{DqyPPCyO.js → B8Xt0Fuy.js} +2 -2
- package/web/app/immutable/chunks/{BYR3hbm1.js → B9vEAveM.js} +1 -1
- package/web/app/immutable/chunks/{CqAUygYd.js → BA1-CV5U.js} +1 -1
- package/web/app/immutable/chunks/{BbiotSng.js → BDbnsjQH.js} +1 -1
- package/web/app/immutable/chunks/{hPM-hpF1.js → BFu_t_Z1.js} +1 -1
- package/web/app/immutable/chunks/{DWfKl2G1.js → BHVIonrt.js} +2 -2
- package/web/app/immutable/chunks/{B82-1O1e.js → BHoNN3Qm.js} +1 -1
- package/web/app/immutable/chunks/{b6oXDh_T.js → BIpRxjYy.js} +3 -3
- package/web/app/immutable/chunks/{ChCEEi91.js → BMp6iFxZ.js} +2 -2
- package/web/app/immutable/chunks/{D1Ne8i3Y.js → BThBX3NU.js} +1 -1
- package/web/app/immutable/chunks/{l0-9ftmB.js → BYYYyD1o.js} +1 -1
- package/web/app/immutable/chunks/{CSVFP6Jt.js → BZEQhOg-.js} +1 -1
- package/web/app/immutable/chunks/{eqoPYRQw.js → BcCszrUD.js} +1 -1
- package/web/app/immutable/chunks/{BI40CZU_.js → BiBUw7Gf.js} +1 -1
- package/web/app/immutable/chunks/{Br4sh5Vb.js → BiK9aV24.js} +1 -1
- package/web/app/immutable/chunks/{3_J6fjhO.js → BkPD62Sm.js} +1 -1
- package/web/app/immutable/chunks/{BGKHyW3m.js → Bm8kqAm8.js} +1 -1
- package/web/app/immutable/chunks/{Crf8zlEl.js → Bpe3qOEk.js} +1 -1
- package/web/app/immutable/chunks/{Pvi3xCgN.js → BrG4kjhA.js} +1 -1
- package/web/app/immutable/chunks/{BlJpnECK.js → Brk0d2Yh.js} +3 -3
- package/web/app/immutable/chunks/{Cnv943xM.js → BtjjO5-R.js} +1 -1
- package/web/app/immutable/chunks/{72kV58Ql.js → BuwsjKxk.js} +2 -2
- package/web/app/immutable/chunks/{DBwzp-5d.js → C-XSTrgb.js} +1 -1
- package/web/app/immutable/chunks/{eHnFo4lI.js → C00CKhUO.js} +1 -1
- package/web/app/immutable/chunks/{BKZOB6N7.js → C2P8j-iW.js} +1 -1
- package/web/app/immutable/chunks/{Cj0F5ihH.js → C3LJZi03.js} +1 -1
- package/web/app/immutable/chunks/{CCguRiXg.js → C5NMlDdz.js} +1 -1
- package/web/app/immutable/chunks/{BYOZsc06.js → CDb_ubYB.js} +1 -1
- package/web/app/immutable/chunks/{8dcwmYMD.js → CE7R4ADw.js} +1 -1
- package/web/app/immutable/chunks/{DTQGk7-p.js → CEMqt0Cp.js} +1 -1
- package/web/app/immutable/chunks/{DE1Y_Mqg.js → CEPeLq3h.js} +1 -1
- package/web/app/immutable/chunks/{CdwWwIxc.js → CHZQwNOP.js} +1 -1
- package/web/app/immutable/chunks/{DdroO4BP.js → CHc_0N7g.js} +1 -1
- package/web/app/immutable/chunks/{B0Eu_1Zr.js → CKdN1cCE.js} +1 -1
- package/web/app/immutable/chunks/{W4n-ioby.js → CNLihcDS.js} +1 -1
- package/web/app/immutable/chunks/{D8kRzVzM.js → CSEhUqXf.js} +3 -3
- package/web/app/immutable/chunks/{BZRAoPBg.js → CUJhxiPI.js} +1 -1
- package/web/app/immutable/chunks/{BKrFdF0K.js → CYKUoAtj.js} +1 -1
- package/web/app/immutable/chunks/{CVnjH67L.js → CZUe-5xr.js} +1 -1
- package/web/app/immutable/chunks/{CxR88OSV.js → C_WCW0pZ.js} +1 -1
- package/web/app/immutable/chunks/{BqUo6Ktu.js → CfQAH0hP.js} +2 -2
- package/web/app/immutable/chunks/{DAy_opbr.js → CfTOHLZX.js} +1 -1
- package/web/app/immutable/chunks/{h1qD8ry7.js → Ch976N_A.js} +1 -1
- package/web/app/immutable/chunks/{762lAjev.js → Chxftzo7.js} +6 -6
- package/web/app/immutable/chunks/{QroQeT1R.js → CjzmJepK.js} +1 -1
- package/web/app/immutable/chunks/{-2bHDplp.js → ClvOrYJK.js} +1 -1
- package/web/app/immutable/chunks/{BM2TfFMT.js → Cm4H7d3F.js} +1 -1
- package/web/app/immutable/chunks/{DARBmEKl.js → CpwTpNAY.js} +1 -1
- package/web/app/immutable/chunks/{hC1Rd2xp.js → CrpuS6Ni.js} +1 -1
- package/web/app/immutable/chunks/{CVoHD481.js → CstEmW17.js} +1 -1
- package/web/app/immutable/chunks/{C_MoDXbz.js → Cz7zkfuI.js} +1 -1
- package/web/app/immutable/chunks/{DUMC5ag4.js → D0uQWC2c.js} +1 -1
- package/web/app/immutable/chunks/{DzBSnte5.js → D3cE9nLc.js} +1 -1
- package/web/app/immutable/chunks/{DCWQ8q2B.js → D5xrBxHO.js} +1 -1
- package/web/app/immutable/chunks/{CqOHERUX.js → D7Bt6CWc.js} +3 -3
- package/web/app/immutable/chunks/{Db-yEKas.js → D8Af3nYK.js} +1 -1
- package/web/app/immutable/chunks/{D6AnRuxJ.js → D8rIse1T.js} +1 -1
- package/web/app/immutable/chunks/{DPULIKQk.js → D9hYtFgK.js} +1 -1
- package/web/app/immutable/chunks/{Bip3iRY7.js → DECca1-5.js} +4 -4
- package/web/app/immutable/chunks/{DdjKmyFb.js → DHwVhbU6.js} +1 -1
- package/web/app/immutable/chunks/{BTRr_gVO.js → DIE2xEGx.js} +4 -4
- package/web/app/immutable/chunks/{BbpzcJJv.js → DIUWL4pO.js} +1 -1
- package/web/app/immutable/chunks/{DbZTkkyC.js → DIUt4wjF.js} +1 -1
- package/web/app/immutable/chunks/{C6ijr8RP.js → DMYklue_.js} +1 -1
- package/web/app/immutable/chunks/{BXtYtFFm.js → DOE93G2F.js} +1 -1
- package/web/app/immutable/chunks/{CEcvV5G3.js → DP3zLz97.js} +1 -1
- package/web/app/immutable/chunks/{C_YySiHw.js → DPHLMXXB.js} +1 -1
- package/web/app/immutable/chunks/{H1fgmcwF.js → DSf7xPiS.js} +1 -1
- package/web/app/immutable/chunks/{DbaSDcEd.js → DTRzEXDv.js} +1 -1
- package/web/app/immutable/chunks/{CbGy5L3Y.js → DUqFUm2r.js} +1 -1
- package/web/app/immutable/chunks/{B87Opa04.js → DW-jvC4s.js} +1 -1
- package/web/app/immutable/chunks/{DSWsYH8C.js → DW7TAOpx.js} +1 -1
- package/web/app/immutable/chunks/{DksiAt8J.js → DY6rFXPh.js} +1 -1
- package/web/app/immutable/chunks/{m-4S75UZ.js → DYJfIIFo.js} +1 -1
- package/web/app/immutable/chunks/{CK9cQMVJ.js → DZ48MMZ5.js} +1 -1
- package/web/app/immutable/chunks/{CwkZa8IK.js → DZr9s6Pw.js} +1 -1
- package/web/app/immutable/chunks/{C62uwcSa.js → DaUHNiCF.js} +1 -1
- package/web/app/immutable/chunks/{B5QVp6A0.js → DbiEyP6R.js} +1 -1
- package/web/app/immutable/chunks/{DQJZrn_X.js → DbknkG4W.js} +1 -1
- package/web/app/immutable/chunks/{DODWySkx.js → DbyXyasD.js} +1 -1
- package/web/app/immutable/chunks/{DKyOFl-H.js → DfsGU3Wn.js} +1 -1
- package/web/app/immutable/chunks/{DiLL3u8G.js → DjCL1Hxh.js} +1 -1
- package/web/app/immutable/chunks/{BAr6DP2S.js → DnpDtYbO.js} +1 -1
- package/web/app/immutable/chunks/{NAs2sQwc.js → DqzMEdu3.js} +1 -1
- package/web/app/immutable/chunks/{CVimJ6Rz.js → DrcXjKQ_.js} +1 -1
- package/web/app/immutable/chunks/{BHOPo_9A.js → DriTY1JC.js} +1 -1
- package/web/app/immutable/chunks/{ob_UjBCd.js → DspLnLHB.js} +2 -2
- package/web/app/immutable/chunks/{CZ4naQ1D.js → DtvtE_L9.js} +1 -1
- package/web/app/immutable/chunks/{zFLt0HSh.js → DuEP-GLD.js} +1 -1
- package/web/app/immutable/chunks/{B6UkjkkG.js → DuS6s3Hb.js} +1 -1
- package/web/app/immutable/chunks/{DtsUKbfD.js → Duhn8Rxm.js} +1 -1
- package/web/app/immutable/chunks/{BQ-M1wvC.js → DusNPXQF.js} +1 -1
- package/web/app/immutable/chunks/{BVX8qLeE.js → DzG9oS3W.js} +1 -1
- package/web/app/immutable/chunks/{CiJxgZE6.js → EQHtbLJx.js} +1 -1
- package/web/app/immutable/chunks/{TpcWfRK3.js → EceC8-O2.js} +1 -1
- package/web/app/immutable/chunks/{olZe0-nS.js → FEOKRLhr.js} +1 -1
- package/web/app/immutable/chunks/{CsZ8CKOb.js → PKFab1LF.js} +1 -1
- package/web/app/immutable/chunks/{DGLoeWwC.js → Q8jT5C71.js} +1 -1
- package/web/app/immutable/chunks/{D3bgZo3Z.js → U5KHGPBO.js} +2 -2
- package/web/app/immutable/chunks/{teiHBTP_.js → WFmKN8sA.js} +1 -1
- package/web/app/immutable/chunks/{BOhFt8_6.js → YsZHimAl.js} +1 -1
- package/web/app/immutable/chunks/{CfcPGi-s.js → Z5bnli72.js} +3 -3
- package/web/app/immutable/chunks/{CUfXGQXK.js → axgQo8cw.js} +1 -1
- package/web/app/immutable/chunks/{DUfPBqyv.js → bZzmY7dL.js} +1 -1
- package/web/app/immutable/chunks/{8_7J_rxm.js → cjpQKFKe.js} +1 -1
- package/web/app/immutable/chunks/{CVWq5h5S.js → fjwSz6Ls.js} +1 -1
- package/web/app/immutable/chunks/{BhR1rUz4.js → lueIr-rh.js} +4 -4
- package/web/app/immutable/chunks/{Dnnm3rWT.js → o2hG3dk-.js} +1 -1
- package/web/app/immutable/chunks/{0tj_yJAd.js → w4Z-hwiU.js} +1 -1
- package/web/app/immutable/chunks/{CYrZeetF.js → xgz6tLTq.js} +1 -1
- package/web/app/immutable/chunks/{B_gooRw3.js → xmj9VQiT.js} +1 -1
- package/web/app/immutable/chunks/{Db9BDdTM.js → yU2Ozt8f.js} +1 -1
- package/web/app/immutable/chunks/{DZIpsGdM.js → zfpJcV11.js} +1 -1
- package/web/app/immutable/entry/{app.PZ5Y9PBf.js → app.BipGAxSD.js} +2 -2
- package/web/app/immutable/entry/start.Doft0JHv.js +1 -0
- package/web/app/immutable/nodes/{0.NhRN4wpn.js → 0.CRDjU4rX.js} +1 -1
- package/web/app/immutable/nodes/{1.rxmnWftv.js → 1.CREGl2Pt.js} +1 -1
- package/web/app/immutable/nodes/{10.B5uqPVYd.js → 10.CMwz_1nI.js} +1 -1
- package/web/app/immutable/nodes/{14.BNz2Qn0-.js → 14.CV8rtwPq.js} +1 -1
- package/web/app/immutable/nodes/17.BtyZD7Rw.js +3 -0
- package/web/app/immutable/nodes/{2.BewlISWX.js → 2.kIfgDx6U.js} +4 -4
- package/web/app/immutable/nodes/{3.Dh75TGTq.js → 3.Bnf1EqEs.js} +1 -1
- package/web/app/immutable/nodes/{4.D_lzUIO2.js → 4.D_ON5RZE.js} +1 -1
- package/web/app/immutable/nodes/{5.D-mFbexK.js → 5.DJWDqCb3.js} +1 -1
- package/web/app/immutable/nodes/{6.Cgb9LGMD.js → 6.B_DMhjSu.js} +1 -1
- package/web/app/immutable/nodes/{7.CEKTuRJF.js → 7.CrzoTO8s.js} +1 -1
- package/web/app/immutable/nodes/{8.Dwn9d0dT.js → 8.DjCB3qt1.js} +4 -4
- package/web/app/immutable/nodes/{9.JcoFlsdV.js → 9.B4rL513Y.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.BY0gUtqa.js +0 -1
- package/web/app/immutable/nodes/17.DmFoGT2O.js +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/ChkzKl5W.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/pKvpKpo4.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/BnovDLUv.js","/app/immutable/chunks/DlyM6KGr.js","/app/immutable/chunks/i7ZdGAM9.js","/app/immutable/chunks/BhSvFvWk.js","/app/immutable/chunks/l23P2uQD.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/Jt_K3Kpx.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/
|
|
2
|
-
import{Iy as a,nI as I,ny as g,nx as k,m3 as Z,qs as Q,i7 as ee,vg as Fe,jA as He,CY as $e,uN as Be,nP as ve,m6 as te,q2 as Ve,m5 as ze,lK as Ke,aM as le,lU as Je,l_ as Ye,Fw as Xe,CW as Ze,zi as Qe,nN as et,m8 as tt}from"./D5ej8a-y.js";import{b as st,p as rt,F as nt,z as at}from"./DHQOuksI.js";import{aX as V,aT as se,cD as v,cG as ue,co as ot,dr as M,aU as ct,cE as it,dl as lt,o as de,O as ut,dn as dt,c3 as pt,ak as mt,au as ht,ad as ft,bC as St,cA as gt,cY as yt,cm as bt,bD as kt}from"./D3QcPFoL.js";import{x as wt}from"./CRsmjbca.js";import{ah as It,cN as _t,aX as vt,av as Ct,p as At}from"./CqAUygYd.js";import{g as Et}from"./ChkzKl5W.js";import{bp as p,_ as q}from"./DXyyWeag.js";import{i as w}from"./RD9QY1Yc.js";import{I as Rt}from"./DyvrH0mm.js";import{L as P}from"./g8YNVDho.js";import{an as Tt,k as Pt,h as O,ag as Ot,t as Wt}from"./B_FQfWfg.js";import{c as Nt}from"./ChTqQfQN.js";import{w as xt}from"./DEYvT_CO.js";import{r as x}from"./uXuxG9cN.js";import{aN as Mt,O as Lt,R as Dt,x as Ut}from"./hPM-hpF1.js";import{bs as pe,bt as me,ax as Ce}from"./Bfr1QjPr.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";const nr=a.createSelector(e=>e.workspaceShare.open),ar=a.createSelector(e=>e.workspaceShare.workspaceId),or=a.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=a.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),cr=a.createSelector(e=>e.workspaceShare.createRequest),ir=a.createSelector(e=>e.workspaceShare.mutationGeneration),lr=a.createSelector(e=>e.workspaceShare.workspaceTitle),ur=a.createSelector(e=>g(e.workspaceShare.members)),dr=a.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),pr=a.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),mr=a.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),hr=a.createSelector(e=>e.workspaceShare.guestCount),fr=a.createSelector(e=>e.workspaceShare.guestLimit),Sr=a.createSelector(e=>e.workspaceShare.loadStatus==="loading"),gr=a.createSelector(e=>e.workspaceShare.loadError),yr=a.createSelector(e=>e.workspaceShare.creating),br=a.createSelector(e=>e.workspaceShare.createError),kr=a.createSelector(e=>e.workspaceShare.createdLink),wr=a.createSelector(e=>e.workspaceShare.revokingInviteId),Ir=a.createSelector(e=>e.workspaceShare.removingPrincipalId),_r=a.createSelector(e=>e.workspaceShare.addingPrincipalId),vr=a.createSelector(e=>e.workspaceShare.actionError),Cr=a.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Ar=a.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Er=a.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));a.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const Rr=a.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);a.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Tr=a.createSelector(e=>e.workspaceShare.integrationAuth),Pr=a.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=a.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===v.select(e)),jt=a.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Or=a.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),qt=a.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Ft=a.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Wr=a.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&jt.select(e)===null&&Ft.select(e)===null&&!qt.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),Nr=a.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:ot.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),xr=a.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),Mr=a.createSelector(e=>e.workspaceShare.roleErrors),ge=a.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Ht=a.createSelector(e=>{const t=v.select(e),s=st.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Lr=a.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),$t=[],Bt=a.createSelector((e,t)=>{const s=v.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return $t;const n=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(n?g(n).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(n&&i.redeemedByPrincipalId&&k(n,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Dr=a.createSelector(e=>{const s=Ht.select(e).workspaceIds.flatMap(r=>Bt.select(e,r).map(n=>Date.parse(n.expiresAt)));return s.length?Math.min(...s):null});function Ur(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Gr=a.createSelector(e=>e.hostRequirements.git),jr=a.createSelector(e=>e.hostRequirements.node),qr=a.createSelector(e=>e.hostRequirements.gh),Fr=a.createSelector(e=>e.hostRequirements.checking),Hr=a.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Ae(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const $r=a.createSelector(Ae),Br=a.createSelector(e=>e.hostRequirements.node.ok&&(e.hostRequirements.git.available||Ae(e))),Vr=a.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),zr="22.0.0";function Vt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Vt(e.clientId)}function Kr(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:n}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&n!==s)}}const Jr=a.createSelector(e=>e?.browserClients?.ownClientId??null),Yr=a.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);a.createSelector(e=>g(e.browserClients.liveClients));const Xr=a.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);a.createSelector((e,t)=>k(e.browserClients.liveClients,t));const Zr=a.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),Qr=a.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const en=a.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),n=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Et(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:n,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),tn=a.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),n=k(r,s.ownClientId);return n!==void 0&&n.capabilities.browserExec!==!0}),sn=a.createSelector((e,t,s)=>{const r=e?.browserClients??Q,n=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(n,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),rn=a.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),nn=a.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function an(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function on(e){const t=N.get(e);return t?t():null}function cn(e){N.delete(e)}const Ee="From repo config",ln="repo-config";function un(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Re(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function zt(e){let t;try{t=JSON.parse(e)}catch{return null}return Re(t).setupScript}async function dn(e){if(!e)return null;try{const t=await w(Rt.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?zt(s):null}catch{return null}}async function pn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./ChkzKl5W.js").then(c=>c.p);return{appClient: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]),import.meta.url),n=await r.integrations.githubRepoConfig(e,t,s);return Re(n.config).setupScript}catch{return null}}function mn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function hn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Te="setup-scripts:last-used-by-repo",Pe="setup-scripts:recent-by-repo",$=20,Oe=10,Kt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function We(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Kt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Te);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,n]of Object.entries(t))r&&We(n)&&(s[r]=n);return s}catch{return{}}}function Ne(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,n]of Object.entries(t)){if(!r||!Array.isArray(n))continue;const o=n.filter(We);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Jt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function xe(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Me(e){const t=[];for(const s of e)t.some(r=>Jt(r,s))||t.push(s);return t}function fn(e,t){if(!e)return[];const s=ne(e,t),r=Ne()[s]??[],n=B()[s];return Me(xe(n?[...r,n]:r)).slice(0,Oe).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function Yt(e,t,s){try{const r=Ne(),n=r[e]??(s?[s]:[]);r[e]=Me([t,...xe(n)]).slice(0,Oe);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(o)))}catch{}}function Sn(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function gn(e,t,s){const r=t.content.trim();if(!e||!r)return;const n=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};Yt(n,o,B()[n]);try{const c=B();c[n]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Te,JSON.stringify(Object.fromEntries(i)))}catch{}}const Xt={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},yn=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:Xt},Symbol.toStringTag,{value:"Module"})),_={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},Zt={async isAuthenticated(e){try{return await w(_.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(_.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(_.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(_.LOGOUT)},async fetchProjects(e){try{return await w(_.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(_.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(_.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(_.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},bn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:Zt},Symbol.toStringTag,{value:"Module"})),ae=a.createSelector(e=>{const t=v.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=a.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),kn=a.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),wn=a.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),Qt=a.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),In=a.createSelector((e,t)=>{const s=Qt.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),_n="__new-workspace__",vn="__initializer__",Cn="compact-workspace-initializer-state-prompt",An="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function En(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let n=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(n+i>U){o+=1;continue}r.push(c),n+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const es="host.providerAuthStatus";function ts(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function ss(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function rs(e){const{email:t,orgName:s}=e??{};return t&&s?ss(t,s)?t:`${t} · ${s}`:t||s||void 0}function ns(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},n=rs(s.identity);n!==void 0&&(r.authDetails=n),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const as=6e4,E=new Map,G=new Map,A=new Map;let F=0,Le=0;const os=e=>JSON.stringify([it.select(a.state),Le,e.workspaceId??null,e.providerId??"*"]);function cs(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of E.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&E.delete(t)}else E.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(cs(e)??"")&&J()});typeof me=="function"&&me(()=>{Le+=1,J()});function is(e={}){const t=os(e);if(e.force)J(e.providerId);else{const o=E.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&E.delete(t)}const s=G.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),is({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,n=Ce(es,ts(e)).then(ns).then(o=>(r===F&&E.set(t,{verdicts:o,expiresAt:Date.now()+as}),o)).finally(()=>{G.get(t)?.promise===n&&G.delete(t)});return G.set(t,{generation:r,promise:n}),n}function Rn(e,t=e,s="default",r,n){if(!xt.select(a.state))return;const o=n??rt.select(a.state,t)??nt.select(a.state,t)[0];if(!o)return;const c=at.select(a.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>Fe(m,i));s==="new"&&a.dispatch(He(e)),a.dispatch(l?$e(t,l.id,o):Be(t,i,o,void 0,!0,void 0,!0))}function Tn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ls=a.createSelector((e,t,s)=>{const r=ve(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});a.createSelector((e,t,s)=>{const r=ls.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Pn=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=ve(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(n=>n.context):[],unavailableReason:s.unavailableReason}}),On=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Wn=a.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===v.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Nn=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),xn=a.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),us=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function ds(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ps(e){const t=new Set(us);return ds(e).some(s=>t.has(s))}const ms=new Set(["lastActivity","statusMessage","statusImageAssetId"]),hs=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function gs(e){const t=Ss(e);return!t||ps(t)?!1:!fs(t).some(s=>hs.has(s))}function ys(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>ms.has(r))}function h(e){return typeof e=="string"?e.trim():""}function R(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function be(e){const t=R(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function bs(e){const t=R(e.data),s={workspaceId:e.workspaceId,closable:!0},r=n=>n?{...s,type:"note",noteId:n,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const n=h(t.agentId)||h(e.sessionId);return n?{...s,type:"agent",agentId:n,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const n=h(t.path)||h(t.relativePath);return n&&t.action!=="delete"?{...s,type:"file",filePath:n,title:n.split(/[\\/]/).pop()||n}:null}case"git:commit":{const n=h(t.commit),o=h(t.gitRootId);return n?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:n,...o?{gitRootId:o}:{}}}:null}default:return null}}function ke(e,t){const s=R(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),n=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return n(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?n(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return gs(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?n(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?n(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return n(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return n(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return n(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(ys(e))return null;const c=R(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return n(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function ks(e,t,s,r){const n=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=R(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=be(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=R(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const qe=S?h(f.messageId):"",T=S?be(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?n.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=ke(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):ke(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:bs(u),messageId:qe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const Mn=a.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Ln=a.createSelector(e=>e.workspaceEvents.subscriptionGeneration),ws=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Dn=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),Un=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Gn=a.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),jn=a.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),De=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),qn=a.createSelector((e,t)=>Object.values(De.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Fn=a.createSelector((e,t,s)=>{const r=ws.select(e,t),o=ks(t,r,_t.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=De.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})}),Hn=a.createSelector((e,t)=>{const s=[],r=new Set,n=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(n.has(l))return;n.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[Ve(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),Is=a.createSelector((e,t)=>e.context.byWorkspaceId[t]??ze),_s=a.createSelector((e,t)=>g(Is.select(e,t).items)),$n=a.createSelector((e,t)=>_s.select(e,t).filter(s=>!s.parentNoteId)),Bn=a.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??Ue),Vn=a.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??Ue),Ue={},zn=a.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=a.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),Kn=a.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),Jn=a.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function we(e){return e.title||`PR #${e.number}`}const oe=a.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function vs(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Cs(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const Yn=a.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Cs);return s?[vs(s),...r]:r}),Xn=a.createSelector((e,t)=>oe.select(e,t).length>0),Zn=a.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),As=a.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Ke).operations,s)),Qn=a.createSelector((e,t,s)=>As.select(e,t,s)?.status==="running"),ea=a.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ta=a.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(n=>n.status===le.Open||n.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),sa=a.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ra=a.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),n=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=vt(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),we,o),yt.select(e,t),o,oe.select(e,t),we).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Mt.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:n.hasRemote,clearReset:n.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(n.mergeHeadSha&&r[0]?.hash&&n.mergeHeadSha!==r[0].hash)}}),na=a.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Je),Es=a.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Ye);a.createSelector((e,t,s)=>Es.select(e,t).operations[s]);const aa=a.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),oa=a.createSelector(e=>e.noteReadTracking.readRecords),Rs="host.providerTestPrompt",Ts=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),Ps=3e5;async function ca(e){const t=await Ce(Rs,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:Ps}),s=Ts.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Os=-1,Ws=/^remote-script-lost:\s*/,Ns=["idle","starting","running","restarting","exited"],Ie=e=>!!e&&typeof e=="object"&&!Array.isArray(e),_e=e=>typeof e=="string"&&e.trim().length>0;function xs(e){return Ie(e)&&_e(e.remoteAgentId)&&_e(e.nodeId)&&Ie(e.runtime)&&Ns.includes(e.runtime.status)}function ia(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(xs):[]}function la(e,t,s){const r=Lt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const n=t?.nodeId===e.nodeId?t:null;return{...r,name:n?.nodeName?.trim()||r.name,platform:Dt(n?.placement?.os,n?.placement?.arch)}}function Ms(e){return e.status==="exited"&&e.exitCode===Os}function Ls(e){const t=e.error?.trim().replace(Ws,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ua(e){if(Ms(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Ls(e)})};const t=Ut(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const j=e=>typeof e=="string"&&e.length>0,Ds=/\bremote-script-agent-ending:/;function da(e){return!!e&&Ds.test(e)}function pa(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...j(s.machineVersion)?{machineVersion:s.machineVersion}:{},...j(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return j(c.route)&&j(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ma(e){const s=e.filter(n=>n.runtime.status==="running"&&n.runtime.detectedUrl?.trim()).sort((n,o)=>(o.runtime.startedAt??"").localeCompare(n.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Us={status:"idle",error:null},Gs=a.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Us);a.createSelector((e,t)=>Gs.select(e,t).error);const ha=a.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),je=a.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),js=e=>e==="hydrated"||e==="live",fa=a.createSelector((e,t)=>{const s=je.select(e,t);return s==="hydrated"||s==="live"}),Sa=a.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>js(t[s]))}),ga=a.createSelector((e,t)=>je.select(e,t)==="live");function ya(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:n}=e;if(t&&!(!r&&t===s))return n(Xe({providerId:t,enabled:!0})),n(Ze(t)),n(Qe()),t}function ba(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const n=[];if(n.push(`[${s.identifier}] ${s.title}`),s.url&&n.push(`URL: ${s.url}`),s.description&&n.push(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/ChkzKl5W.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/pKvpKpo4.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/BnovDLUv.js","/app/immutable/chunks/DlyM6KGr.js","/app/immutable/chunks/i7ZdGAM9.js","/app/immutable/chunks/BhSvFvWk.js","/app/immutable/chunks/l23P2uQD.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/Jt_K3Kpx.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/C5NMlDdz.js","/app/immutable/chunks/BFu_t_Z1.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/D3QcPFoL.js","/app/immutable/chunks/RD9QY1Yc.js","/app/immutable/chunks/CRsmjbca.js","/app/immutable/chunks/DHQOuksI.js","/app/immutable/chunks/40Nd55Kt.js","/app/immutable/chunks/BiBUw7Gf.js","/app/immutable/chunks/B4BIeyFw.js","/app/immutable/chunks/BA1-CV5U.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Iy as a,nI as I,ny as g,nx as k,m3 as Z,qs as Q,i7 as ee,vg as Fe,jA as He,CY as $e,uN as Be,nP as ve,m6 as te,q2 as Ve,m5 as ze,lK as Ke,aM as le,lU as Je,l_ as Ye,Fw as Xe,CW as Ze,zi as Qe,nN as et,m8 as tt}from"./D5ej8a-y.js";import{b as st,p as rt,F as nt,z as at}from"./DHQOuksI.js";import{aX as V,aT as se,cD as v,cG as ue,co as ot,dr as M,aU as ct,cE as it,dl as lt,o as de,O as ut,dn as dt,c3 as pt,ak as mt,au as ht,ad as ft,bC as St,cA as gt,cY as yt,cm as bt,bD as kt}from"./D3QcPFoL.js";import{x as wt}from"./CRsmjbca.js";import{ah as It,cN as _t,aX as vt,av as Ct,p as At}from"./BA1-CV5U.js";import{g as Et}from"./ChkzKl5W.js";import{bp as p,_ as q}from"./DXyyWeag.js";import{i as w}from"./RD9QY1Yc.js";import{I as Rt}from"./DyvrH0mm.js";import{L as P}from"./g8YNVDho.js";import{an as Tt,k as Pt,h as O,ag as Ot,t as Wt}from"./B4BIeyFw.js";import{c as Nt}from"./ChTqQfQN.js";import{w as xt}from"./DEYvT_CO.js";import{r as x}from"./uXuxG9cN.js";import{aN as Mt,O as Lt,R as Dt,x as Ut}from"./BFu_t_Z1.js";import{bs as pe,bt as me,ax as Ce}from"./Bfr1QjPr.js";import{d as Gt,o as he,l as fe,s as Se}from"./CIyUrgF0.js";const nr=a.createSelector(e=>e.workspaceShare.open),ar=a.createSelector(e=>e.workspaceShare.workspaceId),or=a.createSelector(e=>{const{open:t,workspaceId:s,session:r}=e.workspaceShare;return t&&s?{workspaceId:s,session:r}:null}),re=a.createSelector(e=>{const{open:t,workspaceId:s,withheld:r}=e.workspaceShare;return!t||!s||r||I(e.workspaceShare,s).inviteWithheld?!1:V.select(e,s)}),cr=a.createSelector(e=>e.workspaceShare.createRequest),ir=a.createSelector(e=>e.workspaceShare.mutationGeneration),lr=a.createSelector(e=>e.workspaceShare.workspaceTitle),ur=a.createSelector(e=>g(e.workspaceShare.members)),dr=a.createSelector((e,t)=>k(e.workspaceShare.members,t)!==void 0),pr=a.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!I(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),mr=a.createSelector(e=>{const{principals:t,members:s}=e.workspaceShare;return g(t).filter(r=>!k(s,r.principalId)&&(r.hostRole===void 0||r.hostRole==="guest"))}),hr=a.createSelector(e=>e.workspaceShare.guestCount),fr=a.createSelector(e=>e.workspaceShare.guestLimit),Sr=a.createSelector(e=>e.workspaceShare.loadStatus==="loading"),gr=a.createSelector(e=>e.workspaceShare.loadError),yr=a.createSelector(e=>e.workspaceShare.creating),br=a.createSelector(e=>e.workspaceShare.createError),kr=a.createSelector(e=>e.workspaceShare.createdLink),wr=a.createSelector(e=>e.workspaceShare.revokingInviteId),Ir=a.createSelector(e=>e.workspaceShare.removingPrincipalId),_r=a.createSelector(e=>e.workspaceShare.addingPrincipalId),vr=a.createSelector(e=>e.workspaceShare.actionError),Cr=a.createSelector((e,t)=>I(e.workspaceShare,t).loadStatus!=="idle"),Ar=a.createSelector((e,t)=>t?g(I(e.workspaceShare,t).members):[]),Er=a.createSelector((e,t)=>!!t&&!I(e.workspaceShare,t).withheld&&V.select(e,t));a.createSelector((e,t)=>!!t&&I(e.workspaceShare,t).withheld);const Rr=a.createSelector((e,t)=>t?I(e.workspaceShare,t).removingPrincipalId:null);a.createSelector((e,t)=>t?I(e.workspaceShare,t).removeError:null);const Tr=a.createSelector(e=>e.workspaceShare.integrationAuth),Pr=a.createSelector(e=>e.workspaceShare.ownerForgeMissing),z=a.createSelector(e=>re.select(e)&&se.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===v.select(e)),jt=a.createSelector(e=>z.select(e)?e.workspaceShare.sharingEnabled:null),Or=a.createSelector(e=>z.select(e)&&e.workspaceShare.sharingChecking),qt=a.createSelector(e=>z.select(e)&&e.workspaceShare.sharingEnabling),Ft=a.createSelector(e=>z.select(e)?e.workspaceShare.sharingError:null),Wr=a.createSelector(e=>{if(!re.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||se.select(e)&&jt.select(e)===null&&Ft.select(e)===null&&!qt.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),Nr=a.createSelector(e=>re.select(e)&&!!e.workspaceShare.workspaceId&&(se.select(e)||(ge.select(e)?ge.select(e)===ue.select(e)?.principal.id:ot.select(e,e.workspaceShare.workspaceId)))&&ue.select(e)?.capabilities.workspaceGuestRoles===!0),xr=a.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),Mr=a.createSelector(e=>e.workspaceShare.roleErrors),ge=a.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?M.select(e,t)?.ownerPrincipalId??null:null}),Ht=a.createSelector(e=>{const t=v.select(e),s=st.select(e);return{context:t,workspaceIds:t?s.filter(r=>V.select(e,r)):[]}}),Lr=a.createSelector((e,t)=>{const s=I(e.workspaceShare,t);return{context:s.inviteContext,generation:s.inviteGeneration,withheld:s.inviteWithheld}}),$t=[],Bt=a.createSelector((e,t)=>{const s=v.select(e),r=I(e.workspaceShare,t);if(!s||r.inviteContext!==s||r.inviteWithheld||!V.select(e,t))return $t;const n=e.presence?.context===s?e.presence.members[t]:void 0,o=new Set(n?g(n).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>r.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(n&&i.redeemedByPrincipalId&&k(n,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),Dr=a.createSelector(e=>{const s=Ht.select(e).workspaceIds.flatMap(r=>Bt.select(e,r).map(n=>Date.parse(n.expiresAt)));return s.length?Math.min(...s):null});function Ur(e){return Object.entries(e).some(([t,s])=>s.available&&wt(t,s.authenticated))}const Gr=a.createSelector(e=>e.hostRequirements.git),jr=a.createSelector(e=>e.hostRequirements.node),qr=a.createSelector(e=>e.hostRequirements.gh),Fr=a.createSelector(e=>e.hostRequirements.checking),Hr=a.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Ae(e){const t=e.gitlabAuth?.statusFailed===!0;return It({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const $r=a.createSelector(Ae),Br=a.createSelector(e=>e.hostRequirements.node.ok&&(e.hostRequirements.git.available||Ae(e))),Vr=a.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),zr="22.0.0";function Vt(e){return e.length>15?`${e.slice(0,15)}…`:e}function H(e){return e.name?.trim()||Vt(e.clientId)}function Kr(e){const{eligibleClients:t,ownClientId:s,driving:r,pinnedClientId:n}=e,o=t.find(l=>l.clientId===s&&l.connected),c=r!==null&&!r.connected,i=!r||r.clientId===s;return{mode:c?"offline":i?"here":"elsewhere",hostName:r?H(r):o?H(o):"",canSwitchHere:!!(o&&n!==s)}}const Jr=a.createSelector(e=>e?.browserClients?.ownClientId??null),Yr=a.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);a.createSelector(e=>g(e.browserClients.liveClients));const Xr=a.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);a.createSelector((e,t)=>k(e.browserClients.liveClients,t));const Zr=a.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).browserClient),Qr=a.createSelector((e,t)=>{const s=e?.browserClients?.byWorkspaceId[t];return s?.pinnedClientId!==void 0||s?.browserClient!=null});function X(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const en=a.createSelector((e,t)=>{const s=e?.browserClients??Q,r=s.byWorkspaceId[t]?.liveClients??ee(),n=g(r).filter(y=>y.capabilities.browserExec===!0).map(X),o=(s.byWorkspaceId[t]??Z).browserClient,c=s.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Et(o):void 0;let m=null;if(o?.resolved){const y=k(r,o.resolved.clientId);m=y?X(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:n,ownClientId:s.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),tn=a.createSelector((e,t)=>{const s=e?.browserClients??Q;if(!s.ownClientId||!s.ownClientIdConfirmed)return!1;const r=s.byWorkspaceId[t]?.liveClients??ee(),n=k(r,s.ownClientId);return n!==void 0&&n.capabilities.browserExec!==!0}),sn=a.createSelector((e,t,s)=>{const r=e?.browserClients??Q,n=s?r.byWorkspaceId[s]?.liveClients??ee():r.liveClients,o=s?r.byWorkspaceId[s]?.liveClientsLoaded:r.liveClientsLoaded,c=k(n,t);return c?{name:H(X(c)),connected:!0}:{name:H({clientId:t}),connected:!o}}),rn=a.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??Z).tabsRevision),nn=a.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),N=new Map;function an(e,t){return N.set(e,t),()=>{N.get(e)===t&&N.delete(e)}}async function on(e){const t=N.get(e);return t?t():null}function cn(e){N.delete(e)}const Ee="From repo config",ln="repo-config";function un(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Re(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function zt(e){let t;try{t=JSON.parse(e)}catch{return null}return Re(t).setupScript}async function dn(e){if(!e)return null;try{const t=await w(Rt.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),s=t?.success?t.data?.content:null;return typeof s=="string"?zt(s):null}catch{return null}}async function pn(e,t,s){if(!e||!t)return null;try{const{appClient:r}=await q(async()=>{const{appClient:o}=await import("./ChkzKl5W.js").then(c=>c.p);return{appClient: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]),import.meta.url),n=await r.integrations.githubRepoConfig(e,t,s);return Re(n.config).setupScript}catch{return null}}function mn(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===Ee&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function hn(e){const{repoConfigScript:t,lastUsed:s,genericTemplate:r}=e;return t?{content:t,name:Ee,source:"repo-config"}:s?{content:s.content,name:s.nameSource==="repo-config"?"Custom":s.name,source:s.nameSource==="repo-config"?"custom":s.nameSource??"named"}:r?{content:r.content,name:r.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const Te="setup-scripts:last-used-by-repo",Pe="setup-scripts:recent-by-repo",$=20,Oe=10,Kt=["repo-config","custom","named"];function ne(e,t){return t?`${e}\0${t}`:e}function We(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Kt.includes(t.nameSource))}function B(){try{const e=localStorage.getItem(Te);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,n]of Object.entries(t))r&&We(n)&&(s[r]=n);return s}catch{return{}}}function Ne(){try{const e=localStorage.getItem(Pe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const s={};for(const[r,n]of Object.entries(t)){if(!r||!Array.isArray(n))continue;const o=n.filter(We);o.length>0&&(s[r]=o)}return s}catch{return{}}}function Jt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function xe(e){return[...e].sort((t,s)=>s.usedAt.localeCompare(t.usedAt))}function Me(e){const t=[];for(const s of e)t.some(r=>Jt(r,s))||t.push(s);return t}function fn(e,t){if(!e)return[];const s=ne(e,t),r=Ne()[s]??[],n=B()[s];return Me(xe(n?[...r,n]:r)).slice(0,Oe).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function Yt(e,t,s){try{const r=Ne(),n=r[e]??(s?[s]:[]);r[e]=Me([t,...xe(n)]).slice(0,Oe);const o=Object.entries(r);o.length>$&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=$),localStorage.setItem(Pe,JSON.stringify(Object.fromEntries(o)))}catch{}}function Sn(e,t){if(!e)return;const s=B()[ne(e,t)];return s?{name:s.name,content:s.content,nameSource:s.nameSource??"named"}:void 0}function gn(e,t,s){const r=t.content.trim();if(!e||!r)return;const n=ne(e,s),o={name:t.name,content:r,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};Yt(n,o,B()[n]);try{const c=B();c[n]=o;const i=Object.entries(c);i.length>$&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=$),localStorage.setItem(Te,JSON.stringify(Object.fromEntries(i)))}catch{}}const Xt={async isAuthenticated(e){try{return await w(P.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await w(P.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await w(P.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await w(P.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await w(P.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},yn=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:Xt},Symbol.toStringTag,{value:"Module"})),_={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},Zt={async isAuthenticated(e){try{return await w(_.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await w(_.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await w(_.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await w(_.LOGOUT)},async fetchProjects(e){try{return await w(_.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await w(_.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,s){try{return await w(_.SEARCH_ISSUES,{query:e,project:t,...s})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await w(_.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},bn=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:Zt},Symbol.toStringTag,{value:"Module"})),ae=a.createSelector(e=>{const t=v.select(e);return!t||!ct.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),K=a.createSelector((e,t)=>k(e.repositoryCheckout.forms,t)??null),kn=a.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.projects):[]}),wn=a.createSelector((e,t)=>{const s=K.select(e,t);return s?.admission===ae.select(e)&&s.status==="ready"?g(s.branches):[]}),Qt=a.createSelector((e,t)=>{const s=K.select(e,t);return!s||s.status!=="ready"||s.admission!==ae.select(e)||!s.capture||!s.project||!s.branch?null:{checkoutId:s.capture.checkoutId,revision:s.capture.revision,projectPath:s.project.projectPath,branch:s.branch.name,commitSha:s.branch.commitSha,mode:s.mode}}),In=a.createSelector((e,t)=>{const s=Qt.select(e,t);return!!s&&(s.mode==="direct"||K.select(e,t)?.warmStatus==="ready")}),_n="__new-workspace__",vn="__initializer__",Cn="compact-workspace-initializer-state-prompt",An="onboarding-prompt",U=20*1024*1024,ye=Nt("NewWorkspaceDraft");function En(e,t){if(e.length>U)return ye.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:U}),null;const s=Tt(t);if(s.length===0)return{text:e};const r=[];let n=e.length+2,o=0;for(const c of s){const i=JSON.stringify(c).length+1;if(n+i>U){o+=1;continue}r.push(c),n+=i}return o>0&&ye.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:U,attachmentCount:s.length,droppedCount:o}),r.length>0?{text:e,attachments:r}:{text:e}}const es="host.providerAuthStatus";function ts(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function ss(e,t){const s=t.toLowerCase(),r=e.toLowerCase();return s.startsWith(r)?/^(['’]s\s+organization)?$/.test(s.slice(r.length)):!1}function rs(e){const{email:t,orgName:s}=e??{};return t&&s?ss(t,s)?t:`${t} · ${s}`:t||s||void 0}function ns(e){const t={};for(const s of e?.providers??[]){const r={authenticated:s.authenticated??void 0},n=rs(s.identity);n!==void 0&&(r.authDetails=n),s.identity?.email&&(r.email=s.identity.email),t[s.id]=r}return t}const as=6e4,E=new Map,G=new Map,A=new Map;let F=0,Le=0;const os=e=>JSON.stringify([it.select(a.state),Le,e.workspaceId??null,e.providerId??"*"]);function cs(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,r=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof r=="string"?r:void 0}function J(e){if(F+=1,e)for(const t of E.keys()){const[,,,s]=JSON.parse(t);(s===e||s==="*")&&E.delete(t)}else E.clear()}typeof pe=="function"&&pe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(cs(e)??"")&&J()});typeof me=="function"&&me(()=>{Le+=1,J()});function is(e={}){const t=os(e);if(e.force)J(e.providerId);else{const o=E.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&E.delete(t)}const s=G.get(t);if(!e.force&&s?.generation===F)return s.promise;if(s){const o=A.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=s.promise.catch(()=>({})).then(()=>(A.get(t)===c&&A.delete(t),is({...e,force:c.force}))).finally(()=>{A.get(t)===c&&A.delete(t)});return c={force:e.force===!0,promise:i},A.set(t,c),i}const r=F,n=Ce(es,ts(e)).then(ns).then(o=>(r===F&&E.set(t,{verdicts:o,expiresAt:Date.now()+as}),o)).finally(()=>{G.get(t)?.promise===n&&G.delete(t)});return G.set(t,{generation:r,promise:n}),n}function Rn(e,t=e,s="default",r,n){if(!xt.select(a.state))return;const o=n??rt.select(a.state,t)??nt.select(a.state,t)[0];if(!o)return;const c=at.select(a.state,t,o),i={type:"discussion",title:r??(s==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:s}},l=c?.tabs.find(m=>Fe(m,i));s==="new"&&a.dispatch(He(e)),a.dispatch(l?$e(t,l.id,o):Be(t,i,o,void 0,!0,void 0,!0))}function Tn(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(r=>r.principalId!==t).map(r=>r.displayName||r.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const ls=a.createSelector((e,t,s)=>{const r=ve(e.repositoryContext,t);return s!==null&&r.binding===s?r:null});a.createSelector((e,t,s)=>{const r=ls.select(e,t.workspaceId,s);return r?.status==="ready"?k(r.roots,x(t))?.context:void 0});const Pn=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=ve(e.repositoryContext,t.workspaceId),r=s.ownership;return!r||r.demandId!==t.demandId||r.admission!==t.admission||r.request.workspaceId!==t.workspaceId?null:{status:s.status,scope:s.scope,revision:s.revision,roots:s.status==="ready"?g(s.roots).map(n=>n.context):[],unavailableReason:s.unavailableReason}}),On=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission)return null;const s=e.repositoryContext.selectionEdits,r=s?k(s,t.editId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&x(r.owner.root)===x(t.root)?r:null}),Wn=a.createSelector((e,t)=>{const s=e.repositoryContext.selectionEdits;return!!s&&g(s).some(r=>r.owner.root.workspaceId===t&&r.owner.admission===v.select(e)&&(r.status==="capturing"||r.status==="pending"&&(!r.observation||r.observation.attempt?.status==="pending")))}),Nn=a.createSelector((e,t)=>{if(t.admission===null||v.select(e)!==t.admission||t.hostContext===null||lt.select(e,t.root.workspaceId)!==t.hostContext)return null;const s=e.repositoryContext.nativeReviewAttempts,r=s?k(s,t.attemptId):void 0;return r&&r.status!=="closed"&&r.owner.admission===t.admission&&r.owner.hostContext===t.hostContext&&x(r.owner.root)===x(t.root)?r:null}),xn=a.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?k(e.repositoryContext.nativeReviewAttempts,t):void 0),us=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function ds(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function ps(e){const t=new Set(us);return ds(e).some(s=>t.has(s))}const ms=new Set(["lastActivity","statusMessage","statusImageAssetId"]),hs=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function fs(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Ss(e){if(!e.type.startsWith("file:"))return null;const t=e.data,s=t?.relativePath??t?.path??t?.filePath;return typeof s=="string"&&s.length>0?s:null}function gs(e){const t=Ss(e);return!t||ps(t)?!1:!fs(t).some(s=>hs.has(s))}function ys(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const s=Object.keys(t.changes).filter(r=>r!=="workspaceId");return s.length>0&&s.every(r=>ms.has(r))}function h(e){return typeof e=="string"?e.trim():""}function R(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function be(e){const t=R(e.data),s=h(t.agentId)||h(e.sessionId),r=h(t.messageId);return s&&r?JSON.stringify([s,r]):""}function bs(e){const t=R(e.data),s={workspaceId:e.workspaceId,closable:!0},r=n=>n?{...s,type:"note",noteId:n,title:h(t.title)||h(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return r(h(t.noteId));case"task:status-changed":return r(h(t.noteId)||h(t.linkedNoteId));case"spec:updated":case"goal:updated":return r("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const n=h(t.agentId)||h(e.sessionId);return n?{...s,type:"agent",agentId:n,title:h(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const n=h(t.path)||h(t.relativePath);return n&&t.action!=="delete"?{...s,type:"file",filePath:n,title:n.split(/[\\/]/).pop()||n}:null}case"git:commit":{const n=h(t.commit),o=h(t.gitRootId);return n?{...s,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:n,...o?{gitRootId:o}:{}}}:null}default:return null}}function ke(e,t){const s=R(e.data),r=Object.fromEntries(Object.entries(s).filter(([,c])=>typeof c=="string")),n=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return O({...e,actor:{...e.actor,name:t},data:r});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return n(O({...e,actor:{...e.actor,name:void 0},data:r}));case"agent:updated":return h(s.modelId)||s.completionReportCleared===!0?n(O({...e,actor:{...e.actor,name:void 0},data:s})):null;case"file:changed":return gs(e)?O({...e,actor:{...e.actor,name:t},data:{path:h(s.path)||h(s.relativePath),action:h(s.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return s.resolved===!1?n(p.events_activity_reopenedCommentThread_label()):s.resolved===!0?n(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=h(s.agentName)||h(s.toAgentName);return n(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return n(O({...e,actor:{...e.actor,name:void 0},data:{taskName:h(s.taskName)||h(s.noteTitle),newStatus:h(s.newStatus)||h(s.status)}}));case"workspace:created":return n(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(ys(e))return null;const c=R(s.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=h(c.title);return n(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function W(e,t){const s=h(e);return s===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(s)?"":s}function ks(e,t,s,r){const n=new Map(s.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=R(u.data),f=de({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=be(u);if(!f||!S||typeof d.lastUserMessage!="string")continue;const b=Pt({id:h(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:f,metadata:d.metadata},r);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!h(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const f=R(u.data),S=u.type==="agent:message",b=S?de({role:f.role==="user"?"user":"system",author:f.author,metadata:f.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&f.role==="user"&&u.actor?.type==="user"&&ut(f.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const qe=S?h(f.messageId):"",T=S?be(u):"";if(T&&i.has(T))continue;const C=h(u.actor?.id),Y=C?n.get(C):void 0,L=b?W(b.displayName,b.principalId??"")||W(b.login,b.principalId??""):W(u.actor.name,C)||W(Y?.displayName,C)||W(Y?.login,C),ce=ke(u,"");if(!ce)continue;if(!L){l.push({row:null,timestamp:d,segment:m});continue}const D=S?o.get(T)??null:null,ie=D?p.workspace_peopleActivity_actorAction_label({name:L,action:D}):ke(u,L);ie&&(c.add(u.id),T&&i.add(T),l.push({timestamp:d,segment:m,row:{id:u.id,name:L,principalId:b?h(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Y?.avatarUrl??null,label:ie,actionLabel:D??ce,continuation:!1,timestamp:u.timestamp,destination:bs(u),messageId:qe||null,messagePreview:D}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const f=l[u-1],S=f?f.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&f?.row?.principalId===d.row.principalId&&f.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const Mn=a.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Ln=a.createSelector(e=>e.workspaceEvents.subscriptionGeneration),ws=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).events),Dn=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).nextToken),Un=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),Gn=a.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),jn=a.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),De=a.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??te).peopleStreams),qn=a.createSelector((e,t)=>Object.values(De.select(e,t)).every(s=>s.initialized&&s.nextToken===null)),Fn=a.createSelector((e,t,s)=>{const r=ws.select(e,t),o=ks(t,r,_t.select(e,t),M.select(e,t)?.ownerPrincipalId)[s-1]?.timestamp,c=De.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=r.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})}),Hn=a.createSelector((e,t)=>{const s=[],r=new Set,n=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!r.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(n.has(l))return;n.add(l)}r.add(i),s.push(c)}};for(const[c,i]of Object.entries(Ot.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of dt.select(e,t)){const i=pt.select(e,c),l=[...mt.select(e,c),...ht.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Wt(u))continue;const d=u.id?i?.[Ve(m.id,u.id)]:void 0,f=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:f.fileName,block:f,agentId:c,messageId:m.id,hydration:d})}}return s}),Is=a.createSelector((e,t)=>e.context.byWorkspaceId[t]??ze),_s=a.createSelector((e,t)=>g(Is.select(e,t).items)),$n=a.createSelector((e,t)=>_s.select(e,t).filter(s=>!s.parentNoteId)),Bn=a.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??Ue),Vn=a.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??Ue),Ue={},zn=a.createSelector((e,t,s)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?k(r,s):void 0}),Ge=a.createSelector((e,t)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?g(s):[]}),Kn=a.createSelector((e,t)=>Ge.select(e,t).some(s=>s.status==="queued"||s.status==="running")),Jn=a.createSelector((e,t)=>Ge.select(e,t).filter(s=>s.operation.kind==="partialCommit"&&(s.status==="queued"||s.status==="running")));function we(e){return e.title||`PR #${e.number}`}const oe=a.createSelector((e,t)=>{const s=e.gitRoots?.byWorkspaceId?.[t];return s?g(s.gitRoots):[]});function vs(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Cs(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const Yn=a.createSelector((e,t)=>{const s=M.select(e,t),r=oe.select(e,t).map(Cs);return s?[vs(s),...r]:r}),Xn=a.createSelector((e,t)=>oe.select(e,t).length>0),Zn=a.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),As=a.createSelector((e,t,s)=>k((e.acceptWorkflow.byWorkspaceId[t]??Ke).operations,s)),Qn=a.createSelector((e,t,s)=>As.select(e,t,s)?.status==="running"),ea=a.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),ta=a.createSelector((e,t)=>{const s=ft.select(e,t)?.hasRemote??!1,r=M.select(e,t)?.pullRequests?.some(n=>n.status===le.Open||n.status===le.Draft)??!1;return{squash:!1,viaPR:s&&r,pushAfter:s,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),sa=a.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ra=a.createSelector((e,t)=>{const s=M.select(e,t),r=St.select(e,t),n=gt.select(e,t),o=s?.repositoryOwner&&s.repositoryName?`${s.repositoryOwner}/${s.repositoryName}`:void 0,c=vt(Ct(s?.pullRequests,s?.activePullRequest,(i,l)=>At(i,s?.repositoryOwner,s?.repositoryName,l),we,o),yt.select(e,t),o,oe.select(e,t),we).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:kt.select(e,t),owner:!bt.select(e,t),authenticated:Mt.select(e),pushedCount:r.filter(i=>i.isPushed).length,hasRemote:n.hasRemote,clearReset:n.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(n.mergeHeadSha&&r[0]?.hash&&n.mergeHeadSha!==r[0].hash)}}),na=a.createSelector((e,t,s)=>e.bgExecutor?.byWorkspaceId[t]?.executors[s]??Je),Es=a.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??Ye);a.createSelector((e,t,s)=>Es.select(e,t).operations[s]);const aa=a.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),oa=a.createSelector(e=>e.noteReadTracking.readRecords),Rs="host.providerTestPrompt",Ts=Gt("ok",[he({ok:fe(!0)}).passthrough(),he({ok:fe(!1),reason:Se().min(1),message:Se()}).passthrough()]),Ps=3e5;async function ca(e){const t=await Ce(Rs,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:Ps}),s=Ts.parse(t);return(s.ok||s.reason==="auth-required")&&J(e.providerId),s}const Os=-1,Ws=/^remote-script-lost:\s*/,Ns=["idle","starting","running","restarting","exited"],Ie=e=>!!e&&typeof e=="object"&&!Array.isArray(e),_e=e=>typeof e=="string"&&e.trim().length>0;function xs(e){return Ie(e)&&_e(e.remoteAgentId)&&_e(e.nodeId)&&Ie(e.runtime)&&Ns.includes(e.runtime.status)}function ia(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(xs):[]}function la(e,t,s){const r=Lt(e.nodeId,s)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(s&&s.id===e.nodeId)return r;const n=t?.nodeId===e.nodeId?t:null;return{...r,name:n?.nodeName?.trim()||r.name,platform:Dt(n?.placement?.os,n?.placement?.arch)}}function Ms(e){return e.status==="exited"&&e.exitCode===Os}function Ls(e){const t=e.error?.trim().replace(Ws,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function ua(e){if(Ms(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Ls(e)})};const t=Ut(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const j=e=>typeof e=="string"&&e.length>0,Ds=/\bremote-script-agent-ending:/;function da(e){return!!e&&Ds.test(e)}function pa(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const s=t,r=e instanceof Error&&e.message?{message:e.message}:{};return s.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:s.update==="backend"?"backend":"machine",...j(s.machineVersion)?{machineVersion:s.machineVersion}:{},...j(s.backendVersion)?{backendVersion:s.backendVersion}:{},...r}:s.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(s.attempts)?s.attempts.flatMap(o=>{const c=o??{};return j(c.route)&&j(c.error)?[{route:c.route,error:c.error}]:[]}):[],...r}:null}function ma(e){const s=e.filter(n=>n.runtime.status==="running"&&n.runtime.detectedUrl?.trim()).sort((n,o)=>(o.runtime.startedAt??"").localeCompare(n.runtime.startedAt??""))[0],r=s?.runtime.detectedUrl?.trim();return!s||!r?null:{scriptId:s.id,name:s.name,url:r}}const Us={status:"idle",error:null},Gs=a.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??Us);a.createSelector((e,t)=>Gs.select(e,t).error);const ha=a.createSelector((e,t)=>k(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),je=a.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),js=e=>e==="hydrated"||e==="live",fa=a.createSelector((e,t)=>{const s=je.select(e,t);return s==="hydrated"||s==="live"}),Sa=a.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(s=>js(t[s]))}),ga=a.createSelector((e,t)=>je.select(e,t)==="live");function ya(e){const{selectedProviderId:t,activeProviderId:s,recommitActive:r,dispatch:n}=e;if(t&&!(!r&&t===s))return n(Xe({providerId:t,enabled:!0})),n(Ze(t)),n(Qe()),t}function ba(e){const t=[];for(const s of e){let r={};if(s.metadata)try{r=JSON.parse(s.metadata)}catch{}const n=[];if(n.push(`[${s.identifier}] ${s.title}`),s.url&&n.push(`URL: ${s.url}`),s.description&&n.push(`
|
|
3
3
|
Description:
|
|
4
4
|
${s.description}`),r.state&&n.push(`Status: ${r.state}`),r.teamName&&n.push(`Team: ${r.teamName}`),r.priority!==void 0){const o=["No priority","Urgent","High","Medium","Low"];n.push(`Priority: ${o[r.priority]||r.priority}`)}r.assignee&&n.push(`Assignee: ${r.assignee}`),t.push({type:s.itemType||"unknown",provider:s.provider,identifier:s.identifier,title:s.title,url:s.url,content:n.join(`
|
|
5
|
-
`),metadata:r})}return t}function ka(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const n=s.id.slice(5);(n.startsWith("/")||/^[A-Za-z]:/.test(n))&&(r=n)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function wa(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:n}=await q(async()=>{const{terminalManager:l}=await import("./BnovDLUv.js").then(m=>m.c);return{terminalManager:l}},__vite__mapDeps([25,3,2,20,21,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,18,19,22,23,24,26,27,28,29,30,31,32,33,34]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await n.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(n){t?.warn("[OnboardingContext] Failed to read terminal buffer:",n)}if(r.type==="script")try{const{selectScriptById:n,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./
|
|
5
|
+
`),metadata:r})}return t}function ka(e){const t=[];for(const s of e){if(s.type!=="file")continue;let r=s.meta?.fullPath||s.meta?.path||"";if(!r&&s.id?.startsWith("file-")){const n=s.id.slice(5);(n.startsWith("/")||/^[A-Za-z]:/.test(n))&&(r=n)}if(!r&&s.uri)if(s.uri.startsWith("devspace://file/"))try{r=decodeURIComponent(s.uri.slice(16))}catch{}else s.uri.startsWith("file:")&&(r=s.uri.slice(5));r||(r=s.label||s.meta?.name||""),t.push({type:"file",path:r,title:s.label})}return t}async function wa(e,t){const s=[];for(const r of e){if(r.type==="terminal")try{const{terminalManager:n}=await q(async()=>{const{terminalManager:l}=await import("./BnovDLUv.js").then(m=>m.c);return{terminalManager:l}},__vite__mapDeps([25,3,2,20,21,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,18,19,22,23,24,26,27,28,29,30,31,32,33,34]),import.meta.url),o=r.meta?.workspaceId||"",c=r.id??"",i=await n.getBufferContent(c,o);i&&s.push({type:"terminal",content:i,title:r.label,metadata:{terminalName:r.label,terminalId:c}})}catch(n){t?.warn("[OnboardingContext] Failed to read terminal buffer:",n)}if(r.type==="script")try{const{selectScriptById:n,selectScriptRuntime:o}=await q(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./C5NMlDdz.js");return{selectScriptById:S,selectScriptRuntime:b}},__vite__mapDeps([35,4,5,3,6,7,8,9,2,10,11,12,36,37,14,15,13,16,17,18,19,38,39,40,41,42,43,44,45,23,32,46,21,20,47,48,24,1,49]),import.meta.url),{readScriptContextOutputLines:c}=await q(async()=>{const{readScriptContextOutputLines:S}=await import("./BiBUw7Gf.js");return{readScriptContextOutputLines:S}},__vite__mapDeps([50,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,51,45,41,32,38,52,36,37,39,40,42,43,44,46,47,48,49,35]),import.meta.url),i=r.meta?.workspaceId||"",l=r.id??"",m=a.state,y=await c(m,i,l),u=n.select(m,i,l),d=o.select(m,i,l);let f=`Script: ${u?.name||r.label}
|
|
6
6
|
`;if(f+=`Command: ${u?.command||"unknown"}
|
|
7
7
|
`,f+=`Status: ${d.status}`,d.exitCode!==null&&d.exitCode!==void 0&&(f+=` (exit code: ${d.exitCode})`),f+=`
|
|
8
8
|
`,d.detectedUrl&&(f+=`URL: ${d.detectedUrl}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as xe}from"./m-4S75UZ.js";import{p as be}from"./B0Eu_1Zr.js";import{b as C,a6 as Ce,W as ae,q as ee,aX as we,B as Te,ay as te,b8 as B,aW as Z,a_ as Le,V as $e,b0 as Ae,Y as Fe,U as _e,aZ as Ne,O as Me,ao as ke,r as Ve}from"./Cn2QoVqR.js";import{p as ze}from"./2gme4FSl.js";import{f as O,o as Q}from"./Br4sh5Vb.js";function De(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function Pe(){return this.eachAfter(De)}function Be(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function We(t,a){for(var l=this,n=[l],s,r,h=-1;l=n.pop();)if(t.call(a,l,++h,this),s=l.children)for(r=s.length-1;r>=0;--r)n.push(s[r]);return this}function Ee(t,a){for(var l=this,n=[l],s=[],r,h,d,f=-1;l=n.pop();)if(s.push(l),r=l.children)for(h=0,d=r.length;h<d;++h)n.push(r[h]);for(;l=s.pop();)t.call(a,l,++f,this);return this}function Re(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function He(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function Ie(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Oe(t){for(var a=this,l=qe(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;t!==l;)n.splice(s,0,t),t=t.parent;return n}function qe(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),s=null;for(t=l.pop(),a=n.pop();t===a;)s=t,t=l.pop(),a=n.pop();return s}function Ge(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Xe(){return Array.from(this)}function Ye(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function je(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ue(){var t=this,a,l=[t],n,s,r;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(s=0,r=n.length;s<r;++s)l.push(n[s]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ke)):a===void 0&&(a=Je);for(var l=new Y(t),n,s=[l],r,h,d,f;n=s.pop();)if((h=a(n.data))&&(f=(h=Array.from(h)).length))for(n.children=h,d=f-1;d>=0;--d)s.push(r=h[d]=new Y(h[d])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(et)}function Ze(){return ne(this).eachBefore(Qe)}function Je(t){return t.children}function Ke(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function et(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}Y.prototype=ne.prototype={constructor:Y,count:Pe,each:Be,eachAfter:Ee,eachBefore:We,find:Re,sum:He,sort:Ie,path:Oe,ancestors:Ge,descendants:Xe,leaves:Ye,links:je,copy:Ze,[Symbol.iterator]:Ue};function tt(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function at(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function oe(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(n-a)/t.value;++d<f;)h=r[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*o}Object.create(Y.prototype);function ce(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(s-l)/t.value;++d<f;)h=r[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*o}var he=(1+Math.sqrt(5))/2;function de(t,a,l,n,s,r){for(var h=[],d=a.children,f,o,u=0,S=0,i=d.length,v,x,g=a.value,p,b,_,$,z,R,N;u<i;){v=s-l,x=r-n;do p=d[S++].value;while(!p&&S<i);for(b=_=p,R=Math.max(x/v,v/x)/(g*t),N=p*p*R,z=Math.max(_/N,N/b);S<i;++S){if(p+=o=d[S].value,o<b&&(b=o),o>_&&(_=o),N=p*p*R,$=Math.max(_/N,N/b),$>z){p-=o;break}z=$}h.push(f={value:p,dice:v<x,children:d.slice(u,S)}),f.dice?oe(f,l,n,s,g?n+=x*p/g:r):ce(f,l,n,g?l+=v*p/g:s,r),g-=p,u=S}return h}var nt=(function t(a){function l(n,s,r,h,d){de(a,n,s,r,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);function lt(){var t=nt,a=!1,l=1,n=1,s=[0],r=q,h=q,d=q,f=q,o=q;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(S),s=[0],a&&i.eachBefore(at),i}function S(i){var v=s[i.depth],x=i.x0+v,g=i.y0+v,p=i.x1-v,b=i.y1-v;p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),i.x0=x,i.y0=g,i.x1=p,i.y1=b,i.children&&(v=s[i.depth+1]=r(i)/2,x+=o(i)-v,g+=h(i)-v,p-=d(i)-v,b-=f(i)-v,p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),t(i,x,g,p,b))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=tt(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(r=typeof i=="function"?i:G(+i),u):r},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),u):h},u.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),u):d},u.paddingBottom=function(i){return arguments.length?(f=typeof i=="function"?i:G(+i),u):f},u.paddingLeft=function(i){return arguments.length?(o=typeof i=="function"?i:G(+i),u):o},u}(function t(a){function l(n,s,r,h,d){if((f=n._squarify)&&f.ratio===a)for(var f,o,u,S,i=-1,v,x=f.length,g=n.value;++i<x;){for(o=f[i],u=o.children,S=o.value=0,v=u.length;S<v;++S)o.value+=u[S].value;o.dice?oe(o,s,r,h,g?r+=(d-r)*o.value/g:d):ce(o,s,r,g?s+=(h-s)*o.value/g:h,d),g-=o.value}else n._squarify=f=de(a,n,s,r,h,d),f.ratio=a}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);var E,ue=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Le,this.getAccTitle=$e,this.setDiagramTitle=Ae,this.getDiagramTitle=Fe,this.getAccDescription=_e,this.setAccDescription=Ne}getNodes(){return this.nodes}getConfig(){const a=Me,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},s=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(r=>{ke(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Ve(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(E,"TreeMapDB"),E);function pe(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const r=l[l.length-1].node;r.children?r.children.push(s):r.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}C(pe,"buildHierarchy");var st=C((t,a)=>{be(t,a);const l=[];for(const r of t.TreemapRows??[])r.$type==="ClassDefStatement"&&a.addClass(r.className??"",r.styleText??"");for(const r of t.TreemapRows??[]){const h=r.item;if(!h)continue;const d=r.indent?parseInt(r.indent):0,f=rt(h),o=h.classSelector?a.getStylesForClass(h.classSelector):[],u=o.length>0?o:void 0,S={level:d,name:f,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(S)}const n=pe(l),s=C((r,h)=>{for(const d of r)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),rt=C(t=>t.name?String(t.name):"","getItemName"),fe={parser:{yy:void 0},parse:C(async t=>{try{const l=await ze("treemap",t);te.debug("Treemap AST:",l);const n=fe.parser?.yy;if(!(n instanceof ue))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");st(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,W=10,X=25,ot=C((t,a,l,n)=>{const s=n.db,r=s.getConfig(),h=r.padding??it,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:o}=ae();if(!f)return;const u=d?30:0,S=we(a),i=r.nodeWidth?r.nodeWidth*W:960,v=r.nodeHeight?r.nodeHeight*W:500,x=i,g=v+u;S.attr("viewBox",`0 0 ${x} ${g}`),Te(S,g,x,r.useMaxWidth);let p;try{const e=r.valueFormat||",";if(e==="$0,0")p=C(c=>"$"+O(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),m=c?c[0]:"";p=C(w=>"$"+O(","+m)(w),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);p=C(m=>"$"+O(c||"")(m),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const b=Q().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),_=Q().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),$=Q().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);d&&S.append("text").attr("x",x/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=S.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ne(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),le=lt().size([i,v]).paddingTop(e=>e.children&&e.children.length>0?X+W:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?W:0).paddingRight(e=>e.children&&e.children.length>0?W:0).paddingBottom(e=>e.children&&e.children.length>0?W:0).round(!0)(R),me=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(me).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>b(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>_(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,c)=>`url(#clip-section-${a}-${c})`).attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=Z(this),m=e.data.name;c.text(m);const w=e.x1-e.x0,L=6;let T;r.showValues!==!1&&e.value?T=w-10-30-10-L:T=w-L-6;const y=Math.max(15,T),M=c.node();if(M.getComputedTextLength()>y){let V=m;for(;V.length>0;){if(V=m.substring(0,V.length-1),V.length===0){c.text("..."),M.getComputedTextLength()>y&&c.text("");break}if(c.text(V+"..."),M.getComputedTextLength()<=y)break}}}),r.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")});const se=le.leaves(),A=se.length>20,ge=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,re=A?8:10,K=A?1:2,U=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);U.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("stroke-width",3),U.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),U.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c=`text-anchor: middle; dominant-baseline: middle; font-size: ${ge}px;fill:`+$(e.data.name)+";",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=Z(this),m=e.x1-e.x0,w=e.y1-e.y0,L=c.node(),T=m-2*J,P=w-2*J;if(T<re||P<re){c.style("display","none");return}let y=parseInt(c.style("font-size"),10);const M=.6;for(;L.getComputedTextLength()>T&&y>D;)y--,c.style("font-size",`${y}px`);let F=Math.max(I,Math.min(j,Math.round(y*M))),k=y+K+F;for(;k>P&&y>D&&(y--,F=Math.max(I,Math.min(j,Math.round(y*M))),!(F<I&&y===D));)c.style("font-size",`${y}px`),k=y+K+F;c.style("font-size",`${y}px`),A?(y<D||P<D)&&c.style("display","none"):(L.getComputedTextLength()>T||y<D||P<y)&&c.style("display","none")}),r.showValues!==!1&&U.append("text").attr("class","treemapValue").attr("x",c=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",c=>{const m=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(c.data.name)+";",w=B({cssCompiledStyles:c.data.cssCompiledStyles});return m+w.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,m)=>`url(#clip-${a}-${m})`).text(c=>c.value?p(c.value):"").each(function(c){const m=Z(this),w=this.parentNode;if(!w){m.style("display","none");return}const L=Z(w).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){m.style("display","none");return}const T=parseFloat(L.style("font-size")),y=Math.max(I,Math.min(j,Math.round(T*.6)));m.style("font-size",`${y}px`);const F=(c.y1-c.y0)/2+T/2+K;m.attr("y",F);const k=c.x1-c.x0,ie=c.y1-c.y0-4,ve=k-2*J;m.node().getComputedTextLength()>ve||F+y>ie||y<I?m.style("display","none"):m.style("display",null)});const ye=r.diagramPadding??8;xe(S,ye,"flowchart",r?.useMaxWidth||!1)},"draw"),ct=C(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=C(({treemap:t}={})=>{const a=Ce(),l=ae(),n=ee(a,l.themeVariables),s=ee(dt,t),r=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
|
|
1
|
+
import{s as xe}from"./DYJfIIFo.js";import{p as be}from"./CKdN1cCE.js";import{b as C,a6 as Ce,W as ae,q as ee,aX as we,B as Te,ay as te,b8 as B,aW as Z,a_ as Le,V as $e,b0 as Ae,Y as Fe,U as _e,aZ as Ne,O as Me,ao as ke,r as Ve}from"./B5LF76XB.js";import{p as ze}from"./2gme4FSl.js";import{f as O,o as Q}from"./BiK9aV24.js";function De(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function Pe(){return this.eachAfter(De)}function Be(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function We(t,a){for(var l=this,n=[l],s,r,h=-1;l=n.pop();)if(t.call(a,l,++h,this),s=l.children)for(r=s.length-1;r>=0;--r)n.push(s[r]);return this}function Ee(t,a){for(var l=this,n=[l],s=[],r,h,d,f=-1;l=n.pop();)if(s.push(l),r=l.children)for(h=0,d=r.length;h<d;++h)n.push(r[h]);for(;l=s.pop();)t.call(a,l,++f,this);return this}function Re(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function He(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,s=n&&n.length;--s>=0;)l+=n[s].value;a.value=l})}function Ie(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Oe(t){for(var a=this,l=qe(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var s=n.length;t!==l;)n.splice(s,0,t),t=t.parent;return n}function qe(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),s=null;for(t=l.pop(),a=n.pop();t===a;)s=t,t=l.pop(),a=n.pop();return s}function Ge(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Xe(){return Array.from(this)}function Ye(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function je(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ue(){var t=this,a,l=[t],n,s,r;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(s=0,r=n.length;s<r;++s)l.push(n[s]);while(l.length)}function ne(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ke)):a===void 0&&(a=Je);for(var l=new Y(t),n,s=[l],r,h,d,f;n=s.pop();)if((h=a(n.data))&&(f=(h=Array.from(h)).length))for(n.children=h,d=f-1;d>=0;--d)s.push(r=h[d]=new Y(h[d])),r.parent=n,r.depth=n.depth+1;return l.eachBefore(et)}function Ze(){return ne(this).eachBefore(Qe)}function Je(t){return t.children}function Ke(t){return Array.isArray(t)?t[1]:null}function Qe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function et(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Y(t){this.data=t,this.depth=this.height=0,this.parent=null}Y.prototype=ne.prototype={constructor:Y,count:Pe,each:Be,eachAfter:Ee,eachBefore:We,find:Re,sum:He,sort:Ie,path:Oe,ancestors:Ge,descendants:Xe,leaves:Ye,links:je,copy:Ze,[Symbol.iterator]:Ue};function tt(t){if(typeof t!="function")throw new Error;return t}function q(){return 0}function G(t){return function(){return t}}function at(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function oe(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(n-a)/t.value;++d<f;)h=r[d],h.y0=l,h.y1=s,h.x0=a,h.x1=a+=h.value*o}Object.create(Y.prototype);function ce(t,a,l,n,s){for(var r=t.children,h,d=-1,f=r.length,o=t.value&&(s-l)/t.value;++d<f;)h=r[d],h.x0=a,h.x1=n,h.y0=l,h.y1=l+=h.value*o}var he=(1+Math.sqrt(5))/2;function de(t,a,l,n,s,r){for(var h=[],d=a.children,f,o,u=0,S=0,i=d.length,v,x,g=a.value,p,b,_,$,z,R,N;u<i;){v=s-l,x=r-n;do p=d[S++].value;while(!p&&S<i);for(b=_=p,R=Math.max(x/v,v/x)/(g*t),N=p*p*R,z=Math.max(_/N,N/b);S<i;++S){if(p+=o=d[S].value,o<b&&(b=o),o>_&&(_=o),N=p*p*R,$=Math.max(_/N,N/b),$>z){p-=o;break}z=$}h.push(f={value:p,dice:v<x,children:d.slice(u,S)}),f.dice?oe(f,l,n,s,g?n+=x*p/g:r):ce(f,l,n,g?l+=v*p/g:s,r),g-=p,u=S}return h}var nt=(function t(a){function l(n,s,r,h,d){de(a,n,s,r,h,d)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);function lt(){var t=nt,a=!1,l=1,n=1,s=[0],r=q,h=q,d=q,f=q,o=q;function u(i){return i.x0=i.y0=0,i.x1=l,i.y1=n,i.eachBefore(S),s=[0],a&&i.eachBefore(at),i}function S(i){var v=s[i.depth],x=i.x0+v,g=i.y0+v,p=i.x1-v,b=i.y1-v;p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),i.x0=x,i.y0=g,i.x1=p,i.y1=b,i.children&&(v=s[i.depth+1]=r(i)/2,x+=o(i)-v,g+=h(i)-v,p-=d(i)-v,b-=f(i)-v,p<x&&(x=p=(x+p)/2),b<g&&(g=b=(g+b)/2),t(i,x,g,p,b))}return u.round=function(i){return arguments.length?(a=!!i,u):a},u.size=function(i){return arguments.length?(l=+i[0],n=+i[1],u):[l,n]},u.tile=function(i){return arguments.length?(t=tt(i),u):t},u.padding=function(i){return arguments.length?u.paddingInner(i).paddingOuter(i):u.paddingInner()},u.paddingInner=function(i){return arguments.length?(r=typeof i=="function"?i:G(+i),u):r},u.paddingOuter=function(i){return arguments.length?u.paddingTop(i).paddingRight(i).paddingBottom(i).paddingLeft(i):u.paddingTop()},u.paddingTop=function(i){return arguments.length?(h=typeof i=="function"?i:G(+i),u):h},u.paddingRight=function(i){return arguments.length?(d=typeof i=="function"?i:G(+i),u):d},u.paddingBottom=function(i){return arguments.length?(f=typeof i=="function"?i:G(+i),u):f},u.paddingLeft=function(i){return arguments.length?(o=typeof i=="function"?i:G(+i),u):o},u}(function t(a){function l(n,s,r,h,d){if((f=n._squarify)&&f.ratio===a)for(var f,o,u,S,i=-1,v,x=f.length,g=n.value;++i<x;){for(o=f[i],u=o.children,S=o.value=0,v=u.length;S<v;++S)o.value+=u[S].value;o.dice?oe(o,s,r,h,g?r+=(d-r)*o.value/g:d):ce(o,s,r,g?s+=(h-s)*o.value/g:h,d),g-=o.value}else n._squarify=f=de(a,n,s,r,h,d),f.ratio=a}return l.ratio=function(n){return t((n=+n)>1?n:1)},l})(he);var E,ue=(E=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=Le,this.getAccTitle=$e,this.setDiagramTitle=Ae,this.getDiagramTitle=Fe,this.getAccDescription=_e,this.setAccDescription=Ne}getNodes(){return this.nodes}getConfig(){const a=Me,l=ae();return ee({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??=a)}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},s=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");s&&s.forEach(r=>{ke(r)&&(n?.textStyles?n.textStyles.push(r):n.textStyles=[r]),n?.styles?n.styles.push(r):n.styles=[r]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){return this.classes.get(a)?.styles??[]}clear(){Ve(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(E,"TreeMapDB"),E);function pe(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const s={name:n.name,children:n.type==="Leaf"?void 0:[]};for(s.classSelector=n?.classSelector,n?.cssCompiledStyles&&(s.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(s.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(s);else{const r=l[l.length-1].node;r.children?r.children.push(s):r.children=[s]}n.type!=="Leaf"&&l.push({node:s,level:n.level})}),a}C(pe,"buildHierarchy");var st=C((t,a)=>{be(t,a);const l=[];for(const r of t.TreemapRows??[])r.$type==="ClassDefStatement"&&a.addClass(r.className??"",r.styleText??"");for(const r of t.TreemapRows??[]){const h=r.item;if(!h)continue;const d=r.indent?parseInt(r.indent):0,f=rt(h),o=h.classSelector?a.getStylesForClass(h.classSelector):[],u=o.length>0?o:void 0,S={level:d,name:f,type:h.$type,value:h.value,classSelector:h.classSelector,cssCompiledStyles:u};l.push(S)}const n=pe(l),s=C((r,h)=>{for(const d of r)a.addNode(d,h),d.children&&d.children.length>0&&s(d.children,h+1)},"addNodesRecursively");s(n,0)},"populate"),rt=C(t=>t.name?String(t.name):"","getItemName"),fe={parser:{yy:void 0},parse:C(async t=>{try{const l=await ze("treemap",t);te.debug("Treemap AST:",l);const n=fe.parser?.yy;if(!(n instanceof ue))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");st(l,n)}catch(a){throw te.error("Error parsing treemap:",a),a}},"parse")},it=10,W=10,X=25,ot=C((t,a,l,n)=>{const s=n.db,r=s.getConfig(),h=r.padding??it,d=s.getDiagramTitle(),f=s.getRoot(),{themeVariables:o}=ae();if(!f)return;const u=d?30:0,S=we(a),i=r.nodeWidth?r.nodeWidth*W:960,v=r.nodeHeight?r.nodeHeight*W:500,x=i,g=v+u;S.attr("viewBox",`0 0 ${x} ${g}`),Te(S,g,x,r.useMaxWidth);let p;try{const e=r.valueFormat||",";if(e==="$0,0")p=C(c=>"$"+O(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),m=c?c[0]:"";p=C(w=>"$"+O(","+m)(w),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);p=C(m=>"$"+O(c||"")(m),"valueFormat")}else p=O(e)}catch(e){te.error("Error creating format function:",e),p=O(",")}const b=Q().range(["transparent",o.cScale0,o.cScale1,o.cScale2,o.cScale3,o.cScale4,o.cScale5,o.cScale6,o.cScale7,o.cScale8,o.cScale9,o.cScale10,o.cScale11]),_=Q().range(["transparent",o.cScalePeer0,o.cScalePeer1,o.cScalePeer2,o.cScalePeer3,o.cScalePeer4,o.cScalePeer5,o.cScalePeer6,o.cScalePeer7,o.cScalePeer8,o.cScalePeer9,o.cScalePeer10,o.cScalePeer11]),$=Q().range([o.cScaleLabel0,o.cScaleLabel1,o.cScaleLabel2,o.cScaleLabel3,o.cScaleLabel4,o.cScaleLabel5,o.cScaleLabel6,o.cScaleLabel7,o.cScaleLabel8,o.cScaleLabel9,o.cScaleLabel10,o.cScaleLabel11]);d&&S.append("text").attr("x",x/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(d);const z=S.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),R=ne(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),le=lt().size([i,v]).paddingTop(e=>e.children&&e.children.length>0?X+W:0).paddingInner(h).paddingLeft(e=>e.children&&e.children.length>0?W:0).paddingRight(e=>e.children&&e.children.length>0?W:0).paddingBottom(e=>e.children&&e.children.length>0?W:0).round(!0)(R),me=le.descendants().filter(e=>e.children&&e.children.length>0),H=z.selectAll(".treemapSection").data(me).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),H.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),H.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>b(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>_(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=B({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),H.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,c)=>`url(#clip-section-${a}-${c})`).attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=Z(this),m=e.data.name;c.text(m);const w=e.x1-e.x0,L=6;let T;r.showValues!==!1&&e.value?T=w-10-30-10-L:T=w-L-6;const y=Math.max(15,T),M=c.node();if(M.getComputedTextLength()>y){let V=m;for(;V.length>0;){if(V=m.substring(0,V.length-1),V.length===0){c.text("..."),M.getComputedTextLength()>y&&c.text("");break}if(c.text(V+"..."),M.getComputedTextLength()<=y)break}}}),r.showValues!==!1&&H.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+$(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")});const se=le.leaves(),A=se.length>20,ge=A?16:38,j=A?14:28,D=A?4:8,I=A?4:6,J=A?2:4,re=A?8:10,K=A?1:2,U=z.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);U.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("style",e=>B({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?b(e.parent.data.name):b(e.data.name)).attr("stroke-width",3),U.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),U.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c=`text-anchor: middle; dominant-baseline: middle; font-size: ${ge}px;fill:`+$(e.data.name)+";",m=B({cssCompiledStyles:e.data.cssCompiledStyles});return c+m.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=Z(this),m=e.x1-e.x0,w=e.y1-e.y0,L=c.node(),T=m-2*J,P=w-2*J;if(T<re||P<re){c.style("display","none");return}let y=parseInt(c.style("font-size"),10);const M=.6;for(;L.getComputedTextLength()>T&&y>D;)y--,c.style("font-size",`${y}px`);let F=Math.max(I,Math.min(j,Math.round(y*M))),k=y+K+F;for(;k>P&&y>D&&(y--,F=Math.max(I,Math.min(j,Math.round(y*M))),!(F<I&&y===D));)c.style("font-size",`${y}px`),k=y+K+F;c.style("font-size",`${y}px`),A?(y<D||P<D)&&c.style("display","none"):(L.getComputedTextLength()>T||y<D||P<y)&&c.style("display","none")}),r.showValues!==!1&&U.append("text").attr("class","treemapValue").attr("x",c=>(c.x1-c.x0)/2).attr("y",function(c){return(c.y1-c.y0)/2}).attr("style",c=>{const m=`text-anchor: middle; dominant-baseline: hanging; font-size: ${j}px;fill:`+$(c.data.name)+";",w=B({cssCompiledStyles:c.data.cssCompiledStyles});return m+w.labelStyles.replace("color:","fill:")}).attr("clip-path",(c,m)=>`url(#clip-${a}-${m})`).text(c=>c.value?p(c.value):"").each(function(c){const m=Z(this),w=this.parentNode;if(!w){m.style("display","none");return}const L=Z(w).select(".treemapLabel");if(L.empty()||L.style("display")==="none"){m.style("display","none");return}const T=parseFloat(L.style("font-size")),y=Math.max(I,Math.min(j,Math.round(T*.6)));m.style("font-size",`${y}px`);const F=(c.y1-c.y0)/2+T/2+K;m.attr("y",F);const k=c.x1-c.x0,ie=c.y1-c.y0-4,ve=k-2*J;m.node().getComputedTextLength()>ve||F+y>ie||y<I?m.style("display","none"):m.style("display",null)});const ye=r.diagramPadding??8;xe(S,ye,"flowchart",r?.useMaxWidth||!1)},"draw"),ct=C(function(t,a){return a.db.getClasses()},"getClasses"),ht={draw:ot,getClasses:ct},dt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ut=C(({treemap:t}={})=>{const a=Ce(),l=ae(),n=ee(a,l.themeVariables),s=ee(dt,t),r=s.titleColor??n.titleColor,h=s.labelColor??n.textColor,d=s.valueColor??n.textColor;return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${s.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${s.sectionStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{aZ as Ae,U as ke,Y as ae,b0 as Fe,V as Pe,a_ as ve,b as o,X as Vt,ay as bt,aW as Lt,B as Ce,r as Le,O as V,aV as Ee,a6 as De}from"./
|
|
1
|
+
import{aZ as Ae,U as ke,Y as ae,b0 as Fe,V as Pe,a_ as ve,b as o,X as Vt,ay as bt,aW as Lt,B as Ce,r as Le,O as V,aV as Ee,a6 as De}from"./B5LF76XB.js";import{l as ie}from"./BiK9aV24.js";var Et=(function(){var t=o(function(Y,r,l,x){for(l=l||{},x=Y.length;x--;l[Y[x]]=r);return l},"o"),n=[1,3],f=[1,4],d=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],_=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],u=[1,37],T=[1,36],q=[1,38],m=[1,35],b=[1,43],g=[1,41],A=[1,45],ht=[1,14],xt=[1,23],ft=[1,18],gt=[1,19],ct=[1,20],_t=[1,21],dt=[1,22],i=[1,24],zt=[1,25],It=[1,26],wt=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],X=[1,63],H=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Xt=[1,71],Ht=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],K=[1,91],Z=[1,92],J=[1,93],$=[1,100],tt=[1,94],et=[1,97],it=[1,95],at=[1,96],nt=[1,98],st=[1,99],At=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],kt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,x,c,S,e,ut){var s=e.length-1;switch(S){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],c.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),c.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),c.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),c.setAccDescription(this.$);break;case 46:c.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:c.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:c.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:c.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:c.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:c.setXAxisLeftText(e[s-2]),c.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",c.setXAxisLeftText(e[s-1]);break;case 53:c.setXAxisLeftText(e[s]);break;case 54:c.setYAxisBottomText(e[s-2]),c.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",c.setYAxisBottomText(e[s-1]);break;case 56:c.setYAxisBottomText(e[s]);break;case 57:c.setQuadrant1Text(e[s]);break;case 58:c.setQuadrant2Text(e[s]);break;case 59:c.setQuadrant3Text(e[s]);break;case 60:c.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:f,55:d,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:f,55:d,56:h,57:p},{18:n,26:9,27:2,28:f,55:d,56:h,57:p},t(y,[2,33],{29:10}),t(_,[2,61]),t(_,[2,62]),t(_,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:d,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:u,5:T,10:q,12:m,13:b,14:g,15:A,18:ht,25:xt,35:ft,37:gt,39:ct,41:_t,42:dt,48:i,50:zt,51:It,52:wt,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,10:q,12:m,13:b,14:g,15:A,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Xt,10:Ht,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:u,5:T,10:q,12:m,13:b,14:g,15:A,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:u,5:T,8:X,10:q,12:m,13:b,14:g,15:A,18:H,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{46:[1,102]},t(a,[2,29],{10:At}),t(Zt,[2,27],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:At}),t(a,[2,48],{22:89,16:90,23:105,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st}),{4:K,5:Z,6:J,8:$,11:tt,13:et,16:90,17:it,18:at,19:nt,20:st,22:106},t(N,[2,26]),t(a,[2,50],{10:At}),t(Zt,[2,28],{16:104,4:K,5:Z,6:J,8:$,11:tt,13:et,17:it,18:at,19:nt,20:st})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=l,x}},"parseError"),parse:o(function(r){var l=this,x=[0],c=[],S=[null],e=[],ut=this.table,s="",yt=0,Jt=0,me=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),j={yy:{}};for(var Ft in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ft)&&(j.yy[Ft]=this.yy[Ft]);D.setInput(r,j.yy),j.yy.lexer=D,j.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Pt=D.yylloc;e.push(Pt);var Se=D.options&&D.options.ranges;typeof j.yy.parseError=="function"?this.parseError=j.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){x.length=x.length-2*R,S.length=S.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=c.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(c=R,R=c.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,G,W,vt,rt={},Tt,M,ee,qt;;){if(G=x[x.length-1],this.defaultActions[G]?W=this.defaultActions[G]:((B===null||typeof B>"u")&&(B=te()),W=ut[G]&&ut[G][B]),typeof W>"u"||!W.length||!W[0]){var Ct="";qt=[];for(Tt in ut[G])this.terminals_[Tt]&&Tt>me&&qt.push("'"+this.terminals_[Tt]+"'");D.showPosition?Ct="Parse error on line "+(yt+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+qt.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Ct="Parse error on line "+(yt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Ct,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Pt,expected:qt})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+B);switch(W[0]){case 1:x.push(B),S.push(D.yytext),e.push(D.yylloc),x.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,yt=D.yylineno,Pt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],rt.$=S[S.length-M],rt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(rt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),vt=this.performAction.apply(rt,[s,Jt,yt,j.yy,W[1],S,e].concat(be)),typeof vt<"u")return vt;M&&(x=x.slice(0,-1*M*2),S=S.slice(0,-1*M),e=e.slice(0,-1*M)),x.push(this.productions_[W[1]][0]),S.push(rt.$),e.push(rt._$),ee=ut[x[x.length-2]][x[x.length-1]],x.push(ee);break;case 3:return!0}}return!0},"parse")},qe=(function(){var Y={EOF:1,parseError:o(function(l,x){if(this.yy.parser)this.yy.parser.parseError(l,x);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===c.length?this.yylloc.first_column:0)+c[c.length-x.length].length-x[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as n}from"./
|
|
1
|
+
import{g as p,r as u,d as n}from"./zfpJcV11.js";import{p as f}from"./CKdN1cCE.js";import{b as a,ay as o}from"./B5LF76XB.js";import{M as c,c as d}from"./2gme4FSl.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},w={parser:R,db:n,renderer:u,styles:p};export{w as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as I}from"./
|
|
1
|
+
import{p as I}from"./CKdN1cCE.js";import{aZ as _,U as E,Y as F,b0 as D,V as P,a_ as z,b as c,aX as G,r as B,q as w,W as C,O as W,ay as b,a6 as V,B as H}from"./B5LF76XB.js";import{p as U}from"./2gme4FSl.js";var m={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},y=32,A={axes:[],curves:[],options:m},x=structuredClone(A),X=W.radar,j=c(()=>w({...X,...C().radar}),"getConfig"),M=c(()=>x.axes,"getAxes"),Y=c(()=>x.curves,"getCurves"),Z=c(()=>x.options,"getOptions"),q=c(a=>{x.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=c(a=>{x.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=c(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>s.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=c(a=>{const t=a.reduce((e,r)=>(e[r.name]=r,e),{});x.options={showLegend:t.showLegend?.value??m.showLegend,ticks:t.ticks?.value??m.ticks,max:t.max?.value??m.max,min:t.min?.value??m.min,graticule:t.graticule?.value??m.graticule},x.options.ticks>y&&(b.warn(`Radar diagram ticks (${x.options.ticks}) exceeds maximum allowed (${y}). Using ${y} instead.`),x.options.ticks=y)},"setOptions"),Q=c(()=>{B(),x=structuredClone(A)},"clear"),$={getAxes:M,getCurves:Y,getOptions:Z,setAxes:q,setCurves:K,setOptions:J,getConfig:j,clear:Q,setAccTitle:z,getAccTitle:P,setDiagramTitle:D,getDiagramTitle:F,getAccDescription:E,setAccDescription:_},tt=c(a=>{I(a,$);const{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:c(async a=>{const t=await U("radar",a);b.debug(t),tt(t)},"parse")},at=c((a,t,e,r)=>{const s=r.db,i=s.getAxes(),l=s.getCurves(),n=s.getOptions(),o=s.getConfig(),d=s.getDiagramTitle(),p=G(t),u=rt(p,o),g=n.max??Math.max(...l.map(f=>Math.max(...f.entries))),h=n.min,v=Math.min(o.width,o.height)/2;st(u,i,v,n.ticks,n.graticule),nt(u,i,v,o),L(u,i,l,h,g,n.graticule,o),k(u,l,n.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=c((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return H(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),st=c((a,t,e,r,s)=>{if(s==="circle")for(let i=0;i<r;i++){const l=e*(i+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(s==="polygon"){const i=t.length;for(let l=0;l<r;l++){const n=e*(l+1)/r,o=t.map((d,p)=>{const u=2*p*Math.PI/i-Math.PI/2,g=n*Math.cos(u),h=n*Math.sin(u);return`${g},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),nt=c((a,t,e,r)=>{const s=t.length;for(let i=0;i<s;i++){const l=t[i].label,n=2*i*Math.PI/s-Math.PI/2,o=Math.cos(n),d=Math.sin(n);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");const p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",g=4;a.append("text").text(l).attr("x",e*r.axisLabelFactor*o+g*o).attr("y",e*r.axisLabelFactor*d+g*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function L(a,t,e,r,s,i,l){const n=t.length,o=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==n)return;const u=d.entries.map((g,h)=>{const v=2*Math.PI*h/n-Math.PI/2,f=T(g,r,s,o),O=f*Math.cos(v),R=f*Math.sin(v);return{x:O,y:R}});i==="circle"?a.append("path").attr("d",S(u,l.curveTension)).attr("class",`radarCurve-${p}`):i==="polygon"&&a.append("polygon").attr("points",u.map(g=>`${g.x},${g.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}c(L,"drawCurves");function T(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}c(T,"relativeRadius");function S(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const i=a[(s-1+e)%e],l=a[s],n=a[(s+1)%e],o=a[(s+2)%e],d={x:l.x+(n.x-i.x)*t,y:l.y+(n.y-i.y)*t},p={x:n.x-(o.x-l.x)*t,y:n.y-(o.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${n.x},${n.y}`}return`${r} Z`}c(S,"closedRoundCurve");function k(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,i=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((n,o)=>{const d=a.append("g").attr("transform",`translate(${s}, ${i+o*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(n.label)})}c(k,"drawLegend");var ot={draw:at},it=c((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
|
|
2
2
|
.radarCurve-${r} {
|
|
3
3
|
color: ${s};
|
|
4
4
|
fill: ${s};
|