@intent-hq/web 2.369.1 → 2.370.0
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/bin/intent-web.mjs +113 -2
- package/package.json +1 -1
- package/web/app/immutable/chunks/{DodshHwq.js → -7AqlW5j.js} +1 -1
- package/web/app/immutable/chunks/{8bw9vP4h.js → 1DKpnRTj.js} +1 -1
- package/web/app/immutable/chunks/{Ck5xuk0H.js → 1GGKXNxU.js} +1 -1
- package/web/app/immutable/chunks/{DR7bEdZk.js → 1GrJvO3a.js} +1 -1
- package/web/app/immutable/chunks/{s1m3ujOc.js → 1pIqWRUk.js} +1 -1
- package/web/app/immutable/chunks/{CV10cSI4.js → 1q0xL14K.js} +1 -1
- package/web/app/immutable/chunks/{CWybLnJv.js → 5lieSvED.js} +1 -1
- package/web/app/immutable/chunks/{BPCO02B5.js → 9-nUCsGi.js} +1 -1
- package/web/app/immutable/chunks/{V6SVTu37.js → 9sCF_0su.js} +1 -1
- package/web/app/immutable/chunks/{D0Z6csIX.js → A4nvdmL6.js} +1 -1
- package/web/app/immutable/chunks/{9wk-Hes5.js → B-1iBpaq.js} +1 -1
- package/web/app/immutable/chunks/{7mowE2Gg.js → B-_ROixI.js} +2 -2
- package/web/app/immutable/chunks/{DvPSMnYw.js → B-kUJzil.js} +1 -1
- package/web/app/immutable/chunks/{iTSQ9YOi.js → B0SoVMRS.js} +1 -1
- package/web/app/immutable/chunks/{Cu3YXFZW.js → B1hj1DGj.js} +1 -1
- package/web/app/immutable/chunks/{B9EhZrTN.js → B1lYPzEU.js} +1 -1
- package/web/app/immutable/chunks/{BigChyTJ.js → B2AfKG58.js} +2 -2
- package/web/app/immutable/chunks/{DyBkeTEM.js → B3Gso1ut.js} +1 -1
- package/web/app/immutable/chunks/{CRwqTV0i.js → B8_Ff8zl.js} +1 -1
- package/web/app/immutable/chunks/{BUrTAEns.js → B9BjyTgZ.js} +1 -1
- package/web/app/immutable/chunks/{DsI0RDZ2.js → B9mj0qwd.js} +1 -1
- package/web/app/immutable/chunks/{SX1khnGy.js → BAymCgEX.js} +1 -1
- package/web/app/immutable/chunks/{DMl4Z5o_.js → BBWuirRW.js} +1 -1
- package/web/app/immutable/chunks/{DCJDf3gb.js → BCQ1W7zT.js} +3 -3
- package/web/app/immutable/chunks/{Dd_WBgru.js → BDA31WCY.js} +1 -1
- package/web/app/immutable/chunks/{D7slXRL_.js → BDcauMkX.js} +1 -1
- package/web/app/immutable/chunks/{CQw_RyF_.js → BEV9WkWU.js} +1 -1
- package/web/app/immutable/chunks/{CBZ4KqrB.js → BG2RPA7A.js} +2 -2
- package/web/app/immutable/chunks/{wJewnowK.js → BGT9uvaQ.js} +6 -6
- package/web/app/immutable/chunks/{BUHAwVs7.js → BHaE4286.js} +1 -1
- package/web/app/immutable/chunks/{CGOlqeU_.js → BIv0yV05.js} +1 -1
- package/web/app/immutable/chunks/{ie53yFct.js → BR2t5nsF.js} +2 -2
- package/web/app/immutable/chunks/{DUItrdZb.js → BRRvOx4M.js} +1 -1
- package/web/app/immutable/chunks/{BKuhcLZN.js → BSD34ZVo.js} +1 -1
- package/web/app/immutable/chunks/{oOuL5l8A.js → BSfkjlLx.js} +1 -1
- package/web/app/immutable/chunks/{B6jI9-V_.js → BSsEOl8-.js} +1 -1
- package/web/app/immutable/chunks/{ge7HDe-3.js → BUA7BUyu.js} +1 -1
- package/web/app/immutable/chunks/{CJb9CQqu.js → BVLa_5Le.js} +1 -1
- package/web/app/immutable/chunks/{BlIreYOW.js → BX9hgO_H.js} +1 -1
- package/web/app/immutable/chunks/{Bo-8pH0P.js → BYMXwcID.js} +1 -1
- package/web/app/immutable/chunks/{BEqf00Je.js → B_IEMfS6.js} +3 -3
- package/web/app/immutable/chunks/{C5rcw_c7.js → Bc7pHsTy.js} +1 -1
- package/web/app/immutable/chunks/{CUH5IR0E.js → Bg7YNbVH.js} +1 -1
- package/web/app/immutable/chunks/{nRmTo2Eh.js → BgPtjifd.js} +1 -1
- package/web/app/immutable/chunks/{FavPgSsK.js → BhZDGIfe.js} +1 -1
- package/web/app/immutable/chunks/{Dxjy2MWO.js → Bi0vr71w.js} +1 -1
- package/web/app/immutable/chunks/{DfSzfqox.js → BimRiD6s.js} +1 -1
- package/web/app/immutable/chunks/{msw9XRLE.js → BinPWBvt.js} +1 -1
- package/web/app/immutable/chunks/{BrAu7eNn.js → BkFHmpuY.js} +1 -1
- package/web/app/immutable/chunks/{6i_wfV3v.js → Blu9C_Vv.js} +1 -1
- package/web/app/immutable/chunks/{CgXGPBF5.js → BmBa9vQp.js} +1 -1
- package/web/app/immutable/chunks/{D1E6y9eQ.js → BmjF1SON.js} +1 -1
- package/web/app/immutable/chunks/{ByCxDC-R.js → BnNJN3Ls.js} +1 -1
- package/web/app/immutable/chunks/{D321NUNJ.js → BnhOIUmr.js} +1 -1
- package/web/app/immutable/chunks/{BxbMMWzz.js → Bp098-aN.js} +1 -1
- package/web/app/immutable/chunks/{BLzqYDED.js → BpEHjU4g.js} +1 -1
- package/web/app/immutable/chunks/Bqd7fdCF.js +1 -0
- package/web/app/immutable/chunks/{BuveYyQe.js → Bqm2Rf6d.js} +1 -1
- package/web/app/immutable/chunks/{BuLzqNKd.js → BqxcrzZH.js} +1 -1
- package/web/app/immutable/chunks/{TaTYmBM5.js → Bu13V5mO.js} +1 -1
- package/web/app/immutable/chunks/{BHfEypjS.js → BulBKnVz.js} +1 -1
- package/web/app/immutable/chunks/{B-F2f_Hq.js → Bus1Z5ou.js} +1 -1
- package/web/app/immutable/chunks/{Cl71oYkB.js → BvKqDQXM.js} +1 -1
- package/web/app/immutable/chunks/{ByN-IDvR.js → BvZfa6RH.js} +1 -1
- package/web/app/immutable/chunks/{DWsHBNeU.js → Bvo32SXP.js} +1 -1
- package/web/app/immutable/chunks/{nIQsF0QH.js → BwtGEQS3.js} +1 -1
- package/web/app/immutable/chunks/{BE2y8JEQ.js → BzFy3u2D.js} +1 -1
- package/web/app/immutable/chunks/{CqesqBNM.js → C0wua3Vt.js} +1 -1
- package/web/app/immutable/chunks/{Dxs2medA.js → C14Hgf8a.js} +1 -1
- package/web/app/immutable/chunks/{zhSFUcJz.js → C1AEP5wW.js} +1 -1
- package/web/app/immutable/chunks/{D1cY0pVs.js → C2Vj5Vs6.js} +1 -1
- package/web/app/immutable/chunks/{ClSUFCtq.js → C2YH0P-B.js} +1 -1
- package/web/app/immutable/chunks/{DQUvqa9o.js → CA2ANaNj.js} +1 -1
- package/web/app/immutable/chunks/{DSqj6mlv.js → CADQyVDS.js} +2 -2
- package/web/app/immutable/chunks/{CNn7flY0.js → CBRZjI7P.js} +2 -2
- package/web/app/immutable/chunks/{BDbtK9be.js → CBafvv8h.js} +1 -1
- package/web/app/immutable/chunks/{BnRltR11.js → CCSbqNiH.js} +1 -1
- package/web/app/immutable/chunks/{Wv5_ui4s.js → CCrwZkau.js} +1 -1
- package/web/app/immutable/chunks/{B2FXFK8l.js → CCsCF1Mh.js} +1 -1
- package/web/app/immutable/chunks/CFNJHO2G.js +1 -0
- package/web/app/immutable/chunks/{6CAGpBb_.js → CGzD6XfW.js} +1 -1
- package/web/app/immutable/chunks/{3_UV1UgL.js → CH7fgKro.js} +1 -1
- package/web/app/immutable/chunks/CK4eAyad.js +1 -0
- package/web/app/immutable/chunks/{Dz5OBP4z.js → CKnpbRTh.js} +4 -4
- package/web/app/immutable/chunks/{DCOxMTSf.js → CL3a4Hm1.js} +1 -1
- package/web/app/immutable/chunks/{D9NDL9ta.js → CMLBE7U6.js} +1 -1
- package/web/app/immutable/chunks/{Bl3mtXZn.js → CPlH-52U.js} +1 -1
- package/web/app/immutable/chunks/{XPs8BW44.js → CQAAihrI.js} +1 -1
- package/web/app/immutable/chunks/{C6T3ggVX.js → CQHtdg39.js} +1 -1
- package/web/app/immutable/chunks/{DdKIjYo_.js → CQ_NwL45.js} +2 -2
- package/web/app/immutable/chunks/{Bd_VEON_.js → CR2m4w2U.js} +1 -1
- package/web/app/immutable/chunks/{CFvGekuw.js → CRNfAyhd.js} +1 -1
- package/web/app/immutable/chunks/{C5X1QcI7.js → CRY4aELR.js} +3 -3
- package/web/app/immutable/chunks/{BsjFeGOg.js → CSBGusi9.js} +1 -1
- package/web/app/immutable/chunks/{DxejgjNm.js → CUMRLgxB.js} +1 -1
- package/web/app/immutable/chunks/{BOCp5eAe.js → CUNx-_2d.js} +4 -4
- package/web/app/immutable/chunks/{DuPd2TLf.js → CUdMuhJF.js} +1 -1
- package/web/app/immutable/chunks/{s97D1nrA.js → CY-vjmpy.js} +1 -1
- package/web/app/immutable/chunks/{C1McR-sz.js → CYKOPxuJ.js} +1 -1
- package/web/app/immutable/chunks/{CMqhKAKf.js → C_-WdiR8.js} +1 -1
- package/web/app/immutable/chunks/{PxI10rWs.js → C_E26DWe.js} +1 -1
- package/web/app/immutable/chunks/{CxF8L5mw.js → CaHds95Q.js} +1 -1
- package/web/app/immutable/chunks/{C1VlgusM.js → Caqml6gj.js} +1 -1
- package/web/app/immutable/chunks/{N5wpZAwp.js → CbRNm5he.js} +1 -1
- package/web/app/immutable/chunks/{Zldsekdv.js → CbRsc9i4.js} +1 -1
- package/web/app/immutable/chunks/{C7kFrL62.js → CblB0zCN.js} +1 -1
- package/web/app/immutable/chunks/{BQGSaBlM.js → CbyU6cEf.js} +1 -1
- package/web/app/immutable/chunks/{Cdw_CIdg.js → CdOh_Fmv.js} +1 -1
- package/web/app/immutable/chunks/{BsE4jMhr.js → CfUtc4-L.js} +1 -1
- package/web/app/immutable/chunks/{C6MAELkY.js → CgS_FiQI.js} +1 -1
- package/web/app/immutable/chunks/{CF1Tu_8c.js → Cgn_eC9-.js} +3 -3
- package/web/app/immutable/chunks/{XJqoy2ap.js → CgwFGLCK.js} +1 -1
- package/web/app/immutable/chunks/{sG8VksRm.js → Chnr0_jK.js} +1 -1
- package/web/app/immutable/chunks/{BR9s3igW.js → CiZzqOpk.js} +1 -1
- package/web/app/immutable/chunks/{ocWSyOIA.js → CjTGc2Y5.js} +1 -1
- package/web/app/immutable/chunks/{Cs_DX3BC.js → Cj_UUgNI.js} +1 -1
- package/web/app/immutable/chunks/{Bo900RGs.js → CkrbZXJF.js} +1 -1
- package/web/app/immutable/chunks/{DEMmGTfr.js → CmVXj6KK.js} +2 -2
- package/web/app/immutable/chunks/{DWjKA8Pm.js → CmW3Zqh6.js} +1 -1
- package/web/app/immutable/chunks/{LKW_Bid7.js → CnztNSaN.js} +1 -1
- package/web/app/immutable/chunks/{DvdPJ4VE.js → Cq4X6ptS.js} +1 -1
- package/web/app/immutable/chunks/{Da2tbXc-.js → CqVZxU_G.js} +1 -1
- package/web/app/immutable/chunks/{CASKMy_V.js → CqwiFk32.js} +1 -1
- package/web/app/immutable/chunks/{x-XvE_CJ.js → Cv2YUgTX.js} +1 -1
- package/web/app/immutable/chunks/{BNp3_sz0.js → CwWm64yZ.js} +1 -1
- package/web/app/immutable/chunks/{jRFO7UbE.js → CyWgrZMk.js} +4 -4
- package/web/app/immutable/chunks/{Dz2wxoQy.js → CylWx-GB.js} +1 -1
- package/web/app/immutable/chunks/{Boh_rcCH.js → CzS5ny-g.js} +1 -1
- package/web/app/immutable/chunks/{Bs9TCQJX.js → CzW29tkb.js} +1 -1
- package/web/app/immutable/chunks/{Cc2FSrQK.js → D-NrCL67.js} +1 -1
- package/web/app/immutable/chunks/{BgLPrJ77.js → D0DIS-cT.js} +1 -1
- package/web/app/immutable/chunks/{dP7u_sPF.js → D1V2Et17.js} +1 -1
- package/web/app/immutable/chunks/{CzmcyLb_.js → D1bivTve.js} +2 -2
- package/web/app/immutable/chunks/{CKkGJ_p-.js → D2dAlclh.js} +3 -3
- package/web/app/immutable/chunks/{D547g0l5.js → D5_auhOU.js} +2 -2
- package/web/app/immutable/chunks/{hHeBjODU.js → D69ZLPjW.js} +1 -1
- package/web/app/immutable/chunks/{4GHsM2YX.js → D6VfSAVQ.js} +1 -1
- package/web/app/immutable/chunks/{JKboQXkL.js → D6dNunKo.js} +1 -1
- package/web/app/immutable/chunks/{fRGswTf6.js → D9MwZkzV.js} +1 -1
- package/web/app/immutable/chunks/{KykWEhyB.js → DB9n2KBT.js} +1 -1
- package/web/app/immutable/chunks/{DH6z3AzB.js → DBdkAKrm.js} +3 -3
- package/web/app/immutable/chunks/{6GNWsakm.js → DCW2c0FY.js} +1 -1
- package/web/app/immutable/chunks/{C7Ed4dxf.js → DC_1j_gh.js} +3 -3
- package/web/app/immutable/chunks/{BZ5fAc9N.js → DELYEsRi.js} +1 -1
- package/web/app/immutable/chunks/{B_QtiZYt.js → DFBd8tOh.js} +1 -1
- package/web/app/immutable/chunks/{CXaVTV1g.js → DFr6bn5t.js} +3 -3
- package/web/app/immutable/chunks/{CPatK7EU.js → DISyGoja.js} +1 -1
- package/web/app/immutable/chunks/{3kQ-PiCp.js → DIukqb9l.js} +1 -1
- package/web/app/immutable/chunks/{CtxaFpQJ.js → DJFAYXyc.js} +1 -1
- package/web/app/immutable/chunks/{BR5vKj6f.js → DL1CE4TH.js} +1 -1
- package/web/app/immutable/chunks/{D-2bQKif.js → DONrLvvt.js} +1 -1
- package/web/app/immutable/chunks/{xqJuIupR.js → DRy2oEmj.js} +1 -1
- package/web/app/immutable/chunks/{ZYL8cEBi.js → DSacn4II.js} +1 -1
- package/web/app/immutable/chunks/{DcvxsgOZ.js → DUGztmZo.js} +1 -1
- package/web/app/immutable/chunks/{Bp0nVWtT.js → DWDPOFkL.js} +1 -1
- package/web/app/immutable/chunks/{Cnwc7RZW.js → DWEA_zul.js} +1 -1
- package/web/app/immutable/chunks/{BgDYQZ_0.js → DZIz7Wk9.js} +1 -1
- package/web/app/immutable/chunks/{fK0I75t-.js → DZRLhNnQ.js} +1 -1
- package/web/app/immutable/chunks/{BXkyhXuK.js → D_-ztW_Y.js} +1 -1
- package/web/app/immutable/chunks/{C_A_Ikb5.js → D_hG-oZK.js} +1 -1
- package/web/app/immutable/chunks/{C2jA6pM8.js → D_r5h8IL.js} +1 -1
- package/web/app/immutable/chunks/{aHO4L7kg.js → Dawt227W.js} +1 -1
- package/web/app/immutable/chunks/{Csxq8_TN.js → Db8-C0Zq.js} +1 -1
- package/web/app/immutable/chunks/{BpwdP8dq.js → DbCFTbwM.js} +1 -1
- package/web/app/immutable/chunks/{CLZkKjaI.js → DcUCHDGY.js} +1 -1
- package/web/app/immutable/chunks/{ByDB1X4D.js → DeE0yn_3.js} +1 -1
- package/web/app/immutable/chunks/{C9r0mVfa.js → Dekzflbl.js} +1 -1
- package/web/app/immutable/chunks/{DqgCp5ae.js → Df-HaYIr.js} +1 -1
- package/web/app/immutable/chunks/{s3nd6_cp.js → DgMr61cU.js} +1 -1
- package/web/app/immutable/chunks/{BCSEMQfF.js → DkJkWZTE.js} +1 -1
- package/web/app/immutable/chunks/{BDP3Y6aK.js → DksUdusM.js} +1 -1
- package/web/app/immutable/chunks/{CtFSFfLz.js → Dp9fBXaC.js} +1 -1
- package/web/app/immutable/chunks/{A9EcmNK3.js → DrOwYgbZ.js} +1 -1
- package/web/app/immutable/chunks/{B9I2hDG-.js → Dsn82AW0.js} +1 -1
- package/web/app/immutable/chunks/{DgFinDjM.js → DtHX0_aW.js} +2 -2
- package/web/app/immutable/chunks/{C8APJtmo.js → DtfuSWPd.js} +1 -1
- package/web/app/immutable/chunks/{Ct_Zx4ru.js → Dv0Jc2Nv.js} +1 -1
- package/web/app/immutable/chunks/{DumeSIrz.js → DvATy2o1.js} +1 -1
- package/web/app/immutable/chunks/{M18r7swD.js → DvrEye74.js} +1 -1
- package/web/app/immutable/chunks/{93RUSyHg.js → DwXKCf3Q.js} +1 -1
- package/web/app/immutable/chunks/{Cdhrdfve.js → DxyI4IUi.js} +1 -1
- package/web/app/immutable/chunks/{BLlLxRVW.js → Ev5lig9W.js} +1 -1
- package/web/app/immutable/chunks/{CxXkuVq5.js → EzpfJOSe.js} +1 -1
- package/web/app/immutable/chunks/{BsKhFZ0Q.js → FtGWFokI.js} +1 -1
- package/web/app/immutable/chunks/{QpGjdleN.js → Hd1u2Z-S.js} +1 -1
- package/web/app/immutable/chunks/{CB0sfbT7.js → Iq8JI4_0.js} +1 -1
- package/web/app/immutable/chunks/{C1ZHQc4S.js → MifrdpDQ.js} +1 -1
- package/web/app/immutable/chunks/{fXS7JPx0.js → NQru5r2h.js} +1 -1
- package/web/app/immutable/chunks/{WHfdsTrE.js → NqK_XT0y.js} +1 -1
- package/web/app/immutable/chunks/{CJHs_ufb.js → R1s5ARST.js} +1 -1
- package/web/app/immutable/chunks/{DK2Pie4F.js → R2N5eDxY.js} +1 -1
- package/web/app/immutable/chunks/{RifCGV3x.js → TE7UDCh6.js} +1 -1
- package/web/app/immutable/chunks/{DmhHEMPi.js → THdp5Vpk.js} +1 -1
- package/web/app/immutable/chunks/UGr2VEtG.js +1 -0
- package/web/app/immutable/chunks/{BUNNt_Jr.js → UN8KT7fR.js} +1 -1
- package/web/app/immutable/chunks/{B9XvejAu.js → UQXXh4U7.js} +1 -1
- package/web/app/immutable/chunks/{5NOp7PNZ.js → VJkCr9xp.js} +1 -1
- package/web/app/immutable/chunks/VdR0DXlW.js +410 -0
- package/web/app/immutable/chunks/{Z73Hn0_g.js → WlqVlpOk.js} +1 -1
- package/web/app/immutable/chunks/{0NGflniG.js → YV53nLSc.js} +1 -1
- package/web/app/immutable/chunks/{TrRXD94r.js → YcqSYZ1W.js} +1 -1
- package/web/app/immutable/chunks/{DtnAdLQg.js → ZIOU9Sxd.js} +1 -1
- package/web/app/immutable/chunks/{u8OBGcNi.js → _EqQOSVK.js} +1 -1
- package/web/app/immutable/chunks/{eln8hjjQ.js → bb5Wjkri.js} +1 -1
- package/web/app/immutable/chunks/{DAjaV_xN.js → cFozej4U.js} +3 -3
- package/web/app/immutable/chunks/{D_MzuSit.js → d1EmVp98.js} +1 -1
- package/web/app/immutable/chunks/{DKyvRWc2.js → eCVtubQ8.js} +1 -1
- package/web/app/immutable/chunks/{DllP5msd.js → f686-QUd.js} +1 -1
- package/web/app/immutable/chunks/{DpFiDNG-.js → fr0BmHL-.js} +1 -1
- package/web/app/immutable/chunks/{BUtBz-tz.js → gHT8Z5q-.js} +1 -1
- package/web/app/immutable/chunks/{A2MGRlHV.js → gySpGbnA.js} +2 -2
- package/web/app/immutable/chunks/i8PKWJT0.js +1 -0
- package/web/app/immutable/chunks/{DdH7Q5ij.js → ir8Qz45r.js} +1 -1
- package/web/app/immutable/chunks/{OcJyMtNk.js → jG-4Z8qH.js} +1 -1
- package/web/app/immutable/chunks/{CoNmDxYv.js → qHChsLZZ.js} +1 -1
- package/web/app/immutable/chunks/{B1sp_kEH.js → qi41b1Ac.js} +1 -1
- package/web/app/immutable/chunks/{sJt4gu2x.js → qjcf4Gb9.js} +1 -1
- package/web/app/immutable/chunks/{dSvJdwG_.js → qvt-0QTi.js} +3 -3
- package/web/app/immutable/chunks/{Cu91VTQn.js → rB5UfCey.js} +1 -1
- package/web/app/immutable/chunks/{DVy6H5Ng.js → sS3MW5B6.js} +1 -1
- package/web/app/immutable/chunks/{BbQfjn7f.js → t7yAUuZn.js} +2 -2
- package/web/app/immutable/chunks/{BEjEPSxp.js → tDUnXf7O.js} +1 -1
- package/web/app/immutable/chunks/{eLOMf9Vt.js → uCQEgTob.js} +1 -1
- package/web/app/immutable/chunks/{CZ_Dk1nz.js → vLtMR-kj.js} +1 -1
- package/web/app/immutable/chunks/{iBqqkWL_.js → wEnqV1Ol.js} +1 -1
- package/web/app/immutable/chunks/{Danvn_nL.js → wgljT0D3.js} +1 -1
- package/web/app/immutable/chunks/{DvYo8gAP.js → zye35u-t.js} +1 -1
- package/web/app/immutable/entry/{app.OFNFrEIR.js → app.jT7Rd2u4.js} +2 -2
- package/web/app/immutable/entry/start.CSuXA93h.js +1 -0
- package/web/app/immutable/nodes/{0.BPB4y4Pk.js → 0.9lwWQtfB.js} +1 -1
- package/web/app/immutable/nodes/{1.CBbBqNOx.js → 1.Ck4yEk2l.js} +1 -1
- package/web/app/immutable/nodes/{10.B-rk3kEM.js → 10.C4FEQjC7.js} +16 -16
- package/web/app/immutable/nodes/{11.P0HocOtE.js → 11.C-vXNNmX.js} +1 -1
- package/web/app/immutable/nodes/{13.DYH2a5Wx.js → 13.DhKVmEQi.js} +1 -1
- package/web/app/immutable/nodes/{14.B6MrEg8x.js → 14.INZu_e5k.js} +1 -1
- package/web/app/immutable/nodes/{15.DhLBijej.js → 15.DdKSdQ-h.js} +1 -1
- package/web/app/immutable/nodes/{16.CKbY5VRM.js → 16.Ad-t6nft.js} +1 -1
- package/web/app/immutable/nodes/{17.DPSU7Eqq.js → 17.pLS5JsPi.js} +1 -1
- package/web/app/immutable/nodes/{18.BlD6ustd.js → 18.DIVxEUeB.js} +1 -1
- package/web/app/immutable/nodes/{19.bgAqepNt.js → 19.BB9LuT5j.js} +2 -2
- package/web/app/immutable/nodes/{2.DU7oYEtS.js → 2.Bp80wZmn.js} +4 -4
- package/web/app/immutable/nodes/{20.Cj4TGw20.js → 20.BGTcjiLa.js} +1 -1
- package/web/app/immutable/nodes/{3.B4hrIG7P.js → 3.DRJnaOSe.js} +1 -1
- package/web/app/immutable/nodes/{4.J3HSWI_f.js → 4.p67SnElB.js} +1 -1
- package/web/app/immutable/nodes/{5.CS5w-vHI.js → 5.DRmIJA2c.js} +1 -1
- package/web/app/immutable/nodes/{6.Bf53uJQ1.js → 6.Bjeibumi.js} +1 -1
- package/web/app/immutable/nodes/{7.q-WiNda-.js → 7.CjIaxqZ1.js} +1 -1
- package/web/app/immutable/nodes/{8.eHanxjw-.js → 8.DAlxovqG.js} +1 -1
- package/web/app/immutable/nodes/{9.BMShc48l.js → 9.BKQZzsCi.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +15 -15
- package/web/app/immutable/chunks/BBMzDN3i.js +0 -1
- package/web/app/immutable/chunks/BxTyo7yU.js +0 -1
- package/web/app/immutable/chunks/ClHV2gp3.js +0 -1
- package/web/app/immutable/chunks/CqJQ3ikU.js +0 -1
- package/web/app/immutable/chunks/DW3gkA_F.js +0 -1
- package/web/app/immutable/chunks/fd1DS8nx.js +0 -410
- package/web/app/immutable/entry/start.CHpPu02l.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./BOCp5eAe.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./CUNx-_2d.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as W}from"./
|
|
1
|
+
import{I as W}from"./DISyGoja.js";import{p as X}from"./CbRNm5he.js";import{b0 as z,a_ as G,aZ as Y,Y as P,U as F,V as Z,b as g,q as N,ay as A,aX as q,B as U,W as E,r as j,aV as J,a0 as K,O as Q,aO as ee}from"./CUNx-_2d.js";import{p as te}from"./C0gEyGJV.js";var L=/[─━│┃└┗├┣]/,D=/[└┗├┣]/,ne=/[─━]/,V=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,re=" ";function _(n){return n.some(t=>L.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=D.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
|
|
2
2
|
`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||$.test(c)||T.test(c)||V.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=M(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if($.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c)){o.push(c),a++,e.set(a,h);continue}if(V.test(c))continue;const l=c.replace(/\t/g," "),w=D.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const O=re.repeat(m);o.push(O+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(L.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
|
|
3
3
|
`),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new W(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:z},I=de,he=g(n=>{X(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),k=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;k(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;k(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
|
|
4
4
|
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./CJxGDkBm.js";import{bm as $s,_ as Dn}from"./51_h0jm2.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CBafvv8h.js","/app/immutable/chunks/BAymCgEX.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/51_h0jm2.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/PXCFrn2V.js","/app/immutable/chunks/CpPNoOk-.js","/app/immutable/chunks/DxvSggY5.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CdOh_Fmv.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/Bjy4ygfJ.js","/app/immutable/chunks/Cgn_eC9-.js","/app/immutable/chunks/BQDGTBxC.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DGmOjLYi.js","/app/immutable/chunks/C9UsZ4re.js","/app/immutable/chunks/DqFWZ_g1.js","/app/immutable/chunks/D6dNunKo.js","/app/immutable/chunks/CbRsc9i4.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BEklUrxK.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/DSQT151l.js","/app/immutable/chunks/BxwkoIbZ.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BmBa9vQp.js","/app/immutable/chunks/BRRvOx4M.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Fh=Object.defineProperty;var Nh=(t,e,i)=>e in t?Fh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var P=(t,e,i)=>Nh(t,typeof e!="symbol"?e+"":e,i);import{cd as zh}from"./CJxGDkBm.js";import{bm as $s,_ as Dn}from"./51_h0jm2.js";import{a as Xi}from"./BdWqymET.js";import{i as Fs}from"./BBWuirRW.js";import{d as Wh}from"./Cj_UUgNI.js";import{t as Hh}from"./CCSbqNiH.js";import{d as Hi}from"./B0Z-1lwJ.js";import{c as Uh}from"./ChTqQfQN.js";import{s as Wt}from"./CQ409-Pj.js";import{H as Kh}from"./Cgn_eC9-.js";import{J4 as _t,K9 as Bn,gu as qh,aW as Vh,Cj as Gh,Ax as Yh,s3 as Xh}from"./CbRsc9i4.js";import{O as An,S as Pn,J as On,B as In}from"./Bqd7fdCF.js";import{g as jh}from"./CnztNSaN.js";import{f as Zh,l as Jh}from"./B3Gso1ut.js";/**
|
|
3
3
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
4
4
|
* @license MIT
|
|
5
5
|
*
|
|
@@ -141,6 +141,6 @@ void main() {
|
|
|
141
141
|
`))}},df=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},uf=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},_f=0,dr=class{constructor(t){this.value=t,this.id=_f++}},ff=2,gf,ut=class{constructor(t){this._size=0,this._options=t,this._leakageMon=this._options?.leakWarningThreshold?new lf(t?.onListenerError??cr,this._options?.leakWarningThreshold??hf):void 0,this._perfMon=this._options?._profName?new af(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(t,e,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let a=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],l=new uf(`${o}. HINT: Stack shows most frequent listener (${a[1]}-times)`,a[0]);return(this._options?.onListenerError||cr)(l),Kt.None}if(this._disposed)return Kt.None;e&&(t=t.bind(e));let s=new dr(t),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=cf.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof dr?(this._deliveryQueue??=new pf,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=Ci(()=>{r?.(),this._removeListener(s)});return i instanceof xn?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*ff<=e.length){let r=0;for(let n=0;n<e.length;n++)e[n]?e[r++]=e[n]:s&&(this._deliveryQueue.end--,r<this._deliveryQueue.i&&this._deliveryQueue.i--);e.length=r}}_deliver(t,e){if(!t)return;let i=this._options?.onListenerError||cr;if(!i){t.value(e);return}try{t.value(e)}catch(s){i(s)}}_deliverQueue(t){let e=t.current._listeners;for(;t.i<t.end;)this._deliver(e[t.i++],t.value);t.reset()}fire(t){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof dr)this._deliver(this._listeners,t);else{let e=this._deliveryQueue;e.enqueue(this,t,this._listeners.length),this._deliverQueue(e)}this._perfMon?.stop()}hasListeners(){return this._size>0}},pf=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ph=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),mf;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof vf?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ph})})(mf||={});var vf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ph:(this._emitter||(this._emitter=new ut),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},pi="en",ur=!1,cs,bs=pi,oa=pi,Sf,Et,ri=globalThis,Ge;typeof ri.vscode<"u"&&typeof ri.vscode.process<"u"?Ge=ri.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ge=process);var wf=typeof Ge?.versions?.electron=="string",bf=wf&&Ge?.type==="renderer";if(typeof Ge=="object"){Ge.platform,Ge.platform,ur=Ge.platform==="linux",ur&&Ge.env.SNAP&&Ge.env.SNAP_REVISION,Ge.env.CI||Ge.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cs=pi,bs=pi;let t=Ge.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);cs=e.userLocale,oa=e.osLocale,bs=e.resolvedLanguage||pi,Sf=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!bf?(Et=navigator.userAgent,Et.indexOf("Windows")>=0,Et.indexOf("Macintosh")>=0,(Et.indexOf("Macintosh")>=0||Et.indexOf("iPad")>=0||Et.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ur=Et.indexOf("Linux")>=0,Et?.indexOf("Mobi")>=0,bs=globalThis._VSCODE_NLS_LANGUAGE||pi,cs=navigator.language.toLowerCase(),oa=cs):console.error("Unable to resolve platform.");var vt=Et,$t=bs,Cf;(t=>{function e(){return $t}t.value=e;function i(){return $t.length===2?$t==="en":$t.length>=3?$t[0]==="e"&&$t[1]==="n"&&$t[2]==="-":!1}t.isDefaultVariant=i;function s(){return $t==="en"}t.isDefault=s})(Cf||={});var yf=typeof ri.postMessage=="function"&&!ri.importScripts;(()=>{if(yf){let t=[];ri.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){let n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{let s=++e;t.push({id:s,callback:i}),ri.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var xf=!!(vt&&vt.indexOf("Chrome")>=0);vt&&vt.indexOf("Firefox")>=0;!xf&&vt&&vt.indexOf("Safari")>=0;vt&&vt.indexOf("Edg/")>=0;vt&&vt.indexOf("Android")>=0;function Oh(t,e=0,i){let s=setTimeout(()=>{t()},e);return Ci(()=>{clearTimeout(s)})}var kf;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(kf||={});var aa=class Qe{static fromArray(e){return new Qe(i=>{i.emitMany(e)})}static fromPromise(e){return new Qe(async i=>{i.emitMany(await e)})}static fromPromises(e){return new Qe(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new Qe(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ut,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await kn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new Qe(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return Qe.map(this,e)}static filter(e,i){return new Qe(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return Qe.filter(this,e)}static coalesce(e){return Qe.filter(e,i=>!!i)}coalesce(){return Qe.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return Qe.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};aa.EMPTY=aa.fromArray([]);var Lf=class extends Kt{constructor(t){super(),this._terminal=t,this._linesCacheTimeout=this._register(new Ts),this._linesCacheDisposables=this._register(new Ts),this._register(Ci(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Eh(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Oh(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(t){return this._linesCache?.[t]}setLineInCache(t,e){this._linesCache&&(this._linesCache[t]=e)}translateBufferLineToStringWithWrap(t,e){let i=[],s=[0],r=this._terminal.buffer.active.getLine(t);for(;r;){let n=this._terminal.buffer.active.getLine(t+1),o=n?n.isWrapped:!1,a=r.translateToString(!o&&e);if(o&&n){let l=r.getCell(r.length-1);l&&l.getCode()===0&&l.getWidth()===1&&n.getCell(0)?.getWidth()===2&&(a=a.slice(0,-1))}if(i.push(a),o)s.push(s[s.length-1]+a.length);else break;t++,r=n}return[i.join(""),s]}},Ef=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(t){this._cachedSearchTerm=t}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(t){this._lastSearchOptions=t}isValidSearchTerm(t){return!!(t&&t.length>0)}didOptionsChange(t){return this._lastSearchOptions?t?this._lastSearchOptions.caseSensitive!==t.caseSensitive||this._lastSearchOptions.regex!==t.regex||this._lastSearchOptions.wholeWord!==t.wholeWord:!1:!0}shouldUpdateHighlighting(t,e){return e?.decorations?this._cachedSearchTerm===void 0||t!==this._cachedSearchTerm||this.didOptionsChange(e):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},Mf=class{constructor(t,e){this._terminal=t,this._lineCache=e}find(t,e,i,s){if(!t||t.length===0){this._terminal.clearSelection();return}if(i>this._terminal.cols)throw new Error(`Invalid col: ${i} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let r={startRow:e,startCol:i},n=this._findInLine(t,r,s);if(!n)for(let o=e+1;o<this._terminal.buffer.active.baseY+this._terminal.rows&&(r.startRow=o,r.startCol=0,n=this._findInLine(t,r,s),!n);o++);return n}findNextWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=0,n=0;s&&(i===t?(r=s.end.x,n=s.end.y):(r=s.start.x,n=s.start.y)),this._lineCache.initLinesCache();let o={startRow:n,startCol:r},a=this._findInLine(t,o,e);if(!a)for(let l=n+1;l<this._terminal.buffer.active.baseY+this._terminal.rows&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);if(!a&&n!==0)for(let l=0;l<n&&(o.startRow=l,o.startCol=0,a=this._findInLine(t,o,e),!a);l++);return!a&&s&&(o.startRow=s.start.y,o.startCol=0,a=this._findInLine(t,o,e)),a}findPreviousWithSelection(t,e,i){if(!t||t.length===0){this._terminal.clearSelection();return}let s=this._terminal.getSelectionPosition();this._terminal.clearSelection();let r=this._terminal.buffer.active.baseY+this._terminal.rows-1,n=this._terminal.cols,o=!0;this._lineCache.initLinesCache();let a={startRow:r,startCol:n},l;if(s&&(a.startRow=r=s.start.y,a.startCol=n=s.start.x,i!==t&&(l=this._findInLine(t,a,e,!1),l||(a.startRow=r=s.end.y,a.startCol=n=s.end.x))),l||(l=this._findInLine(t,a,e,o)),!l){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let h=r-1;h>=0&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);}if(!l&&r!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let h=this._terminal.buffer.active.baseY+this._terminal.rows-1;h>=r&&(a.startRow=h,l=this._findInLine(t,a,e,o),!l);h--);return l}_isWholeWord(t,e,i){return(t===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t-1]))&&(t+i.length===e.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(e[t+i.length]))}_findInLine(t,e,i={},s=!1){let r=e.startRow,n=e.startCol;if(this._terminal.buffer.active.getLine(r)?.isWrapped){if(s){e.startCol+=this._terminal.cols;return}return e.startRow--,e.startCol+=this._terminal.cols,this._findInLine(t,e,i)}let o=this._lineCache.getLineFromCache(r);o||(o=this._lineCache.translateBufferLineToStringWithWrap(r,!0),this._lineCache.setLineInCache(r,o));let[a,l]=o,h=this._bufferColsToStringOffset(r,n),c=t,d=a;i.regex||(c=i.caseSensitive?t:t.toLowerCase(),d=i.caseSensitive?a:a.toLowerCase());let u=-1;if(i.regex){let f=RegExp(c,i.caseSensitive?"g":"gi"),g;if(s)for(;g=f.exec(d.slice(0,h));)u=f.lastIndex-g[0].length,t=g[0],f.lastIndex-=t.length-1;else g=f.exec(d.slice(h)),g&&g[0].length>0&&(u=h+(f.lastIndex-g[0].length),t=g[0])}else s?h-c.length>=0&&(u=d.lastIndexOf(c,h-c.length)):u=d.indexOf(c,h);if(u>=0){if(i.wholeWord&&!this._isWholeWord(u,d,t))return;let f=0;for(;f<l.length-1&&u>=l[f+1];)f++;let g=f;for(;g<l.length-1&&u+t.length>=l[g+1];)g++;let C=u-l[f],L=u+t.length-l[g],D=this._stringLengthToBufferSize(r+f,C),B=this._stringLengthToBufferSize(r+g,L)-D+this._terminal.cols*(g-f);return{term:t,col:D,row:r+f,size:B}}}_stringLengthToBufferSize(t,e){let i=this._terminal.buffer.active.getLine(t);if(!i)return 0;for(let s=0;s<e;s++){let r=i.getCell(s);if(!r)break;let n=r.getChars();n.length>1&&(e-=n.length-1);let o=i.getCell(s+1);o&&o.getWidth()===0&&e++}return e}_bufferColsToStringOffset(t,e){let i=t,s=0,r=this._terminal.buffer.active.getLine(i);for(;e>0&&r;){for(let n=0;n<e&&n<this._terminal.cols;n++){let o=r.getCell(n);if(!o)break;o.getWidth()&&(s+=o.getCode()===0?1:o.getChars().length)}if(i++,r=this._terminal.buffer.active.getLine(i),r&&!r.isWrapped)break;e-=this._terminal.cols}return s}},Tf=class extends Kt{constructor(t){super(),this._terminal=t,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(Ci(()=>this.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let i of t){let s=this._createResultDecorations(i,e,!1);if(s)for(let r of s)this._storeDecoration(r,i)}}createActiveDecoration(t,e){let i=this._createResultDecorations(t,e,!0);if(i)return{decorations:i,match:t,dispose(){Ki(i)}}}clearHighlightDecorations(){Ki(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,i){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),i&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,i){let s=[],r=t.col,n=t.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;n>0;){let l=Math.min(this._terminal.cols-r,n);s.push([o,r,l]),r=0,n-=l,o++}let a=[];for(let l of s){let h=this._terminal.registerMarker(l[0]),c=this._terminal.registerDecoration({marker:h,x:l[1],width:l[2],backgroundColor:i?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(h.line)?void 0:{color:i?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(c){let d=[];d.push(h),d.push(c.onRender(u=>this._applyStyles(u,i?e.activeMatchBorder:e.matchBorder,!1))),d.push(c.onDispose(()=>Ki(d))),a.push(c)}}return a.length===0?void 0:a}},Rf=class extends Kt{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new ut)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;e<this._searchResults.length;e++){let i=this._searchResults[e];if(i.row===t.row&&i.col===t.col&&i.size===t.size)return e}return-1}fireResultsChanged(t){if(!t)return;let e=-1;this._selectedDecoration&&(e=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:e,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},Df=class extends Kt{constructor(t){super(),this._highlightTimeout=this._register(new Ts),this._lineCache=this._register(new Ts),this._state=new Ef,this._resultTracker=this._register(new Rf),this._highlightLimit=t?.highlightLimit??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(t){this._terminal=t,this._lineCache.value=new Lf(t),this._engine=new Mf(t,this._lineCache.value),this._decorationManager=new Tf(t),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Ci(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=Oh(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findNextAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let i=[],s,r=this._engine.find(t,0,0,e);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(t,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,e);this._resultTracker.updateResults(i,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(i,e.decorations)}_findNextAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}findPrevious(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findPreviousAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}_selectResult(t,e,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let s=this._decorationManager.createActiveDecoration(t,e);s&&(this._resultTracker.selectedDecoration=s)}if(!i&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.row<this._terminal.buffer.active.viewportY)){let s=t.row-this._terminal.buffer.active.viewportY;s-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(s)}return!0}};const Gt=new Xi("TerminalStateMachine");var et=(t=>(t.UNINITIALIZED="uninitialized",t.INITIALIZING="initializing",t.CONNECTING="connecting",t.CONNECTED="connected",t.RECONNECTING="reconnecting",t.DISCONNECTED="disconnected",t.ERROR="error",t.DISPOSED="disposed",t))(et||{});class Bf{constructor(e){P(this,"currentState","uninitialized");P(this,"stateListeners",new Map);P(this,"transitionListeners",new Set);P(this,"errorHandlers",new Set);P(this,"transitions",[{from:["uninitialized"],to:"initializing",action:"initialize"},{from:["initializing"],to:"connecting",action:"connect"},{from:["connecting"],to:"connected",action:"connected"},{from:["disconnected","error"],to:"reconnecting",action:"reconnect"},{from:["reconnecting"],to:"connected",action:"reconnected"},{from:["connected","connecting"],to:"disconnected",action:"disconnect"},{from:["initializing","connecting","connected","reconnecting"],to:"error",action:"error"},{from:["uninitialized","initializing","connecting","connected","reconnecting","disconnected","error"],to:"disposed",action:"dispose"}]);this.terminalId=e}getState(){return this.currentState}canTransition(e){const i=this.transitions.find(s=>s.action===e&&s.from.includes(this.currentState));return!(!i||i.guard&&!i.guard())}transition(e){const i=this.transitions.find(r=>r.action===e&&r.from.includes(this.currentState));if(!i)return Gt.warn(`Invalid transition: ${e} from ${this.currentState}`),!1;if(i.guard&&!i.guard())return Gt.warn(`Guard failed for transition: ${e}`),!1;const s=this.currentState;return this.currentState=i.to,Gt.info(`Terminal ${this.terminalId}: ${s} -> ${this.currentState} (${e})`),this.notifyStateListeners(this.currentState),this.notifyTransitionListeners(s,this.currentState),!0}onStateChange(e,i){let s=this.stateListeners.get(e);return s||(s=new Set,this.stateListeners.set(e,s)),s.add(i),()=>{this.stateListeners.get(e)?.delete(i)}}onTransition(e){return this.transitionListeners.add(e),()=>{this.transitionListeners.delete(e)}}onError(e){return this.errorHandlers.add(e),()=>{this.errorHandlers.delete(e)}}reportError(e){Gt.error(`Terminal ${this.terminalId} error:`,e),this.errorHandlers.forEach(i=>{try{i(e)}catch(s){Gt.error("Error handler threw exception:",s)}}),this.currentState!=="disposed"&&this.transition("error")}isHealthy(){return["connected","connecting","reconnecting"].includes(this.currentState)}canAcceptInput(){return this.currentState==="connected"}isDisposed(){return this.currentState==="disposed"}notifyStateListeners(e){this.stateListeners.get(e)?.forEach(i=>{try{i()}catch(s){Gt.error("Error in state listener:",s)}})}notifyTransitionListeners(e,i){this.transitionListeners.forEach(s=>{try{s(e,i)}catch(r){Gt.error("Error in transition listener:",r)}})}dispose(){this.isDisposed()||this.transition("dispose"),this.stateListeners.clear(),this.transitionListeners.clear(),this.errorHandlers.clear()}}const ct=new Xi("TerminalBufferManager"),Ln="terminal-buffer-index";let Zt=null,an=0;const Af=5e3;function En(){const t=Date.now();if(Zt&&t-an<Af)return Zt;try{const e=localStorage.getItem(Ln);if(e){const i=JSON.parse(e);Zt=new Map(i.map(s=>[s.key,s.timestamp]))}else Zt=new Map}catch{Zt=new Map}return an=t,Zt}function Mn(t){try{const e=Array.from(t.entries()).map(([i,s])=>({key:i,timestamp:s}));localStorage.setItem(Ln,JSON.stringify(e)),Zt=t,an=Date.now()}catch{}}function ha(t,e){const i=En();i.set(t,e),Mn(i)}function la(t){const e=En();e.delete(t),Mn(e)}const $e=class $e{constructor(e,i){P(this,"storageKey");P(this,"fallbackStorage",new Map);this.workspaceId=e,this.terminalId=i,this.storageKey=`terminal-buffer-${e}-${i}`}async saveBuffer(e,i,s){try{const n={lines:this.trimBuffer(e),cursorX:i,cursorY:s,timestamp:Date.now(),version:$e.BUFFER_VERSION};if(await this.hasStorageSpace(n))try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),ct.debug(`Saved buffer for terminal ${this.terminalId}`),!0}catch(o){return ct.warn("localStorage failed, using fallback storage:",o),this.fallbackStorage.set(this.storageKey,n),!0}else{await this.cleanupOldBuffers();try{return localStorage.setItem(this.storageKey,JSON.stringify(n)),ha(this.storageKey,n.timestamp),!0}catch{return this.fallbackStorage.set(this.storageKey,n),!0}}}catch(r){return ct.error("Failed to save buffer:",r),!1}}async restoreBuffer(){try{const e=localStorage.getItem(this.storageKey);if(e){const s=JSON.parse(e);if(this.isValidSnapshot(s))return ct.debug(`Restored buffer for terminal ${this.terminalId}`),s;localStorage.removeItem(this.storageKey)}const i=this.fallbackStorage.get(this.storageKey);return i&&this.isValidSnapshot(i)?i:null}catch(e){return ct.error("Failed to restore buffer:",e),null}}async clearBuffer(){try{localStorage.removeItem(this.storageKey),this.fallbackStorage.delete(this.storageKey),la(this.storageKey)}catch(e){ct.error("Failed to clear buffer:",e)}}trimBuffer(e){for(;e.length>0&&!e[e.length-1].trim();)e.pop();return e.length>$e.MAX_BUFFER_SIZE&&(e=e.slice(-1e4)),e.map(i=>i.length>$e.MAX_LINE_LENGTH?`${i.substring(0,$e.MAX_LINE_LENGTH)}…`:i)}isValidSnapshot(e){return!(e.version!==$e.BUFFER_VERSION||Date.now()-e.timestamp>$e.RETENTION_PERIOD||!Array.isArray(e.lines))}async hasStorageSpace(e){try{const i=JSON.stringify(e).length;if("storage"in navigator&&"estimate"in navigator.storage){const s=await navigator.storage.estimate();return(s.quota||0)-(s.usage||0)>i+$e.STORAGE_QUOTA_BUFFER}return!0}catch{return!0}}async cleanupOldBuffers(){try{const e=[],i=Date.now(),s=En();for(const[r,n]of s)i-n>$e.RETENTION_PERIOD&&e.push(r);for(const r of e)localStorage.removeItem(r),la(r),ct.debug(`Cleaned up old buffer: ${r}`);s.size===0&&await this.rebuildBufferIndex()}catch(e){ct.error("Failed to cleanup old buffers:",e)}}async rebuildBufferIndex(){try{const e=new Map;for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);if(s?.startsWith("terminal-buffer-")&&s!==Ln)try{const r=localStorage.getItem(s);if(r){const n=JSON.parse(r);e.set(s,n.timestamp)}}catch{}}e.size>0&&(Mn(e),ct.debug(`Rebuilt buffer index with ${e.size} entries`))}catch(e){ct.error("Failed to rebuild buffer index:",e)}}getStats(){try{const e=localStorage.getItem(this.storageKey);if(e){const i=JSON.parse(e);return{size:e.length,lineCount:i.lines.length,age:Date.now()-i.timestamp}}return null}catch{return null}}};P($e,"BUFFER_VERSION",1),P($e,"MAX_BUFFER_SIZE",1e4),P($e,"MAX_LINE_LENGTH",1e3),P($e,"RETENTION_PERIOD",1440*60*1e3),P($e,"STORAGE_QUOTA_BUFFER",100*1024);let Rs=$e;const Pi=new Xi("TerminalThemeManager"),Se=class Se{constructor(e){P(this,"currentTheme");P(this,"customTerminalTheme",null);P(this,"themeObserver",null);P(this,"transitionTimeout",null);P(this,"darkModeQuery",null);P(this,"darkModeChangeHandler",null);P(this,"themeChangeHandler",null);this.container=e,this.currentTheme=this.detectSystemTheme(),this.setContainer(this.container??null),this.setupThemeObserver()}setContainer(e){this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.container&&this.container!==e&&(this.container.style.transition=""),this.container=e,this.container&&(this.container.style.backgroundColor=this.currentTheme.background||"transparent")}getCurrentTheme(){return this.currentTheme}applyTheme(e,i){const s=i||this.detectSystemTheme();if(s.name!==this.currentTheme.name)try{this.container&&(this.container.style.transition=`background-color ${Se.TRANSITION_DURATION}ms ease`),e.options.theme=s,this.container&&(this.container.style.backgroundColor=s.background||"transparent"),e.refresh(0,e.rows-1),this.currentTheme=s,Pi.debug(`Applied theme: ${s.name}`),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.container&&(this.container.style.transition="")},Se.TRANSITION_DURATION)}catch(r){Pi.error("Failed to apply theme:",r)}}detectSystemTheme(){if(this.customTerminalTheme)return this.customTerminalTheme;const e=document.documentElement.classList.contains("dark"),i=document.documentElement.classList.contains("light");if(e)return Se.DARK_THEME;if(i)return Se.LIGHT_THEME;const s=document.documentElement.getAttribute("data-theme");if(s==="dark")return Se.DARK_THEME;if(s==="light")return Se.LIGHT_THEME;const n=getComputedStyle(document.documentElement).getPropertyValue("--background").trim();return n&&this.isColorDark(n)||Hh.isDark()?Se.DARK_THEME:Se.LIGHT_THEME}isColorDark(e){const i=this.colorToRgb(e);return i?(.299*i.r+.587*i.g+.114*i.b)/255<.5:!1}colorToRgb(e){if(e.startsWith("#")){const s=e.slice(1);if(s.length===3)return{r:parseInt(s[0]+s[0],16),g:parseInt(s[1]+s[1],16),b:parseInt(s[2]+s[2],16)};if(s.length===6)return{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16)}}const i=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);return i?{r:parseInt(i[1]),g:parseInt(i[2]),b:parseInt(i[3])}:null}setupThemeObserver(){typeof window>"u"||(this.themeObserver=new MutationObserver(e=>{for(const i of e)if(i.type==="attributes"){const s=i.attributeName;if(s==="class"||s==="data-theme"){const r=this.detectSystemTheme();r.name!==this.currentTheme.name&&(Pi.debug(`Theme change detected: ${this.currentTheme.name} -> ${r.name}`),Hi("terminal-theme-changed",{theme:r}))}}}),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),this.darkModeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.darkModeChangeHandler=()=>{Pi.debug("System theme preference changed");const e=this.detectSystemTheme();e.name!==this.currentTheme.name&&Hi("terminal-theme-changed",{theme:e})},this.darkModeQuery.addEventListener("change",this.darkModeChangeHandler),this.themeChangeHandler=e=>{const i=e.detail?.isDark,s=e.detail?.terminalColors;let r;s&&Object.keys(s).length>0?(r={...i?Se.DARK_THEME:Se.LIGHT_THEME,...s,name:"custom",isDark:i},this.customTerminalTheme=r):(this.customTerminalTheme=null,r=i?Se.DARK_THEME:Se.LIGHT_THEME),(r.name!==this.currentTheme.name||s)&&(Pi.debug(`App theme changed to ${r.name}`),Hi("terminal-theme-changed",{theme:r}))},window.addEventListener("theme-changed",this.themeChangeHandler))}dispose(){this.themeObserver&&(this.themeObserver.disconnect(),this.themeObserver=null),this.darkModeQuery&&this.darkModeChangeHandler&&(this.darkModeQuery.removeEventListener("change",this.darkModeChangeHandler),this.darkModeQuery=null,this.darkModeChangeHandler=null),this.themeChangeHandler&&(window.removeEventListener("theme-changed",this.themeChangeHandler),this.themeChangeHandler=null),this.transitionTimeout&&(clearTimeout(this.transitionTimeout),this.transitionTimeout=null),this.setContainer(null)}};P(Se,"TRANSITION_DURATION",200),P(Se,"DARK_THEME",{name:"sleek-dark",isDark:!0,background:"#0B0B0E",foreground:"#e4e4e7",cursor:"#fbbf24",cursorAccent:"#1a1a1a",selectionBackground:"#3f3f46",selectionForeground:"#F7F7F7",selectionInactiveBackground:"#27272a",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#d4d4d8",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#f4f4f5"}),P(Se,"LIGHT_THEME",{name:"sleek-light",isDark:!1,background:"#F7F7F8",foreground:"#18181b",cursor:"#f59e0b",cursorAccent:"#F7F7F7",selectionBackground:"#e4e4e7",selectionForeground:"#09090b",selectionInactiveBackground:"#f4f4f5",black:"#18181b",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#e4e4e7",brightBlack:"#71717a",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#F7F7F7"});let hn=Se;const Yt=Uh("TerminalHistoryTracker"),Jt=class Jt{constructor(){P(this,"histories",new Map);P(this,"MAX_HISTORY_SIZE",10);P(this,"MAX_OUTPUT_LENGTH",500);P(this,"STORAGE_PREFIX","terminal-history-");P(this,"_updateCounter",zh(0));P(this,"updateCounter",{subscribe:this._updateCounter.subscribe});this.loadHistories()}notifyUpdate(){this._updateCounter.update(e=>e+1)}static getInstance(){return Jt.instance||(Jt.instance=new Jt),Jt.instance}getOrCreateHistory(e,i){let s=this.histories.get(e);return s||(s={terminalId:e,workspaceId:i,commands:[],currentOutput:"",isExecuting:!1},this.histories.set(e,s)),s}onCommandStart(e,i,s){const r=this.getOrCreateHistory(e,i),n=Wt(s);r.currentCommand=n,r.currentOutput="",r.isExecuting=!0,r.lastCommand=n,this.notifyUpdate(),Yt.debug(`Command started for terminal ${e}: ${n}`)}onOutput(e,i,s){const r=this.getOrCreateHistory(e,i);r.currentOutput.length<this.MAX_OUTPUT_LENGTH&&(r.currentOutput+=s,r.currentOutput.length>this.MAX_OUTPUT_LENGTH&&(r.currentOutput=`${r.currentOutput.substring(0,this.MAX_OUTPUT_LENGTH)}...`))}onCommandFinish(e,i){const s=this.getOrCreateHistory(e,i);if(s.currentCommand){const r=Wt(s.currentCommand),n={command:r,timestamp:Date.now(),output:s.currentOutput};s.commands.push(n),s.commands.length>this.MAX_HISTORY_SIZE&&(s.commands=s.commands.slice(-this.MAX_HISTORY_SIZE)),s.lastCommand=r,s.lastOutput=s.currentOutput,this.saveHistory(e,s),Yt.debug(`Command finished for terminal ${e}: ${r}`)}s.currentCommand=void 0,s.currentOutput="",s.isExecuting=!1,this.notifyUpdate()}getHistory(e){return this.histories.get(e)}getHistoriesForWorkspace(e){return Array.from(this.histories.values()).filter(i=>i.workspaceId===e)}getLastCommand(e){return this.histories.get(e)?.lastCommand}getLastOutput(e){return this.histories.get(e)?.lastOutput}saveHistory(e,i){try{const s=`${this.STORAGE_PREFIX}${e}`,r={terminalId:i.terminalId,workspaceId:i.workspaceId,commands:i.commands.slice(-5).map(n=>({...n,command:Wt(n.command)})),lastCommand:i.lastCommand?Wt(i.lastCommand):void 0,lastOutput:i.lastOutput?.substring(0,200)};localStorage.setItem(s,JSON.stringify(r))}catch(s){Yt.warn("Failed to save terminal history:",s)}}loadHistories(){try{const e=Object.keys(localStorage).filter(i=>i.startsWith(this.STORAGE_PREFIX));for(const i of e)try{const s=localStorage.getItem(i);if(s){const r=JSON.parse(s);r.terminalId&&this.histories.set(r.terminalId,{...r,currentOutput:"",isExecuting:!1,commands:r.commands||[]})}}catch(s){Yt.warn(`Failed to load terminal history for ${i}:`,s)}Yt.info(`Loaded ${this.histories.size} terminal histories from localStorage`)}catch(e){Yt.error("Failed to load terminal histories:",e)}}clearHistory(e){this.histories.delete(e);try{localStorage.removeItem(`${this.STORAGE_PREFIX}${e}`)}catch(i){Yt.warn("Failed to clear terminal history:",i)}}clearWorkspaceHistories(e){const i=[];for(const[s,r]of this.histories.entries())r.workspaceId===e&&i.push(s);for(const s of i)this.clearHistory(s)}};P(Jt,"instance");let ln=Jt;const Oi=ln.getInstance();function Pf(t,e){return setTimeout(()=>{try{t.dispose()}catch(i){if(e)e(i);else throw i}},0)}const Of=["panel.focus-next-column","panel.focus-previous-column","global.next-space-alt","global.previous-space-alt","navigation.go-to-tab","navigation.recent-agents"];function If(t,e,i,s=!1){const r=o=>An(o,e),n=s?r("navigation.go-to-device"):An("navigation.go-to-tab",e)===Pn["navigation.go-to-tab"]?Pn["navigation.go-to-device"]:null;return n&&On(t,n,i)>=0&&!In("navigation.go-to-device",t,r,i)?!0:Of.some(o=>On(t,r(o),i)>=0&&(o!=="navigation.go-to-tab"||!In(o,t,r,i)))}const $f=Df,I=new Xi("TerminalAdapter"),Ff=typeof process<"u"&&process.platform==="win32",Nf=100,Ae=class Ae{constructor(e){P(this,"xterm");P(this,"fitAddon");P(this,"searchAddon");P(this,"webLinksAddon");P(this,"webglAddon",null);P(this,"stateMachine");P(this,"bufferManager");P(this,"themeManager");P(this,"terminalId");P(this,"workspaceId");P(this,"container");P(this,"eventListeners",[]);P(this,"resizeObserver",null);P(this,"reattachFitObserver",null);P(this,"reattachFitTimer",null);P(this,"visibilityObserver",null);P(this,"wasVisible",!0);P(this,"isVisible",!0);P(this,"lastFittedSize",null);P(this,"resizeDebounceTimer",null);P(this,"bufferSaveTimer",null);P(this,"dataDisposable",null);P(this,"resizeDisposable",null);P(this,"selectionDisposable",null);P(this,"ipcCleanup",null);P(this,"themeCleanup",null);P(this,"webglContextLostCleanup",null);P(this,"isDisposed",!1);P(this,"isXtermOpened",!1);P(this,"autoReconnectTimer",null);P(this,"autoReconnectAttempts",0);P(this,"heartbeatTimer",null);P(this,"webglRecoveryAttempts",0);P(this,"exitedNormally",!1);P(this,"lastCwd");P(this,"isExecuting",!1);P(this,"startTime",Date.now());P(this,"commandBuffer","");P(this,"currentLineBuffer","");P(this,"isAtPrompt",!1);P(this,"callbacks");P(this,"terminals");this.workspaceId=e.workspaceId,this.terminalId=e.terminalId||`terminal-${Date.now()}-${Math.random().toString(36).substring(2,11)}`,this.container=e.container,this.terminals=(e.appClient??Wh).terminals,this.callbacks={onReady:e.onReady,onExit:e.onExit,onCommandStart:e.onCommandStart,onCommandFinished:e.onCommandFinished,onCwdChanged:e.onCwdChanged,onError:e.onError,onToggleSearch:e.onToggleSearch},this.stateMachine=new Bf(this.terminalId),this.setupStateMachineListeners(),this.bufferManager=new Rs(this.workspaceId,this.terminalId),this.themeManager=new hn(this.container);const i=e.fontFamily??jh.select(_t.state);this.xterm=new au({allowProposedApi:!0,fontFamily:i,fontSize:13,lineHeight:1.2,letterSpacing:0,cursorBlink:!0,cursorStyle:"block",cursorWidth:1,scrollback:1e4,allowTransparency:!0,windowsPty:Ff?{backend:"conpty"}:void 0,macOptionIsMeta:!0,rightClickSelectsWord:!0,convertEol:!0,drawBoldTextInBrightColors:!0,scrollSensitivity:1,theme:this.themeManager.getCurrentTheme()}),this.fitAddon=new cu,this.xterm.loadAddon(this.fitAddon),this.webLinksAddon=new pu((s,r)=>{this.handleLinkClick(r)}),this.xterm.loadAddon(this.webLinksAddon),this.searchAddon=new $f,this.xterm.loadAddon(this.searchAddon),this.searchAddon.onDidChangeResults(s=>{this.callbacks.onSearchResultsChange?.(s.resultIndex,s.resultCount)})}getSearchDecorations(){return{matchBackground:"#515c6a",matchBorder:"#515c6a",matchOverviewRuler:"#515c6a",activeMatchBackground:"#eab308",activeMatchBorder:"#ca8a04",activeMatchColorOverviewRuler:"#eab308"}}setupStateMachineListeners(){this.stateMachine.onTransition((e,i)=>{i===et.ERROR&&this.handleError(new Error(`Terminal entered error state from ${e}`)),(i===et.DISCONNECTED||i===et.ERROR)&&(this.stopHeartbeat(),this.exitedNormally||this.scheduleAutoReconnect()),i===et.CONNECTED&&(this.autoReconnectAttempts=0,this.cancelAutoReconnect(),this.startHeartbeat())}),this.stateMachine.onError(e=>{this.handleError(e)})}async initialize(e=!1){if(this.isDisposed)throw new Error("Cannot initialize disposed terminal");if(!this.container)throw new Error("Cannot initialize terminal without a container");const i=this.container;if(!this.stateMachine.canTransition("initialize"))throw new Error(`Cannot initialize terminal in state ${this.stateMachine.getState()}`);this.stateMachine.transition("initialize");try{this.isXtermOpened?I.warn(`[initialize] XTerm already opened for terminal ${this.terminalId}, skipping open()`):(this.xterm.open(i),this.isXtermOpened=!0,I.info(`[initialize] XTerm opened for terminal ${this.terminalId}`)),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer for light theme (better anti-aliasing)"),this.themeManager.applyTheme(this.xterm),this.fitTerminalToContainer()||(I.warn("Container has no dimensions, delaying fit"),setTimeout(()=>{this.fitTerminalToContainer()},100)),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.setupThemeChangeListener();const r=this.xterm.cols,n=this.xterm.rows,o=await this.findBackendTerminal(),a=o!==null;if(!e)if(a)try{const l=await this.terminals.getBuffer(this.terminalId,void 0,this.workspaceId);l&&(I.info(`Restoring ${l.length} bytes of buffered output from backend`),this.xterm.write(l),this.parseTerminalOutput(l))}catch(l){I.warn("Could not restore terminal buffer from backend:",l)}else{const l=await this.bufferManager.restoreBuffer();l&&(I.info("Restoring terminal buffer from local storage"),this.restoreFromSnapshot(l))}this.startBufferAutoSave(),this.stateMachine.transition("connect"),a?(this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.resize(r,n),o?.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.()):(I.debug(`[initialize] Terminal ${this.terminalId} creating new PTY`),await this.openPtyConnection(r,n)),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}catch(s){throw this.stateMachine.reportError(s),s}}async openPtyConnection(e,i){try{const s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_openFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("connected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(s){throw this.stateMachine.reportError(s),s}}async findBackendTerminal(){try{const{terminals:e}=await this.terminals.list(this.workspaceId);return e.find(i=>i.id===this.terminalId)??null}catch(e){return I.warn("Could not check terminal existence:",e),null}}async terminalExistsOnBackend(){return await this.findBackendTerminal()!==null}hideCursorOnExit(){this.isDisposed||(this.xterm.options.cursorBlink=!1,this.xterm.write("\x1B[?25l"))}restoreCursor(){this.isDisposed||(this.xterm.options.cursorBlink=!0,this.xterm.write("\x1B[?25h"))}setupXTermEventHandlers(){this.container&&(this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.resizeDisposable&&(this.resizeDisposable.dispose(),this.resizeDisposable=null),this.selectionDisposable&&(this.selectionDisposable.dispose(),this.selectionDisposable=null),this.xterm.attachCustomKeyEventHandler(e=>{const i=navigator.platform.toUpperCase().includes("MAC"),s=i?e.metaKey:e.ctrlKey;return e.metaKey&&e.key==="k"&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.clear(),!1):s&&e.key==="j"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(Bn(this.workspaceId)),!1):s&&e.key==="f"&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&this.callbacks.onToggleSearch?.(),!1):s&&(e.key==="t"||e.key==="T")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&Hi("workspace:new-terminal",{workspaceId:this.workspaceId}),!1):s&&(e.key==="w"||e.key==="W")&&!e.shiftKey&&!e.altKey?(e.type==="keydown"&&_t.dispatch(qh(this.workspaceId)),!1):If(e,_t.state.userPreferences?.shortcutOverrides??{},i,_t.state.machineRail?.enabled??!1)||s&&e.shiftKey&&!e.altKey&&(e.key==="]"||e.key==="}"||e.key==="["||e.key==="{")?!1:e.ctrlKey&&!e.metaKey&&!e.altKey&&(e.key==="`"||e.key==="~")?(e.type==="keydown"&&(e.shiftKey||e.key==="~"?Hi("workspace:new-terminal",{workspaceId:this.workspaceId}):_t.dispatch(Bn(this.workspaceId))),!1):!0}),this.dataDisposable=this.xterm.onData(e=>{this.isDisposed||this.write(e)}),this.resizeDisposable=this.xterm.onResize(({cols:e,rows:i})=>{!this.isDisposed&&this.stateMachine.canAcceptInput()&&this.resize(e,i)}),this.selectionDisposable=this.xterm.onSelectionChange(()=>{}))}setupIpcEventHandlers(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null);let e=!1;const i=this.terminals.subscribeEvents(this.terminalId,{onData:({chunk:s})=>{e||this.isDisposed||this.stateMachine.canAcceptInput()&&(this.xterm.write(s),this.parseTerminalOutput(s))},onExit:({exitCode:s})=>{e||this.isDisposed||(this.exitedNormally=!0,this.hideCursorOnExit(),this.callbacks.onExit?.(s),this.stateMachine.transition("disconnect"))},onCwd:({cwd:s})=>{e||this.isDisposed||(this.lastCwd=s,this.callbacks.onCwdChanged?.(s))}},this.workspaceId);this.ipcCleanup=()=>{e=!0;try{i()}catch(s){I.warn("Failed to unsubscribe terminal events:",s)}}}setupResizeObserver(){if(!this.container||!this.isVisible)return;const e=this.container;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e),this.setupVisibilityObserver()}setupVisibilityObserver(){if(!this.container)return;const e=this.container;this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.visibilityObserver=new IntersectionObserver(i=>{for(const s of i){const r=s.isIntersecting;r&&!this.wasVisible&&(I.debug(`[visibility] Terminal ${this.terminalId} became visible, reconnecting ResizeObserver`),this.resizeObserver||(this.resizeObserver=new ResizeObserver(()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=setTimeout(()=>{this.fitTerminalToContainer()},100)}),this.resizeObserver.observe(e)),this.fitTerminalToContainer()),this.wasVisible=r}}),this.visibilityObserver.observe(e)}loadWebglAddon(){this.disposeWebglAddon();try{this.webglAddon=new Z_,this.xterm.loadAddon(this.webglAddon);const e=this.xterm.element?.querySelector("canvas");if(e){const i=s=>{s.preventDefault(),I.warn(`[WebGL] Context lost for terminal ${this.terminalId}, recovering...`),!this.isDisposed&&(this.disposeWebglAddon(),setTimeout(()=>{if(this.isDisposed)return;if(!this.themeManager.getCurrentTheme().isDark){I.info("[WebGL] Skipping WebGL recovery on light theme, using Canvas renderer");return}if(this.webglRecoveryAttempts>=Ae.MAX_WEBGL_RECOVERY_ATTEMPTS){I.warn(`[WebGL] Max recovery attempts (${Ae.MAX_WEBGL_RECOVERY_ATTEMPTS}) reached for terminal ${this.terminalId}, staying on Canvas renderer`);return}this.webglRecoveryAttempts++;try{this.loadWebglAddon(),I.info(`[WebGL] Successfully recovered from context loss (attempt ${this.webglRecoveryAttempts})`)}catch(n){I.warn("[WebGL] Failed to recover from context loss, falling back to Canvas renderer:",n),this.webglAddon=null}},100))};e.addEventListener("webglcontextlost",i),this.webglContextLostCleanup=()=>{e.removeEventListener("webglcontextlost",i)}}}catch(e){I.warn("Failed to load WebGL renderer, falling back to Canvas renderer:",e),this.webglAddon=null}}disposeWebglAddon(){if(this.webglContextLostCleanup&&(this.webglContextLostCleanup(),this.webglContextLostCleanup=null),this.webglAddon){try{this.webglAddon.dispose()}catch(e){I.warn("Error disposing WebGL addon:",e)}this.webglAddon=null}}setupThemeChangeListener(){this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null);const e=i=>{const s=i.detail?.theme;s&&this.xterm&&(I.info(`[Theme] Theme changed to: ${s.name} (isDark: ${s.isDark})`),this.themeManager.applyTheme(this.xterm,s),s.isDark?this.webglAddon||this.loadWebglAddon():this.webglAddon&&(this.disposeWebglAddon(),I.info("[WebGL] Disposed WebGL addon for light theme (using Canvas renderer)")))};window.addEventListener("terminal-theme-changed",e),this.themeCleanup=()=>{window.removeEventListener("terminal-theme-changed",e)}}parseTerminalOutput(e){Oi.onOutput(this.terminalId,this.workspaceId,e),e.includes("\x1B]133;C\x07")?(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId)),this.commandBuffer="",this.isAtPrompt=!0):e.includes("\x1B]133;A\x07")&&(this.isExecuting||(this.isExecuting=!0,this.callbacks.onCommandStart?.()),this.isAtPrompt=!0,this.commandBuffer="");const i=/[\$%]\s*$/,s=/^.*[\$%]\s+(.+)$/,r=e.split(/\r?\n/);for(const o of r){const a=o.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b\][^\x1b]*\x1b\\/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x1b[=>]/g,"").replace(/\x1b[78]/g,"").replace(/\x1b[DME]/g,"").replace(/\x1b[HZ]/g,"").replace(/\x1b[c]/g,"").replace(/\[\?[0-9;]*[a-zA-Z]/g,"").replace(/\x07/g,"").replace(/\x00-\x08\x0b\x0c\x0e-\x1f/g,"").trim();if(!a||/^\[[\?0-9;]*[a-zA-Z]$/.test(a))continue;const l=a.match(s);if(l&&l[1]){const h=l[1].trim(),c=/^[a-zA-Z0-9.\/~]/.test(h);h.length>0&&!this.isExecuting&&c?(I.info(`[TerminalAdapter] Detected command from output: ${Wt(h)}`),Oi.onCommandStart(this.terminalId,this.workspaceId,h),this.isExecuting=!0,this.callbacks.onCommandStart?.()):h.length>0&&!c&&I.debug(`[TerminalAdapter] Skipping suspicious command detection: ${Wt(h)}`)}i.test(a)&&!l&&(this.isExecuting&&(this.isExecuting=!1,this.callbacks.onCommandFinished?.(),Oi.onCommandFinish(this.terminalId,this.workspaceId),I.debug(`[TerminalAdapter] Command finished, prompt detected: ${Wt(a)}`)),this.isAtPrompt=!0,this.commandBuffer="")}const n=e.match(/\x1b\]7;file:\/\/[^/]*([^\x07]*)\x07/);if(n){const o=decodeURIComponent(n[1]);o!==this.lastCwd&&(this.lastCwd=o,this.callbacks.onCwdChanged?.(o))}}startBufferAutoSave(){this.bufferSaveTimer=setInterval(()=>{this.stateMachine?.canAcceptInput()&&this.saveBuffer()},5e3)}async saveBuffer(){try{const e=this.xterm.buffer.active,i=[];for(let s=0;s<e.length;s++){const r=e.getLine(s);r&&i.push(r.translateToString(!0))}await this.bufferManager.saveBuffer(i,e.cursorX,e.cursorY)}catch(e){I.error("Failed to save buffer:",e)}}restoreFromSnapshot(e){if(e.lines&&e.lines.length>0){this.xterm.clear();const i=[...e.lines];for(;i.length>0&&i[i.length-1].trim()==="";)i.pop();const s=/[\$>#%]\s*$/,r=/@[\w-]+/;if(i.length>0){const n=i[i.length-1],o=i.length>1?i[i.length-2]:"";if(s.test(n)&&r.test(n))i.pop();else if(s.test(n)&&n.trim().length<80)i.pop(),i.length>0&&r.test(i[i.length-1])&&i.pop();else if(i.length>=2){const a=o+n;s.test(a)&&r.test(a)&&(i.pop(),i.pop())}}for(let n=0;n<i.length;n++)n<i.length-1?this.xterm.writeln(i[n]):i[n].trim()&&this.xterm.writeln(i[n]);I.debug(`Restored terminal buffer for ${this.terminalId} with ${i.length} lines (prompt removed)`)}}getCommandFromXtermBuffer(){try{const e=this.xterm.buffer.active,i=e.cursorY+e.baseY,s=e.getLine(i);if(!s)return null;const r=s.translateToString(!0);if(!r||!r.trim())return null;const n=r.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g,"").replace(/\x1b\][^\x07]*\x07/g,"").replace(/\x1b[()][AB0-2]/g,"").replace(/\x07/g,"").trim();if(!n)return null;const o=n.match(/^.*[\$%#❯➜]\s+(.+)$/);return o&&o[1]?o[1].trim():null}catch{return null}}write(e){if(!(this.isDisposed||!this.stateMachine.canAcceptInput())){if(e==="\r"||e===`
|
|
142
142
|
`){const i=this.getCommandFromXtermBuffer(),s=i||this.commandBuffer.trim();s&&(Oi.onCommandStart(this.terminalId,this.workspaceId,s),this.isExecuting=!0,I.debug(`Command executed: ${Wt(s)}${i?" (from xterm buffer)":" (from keystroke buffer)"}`)),this.commandBuffer="",this.currentLineBuffer=""}else e===""||e==="\b"?this.commandBuffer.length>0&&(this.commandBuffer=this.commandBuffer.slice(0,-1)):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e===""?(this.commandBuffer="",this.currentLineBuffer=""):e.match(/[\x00-\x1F\x7F]/)||(this.commandBuffer+=e,this.currentLineBuffer+=e);this.terminals.write(this.terminalId,e,this.workspaceId).then(i=>{i.success||I.error(`[write] Terminal ${this.terminalId}: write failed - ${i.error}`)}).catch(i=>{I.error(`[write] Terminal ${this.terminalId}: transport error - ${i}`),this.isDisposed||this.stateMachine.reportError(i)})}}resize(e,i){this.isDisposed||!this.stateMachine.canAcceptInput()||this.terminals.resize(this.terminalId,e,i,this.workspaceId).catch(s=>{I.error("Failed to resize terminal:",s)})}focus(){!this.isDisposed&&this.isVisible&&this.xterm.focus()}blur(){this.isDisposed||this.xterm.blur()}setVisible(e){if(!(this.isDisposed||this.isVisible===e)){if(this.isVisible=e,this.wasVisible=e,!e){this.xterm.blur(),this.disconnectLayoutObservers();return}this.setupResizeObserver(),requestAnimationFrame(()=>this.fitTerminalToContainer())}}fitTerminalToContainer(){if(this.isDisposed||!this.isVisible||!this.container)return!1;const{width:e,height:i}=this.container.getBoundingClientRect();return e<=0||i<=0?!1:(this.lastFittedSize?.width===e&&this.lastFittedSize.height===i||(this.fitAddon.fit(),this.lastFittedSize={width:e,height:i}),!0)}disconnectLayoutObservers(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.visibilityObserver?.disconnect(),this.visibilityObserver=null,this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null)}fitAfterReattach(e){if(this.cancelReattachFit(),this.fitReattachedContainer(e))return;const i=new ResizeObserver(()=>{if(this.reattachFitObserver!==i){i.disconnect();return}this.hasReattachedContainerBox(e)&&(this.reattachFitTimer&&clearTimeout(this.reattachFitTimer),this.reattachFitTimer=setTimeout(()=>{this.reattachFitTimer=null,this.fitReattachedContainer(e)&&this.cancelReattachFit()},Nf))});this.reattachFitObserver=i,i.observe(e)}fitReattachedContainer(e){if(this.isDisposed||this.container!==e)return!0;if(!this.hasReattachedContainerBox(e))return!1;const{width:i,height:s}=e.getBoundingClientRect();return this.fitAddon.fit(),this.lastFittedSize={width:i,height:s},this.xterm.refresh(0,this.xterm.rows-1),!0}hasReattachedContainerBox(e){if(!this.isVisible)return!1;const{width:i,height:s}=e.getBoundingClientRect();return i>0&&s>0}cancelReattachFit(){this.reattachFitObserver?.disconnect(),this.reattachFitObserver=null,this.reattachFitTimer&&(clearTimeout(this.reattachFitTimer),this.reattachFitTimer=null)}clear(){this.isDisposed||this.xterm.clear()}async reattach(e){if(this.isDisposed||this.stateMachine.isDisposed())throw new Error("Cannot reattach disposed terminal");this.cancelAutoReconnect(),this.autoReconnectAttempts=0,this.webglRecoveryAttempts=0,this.exitedNormally=!1,this.setupIpcEventHandlers();const i=this.stateMachine.getState();if(i!==et.CONNECTED){I.info(`[reattach] Terminal ${this.terminalId} not in CONNECTED state (${i}), attempting to restore`);const n=await this.findBackendTerminal();n&&(i===et.DISCONNECTED||i===et.ERROR?(this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected")):i===et.CONNECTING&&this.stateMachine.transition("connected"),n.isExecuting===!1&&this.hideCursorOnExit(),I.info(`[reattach] Terminal ${this.terminalId} state restored to ${this.stateMachine.getState()}`))}const s=this.xterm.element;if(s){e.appendChild(s),this.container=e,this.themeManager.setContainer(e),this.disposeWebglAddon(),this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer after move (light theme)"),this.fitAfterReattach(e),this.setupResizeObserver(),this.setupXTermEventHandlers(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()});return}I.warn(`Could not move terminal element, recreating for terminal ${this.terminalId}`),this.container&&(this.container.innerHTML=""),this.disposeWebglAddon(),this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.container=e,this.themeManager.setContainer(e),this.isXtermOpened&&I.warn(`[reattach] XTerm was already opened for terminal ${this.terminalId}, calling open() again may cause duplicate handlers`),this.xterm.open(e),this.isXtermOpened=!0,this.themeManager.applyTheme(this.xterm),this.themeManager.getCurrentTheme().isDark?this.loadWebglAddon():I.debug("[Renderer] Using Canvas renderer on reattach (light theme)"),this.fitAfterReattach(e),this.setupXTermEventHandlers(),this.setupResizeObserver(),this.commandBuffer="",this.currentLineBuffer="",this.isAtPrompt=!1,this.startHeartbeat(),requestAnimationFrame(()=>{!this.isDisposed&&this.isVisible&&this.xterm.focus()})}updateCallbacks(e){Object.assign(this.callbacks,e)}updateFontFamily(e){this.isDisposed||this.xterm.options.fontFamily!==e&&(this.xterm.options.fontFamily=e)}findNext(e,i){return this.searchAddon.findNext(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}findPrevious(e,i){return this.searchAddon.findPrevious(e,{caseSensitive:i?.caseSensitive??!1,wholeWord:i?.wholeWord??!1,regex:i?.regex??!1,incremental:!1,decorations:this.getSearchDecorations()})}clearSearch(){this.searchAddon.clearDecorations()}getSelection(){return this.xterm.getSelection()}getInfo(){const e=this.bufferManager.getStats();return{id:this.terminalId,workspaceId:this.workspaceId,state:this.stateMachine.getState(),cwd:this.lastCwd,isExecuting:this.isExecuting,stats:e?{bufferSize:e.size,lineCount:e.lineCount,uptime:Date.now()-this.startTime}:void 0}}startHeartbeat(){this.heartbeatTimer||this.isDisposed||(I.debug(`[heartbeat] Starting for terminal ${this.terminalId} (every ${Ae.HEARTBEAT_INTERVAL_MS}ms)`),this.heartbeatTimer=setInterval(()=>{this.performHealthCheck()},Ae.HEARTBEAT_INTERVAL_MS))}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null,I.debug(`[heartbeat] Stopped for terminal ${this.terminalId}`))}async performHealthCheck(){if(this.isDisposed||!this.ipcCleanup||this.stateMachine.getState()!==et.CONNECTED)return;let e=null;try{const i=await Promise.race([this.terminalExistsOnBackend(),new Promise((s,r)=>{e=setTimeout(()=>r(new Error("Heartbeat timeout")),Ae.HEARTBEAT_TIMEOUT_MS)})]);if(e&&clearTimeout(e),this.isDisposed)return;i||(I.warn(`[heartbeat] Terminal ${this.terminalId}: PTY not found on backend, transitioning to DISCONNECTED`),this.stopHeartbeat(),this.stateMachine.transition("disconnect"))}catch(i){if(e&&clearTimeout(e),this.isDisposed)return;I.warn(`[heartbeat] Terminal ${this.terminalId}: health check failed:`,i),this.stopHeartbeat(),this.stateMachine.transition("disconnect")}}scheduleAutoReconnect(){if(this.isDisposed)return;if(this.autoReconnectAttempts>=Ae.MAX_RECONNECT_ATTEMPTS){I.warn(`[auto-reconnect] Terminal ${this.terminalId}: max reconnect attempts (${Ae.MAX_RECONNECT_ATTEMPTS}) reached, giving up`);return}this.cancelAutoReconnect();const e=Ae.BASE_RECONNECT_DELAY_MS*Math.pow(2,this.autoReconnectAttempts);this.autoReconnectAttempts++,I.info(`[auto-reconnect] Terminal ${this.terminalId}: scheduling attempt ${this.autoReconnectAttempts}/${Ae.MAX_RECONNECT_ATTEMPTS} in ${e}ms`),this.autoReconnectTimer=setTimeout(()=>{this.autoReconnectTimer=null,this.attemptAutoReconnect()},e)}cancelAutoReconnect(){this.autoReconnectTimer&&(clearTimeout(this.autoReconnectTimer),this.autoReconnectTimer=null)}async attemptAutoReconnect(){if(this.isDisposed)return;const e=this.stateMachine.getState();if(e!==et.DISCONNECTED&&e!==et.ERROR){I.debug(`[auto-reconnect] Terminal ${this.terminalId}: skipping, state is ${e}`);return}this.exitedNormally=!1,I.info(`[auto-reconnect] Terminal ${this.terminalId}: attempting reconnect (attempt ${this.autoReconnectAttempts})`);try{const i=await this.findBackendTerminal();if(this.isDisposed)return;i?(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY exists on backend, re-establishing connection`),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnect"),this.stateMachine.transition("reconnected"),this.xterm.cols&&this.xterm.rows&&this.resize(this.xterm.cols,this.xterm.rows),i.isExecuting===!1&&this.hideCursorOnExit(),this.callbacks.onReady?.(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: reconnected successfully`)):(I.info(`[auto-reconnect] Terminal ${this.terminalId}: PTY not found, creating new PTY`),await this.reconnect(),I.info(`[auto-reconnect] Terminal ${this.terminalId}: new PTY created successfully`))}catch(i){I.error(`[auto-reconnect] Terminal ${this.terminalId}: attempt ${this.autoReconnectAttempts} failed:`,i),this.scheduleAutoReconnect()}}handleError(e){I.error(`Terminal ${this.terminalId} error:`,e),this.callbacks.onError?.(e),this.isDisposed||this.xterm.writeln(`\r
|
|
143
143
|
\x1B[31m${$s.terminal_adapter_errorLine_label({message:e.message})}\x1B[0m\r
|
|
144
|
-
`)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./
|
|
144
|
+
`)}handleLinkClick(e){try{if(Kh(e)||this.workspaceId===Vh){I.debug("Opening terminal link in external browser",{uri:e,workspaceId:this.workspaceId}),Fs("shell:openExternal",{url:e});return}Dn(async()=>{const{resolveBrowserLinkForOpen:i}=await import("./CBafvv8h.js").then(s=>s.b);return{resolveBrowserLinkForOpen:i}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url).then(({resolveBrowserLinkForOpen:i})=>i(e)).catch(()=>({url:e})).then(i=>{Dn(async()=>{const{getPanelLayoutManager:s}=await import("./BmBa9vQp.js").then(r=>r.p);return{getPanelLayoutManager:s}},__vite__mapDeps([32,21,22,5,23,24,3,8,4,25,15,2,33]),import.meta.url).then(({getPanelLayoutManager:s})=>{s(this.workspaceId).openBrowserPanel(i.url,void 0,void 0,i.requestedUrl),I.debug("Opened URL in browser panel",{uri:e,resolvedUrl:i.url,workspaceId:this.workspaceId})}).catch(s=>{I.warn("Failed to open URL in browser panel, falling back to external browser",{uri:e,error:s}),Fs("shell:openExternal",{url:i.url})})})}catch(i){I.warn("Failed to handle link click",{uri:e,error:i}),Fs("shell:openExternal",{url:e})}}async reconnect(){if(this.isDisposed)throw new Error("Cannot reconnect disposed terminal");if(!this.stateMachine.canTransition("reconnect"))throw new Error(`Cannot reconnect in state ${this.stateMachine.getState()}`);this.exitedNormally=!1,this.stateMachine.transition("reconnect");try{const e=this.xterm.cols,i=this.xterm.rows,s=await this.terminals.create({workspaceId:this.workspaceId,cols:e,rows:i});if(!s.success)throw new Error(s.error||$s.terminal_adapter_reconnectFailed_error());s.id&&(this.terminalId=s.id),this.setupIpcEventHandlers(),this.stateMachine.transition("reconnected"),this.restoreCursor(),this.callbacks.onReady?.()}catch(e){throw this.stateMachine.reportError(e),e}}detach(){this.ipcCleanup&&(this.ipcCleanup(),this.ipcCleanup=null),this.stopHeartbeat(),this.cancelAutoReconnect(),this.cancelReattachFit(),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null);const e=this.xterm.element;e&&e.parentNode&&e.parentNode.removeChild(e),this.themeManager.setContainer(null),this.container=null}dispose(e={}){if(!(this.isDisposed||this.stateMachine.isDisposed())){if(this.isDisposed=!0,this.cancelAutoReconnect(),this.stopHeartbeat(),this.cancelReattachFit(),this.stateMachine.transition("dispose"),this.saveBuffer().catch(()=>{}),this.resizeDebounceTimer&&(clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=null),this.bufferSaveTimer&&(clearInterval(this.bufferSaveTimer),this.bufferSaveTimer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.visibilityObserver&&(this.visibilityObserver.disconnect(),this.visibilityObserver=null),this.dataDisposable){try{this.dataDisposable.dispose()}catch(i){I.error("Error disposing data handler:",i)}this.dataDisposable=null}if(this.resizeDisposable){try{this.resizeDisposable.dispose()}catch(i){I.error("Error disposing resize handler:",i)}this.resizeDisposable=null}if(this.selectionDisposable){try{this.selectionDisposable.dispose()}catch(i){I.error("Error disposing selection handler:",i)}this.selectionDisposable=null}if(this.ipcCleanup){try{this.ipcCleanup()}catch(i){I.error("Error cleaning up IPC handlers:",i)}this.ipcCleanup=null}if(this.themeCleanup){try{this.themeCleanup()}catch(i){I.error("Error cleaning up theme listener:",i)}this.themeCleanup=null}this.eventListeners.forEach(i=>{try{i()}catch(s){I.error("Error cleaning up event listener:",s)}}),this.eventListeners=[],e.killPty!==!1&&this.terminals.kill(this.terminalId,this.workspaceId).catch(i=>{I.error("Error killing PTY connection:",i)});try{this.searchAddon?.dispose&&this.searchAddon.dispose(),this.webLinksAddon?.dispose&&this.webLinksAddon.dispose(),this.disposeWebglAddon(),this.fitAddon?.dispose&&this.fitAddon.dispose()}catch(i){I.error("Error disposing addons:",i)}try{this.themeManager.dispose()}catch(i){I.error("Error disposing theme manager:",i)}try{this.stateMachine.dispose()}catch(i){I.error("Error disposing state machine:",i)}Pf(this.xterm,i=>{I.error("Error disposing xterm:",i)})}}};P(Ae,"MAX_RECONNECT_ATTEMPTS",5),P(Ae,"BASE_RECONNECT_DELAY_MS",1e3),P(Ae,"HEARTBEAT_INTERVAL_MS",3e4),P(Ae,"HEARTBEAT_TIMEOUT_MS",1e4),P(Ae,"MAX_WEBGL_RECOVERY_ATTEMPTS",3);let cn=Ae;const le=new Xi("TerminalManager");class zf{constructor(){P(this,"terminals",new Map)}saveTerminalMetadata(e,i,s){try{_t.dispatch(Gh(i,e,s,new Date().toISOString())),le.debug(`[RendererTerminalManager] Saved terminal metadata for ${e}`)}catch(r){le.error("[RendererTerminalManager] Failed to save terminal metadata:",r)}}loadTerminalMetadata(e){try{return Zh.select(_t.state,e).map(i=>({terminalId:i.id,workspaceId:i.workspaceId??e,createdAt:i.createdAt??"",title:i.customName||Jh(i.name)}))}catch(i){le.error("[RendererTerminalManager] Failed to load terminal metadata:",i)}return[]}removeTerminalMetadata(e,i){try{_t.dispatch(Yh(i,e)),le.debug(`[RendererTerminalManager] Removed terminal metadata for ${e}`)}catch(s){le.error("[RendererTerminalManager] Failed to remove terminal metadata:",s)}}hasTerminal(e){return this.terminals.has(e)}async getOrCreateTerminal(e,i,s,r,n=!1){let o=this.terminals.get(e);if(n&&o&&(le.info(`[RendererTerminalManager] Force creating new terminal, disposing existing: ${e}`),this.disposeTerminal(e),o=void 0),o)if(o.workspaceId!==i)le.warn(`[RendererTerminalManager] Terminal ${e} has mismatched workspaceId (has: ${o.workspaceId}, requested: ${i}). Disposing and recreating.`),this.disposeTerminal(e),o=void 0;else return le.info(`[RendererTerminalManager] Reattaching to existing terminal: ${e} (was attached: ${o.isAttached})`),o.container=s,o.isAttached=!0,await o.adapter.reattach(s),r&&(o.adapter.updateCallbacks(r),r.onReady?.()),le.info(`[RendererTerminalManager] Successfully reattached terminal: ${e}`),o.adapter;le.info(`[RendererTerminalManager] Creating new terminal: ${e}`);const a=new cn({workspaceId:i,terminalId:e,container:s,...r});return o={adapter:a,terminalId:e,workspaceId:i,isAttached:!0,container:s},this.terminals.set(e,o),this.saveTerminalMetadata(e,i),await a.initialize(n),a}isAttachedTo(e,i){const s=this.terminals.get(e);return!!s&&s.isAttached&&s.container===i}detachTerminal(e,i){const s=this.terminals.get(e);if(s){if(i&&s.container!==i){le.info(`[RendererTerminalManager] Ignoring detach from a stale surface: ${e}`);return}le.info(`[RendererTerminalManager] Detaching terminal: ${e}`),s.isAttached=!1,s.adapter.detach(),s.container=null}}disposeTerminal(e,i){const s=this.terminals.get(e);s?(le.info(`[RendererTerminalManager] Disposing terminal: ${e}`),s.adapter.dispose(),this.terminals.delete(e),this.removeTerminalMetadata(e,s.workspaceId)):_t.dispatch(Xh(e,i))}disposeExitedTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Disposing exited terminal: ${e}`),i.adapter.dispose({killPty:!1}),this.terminals.delete(e))}clearTerminal(e){const i=this.terminals.get(e);i&&(le.info(`[RendererTerminalManager] Clearing terminal: ${e}`),i.adapter.clear())}getTerminalInfo(e){const i=this.terminals.get(e);return i?i.adapter.getInfo():null}async getBufferContent(e,i){const s=this.terminals.get(e);if(s?.adapter)try{const r=s.adapter.xterm;if(r?.buffer?.active){const n=r.buffer.active,o=[];for(let a=0;a<n.length;a++){const l=n.getLine(a);l&&o.push(l.translateToString(!0))}for(;o.length>0&&!o[o.length-1].trim();)o.pop();if(o.length>0)return o.join(`
|
|
145
145
|
`)}}catch(r){le.warn("[RendererTerminalManager] Failed to read live buffer, falling back:",r)}try{const n=await new Rs(i,e).restoreBuffer();if(n&&n.lines.length>0){const o=[...n.lines];for(;o.length>0&&!o[o.length-1].trim();)o.pop();return o.join(`
|
|
146
146
|
`)}}catch(r){le.error("[RendererTerminalManager] Failed to read persisted buffer:",r)}return null}disposeWorkspaceTerminals(e){const i=[];for(const[s,r]of this.terminals)r.workspaceId===e&&i.push(s);if(i.length>0){le.info(`[RendererTerminalManager] Disposing ${i.length} terminals for workspace ${e}`);for(const s of i)try{const r=this.terminals.get(s);r&&(r.adapter.dispose(),this.terminals.delete(s))}catch(r){le.error(`[RendererTerminalManager] Failed to dispose terminal ${s}:`,r)}}}disposeAll(){le.info(`[RendererTerminalManager] Disposing all ${this.terminals.size} terminals`);for(const[e,i]of this.terminals)try{i.adapter.dispose()}catch(s){le.error(`[RendererTerminalManager] Failed to dispose terminal ${e}:`,s)}this.terminals.clear()}}typeof window<"u"&&!window.__terminalManager&&(window.__terminalManager=new zf);const Wf=window.__terminalManager,Tp=Object.freeze(Object.defineProperty({__proto__:null,terminalManager:Wf},Symbol.toStringTag,{value:"Module"}));export{au as D,pu as L,hn as T,Wf as a,Tp as b,Pf as d,cu as o,Oi as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{J4 as o,nM as d,nL as n,oD as i,bl as a,rY as S,ps as p,oA as k}from"./
|
|
1
|
+
import{J4 as o,nM as d,nL as n,oD as i,bl as a,rY as S,ps as p,oA as k}from"./CbRsc9i4.js";import{bl as g,b4 as m,dQ as v,dD as W,c as h,cR as I,cc as R}from"./CgwFGLCK.js";const w={status:"loading",members:[]},u=o.createSelector(e=>d(e.guestSessions.sessions)),K=o.createSelector(e=>e.guestSessions.hasReceivedList),l=o.createSelector(e=>n(e.guestSessions.sessions,e.connections.windowBackendId)??null);o.createSelector(e=>l.select(e)!==null);const M=o.createSelector(e=>e.guestSessions.openIds),F=o.createSelector(e=>e.guestSessions.connectedIds),O=o.createSelector(e=>e.guestSessions.leavingIds),P=o.createSelector(e=>e.guestSessions.leavingWorkspaceKeys),x=o.createSelector(e=>u.select(e).filter(s=>e.guestSessions.failedLeaveIds.includes(s.id))),A=o.createSelector(e=>u.select(e).flatMap(s=>(s.workspaces??[]).filter(t=>e.guestSessions.failedLeaveWorkspaceKeys.includes(i(s.id,t.id))).map(t=>({session:s,workspace:t})))),B=o.createSelector(e=>e.guestSessions.failedLeaveIds),D=o.createSelector(e=>d(e.guestSessions.sweepReports)),J=o.createSelector((e,s)=>n(e.guestSessions.sweepReports,s)),N=o.createSelector(e=>e.guestSessions.clearingWorkspaceIds),$=o.createSelector((e,s)=>n(e.workspace.workspaces,a(s))!==void 0),L=o.createSelector((e,s)=>e.guestSessions.hostedRosters[s]?.status==="withheld"?!1:n(e.workspace.workspaces,a(s))!==void 0&&g.select(e)&&m.select(e,s)),b=o.createSelector((e,s)=>{const t=n(e.workspace.workspaces,a(s));if(t?.openInviteCount!=null)return t.openInviteCount;const c=e.guestSessions.hostedRosters[s];return c?.guestCount!=null?Math.max(0,c.guestCount-c.members.filter(S).length):null}),j=o.createSelector(e=>e.workspace.error?"error":v.select(e,e.connections.windowBackendId)?"loaded":"loading"),E=o.createSelector(e=>{const s=W.select(e);return d(e.workspace.workspaces).filter(t=>{if(!s.collaborationReady||!h(s,t.id,()=>t))return!1;const c=b.select(e,t.id);if((t.memberCount??1/0)<=1&&c===0)return!1;const r=e.guestSessions.hostedRosters[t.id];return!r||r.status!=="loaded"?!0:r.members.some(S)||c===null||c>0})}),f=o.createSelector(e=>{const s=l.select(e),t=I.select(e);return u.select(e).filter(c=>{const r=s?.id===c.id&&t?.principal.id===c.principalId?R.select(e):null;return r?r!=="guest":c.hostRole==="member"})}),U=o.createSelector(e=>{const s=new Set(f.select(e).map(t=>t.id));return u.select(e).filter(t=>!s.has(t.id))}),_=o.createSelector(e=>e.guestSessions.listUnavailable),y=o.createSelector((e,s)=>e.guestSessions.hostedRosters[s]??w),q=o.createSelector((e,s)=>y.select(e,s).members.filter(t=>e.guestSessions.failedMemberKeys.includes(p(s,t.principalId)))),C=[],z=o.createSelector((e,s)=>{const t=p(s,""),c=e.guestSessions.removingMemberKeys.filter(r=>r.startsWith(t)).map(r=>r.slice(t.length));return c.length===0?C:c}),Q=o.createSelector((e,s)=>e.guestSessions.clearingWorkspaceIds.includes(s)),T=o.createSelector(e=>{const s=[];for(const[t,c]of Object.entries(e.guestSessions.hostedRosters)){if(c.status==="withheld")continue;const r=n(e.workspace.workspaces,a(t));!r||!L.select(e,t)||s.push(`${t}:${r.memberCount??0},${c.invalidation??0}`)}return s.sort()}),V=o.createSelector(e=>e.guestSessions.inheritedWorkspaceKeys),Y=o.createSelector(e=>e.guestSessions.leaveConfirmations),X=o.createSelector((e,s)=>k(n(e.guestSessions.sessions,s))),Z=o.createSelector((e,s)=>{if(!s||!g.select(e))return!1;const t=l.select(e);return!t||!(t.workspaces??[]).some(c=>c.id===s)||f.select(e).some(c=>c.id===t.id)||e.guestSessions.inheritedWorkspaceKeys.includes(i(t.id,s))?!1:n(e.workspace.workspaces,a(s))?.myRole!=="owner"}),ee=o.createSelector((e,s)=>{const t=l.select(e);return!!t&&e.guestSessions.selfLeaveWorkspaceKeys.includes(i(t.id,s))}),se=o.createSelector((e,s)=>{const t=l.select(e);return!!t&&e.guestSessions.leavingWorkspaceKeys.includes(i(t.id,s))});export{$ as A,se as B,ee as C,f as D,U as E,l as F,L as a,x as b,A as c,Y as d,B as e,O as f,P as g,X as h,u as i,F as j,K as k,M as l,_ as m,N as n,q as o,b as p,z as q,y as r,Z as s,T as t,j as u,J as v,D as w,E as x,V as y,Q as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bm as r}from"./51_h0jm2.js";import{J4 as a,nM as h,BL as N,yq as f,qN as T,nL as F,rM as v,hj as B,Lh as U,k as H,mL as V,hf as k,D as W}from"./Zldsekdv.js";import{w as Y}from"./LKW_Bid7.js";import{cu as z,cc as G,cP as K,cl as p,c9 as M,cG as y,cY as C,cX as $,dE as I,cV as X,cW as J,c_ as Q}from"./XJqoy2ap.js";const Z={auggie:"auggie",claudeCode:"claude-code",codex:"codex",mock:"mock",opencode:"opencode",pi:"pi",cortex:"cortex",droid:"droid",grok:"grok",unsloth:"unsloth",antigravity:"antigravity",cursor:"cursor"},ee=new Map(Object.entries(Z).map(([e,t])=>[t,e]));function te(e,t){const o=ee.get(t);return o===void 0?void 0:e?.providers[o]}function De(e,t){const o=te(e,t);return o?.available===!0&&O(t,o.authenticated)}const je=new Set(["claude-code"]);function O(e,t){return t!==!1}const R=new WeakMap,qe=a.createSelector((e,t)=>e.agentAvailability.providerStatusMap[t]?.viaNpx===!0),w=a.createSelector(e=>{if(!z.select(e))return e.agentAvailability.providerStatusMap;const t=e.providerCatalog?.providers;if(!t)return{};let o=R.get(t);return o||(o=Object.fromEntries(h(t).map(n=>[n.id,{available:!0}])),R.set(t,o)),o}),Ne=a.createSelector(e=>e.agentAvailability.providerLoadingMap),Te=a.createSelector(e=>e.agentAvailability.providerCheckEpochMap),re=a.createSelector(e=>e.agentAvailability.hasCheckedOnce),Fe=a.createSelector(e=>Object.values(e.agentAvailability.providerLoadingMap).some(t=>t)),Be=a.createSelector(e=>e.agentAvailability.npxStatus),Ue=a.createSelector(e=>e.agentAvailability.hiddenProviders),He=a.createSelector(e=>e.agentAvailability.discoveryError),Ve=a.createSelector(e=>e.agentAvailability.discoveryRevision),We=a.createSelector(e=>e.agentAvailability.refreshModelsPending),Ye=a.createSelector(e=>e.agentAvailability.refreshModelsRevision),ze=a.createSelector(e=>e.sidebarNav?.onboardingActive&&e.userPreferences.providerSetupHydratedBackendId===e.connections.windowBackendId&&!e.userPreferences.hasCompletedProviderSetup&&G.select(e)==="owner"?K.select(e):null),Ge=a.createSelector((e,t)=>h(e.providerSettings.requests).filter(o=>o.sessionId===t)),Ke=a.createSelector((e,t)=>e.providerSettings.sessions.includes(t)),$e=a.createSelector((e,t)=>e.providerSettings.writeRevisions?.[t]??0),Xe=a.createSelector(e=>e.providerSettings.paths),Je=a.createSelector(e=>e.providerSettings.pathsRevision),g=a.createSelector(e=>p.select(e)?M.select(e)?.defaultProviderId??"":e.model.defaultProviderId);a.createSelector((e,t)=>g.select(e)===t);const oe=a.createSelector(e=>p.select(e)?Object.fromEntries((M.select(e)?.enabledProviderIds??[]).map(t=>[t,!0])):e.providerSettings.enabledProviders),L=a.createSelector((e,t)=>{if(p.select(e))return M.select(e)?.enabledProviderIds?.includes(t)===!0;const o=e.providerSettings.nonDisableableProviderIds??[];return N(e.providerSettings.enabledProviders,t,{canBeDisabled:!o.includes(t)})}),A=a.createSelector(e=>{if(p.select(e))return M.select(e)?.enabledProviderIds??[];const t=e.providerSettings.enabledProviders,o=e.providerCatalog?h(e.providerCatalog.providers):[],n=new Set(o.filter(c=>L.select(e,c.id)).map(c=>c.id)),i=g.select(e),s=f(i);s&&t[s]!==!1&&n.add(s);for(const[c,l]of Object.entries(t))l&&n.add(c);return[...n]});function ne(e,t){const o=C.select(e,t);return p.select(e)?o?.visible!==!0:!!(o?.requiresEnvVar||o?.requiresFeatureCode)}const S=a.createSelector(e=>{const t=w.select(e);return A.select(e).filter(o=>!ne(e,o)&&t[o]?.available===!0)}),Qe=a.createSelector((e,t)=>{const o=w.select(e),n=y.select(e,t);return S.select(e).filter(i=>y.select(e,i)!==n&&L.select(e,i)&&O(i,o[i]?.authenticated))}),Ze=a.createSelector(e=>re.select(e)?S.select(e):A.select(e)),et=a.createSelector(e=>{const t=f(g.select(e));return S.select(e).includes(t)}),tt=a.createSelector(e=>e.providerSettings.fastMode),rt=a.createSelector(e=>{const t=e.providerSettings.fastMode,o={...t?.confirmed};for(const[n,i]of Object.entries(t?.pending??{}))o[n]=i.enabled;return o}),ot=a.createSelector(e=>Object.values(u(e).defaults).some(t=>t.remoteLaunch!==void 0)),nt=a.createSelector(e=>e.providerSettings.fastMode?.supported?["claude-code","codex"].filter(t=>C.select(e,t)?.supportsFastMode===!0):[]),u=e=>e.providerSettings?.profiles??T,at=a.createSelector(e=>$.select(e).filter(t=>t.supportsProfiles===!0).map(t=>t.id)),st=a.createSelector((e,t)=>h(u(e).items).filter(o=>o.baseProviderId===t)),it=a.createSelector(e=>[...new Set(h(u(e).items).map(t=>t.baseProviderId))]),ct=a.createSelector(e=>u(e).defaults),lt=a.createSelector((e,t)=>u(e).defaults[t]),dt=a.createSelector((e,t)=>F(u(e).items,t)),ut=a.createSelector(e=>u(e).revision),_t=a.createSelector(e=>u(e).loadStatus),ht=a.createSelector(e=>u(e).status),ft=a.createSelector(e=>u(e).activation),pt=a.createSelector(e=>Object.fromEntries(h(u(e).mutations).map(t=>[t.id,t]))),ae={},mt=a.createSelector(e=>u(e).identity??ae),se={},vt=a.createSelector(e=>u(e).setups??se),Mt=a.createSelector(e=>(e.providerSettings?.sessions.length??0)>0);function E(e){const t=e.trim();if(!t.startsWith("tc"))return!1;const o=t.slice(2);if(o.length<50||o.length%4===1||!/^[A-Za-z0-9_-]+$/.test(o))return!1;const n=atob(o.slice(0,4).replace(/-/g,"+").replace(/_/g,"/")).charCodeAt(0);return n>=161&&n<=187||n===191}function bt(e){if(!e||typeof e!="object")return null;const t=e;for(const o of[t.collaborationName,t.prettyHostname,t.hostname])if(typeof o=="string"&&m(o))return m(o);return null}function gt(e){return[...m(e)].length<=100&&!/\p{Cc}/u.test(e)}function m(e){return e.replace(/^\p{White_Space}+|\p{White_Space}+$/gu,"")}function ie(e){const t=e.label.trim(),o=e.host&&e.port!=null?`${e.host}:${e.port}`:"";return(t&&t!==o?t:"")||e.hostname?.trim()||t||o}function ce(e){const t=e.machineName?.trim();return t?r.settings_devices_localMachine_label({name:t}):r.layout_daemonStatus_localConnection_label()}function St(e,t){if(e.isLocal)return ce(e);const o=ie(e);return e.id===t?r.settings_devices_connectedBackend_label({name:o}):o}function le(e){const t=m(e.hostname??"");return t||(E(e.label)?r.connection_unknownHost_label():e.label)}function Pt(e){const t=e.label.trim();return!t||E(t)?null:t!==le(e)?t:null}function kt(e){return e.catalogProfiles.some(t=>typeof t.remoteCompatible=="boolean")||e.defaultRemoteIncompatibility||e.defaultRemoteLaunch||e.profileDefaults.some(t=>typeof t.remoteCompatible=="boolean")?"supported":e.catalogProfiles.length>0?"unsupported":e.profilesLoadStatus==="idle"?"unknown":"unsupported"}function yt(e,t,o){if(v(e)){const n=t.find(i=>i.providerRef===e);return n?.remoteCompatible!==!1?null:n.remoteIncompatibility??{reason:"unknown",keys:[]}}return null}const de=1440*60*1e3;function x(e,t){if(!e?.capabilities)return"missing";const o=e.observedAt?Date.parse(e.observedAt):Number.NaN;return Number.isFinite(o)&&t-o>de?"stale":"fresh"}function Rt(e,t,o){if(!e||x(e,o)!=="fresh")return;const n=f(t),i=e.capabilities?.providers.find(s=>s.id===n);return i&&i.models.length>0?i.models:void 0}function Ct(e,t,o){const n=f(t),i=new Set;for(const s of e){if(s.state==="revoked"||x(s,o)!=="fresh")continue;const c=s.capabilities?.providers.find(l=>l.id===n);if(!(!c||!_e(c)))for(const l of c.models)i.add(l)}return[...i]}const ue=new Set(["cli-missing","prerequisite-missing"]);function _e(e){return e.visible!==!1&&!ue.has(e.status)}const he=new Set(["signed-out","auth-failed"]);function fe(e){return he.has(e)}function pe(e,t){if(v(t))return!1;const o=f(t),n=e?.capabilities?.providers.find(i=>i.id===o);return!!n&&fe(n.status)}function D(e,t){return(t.defaultRemoteLaunch?t.defaultRemoteLaunch[e]==="send":!t.defaultRemoteIncompatibility?.[e])&&t.defaultHasOverrides?.[e]!==!1}function me(e,t,o){return o.defaultRemoteLaunch?.[t]==="refused"?!1:!e.cloud&&!pe(e,t)}function It(e){const{machine:t,providerRef:o}=e;return v(o)||me(t,o,e)||D(o,e)?null:e.catalogProfiles.find(n=>n.baseProviderId===o&&n.remoteCompatible===!0)??null}const ve="https://e2b.dev/dashboard",Me="https://app.northflank.com",be="https://www.agent37.com/dashboard/cloud",ge="https://vercel.com/dashboard";function Ot(e="e2b"){return e==="vercel"?ge:e==="northflank"?Me:e==="agent37"?be:ve}function Se(e){switch(e){case"northflank":return{keyRejected:r.cloudMachines_northflank_state_tokenRejected_label(),unreachable:r.cloudMachines_northflank_state_unreachable_label(),ownerOnly:r.cloudMachines_northflank_error_ownerOnly(),saved:r.cloudMachines_northflank_saved_toast(),listTitle:r.cloudMachines_northflank_services_title(),listSummary:r.cloudMachines_northflank_services_summary,dashboard:r.cloudMachines_northflank_dashboard_label(),dashboardOpen:r.cloudMachines_northflank_dashboardOpen_label(),deleteTitle:r.cloudMachines_northflank_delete_confirmTitle,deleteDescription:r.cloudMachines_northflank_delete_confirm_description(),creating:r.cloudMachines_northflank_start_creating(),startFailed:r.cloudMachines_northflank_startFailure_title(),startUnknown:r.cloudMachines_northflank_startFailure_unknown_cause()};case"agent37":return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_agent37_state_unreachable_label(),ownerOnly:r.cloudMachines_agent37_error_ownerOnly(),saved:r.cloudMachines_agent37_saved_toast(),listTitle:r.cloudMachines_agent37_instances_title(),listSummary:r.cloudMachines_agent37_instances_summary,dashboard:r.cloudMachines_agent37_dashboard_label(),dashboardOpen:r.cloudMachines_agent37_dashboardOpen_label(),deleteTitle:r.cloudMachines_agent37_delete_confirmTitle,deleteDescription:r.cloudMachines_agent37_delete_confirm_description(),creating:r.cloudMachines_agent37_start_creating(),startFailed:r.cloudMachines_agent37_startFailure_title(),startUnknown:r.cloudMachines_agent37_startFailure_unknown_cause()};case"vercel":return{keyRejected:r.cloudMachines_vercel_state_tokenRejected_label(),unreachable:r.cloudMachines_vercel_state_unreachable_label(),ownerOnly:r.cloudMachines_vercel_error_ownerOnly(),saved:r.cloudMachines_vercel_saved_toast(),listTitle:r.cloudMachines_vercel_sandboxes_title(),listSummary:r.cloudMachines_sandboxes_summary,dashboard:r.cloudMachines_vercel_dashboard_label(),dashboardOpen:r.cloudMachines_vercel_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_vercel_delete_confirm_description(),creating:r.cloudMachines_vercel_start_creating(),startFailed:r.cloudMachines_vercel_startFailure_title(),startUnknown:r.cloudMachines_vercel_startFailure_unknown_cause()};default:return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_state_unreachable_label(),ownerOnly:r.cloudMachines_error_ownerOnly(),saved:r.cloudMachines_saved_toast(),listTitle:r.cloudMachines_sandboxes_title(),listSummary:r.cloudMachines_sandboxes_summary,dashboard:r.cloudMachines_dashboard_label(),dashboardOpen:r.cloudMachines_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_delete_confirm_description(),creating:r.cloudMachines_start_creating(),startFailed:r.cloudMachines_startFailure_title(),startUnknown:r.cloudMachines_startFailure_unknown_cause()}}}function wt(e){return e==="vm"?r.cloudMachines_agent37_form_type_vm():r.cloudMachines_agent37_form_type_default()}function Lt(e){return e==="eu"?r.cloudMachines_agent37_region_eu():e==="ap-south"?r.cloudMachines_agent37_region_apSouth():r.cloudMachines_agent37_region_us()}const Pe=/^E2B\s*·\s*/u;function At(e,t){const o=t?`${t} · `:null;return(o&&e.name.startsWith(o)?e.name.slice(o.length):e.name.replace(Pe,"")).trim()||e.name}function Et(e){const t=B(e);return t?r.cloudMachines_size_label({vcpu:String(t.vcpu),memory:String(t.memoryGiB)}):e}function xt(e,t,o){const n=e.cloud;if(!n)return 0;const i=n.state==="running"&&t>0?Math.max(0,(o-t)/1e3):0;return Math.floor(n.runningSeconds+i)}function Dt(e){const t=Math.floor(e/60);if(t<1)return r.cloudMachines_uptime_underMinute();if(t<60)return r.cloudMachines_uptime_minutes({minutes:String(t)});const o=Math.floor(t/60),n=t%60;return n===0?r.cloudMachines_uptime_hours({hours:String(o)}):r.cloudMachines_uptime_hoursMinutes({hours:String(o),minutes:String(n)})}const ke=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});function jt(e){const t=V(e,3600);return t===null?null:r.cloudMachines_size_hourly({amount:ke.format(t)})}function j(e){try{return new URL(e).host||e}catch{return e}}function qt(e){const t=e.find(n=>n.cloud?.state==="running");if(!t?.cloud)return null;const o=t.cloud.relayUrl;return o?r.cloudMachines_relay_host({host:j(o)}):r.cloudMachines_relay_default()}function Nt(e,t){const o=new Map;for(const s of e){const c=s.cloud?.workspaceId,l=c?t(c):null,_=c&&l?c:"";let d=o.get(_);d||(d={key:_,name:l??r.cloudMachines_sandboxes_otherWorkspace(),sandboxes:[]},o.set(_,d)),d.sandboxes.push(s)}const n=s=>+(s.cloud?.state==="paused"),i=s=>Number(s.sandboxes.every(c=>n(c)));for(const s of o.values())s.sandboxes.sort((c,l)=>n(c)-n(l)||(l.cloud?.startedAt??"").localeCompare(c.cloud?.startedAt??"")||c.id.localeCompare(l.id));return[...o.values()].sort((s,c)=>i(s)-i(c)||+(s.key==="")-+(c.key==="")||s.name.localeCompare(c.name,void 0,{sensitivity:"base"})||s.key.localeCompare(c.key))}function ye(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_northflank_error_profileRequired_title(),description:r.cloudMachines_northflank_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_northflank_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_northflank_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_northflank_error_quotaRate_description():r.cloudMachines_northflank_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_northflank_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_northflank_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_northflank_error_tokenRejected_title(),description:r.cloudMachines_northflank_error_tokenRejected_description()};case"project-missing":return t(r.cloudMachines_northflank_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_northflank_error_permissionDenied_title(),description:r.cloudMachines_northflank_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_northflank_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_northflank_error_serviceLost_title(),description:r.cloudMachines_northflank_error_serviceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_northflank_error_bootstrapFailed_description());default:return t(r.cloudMachines_northflank_error_apiError_description())}}}}function Re(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_agent37_error_profileRequired_title(),description:r.cloudMachines_agent37_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_agent37_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_agent37_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_agent37_error_quotaRate_description():r.cloudMachines_agent37_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_agent37_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_agent37_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_agent37_error_keyRejected_title(),description:r.cloudMachines_agent37_error_keyRejected_description()};case"permission-denied":return{title:r.cloudMachines_agent37_error_permissionDenied_title(),description:r.cloudMachines_agent37_error_permissionDenied_description()};case"no-capacity":return{title:r.cloudMachines_agent37_error_noCapacity_title(),description:r.cloudMachines_agent37_error_noCapacity_description()};case"template-missing":return t(r.cloudMachines_agent37_error_templateMissing_description());case"sandbox-lost":return{title:r.cloudMachines_agent37_error_instanceLost_title(),description:r.cloudMachines_agent37_error_instanceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_agent37_error_bootstrapFailed_description());default:return t(r.cloudMachines_agent37_error_apiError_description())}}}}function Ce(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_vercel_error_profileRequired_title(),description:r.cloudMachines_vercel_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_vercel_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_vercel_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_vercel_error_quotaRate_description():r.cloudMachines_vercel_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_vercel_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_vercel_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_vercel_error_keyRejected_title(),description:r.cloudMachines_vercel_error_keyRejected_description()};case"project-missing":return t(r.cloudMachines_vercel_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_vercel_error_permissionDenied_title(),description:r.cloudMachines_vercel_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_vercel_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_vercel_error_sandboxLost_title(),description:r.cloudMachines_vercel_error_sandboxLost_description()};case"bootstrap-failed":return t(r.cloudMachines_vercel_error_bootstrapFailed_description());default:return t(r.cloudMachines_vercel_error_apiError_description())}}}}function Tt(e,t){if(e.code==="cloud-machine-unavailable"&&e.reason==="relay-unreachable")return{title:r.cloudMachines_error_relayUnreachable_title(),description:e.relayUrl?r.cloudMachines_error_relayUnreachable_description({host:j(e.relayUrl)}):r.cloudMachines_error_relayUnreachable_noHost_description()};const o=e.provider??t;if(o==="northflank")return ye(e);if(o==="agent37")return Re(e);if(o==="vercel")return Ce(e);switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_error_profileRequired_title(),description:r.cloudMachines_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_error_quotaRate_description():r.cloudMachines_error_quotaConcurrency_description()};case"cloud-machine-unavailable":switch(e.reason){case"not-configured":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_notConfigured_description()};case"key-rejected":return{title:r.cloudMachines_error_keyRejected_title(),description:r.cloudMachines_error_keyRejected_description()};case"template-missing":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_templateMissing_description()};case"sandbox-lost":return{title:r.cloudMachines_error_sandboxLost_title(),description:r.cloudMachines_error_sandboxLost_description()};case"bootstrap-failed":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_bootstrapFailed_description()};default:return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_apiError_description()}}}}function Ft(e,t,o){const n=e.trim();if(!n)return r.cloudMachines_form_name_required();if(U(n)>H||/[\u0000-\u001f\u007f]/u.test(n))return r.cloudMachines_form_name_invalid();const i=n.toLowerCase();return t.some(s=>s.id!==o&&s.name.trim().toLowerCase()===i)?r.cloudMachines_form_name_taken():null}const Ie=a.createSelector(e=>Y.select(e)&&e.remoteMachines?.supported===!0&&e.cloudMachines?.supported===!0),Bt=a.createSelector(e=>{const t=e.cloudMachines?.providerKinds??["e2b"];return e.cloudMachines?.entries===!0?t:t.filter(o=>o==="e2b")}),Ut=a.createSelector(e=>e.cloudMachines?.entries===!0);function q(e){return Object.values(e.cloudMachines?.providers??{}).sort((t,o)=>t.configuredAt.localeCompare(o.configuredAt)||t.name.localeCompare(o.name))}const Ht=a.createSelector(q),Vt=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).sort((t,o)=>(t.cloud?.startedAt??"").localeCompare(o.cloud?.startedAt??""))),Wt=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).filter(t=>t.cloud?.state==="paused").length);function Oe(e,t){const o=t.cloud;return!o?.agentId||!o.workspaceId||!I.select(e,o.workspaceId)?null:{workspaceId:o.workspaceId,agentId:o.agentId}}const Yt=a.createSelector((e,t)=>{const o={},n={};for(const i of t){const s=i.cloud?.workspaceId;if(s&&!(s in o)){const c=I.select(e,s);o[s]=c?.title||c?.name||null}n[i.id]=Oe(e,i)}return{workspaceNames:o,agentLinks:n}}),zt=a.createSelector(e=>e.cloudMachines?.readAt??{}),Gt=a.createSelector(e=>e.cloudMachines?.pending??{}),Kt=a.createSelector(e=>e.cloudMachines?.failures??{}),$t=a.createSelector(e=>e.cloudMachines?.validated??null);function Xt(e){if(!Ie.select(e))return null;const t=q(e);if(t.length===0)return null;const o=e.cloudMachines?.entries===!0;return t.map(n=>({cloudMachineId:n.id,label:n.provider==="e2b"?o&&(t.length>1||n.name.trim().toLowerCase()!=="e2b")?r.cloudMachines_startOn_entry_label({name:n.name}):r.cloudMachines_startOn_label():n.name.trim().toLowerCase()===k(n.provider).toLowerCase()?k(n.provider):n.provider==="northflank"?r.cloudMachines_startOn_northflank_label({name:n.name}):n.provider==="agent37"?r.cloudMachines_startOn_agent37_label({name:n.name}):r.cloudMachines_startOn_vercel_label({name:n.name}),unavailableReason:n.state==="key-rejected"?Se(n.provider).keyRejected:null,needsProfile:!we(e,n)}))}function we(e,t){const o=oe.select(e),n=e.providerSettings?.profiles?.defaults??{},i={defaultRemoteLaunch:J.select(e),defaultRemoteIncompatibility:X.select(e)},s=d=>o[d]!==!1&&(t.agentProviders.length===0||t.agentProviders.includes(d)),c=new Set([...t.agentProviders,...Object.keys(i.defaultRemoteLaunch??{})]);for(const d of c)if(s(d)&&(n[d]?.env.length??0)>0&&D(d,i))return!0;const l=e.providerSettings?.profiles?.items,_=l?h(l):[];return Q.select(e).some(d=>{if(d.remoteCompatible!==!0||!s(d.baseProviderId))return!1;const P=_.find(b=>b.providerRef===d.providerRef);return!P||P.env.some(b=>b.kind==="set")})}function Jt(e,t,o=e.cloudMachines?.providers[W]??null){if(!t)return null;const n=o,i=f(t);if(n&&n.agentProviders.length>0&&!n.agentProviders.includes(i))return r.cloudMachines_startOn_providerMissing();const s=e.providerSettings?.profiles;if(v(t)){const l=s?h(s.items).find(_=>_.providerRef===t):void 0;return l?l.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():l.env.some(_=>_.kind==="set")?null:r.cloudMachines_startOn_needsProfile():null}const c=s?.defaults?.[i];return c?c.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():c.env.some(l=>l.kind==="set")?null:r.cloudMachines_startOn_needsProfile():s?.loadStatus==="success"?r.cloudMachines_startOn_needsProfile():null}export{Fe as $,xt as A,x as B,Rt as C,m as D,Ct as E,It as F,yt as G,kt as H,At as I,g as J,S as K,it as L,Ht as M,je as N,Ut as O,Z as P,Kt as Q,Ie as R,Gt as S,Bt as T,zt as U,Vt as V,$t as W,oe as X,nt as Y,re as Z,et as _,Lt as a,L as a0,Ze as a1,Be as a2,ze as a3,Wt as a4,at as a5,Te as a6,lt as a7,ct as a8,He as a9,Yt as aA,Xt as aB,gt as aC,Ve as aa,tt as ab,rt as ac,Ue as ad,Ne as ae,We as af,Ye as ag,Xe as ah,Je as ai,dt as aj,ft as ak,mt as al,pt as am,vt as an,ht as ao,st as ap,_t as aq,ut as ar,qe as as,Mt as at,Ke as au,Ge as av,w as aw,$e as ax,Qe as ay,ot as az,wt as b,Ot as c,Ft as d,qt as e,Tt as f,Jt as g,Se as h,Et as i,bt as j,me as k,D as l,ie as m,Pt as n,le as o,ce as p,St as q,Dt as r,te as s,Nt as t,jt as u,_e as v,O as w,De as x,pe as y,E as z};
|
|
1
|
+
import{bm as r}from"./51_h0jm2.js";import{J4 as a,nM as h,BL as N,yq as f,qN as T,nL as F,rM as v,hj as B,Lh as U,k as H,mL as V,hf as k,D as W}from"./CbRsc9i4.js";import{w as Y}from"./CnztNSaN.js";import{cu as z,cc as G,cP as K,cl as p,c9 as M,cG as y,cY as C,cX as $,dE as I,cV as X,cW as J,c_ as Q}from"./CgwFGLCK.js";const Z={auggie:"auggie",claudeCode:"claude-code",codex:"codex",mock:"mock",opencode:"opencode",pi:"pi",cortex:"cortex",droid:"droid",grok:"grok",unsloth:"unsloth",antigravity:"antigravity",cursor:"cursor"},ee=new Map(Object.entries(Z).map(([e,t])=>[t,e]));function te(e,t){const o=ee.get(t);return o===void 0?void 0:e?.providers[o]}function De(e,t){const o=te(e,t);return o?.available===!0&&O(t,o.authenticated)}const je=new Set(["claude-code"]);function O(e,t){return t!==!1}const R=new WeakMap,qe=a.createSelector((e,t)=>e.agentAvailability.providerStatusMap[t]?.viaNpx===!0),w=a.createSelector(e=>{if(!z.select(e))return e.agentAvailability.providerStatusMap;const t=e.providerCatalog?.providers;if(!t)return{};let o=R.get(t);return o||(o=Object.fromEntries(h(t).map(n=>[n.id,{available:!0}])),R.set(t,o)),o}),Ne=a.createSelector(e=>e.agentAvailability.providerLoadingMap),Te=a.createSelector(e=>e.agentAvailability.providerCheckEpochMap),re=a.createSelector(e=>e.agentAvailability.hasCheckedOnce),Fe=a.createSelector(e=>Object.values(e.agentAvailability.providerLoadingMap).some(t=>t)),Be=a.createSelector(e=>e.agentAvailability.npxStatus),Ue=a.createSelector(e=>e.agentAvailability.hiddenProviders),He=a.createSelector(e=>e.agentAvailability.discoveryError),Ve=a.createSelector(e=>e.agentAvailability.discoveryRevision),We=a.createSelector(e=>e.agentAvailability.refreshModelsPending),Ye=a.createSelector(e=>e.agentAvailability.refreshModelsRevision),ze=a.createSelector(e=>e.sidebarNav?.onboardingActive&&e.userPreferences.providerSetupHydratedBackendId===e.connections.windowBackendId&&!e.userPreferences.hasCompletedProviderSetup&&G.select(e)==="owner"?K.select(e):null),Ge=a.createSelector((e,t)=>h(e.providerSettings.requests).filter(o=>o.sessionId===t)),Ke=a.createSelector((e,t)=>e.providerSettings.sessions.includes(t)),$e=a.createSelector((e,t)=>e.providerSettings.writeRevisions?.[t]??0),Xe=a.createSelector(e=>e.providerSettings.paths),Je=a.createSelector(e=>e.providerSettings.pathsRevision),g=a.createSelector(e=>p.select(e)?M.select(e)?.defaultProviderId??"":e.model.defaultProviderId);a.createSelector((e,t)=>g.select(e)===t);const oe=a.createSelector(e=>p.select(e)?Object.fromEntries((M.select(e)?.enabledProviderIds??[]).map(t=>[t,!0])):e.providerSettings.enabledProviders),L=a.createSelector((e,t)=>{if(p.select(e))return M.select(e)?.enabledProviderIds?.includes(t)===!0;const o=e.providerSettings.nonDisableableProviderIds??[];return N(e.providerSettings.enabledProviders,t,{canBeDisabled:!o.includes(t)})}),A=a.createSelector(e=>{if(p.select(e))return M.select(e)?.enabledProviderIds??[];const t=e.providerSettings.enabledProviders,o=e.providerCatalog?h(e.providerCatalog.providers):[],n=new Set(o.filter(c=>L.select(e,c.id)).map(c=>c.id)),i=g.select(e),s=f(i);s&&t[s]!==!1&&n.add(s);for(const[c,l]of Object.entries(t))l&&n.add(c);return[...n]});function ne(e,t){const o=C.select(e,t);return p.select(e)?o?.visible!==!0:!!(o?.requiresEnvVar||o?.requiresFeatureCode)}const S=a.createSelector(e=>{const t=w.select(e);return A.select(e).filter(o=>!ne(e,o)&&t[o]?.available===!0)}),Qe=a.createSelector((e,t)=>{const o=w.select(e),n=y.select(e,t);return S.select(e).filter(i=>y.select(e,i)!==n&&L.select(e,i)&&O(i,o[i]?.authenticated))}),Ze=a.createSelector(e=>re.select(e)?S.select(e):A.select(e)),et=a.createSelector(e=>{const t=f(g.select(e));return S.select(e).includes(t)}),tt=a.createSelector(e=>e.providerSettings.fastMode),rt=a.createSelector(e=>{const t=e.providerSettings.fastMode,o={...t?.confirmed};for(const[n,i]of Object.entries(t?.pending??{}))o[n]=i.enabled;return o}),ot=a.createSelector(e=>Object.values(u(e).defaults).some(t=>t.remoteLaunch!==void 0)),nt=a.createSelector(e=>e.providerSettings.fastMode?.supported?["claude-code","codex"].filter(t=>C.select(e,t)?.supportsFastMode===!0):[]),u=e=>e.providerSettings?.profiles??T,at=a.createSelector(e=>$.select(e).filter(t=>t.supportsProfiles===!0).map(t=>t.id)),st=a.createSelector((e,t)=>h(u(e).items).filter(o=>o.baseProviderId===t)),it=a.createSelector(e=>[...new Set(h(u(e).items).map(t=>t.baseProviderId))]),ct=a.createSelector(e=>u(e).defaults),lt=a.createSelector((e,t)=>u(e).defaults[t]),dt=a.createSelector((e,t)=>F(u(e).items,t)),ut=a.createSelector(e=>u(e).revision),_t=a.createSelector(e=>u(e).loadStatus),ht=a.createSelector(e=>u(e).status),ft=a.createSelector(e=>u(e).activation),pt=a.createSelector(e=>Object.fromEntries(h(u(e).mutations).map(t=>[t.id,t]))),ae={},mt=a.createSelector(e=>u(e).identity??ae),se={},vt=a.createSelector(e=>u(e).setups??se),Mt=a.createSelector(e=>(e.providerSettings?.sessions.length??0)>0);function E(e){const t=e.trim();if(!t.startsWith("tc"))return!1;const o=t.slice(2);if(o.length<50||o.length%4===1||!/^[A-Za-z0-9_-]+$/.test(o))return!1;const n=atob(o.slice(0,4).replace(/-/g,"+").replace(/_/g,"/")).charCodeAt(0);return n>=161&&n<=187||n===191}function bt(e){if(!e||typeof e!="object")return null;const t=e;for(const o of[t.collaborationName,t.prettyHostname,t.hostname])if(typeof o=="string"&&m(o))return m(o);return null}function gt(e){return[...m(e)].length<=100&&!/\p{Cc}/u.test(e)}function m(e){return e.replace(/^\p{White_Space}+|\p{White_Space}+$/gu,"")}function ie(e){const t=e.label.trim(),o=e.host&&e.port!=null?`${e.host}:${e.port}`:"";return(t&&t!==o?t:"")||e.hostname?.trim()||t||o}function ce(e){const t=e.machineName?.trim();return t?r.settings_devices_localMachine_label({name:t}):r.layout_daemonStatus_localConnection_label()}function St(e,t){if(e.isLocal)return ce(e);const o=ie(e);return e.id===t?r.settings_devices_connectedBackend_label({name:o}):o}function le(e){const t=m(e.hostname??"");return t||(E(e.label)?r.connection_unknownHost_label():e.label)}function Pt(e){const t=e.label.trim();return!t||E(t)?null:t!==le(e)?t:null}function kt(e){return e.catalogProfiles.some(t=>typeof t.remoteCompatible=="boolean")||e.defaultRemoteIncompatibility||e.defaultRemoteLaunch||e.profileDefaults.some(t=>typeof t.remoteCompatible=="boolean")?"supported":e.catalogProfiles.length>0?"unsupported":e.profilesLoadStatus==="idle"?"unknown":"unsupported"}function yt(e,t,o){if(v(e)){const n=t.find(i=>i.providerRef===e);return n?.remoteCompatible!==!1?null:n.remoteIncompatibility??{reason:"unknown",keys:[]}}return null}const de=1440*60*1e3;function x(e,t){if(!e?.capabilities)return"missing";const o=e.observedAt?Date.parse(e.observedAt):Number.NaN;return Number.isFinite(o)&&t-o>de?"stale":"fresh"}function Rt(e,t,o){if(!e||x(e,o)!=="fresh")return;const n=f(t),i=e.capabilities?.providers.find(s=>s.id===n);return i&&i.models.length>0?i.models:void 0}function Ct(e,t,o){const n=f(t),i=new Set;for(const s of e){if(s.state==="revoked"||x(s,o)!=="fresh")continue;const c=s.capabilities?.providers.find(l=>l.id===n);if(!(!c||!_e(c)))for(const l of c.models)i.add(l)}return[...i]}const ue=new Set(["cli-missing","prerequisite-missing"]);function _e(e){return e.visible!==!1&&!ue.has(e.status)}const he=new Set(["signed-out","auth-failed"]);function fe(e){return he.has(e)}function pe(e,t){if(v(t))return!1;const o=f(t),n=e?.capabilities?.providers.find(i=>i.id===o);return!!n&&fe(n.status)}function D(e,t){return(t.defaultRemoteLaunch?t.defaultRemoteLaunch[e]==="send":!t.defaultRemoteIncompatibility?.[e])&&t.defaultHasOverrides?.[e]!==!1}function me(e,t,o){return o.defaultRemoteLaunch?.[t]==="refused"?!1:!e.cloud&&!pe(e,t)}function It(e){const{machine:t,providerRef:o}=e;return v(o)||me(t,o,e)||D(o,e)?null:e.catalogProfiles.find(n=>n.baseProviderId===o&&n.remoteCompatible===!0)??null}const ve="https://e2b.dev/dashboard",Me="https://app.northflank.com",be="https://www.agent37.com/dashboard/cloud",ge="https://vercel.com/dashboard";function Ot(e="e2b"){return e==="vercel"?ge:e==="northflank"?Me:e==="agent37"?be:ve}function Se(e){switch(e){case"northflank":return{keyRejected:r.cloudMachines_northflank_state_tokenRejected_label(),unreachable:r.cloudMachines_northflank_state_unreachable_label(),ownerOnly:r.cloudMachines_northflank_error_ownerOnly(),saved:r.cloudMachines_northflank_saved_toast(),listTitle:r.cloudMachines_northflank_services_title(),listSummary:r.cloudMachines_northflank_services_summary,dashboard:r.cloudMachines_northflank_dashboard_label(),dashboardOpen:r.cloudMachines_northflank_dashboardOpen_label(),deleteTitle:r.cloudMachines_northflank_delete_confirmTitle,deleteDescription:r.cloudMachines_northflank_delete_confirm_description(),creating:r.cloudMachines_northflank_start_creating(),startFailed:r.cloudMachines_northflank_startFailure_title(),startUnknown:r.cloudMachines_northflank_startFailure_unknown_cause()};case"agent37":return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_agent37_state_unreachable_label(),ownerOnly:r.cloudMachines_agent37_error_ownerOnly(),saved:r.cloudMachines_agent37_saved_toast(),listTitle:r.cloudMachines_agent37_instances_title(),listSummary:r.cloudMachines_agent37_instances_summary,dashboard:r.cloudMachines_agent37_dashboard_label(),dashboardOpen:r.cloudMachines_agent37_dashboardOpen_label(),deleteTitle:r.cloudMachines_agent37_delete_confirmTitle,deleteDescription:r.cloudMachines_agent37_delete_confirm_description(),creating:r.cloudMachines_agent37_start_creating(),startFailed:r.cloudMachines_agent37_startFailure_title(),startUnknown:r.cloudMachines_agent37_startFailure_unknown_cause()};case"vercel":return{keyRejected:r.cloudMachines_vercel_state_tokenRejected_label(),unreachable:r.cloudMachines_vercel_state_unreachable_label(),ownerOnly:r.cloudMachines_vercel_error_ownerOnly(),saved:r.cloudMachines_vercel_saved_toast(),listTitle:r.cloudMachines_vercel_sandboxes_title(),listSummary:r.cloudMachines_sandboxes_summary,dashboard:r.cloudMachines_vercel_dashboard_label(),dashboardOpen:r.cloudMachines_vercel_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_vercel_delete_confirm_description(),creating:r.cloudMachines_vercel_start_creating(),startFailed:r.cloudMachines_vercel_startFailure_title(),startUnknown:r.cloudMachines_vercel_startFailure_unknown_cause()};default:return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_state_unreachable_label(),ownerOnly:r.cloudMachines_error_ownerOnly(),saved:r.cloudMachines_saved_toast(),listTitle:r.cloudMachines_sandboxes_title(),listSummary:r.cloudMachines_sandboxes_summary,dashboard:r.cloudMachines_dashboard_label(),dashboardOpen:r.cloudMachines_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_delete_confirm_description(),creating:r.cloudMachines_start_creating(),startFailed:r.cloudMachines_startFailure_title(),startUnknown:r.cloudMachines_startFailure_unknown_cause()}}}function wt(e){return e==="vm"?r.cloudMachines_agent37_form_type_vm():r.cloudMachines_agent37_form_type_default()}function Lt(e){return e==="eu"?r.cloudMachines_agent37_region_eu():e==="ap-south"?r.cloudMachines_agent37_region_apSouth():r.cloudMachines_agent37_region_us()}const Pe=/^E2B\s*·\s*/u;function At(e,t){const o=t?`${t} · `:null;return(o&&e.name.startsWith(o)?e.name.slice(o.length):e.name.replace(Pe,"")).trim()||e.name}function Et(e){const t=B(e);return t?r.cloudMachines_size_label({vcpu:String(t.vcpu),memory:String(t.memoryGiB)}):e}function xt(e,t,o){const n=e.cloud;if(!n)return 0;const i=n.state==="running"&&t>0?Math.max(0,(o-t)/1e3):0;return Math.floor(n.runningSeconds+i)}function Dt(e){const t=Math.floor(e/60);if(t<1)return r.cloudMachines_uptime_underMinute();if(t<60)return r.cloudMachines_uptime_minutes({minutes:String(t)});const o=Math.floor(t/60),n=t%60;return n===0?r.cloudMachines_uptime_hours({hours:String(o)}):r.cloudMachines_uptime_hoursMinutes({hours:String(o),minutes:String(n)})}const ke=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});function jt(e){const t=V(e,3600);return t===null?null:r.cloudMachines_size_hourly({amount:ke.format(t)})}function j(e){try{return new URL(e).host||e}catch{return e}}function qt(e){const t=e.find(n=>n.cloud?.state==="running");if(!t?.cloud)return null;const o=t.cloud.relayUrl;return o?r.cloudMachines_relay_host({host:j(o)}):r.cloudMachines_relay_default()}function Nt(e,t){const o=new Map;for(const s of e){const c=s.cloud?.workspaceId,l=c?t(c):null,_=c&&l?c:"";let d=o.get(_);d||(d={key:_,name:l??r.cloudMachines_sandboxes_otherWorkspace(),sandboxes:[]},o.set(_,d)),d.sandboxes.push(s)}const n=s=>+(s.cloud?.state==="paused"),i=s=>Number(s.sandboxes.every(c=>n(c)));for(const s of o.values())s.sandboxes.sort((c,l)=>n(c)-n(l)||(l.cloud?.startedAt??"").localeCompare(c.cloud?.startedAt??"")||c.id.localeCompare(l.id));return[...o.values()].sort((s,c)=>i(s)-i(c)||+(s.key==="")-+(c.key==="")||s.name.localeCompare(c.name,void 0,{sensitivity:"base"})||s.key.localeCompare(c.key))}function ye(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_northflank_error_profileRequired_title(),description:r.cloudMachines_northflank_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_northflank_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_northflank_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_northflank_error_quotaRate_description():r.cloudMachines_northflank_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_northflank_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_northflank_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_northflank_error_tokenRejected_title(),description:r.cloudMachines_northflank_error_tokenRejected_description()};case"project-missing":return t(r.cloudMachines_northflank_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_northflank_error_permissionDenied_title(),description:r.cloudMachines_northflank_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_northflank_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_northflank_error_serviceLost_title(),description:r.cloudMachines_northflank_error_serviceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_northflank_error_bootstrapFailed_description());default:return t(r.cloudMachines_northflank_error_apiError_description())}}}}function Re(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_agent37_error_profileRequired_title(),description:r.cloudMachines_agent37_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_agent37_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_agent37_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_agent37_error_quotaRate_description():r.cloudMachines_agent37_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_agent37_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_agent37_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_agent37_error_keyRejected_title(),description:r.cloudMachines_agent37_error_keyRejected_description()};case"permission-denied":return{title:r.cloudMachines_agent37_error_permissionDenied_title(),description:r.cloudMachines_agent37_error_permissionDenied_description()};case"no-capacity":return{title:r.cloudMachines_agent37_error_noCapacity_title(),description:r.cloudMachines_agent37_error_noCapacity_description()};case"template-missing":return t(r.cloudMachines_agent37_error_templateMissing_description());case"sandbox-lost":return{title:r.cloudMachines_agent37_error_instanceLost_title(),description:r.cloudMachines_agent37_error_instanceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_agent37_error_bootstrapFailed_description());default:return t(r.cloudMachines_agent37_error_apiError_description())}}}}function Ce(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_vercel_error_profileRequired_title(),description:r.cloudMachines_vercel_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_vercel_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_vercel_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_vercel_error_quotaRate_description():r.cloudMachines_vercel_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_vercel_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_vercel_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_vercel_error_keyRejected_title(),description:r.cloudMachines_vercel_error_keyRejected_description()};case"project-missing":return t(r.cloudMachines_vercel_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_vercel_error_permissionDenied_title(),description:r.cloudMachines_vercel_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_vercel_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_vercel_error_sandboxLost_title(),description:r.cloudMachines_vercel_error_sandboxLost_description()};case"bootstrap-failed":return t(r.cloudMachines_vercel_error_bootstrapFailed_description());default:return t(r.cloudMachines_vercel_error_apiError_description())}}}}function Tt(e,t){if(e.code==="cloud-machine-unavailable"&&e.reason==="relay-unreachable")return{title:r.cloudMachines_error_relayUnreachable_title(),description:e.relayUrl?r.cloudMachines_error_relayUnreachable_description({host:j(e.relayUrl)}):r.cloudMachines_error_relayUnreachable_noHost_description()};const o=e.provider??t;if(o==="northflank")return ye(e);if(o==="agent37")return Re(e);if(o==="vercel")return Ce(e);switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_error_profileRequired_title(),description:r.cloudMachines_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_error_quotaRate_description():r.cloudMachines_error_quotaConcurrency_description()};case"cloud-machine-unavailable":switch(e.reason){case"not-configured":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_notConfigured_description()};case"key-rejected":return{title:r.cloudMachines_error_keyRejected_title(),description:r.cloudMachines_error_keyRejected_description()};case"template-missing":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_templateMissing_description()};case"sandbox-lost":return{title:r.cloudMachines_error_sandboxLost_title(),description:r.cloudMachines_error_sandboxLost_description()};case"bootstrap-failed":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_bootstrapFailed_description()};default:return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_apiError_description()}}}}function Ft(e,t,o){const n=e.trim();if(!n)return r.cloudMachines_form_name_required();if(U(n)>H||/[\u0000-\u001f\u007f]/u.test(n))return r.cloudMachines_form_name_invalid();const i=n.toLowerCase();return t.some(s=>s.id!==o&&s.name.trim().toLowerCase()===i)?r.cloudMachines_form_name_taken():null}const Ie=a.createSelector(e=>Y.select(e)&&e.remoteMachines?.supported===!0&&e.cloudMachines?.supported===!0),Bt=a.createSelector(e=>{const t=e.cloudMachines?.providerKinds??["e2b"];return e.cloudMachines?.entries===!0?t:t.filter(o=>o==="e2b")}),Ut=a.createSelector(e=>e.cloudMachines?.entries===!0);function q(e){return Object.values(e.cloudMachines?.providers??{}).sort((t,o)=>t.configuredAt.localeCompare(o.configuredAt)||t.name.localeCompare(o.name))}const Ht=a.createSelector(q),Vt=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).sort((t,o)=>(t.cloud?.startedAt??"").localeCompare(o.cloud?.startedAt??""))),Wt=a.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).filter(t=>t.cloud?.state==="paused").length);function Oe(e,t){const o=t.cloud;return!o?.agentId||!o.workspaceId||!I.select(e,o.workspaceId)?null:{workspaceId:o.workspaceId,agentId:o.agentId}}const Yt=a.createSelector((e,t)=>{const o={},n={};for(const i of t){const s=i.cloud?.workspaceId;if(s&&!(s in o)){const c=I.select(e,s);o[s]=c?.title||c?.name||null}n[i.id]=Oe(e,i)}return{workspaceNames:o,agentLinks:n}}),zt=a.createSelector(e=>e.cloudMachines?.readAt??{}),Gt=a.createSelector(e=>e.cloudMachines?.pending??{}),Kt=a.createSelector(e=>e.cloudMachines?.failures??{}),$t=a.createSelector(e=>e.cloudMachines?.validated??null);function Xt(e){if(!Ie.select(e))return null;const t=q(e);if(t.length===0)return null;const o=e.cloudMachines?.entries===!0;return t.map(n=>({cloudMachineId:n.id,label:n.provider==="e2b"?o&&(t.length>1||n.name.trim().toLowerCase()!=="e2b")?r.cloudMachines_startOn_entry_label({name:n.name}):r.cloudMachines_startOn_label():n.name.trim().toLowerCase()===k(n.provider).toLowerCase()?k(n.provider):n.provider==="northflank"?r.cloudMachines_startOn_northflank_label({name:n.name}):n.provider==="agent37"?r.cloudMachines_startOn_agent37_label({name:n.name}):r.cloudMachines_startOn_vercel_label({name:n.name}),unavailableReason:n.state==="key-rejected"?Se(n.provider).keyRejected:null,needsProfile:!we(e,n)}))}function we(e,t){const o=oe.select(e),n=e.providerSettings?.profiles?.defaults??{},i={defaultRemoteLaunch:J.select(e),defaultRemoteIncompatibility:X.select(e)},s=d=>o[d]!==!1&&(t.agentProviders.length===0||t.agentProviders.includes(d)),c=new Set([...t.agentProviders,...Object.keys(i.defaultRemoteLaunch??{})]);for(const d of c)if(s(d)&&(n[d]?.env.length??0)>0&&D(d,i))return!0;const l=e.providerSettings?.profiles?.items,_=l?h(l):[];return Q.select(e).some(d=>{if(d.remoteCompatible!==!0||!s(d.baseProviderId))return!1;const P=_.find(b=>b.providerRef===d.providerRef);return!P||P.env.some(b=>b.kind==="set")})}function Jt(e,t,o=e.cloudMachines?.providers[W]??null){if(!t)return null;const n=o,i=f(t);if(n&&n.agentProviders.length>0&&!n.agentProviders.includes(i))return r.cloudMachines_startOn_providerMissing();const s=e.providerSettings?.profiles;if(v(t)){const l=s?h(s.items).find(_=>_.providerRef===t):void 0;return l?l.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():l.env.some(_=>_.kind==="set")?null:r.cloudMachines_startOn_needsProfile():null}const c=s?.defaults?.[i];return c?c.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():c.env.some(l=>l.kind==="set")?null:r.cloudMachines_startOn_needsProfile():s?.loadStatus==="success"?r.cloudMachines_startOn_needsProfile():null}export{Fe as $,xt as A,x as B,Rt as C,m as D,Ct as E,It as F,yt as G,kt as H,At as I,g as J,S as K,it as L,Ht as M,je as N,Ut as O,Z as P,Kt as Q,Ie as R,Gt as S,Bt as T,zt as U,Vt as V,$t as W,oe as X,nt as Y,re as Z,et as _,Lt as a,L as a0,Ze as a1,Be as a2,ze as a3,Wt as a4,at as a5,Te as a6,lt as a7,ct as a8,He as a9,Yt as aA,Xt as aB,gt as aC,Ve as aa,tt as ab,rt as ac,Ue as ad,Ne as ae,We as af,Ye as ag,Xe as ah,Je as ai,dt as aj,ft as ak,mt as al,pt as am,vt as an,ht as ao,st as ap,_t as aq,ut as ar,qe as as,Mt as at,Ke as au,Ge as av,w as aw,$e as ax,Qe as ay,ot as az,wt as b,Ot as c,Ft as d,qt as e,Tt as f,Jt as g,Se as h,Et as i,bt as j,me as k,D as l,ie as m,Pt as n,le as o,ce as p,St as q,Dt as r,te as s,Nt as t,jt as u,_e as v,O as w,De as x,pe as y,E as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{_ as i}from"./51_h0jm2.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const E=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function v(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){E.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DtHX0_aW.js","/app/immutable/chunks/51_h0jm2.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CbRsc9i4.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BEklUrxK.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DxvSggY5.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/Cj_UUgNI.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/Cgn_eC9-.js","/app/immutable/chunks/BQDGTBxC.js","/app/immutable/chunks/CpPNoOk-.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BSfkjlLx.js","/app/immutable/chunks/B-_ROixI.js","/app/immutable/chunks/BAymCgEX.js","/app/immutable/chunks/PXCFrn2V.js","/app/immutable/chunks/CdOh_Fmv.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/Bjy4ygfJ.js","/app/immutable/chunks/DGmOjLYi.js","/app/immutable/chunks/C9UsZ4re.js","/app/immutable/chunks/DqFWZ_g1.js","/app/immutable/chunks/D6dNunKo.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/DSQT151l.js","/app/immutable/chunks/BxwkoIbZ.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CgwFGLCK.js","/app/immutable/chunks/CnztNSaN.js","/app/immutable/chunks/Bqm2Rf6d.js","/app/immutable/chunks/BRRvOx4M.js","/app/immutable/chunks/D-NrCL67.js","/app/immutable/chunks/CA2ANaNj.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/DWDPOFkL.js","/app/immutable/chunks/BGT9uvaQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as i}from"./51_h0jm2.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const E=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function v(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){E.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./DtHX0_aW.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await n(t,{preserveFocus:!0,background:e.assistantContent===!0,agentId:e.assistantAgentId})){if(e.assistantContent)return;const{openPanel:o}=await i(async()=>{const{openPanel:a}=await import("./CbRsc9i4.js").then(r=>r.IE);return{openPanel:a}},__vite__mapDeps([3,4,2,5,6,7,8,1,9,10,11]),import.meta.url),{store:f}=await i(async()=>{const{store:a}=await import("./CA2ANaNj.js");return{store:a}},__vite__mapDeps([45,3,4,2,5,6,7,8,1,9,10,11,46,47]),import.meta.url);f.dispatch(o("chief"));const{goto:p}=await i(async()=>{const{goto:a}=await import("./BGT9uvaQ.js").then(r=>r.n);return{goto:a}},__vite__mapDeps([48,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(s(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!s(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(_,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./BGT9uvaQ.js").then(o=>o.n);return{goto:n}},__vite__mapDeps([48,2]),import.meta.url);return e.state?u(t,{state:e.state}):u(t)}const b=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:_,isHudWindowRenderer:d,isSettingsRoute:s,navigateToRoute:v},Symbol.toStringTag,{value:"Module"}));export{_ as S,s as a,y as b,l as c,h as d,T as e,b as f,d as i,v as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bo as z,bs as I,a7 as O,ay as x,W as y,aD as S,a5 as Q,bf as j,bA as q,bn as E,c9 as G,aA as r,aB as J}from"./CJxGDkBm.js";import{t as K,bo as a,bw as L,b as M,bp as N}from"./51_h0jm2.js";import{b as R}from"./CpPNoOk-.js";import"./
|
|
1
|
+
import{bo as z,bs as I,a7 as O,ay as x,W as y,aD as S,a5 as Q,bf as j,bA as q,bn as E,c9 as G,aA as r,aB as J}from"./CJxGDkBm.js";import{t as K,bo as a,bw as L,b as M,bp as N}from"./51_h0jm2.js";import{b as R}from"./CpPNoOk-.js";import"./THdp5Vpk.js";import{i as U}from"./PXCFrn2V.js";import{s as w}from"./DxvSggY5.js";import{a as V}from"./BEV9WkWU.js";import{az as T,av as n,aQ as X}from"./CdOh_Fmv.js";import{F as Y}from"./CYKOPxuJ.js";var Z=new Set(["$$slots","$$events","$$legacy","children","child","id","ref","type","disabled","openOnHover","openDelay","closeDelay"]),$=J("<button><!></button>");function A(v,t){const _=z();if(new.target)return K({component:A,...v});I(t,!0);let p=a(t,"children",7),l=a(t,"child",7),i=a(t,"id",23,()=>T(_)),d=a(t,"ref",15,null),c=a(t,"type",7,"button"),f=a(t,"disabled",7,!1),u=a(t,"openOnHover",7,!1),g=a(t,"openDelay",7,700),m=a(t,"closeDelay",7,300),B=N(t,Z);const h=V.create({id:n(()=>i()),ref:n(()=>d(),e=>d(e)),disabled:n(()=>!!f()),openOnHover:n(()=>u()),openDelay:n(()=>g()),closeDelay:n(()=>m())}),D=G(()=>X(B,h.props,{type:c()}));var C={get children(){return p()},set children(e){p(e),r()},get child(){return l()},set child(e){l(e),r()},get id(){return i()},set id(e=T(_)){i(e),r()},get ref(){return d()},set ref(e=null){d(e),r()},get type(){return c()},set type(e="button"){c(e),r()},get disabled(){return f()},set disabled(e=!1){f(e),r()},get openOnHover(){return u()},set openOnHover(e=!1){u(e),r()},get openDelay(){return g()},set openDelay(e=700){g(e),r()},get closeDelay(){return m()},set closeDelay(e=300){m(e),r()},$set:L,$on:(e,P)=>M(t,e,P)};return Y(v,{get id(){return i()},get ref(){return h.opts.ref},children:(e,P)=>{var H=O(),F=x(H);{var W=s=>{var o=O(),b=x(o);w(b,l,()=>({props:S(D)})),y(s,o)},k=s=>{var o=$();R(o,()=>({...S(D)}));var b=Q(o);w(b,()=>p()??j),q(o),y(s,o)};U(F,s=>{l()?s(W):s(k,-1)})}y(e,H)},$$slots:{default:!0}}),E(C)}const de=A;export{A as P,de as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aB as v,b as y}from"./
|
|
1
|
+
import{aB as v,b as y}from"./CUNx-_2d.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
|