@intent-hq/web 2.343.1 → 2.344.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/package.json +1 -1
- package/web/app/immutable/assets/0.BtTQsuHZ.css +1 -0
- package/web/app/immutable/assets/DiagramPresentation.C2GLYoBN.css +1 -0
- package/web/app/immutable/chunks/{9kqz7dDm.js → -IITeht6.js} +1 -1
- package/web/app/immutable/chunks/{Ae-1QeEg.js → 2XZtwznc.js} +4 -4
- package/web/app/immutable/chunks/{iGTwwZkZ.js → 4GiF-64P.js} +1 -1
- package/web/app/immutable/chunks/7V9sfwkG.js +1 -0
- package/web/app/immutable/chunks/{DnouH0RQ.js → 9cPLPH_O.js} +1 -1
- package/web/app/immutable/chunks/{uXJ_E75I.js → B1Hn0_Hu.js} +1 -1
- package/web/app/immutable/chunks/{D_n6c_yZ.js → B461Cu-8.js} +1 -1
- package/web/app/immutable/chunks/{DyhEd_D5.js → B4yyNCE8.js} +1 -1
- package/web/app/immutable/chunks/{DFkJzID4.js → B5lHtLmV.js} +3 -3
- package/web/app/immutable/chunks/{BWar5Ve4.js → B7_gjxTl.js} +1 -1
- package/web/app/immutable/chunks/{BIGnKucK.js → B9dU3-fa.js} +1 -1
- package/web/app/immutable/chunks/{CJ557C-o.js → BAR7XkP3.js} +3 -3
- package/web/app/immutable/chunks/{BSJHYrig.js → BBC8ZwBc.js} +1 -1
- package/web/app/immutable/chunks/{CsjdKc-0.js → BIG4edn9.js} +1 -1
- package/web/app/immutable/chunks/{kIGC16c9.js → BIY2S7K4.js} +1 -1
- package/web/app/immutable/chunks/{CgdsufvB.js → BLHhhsG2.js} +1 -1
- package/web/app/immutable/chunks/{BOTuR8YM.js → BM1KP-FJ.js} +1 -1
- package/web/app/immutable/chunks/{D58P1mNO.js → BMs7t3_m.js} +1 -1
- package/web/app/immutable/chunks/{D0TlsaAe.js → BOa-AN22.js} +1 -1
- package/web/app/immutable/chunks/{BXNFvqQr.js → BPk8wgKn.js} +3 -3
- package/web/app/immutable/chunks/{Dogvf-Iu.js → BQAjCr1w.js} +1 -1
- package/web/app/immutable/chunks/{C4omy0Us.js → BRhVB6Sv.js} +1 -1
- package/web/app/immutable/chunks/{BytoSt_Z.js → BSo5IXuX.js} +1 -1
- package/web/app/immutable/chunks/{BAyUfXYZ.js → BUUYjiKy.js} +1 -1
- package/web/app/immutable/chunks/{wiuyjoXz.js → BUY1W-f0.js} +1 -1
- package/web/app/immutable/chunks/{DbnF6Yok.js → BXbF11Gp.js} +1 -1
- package/web/app/immutable/chunks/{DWcJHqWX.js → BYRfWsRg.js} +1 -1
- package/web/app/immutable/chunks/{COjSVIHG.js → BYg2F-3D.js} +1 -1
- package/web/app/immutable/chunks/{BXXxFrPj.js → BZm5iyKH.js} +1 -1
- package/web/app/immutable/chunks/{CQLYGyEz.js → B_frQYKx.js} +1 -1
- package/web/app/immutable/chunks/{Bdd_Up9A.js → BdHmsKvO.js} +1 -1
- package/web/app/immutable/chunks/BdNiI0PS.js +344 -0
- package/web/app/immutable/chunks/{G8V-Z8rX.js → BdUSoBxL.js} +2 -2
- package/web/app/immutable/chunks/{juKvR8YJ.js → Bev5K0J8.js} +4 -4
- package/web/app/immutable/chunks/{CrUW7uHI.js → BgN4cuBh.js} +1 -1
- package/web/app/immutable/chunks/{BfIFD0ql.js → BgzyvwGo.js} +1 -1
- package/web/app/immutable/chunks/{atiG7mlf.js → BhzRZYY1.js} +2 -2
- package/web/app/immutable/chunks/{BgEFdEVh.js → BjcX_fOv.js} +1 -1
- package/web/app/immutable/chunks/{B70m4__L.js → BjnZ1Xf3.js} +2 -2
- package/web/app/immutable/chunks/{C1fHwcnr.js → Bk2hJ8Ly.js} +1 -1
- package/web/app/immutable/chunks/{Dp7jUSi9.js → BkUAKnVY.js} +1 -1
- package/web/app/immutable/chunks/{BGvipfx2.js → BmB6-2Ft.js} +1 -1
- package/web/app/immutable/chunks/{BSDp34Kf.js → BmT6wRR1.js} +1 -1
- package/web/app/immutable/chunks/{BaEEaJBP.js → BnZrTj7m.js} +1 -1
- package/web/app/immutable/chunks/{DohG5a1a.js → BnjfAdW_.js} +1 -1
- package/web/app/immutable/chunks/{I0uVE7V8.js → BnrnoFjd.js} +1 -1
- package/web/app/immutable/chunks/{_wUGU0fc.js → Bo4mc4_O.js} +1 -1
- package/web/app/immutable/chunks/{Ptn6pOdb.js → BpIeTy9w.js} +1 -1
- package/web/app/immutable/chunks/{DoNhrjWd.js → Br0dSiCW.js} +1 -1
- package/web/app/immutable/chunks/{DYLHdssA.js → BrysY2Ec.js} +1 -1
- package/web/app/immutable/chunks/{BayXe-e8.js → BtBKKn81.js} +1 -1
- package/web/app/immutable/chunks/{DMte7IXf.js → BuFMu57Q.js} +1 -1
- package/web/app/immutable/chunks/{BsjKNm-k.js → Bv5I7YDM.js} +1 -1
- package/web/app/immutable/chunks/{DM_Dhcp5.js → BvSNOyzW.js} +2 -2
- package/web/app/immutable/chunks/{OrocR3hK.js → BvrMTALy.js} +1 -1
- package/web/app/immutable/chunks/{BznnhLs6.js → BwScowY6.js} +1 -1
- package/web/app/immutable/chunks/{Dlo7xxGg.js → By0eqGj-.js} +1 -1
- package/web/app/immutable/chunks/{DuHksFog.js → C-s9_soQ.js} +1 -1
- package/web/app/immutable/chunks/{AzBoScJz.js → C46XexX0.js} +1 -1
- package/web/app/immutable/chunks/{CHylN0y-.js → C4Jo6GXP.js} +1 -1
- package/web/app/immutable/chunks/{Dv_vjHi2.js → C59ujSMF.js} +1 -1
- package/web/app/immutable/chunks/{C-3x67fn.js → C62A1TLT.js} +2 -2
- package/web/app/immutable/chunks/{BIjcjB3s.js → C8b2UIVX.js} +1 -1
- package/web/app/immutable/chunks/{BoX75a7M.js → C91dOInA.js} +1 -1
- package/web/app/immutable/chunks/{BIqsMOOo.js → C9gix5Ke.js} +1 -1
- package/web/app/immutable/chunks/{N8Bwwvnf.js → CClqWu60.js} +1 -1
- package/web/app/immutable/chunks/{CfJdaoIE.js → CDFRnJ8k.js} +1 -1
- package/web/app/immutable/chunks/{CXHfGIt6.js → CDRWYo_y.js} +1 -1
- package/web/app/immutable/chunks/{BmmYJ5hU.js → CGXahRhf.js} +1 -1
- package/web/app/immutable/chunks/{C2Rkb1O5.js → CHFUz5Rr.js} +1 -1
- package/web/app/immutable/chunks/{CC401ReW.js → CHukbU1Q.js} +1 -1
- package/web/app/immutable/chunks/{BUUgD57b.js → CI-nVEa_.js} +1 -1
- package/web/app/immutable/chunks/{JIxwOKX_.js → CJSrEfR4.js} +1 -1
- package/web/app/immutable/chunks/{DIL0XcL6.js → CMO4ot9F.js} +1 -1
- package/web/app/immutable/chunks/{DJ0uFT5X.js → COMJNvT3.js} +1 -1
- package/web/app/immutable/chunks/{BqkRycEV.js → CPYWKVyq.js} +9 -9
- package/web/app/immutable/chunks/{iAu7Aj29.js → CPi3hzpu.js} +1 -1
- package/web/app/immutable/chunks/{DJL0zbbT.js → CTXbgIPd.js} +1 -1
- package/web/app/immutable/chunks/{C_AhBHEv.js → CThb3iAk.js} +1 -1
- package/web/app/immutable/chunks/{TvbL6LZd.js → CVikHxT_.js} +3 -3
- package/web/app/immutable/chunks/{DtxfuyBv.js → CWIcIgSm.js} +1 -1
- package/web/app/immutable/chunks/{ClQaWwZN.js → Ca3YR8yw.js} +1 -1
- package/web/app/immutable/chunks/{CVEBue1Q.js → CadpuSEK.js} +1 -1
- package/web/app/immutable/chunks/{Bgfnbjb4.js → CdN2Ihv_.js} +1 -1
- package/web/app/immutable/chunks/{DXw-WTZY.js → CdjPYGHf.js} +1 -1
- package/web/app/immutable/chunks/{D-2cdK33.js → CdqlgErf.js} +1 -1
- package/web/app/immutable/chunks/{CB2VdHhb.js → CerTrxRJ.js} +1 -1
- package/web/app/immutable/chunks/{Dyc_CyAW.js → Cfd0oFGI.js} +1 -1
- package/web/app/immutable/chunks/{BrU4OT9R.js → CgWXj0YG.js} +2 -2
- package/web/app/immutable/chunks/{BjGmqNpS.js → CiTK-_b6.js} +1 -1
- package/web/app/immutable/chunks/{CnZcDXmL.js → CicdOSYm.js} +2 -2
- package/web/app/immutable/chunks/{1JAPG9y2.js → Cj2EKBCH.js} +1 -1
- package/web/app/immutable/chunks/{CAHBBl9S.js → CjXLe_MO.js} +1 -1
- package/web/app/immutable/chunks/{C-DRfJcG.js → CjZIABEV.js} +1 -1
- package/web/app/immutable/chunks/{Cx2Zr_EY.js → Ck9j_FHl.js} +1 -1
- package/web/app/immutable/chunks/{w-1KkHyd.js → ClTZNeVO.js} +1 -1
- package/web/app/immutable/chunks/{BHekbKzn.js → CmSDhJgU.js} +1 -1
- package/web/app/immutable/chunks/{DwXYzqBQ.js → Cn19T3na.js} +1 -1
- package/web/app/immutable/chunks/{DrI6m-rY.js → Cn3xolhp.js} +1 -1
- package/web/app/immutable/chunks/{BpQOBsoR.js → CnJe4S2a.js} +1 -1
- package/web/app/immutable/chunks/{BP2y3sRZ.js → CnhilOhJ.js} +1 -1
- package/web/app/immutable/chunks/{DtVlaWMd.js → CoTJDQuc.js} +1 -1
- package/web/app/immutable/chunks/{DwZUZouP.js → CqhKSPXA.js} +1 -1
- package/web/app/immutable/chunks/{35fhULrG.js → CrH1YN9o.js} +1 -1
- package/web/app/immutable/chunks/{WQOeAOAl.js → Cs-BSsj3.js} +1 -1
- package/web/app/immutable/chunks/{kae1oT68.js → CsF8OjbK.js} +1 -1
- package/web/app/immutable/chunks/{C76q11mm.js → CwRpBR2e.js} +1 -1
- package/web/app/immutable/chunks/{CIwcmzpw.js → CxLPEkg7.js} +1 -1
- package/web/app/immutable/chunks/{BvXEM_ru.js → Cxz3q_28.js} +1 -1
- package/web/app/immutable/chunks/{Ci-yONgL.js → Cyfw6OkG.js} +1 -1
- package/web/app/immutable/chunks/{QoUsFhvz.js → CzQCBVm9.js} +1 -1
- package/web/app/immutable/chunks/{51PCa81S.js → CztRrCMq.js} +1 -1
- package/web/app/immutable/chunks/{DFq9n5nW.js → D-J8Mlcm.js} +1 -1
- package/web/app/immutable/chunks/{C2NHyJHV.js → D1uFLIU4.js} +1 -1
- package/web/app/immutable/chunks/{m1QfmWoj.js → D37kdZVn.js} +1 -1
- package/web/app/immutable/chunks/{DarHRPPY.js → D4pwA7AS.js} +2 -2
- package/web/app/immutable/chunks/{Dnv7wJSL.js → D6-Slo8_.js} +1 -1
- package/web/app/immutable/chunks/{Ci9pTyYA.js → D61HjMue.js} +1 -1
- package/web/app/immutable/chunks/{p3CrvZe2.js → D6cqwcO2.js} +1 -1
- package/web/app/immutable/chunks/{BANxp4gx.js → D8DQsqlL.js} +1 -1
- package/web/app/immutable/chunks/{D__c4Yl1.js → D8FYgRYk.js} +1 -1
- package/web/app/immutable/chunks/{U7UFkZSE.js → D8YFvJ64.js} +1 -1
- package/web/app/immutable/chunks/{CIR7skK5.js → D9ajM8uP.js} +1 -1
- package/web/app/immutable/chunks/{DW4-9u0G.js → DA3kI_Ir.js} +1 -1
- package/web/app/immutable/chunks/{DjI8eVMr.js → DAPhb2nP.js} +45 -45
- package/web/app/immutable/chunks/{0sFbw5Xt.js → DAYo95RN.js} +1 -1
- package/web/app/immutable/chunks/{B0IMKrn3.js → DEnfRYcH.js} +1 -1
- package/web/app/immutable/chunks/{rPOaqvb6.js → DGySvVDu.js} +1 -1
- package/web/app/immutable/chunks/{DHTa3FGv.js → DHApIXYn.js} +1 -1
- package/web/app/immutable/chunks/{Bhmm0Csf.js → DHP1DFPI.js} +1 -1
- package/web/app/immutable/chunks/{Cvz-9_40.js → DIumxlqP.js} +1 -1
- package/web/app/immutable/chunks/{CeNWJyWT.js → DIyuJ_GU.js} +1 -1
- package/web/app/immutable/chunks/{BziNoOeQ.js → DLykoDqY.js} +1 -1
- package/web/app/immutable/chunks/{CGAWDKVf.js → DN71oh5l.js} +1 -1
- package/web/app/immutable/chunks/{BYONj21e.js → DNM32kqo.js} +1 -1
- package/web/app/immutable/chunks/{BsDPTTmM.js → DOrgOYHc.js} +2 -2
- package/web/app/immutable/chunks/{DEipLocY.js → DT4LiP7Y.js} +1 -1
- package/web/app/immutable/chunks/{CckzaWai.js → DTBnd4hM.js} +1 -1
- package/web/app/immutable/chunks/{BtXKsHf_.js → DTrgzOIA.js} +1 -1
- package/web/app/immutable/chunks/{CCv3Lx_U.js → DVH2puba.js} +1 -1
- package/web/app/immutable/chunks/{D2hN829h.js → DVYqzV0n.js} +1 -1
- package/web/app/immutable/chunks/{D7rZCWdO.js → DVsRM1tQ.js} +1 -1
- package/web/app/immutable/chunks/DWBLeVMU.js +1 -0
- package/web/app/immutable/chunks/{X4cuG_zB.js → DWiPdXwB.js} +1 -1
- package/web/app/immutable/chunks/D_aUnmwC.js +1 -0
- package/web/app/immutable/chunks/{DRp_Nj0f.js → DaaneYTG.js} +1 -1
- package/web/app/immutable/chunks/{DDaNHu84.js → DhDeMWX_.js} +1 -1
- package/web/app/immutable/chunks/{Bx3b0rPd.js → DhUtJEn_.js} +1 -1
- package/web/app/immutable/chunks/{CIQcnDuR.js → DhtvToBX.js} +1 -1
- package/web/app/immutable/chunks/{_0BFM6IU.js → DjCFWz1t.js} +2 -2
- package/web/app/immutable/chunks/{Bka1VG1N.js → Dl7ZwNmB.js} +1 -1
- package/web/app/immutable/chunks/DnzNFOP-.js +1 -0
- package/web/app/immutable/chunks/{HZ3QrylZ.js → Dp_2W12t.js} +1 -1
- package/web/app/immutable/chunks/{DZGCpHpr.js → Dq9eeDUE.js} +1 -1
- package/web/app/immutable/chunks/{C4Ninryq.js → DqWTOCbK.js} +1 -1
- package/web/app/immutable/chunks/{BpLC2eO9.js → DuIazAmY.js} +1 -1
- package/web/app/immutable/chunks/{DGznsmsL.js → DukOM-92.js} +1 -1
- package/web/app/immutable/chunks/{L-Y-TBRM.js → Dx9ju3Oy.js} +1 -1
- package/web/app/immutable/chunks/{DxMdBYgz.js → DxBvyCwr.js} +1 -1
- package/web/app/immutable/chunks/{v2YVbizz.js → DzX5UiFd.js} +1 -1
- package/web/app/immutable/chunks/{B5tMdivj.js → Gobu28zb.js} +2 -2
- package/web/app/immutable/chunks/{BIIYAsFZ.js → HIyZggkg.js} +4 -4
- package/web/app/immutable/chunks/{DTVdw8r4.js → HLKPZgVy.js} +1 -1
- package/web/app/immutable/chunks/{B422XfSt.js → KJX0Kw6L.js} +3 -3
- package/web/app/immutable/chunks/{D2waAEN7.js → L30ES58t.js} +1 -1
- package/web/app/immutable/chunks/{DbboHfqH.js → MioiZpXB.js} +1 -1
- package/web/app/immutable/chunks/{DA06uG-a.js → NTeezaZ2.js} +1 -1
- package/web/app/immutable/chunks/{DySlMfKo.js → PDh5csw9.js} +1 -1
- package/web/app/immutable/chunks/{wJj3WeBH.js → PXetJRrh.js} +2 -2
- package/web/app/immutable/chunks/{CAXcxCRW.js → RNDWAc1K.js} +6 -6
- package/web/app/immutable/chunks/{CDFewoTI.js → SEJ8ae0u.js} +1 -1
- package/web/app/immutable/chunks/{BPPRSM7X.js → SxNmK2GR.js} +3 -3
- package/web/app/immutable/chunks/{Bc5tOdcb.js → TKg6aZ2_.js} +1 -1
- package/web/app/immutable/chunks/{CBq9ao8v.js → UtZBgRek.js} +1 -1
- package/web/app/immutable/chunks/{CHVKhAgJ.js → Wsz69q6g.js} +1 -1
- package/web/app/immutable/chunks/{z5uPT3dt.js → WyTFZ_7I.js} +1 -1
- package/web/app/immutable/chunks/{r9qRR0z6.js → X4o7hGKf.js} +3 -3
- package/web/app/immutable/chunks/{CCaHJZV8.js → XvLHDIL-.js} +1 -1
- package/web/app/immutable/chunks/{DpjBemXH.js → _RGinDCt.js} +1 -1
- package/web/app/immutable/chunks/{DZiSQoCc.js → _VCQMG81.js} +1 -1
- package/web/app/immutable/chunks/{v2vpkl1z.js → bJswqAg7.js} +1 -1
- package/web/app/immutable/chunks/{ZN-mesLP.js → ei2mFcvT.js} +1 -1
- package/web/app/immutable/chunks/{DoWkfKYp.js → f5lTIPHi.js} +1 -1
- package/web/app/immutable/chunks/{CgFIU5ie.js → fCEIPyv5.js} +1 -1
- package/web/app/immutable/chunks/{CFK6lvfY.js → fI_J_To4.js} +1 -1
- package/web/app/immutable/chunks/{CVGmnzrp.js → g9G7tvrf.js} +1 -1
- package/web/app/immutable/chunks/{BrNDzmoP.js → gJDgmD_2.js} +1 -1
- package/web/app/immutable/chunks/{CJlP-cGG.js → gsD5Xe0D.js} +4 -4
- package/web/app/immutable/chunks/{C2uZ_VhE.js → gsElU_36.js} +1 -1
- package/web/app/immutable/chunks/{CZt5ZBg4.js → iwClg1fT.js} +3 -3
- package/web/app/immutable/chunks/{BdI_W2oB.js → ixz6jb_3.js} +1 -1
- package/web/app/immutable/chunks/{CepAUbyM.js → jbKFYOOg.js} +1 -1
- package/web/app/immutable/chunks/{DJh_DDe7.js → juQAMcx2.js} +1 -1
- package/web/app/immutable/chunks/kHCC2X2-.js +1 -0
- package/web/app/immutable/chunks/{C3Z0swGN.js → lI7T5mqw.js} +1 -1
- package/web/app/immutable/chunks/{BaA_OrGq.js → nLXSdbN2.js} +1 -1
- package/web/app/immutable/chunks/{DtbQslHZ.js → oYQw_s1S.js} +1 -1
- package/web/app/immutable/chunks/{nlN0b4Kg.js → ozzjQyCh.js} +1 -1
- package/web/app/immutable/chunks/{D8eBy-8s.js → pAYxBetQ.js} +1 -1
- package/web/app/immutable/chunks/{DMXJ8RT1.js → quYX3pdL.js} +1 -1
- package/web/app/immutable/chunks/{Cu8zpbs5.js → sEcTUaec.js} +1 -1
- package/web/app/immutable/chunks/{OmpkRRYb.js → tHDPdTwr.js} +1 -1
- package/web/app/immutable/chunks/{D7Ydchf3.js → uPiYeMwS.js} +1 -1
- package/web/app/immutable/chunks/{BHxqvJ6p.js → xBFqBq1j.js} +1 -1
- package/web/app/immutable/chunks/{BJ9asJd9.js → yl6pDKiQ.js} +1 -1
- package/web/app/immutable/chunks/{ClN0hrCD.js → zWI60sec.js} +1 -1
- package/web/app/immutable/entry/app.DfuiYuem.js +4 -0
- package/web/app/immutable/entry/start.DDUK339f.js +1 -0
- package/web/app/immutable/nodes/{0.maNxDgKk.js → 0.D56mBX7M.js} +1 -1
- package/web/app/immutable/nodes/{1.CrUOCJzJ.js → 1.az7hmVZE.js} +1 -1
- package/web/app/immutable/nodes/{10.DAHzIxDn.js → 10.ijh736ED.js} +1 -1
- package/web/app/immutable/nodes/{11.QGXqc7LC.js → 11.CPz1gfx7.js} +1 -1
- package/web/app/immutable/nodes/{12.Deg0J99J.js → 12.IWuvbIEt.js} +1 -1
- package/web/app/immutable/nodes/{13.DYahTbd4.js → 13.K9ySk2sQ.js} +1 -1
- package/web/app/immutable/nodes/{14.DqcYIHGs.js → 14.BvEshoLb.js} +1 -1
- package/web/app/immutable/nodes/{15.fBsD-rf2.js → 15.MdkxIvV5.js} +1 -1
- package/web/app/immutable/nodes/{16.BB4D0sXM.js → 16.CKCeF79S.js} +1 -1
- package/web/app/immutable/nodes/{17.C504DyaY.js → 17.DnoEG3fq.js} +2 -2
- package/web/app/immutable/nodes/2.B4faJzFv.js +13 -0
- package/web/app/immutable/nodes/{3.C7nQO7Qp.js → 3.CXkOfW97.js} +1 -1
- package/web/app/immutable/nodes/{4.DOK8Tw7p.js → 4.DAQzul95.js} +1 -1
- package/web/app/immutable/nodes/{5.ubLsJnyC.js → 5.DE5jTHSS.js} +1 -1
- package/web/app/immutable/nodes/{6.CyCRzMDW.js → 6.DhIYx_bX.js} +1 -1
- package/web/app/immutable/nodes/{7.Bg70Q16x.js → 7.CqVh2822.js} +1 -1
- package/web/app/immutable/nodes/{8.BvaAzEQm.js → 8.CtwSJYpI.js} +10 -10
- package/web/app/immutable/nodes/{9.DO468RMT.js → 9.RM7Dv9Cl.js} +5 -5
- package/web/app/version.json +1 -1
- package/web/index.html +16 -16
- package/web/app/immutable/assets/0.DZzKp2Fe.css +0 -1
- package/web/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css +0 -1
- package/web/app/immutable/chunks/BvpPy--g.js +0 -1
- package/web/app/immutable/chunks/CO2d8RwC.js +0 -1
- package/web/app/immutable/chunks/CQpQeUin.js +0 -1
- package/web/app/immutable/chunks/CTjSHpOw.js +0 -344
- package/web/app/immutable/chunks/DvnMaoHD.js +0 -1
- package/web/app/immutable/chunks/qiTOR0DK.js +0 -1
- package/web/app/immutable/entry/app.F35RZd_b.js +0 -4
- package/web/app/immutable/entry/start.Dg01C9a0.js +0 -1
- package/web/app/immutable/nodes/2.ByX1NsE4.js +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var Ct=Object.defineProperty;var Dt=(e,t,n)=>t in e?Ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Dt(e,typeof t!="symbol"?t+"":t,n);import{B as xt,O as Rt,dG as Be,cG as pe,dr as Pt,al as Bt,b1 as Ge,z as Ot,dS as $t}from"./BqkRycEV.js";import{Ix as A,g as be,nw as x,vM as Ut,Bx as Ye,vO as Lt,CK as Je,cw as Nt,cx as Ht,nx as Qe,nj as Ft,c as ke,fE as Kt,lM as Wt,cE as jt}from"./CnZcDXmL.js";import{e as qt,b as ae,F as Vt,y as re,_ as ve,G as zt,C as Gt,W as Xe,v as Yt,u as Jt,M as Qt}from"./hX9Crt6i.js";import{D as Oe,a as Xt,d as Zt}from"./CQcEqK4G.js";import{l as en,o as tn,g as Ze,r as nn,m as an,D as rn}from"./D-2cdK33.js";import{a as et,e as sn}from"./CfJdaoIE.js";import{f as on}from"./BsjKNm-k.js";import{bp as b,_ as fe}from"./CGWRZzdk.js";import{a9 as tt,aA as se,J as he,a as nt,n as at,cQ as rt,e as st,aH as it,M as cn,ab as ln,aT as $e,d as le,C as dn,cR as un,U as mn,a6 as pn,aI as fn,bY as hn}from"./DJL0zbbT.js";import{bD as gn,bq as yn,aX as wn,by as bn,bs as kn,ax as vn}from"./B422XfSt.js";import{O as _n,z as Sn}from"./Bhmm0Csf.js";import{t as q,q as Mn,v as An}from"./BOTuR8YM.js";import{x as In,J as Tn,ai as En,ar as Cn}from"./BXNFvqQr.js";import{a as Ue,b as Dn,g as xn}from"./DypB-Dwi.js";import{z as Rn}from"./CVGmnzrp.js";import{C as Pn}from"./BvFAWM27.js";import{i as Bn}from"./L-Y-TBRM.js";import{o as $,e as On,l as V,s as E,n as ce,b as $n,d as Un,c as Ln}from"./CIyUrgF0.js";function Cr(e,t){if(e)return e.model}function Nn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Dr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?xt(e):!1)&&!Nn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function xr(e){return Rt(e.messageMetadata)}function Hn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Rr(e){return Hn({...e,createdAt:Date.parse(e.queuedAt)})}const Fn=8*1024*1024,Kn=3*1024*1024;function Wn(e){return Math.ceil(Math.max(0,e)/3)*4}function jn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=Kn&&typeof t=="number"&&t===Wn(e.size)?t:null}async function ot(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const i=en(e.source,e.saved);if(i.length>1e4)throw new Error("media-animation-layer-limit");const o=[];for(const c of i)s(),o.push({...c,png:await tn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:qt,jobId:t,media:e,layers:o});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const _e={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function Le(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function qn(e){const t=e.video==="full"?b.dock_captureEditor_videoFull_label():b.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?b.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?b.dock_captureEditor_voiceTranscript_label():b.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Vn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const j=on;function Pr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,i=t.speech.error??t.speech.capability?.reason??null,o=Vn(t.captureError,t.clips.find(g=>g.status==="failed"&&g.error==="permission")?.error??null,i,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",h=c?.error==="permission"&&c.kind==="pick",p=i?.startsWith("speech-permission")?"speech":i?.startsWith("microphone-permission")||i==="permission"?"microphone":void 0,m={},y={},f=(g,D,L)=>{m[g]=D,L&&(y[g]=L)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),h&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(i&&r.speechError?.(i))??s.speechPermission,p));const k=g=>{const D=y[g];D&&e.actions.onOpenSettings(D)},v=new Set(t.evidenceOwnedItemIds),I=t.clips.find(g=>g.status==="recording"),S=t.clips.length>=ae.clips,_=t.capabilities,B=t.speech.available,C=new Set(t.clips.filter(g=>g.status==="recording"||g.status==="placing"||!!g.media).flatMap(g=>g.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:g,marks:D})=>!!g.media||g.source!=="annotate"||!C.has(g.id)||D.some(({mark:L})=>!L.clipId)).map(({image:g,marks:D})=>({kind:"image",id:g.contextItemId,url:a.previews[g.id]??"",markCount:D.length,owner:"evidence",...a.previews[g.id]?{}:{status:"placing"}})),...t.clips.filter(g=>!g.discarding).map(g=>({kind:"clip",id:g.contextItemId??g.id,duration:j(g.status==="recording"?Le(g,a.now):g.durationMs),recording:g.status==="recording",...g.media?.saved?{summary:qn(g.media.saved)}:{},...g.status==="ready"&&ge(e.workspaceId,g.path)?{url:ge(e.workspaceId,g.path)}:{},owner:"evidence",...g.status==="placing"?{status:"placing"}:{},...g.status==="failed"?{status:"failed",...g.error==="limit"?{error:b.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(g=>!v.has(g.id)).map(g=>({...g.imageData&&g.imageMimeType?{kind:"image",id:g.id,url:`data:${g.imageMimeType};base64,${g.imageData}`,markCount:0,file:{name:g.label,imageData:g.imageData,imageMimeType:g.imageMimeType}}:{kind:"file",id:g.id,name:g.label},owner:"attachment",...g.placementStatus==="placing"?{status:"placing"}:{},...g.placementStatus==="failed"?{status:"failed",error:g.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.dictation?{kind:"listening",label:r.listening}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...o?{settingsPane:o}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!_.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!_.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!_.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!_.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:j(I?Le(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?j(a.now-t.dictation.startedAt):j(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,zn=["image/png","image/jpeg","image/webp"],Ne=e=>zn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function Br(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const y=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:y,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:y,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),h=r[s.image.id];return!c?.imageData||!u||!h?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(h),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const i=n.clips.find(c=>c.id===e||c.contextItemId===e);if(i){const c=i.status==="ready"?ge(t.workspaceId,i.path):null;if(!c)return null;const d=a.find(h=>h.id===i.contextItemId),u=await t.fetchBytes(c);if(!Yn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${i.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:i.durationMs,hasMicAudio:i.hasMicAudio}}const o=a.find(c=>c.id===e),l=Ne(o?.imageMimeType);return o?.imageData&&l?{kind:"image",name:o.label||"image",mimeType:l,bytes:He(o.imageData)}:null}async function Gn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Yn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function Or(e){try{return(await Se()?.invoke(_e.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Jn(){try{return await Se()?.invoke(_e.CLIPBOARD_READ,{})??null}catch{return null}}async function $r(e){try{const t=await Se()?.invoke(_e.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function Qn(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function Ur(e,{onIntentMedia:t,isCurrent:n,read:a=Jn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,i=Array.from(r.files),o=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await Qn(i,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of i)c.items.add(u);for(const[u,h]of o)c.setData(u,h);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function Xn(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function Zn(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function ct(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function ea(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const lt={placeAttachment:it,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=lt){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},i=async m=>un(m,r)?$e(e,r,a.getAttachmentInfo):void 0;if(ct(n.data)<=cn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const y=await i(m);if(y)return y;throw m}const o=Xn(n.data),l=await ea(o);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,o.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&ln(m)){const y=await $e(e,r,a.getAttachmentInfo);if(y)return y}throw m}const u=Math.min(mn,d),h=Math.ceil(o.byteLength/u);let p=!1;try{for(let m=0;m<h;m++){const y=o.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,Zn(y),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const y=p?await i(m):void 0;if(y)return y;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ta(e,t){return pn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function na(e,t){return e instanceof Ae?e.retryBlocks:t}async function aa(e,t,n=lt,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],i=[],o=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),i.push(p);continue}const d=c,u=d.placementFileName??ta(d.mimeType,l),h=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...h!==void 0?{idempotencyKey:h}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),i.push(m)}catch(p){const m=dn(p);o.push(m?`${u} (${m})`:u),i.push(h!==void 0?{...d,placementIdempotencyKey:h,placementFileName:u}:d)}}if(o.length>0)throw new Ae(b.chat_imagePlacement_failed_error({names:o.join(", ")}),i);return le(a),s}const Lr=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:ct,imageRetryBlocks:na,placeImageAttachment:Me,toImageReferenceBlocks:aa},Symbol.toStringTag,{value:"Module"}));function dt(){try{return gn()}catch{return null}}function ra(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:dt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const H={current:e=>dt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>yn(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,it),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function G(e){return H.current(e)}function sa(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:x(n.drafts,Vt(e,t))?.clearRevision??0,binding:ra()}}function Nr(e,t,n){const a=sa(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&G(n.binding)}function ut(e,t){return()=>{if(!e.current(t))throw new Ie}}const mt=Object.freeze({rawRetention:!1,chiefAttachments:!1});function Hr(e){return e!==mt}const de=new Map;function pt(e,t=H){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=ut(t,e);a=(async()=>{r();const i=await t.capabilities();r();const o=i?.server?.capabilities;if(!o||typeof o!="object")throw new Error("unobserved");return{rawRetention:o.rawScreenshotRetention===1,chiefAttachments:o.chiefAttachments===1}})().catch(()=>(de.delete(n),mt)),de.set(n,a)}return a}class Z extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function ft(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function ia(e){const t=String(e?.message??"");return ft(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function oa(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ca extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function la(e){const t=e.api??H,n=e.now??Date.now,a=ut(t,e.binding);a();const r=await pt(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),i=[];for(const o of e.images){const l=e.records[o.image.id];let c=l&&l.signature===o.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:o.image.id,signature:o.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const h=c.compositeKey,p=t.mintKey(h??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}.${We(o.composite.mimeType)}`,{data:o.composite.base64,mimeType:o.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??o.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&o.raw&&!c.raw&&!c.rawSettled){const h=c.rawKey,p=t.mintKey(h??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}-original.${We(o.raw.mimeType)}`,{data:o.raw.base64,mimeType:o.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const y=oa(m,u,n());if(y==="expired")d({...c,rawSettled:!0});else if(y)d({...c,raw:y});else throw new Z("echo")}catch(y){if(ia(y))d({...c,rawSettled:!0});else throw y instanceof Z?y:ft(y)?new Z("refused"):y}}else throw new Z("unkeyed")}}catch(u){throw u instanceof Ie?u:new ca(o.image.id,u)}i.push(c)}return i}async function Fr(e,t,n,a){const r=()=>{if(!H.current(a))throw new Ie};r();const s=await H.placeImage(e,t,{...n,idempotencyKey:H.mintKey()},r);return r(),s}const da=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),ua=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function ie(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!da.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>ua.has(r)?r:"other")].join(":")}function Kr(e,t){return e instanceof O?{stage:e.stage,code:ie(e.code)}:{stage:t,code:ie(e)}}function F(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=ve(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ma(e,t,n,a,r,s){const i={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let o="validate";try{const l=()=>{if(!r()||!G(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(o="validate",s?.stage(o),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||F(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let h=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&h.voice==="transcript"&&d.transcript?.status!=="ready"){if(o="transcribe",s?.stage(o),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(h=re(u,u.capturedMarks??[],d.transcript))}o="plan",s?.stage(o);const m=ve(h,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const y={id:c.id,kind:u.kind,video:h.video,voice:h.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:v})=>({n:f,id:k.id,at_ms:v,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){o="screenshot-source",s?.stage(o);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const v=await Gn(k.url);l();const I={base64:Ze(v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};o="screenshot-render",s?.stage(o),i.images[c.id]=await nn(u,h,I),l()}else{if(!m.clips.length){y.video_attachment_id=null,y.frames=[],y.kept_ms=[],i.metadata.push(y);continue}const f={...d,saved:h};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await ot(f,p,a,()=>r()&&G(n),S=>{o=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,o="placement",s?.stage(o);const v=[k.value.video,...k.value.frames],I=[];for(let S=0;S<v.length;S++){l();const _=v[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":_.mimeType==="image/jpeg"?"jpg":"png"}`,C=await fn(e,B,{sourcePath:_.sourcePath,mimeType:_.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&G(n));l(),S===0?i.files.push({type:"file",attachmentId:C.attachmentId,fileName:B,mimeType:C.mimeType??_.mimeType,size:C.size}):(i.frames.push({type:"image",attachmentId:C.attachmentId,mimeType:_.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),i.framePromptBytes.push(jn(_))),I.push(C.attachmentId)}y.video_attachment_id=I[0],y.frames=k.value.frames.map((S,_)=>({mark_id:S.markId,attachment_id:I[_+1]})),y.kept_ms=m.clips}i.metadata.push(y)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return i}catch(l){throw l instanceof O?l:new O(o,ie(l))}}const ue=1568,pa=.85;async function fa(e,t){const n=Math.round(e.length*3/4/1024),a=await ha(e,t),{width:r,height:s}=a,i=r>ue||s>ue;let o=r,l=s;if(i){const f=ue/Math.max(r,s);o=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(o,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,o,l);let u=t;ga(d,o,l)||(u="image/jpeg");const h=await c.convertToBlob({type:u,quality:u==="image/jpeg"?pa:void 0}),p=h.type||u,m=await ya(h),y=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${o}×${l} | ${t} → ${p} | ${n} KB → ${y} KB`),{base64:m,mimeType:p}}async function ha(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ga(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ya(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function wa(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],i=o=>o*n;for(const{n:o,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:i(c.x),y:i(c.y),w:i(c.w),h:i(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:i(m.x),y:i(m.y)})),width:T.pen*r});else{const m={x:i(c.from.x),y:i(c.from.y)},y={x:i(c.to.x),y:i(c.to.y)};s.push({kind:"arrow",from:m,to:y,head:Sa(m,y,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=i(l.bounds.x+l.bounds.w),h=i(l.bounds.y),p=Zt({x:i(l.bounds.x),y:h,w:u-i(l.bounds.x),h:i(l.bounds.h)},{x:0,y:0,w:i(e.width),h:i(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(o),font:d*T.badgeTextScale})}return s}function ba(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((i,o)=>o?e.lineTo(i.x,i.y):e.moveTo(i.x,i.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(Xt(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function ka(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function va(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function ht(e,t,n,a,r=0){await an();const s=await ka(e.base64,e.mimeType);try{const i=Math.min(1,a/Math.max(t.width,t.height)),o=new OffscreenCanvas(Math.max(1,Math.round(t.width*i)),Math.max(1,Math.round(t.height*i))),l=o.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,o.width,o.height),ba(l,wa(t,n,i,r)),o}finally{s.close()}}async function _a(e,t,n){const a=await ht(e,t,n,Math.max(t.width,t.height));return fa(await va(a),"image/png")}async function Wr(e,t,n,a=384){const r=await ht(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Sa(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function jr(e,t){const n=zt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!F(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function qr({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:i,service:o,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!G(i))throw new O("validate","media-send-retired")};if(u(),n?.images.some(w=>w.mediaError)||n?.clips.some(w=>w.mediaError))throw new O("validate","invalid-saved-edit");const h=w=>!!w.media&&!F(w.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(w=>[w.id,a.find(M=>M.id===w.contextItemId)?.attachmentId??null]))}:null;for(const w of n?.clips??[]){if(!w.media||!F(w.media))continue;const M=a.find(Q=>Q.id===w.contextItemId);if(!M||M.attachmentId!==w.media.source.attachmentId||M.path!==w.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ma(e,n,i,o,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},y=new Set(n?.clips.filter(w=>h(w)||!!w.media&&F(w.media)).map(w=>w.id)),f=new Set(n?.clips.filter(w=>y.has(w.id)).flatMap(w=>(w.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(w=>w.source!=="annotate"||!!w.media||!f.has(w.id)||n.marks.some(M=>M.imageId===w.id&&!(M.clipId&&y.has(M.clipId))));d?.stage("burn");let v=[];try{v=n?await Ma({...n,images:k},a,m.images):[]}catch(w){throw new O("burn",ie(w))}if(m.framePromptBytes.reduce((w,M)=>w+(M??0),0)>Fn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(w=>w.media).map(w=>w.id)),_=n?{...n,images:k.map(w=>m.images[w.id]?{...w,width:m.images[w.id].width,height:m.images[w.id].height}:w),clips:n.clips.filter(w=>!h(w)),marks:n.marks.filter(w=>!S.has(w.imageId)&&!n.clips.some(M=>h(M)&&M.id===w.clipId))}:null;u();const B=m.metadata.some(w=>typeof w.transcript=="string"&&w.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!v.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let C=v,P=null;d?.stage("placement");const Re=n?await pt(i):null;if(u(),n&&(e!==be||Re?.chiefAttachments)){const w=await la({workspaceId:e,binding:i,images:k.map((M,Q)=>{const X=a.find(Et=>Et.id===M.contextItemId);return{image:M,signature:Gt(n,M.id),composite:{base64:v[Q].data,mimeType:v[Q].mimeType},raw:!M.media&&X?.imageData&&X.imageMimeType?{base64:X.imageData,mimeType:X.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),C=w.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(w.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const g=new Map(n?Xe(n).map(({n:w,mark:M})=>[M.id,w]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:g}:p&&{...p,markNumbers:g},L=n&&D?{...s,imageBlocks:[...C,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Jt(_,D),m.metadata.length?`[Edited capture outputs]
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BrysY2Ec.js","/app/immutable/chunks/CxLPEkg7.js","/app/immutable/chunks/DHP1DFPI.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/CGWRZzdk.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/BjnZ1Xf3.js","/app/immutable/chunks/BEyWfhqM.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/KJX0Kw6L.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/nmrokYzj.js","/app/immutable/chunks/B10JrSzM.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BM1KP-FJ.js","/app/immutable/chunks/DVYqzV0n.js","/app/immutable/chunks/CicdOSYm.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/hX9Crt6i.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/By0eqGj-.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/CPYWKVyq.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DaaneYTG.js","/app/immutable/chunks/CDFRnJ8k.js","/app/immutable/chunks/C91dOInA.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/g9G7tvrf.js","/app/immutable/chunks/CnJe4S2a.js","/app/immutable/chunks/CwRpBR2e.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/C62A1TLT.js","/app/immutable/chunks/4GiF-64P.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/BUY1W-f0.js","/app/immutable/chunks/BAR7XkP3.js","/app/immutable/chunks/DAYo95RN.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ct=Object.defineProperty;var Dt=(e,t,n)=>t in e?Ct(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Pe=(e,t,n)=>Dt(e,typeof t!="symbol"?t+"":t,n);import{B as xt,O as Rt,dG as Be,cG as pe,dr as Pt,al as Bt,b1 as Ge,z as Ot,dS as $t}from"./CPYWKVyq.js";import{Ix as A,g as be,nw as x,vM as Ut,Bx as Ye,vO as Lt,CK as Je,cw as Nt,cx as Ht,nx as Qe,nj as Ft,c as ke,fE as Kt,lM as Wt,cE as jt}from"./CicdOSYm.js";import{e as qt,b as ae,F as Vt,y as re,_ as ve,G as zt,C as Gt,W as Xe,v as Yt,u as Jt,M as Qt}from"./hX9Crt6i.js";import{D as Oe,a as Xt,d as Zt}from"./CQcEqK4G.js";import{l as en,o as tn,g as Ze,r as nn,m as an,D as rn}from"./CdqlgErf.js";import{a as et,e as sn}from"./CDFRnJ8k.js";import{f as on}from"./Bv5I7YDM.js";import{bp as b,_ as fe}from"./CGWRZzdk.js";import{a9 as tt,aA as se,J as he,a as nt,n as at,cQ as rt,e as st,aH as it,M as cn,ab as ln,aT as $e,d as le,C as dn,cR as un,U as mn,a6 as pn,aI as fn,bY as hn}from"./CTXbgIPd.js";import{bD as gn,bq as yn,aX as wn,by as bn,bs as kn,ax as vn}from"./KJX0Kw6L.js";import{O as _n,z as Sn}from"./DHP1DFPI.js";import{t as q,q as Mn,v as An}from"./BM1KP-FJ.js";import{x as In,J as Tn,ai as En,ar as Cn}from"./BPk8wgKn.js";import{a as Ue,b as Dn,g as xn}from"./DypB-Dwi.js";import{z as Rn}from"./g9G7tvrf.js";import{C as Pn}from"./BvFAWM27.js";import{i as Bn}from"./Dx9ju3Oy.js";import{o as $,e as On,l as V,s as E,n as ce,b as $n,d as Un,c as Ln}from"./CIyUrgF0.js";function Cr(e,t){if(e)return e.model}function Nn({messages:e,pendingInitialPrompt:t,pendingContextReferenceCount:n=0}){return e.length>0||!!t||n>0}function Dr({session:e,messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a=0}){return!(e?xt(e):!1)&&!Nn({messages:t,pendingInitialPrompt:n,pendingContextReferenceCount:a})}function xr(e){return Rt(e.messageMetadata)}function Hn(e){return{id:e.id,appMessageId:e.appMessageId,role:"user",timestamp:new Date(e.createdAt??0).toISOString(),contentBlocks:[...e.content?[{type:"text",text:e.content}]:[],...e.imageBlocks??[],...e.fileBlocks??[]],metadata:e.messageMetadata,...e.author!==void 0?{author:e.author}:{}}}function Rr(e){return Hn({...e,createdAt:Date.parse(e.queuedAt)})}const Fn=8*1024*1024,Kn=3*1024*1024;function Wn(e){return Math.ceil(Math.max(0,e)/3)*4}function jn(e){const t=e.promptBase64Bytes;return e.mimeType==="image/jpeg"&&Number.isSafeInteger(e.size)&&e.size>0&&e.size<=Kn&&typeof t=="number"&&t===Wn(e.size)?t:null}async function ot(e,t,n,a,r=()=>{}){const s=()=>{if(!a())throw new Error("media-send-retired")};if(s(),r("overlay-render"),!n.exportMedia)throw new Error("media-export-unavailable");const i=en(e.source,e.saved);if(i.length>1e4)throw new Error("media-animation-layer-limit");const o=[];for(const c of i)s(),o.push({...c,png:await tn(e.source,e.saved,c.atMs)});s(),r("export");const l=await n.exportMedia({outputVersion:qt,jobId:t,media:e,layers:o});if(s(),!l.ok)throw new Error(["media-export-failed",l.error].filter(Boolean).join(":"));return{jobId:t,value:l.value}}const _e={CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"};function Le(e,t){return Math.max(0,(e.pausedAt??t)-e.startedAt-(e.pausedMs??0))}function ge(e,t){if(!t?.startsWith(".intent/attachments/"))return;const n=t.split("/").map(encodeURIComponent).join("/"),a=tt(`intent://local/file/${n}`,e);return a?.kind==="video"?a.url:void 0}function qn(e){const t=e.video==="full"?b.dock_captureEditor_videoFull_label():b.dock_captureEditor_videoHighlights_label(),n=e.voice==="audio"?b.dock_captureEditor_voiceAudio_label():e.voice==="transcript"?b.dock_captureEditor_voiceTranscript_label():b.dock_captureEditor_voiceOff_summary();return`${t} · ${n}`}function Vn(e,t,n,a){if(a?.error==="permission")return a.kind==="pick"?"accessibility":"screen";if(e==="permission"||t==="permission")return"screen";if(n?.startsWith("microphone-permission"))return"microphone";if(n?.startsWith("speech-permission"))return"speech"}const j=on;function Pr(e){const{view:t,items:n,local:a,labels:r,copy:s}=e,i=t.speech.error??t.speech.capability?.reason??null,o=Vn(t.captureError,t.clips.find(g=>g.status==="failed"&&g.error==="permission")?.error??null,i,t.annotationIssue),l=t.annotationIssue?.error==="unavailable"?s?.annotationUnavailable:void 0,c=t.annotationIssue,d=t.captureError==="permission",u=c?.error==="permission"&&c.kind!=="pick",h=c?.error==="permission"&&c.kind==="pick",p=i?.startsWith("speech-permission")?"speech":i?.startsWith("microphone-permission")||i==="permission"?"microphone":void 0,m={},y={},f=(g,D,L)=>{m[g]=D,L&&(y[g]=L)};s&&(d&&(f("capture",s.permission,"screen"),t.recording||f("record",s.permission,"screen")),u&&!t.annotating&&f("annotate",s.permission,"screen"),h&&(f("pick",s.accessibilityPermission,"accessibility"),t.tool==="pick"&&!t.annotating&&f("annotate",s.accessibilityPermission,"accessibility")),p&&!t.dictation&&f("mic",(i&&r.speechError?.(i))??s.speechPermission,p));const k=g=>{const D=y[g];D&&e.actions.onOpenSettings(D)},v=new Set(t.evidenceOwnedItemIds),I=t.clips.find(g=>g.status==="recording"),S=t.clips.length>=ae.clips,_=t.capabilities,B=t.speech.available,C=new Set(t.clips.filter(g=>g.status==="recording"||g.status==="placing"||!!g.media).flatMap(g=>g.captureHistory?.map(D=>D.image.id)??[])),P=[...t.tiles.filter(({image:g,marks:D})=>!!g.media||g.source!=="annotate"||!C.has(g.id)||D.some(({mark:L})=>!L.clipId)).map(({image:g,marks:D})=>({kind:"image",id:g.contextItemId,url:a.previews[g.id]??"",markCount:D.length,owner:"evidence",...a.previews[g.id]?{}:{status:"placing"}})),...t.clips.filter(g=>!g.discarding).map(g=>({kind:"clip",id:g.contextItemId??g.id,duration:j(g.status==="recording"?Le(g,a.now):g.durationMs),recording:g.status==="recording",...g.media?.saved?{summary:qn(g.media.saved)}:{},...g.status==="ready"&&ge(e.workspaceId,g.path)?{url:ge(e.workspaceId,g.path)}:{},owner:"evidence",...g.status==="placing"?{status:"placing"}:{},...g.status==="failed"?{status:"failed",...g.error==="limit"?{error:b.dock_composer_clipTooLarge_error()}:{}}:{}})),...n.filter(g=>!v.has(g.id)).map(g=>({...g.imageData&&g.imageMimeType?{kind:"image",id:g.id,url:`data:${g.imageMimeType};base64,${g.imageData}`,markCount:0,file:{name:g.label,imageData:g.imageData,imageMimeType:g.imageMimeType}}:{kind:"file",id:g.id,name:g.label},owner:"attachment",...g.placementStatus==="placing"?{status:"placing"}:{},...g.placementStatus==="failed"?{status:"failed",error:g.placementError}:{}}))];return{mediaStatus:t.recording?{kind:"recording",label:r.recording}:t.dictation?{kind:"listening",label:r.listening}:t.annotating?{kind:"annotating",label:r.annotating}:void 0,...o?{settingsPane:o}:{},...l?{annotationNotice:l}:{},labels:r,attachments:P,...s?{placeholder:t.dictation?"":s.idle}:{},state:{captureRevision:t.captureAccepted,capturePending:t.capturePending,captureDisabled:!_.capture||t.captureDisabled,...t.captureDisabled?{captureTooltip:r.captureLimit}:{},captureMode:t.evidence?.annotation?"fullscreen":t.captureMode,captureModesAvailable:!!_.captureModes&&!t.evidence?.annotation,annotationActive:t.annotating,tool:t.tool,toolUsed:t.toolUsed,annotationDisabled:!_.annotate,recording:t.recording&&!I?.discarding,recordingDisabled:!!I?.discarding||!t.recording&&(!_.record||S),...S&&!t.recording?{recordingTooltip:r.clipLimit}:{},recordingTime:j(I?Le(I,a.now):0),dictating:!!t.dictation,dictationPending:t.speech.pending||t.dictation?.status==="transcribing",dictationDisabled:!B&&!t.dictation&&!m.mic,...t.speech.error&&r.speechError?{dictationTooltip:r.speechError(t.speech.error)}:{},dictationTime:t.dictation?j(a.now-t.dictation.startedAt):j(0),inputLevels:t.speech.levels,...Object.keys(m).length?{alerts:m}:{}},...e.actions,...t.fileAttachmentsEnabled===!1?{onEdit:void 0}:{},onAlert:k,beforeSubmit:e.beforeSubmit}}const Se=()=>globalThis.electronAPI,zn=["image/png","image/jpeg","image/webp"],Ne=e=>zn.includes(e??"")?e:null;function He(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a+=1)n[a]=t.charCodeAt(a);return n}async function Br(e,t){const{view:n,items:a,previews:r}=t,s=n.tiles.find(({image:c})=>c.id===e||c.contextItemId===e);if(s){const c=a.find(p=>p.id===s.image.contextItemId),d=s.image.media;if(s.image.mediaError)return null;if(d?.saved){if(!t.createSavedPreviewUrl||!t.revokeUrl)return null;const p={...d,saved:d.saved},m=await t.createSavedPreviewUrl(t.workspaceId,p);try{const y=await t.fetchBytes(m),f=p.saved.crop;return{kind:"image",name:c?.label||"screenshot.png",mimeType:"image/png",bytes:y,intent:{pixels:{mimeType:"image/png",width:Math.max(1,Math.round(f?.w??p.source.width)),height:Math.max(1,Math.round(f?.h??p.source.height)),displayScale:s.image.displayScale,capturedAt:s.image.capturedAt},raw:y,marks:[]}}}finally{t.revokeUrl(m)}}const u=Ne(c?.imageMimeType),h=r[s.image.id];return!c?.imageData||!u||!h?null:{kind:"image",name:c.label||"screenshot.png",mimeType:"image/png",bytes:await t.fetchBytes(h),intent:{pixels:{mimeType:u,width:s.image.width,height:s.image.height,displayScale:s.image.displayScale,capturedAt:s.image.capturedAt,...s.image.hash?{hash:s.image.hash}:{}},raw:He(c.imageData),marks:s.marks.map(({mark:p})=>({tool:p.tool,geometry:p.geometry,bounds:p.bounds,element:p.element}))}}}const i=n.clips.find(c=>c.id===e||c.contextItemId===e);if(i){const c=i.status==="ready"?ge(t.workspaceId,i.path):null;if(!c)return null;const d=a.find(h=>h.id===i.contextItemId),u=await t.fetchBytes(c);if(!Yn(u))throw new Error("Not a recording file");return{kind:"clip",name:d?.label||`recording-${i.id.slice(0,8)}.mp4`,mimeType:d?.attachmentMimeType||"video/mp4",bytes:u,durationMs:i.durationMs,hasMicAudio:i.hasMicAudio}}const o=a.find(c=>c.id===e),l=Ne(o?.imageMimeType);return o?.imageData&&l?{kind:"image",name:o.label||"image",mimeType:l,bytes:He(o.imageData)}:null}async function Gn(e){const t=await fetch(e);if(!t.ok)throw new Error(`Media request failed (${t.status})`);const n=new Uint8Array(await t.arrayBuffer()),a=Number(t.headers.get("content-length")??Number.NaN);if(n.byteLength===0||Number.isFinite(a)&&a!==n.byteLength)throw new Error("Media response was incomplete");return n}function Yn(e){return e.byteLength>8&&String.fromCharCode(...e.subarray(4,8))==="ftyp"}async function Or(e){try{return(await Se()?.invoke(_e.CLIPBOARD_WRITE,e))?.ok===!0}catch{return!1}}async function Jn(){try{return await Se()?.invoke(_e.CLIPBOARD_READ,{})??null}catch{return null}}async function $r(e){try{const t=await Se()?.invoke(_e.MENU,{canCut:e});return t?.action==="copy"||t?.action==="cut"?t.action:null}catch{return null}}const Fe=new WeakSet;async function Qn(e,t){const[n]=e;if(e.length!==1||!n||n.size!==t.size)return!1;try{const a=await crypto.subtle.digest("SHA-256",await n.arrayBuffer());return Array.from(new Uint8Array(a),s=>s.toString(16).padStart(2,"0")).join("")===t.sha256}catch{return!1}}function Ur(e,{onIntentMedia:t,isCurrent:n,read:a=Jn}){const r=e.clipboardData;if(Fe.has(e)||!r||r.files.length===0)return!1;const s=e.target,i=Array.from(r.files),o=r.types.filter(l=>l!=="Files").map(l=>[l,r.getData(l)]);return e.preventDefault(),e.stopImmediatePropagation(),a().catch(()=>null).then(async l=>{if(!n())return;if(l&&await Qn(i,l)){n()&&t(l);return}if(!n()||!(s instanceof Node)||!s.isConnected)return;const c=new DataTransfer;for(const u of i)c.items.add(u);for(const[u,h]of o)c.setData(u,h);const d=new ClipboardEvent("paste",{clipboardData:c,bubbles:!0,cancelable:!0});Fe.add(d),s.dispatchEvent(d)}),!0}function Xn(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a);return n}function Zn(e){let t="";for(let a=0;a<e.length;a+=32768)t+=String.fromCharCode(...e.subarray(a,a+32768));return btoa(t)}function ct(e){let t=0;return e.endsWith("==")?t=2:e.endsWith("=")&&(t=1),Math.floor(e.length*3/4)-t}async function ea(e){const t=await crypto.subtle.digest("SHA-256",e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}const lt={placeAttachment:it,beginAttachmentUpload:st,sendAttachmentUploadChunk:rt,commitAttachmentUpload:at,abortAttachmentUpload:nt,getAttachmentInfo:he,mintIdempotencyKey:se};async function Me(e,t,n,a=lt){const{idempotencyKey:r}=n,s={...r!==void 0?{idempotencyKey:r}:{},...n.rawScreenshot!==void 0?{rawScreenshot:n.rawScreenshot}:{}},i=async m=>un(m,r)?$e(e,r,a.getAttachmentInfo):void 0;if(ct(n.data)<=cn)try{return await a.placeAttachment(e,t,{data:n.data,mimeType:n.mimeType,...s})}catch(m){const y=await i(m);if(y)return y;throw m}const o=Xn(n.data),l=await ea(o);let c,d;try{({uploadId:c,maxChunkBytes:d}=await a.beginAttachmentUpload(e,t,o.byteLength,l,{mimeType:n.mimeType,...s}))}catch(m){if(r!==void 0&&ln(m)){const y=await $e(e,r,a.getAttachmentInfo);if(y)return y}throw m}const u=Math.min(mn,d),h=Math.ceil(o.byteLength/u);let p=!1;try{for(let m=0;m<h;m++){const y=o.subarray(m*u,(m+1)*u);await a.sendAttachmentUploadChunk(c,m,Zn(y),e)}return p=!0,await a.commitAttachmentUpload(c,e)}catch(m){const y=p?await i(m):void 0;if(y)return y;throw await a.abortAttachmentUpload(c,e).catch(()=>{}),m}}function ta(e,t){return pn(e,`image-${Date.now()}-${t+1}`)}class Ae extends Error{constructor(n,a){super(n);Pe(this,"retryBlocks");this.name="ImagePlacementError",this.retryBlocks=a}}function na(e,t){return e instanceof Ae?e.retryBlocks:t}async function aa(e,t,n=lt,a=()=>!0){const r=l=>(...c)=>(le(a),l(...c));n={placeAttachment:r(n.placeAttachment),beginAttachmentUpload:r(n.beginAttachmentUpload),sendAttachmentUploadChunk:r(n.sendAttachmentUploadChunk),commitAttachmentUpload:r(n.commitAttachmentUpload),abortAttachmentUpload:r(n.abortAttachmentUpload),getAttachmentInfo:r(n.getAttachmentInfo),mintIdempotencyKey:r(n.mintIdempotencyKey)};const s=[],i=[],o=[];for(let l=0;l<t.length;l++){le(a);const c=t[l];if("attachmentId"in c&&c.attachmentId){const p={type:"image",attachmentId:c.attachmentId,...c.mimeType?{mimeType:c.mimeType}:{}};s.push(p),i.push(p);continue}const d=c,u=d.placementFileName??ta(d.mimeType,l),h=n.mintIdempotencyKey(d.placementIdempotencyKey);try{const p=await Me(e,u,{data:d.data,mimeType:d.mimeType,...h!==void 0?{idempotencyKey:h}:{}},n),m={type:"image",attachmentId:p.attachmentId,...p.mimeType??d.mimeType?{mimeType:p.mimeType??d.mimeType}:{}};s.push(m),i.push(m)}catch(p){const m=dn(p);o.push(m?`${u} (${m})`:u),i.push(h!==void 0?{...d,placementIdempotencyKey:h,placementFileName:u}:d)}}if(o.length>0)throw new Ae(b.chat_imagePlacement_failed_error({names:o.join(", ")}),i);return le(a),s}const Lr=Object.freeze(Object.defineProperty({__proto__:null,ImagePlacementError:Ae,base64DecodedBytes:ct,imageRetryBlocks:na,placeImageAttachment:Me,toImageReferenceBlocks:aa},Symbol.toStringTag,{value:"Module"}));function dt(){try{return gn()}catch{return null}}function ra(){return{backendId:A.state.connections.windowBackendId??null,generation:A.state.daemonHealth.connectionGeneration,transport:dt()}}class Ie extends Error{constructor(){super("dock-evidence-backend-changed")}}function N(e,t){return async(...n)=>{e();const a=await t(...n);return e(),a}}const H={current:e=>dt()===e.transport&&A.state.daemonHealth.connectionGeneration===e.generation&&(A.state.connections.windowBackendId??null)===e.backendId,capabilities:()=>yn(),placeImage:(e,t,n,a)=>Me(e,t,n,{placeAttachment:N(a,it),beginAttachmentUpload:N(a,st),sendAttachmentUploadChunk:N(a,rt),commitAttachmentUpload:N(a,at),abortAttachmentUpload:N(a,nt),getAttachmentInfo:N(a,he),mintIdempotencyKey:se}),lookup:(e,t)=>he({workspaceId:e,idempotencyKey:t}),mintKey:se};function G(e){return H.current(e)}function sa(e,t){const n=A.state.dockConversation;return{generation:n.generation,authority:n.authority,clearRevision:x(n.drafts,Vt(e,t))?.clearRevision??0,binding:ra()}}function Nr(e,t,n){const a=sa(e,t);return a.generation===n.generation&&a.authority===n.authority&&a.clearRevision===n.clearRevision&&G(n.binding)}function ut(e,t){return()=>{if(!e.current(t))throw new Ie}}const mt=Object.freeze({rawRetention:!1,chiefAttachments:!1});function Hr(e){return e!==mt}const de=new Map;function pt(e,t=H){const n=`${e.backendId}:${e.generation}`;let a=de.get(n);if(!a){const r=ut(t,e);a=(async()=>{r();const i=await t.capabilities();r();const o=i?.server?.capabilities;if(!o||typeof o!="object")throw new Error("unobserved");return{rawRetention:o.rawScreenshotRetention===1,chiefAttachments:o.chiefAttachments===1}})().catch(()=>(de.delete(n),mt)),de.set(n,a)}return a}class Z extends Error{constructor(t){super(`dock-raw-retention-contract:${t}`),this.reason=t}}function ft(e){const{rpcCode:t,code:n}=e??{};return t===-32602||n==="INVALID_PARAMS"}function ia(e){const t=String(e?.message??"");return ft(e)&&(t.includes("rawScreenshotExpired:")||/expired at .*not renewable/i.test(t))}function oa(e,t,n){const a=e.rawScreenshot;if(!a||a.compositeAttachmentId!==t)return null;const r=Date.parse(a.expiresAt);return Number.isFinite(r)?a.expired||r<=n?"expired":{attachmentId:e.attachmentId,expiresAt:a.expiresAt}:null}function Ke(e){return{ok:!0,path:e.path,fileName:e.fileName,size:e.size,attachmentId:e.attachmentId,...e.mimeType?{mimeType:e.mimeType}:{},uploadedAt:e.uploadedAt,replayed:!0,...e.rawScreenshot?{rawScreenshot:e.rawScreenshot}:{}}}class ca extends Error{constructor(t,n){super("dock-evidence-placement-failed"),this.imageId=t,this.failure=n}}const We=e=>e.split("/")[1]?.replace("jpeg","jpg")||"png";async function la(e){const t=e.api??H,n=e.now??Date.now,a=ut(t,e.binding);a();const r=await pt(e.binding,t);a();const s=r.rawRetention&&(e.workspaceId!==be||r.chiefAttachments),i=[];for(const o of e.images){const l=e.records[o.image.id];let c=l&&l.signature===o.signature&&l.workspaceId===e.workspaceId&&l.backendId===e.binding.backendId?l:{imageId:o.image.id,signature:o.signature,workspaceId:e.workspaceId,backendId:e.binding.backendId,compositeKey:null,rawKey:null,composite:null,raw:null,rawSettled:!1};const d=u=>{c=u,e.onRecord(u)};try{if(!c.composite){const h=c.compositeKey,p=t.mintKey(h??void 0)??null;p!==c.compositeKey&&d({...c,compositeKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a()),m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}.${We(o.composite.mimeType)}`,{data:o.composite.base64,mimeType:o.composite.mimeType,...p?{idempotencyKey:p}:{}},a),a()),d({...c,composite:{attachmentId:m.attachmentId,mimeType:m.mimeType??o.composite.mimeType}})}const u=c.composite.attachmentId;if(s&&o.raw&&!c.raw&&!c.rawSettled){const h=c.rawKey,p=t.mintKey(h??void 0);if(p){p!==c.rawKey&&d({...c,rawKey:p});let m;h&&p===h&&(a(),m=await t.lookup(e.workspaceId,p).then(Ke).catch(()=>{}),a());try{m||(a(),m=await t.placeImage(e.workspaceId,`screenshot-${o.image.id.slice(0,8)}-original.${We(o.raw.mimeType)}`,{data:o.raw.base64,mimeType:o.raw.mimeType,idempotencyKey:p,rawScreenshot:{compositeAttachmentId:u}},a),a());const y=oa(m,u,n());if(y==="expired")d({...c,rawSettled:!0});else if(y)d({...c,raw:y});else throw new Z("echo")}catch(y){if(ia(y))d({...c,rawSettled:!0});else throw y instanceof Z?y:ft(y)?new Z("refused"):y}}else throw new Z("unkeyed")}}catch(u){throw u instanceof Ie?u:new ca(o.image.id,u)}i.push(c)}return i}async function Fr(e,t,n,a){const r=()=>{if(!H.current(a))throw new Ie};r();const s=await H.placeImage(e,t,{...n,idempotencyKey:H.mintKey()},r);return r(),s}const da=new Set(["invalid-saved-edit","media-send-retired","transcript-unavailable","transcript-pending","invalid-edit","stale-source","legacy-baked-marks","timing-unavailable","audio-unavailable","media-source-unavailable","media-export-unavailable","media-animation-layer-limit","media-export-failed","legacy-original-unavailable","capture-render-unavailable","capture-blur-unavailable","stale-source-pixels","not-a-screenshot","not-admitted","unavailable","dock-evidence-missing-pixels","draft-restore-failed","image-budget-exceeded"]),ua=new Set(["unavailable","permission","failed","busy","cancelled","limit"]);class O extends Error{constructor(t,n){super(n),this.stage=t,this.code=n,this.name="DockSendError"}}function ie(e){const t=e instanceof Error?e.message:typeof e=="string"?e:"";if(t.length>64)return"unclassified";const[n,...a]=t.split(":");return!da.has(n)||a.length>2?"unclassified":n!=="media-export-failed"?a.length?"unclassified":n:[n,...a.map(r=>ua.has(r)?r:"other")].join(":")}function Kr(e,t){return e instanceof O?{stage:e.stage,code:ie(e.code)}:{stage:t,code:ie(e)}}function F(e){if(!e||e.source.kind!=="recording")return!1;const t=e.source,n=e.saved??re(t,t.capturedMarks??[],e.transcript);if(n.video!=="full"||n.voice!=="audio"||n.crop||n.blurRegions.length||n.blurStrokes?.length)return!1;const a=ve(n,t,e.transcript);return t.visuals==="clean"?!a.errors.length&&!a.muted&&n.cuts.length===0&&!n.marks.some(r=>r.included)&&a.marks.length===0&&a.transcript===null&&a.kept.length===1&&a.kept[0].startMs===0&&a.kept[0].endMs===t.durationMs&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs===t.durationMs:!a.errors.length&&!a.muted&&a.clips.length===1&&a.clips[0].startMs===0&&a.clips[0].endMs>=t.durationMs}async function ma(e,t,n,a,r,s){const i={images:{},files:[],frames:[],framePromptBytes:[],metadata:[]};let o="validate";try{const l=()=>{if(!r()||!G(n))throw new Error("media-send-retired")};for(const c of[...t.images,...t.clips]){if(o="validate",s?.stage(o),c.mediaError)throw new Error("invalid-saved-edit");if(!c.media||F(c.media))continue;l();const d=structuredClone(c.media),u=d.source;let h=d.saved??re(u,u.capturedMarks??[],d.transcript),p=crypto.randomUUID();try{if(u.kind==="recording"&&h.voice==="transcript"&&d.transcript?.status!=="ready"){if(o="transcribe",s?.stage(o),!a?.transcribeMedia)throw new Error("transcript-unavailable");const f=await a.transcribeMedia({jobId:p,media:d});if(l(),!f.ok)throw new Error("transcript-unavailable");d.transcript=f.value,d.saved||(h=re(u,u.capturedMarks??[],d.transcript))}o="plan",s?.stage(o);const m=ve(h,u,d.transcript);if(m.errors.length)throw new Error(m.errors[0]);const y={id:c.id,kind:u.kind,video:h.video,voice:h.voice,transcript:m.transcript,batches:u.batches,marks:m.marks.map(({n:f,mark:k,frameAtMs:v})=>({n:f,id:k.id,at_ms:v,kind:k.kind,label:k.label,note:k.note,context:k.context,geometry:k.geometry}))};if(u.kind==="screenshot"){o="screenshot-source",s?.stage(o);const f=u.path.split("/").map(encodeURIComponent).join("/"),k=tt(`intent://local/file/${f}`,e);if(!k||k.kind!=="image")throw new Error("media-source-unavailable");const v=await Gn(k.url);l();const I={base64:Ze(v.buffer.slice(v.byteOffset,v.byteOffset+v.byteLength)),mimeType:/\.jpe?g$/i.test(u.path)?"image/jpeg":/\.webp$/i.test(u.path)?"image/webp":"image/png"};o="screenshot-render",s?.stage(o),i.images[c.id]=await nn(u,h,I),l()}else{if(!m.clips.length){y.video_attachment_id=null,y.frames=[],y.kept_ms=[],i.metadata.push(y);continue}const f={...d,saved:h};let k=await a?.takePreparedRecording?.(f);if(k&&(p=k.jobId),l(),!k){if(!a)throw new Error("media-export-unavailable");k=await ot(f,p,a,()=>r()&&G(n),S=>{o=S,s?.stage(S),S==="export"&&s?.exportAttempt(p)})}p=k.jobId,o="placement",s?.stage(o);const v=[k.value.video,...k.value.frames],I=[];for(let S=0;S<v.length;S++){l();const _=v[S],B=`capture-${c.id.slice(0,12)}-${S}.${S===0?"mp4":_.mimeType==="image/jpeg"?"jpg":"png"}`,C=await fn(e,B,{sourcePath:_.sourcePath,mimeType:_.mimeType,idempotencyKey:se()},void 0,void 0,()=>r()&&G(n));l(),S===0?i.files.push({type:"file",attachmentId:C.attachmentId,fileName:B,mimeType:C.mimeType??_.mimeType,size:C.size}):(i.frames.push({type:"image",attachmentId:C.attachmentId,mimeType:_.mimeType==="image/jpeg"?"image/jpeg":"image/png"}),i.framePromptBytes.push(jn(_))),I.push(C.attachmentId)}y.video_attachment_id=I[0],y.frames=k.value.frames.map((S,_)=>({mark_id:S.markId,attachment_id:I[_+1]})),y.kept_ms=m.clips}i.metadata.push(y)}finally{s?.stage("release"),await a?.releaseMediaJob?.(p).catch(()=>{})}}return i}catch(l){throw l instanceof O?l:new O(o,ie(l))}}const ue=1568,pa=.85;async function fa(e,t){const n=Math.round(e.length*3/4/1024),a=await ha(e,t),{width:r,height:s}=a,i=r>ue||s>ue;let o=r,l=s;if(i){const f=ue/Math.max(r,s);o=Math.round(r*f),l=Math.round(s*f)}const c=new OffscreenCanvas(o,l),d=c.getContext("2d");if(!d)throw new Error("Failed to get 2D canvas context for image resize");d.drawImage(a,0,0,o,l);let u=t;ga(d,o,l)||(u="image/jpeg");const h=await c.convertToBlob({type:u,quality:u==="image/jpeg"?pa:void 0}),p=h.type||u,m=await ya(h),y=Math.round(m.length*3/4/1024);return console.debug(`[image-resize] ${r}×${s} → ${o}×${l} | ${t} → ${p} | ${n} KB → ${y} KB`),{base64:m,mimeType:p}}async function ha(e,t){const n=atob(e),a=new Uint8Array(n.length);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);const r=new Blob([a],{type:t});return createImageBitmap(r)}function ga(e,t,n){const r=e.getImageData(0,0,t,n).data;for(let s=3;s<r.length;s+=4)if(r[s]<255)return!0;return!1}async function ya(e){const t=await e.arrayBuffer(),n=new Uint8Array(t);let a="";for(let r=0;r<n.length;r++)a+=String.fromCharCode(n[r]);return btoa(a)}const T={...Oe,badge:Oe.badgeRadius*2};function wa(e,t,n=1,a=0){const r=Math.max(1,e.displayScale)*n,s=[],i=o=>o*n;for(const{n:o,mark:l}of t){const c=l.geometry;if(c.kind==="rect")s.push({kind:"rect",x:i(c.x),y:i(c.y),w:i(c.w),h:i(c.h),width:T.stroke*r});else if(c.kind==="path")s.push({kind:"path",points:c.points.map(m=>({x:i(m.x),y:i(m.y)})),width:T.pen*r});else{const m={x:i(c.from.x),y:i(c.from.y)},y={x:i(c.to.x),y:i(c.to.y)};s.push({kind:"arrow",from:m,to:y,head:Sa(m,y,T.arrowHead*r),width:T.stroke*r})}if(!T.showNumbers)continue;const d=Math.max(a,T.badge/2*r),u=i(l.bounds.x+l.bounds.w),h=i(l.bounds.y),p=Zt({x:i(l.bounds.x),y:h,w:u-i(l.bounds.x),h:i(l.bounds.h)},{x:0,y:0,w:i(e.width),h:i(e.height)},r,d);s.push({kind:"badge",...p,radius:d,label:String(o),font:d*T.badgeTextScale})}return s}function ba(e,t){"letterSpacing"in e&&(e.letterSpacing="0px"),"wordSpacing"in e&&(e.wordSpacing="0px");const n=(a,r,s)=>{e.strokeStyle=T.halo,e.lineWidth=a+T.haloWidth*r,s(),e.strokeStyle=T.accent,e.lineWidth=a,s()};e.strokeStyle=T.accent,e.lineCap="round",e.lineJoin="round";for(const a of t)if(a.kind==="rect")n(a.width,a.width/T.stroke,()=>e.strokeRect(a.x,a.y,a.w,a.h));else if(a.kind==="path"||a.kind==="arrow"){e.lineWidth=a.width,e.beginPath();const r=a.kind==="path"?a.points:[a.from,a.to];a.kind==="arrow"&&r.forEach((i,o)=>o?e.lineTo(i.x,i.y):e.moveTo(i.x,i.y)),a.kind==="arrow"&&(e.moveTo(a.head.left.x,a.head.left.y),e.lineTo(a.to.x,a.to.y),e.lineTo(a.head.right.x,a.head.right.y));const s=a.kind==="path"?new Path2D(Xt(a.points)):null;n(a.width,a.width/(a.kind==="path"?T.pen:T.stroke),()=>s?e.stroke(s):e.stroke())}else e.fillStyle=T.paper,e.beginPath(),e.arc(a.x,a.y,a.radius,0,Math.PI*2),e.closePath(),e.fill(),e.strokeStyle=T.accent,e.lineWidth=T.badgeOutline*a.radius/T.badgeRadius,e.stroke(),e.fillStyle=T.ink,e.font=`600 ${a.font}px ${T.badgeFontFamily}`,e.textAlign="center",e.textBaseline="middle",e.fillText(a.label,a.x,a.y)}async function ka(e,t){const n=Uint8Array.from(atob(e),a=>a.charCodeAt(0));return createImageBitmap(new Blob([n],{type:t}))}async function va(e){const t=await e.convertToBlob({type:"image/png"});return Ze(await t.arrayBuffer())}async function ht(e,t,n,a,r=0){await an();const s=await ka(e.base64,e.mimeType);try{const i=Math.min(1,a/Math.max(t.width,t.height)),o=new OffscreenCanvas(Math.max(1,Math.round(t.width*i)),Math.max(1,Math.round(t.height*i))),l=o.getContext("2d");if(!l)throw new Error("dock-evidence-canvas-unavailable");return l.drawImage(s,0,0,o.width,o.height),ba(l,wa(t,n,i,r)),o}finally{s.close()}}async function _a(e,t,n){const a=await ht(e,t,n,Math.max(t.width,t.height));return fa(await va(a),"image/png")}async function Wr(e,t,n,a=384){const r=await ht(e,t,n,a,a/32);return URL.createObjectURL(await r.convertToBlob({type:"image/png"}))}function Sa(e,t,n=T.arrowHead){const a=Math.atan2(t.y-e.y,t.x-e.x),r=T.arrowSpread;return{left:{x:t.x-n*Math.cos(a-r),y:t.y-n*Math.sin(a-r)},right:{x:t.x-n*Math.cos(a+r),y:t.y-n*Math.sin(a+r)}}}function jr(e,t){const n=zt(t??void 0),a=new Set(t?.clips.filter(r=>!!r.media&&!F(r.media)).map(r=>r.contextItemId));return e.filter(r=>!n.has(r.id)&&!a.has(r.id))}async function qr({workspaceId:e,agentId:t,evidence:n,clickedItems:a,sendItems:r,clickedPayload:s,binding:i,service:o,current:l,onRecord:c,timing:d}){const u=()=>{if(!l()||!G(i))throw new O("validate","media-send-retired")};if(u(),n?.images.some(w=>w.mediaError)||n?.clips.some(w=>w.mediaError))throw new O("validate","invalid-saved-edit");const h=w=>!!w.media&&!F(w.media),p=n?{workspaceId:e,agentId:t,appUrl:`intent://local/workspace/${encodeURIComponent(e)}`,clipAttachmentIds:Object.fromEntries(n.clips.map(w=>[w.id,a.find(M=>M.id===w.contextItemId)?.attachmentId??null]))}:null;for(const w of n?.clips??[]){if(!w.media||!F(w.media))continue;const M=a.find(Q=>Q.id===w.contextItemId);if(!M||M.attachmentId!==w.media.source.attachmentId||M.path!==w.media.source.path||M.placementStatus!==void 0&&M.placementStatus!=="placed")throw new O("validate","legacy-original-unavailable")}const m=n?await ma(e,n,i,o,l,d):{images:{},files:[],frames:[],framePromptBytes:[],metadata:[]},y=new Set(n?.clips.filter(w=>h(w)||!!w.media&&F(w.media)).map(w=>w.id)),f=new Set(n?.clips.filter(w=>y.has(w.id)).flatMap(w=>(w.captureHistory??[]).map(M=>M.image.id))),k=(n?.images??[]).filter(w=>w.source!=="annotate"||!!w.media||!f.has(w.id)||n.marks.some(M=>M.imageId===w.id&&!(M.clipId&&y.has(M.clipId))));d?.stage("burn");let v=[];try{v=n?await Ma({...n,images:k},a,m.images):[]}catch(w){throw new O("burn",ie(w))}if(m.framePromptBytes.reduce((w,M)=>w+(M??0),0)>Fn)throw new O("validate","image-budget-exceeded");const S=new Set(n?.images.filter(w=>w.media).map(w=>w.id)),_=n?{...n,images:k.map(w=>m.images[w.id]?{...w,width:m.images[w.id].width,height:m.images[w.id].height}:w),clips:n.clips.filter(w=>!h(w)),marks:n.marks.filter(w=>!S.has(w.imageId)&&!n.clips.some(M=>h(M)&&M.id===w.clipId))}:null;u();const B=m.metadata.some(w=>typeof w.transcript=="string"&&w.transcript.trim());if(!s.text.trim()&&!r.length&&!s.workspaceContextStr?.trim()&&!v.length&&!m.files.length&&!m.frames.length&&!s.imageBlocks?.length&&!s.fileBlocks?.length&&!B)return null;let C=v,P=null;d?.stage("placement");const Re=n?await pt(i):null;if(u(),n&&(e!==be||Re?.chiefAttachments)){const w=await la({workspaceId:e,binding:i,images:k.map((M,Q)=>{const X=a.find(Et=>Et.id===M.contextItemId);return{image:M,signature:Gt(n,M.id),composite:{base64:v[Q].data,mimeType:v[Q].mimeType},raw:!M.media&&X?.imageData&&X.imageMimeType?{base64:X.imageData,mimeType:X.imageMimeType}:null}}),records:n?.placements??{},onRecord:c});u(),C=w.map(M=>({type:"image",attachmentId:M.composite.attachmentId,mimeType:M.composite.mimeType})),P=Object.fromEntries(w.map(M=>[M.imageId,{attachmentId:M.composite.attachmentId,raw:M.raw}]))}const g=new Map(n?Xe(n).map(({n:w,mark:M})=>[M.id,w]):[]),D=p&&P?{...p,imageAttachments:P,markNumbers:g}:p&&{...p,markNumbers:g},L=n&&D?{...s,imageBlocks:[...C,...m.frames,...s.imageBlocks??[]],fileBlocks:[...s.fileBlocks??[],...m.files],workspaceContextStr:[Jt(_,D),m.metadata.length?`[Edited capture outputs]
|
|
3
3
|
${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
|
|
4
4
|
|
|
5
5
|
`),messageMetadata:{...s.messageMetadata,...Yt(_,D),edited_captures:m.metadata}}:s;return u(),L}async function Ma(e,t,n={}){const a=Xe(e);return Promise.all(e.images.map(async r=>{if(n[r.id])return{type:"image",...n[r.id]};const s=t.find(o=>o.id===r.contextItemId);if(!s?.imageData||!s.imageMimeType)throw new Error("dock-evidence-missing-pixels");const i=await _a({base64:s.imageData,mimeType:s.imageMimeType},r,a.filter(({mark:o})=>o.imageId===r.id));return{type:"image",data:i.base64,mimeType:i.mimeType}}))}const Aa="intent.dock.captureEditorPreview";function Vr(){try{return et()&&localStorage.getItem(Aa)==="1"}catch{return!1}}function zr(e){const{clip:t}=e;if(t.status!=="ready"||!t.path)return null;const n=e.marks.filter(s=>s.clipId===t.id&&typeof s.clipMs=="number").sort((s,i)=>s.clipMs-i.clipMs).map(s=>({id:s.id,tool:s.tool,atMs:s.clipMs,...s.element?.name?{label:s.element.name.slice(0,200)}:{}})),a=Qt(e.evidence??void 0,t.id),r=a?t.media:void 0;return{kind:"recording",workspaceId:e.workspaceId,agentId:e.agentId,attachmentId:a?.attachmentId??t.id,sourceRevision:a?`${a.id}:${a.revision}`:t.path,attachmentPath:t.path,title:"",durationMs:t.durationMs,marks:n,provenance:a?{...a.audio==="unknown"?{}:{hasMicAudio:a.audio==="available"},visuals:a.visuals}:{hasMicAudio:t.hasMicAudio,visuals:n.length>0?"baked-marks":"clean"},...a&&r?{source:a,saved:r.saved??null,transcript:r.transcript??null}:{}}}async function Gr(e){if(!et())return{ok:!1,error:"unavailable"};try{return await sn().invoke(rn.OPEN,e)??{ok:!1,error:"unavailable"}}catch{return{ok:!1,error:"transport"}}}function Yr(e){let t=null,n=null;const a=o=>e.releaseMediaJob?.(o).catch(()=>{});function r(){const o=t;t=null,!(!o||o.taken||o.stopped)&&(o.stopped=!0,clearTimeout(o.timer),a(o.id))}function s(o,l,c){if(t?.key===o||n===o||(r(),n=null,!e.adoptMediaJob||!e.exportMedia||!c()||F(l)))return;const d=structuredClone(l),u=d.saved??re(d.source,d.source.capturedMarks??[],d.transcript),h=ve(u,d.source,d.transcript);if(d.source.kind!=="recording"||d.source.visuals!=="clean"||h.errors.length||!h.clips.length||u.voice==="transcript"&&d.transcript?.status!=="ready")return;const p={...d,saved:u},m=crypto.randomUUID(),y={key:o,mediaKey:JSON.stringify(p),id:m,current:c,taken:!1,stopped:!1,settled:!1,failed:!1,timer:setTimeout(()=>{t===y&&(n=o,r())},3e4),result:Promise.resolve({error:new Error("not-started")})};t=y,y.result=ot(p,m,e,()=>!y.stopped&&y.current()).then(async f=>y.stopped||!y.current()?(await a(m),{error:new Error("media-send-retired")}):{value:f},async f=>(y.failed=!0,t===y&&(n=o),await a(m),{error:f})).finally(()=>{y.settled=!0})}async function i(o,l,c){const d=t;if(!d||d.key!==o||d.mediaKey!==JSON.stringify(l)||d.stopped||d.taken||!c())return null;if(d.failed&&d.settled)return r(),null;d.taken=!0,d.current=c,clearTimeout(d.timer),t=null;const u=await d.result;if("error"in u)throw u.error;try{if(!c())throw new Error("media-send-retired");const h=await e.adoptMediaJob?.(d.id);if(!c())throw new Error("media-send-retired");return!h?.ok||!h.value?(await a(d.id),null):u.value}catch(h){throw await a(d.id),h}}return{warm:s,take:i,cancel:r}}function Jr(e={}){const t=a=>_n(a,typeof e=="function"?e():e),n=a=>wn(t(a));return{actionHints:{get capture(){return{label:b.dock_composer_screenshotAction_label(),shortcut:t("dock.capture")}},get record(){return{label:b.ui_shortcuts_dockRecord_label(),shortcut:t("dock.record")}},get dictate(){return{label:b.dock_shortcut_dictate_label()}}},get capture(){return b.dock_composer_capture_tooltip({shortcut:n("dock.capture")})},captureMode:{get window(){return b.dock_composer_captureWindow_tooltip({shortcut:n("dock.capture")})},get region(){return b.dock_composer_captureRegion_tooltip({shortcut:n("dock.capture")})}},captureModes:{fullscreen:b.dock_composer_captureFullscreen_label(),window:b.dock_composer_captureWindow_label(),region:b.dock_composer_captureRegion_label()},captureOptions:b.dock_composer_captureModes_ariaLabel(),captureLimit:b.dock_composer_captureLimit_tooltip(),clipLimit:b.dock_composer_clipLimit_tooltip({limit:q(ae.clips)}),get record(){return b.dock_composer_record_tooltip({shortcut:n("dock.record")})},stopRecording:b.dock_composer_stopRecording_tooltip(),annotationTools:b.annotation_toolbar_ariaLabel(),annotateCurrent:a=>b.dock_composer_annotate_ariaLabel({tool:a}),tools:{pick:b.dock_composer_pick_label(),box:b.dock_composer_box_label(),pen:b.dock_composer_pen_label(),arrow:b.annotation_arrow_label()},get dictate(){return b.dock_shortcut_dictate_label()},stopDictating:b.dock_composer_stopDictating_tooltip(),annotating:b.dock_composer_annotating_status(),listening:b.dock_composer_listening_status(),recording:b.dock_composer_recording_status(),markUp:b.dock_composer_markUp_label(),remove:b.chat_contextChip_remove_label(),play:b.dock_composer_play_label(),edit:b.dock_composer_edit_label(),done:b.dock_composer_done_label(),attachments:b.context_attachments_title_label(),retry:b.chat_shared_retry_label(),attachmentPending:b.dock_composer_attachmentPending_status(),attachmentFailed:b.dock_composer_attachmentFailed_error(),image:a=>b.dock_composer_image_ariaLabel({n:q(a)}),clip:a=>b.dock_composer_clip_ariaLabel({duration:a}),recordingReference:(a,r)=>r?b.dock_composer_recordingEnd_chip({n:q(a)}):b.dock_composer_recordingStart_chip({n:q(a)}),speechError:a=>a.includes("permission")?b.dock_composer_speechPermission_error():["unsupported-platform","helper-missing","recognizer-unavailable","locale-unsupported","assets-unavailable","unavailable"].includes(a)?b.dock_composer_speechUnavailable_error():b.dock_composer_speechFailed_error()}}function Qr(e,t){return{enabled:e,limit:ae.files,excludedIds:t,unavailableMessage:b.dock_composer_filesUnavailable_error(),limitMessage:b.dock_composer_fileLimit_error({limit:q(ae.files)})}}function Ia(e){try{return new URL(e.pageUrl).hostname||e.pageUrl}catch{return e.pageUrl}}function Xr(e,t){return e.targetAgentId===t}function Zr(e){const t=e.element,n=e.viewport,a=Ia(e),r=t?`<${t.tagName.toLowerCase()}> · ${a}`:e.title||a,s=["<browser-element-capture>",`Page URL: ${e.pageUrl}`,`Page title: ${e.title}`,...t?[`DOM path: ${t.domPath}`,`CSS selector: ${t.selector}`,`Text snippet: ${t.textSnippet}`,...t.sourceRef?[`Source ref: ${t.sourceRef}`]:[],...n?[`Viewport: ${n.width}×${n.height}`]:[],`Element bounds: ${t.rect.width}×${t.rect.height} at (${t.rect.x}, ${t.rect.y})`]:[],"</browser-element-capture>"].join(`
|
|
@@ -8,4 +8,4 @@ ${JSON.stringify(m.metadata)}`:"",s.workspaceContextStr].filter(Boolean).join(`
|
|
|
8
8
|
\`\`\`
|
|
9
9
|
${i}
|
|
10
10
|
\`\`\`]`)}return Ta(a.join(`
|
|
11
|
-
`),e)}function es(e,t,n){if(e==="suggested-prompt")return{fields:{},hasAttachments:!1,cleanup:{clearInput:!1,followBottom:!0,historyText:null}};const a=n(),{imageBlocks:r,fileBlocks:s}=Ea(a.contextItems);return{fields:{contextItems:a.contextItems,workspaceContextStr:Ca(a.contextItems,a.checkedPanels,a.checkedSelections),noteIds:a.noteIds,...r.length>0?{imageBlocks:r}:{},...s.length>0?{fileBlocks:s}:{},...a.pickedMentions?{messageMetadata:a.pickedMentions}:{}},hasAttachments:r.length>0||s.length>0,cleanup:{clearInput:!0,followBottom:!0,historyText:t}}}const Da="chat-read:",K=new Map,ye=new Set;function ts(e,t){let n=K.get(e);n||(n=new Set,K.set(e,n)),n.add(t)}function ns(e,t){const n=K.get(e);if(!(!n||!n.delete(t))&&n.size===0){K.delete(e);for(const a of[...ye])a(e)}}function as(e){return ye.add(e),()=>ye.delete(e)}function rs(e){return K.has(e)}function ss(e){const t=K.get(e);if(!t)return!1;for(const n of t)if(!n.startsWith(Da))return!0;return!1}function xa(e,t,n){const a=e.state.pendingSubmissions.byAgentId[t.agentId];if(!a||!Ye(a.scope,t))return null;const r={...structuredClone(n),id:crypto.randomUUID(),createdAt:Date.now()};e.dispatch(Lt(t,r));const s=e.state.pendingSubmissions.byAgentId[t.agentId];return s&&x(s.submissions,r.id)?r:null}function Ra(e,t,n,a,r){const s=Be.select(e.state,n),i=pe.select(e.state)?.principal.id,o=Ue(e.state);if(!s||!i||!o)return null;const l=In(t,n),c={agentId:t,workspaceId:n,principalId:i,participation:s,authority:o,owner:l.key,lifetime:e.state.pendingSubmissions.byAgentId[t]?.scope.lifetime??crypto.randomUUID()},d=()=>l.isCurrent(e.state.agentSessions?.byAgentId[t]?.workspaceId)&&Be.select(e.state,n)===s&&pe.select(e.state)?.principal.id===i&&Ue(e.state)===o;if(!d())return null;e.dispatch(Ut(c,a,Pt.select(e.state,n)));const u=xa(e,c,r);return u?{scope:c,submission:u,isCurrent:()=>{const h=e.state.pendingSubmissions.byAgentId[t];return d()&&!!h&&Ye(h.scope,c)&&(!!x(h.operations,u.id)||!!x(h.submissions,u.id))}}:null}function we(e,t,n){if(!n.text.trim()&&!n.imageBlocks?.length&&!n.fileBlocks?.length)return null;const a=n.userAppMessageId??Tn();return Ra(e,t,n.wsId,pe.select(e.state)?.capabilities.submissionCorrelation,{content:n.text.trim(),appMessageId:a,destination:!n.forceSubmit&&Bt.select(e.state,t)?"queue":"conversation",contextItems:n.contextItems,imageBlocks:n.imageBlocks,fileBlocks:n.fileBlocks,messageMetadata:n.messageMetadata})}function Pa(e,t,n){const a=we(e,t,n);return a?(e.dispatch(Je(t,{...n,userAppMessageId:a.submission.appMessageId,submission:{scope:a.scope,id:a.submission.id}})),!0):!1}async function Ba(e,t,n,a){const r=n.submission;if(!r)return"legacy";const s=r.reference,i=()=>s.scope.agentId===e&&s.scope.workspaceId===t&&Ge.select(A.state,e)===n?hn.select(A.state,s.scope):void 0,o=i();if(!o)return null;if(!o.supported)return"legacy";const l={wsId:t,text:n.text,imageBlocks:n.options?.imageBlocks,fileBlocks:n.options?.fileBlocks,noteIds:n.options?.noteIds,messageMetadata:n.options?.messageMetadata,model:a??n.options?.model};if(r.outcome==="rejected"){const p=x(o.tombstones,s.id);return x(o.submissions,s.id)||p&&p.reason!=="rejected"?null:we(A,e,l)}if(r.outcome==="accepted")return we(A,e,l);await Promise.all([En(e,t).catch(()=>{}),Cn(e,t).catch(()=>{})]);const c=i();if(!c||x(c.submissions,s.id)?.status!=="uncertain")return null;const{notify:d}=await fe(async()=>{const{notify:p}=await import("./DYLHdssA.js").then(m=>m.C);return{notify:p}},__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]),import.meta.url);if(i()!==c)return null;let u=!1;const h=()=>{u=!0};return d.warning(b.agent_chatSend_uncertainRetry_description(),{key:`submission-retry:${t}:${e}:${s.id}`,duration:Number.POSITIVE_INFINITY,action:{label:b.agent_chatSend_resend_label(),onClick:()=>{if(u)return;u=!0;const p=i();!p||p.generation!==c.generation||p.submissions!==c.submissions||p.observationVersion!==c.observationVersion||x(p.submissions,s.id)?.status!=="uncertain"||Pa(A,e,l)}},cancel:{label:b.chat_richInput_cancel_label(),onClick:h},onDismiss:h}),null}async function is(e,t,n){const a=Ge.select(A.state,e),r=a?.submission?await Ba(e,t,a,n):"legacy";if(r){if(r==="legacy"){await A.dispatch(n===void 0?Nt(e,t):Ht(e,t,n));return}!r.isCurrent()||!a||A.dispatch(Je(e,{wsId:t,text:a.text,imageBlocks:a.options?.imageBlocks,fileBlocks:a.options?.fileBlocks,noteIds:a.options?.noteIds,messageMetadata:a.options?.messageMetadata,model:n??a.options?.model,userAppMessageId:r.submission.appMessageId,submission:{scope:r.scope,id:r.submission.id}}))}}const os=A.createSelector((e,t)=>{const n=x(e.chatDrafts.owners,t);return n?{restore:n.restore,saves:Qe(n.saves),shared:n.restore?e.chatDrafts.shared[JSON.stringify([n.restore.workspaceId,n.restore.agentId])]:void 0}:void 0});function Oa(e,t){return t.workspaceId===e&&!t.retiredAt&&!t.pendingDeleteAt&&t.status!==ke.Deleted&&!t.notificationsMuted&&Kt(t)==="topLevel"}function $a(e){const t=e.metadata?.pendingQuestionsMessageId;return typeof t=="string"&&t.length>0&&!Rn(e.metadata,t)?t:null}function Ua(e){return e.status===ke.Error&&!Ot($t(e))}function cs(e,t){return t.filter(n=>Oa(e,n)).flatMap(n=>{const a=Ft(n),r=$a(n),s=n.status===ke.Error;if(!a&&!r&&!s)return[];const i=a?.timestamp??(s?n.stopReasonTimestamp:void 0);return[{agentId:n.id,agentName:n.name,kind:a?.kind??(s?"failed":"question"),reason:a?.reason,timestamp:i&&Number.isFinite(Date.parse(i))?i:void 0,questionMessageId:r,canRetry:Ua(n)}]})}function ls(e){return e.displayStatus==="failed"?"failed":e.displayStatus==="blocked"?"blocked":e.attention==="review_required"?"review":e.displayStatus==="needs_attention"?"question":e.activity==="agent_running"||e.displayStatus==="in_progress"?"running":e.scriptsRunning===!0?"scripts_running":e.backgroundTasksRunning===!0?"background_tasks_running":e.displayStatus==="pr_ready"?"pr_ready":e.displayStatus==="pr_merged"?"merged":e.displayStatus==="complete"?"complete":e.attention==="unread"?"unread":e.displayStatus==="pr_open"||e.displayStatus==="pr_queued"?e.displayStatus:"idle"}function ds(e){const t=e.kind==="prs"?e.organization?.trim().toLowerCase():void 0;return{key:JSON.stringify([e.kind,e.workspaceId,t||null,[...new Set((t?[]:e.repositories).map(n=>JSON.stringify([n.key,n.owner,n.name])))].sort()]),hasGitHubRepositories:!!t||e.repositories.some(n=>!!n.owner),hasLocalRepositories:!t&&e.repositories.some(n=>!n.owner)}}function Te(e){const t=bn(e);if(t?.kind!=="pr"||!Number.isSafeInteger(t.number)||t.number<=0)return null;const n=t.owner.toLowerCase(),a=t.repo.toLowerCase();return{owner:n,repo:a,number:t.number,id:`${n}/${a}#${t.number}`,url:`https://github.com/${n}/${a}/pull/${t.number}`}}function us(e,t,n,a){const r=e.filter(s=>a?a.includes(s.id):n?s.repositoryOwner?.toLowerCase()===n.toLowerCase():t.some(i=>i.owner?.toLowerCase()===s.repositoryOwner?.toLowerCase()&&i.name.toLowerCase()===s.repositoryName?.toLowerCase()));return[...new Map(r.flatMap(s=>[...(s.pullRequests??[]).map(i=>i.url),s.activePullRequest?.url,s.prUrl]).flatMap(s=>{const i=s?Te(s):null;return i?[[i.id,{owner:i.owner,repo:i.repo,number:i.number}]]:[]})).values()].sort((s,i)=>`${s.owner}/${s.repo}#${s.number}`.localeCompare(`${i.owner}/${i.repo}#${i.number}`))}function ms(e,t){const[n]=t;return t.length!==1||e.owner?.toLowerCase()!==n?.owner?.toLowerCase()||e.repo?.toLowerCase()!==n?.name.toLowerCase()}const ps=A.createSelector(e=>e.homeIntegrations),fs=A.createSelector(e=>{const t=e.homeIntegrations;return!t.linkedItems||!Object.keys(t.linkedItems).length?t:{...t,items:[...new Map([...Object.values(t.linkedItems),...t.items].map(n=>[n.id,n])).values()].sort((n,a)=>(a.updatedAt??"").localeCompare(n.updatedAt??""))}}),gt=A.createSelector(e=>Qe(e.workspace.workspaces).flatMap(t=>[...(t.pullRequests??[]).map(n=>n.url),t.activePullRequest?.url,t.prUrl].filter(n=>!!n).map(n=>({url:Te(n)?.url??n.replace(/\/$/,"").toLowerCase(),workspaceId:t.id,name:t.title||t.id})))),hs=A.createSelector(e=>{const t=e.homeIntegrations.detail?.url,n=t?Te(t)?.url??t.replace(/\/$/,"").toLowerCase():void 0;return gt.select(e).find(a=>a.url===n)??null}),gs=A.createSelector(e=>gt.select(e).map(t=>t.url));let ee=null;function ys(e){return ee=e,()=>{ee===e&&(ee=null)}}function ws(){return ee}function bs(e){return[...e.groups.length>0?e.groups.filter(n=>n.expanded).flatMap(n=>n.items):e.workspaces,...e.asideExpanded?e.aside:[]].map(n=>n.id)}function ks(e,t,n){if(e.length===0)return null;const a=t===null?-1:e.indexOf(t);return a===-1?e[0]:e[a+(n==="clockwise"?1:-1)]??null}let te=null;function vs(e){return te=e,()=>{te===e&&(te=null)}}function _s(){return te}function Ss(e){return An(e)}function La(e){return Mn(e)}function Na(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function me(e){if(e.length===0)return[];const t=[];let n=null;for(const a of e){const r=a.timestamp?typeof a.timestamp=="string"?new Date(a.timestamp):a.timestamp:new Date;(!n||!Na(n.date,r))&&(n={date:r,label:La(r),messages:[]},t.push(n)),n.messages.push(a)}return t}function Ms(e){const t=new Map;return e.map(({date:n})=>{const a=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`,r=t.get(a)??0;return t.set(a,r+1),r===0?a:`${a}#${r}`})}function As(e,t){const n=new Map;let a=t?null:void 0;for(const r of e.groups)for(const s of r.messages)a!==void 0&&n.set(s.id,a),s.role==="user"&&!Bn(s)&&(a=s);return n}function Ha(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function je(e,t){const n=new Map;return e.map(a=>{const r=`${t}-${Ha(a.date)}`,s=(n.get(r)??0)+1;return n.set(r,s),{...a,groupKey:s===1?r:`${r}-${s}`}})}function Fa(e,t){if(e.length===0||t.length===0)return e;const n=new Set(t.map(s=>s.id)),a=new Set(t.map(s=>s.appMessageId).filter(s=>typeof s=="string"&&s.length>0)),r=e.filter(s=>!n.has(s.id)&&!(typeof s.appMessageId=="string"&&s.appMessageId.length>0&&a.has(s.appMessageId)));return r.length===e.length?e:r}function Is(e,t,n){return e=Fa(e,t),e.length===0?{groups:me(t),detached:!1,hiddenTail:[]}:n?{groups:je(me(e),"h"),detached:!0,hiddenTail:t}:{groups:je(me([...e,...t]),"d"),detached:!1,hiddenTail:[]}}function Ts(e){const{scrollTop:t,threshold:n,fetching:a,exhausted:r,historyCount:s,tailCount:i,tailTruncated:o,totalMessages:l,spacerAbove:c=0}=e;return t>n+c||a||r?!1:s>0||o||l>i+s}const Es=300;function Cs(e){const{fetching:t,chainEvaluationPending:n,visible:a,hideArmed:r}=e;return t||n?a&&!r?"none":"show":a&&!r?"arm-hide":"none"}const qe=24,Ka=320;function Ee(e){return Number.isFinite(e)?Math.min(Ka,Math.max(qe,e)):qe}const Wa=.2,ja=.12;function qa(e,t,n=Wa){const a=Ee(t);return e===null||!Number.isFinite(e)?a:e+n*(a-e)}function Ds(e,t){const n=Ee(t??Number.NaN);return{above:Math.round(Math.max(0,e.above)*n),below:Math.round(Math.max(0,e.below)*n)}}function xs(e){const{totalMessages:t,residentCount:n,exhausted:a,residentContentHeight:r,currentSpacerHeight:s,viewportHeight:i}=e;let o=e.rowHeightEma;n>0&&r>0&&(o=qa(o,r/n));const l=e.unloadedRows??t-n,d=a||t<=0||n<=0||l<=0||o===null?0:Math.round(l*o),u=Math.abs(d-s);return u===0?{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}:d===0||s===0||u>s*ja||i>0&&u>i?{spacerHeight:d,rowHeightEma:o,applied:!0,scrollTopDelta:d-s}:{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}}const Va=Pn,za=2;function Rs(e){const{scrollTop:t,spacerAboveHeight:n,rowHeightEstimate:a,pageSize:r=Va,nearPages:s=za}=e;if(n<=0||t>=n)return"serial";const i=Ee(a??Number.NaN);return(n-Math.max(0,t))/i>s*r?"seek":"serial"}const yt=200,Ga=1;function Ps(e,t,n=yt){const a=t.timestamp-n;return[...e.filter(r=>r.timestamp>=a),t]}function Bs(e){const{samples:t,viewportHeight:n,windowMs:a=yt,viewportFactor:r=Ga}=e;if(n<=0||t.length<2)return"gentle";const s=t[t.length-1].timestamp-a,i=t.filter(l=>l.timestamp>=s);if(i.length<2)return"gentle";let o=0;for(let l=1;l<i.length;l+=1)o+=Math.abs(i[l].scrollTop-i[l-1].scrollTop);return o>n*r?"rapid":"gentle"}function Os(e){const{scrollTop:t,spacerAboveHeight:n,unloadedRowsAbove:a}=e;if(a<=0||n<=0)return 0;const r=Math.min(1,Math.max(0,t/n));return Math.min(a-1,Math.max(0,Math.floor(r*a)))}function $s(e){const{totalMessages:t,residentCount:n,exhausted:a,startOrdinalEstimate:r,detachedFromTail:s}=e,i=Math.max(0,t-n);if(!s)return{above:a?0:i,below:0};const o=Math.max(0,e.hiddenTailCount??0);if(a)return{above:0,below:i+o};if(r!==null){const c=Math.min(i,Math.max(0,Math.round(r)));return{above:c,below:i-c+o}}const l=Math.min(i,Math.max(0,Math.round(e.holeRowsEstimate??0)));return{above:i-l,below:l+o}}function Us(e){const{exhausted:t,historyCount:n,tailCount:a,tailTruncated:r,totalMessages:s}=e;return t?!0:n>0?!1:!r&&s<=a}const Ya="intent.drafts.sync",Ja="intent.drafts.changed",Qa=$({id:E(),type:E(),label:E(),description:E().optional(),content:E().optional(),path:E().optional(),imageData:E().optional(),imageMimeType:E().optional(),attachmentId:E().optional(),attachmentMimeType:E().optional(),attachmentSize:ce().optional(),sourcePath:E().optional(),placementStatus:V("failed").optional(),screen:On().optional()}),wt=$({text:E(),attachments:$n(Qa)}),z={provenance:E().min(1),workspaceId:E().min(1),agentId:E().min(1)},ne={lifetime:E(),revision:ce().int().nonnegative()};Un("kind",[$({...z,kind:V("read")}),$({...z,...ne,kind:V("edit"),origin:E().min(1),sequence:ce().int().positive(),snapshot:wt}),$({...z,...ne,kind:V("flush")}),$({...z,...ne,kind:V("clear"),origin:E().min(1)})]);const bt=$({...z,...ne,origin:E(),sequence:ce().int().nonnegative(),snapshot:wt}),Xa=$({accepted:Ln(),draft:bt});function Za(e,t,n=t){const a=new Map,r=new Set,s=crypto.randomUUID();let i=0,o=!1;const l=()=>{const f=t();if(o||!f)throw new Error("draft-authority-unavailable");return f},c=()=>{const f=n();if(!f||o)throw new Error("draft-authority-unavailable");return()=>{if(o||n()!==f)throw new Error("draft-authority-changed")}},d=(f,k,v)=>{const I=JSON.stringify([f,k,v]);let S=a.get(I);return S||(S={dirty:0},a.set(I,S)),S},u=(f,k)=>{if(o||f.provenance!==t())return;const v=d(f.provenance,f.workspaceId,f.agentId);if(!(v.value?.lifetime===f.lifetime&&v.value.revision>f.revision)&&(v.value=f,k&&v.dirty===0))for(const I of r)I(f)},h=e.subscribe(f=>{const k=bt.safeParse(f);k.success&&u(k.data,!0)}),p=async(f,k)=>{k();const v=Xa.parse(await e.request(f));if(k(),f.provenance!==l()||v.draft.provenance!==f.provenance)throw new Error("draft-authority-changed");if(!v.accepted)throw u(v.draft,!1),new Error("draft-changed-in-another-editor");return v.draft},m=async(f,k)=>{const v=l(),I=c(),S=d(v,f,k);S.tail&&await S.tail;const _=await p({kind:"read",provenance:v,workspaceId:f,agentId:k},I);return u(_,!1),_},y=(f,k,v)=>{const I=l(),S=c(),_=d(I,f,k),B=_.tail??(_.value?Promise.resolve(_.value):p({kind:"read",provenance:I,workspaceId:f,agentId:k},S));_.dirty+=1;const C=B.then(P=>p(v(P),S));return _.tail=C,C.then(P=>{_.dirty-=1,_.tail===C&&(_.tail=void 0),u(P,!0)},()=>{_.dirty-=1,_.tail===C&&(_.tail=void 0)}),C};return{authority:()=>o?null:n(),read:m,async edit(f,k,v,I){const S=++i;return y(k,v,_=>({kind:"edit",provenance:_.provenance,workspaceId:k,agentId:v,lifetime:_.lifetime,revision:_.revision,origin:f,sequence:S,snapshot:I}))},async flush(f,k){const v=l(),I=c(),S=d(v,f,k),_=await(S.tail??(S.value?Promise.resolve(S.value):m(f,k)));await p({kind:"flush",provenance:v,workspaceId:f,agentId:k,lifetime:_.lifetime,revision:_.revision},I)},async clear(f,k){await y(f,k,v=>({kind:"clear",provenance:v.provenance,workspaceId:f,agentId:k,lifetime:v.lifetime,revision:v.revision,origin:s}))},subscribe(f){return r.add(f),()=>{r.delete(f)}},dispose(){o=!0,h(),r.clear(),a.clear()}}}let U=null;async function Ls(e,t,n,a,r){const s=U;if(!s)throw new Error("draft-shared-transport-unavailable");const i=()=>{if(U!==s||s.authority()!==r)throw new Error("draft-authority-changed")};i(),await s.edit(e,t,n,a),i(),await s.flush(t,n),i()}async function Ns(e,t){await Promise.resolve(),U&&await U.flush(e,t)}function Hs(){if(!Sn())return null;const e=Za({request:n=>vn(Ya,n),subscribe:n=>kn(a=>{a.method===Ja&&n(a.params)})},()=>Dn(A.state),()=>xn(A.state));U=e;const t=e.dispose;return e.dispose=()=>{U===e&&(U=null),t()},e}const kt=new Map;function vt(e,t){return`${e}\0${t}`}function Fs(e,t){return kt.get(vt(e,t))}function Ks(e,t,n){kt.set(vt(e,t),n)}const Ws=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.userMessageIndexes,n):void 0}),js=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.retryAgents,n):void 0});function er(e){e=Math.max(0,e);const t=Math.floor(e/1e3);if(t<10){const s=e/1e3,i=s.toFixed(1);return i.endsWith(".0")?`${Math.round(s)}s`:`${i}s`}if(t<60)return`${t}s`;const n=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${a}m ${r}s`:`${a}m ${r}s`}function qs(e){return er(Math.max(1e3,Math.round(e/1e3)*1e3))}const tr=new Set(["launch","init","session-create","session-load","prompt"]),nr=new Set(["tool-call","tool-waiting"]);function ar(e){let t=null;for(const n of e)(!t||n.timestamp>=t.timestamp)&&(t=n);return t}function Vs(e){return e&&tr.has(e)?"pulse":e&&nr.has(e)?"twist":"bloom"}const _t="stalled";function zs(e,t){const n=ar(e);return!n||n.phase!==_t||typeof t=="number"&&t>n.timestamp?null:n}function Gs(e){let t=null;for(const n of e)n.phase!==_t&&(!t||n.timestamp>=t.timestamp)&&(t=n);return t}const Ve={get title(){return b.chat_streamingStatus_sessionCorrupted_title()},get message(){return b.chat_streamingStatus_sessionCorrupted_message()}};function Ys(e,t){return e?t===!0?{corrupted:!0,title:Ve.title,message:Ve.message,detail:e}:{corrupted:!1,title:b.chat_streamingStatus_responseFailed_label(),message:e,detail:null}:null}const Js=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),Qs=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Xs=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const i of Object.values(s.panels))for(const o of i.tabs)o.type==="agent"&&o.agentId&&t.push(o.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}}),Zs=A.createSelector((e,t)=>x(e.questionUi.consumers,t)),rr=3e4,Y=new Map;function ei(e,t){const n=Y.get(e);n&&clearTimeout(n.timer);const a=setTimeout(()=>Y.delete(e),rr);Y.set(e,{value:t,timer:a})}function ti(e){const t=Y.get(e);if(t)return clearTimeout(t.timer),Y.delete(e),t.value}const St=A.createSelector((e,t,n)=>e.agentWorkers?.byKey[jt(t,n)]??Wt),sr=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="unsupported"?[]:(a.snapshot?.workers??[]).filter(r=>r.status==="running"||r.status==="unknown")}),ni=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="failed"?!0:a.status!=="ready"||!a.snapshot?!1:a.snapshot.truncated?!0:a.snapshot.support.status!=="supported"&&sr.select(e,t,n).length>0}),ir=1e3,Mt={requireViewedAndFocused:!0,requireAssistantTail:!0},J=new Map,R=new Map;let W=null;function Ce(e){(e===void 0||W===e)&&(W=null)}const or=200;function cr(e,t){if(R.delete(e),R.set(e,t),R.size>or){const n=R.keys().next().value;n!==void 0&&R.delete(n)}}function At(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!n.isStreaming&&typeof n.id=="string"&&n.id.length>0)return n}return null}function ai(e){return At(e)?.id??null}function ri(e){De(e,{requireViewedAndFocused:!0})}function si(e){De(e,{requireViewedAndFocused:!1})}function ii(e){Ce(),De(e,Mt)}function oi(e){W===e&&(J.has(e)||(W=null,xe(e,Mt)))}function ci(e){for(const t of e)typeof t!="string"||t.length===0||(It(t),Ce(t),xe(t,{requireViewedAndFocused:!1}))}function It(e){const t=J.get(e);t&&(clearTimeout(t.timer),J.delete(e))}function De(e,t){It(e),Ce(e);const n=setTimeout(()=>{J.delete(e),xe(e,t)},ir);J.set(e,{timer:n,gates:t})}let ze=null;function lr(){return ze??=Promise.all([fe(()=>import("./iGTwwZkZ.js"),__vite__mapDeps([38,17,18,3,19,20,5,7,4,21,13,2,39,40]),import.meta.url),fe(()=>import("./CJ557C-o.js").then(e=>e.p),__vite__mapDeps([41,36,4,3,17,18,19,20,5,7,21,13,2,9,6,8,10,11,12,14,32,31,42,28,35]),import.meta.url)]).then(([e,t])=>({appStore:e.store,appClient:t.appClient})),ze}async function xe(e,t){let n=null;try{const{appStore:a,appClient:r}=await lr(),s=a.state;if(t.requireViewedAndFocused&&(s.unreadTracking?.currentlyViewedAgentId!==e||typeof document<"u"&&!document.hasFocus()))return;const i=s.agentSessions?.byAgentId[e];if(!i)return;const o=typeof i.workspaceId=="string"?i.workspaceId:"";if(o.length===0)return;if(t.requireAssistantTail&&s.chatState?.byAgentId[e]?.initialHistoryPending){W=e;return}const l=At(i.messages??[]);if(!l){t.requireAssistantTail&&(W=e);return}if(t.requireAssistantTail&&l.role!=="assistant")return;const c=l.id;if(R.get(e)===c)return;cr(e,c),n=c,!(await r.agents.markSeen({workspaceId:o,agentId:e,messageId:c})).success&&R.get(e)===n&&R.delete(e)}catch{n!==null&&R.get(e)===n&&R.delete(e)}}const oe=new Map;function Tt(e,t){return`${e}\0${t}`}function li(e,t){return oe.get(Tt(e,t))}function di(e,t,n){oe.set(Tt(e,t),n)}function ui(e){if(e.length===0)return;const t=new Set(e);for(const n of[...oe.keys()]){const a=n.slice(n.indexOf("\0")+1);t.has(a)&&oe.delete(n)}}export{bs as $,Br as A,zr as B,Kr as C,O as D,Fa as E,jr as F,Ea as G,Da as H,Gn as I,Ns as J,qs as K,Ss as L,ir as M,zs as N,Es as O,li as P,Fs as Q,yt as R,_s as S,cs as T,ws as U,qe as V,ls as W,Gs as X,Vs as Y,rs as Z,ss as _,ts as a,Lr as a0,na as a1,As as a2,Ur as a3,Us as a4,G as a5,Hr as a6,Nr as a7,xr as a8,Os as a9,St as aA,ni as aB,os as aC,Qs as aD,Xs as aE,Js as aF,ps as aG,hs as aH,fs as aI,gs as aJ,gt as aK,Zs as aL,js as aM,Ws as aN,di as aO,Ks as aP,Ts as aQ,$r as aR,ms as aS,$s as aT,ei as aU,ks as aV,Pa as aW,ti as aX,aa as aY,Or as aZ,ci as aa,oi as ab,ri as ac,si as ad,ii as ae,ai as af,Cs as ag,as as ah,Gr as ai,Hn as aj,Ls as ak,Fr as al,es as am,qr as an,Ba as ao,pt as ap,Rr as aq,vs as ar,xs as as,ys as at,ns as au,Ce as av,is as aw,Cr as ax,Ds as ay,sr as az,we as b,Ps as c,Xr as d,Zr as e,Ms as f,Pr as g,Ca as h,Dr as i,sa as j,ra as k,Bs as l,Rs as m,ui as n,us as o,Is as p,Qr as q,Jr as r,Wr as s,Hs as t,Yr as u,Ys as v,ds as w,Vr as x,ge as y,qn as z};
|
|
11
|
+
`),e)}function es(e,t,n){if(e==="suggested-prompt")return{fields:{},hasAttachments:!1,cleanup:{clearInput:!1,followBottom:!0,historyText:null}};const a=n(),{imageBlocks:r,fileBlocks:s}=Ea(a.contextItems);return{fields:{contextItems:a.contextItems,workspaceContextStr:Ca(a.contextItems,a.checkedPanels,a.checkedSelections),noteIds:a.noteIds,...r.length>0?{imageBlocks:r}:{},...s.length>0?{fileBlocks:s}:{},...a.pickedMentions?{messageMetadata:a.pickedMentions}:{}},hasAttachments:r.length>0||s.length>0,cleanup:{clearInput:!0,followBottom:!0,historyText:t}}}const Da="chat-read:",K=new Map,ye=new Set;function ts(e,t){let n=K.get(e);n||(n=new Set,K.set(e,n)),n.add(t)}function ns(e,t){const n=K.get(e);if(!(!n||!n.delete(t))&&n.size===0){K.delete(e);for(const a of[...ye])a(e)}}function as(e){return ye.add(e),()=>ye.delete(e)}function rs(e){return K.has(e)}function ss(e){const t=K.get(e);if(!t)return!1;for(const n of t)if(!n.startsWith(Da))return!0;return!1}function xa(e,t,n){const a=e.state.pendingSubmissions.byAgentId[t.agentId];if(!a||!Ye(a.scope,t))return null;const r={...structuredClone(n),id:crypto.randomUUID(),createdAt:Date.now()};e.dispatch(Lt(t,r));const s=e.state.pendingSubmissions.byAgentId[t.agentId];return s&&x(s.submissions,r.id)?r:null}function Ra(e,t,n,a,r){const s=Be.select(e.state,n),i=pe.select(e.state)?.principal.id,o=Ue(e.state);if(!s||!i||!o)return null;const l=In(t,n),c={agentId:t,workspaceId:n,principalId:i,participation:s,authority:o,owner:l.key,lifetime:e.state.pendingSubmissions.byAgentId[t]?.scope.lifetime??crypto.randomUUID()},d=()=>l.isCurrent(e.state.agentSessions?.byAgentId[t]?.workspaceId)&&Be.select(e.state,n)===s&&pe.select(e.state)?.principal.id===i&&Ue(e.state)===o;if(!d())return null;e.dispatch(Ut(c,a,Pt.select(e.state,n)));const u=xa(e,c,r);return u?{scope:c,submission:u,isCurrent:()=>{const h=e.state.pendingSubmissions.byAgentId[t];return d()&&!!h&&Ye(h.scope,c)&&(!!x(h.operations,u.id)||!!x(h.submissions,u.id))}}:null}function we(e,t,n){if(!n.text.trim()&&!n.imageBlocks?.length&&!n.fileBlocks?.length)return null;const a=n.userAppMessageId??Tn();return Ra(e,t,n.wsId,pe.select(e.state)?.capabilities.submissionCorrelation,{content:n.text.trim(),appMessageId:a,destination:!n.forceSubmit&&Bt.select(e.state,t)?"queue":"conversation",contextItems:n.contextItems,imageBlocks:n.imageBlocks,fileBlocks:n.fileBlocks,messageMetadata:n.messageMetadata})}function Pa(e,t,n){const a=we(e,t,n);return a?(e.dispatch(Je(t,{...n,userAppMessageId:a.submission.appMessageId,submission:{scope:a.scope,id:a.submission.id}})),!0):!1}async function Ba(e,t,n,a){const r=n.submission;if(!r)return"legacy";const s=r.reference,i=()=>s.scope.agentId===e&&s.scope.workspaceId===t&&Ge.select(A.state,e)===n?hn.select(A.state,s.scope):void 0,o=i();if(!o)return null;if(!o.supported)return"legacy";const l={wsId:t,text:n.text,imageBlocks:n.options?.imageBlocks,fileBlocks:n.options?.fileBlocks,noteIds:n.options?.noteIds,messageMetadata:n.options?.messageMetadata,model:a??n.options?.model};if(r.outcome==="rejected"){const p=x(o.tombstones,s.id);return x(o.submissions,s.id)||p&&p.reason!=="rejected"?null:we(A,e,l)}if(r.outcome==="accepted")return we(A,e,l);await Promise.all([En(e,t).catch(()=>{}),Cn(e,t).catch(()=>{})]);const c=i();if(!c||x(c.submissions,s.id)?.status!=="uncertain")return null;const{notify:d}=await fe(async()=>{const{notify:p}=await import("./BrysY2Ec.js").then(m=>m.C);return{notify:p}},__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]),import.meta.url);if(i()!==c)return null;let u=!1;const h=()=>{u=!0};return d.warning(b.agent_chatSend_uncertainRetry_description(),{key:`submission-retry:${t}:${e}:${s.id}`,duration:Number.POSITIVE_INFINITY,action:{label:b.agent_chatSend_resend_label(),onClick:()=>{if(u)return;u=!0;const p=i();!p||p.generation!==c.generation||p.submissions!==c.submissions||p.observationVersion!==c.observationVersion||x(p.submissions,s.id)?.status!=="uncertain"||Pa(A,e,l)}},cancel:{label:b.chat_richInput_cancel_label(),onClick:h},onDismiss:h}),null}async function is(e,t,n){const a=Ge.select(A.state,e),r=a?.submission?await Ba(e,t,a,n):"legacy";if(r){if(r==="legacy"){await A.dispatch(n===void 0?Nt(e,t):Ht(e,t,n));return}!r.isCurrent()||!a||A.dispatch(Je(e,{wsId:t,text:a.text,imageBlocks:a.options?.imageBlocks,fileBlocks:a.options?.fileBlocks,noteIds:a.options?.noteIds,messageMetadata:a.options?.messageMetadata,model:n??a.options?.model,userAppMessageId:r.submission.appMessageId,submission:{scope:r.scope,id:r.submission.id}}))}}const os=A.createSelector((e,t)=>{const n=x(e.chatDrafts.owners,t);return n?{restore:n.restore,saves:Qe(n.saves),shared:n.restore?e.chatDrafts.shared[JSON.stringify([n.restore.workspaceId,n.restore.agentId])]:void 0}:void 0});function Oa(e,t){return t.workspaceId===e&&!t.retiredAt&&!t.pendingDeleteAt&&t.status!==ke.Deleted&&!t.notificationsMuted&&Kt(t)==="topLevel"}function $a(e){const t=e.metadata?.pendingQuestionsMessageId;return typeof t=="string"&&t.length>0&&!Rn(e.metadata,t)?t:null}function Ua(e){return e.status===ke.Error&&!Ot($t(e))}function cs(e,t){return t.filter(n=>Oa(e,n)).flatMap(n=>{const a=Ft(n),r=$a(n),s=n.status===ke.Error;if(!a&&!r&&!s)return[];const i=a?.timestamp??(s?n.stopReasonTimestamp:void 0);return[{agentId:n.id,agentName:n.name,kind:a?.kind??(s?"failed":"question"),reason:a?.reason,timestamp:i&&Number.isFinite(Date.parse(i))?i:void 0,questionMessageId:r,canRetry:Ua(n)}]})}function ls(e){return e.displayStatus==="failed"?"failed":e.displayStatus==="blocked"?"blocked":e.attention==="review_required"?"review":e.displayStatus==="needs_attention"?"question":e.activity==="agent_running"||e.displayStatus==="in_progress"?"running":e.scriptsRunning===!0?"scripts_running":e.backgroundTasksRunning===!0?"background_tasks_running":e.displayStatus==="pr_ready"?"pr_ready":e.displayStatus==="pr_merged"?"merged":e.displayStatus==="complete"?"complete":e.attention==="unread"?"unread":e.displayStatus==="pr_open"||e.displayStatus==="pr_queued"?e.displayStatus:"idle"}function ds(e){const t=e.kind==="prs"?e.organization?.trim().toLowerCase():void 0;return{key:JSON.stringify([e.kind,e.workspaceId,t||null,[...new Set((t?[]:e.repositories).map(n=>JSON.stringify([n.key,n.owner,n.name])))].sort()]),hasGitHubRepositories:!!t||e.repositories.some(n=>!!n.owner),hasLocalRepositories:!t&&e.repositories.some(n=>!n.owner)}}function Te(e){const t=bn(e);if(t?.kind!=="pr"||!Number.isSafeInteger(t.number)||t.number<=0)return null;const n=t.owner.toLowerCase(),a=t.repo.toLowerCase();return{owner:n,repo:a,number:t.number,id:`${n}/${a}#${t.number}`,url:`https://github.com/${n}/${a}/pull/${t.number}`}}function us(e,t,n,a){const r=e.filter(s=>a?a.includes(s.id):n?s.repositoryOwner?.toLowerCase()===n.toLowerCase():t.some(i=>i.owner?.toLowerCase()===s.repositoryOwner?.toLowerCase()&&i.name.toLowerCase()===s.repositoryName?.toLowerCase()));return[...new Map(r.flatMap(s=>[...(s.pullRequests??[]).map(i=>i.url),s.activePullRequest?.url,s.prUrl]).flatMap(s=>{const i=s?Te(s):null;return i?[[i.id,{owner:i.owner,repo:i.repo,number:i.number}]]:[]})).values()].sort((s,i)=>`${s.owner}/${s.repo}#${s.number}`.localeCompare(`${i.owner}/${i.repo}#${i.number}`))}function ms(e,t){const[n]=t;return t.length!==1||e.owner?.toLowerCase()!==n?.owner?.toLowerCase()||e.repo?.toLowerCase()!==n?.name.toLowerCase()}const ps=A.createSelector(e=>e.homeIntegrations),fs=A.createSelector(e=>{const t=e.homeIntegrations;return!t.linkedItems||!Object.keys(t.linkedItems).length?t:{...t,items:[...new Map([...Object.values(t.linkedItems),...t.items].map(n=>[n.id,n])).values()].sort((n,a)=>(a.updatedAt??"").localeCompare(n.updatedAt??""))}}),gt=A.createSelector(e=>Qe(e.workspace.workspaces).flatMap(t=>[...(t.pullRequests??[]).map(n=>n.url),t.activePullRequest?.url,t.prUrl].filter(n=>!!n).map(n=>({url:Te(n)?.url??n.replace(/\/$/,"").toLowerCase(),workspaceId:t.id,name:t.title||t.id})))),hs=A.createSelector(e=>{const t=e.homeIntegrations.detail?.url,n=t?Te(t)?.url??t.replace(/\/$/,"").toLowerCase():void 0;return gt.select(e).find(a=>a.url===n)??null}),gs=A.createSelector(e=>gt.select(e).map(t=>t.url));let ee=null;function ys(e){return ee=e,()=>{ee===e&&(ee=null)}}function ws(){return ee}function bs(e){return[...e.groups.length>0?e.groups.filter(n=>n.expanded).flatMap(n=>n.items):e.workspaces,...e.asideExpanded?e.aside:[]].map(n=>n.id)}function ks(e,t,n){if(e.length===0)return null;const a=t===null?-1:e.indexOf(t);return a===-1?e[0]:e[a+(n==="clockwise"?1:-1)]??null}let te=null;function vs(e){return te=e,()=>{te===e&&(te=null)}}function _s(){return te}function Ss(e){return An(e)}function La(e){return Mn(e)}function Na(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function me(e){if(e.length===0)return[];const t=[];let n=null;for(const a of e){const r=a.timestamp?typeof a.timestamp=="string"?new Date(a.timestamp):a.timestamp:new Date;(!n||!Na(n.date,r))&&(n={date:r,label:La(r),messages:[]},t.push(n)),n.messages.push(a)}return t}function Ms(e){const t=new Map;return e.map(({date:n})=>{const a=`${n.getFullYear()}-${n.getMonth()+1}-${n.getDate()}`,r=t.get(a)??0;return t.set(a,r+1),r===0?a:`${a}#${r}`})}function As(e,t){const n=new Map;let a=t?null:void 0;for(const r of e.groups)for(const s of r.messages)a!==void 0&&n.set(s.id,a),s.role==="user"&&!Bn(s)&&(a=s);return n}function Ha(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`}function je(e,t){const n=new Map;return e.map(a=>{const r=`${t}-${Ha(a.date)}`,s=(n.get(r)??0)+1;return n.set(r,s),{...a,groupKey:s===1?r:`${r}-${s}`}})}function Fa(e,t){if(e.length===0||t.length===0)return e;const n=new Set(t.map(s=>s.id)),a=new Set(t.map(s=>s.appMessageId).filter(s=>typeof s=="string"&&s.length>0)),r=e.filter(s=>!n.has(s.id)&&!(typeof s.appMessageId=="string"&&s.appMessageId.length>0&&a.has(s.appMessageId)));return r.length===e.length?e:r}function Is(e,t,n){return e=Fa(e,t),e.length===0?{groups:me(t),detached:!1,hiddenTail:[]}:n?{groups:je(me(e),"h"),detached:!0,hiddenTail:t}:{groups:je(me([...e,...t]),"d"),detached:!1,hiddenTail:[]}}function Ts(e){const{scrollTop:t,threshold:n,fetching:a,exhausted:r,historyCount:s,tailCount:i,tailTruncated:o,totalMessages:l,spacerAbove:c=0}=e;return t>n+c||a||r?!1:s>0||o||l>i+s}const Es=300;function Cs(e){const{fetching:t,chainEvaluationPending:n,visible:a,hideArmed:r}=e;return t||n?a&&!r?"none":"show":a&&!r?"arm-hide":"none"}const qe=24,Ka=320;function Ee(e){return Number.isFinite(e)?Math.min(Ka,Math.max(qe,e)):qe}const Wa=.2,ja=.12;function qa(e,t,n=Wa){const a=Ee(t);return e===null||!Number.isFinite(e)?a:e+n*(a-e)}function Ds(e,t){const n=Ee(t??Number.NaN);return{above:Math.round(Math.max(0,e.above)*n),below:Math.round(Math.max(0,e.below)*n)}}function xs(e){const{totalMessages:t,residentCount:n,exhausted:a,residentContentHeight:r,currentSpacerHeight:s,viewportHeight:i}=e;let o=e.rowHeightEma;n>0&&r>0&&(o=qa(o,r/n));const l=e.unloadedRows??t-n,d=a||t<=0||n<=0||l<=0||o===null?0:Math.round(l*o),u=Math.abs(d-s);return u===0?{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}:d===0||s===0||u>s*ja||i>0&&u>i?{spacerHeight:d,rowHeightEma:o,applied:!0,scrollTopDelta:d-s}:{spacerHeight:s,rowHeightEma:o,applied:!1,scrollTopDelta:0}}const Va=Pn,za=2;function Rs(e){const{scrollTop:t,spacerAboveHeight:n,rowHeightEstimate:a,pageSize:r=Va,nearPages:s=za}=e;if(n<=0||t>=n)return"serial";const i=Ee(a??Number.NaN);return(n-Math.max(0,t))/i>s*r?"seek":"serial"}const yt=200,Ga=1;function Ps(e,t,n=yt){const a=t.timestamp-n;return[...e.filter(r=>r.timestamp>=a),t]}function Bs(e){const{samples:t,viewportHeight:n,windowMs:a=yt,viewportFactor:r=Ga}=e;if(n<=0||t.length<2)return"gentle";const s=t[t.length-1].timestamp-a,i=t.filter(l=>l.timestamp>=s);if(i.length<2)return"gentle";let o=0;for(let l=1;l<i.length;l+=1)o+=Math.abs(i[l].scrollTop-i[l-1].scrollTop);return o>n*r?"rapid":"gentle"}function Os(e){const{scrollTop:t,spacerAboveHeight:n,unloadedRowsAbove:a}=e;if(a<=0||n<=0)return 0;const r=Math.min(1,Math.max(0,t/n));return Math.min(a-1,Math.max(0,Math.floor(r*a)))}function $s(e){const{totalMessages:t,residentCount:n,exhausted:a,startOrdinalEstimate:r,detachedFromTail:s}=e,i=Math.max(0,t-n);if(!s)return{above:a?0:i,below:0};const o=Math.max(0,e.hiddenTailCount??0);if(a)return{above:0,below:i+o};if(r!==null){const c=Math.min(i,Math.max(0,Math.round(r)));return{above:c,below:i-c+o}}const l=Math.min(i,Math.max(0,Math.round(e.holeRowsEstimate??0)));return{above:i-l,below:l+o}}function Us(e){const{exhausted:t,historyCount:n,tailCount:a,tailTruncated:r,totalMessages:s}=e;return t?!0:n>0?!1:!r&&s<=a}const Ya="intent.drafts.sync",Ja="intent.drafts.changed",Qa=$({id:E(),type:E(),label:E(),description:E().optional(),content:E().optional(),path:E().optional(),imageData:E().optional(),imageMimeType:E().optional(),attachmentId:E().optional(),attachmentMimeType:E().optional(),attachmentSize:ce().optional(),sourcePath:E().optional(),placementStatus:V("failed").optional(),screen:On().optional()}),wt=$({text:E(),attachments:$n(Qa)}),z={provenance:E().min(1),workspaceId:E().min(1),agentId:E().min(1)},ne={lifetime:E(),revision:ce().int().nonnegative()};Un("kind",[$({...z,kind:V("read")}),$({...z,...ne,kind:V("edit"),origin:E().min(1),sequence:ce().int().positive(),snapshot:wt}),$({...z,...ne,kind:V("flush")}),$({...z,...ne,kind:V("clear"),origin:E().min(1)})]);const bt=$({...z,...ne,origin:E(),sequence:ce().int().nonnegative(),snapshot:wt}),Xa=$({accepted:Ln(),draft:bt});function Za(e,t,n=t){const a=new Map,r=new Set,s=crypto.randomUUID();let i=0,o=!1;const l=()=>{const f=t();if(o||!f)throw new Error("draft-authority-unavailable");return f},c=()=>{const f=n();if(!f||o)throw new Error("draft-authority-unavailable");return()=>{if(o||n()!==f)throw new Error("draft-authority-changed")}},d=(f,k,v)=>{const I=JSON.stringify([f,k,v]);let S=a.get(I);return S||(S={dirty:0},a.set(I,S)),S},u=(f,k)=>{if(o||f.provenance!==t())return;const v=d(f.provenance,f.workspaceId,f.agentId);if(!(v.value?.lifetime===f.lifetime&&v.value.revision>f.revision)&&(v.value=f,k&&v.dirty===0))for(const I of r)I(f)},h=e.subscribe(f=>{const k=bt.safeParse(f);k.success&&u(k.data,!0)}),p=async(f,k)=>{k();const v=Xa.parse(await e.request(f));if(k(),f.provenance!==l()||v.draft.provenance!==f.provenance)throw new Error("draft-authority-changed");if(!v.accepted)throw u(v.draft,!1),new Error("draft-changed-in-another-editor");return v.draft},m=async(f,k)=>{const v=l(),I=c(),S=d(v,f,k);S.tail&&await S.tail;const _=await p({kind:"read",provenance:v,workspaceId:f,agentId:k},I);return u(_,!1),_},y=(f,k,v)=>{const I=l(),S=c(),_=d(I,f,k),B=_.tail??(_.value?Promise.resolve(_.value):p({kind:"read",provenance:I,workspaceId:f,agentId:k},S));_.dirty+=1;const C=B.then(P=>p(v(P),S));return _.tail=C,C.then(P=>{_.dirty-=1,_.tail===C&&(_.tail=void 0),u(P,!0)},()=>{_.dirty-=1,_.tail===C&&(_.tail=void 0)}),C};return{authority:()=>o?null:n(),read:m,async edit(f,k,v,I){const S=++i;return y(k,v,_=>({kind:"edit",provenance:_.provenance,workspaceId:k,agentId:v,lifetime:_.lifetime,revision:_.revision,origin:f,sequence:S,snapshot:I}))},async flush(f,k){const v=l(),I=c(),S=d(v,f,k),_=await(S.tail??(S.value?Promise.resolve(S.value):m(f,k)));await p({kind:"flush",provenance:v,workspaceId:f,agentId:k,lifetime:_.lifetime,revision:_.revision},I)},async clear(f,k){await y(f,k,v=>({kind:"clear",provenance:v.provenance,workspaceId:f,agentId:k,lifetime:v.lifetime,revision:v.revision,origin:s}))},subscribe(f){return r.add(f),()=>{r.delete(f)}},dispose(){o=!0,h(),r.clear(),a.clear()}}}let U=null;async function Ls(e,t,n,a,r){const s=U;if(!s)throw new Error("draft-shared-transport-unavailable");const i=()=>{if(U!==s||s.authority()!==r)throw new Error("draft-authority-changed")};i(),await s.edit(e,t,n,a),i(),await s.flush(t,n),i()}async function Ns(e,t){await Promise.resolve(),U&&await U.flush(e,t)}function Hs(){if(!Sn())return null;const e=Za({request:n=>vn(Ya,n),subscribe:n=>kn(a=>{a.method===Ja&&n(a.params)})},()=>Dn(A.state),()=>xn(A.state));U=e;const t=e.dispose;return e.dispose=()=>{U===e&&(U=null),t()},e}const kt=new Map;function vt(e,t){return`${e}\0${t}`}function Fs(e,t){return kt.get(vt(e,t))}function Ks(e,t,n){kt.set(vt(e,t),n)}const Ws=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.userMessageIndexes,n):void 0}),js=A.createSelector((e,t,n)=>{const a=e.chatPanelUi.byWorkspaceId[t];return a?x(a.retryAgents,n):void 0});function er(e){e=Math.max(0,e);const t=Math.floor(e/1e3);if(t<10){const s=e/1e3,i=s.toFixed(1);return i.endsWith(".0")?`${Math.round(s)}s`:`${i}s`}if(t<60)return`${t}s`;const n=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return n>0?`${n}h ${a}m ${r}s`:`${a}m ${r}s`}function qs(e){return er(Math.max(1e3,Math.round(e/1e3)*1e3))}const tr=new Set(["launch","init","session-create","session-load","prompt"]),nr=new Set(["tool-call","tool-waiting"]);function ar(e){let t=null;for(const n of e)(!t||n.timestamp>=t.timestamp)&&(t=n);return t}function Vs(e){return e&&tr.has(e)?"pulse":e&&nr.has(e)?"twist":"bloom"}const _t="stalled";function zs(e,t){const n=ar(e);return!n||n.phase!==_t||typeof t=="number"&&t>n.timestamp?null:n}function Gs(e){let t=null;for(const n of e)n.phase!==_t&&(!t||n.timestamp>=t.timestamp)&&(t=n);return t}const Ve={get title(){return b.chat_streamingStatus_sessionCorrupted_title()},get message(){return b.chat_streamingStatus_sessionCorrupted_message()}};function Ys(e,t){return e?t===!0?{corrupted:!0,title:Ve.title,message:Ve.message,detail:e}:{corrupted:!1,title:b.chat_streamingStatus_responseFailed_label(),message:e,detail:null}:null}const Js=A.createSelector((e,t)=>e.unreadTracking.dividerSessionByAgentId[t]??null),Qs=A.createSelector(e=>e.unreadTracking.currentlyViewedAgentId),Xs=A.createSelector(e=>{const t=[];for(const s of Object.values(e.panelLayout.byWorkspaceId))for(const i of Object.values(s.panels))for(const o of i.tabs)o.type==="agent"&&o.agentId&&t.push(o.agentId);const n=Object.keys(e.unreadTracking.dividerSessionByAgentId),a=new Set(e.agentSessions.agentIdsByWorkspace[be]??[]);return{chiefCardVisible:e.sidebarNav.panelItem==="chief",chiefSessionAgentIds:n.filter(s=>a.has(s)),dividerSessionAgentIds:n,openAgentTabIds:t}}),Zs=A.createSelector((e,t)=>x(e.questionUi.consumers,t)),rr=3e4,Y=new Map;function ei(e,t){const n=Y.get(e);n&&clearTimeout(n.timer);const a=setTimeout(()=>Y.delete(e),rr);Y.set(e,{value:t,timer:a})}function ti(e){const t=Y.get(e);if(t)return clearTimeout(t.timer),Y.delete(e),t.value}const St=A.createSelector((e,t,n)=>e.agentWorkers?.byKey[jt(t,n)]??Wt),sr=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="unsupported"?[]:(a.snapshot?.workers??[]).filter(r=>r.status==="running"||r.status==="unknown")}),ni=A.createSelector((e,t,n)=>{const a=St.select(e,t,n);return a.status==="failed"?!0:a.status!=="ready"||!a.snapshot?!1:a.snapshot.truncated?!0:a.snapshot.support.status!=="supported"&&sr.select(e,t,n).length>0}),ir=1e3,Mt={requireViewedAndFocused:!0,requireAssistantTail:!0},J=new Map,R=new Map;let W=null;function Ce(e){(e===void 0||W===e)&&(W=null)}const or=200;function cr(e,t){if(R.delete(e),R.set(e,t),R.size>or){const n=R.keys().next().value;n!==void 0&&R.delete(n)}}function At(e){for(let t=e.length-1;t>=0;t--){const n=e[t];if(!n.isStreaming&&typeof n.id=="string"&&n.id.length>0)return n}return null}function ai(e){return At(e)?.id??null}function ri(e){De(e,{requireViewedAndFocused:!0})}function si(e){De(e,{requireViewedAndFocused:!1})}function ii(e){Ce(),De(e,Mt)}function oi(e){W===e&&(J.has(e)||(W=null,xe(e,Mt)))}function ci(e){for(const t of e)typeof t!="string"||t.length===0||(It(t),Ce(t),xe(t,{requireViewedAndFocused:!1}))}function It(e){const t=J.get(e);t&&(clearTimeout(t.timer),J.delete(e))}function De(e,t){It(e),Ce(e);const n=setTimeout(()=>{J.delete(e),xe(e,t)},ir);J.set(e,{timer:n,gates:t})}let ze=null;function lr(){return ze??=Promise.all([fe(()=>import("./4GiF-64P.js"),__vite__mapDeps([38,17,18,3,19,20,5,7,4,21,13,2,39,40]),import.meta.url),fe(()=>import("./BAR7XkP3.js").then(e=>e.o),__vite__mapDeps([41,36,4,3,17,18,19,20,5,7,21,13,2,9,6,8,10,11,12,14,32,31,42,28,35]),import.meta.url)]).then(([e,t])=>({appStore:e.store,appClient:t.appClient})),ze}async function xe(e,t){let n=null;try{const{appStore:a,appClient:r}=await lr(),s=a.state;if(t.requireViewedAndFocused&&(s.unreadTracking?.currentlyViewedAgentId!==e||typeof document<"u"&&!document.hasFocus()))return;const i=s.agentSessions?.byAgentId[e];if(!i)return;const o=typeof i.workspaceId=="string"?i.workspaceId:"";if(o.length===0)return;if(t.requireAssistantTail&&s.chatState?.byAgentId[e]?.initialHistoryPending){W=e;return}const l=At(i.messages??[]);if(!l){t.requireAssistantTail&&(W=e);return}if(t.requireAssistantTail&&l.role!=="assistant")return;const c=l.id;if(R.get(e)===c)return;cr(e,c),n=c,!(await r.agents.markSeen({workspaceId:o,agentId:e,messageId:c})).success&&R.get(e)===n&&R.delete(e)}catch{n!==null&&R.get(e)===n&&R.delete(e)}}const oe=new Map;function Tt(e,t){return`${e}\0${t}`}function li(e,t){return oe.get(Tt(e,t))}function di(e,t,n){oe.set(Tt(e,t),n)}function ui(e){if(e.length===0)return;const t=new Set(e);for(const n of[...oe.keys()]){const a=n.slice(n.indexOf("\0")+1);t.has(a)&&oe.delete(n)}}export{bs as $,Br as A,zr as B,Kr as C,O as D,Fa as E,jr as F,Ea as G,Da as H,Gn as I,Ns as J,qs as K,Ss as L,ir as M,zs as N,Es as O,li as P,Fs as Q,yt as R,_s as S,cs as T,ws as U,qe as V,ls as W,Gs as X,Vs as Y,rs as Z,ss as _,ts as a,Lr as a0,na as a1,As as a2,Ur as a3,Us as a4,G as a5,Hr as a6,Nr as a7,xr as a8,Os as a9,St as aA,ni as aB,os as aC,Qs as aD,Xs as aE,Js as aF,ps as aG,hs as aH,fs as aI,gs as aJ,gt as aK,Zs as aL,js as aM,Ws as aN,di as aO,Ks as aP,Ts as aQ,$r as aR,ms as aS,$s as aT,ei as aU,ks as aV,Pa as aW,ti as aX,aa as aY,Or as aZ,ci as aa,oi as ab,ri as ac,si as ad,ii as ae,ai as af,Cs as ag,as as ah,Gr as ai,Hn as aj,Ls as ak,Fr as al,es as am,qr as an,Ba as ao,pt as ap,Rr as aq,vs as ar,xs as as,ys as at,ns as au,Ce as av,is as aw,Cr as ax,Ds as ay,sr as az,we as b,Ps as c,Xr as d,Zr as e,Ms as f,Pr as g,Ca as h,Dr as i,sa as j,ra as k,Bs as l,Rs as m,ui as n,us as o,Is as p,Qr as q,Jr as r,Wr as s,Hs as t,Yr as u,Ys as v,ds as w,Vr as x,ge as y,qn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var f=Object.defineProperty;var y=(s,t,e)=>t in s?f(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var i=(s,t,e)=>y(s,typeof t!="symbol"?t+"":t,e);import{H as m}from"./
|
|
1
|
+
var f=Object.defineProperty;var y=(s,t,e)=>t in s?f(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var i=(s,t,e)=>y(s,typeof t!="symbol"?t+"":t,e);import{H as m}from"./DHP1DFPI.js";import{a as p}from"./CC7to1B5.js";function b(s){const t=s??document.activeElement;return t?!!(t.classList?.contains("xterm")||t.classList?.contains("xterm-helper-textarea")||typeof t.closest=="function"&&t.closest(".xterm")||typeof t.closest=="function"&&t.closest(".terminal-panel")):!1}function K(s){const t=s??document.activeElement;if(!t)return!1;if(p(t))return!0;const e=typeof t.closest=="function";return!!(t.classList?.contains("monaco-editor")||t.classList?.contains("inputarea")||e&&t.closest(".monaco-editor")||t.classList?.contains("cm-content")||e&&t.closest(".cm-editor")||t.classList?.contains("ProseMirror")||e&&t.closest(".ProseMirror"))}class E{constructor(){i(this,"shortcuts",new Map);i(this,"dynamicShortcuts",[]);i(this,"enabled",!1);i(this,"boundHandler",null);i(this,"localFallbacks",new WeakMap);i(this,"boundLocalFallback",t=>{const e=this.localFallbacks.get(t);this.localFallbacks.delete(t),!(!e||t.defaultPrevented)&&(t.preventDefault(),t.stopPropagation(),e.action())});this.boundHandler=this.handleKeyDown.bind(this)}register(t){if(t.binding){this.dynamicShortcuts.push(t);return}const e=this.getShortcutKey(t);this.shortcuts.set(e,t)}unregister(t){const e=this.getShortcutKey(t);this.shortcuts.delete(e)}enable(){!this.enabled&&this.boundHandler&&(window.addEventListener("keydown",this.boundHandler,!0),this.enabled=!0)}disable(){this.enabled&&this.boundHandler&&(window.removeEventListener("keydown",this.boundHandler,!0),window.removeEventListener("keydown",this.boundLocalFallback),this.localFallbacks=new WeakMap,this.enabled=!1)}attach(){this.enable()}detach(){this.disable()}handleKeyDown(t){const e=t.target;if(e.closest?.("[data-shortcut-input], [data-shortcut-entry]"))return;const o=b(e),c=K(e),r=[];t.ctrlKey&&r.push("ctrl"),t.metaKey&&r.push("meta"),t.shiftKey&&r.push("shift"),t.altKey&&r.push("alt");let l=t.key.toLowerCase();t.altKey&&t.code.startsWith("Key")?l=t.code.slice(3).toLowerCase():t.altKey&&t.code.startsWith("Digit")&&(l=t.code.slice(5)),r.push(l);const d=r.join("+"),u=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),a=[...this.dynamicShortcuts].reverse().find(({binding:n,enabled:h})=>n&&k(t,n(),u)&&(!h||h(t)))??this.shortcuts.get(d);if(a){if(o&&!a.allowInTerminal||a.ignoreRepeat&&t.repeat||a.enabled&&!a.enabled(t)||a.skipInEditableElements&&c)return;const n=u?t.metaKey||t.altKey:t.ctrlKey||t.metaKey||t.altKey;if(!c||n||a.global){if(a.preferLocal){this.localFallbacks.set(t,a),window.removeEventListener("keydown",this.boundLocalFallback),window.addEventListener("keydown",this.boundLocalFallback);return}t.preventDefault(),t.stopPropagation(),a.action()}}}getShortcutKey(t){const e=[];return t.ctrl&&e.push("ctrl"),t.meta&&e.push("meta"),t.shift&&e.push("shift"),t.alt&&e.push("alt"),e.push(t.key.toLowerCase()),e.join("+")}getShortcuts(){return Array.from(this.shortcuts.values())}clear(){this.shortcuts.clear(),this.dynamicShortcuts=[]}destroy(){this.detach(),this.clear()}}function k(s,t,e){const o=s.altKey&&s.code.startsWith("Key")?s.code.slice(3):s.altKey&&s.code.startsWith("Digit")?s.code.slice(5):s.key;return m({key:o,metaKey:s.metaKey,ctrlKey:s.ctrlKey,altKey:s.altKey,shiftKey:s.shiftKey},t,e)}export{E as K,b as a,K as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ix as N}from"./
|
|
1
|
+
import{Ix as N}from"./CicdOSYm.js";const z=N.createSelector((t,e,o)=>Object.values(t.taskAgentAssociations?.byWorkspaceId[e]?.byNoteId[o]??{})),D=N.createSelector((t,e,o)=>{const n=t.taskAgentAssociations?.byWorkspaceId[e]?.byNoteId??{};return Object.values(n).flatMap(s=>Object.values(s)).filter(s=>s.agentId===o)});let b=1;const I=new WeakMap;function $(t){let e=I.get(t);return e||(e=b++,I.set(t,e)),e}function m(t){if(t==null)return"";if(typeof t=="string")return`s:${t.length}:${t.slice(0,16)}:${t.slice(-16)}`;if(typeof t!="object")return`${typeof t}:${String(t)}`;if(Array.isArray(t))return`a:${$(t)}:${t.length}`;const e=Object.keys(t).sort();return`o:${$(t)}:${e.map(o=>`${o}=${m(t[o])}`).join(",")}`}function K(t){const e=[`message:${t.id||""}:${t.appMessageId||""}:${t.role}`];for(const o of t.toolCalls||[])e.push(`call:${o.id}:${o.status||""}:${o.error||""}`);for(const o of t.toolResults||[])e.push(`result:${o.toolCallId}:${o.isError?"1":"0"}:${m(o.content)}`);for(const[o,n]of(t.contentBlocks||[]).entries())if(n.type==="tool_use"){const s=n.metadata;e.push(`use:${o}:${n.id||""}:${n.tool_use_id||""}:${n.toolCallId||""}:${s?.toolId||""}:${n.name||""}:${n.toolName||""}:${m(n.input)}:${m(s?.toolInput)}`)}else n.type==="tool_result"&&e.push(`result-block:${o}:${n.id||""}:${n.tool_use_id||""}:${n.toolCallId||""}:${n.is_error?"1":"0"}:${n.isError?"1":"0"}:${m(n.content||n.text)}`);return e.join("|")}function y(t){if(!t)return!1;const e=typeof t=="string"?t:JSON.stringify(t);return[/tool .* not found/i,/tool .* not available/i,/unknown tool/i,/invalid tool/i,/tool execution failed/i,/failed to execute tool/i,/tool error:/i].some(n=>n.test(e))}const S=new WeakMap;function k(t){const e=S.get(t);if(e)return e;const o=new Set;if(t.toolResults)for(const n of t.toolResults)(n.isError||y(n.content))&&n.toolCallId&&o.add(n.toolCallId);if(t.toolCalls)for(const n of t.toolCalls)(n.status==="failed"||n.error)&&n.id&&o.add(n.id);if(t.contentBlocks){const n=t.contentBlocks;for(let s=0;s<n.length;s++){const i=n[s];if(i.type==="tool_result"){const r=i.is_error||i.isError,l=y(i.content||i.text);if(r||l){let a=i.tool_use_id||i.toolCallId||i.id;if(!a&&s>0){const f=n[s-1];f.type==="tool_use"&&(a=f.id||f.tool_use_id||f.toolCallId)}a&&o.add(a)}}}}return S.set(t,o),o}function U(t){const e=new Map;if(t.role!=="assistant"||!t.contentBlocks)return{changes:[],totalFiles:0,totalAdditions:0,totalDeletions:0};const o=k(t);for(const s of t.contentBlocks){if(s.type!=="tool_use")continue;const i=s.id||s.tool_use_id||s.toolCallId;if(i&&o.has(i))continue;const r=A(s);if(r){const l=e.get(r.filePath);l?(l.additions+=r.additions,l.deletions+=r.deletions,l.action=r.action,l.newContent=r.newContent,l.toolCallId=r.toolCallId,l.toolName=r.toolName):e.set(r.filePath,{...r})}}const n=Array.from(e.values()).filter(s=>!(s.oldContent!==void 0&&s.newContent!==void 0&&s.oldContent===s.newContent));return{changes:n,totalFiles:n.length,totalAdditions:n.reduce((s,i)=>s+i.additions,0),totalDeletions:n.reduce((s,i)=>s+i.deletions,0)}}function F(t){const e=new Map,o=new Set;for(const s of t){const i=k(s);for(const r of i)o.add(r)}for(const s of t)if(!(s.role!=="assistant"||!s.contentBlocks))for(const i of s.contentBlocks){if(i.type!=="tool_use")continue;const r=i.id||i.tool_use_id||i.toolCallId;if(r&&o.has(r))continue;const l=A(i);if(l){const a=e.get(l.filePath);a?(a.additions+=l.additions,a.deletions+=l.deletions,a.action=l.action,a.newContent=l.newContent,a.toolCallId=l.toolCallId,a.toolName=l.toolName):e.set(l.filePath,{...l})}}const n=Array.from(e.values()).filter(s=>!(s.oldContent!==void 0&&s.newContent!==void 0&&s.oldContent===s.newContent));return{changes:n,totalFiles:n.length,totalAdditions:n.reduce((s,i)=>s+i.additions,0),totalDeletions:n.reduce((s,i)=>s+i.deletions,0)}}function M(t){const e=[];for(let o=t.length-1;o>=0;o--){const n=t[o];if(n.role==="user")break;n.role==="assistant"&&e.unshift(n)}return e}function V(t){const e=F(t).changes.map(n=>n.filePath),o=new Set(F(M(t)).changes.map(n=>n.filePath));return e.length===o.size&&e.every(n=>o.has(n))}const T=new Set(["spec","notes","tasks","readme","todo","changelog"]),O=new Set(["workspace_api","get_note","create_note","update_note","add_to_note","edit_note","delegate_task","create_agent"]);function E(t){let e=t.toLowerCase();const o=e.match(/\/\/local\/mcp\/(.+)$/);for(o&&(e=o[1]),e=e.replace(/^mcp__[^_]+__/,""),e=e.replace(/^workspace[-_]mcp[-_]/,"");/[-_]workspace-mcp$/.test(e);)e=e.replace(/[-_]workspace-mcp$/,"");return e}function L(t){const e=t.metadata;return[t.name,t.toolName,e?.toolName].some(n=>typeof n=="string"&&O.has(E(n)))}function x(t){if(/\s/.test(t))return!1;const e=t.includes("."),o=t.includes("/")||t.includes("\\");return e||o}function C(t){if(!t)return!1;const e=t.toLowerCase().trim();if(T.has(e)||e.includes(".workspace/notes/"))return!0;const o=e.includes("."),n=e.includes("/")||e.includes("\\");return!!(!o&&!n&&/^[a-z][a-z0-9-_]*$/.test(e))}function A(t){if(L(t))return null;if(t.inputTruncated===!0){const e=P(t);return e?{...e,additions:0,deletions:0,oldContent:void 0,newContent:void 0,startLineNumber:void 0}:null}return P(t)}function P(t){const e=typeof t.name=="string"&&t.name?t.name:typeof t.toolName=="string"?t.toolName:"",o=t.input||t.metadata?.toolInput||{},n=t.id||t.tool_use_id||t.metadata?.toolId||"",s=e.toLowerCase();if(s==="str_replace_editor"||s==="str-replace-editor"||s.startsWith("edit ")){const r=j(n,e,o);return r&&C(r.filePath)?null:r}const i=s==="save_file"||s==="save-file"||s==="write_file"||s==="write-file"||s==="create_file"||s==="create-file";if(i||s.startsWith("save ")||s.startsWith("create ")){const r=W(n,e,o,i);return r&&C(r.filePath)?null:r}if(s==="remove_files"||s==="remove-files"){const r=B(n,e,o);return r&&C(r.filePath)?null:r}return null}function p(t){if(t==null||typeof t=="object")return"";const e=typeof t=="string"?t:String(t);return e&&e.replace(/\\n/g,`
|
|
2
2
|
`).replace(/\\t/g," ").replace(/\\r/g,"\r")}function _(t){return typeof t!="string"?null:t.trim()||null}function v(t){if(Array.isArray(t)){for(const e of t){const o=_(e);if(o)return o}return null}return _(t)}function j(t,e,o){let n=_(o.path);if(!n&&typeof e=="string"&&e.toLowerCase().startsWith("edit ")){const c=_(e.substring(5));n=c&&x(c)?c:null}if(!n)return null;if(o.command==="create"){const c=o.file_text??"",d=p(c),u=d?d.split(`
|
|
3
3
|
`):[];return{filePath:n,action:"create",additions:u.length,deletions:0,toolName:e,toolCallId:t,oldContent:"",newContent:d}}let s=0,i=0;const r=[],l=[];let a;if(Array.isArray(o.str_replace_entries))for(const c of o.str_replace_entries){const d=c.old_str,u=c.new_str,h=c.old_str_start_line_number;if(d!==void 0&&u!==void 0){const g=p(d),w=p(u);i+=g?g.split(`
|
|
4
4
|
`).length:0,s+=w?w.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as Zt,br as K,bz as Jt,b as Nt,a_ as P,bv as Z,bt as Ie,bp as i}from"./CGWRZzdk.js";import{bs as Qt,ay as yt,be as h,b$ as x,b_ as s,bO as o,W as n,bS as l,bl as B,bn as Xt,aA as V,a7 as Se,aD as t,c9 as g,aB as I,bo as we,bV as kt,br as Ge,ca as Bt,bH as W,bk as Le,a5 as E,bA as O}from"./DYhIMPy1.js";import{n as Ae,p as Pe,v as ze,j as De,I as Ht,u as Mt}from"./B70m4__L.js";import{c as Te}from"./nmrokYzj.js";import{f as z}from"./B422XfSt.js";import"./w-1KkHyd.js";import{b as Fe}from"./BgEFdEVh.js";import"./DuHksFog.js";import"./QoUsFhvz.js";import{b as Ue}from"./DtxfuyBv.js";import{I as Wt}from"./D_n6c_yZ.js";import{L as qt}from"./DTVdw8r4.js";import"./BEyWfhqM.js";import{G as Ee,x as Oe}from"./G8V-Z8rX.js";import{Ix as q,fl as Kt,z as Be,eb as Vt,qv as He,tW as Me,Io as We,oc as qe,hz as Ke}from"./CnZcDXmL.js";import{aY as jt,aZ as Rt,a_ as Ve,aT as je,aU as Yt,aV as Re,aW as Ye,b2 as Ze}from"./DYLHdssA.js";var Je=I('<!> <p class="type-body"> </p>',1);function Ne(it,m){if(new.target)return Zt({component:Ne,...it});Qt(m,!0);let D=K(m,"open",15,!1),H=K(m,"static",7,!1),st=K(m,"title",7),_=K(m,"message",7),k=K(m,"buttons",7),b=K(m,"cancelIndex",7,0),J=K(m,"onSelect",7);function j(r){D(!1),J()?.(r)}var vt={get open(){return D()},set open(r=!1){D(r),V()},get static(){return H()},set static(r=!1){H(r),V()},get title(){return st()},set title(r){st(r),V()},get message(){return _()},set message(r){_(r),V()},get buttons(){return k()},set buttons(r){k(r),V()},get cancelIndex(){return b()},set cancelIndex(r=0){b(r),V()},get onSelect(){return J()},set onSelect(r){J(r),V()},$set:Jt,$on:(r,M)=>Nt(m,r,M)};return Ue(it,{get static(){return H()},role:"alertdialog",get title(){return st()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>j(k().length-1),onCancel:()=>j(b()),get open(){return D()},set open(M){D(M)},footer:M=>{var T=Se(),w=yt(T);Ae(w,17,k,Pe,(N,Q,R)=>{{let X=g(()=>R===b()?"ghost":R===k().length-1?"primary":"outline");z(N,{get variant(){return t(X)},onclick:()=>j(R),children:(ct,pt)=>{h();var ut=x();s(()=>o(ut,t(Q))),n(ct,ut)},$$slots:{default:!0}})}}),n(M,T)},children:(M,T)=>{var w=Je(),N=yt(w);Te(N,()=>Fe,(X,ct)=>{ct(X,{class:"sr-only",children:(pt,ut)=>{h();var _t=x();s(()=>o(_t,_())),n(pt,_t)},$$slots:{default:!0}})});var Q=l(N,2),R=B(Q,!0);s(()=>o(R,_())),n(M,w)},$$slots:{footer:!0,default:!0}}),Xt(vt)}var Qe=I('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Xe=I('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),ta=I('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),ea=I('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),aa=I('<p class="text-xs text-danger" role="alert"> </p>'),na=I('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),ra=I('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),sa=I('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),oa=I('<p class="text-sm text-subtle" role="status"> </p>'),la=I('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),ia=I('<p class="text-sm text-danger" role="alert"> </p>'),ca=I('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function ua(it,m){const D=we();if(new.target)return Zt({component:ua,...it});Qt(m,!0);const H=()=>Z(ct,"$storedInstance$",r),st=()=>Z(ee,"$deviceGrantSupported$",r),_=()=>Z(ne,"$instanceSetupSupported$",r),k=()=>Z(pt,"$isAuthenticating$",r),b=()=>Z(ut,"$isCancelling$",r),J=()=>Z(te,"$deviceFlow$",r),j=()=>Z(_t,"$cancelOutcome$",r),vt=()=>Z(ae,"$error$",r),[r,M]=Ie();let T=K(m,"compact",7,!1),w=K(m,"onCancel",7);const N=`${D}-host`,Q=`${D}-host-help`,R=`${D}-host-error`,X=`${D}-token`,ct=jt(),pt=Rt(),ut=Ve(),_t=je(),te=Yt(),ee=Re(),ae=Ye(),ne=Ze();let bt=kt(Ge(jt.select(q.state))),St=kt(!1),tt=kt(""),ft=kt(!1);const p=g(()=>Me(t(bt))),wt=g(()=>t(ft)||t(p)===H()&&st()===!1),Ct=g(()=>t(p)?qe(t(p)):null),re=g(()=>_()&&t(p)!==null&&t(tt).trim().length>0);Bt(()=>{const c=H();t(St)||W(bt,c,!0)}),Bt(()=>{_()||W(tt,"")}),Le(()=>{const c=()=>{const e=q.state;Rt.select(e)&&Yt.select(e)&&q.dispatch(Kt())};return window.addEventListener("focus",c),()=>window.removeEventListener("focus",c)});function Gt(){!_()||!t(p)||t(p)===H()||k()||b()||q.dispatch(He(t(p)))}function se(){W(St,!0),W(tt,"")}function Lt(){!_()||!t(p)||k()||b()||q.dispatch(We(t(p)))}function At(){const c=t(tt).trim();!_()||!c||!t(p)||k()||b()||(q.dispatch(Ke(t(p),c)),W(tt,""))}function Pt(){!_()||b()||(k()&&q.dispatch(Vt()),W(ft,!0))}function oe(){W(ft,!1)}function le(){b()||q.dispatch(Vt())}function ie(){t(Ct)&&Oe(t(Ct),{})}function ce(c){c.key==="Enter"&&(c.preventDefault(),Gt(),t(wt)?document.getElementById(X)?.focus():Lt())}function ue(c){c.key==="Enter"&&(c.preventDefault(),At())}const zt=g(()=>T()?"sm":"xl"),gt=g(()=>T()?"sm":"default");var de={get compact(){return T()},set compact(c=!1){T(c),V()},get onCancel(){return w()},set onCancel(c){w(c),V()},$set:Jt,$on:(c,e)=>Nt(m,c,e)},$t=ca();{const c=e=>{z(e,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return b()},onclick:le,children:(a,u)=>{h();var f=x();s(G=>o(f,G),[()=>b()?i.lib_gitlabConnect_cancelling_label():i.lib_gitlabConnect_cancel_label()]),n(a,f)},$$slots:{default:!0}})};var Dt=E($t);{var ve=e=>{var a=Qe(),u=B(a,!0);s(f=>o(u,f),[()=>i.lib_gitlabConnect_updateRequired_description()]),n(e,a)};P(Dt,e=>{_()||e(ve)})}var Tt=l(Dt,2);{var pe=e=>{var a=Xe(),u=B(a,!0);s(()=>o(u,H())),n(e,a)};P(Tt,e=>{(k()||b())&&e(pe)})}var Ft=l(Tt,2);{var _e=e=>{var a=ta(),u=E(a);{let at=g(()=>i.lib_gitlabConnect_openGitlab_label());Ee(u,{get userCode(){return J().userCode},get verificationUri(){return J().verificationUri},get openLabel(){return t(at)},get compact(){return T()}})}var f=l(u,2),G=E(f);Ht(G,{size:16,class:"shrink-0"});var S=l(G,2),ot=B(S,!0),et=l(S,2);{let at=g(()=>b()||!_());z(et,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(at)},onclick:Pt,children:(It,Et)=>{h();var d=x();s($=>o(d,$),[()=>i.lib_gitlabConnect_useToken_label()]),n(It,d)},$$slots:{default:!0}})}var dt=l(et,2);c(dt),O(f),O(a),s(at=>o(ot,at),[()=>i.lib_gitlabConnect_waitingForAuthorization_label()]),n(e,a)},be=e=>{var a=ea(),u=E(a);Ht(u,{size:16,class:"shrink-0"});var f=l(u,2),G=B(f,!0),S=l(f,2);c(S),O(a),s(ot=>o(G,ot),[()=>i.lib_gitlabConnect_connecting_label()]),n(e,a)},fe=e=>{var a=sa(),u=yt(a),f=E(u);qt(f,{get for(){return N},children:(d,$)=>{h();var y=x();s(L=>o(y,L),[()=>i.lib_gitlabConnect_host_label()]),n(d,y)},$$slots:{default:!0}});var G=l(f,2);{let d=g(()=>!_()),$=g(()=>!t(p)||void 0),y=g(()=>t(p)?Q:`${Q} ${R}`);Wt(G,{get id(){return N},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(d)},get"aria-invalid"(){return t($)},get"aria-describedby"(){return t(y)},get placeholder(){return Be},oninput:se,onchange:Gt,onkeydown:ce,get value(){return t(bt)},set value(L){W(bt,L,!0)}})}var S=l(G,2),ot=B(S,!0),et=l(S,2);{var dt=d=>{var $=aa(),y=B($,!0);s(L=>{Mt($,"id",R),o(y,L)},[()=>i.lib_gitlabConnect_invalidInstance_error()]),n(d,$)};P(et,d=>{t(p)||d(dt)})}O(u);var at=l(u,2);{var It=d=>{var $=na(),y=yt($),L=E(y);qt(L,{get for(){return X},children:(v,U)=>{h();var lt=x();s(C=>o(lt,C),[()=>i.lib_gitlabConnect_token_label()]),n(v,lt)},$$slots:{default:!0}});var mt=l(L,2);{let v=g(()=>!_());Wt(mt,{get id(){return X},type:"password",autocomplete:"off",get disabled(){return t(v)},placeholder:"glpat-...",onkeydown:ue,get value(){return t(tt)},set value(U){W(tt,U,!0)}})}var ht=l(mt,2),F=E(ht),nt=l(F);{var xt=v=>{z(v,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:ie,children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_createToken_label({host:t(p)})]),n(U,C)},$$slots:{default:!0}})};P(nt,v=>{t(Ct)&&t(p)&&v(xt)})}O(ht),O(y);var A=l(y,2),Y=E(A);{let v=g(()=>!t(re));z(Y,{variant:"primary",get size(){return t(zt)},type:"button",onclick:At,get disabled(){return t(v)},children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_connect_label()]),n(U,C)},$$slots:{default:!0}})}var Ot=l(Y,2);{var ke=v=>{z(v,{variant:"ghost",get size(){return t(gt)},type:"button",onclick:oe,children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_useDevice_label()]),n(U,C)},$$slots:{default:!0}})};P(Ot,v=>{t(ft)&&!(t(p)===H()&&st()===!1)&&v(ke)})}var ye=l(Ot,2);{var Ce=v=>{z(v,{variant:"ghost",get size(){return t(gt)},type:"button",get onclick(){return w()},children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_cancel_label()]),n(U,C)},$$slots:{default:!0}})};P(ye,v=>{w()&&v(Ce)})}O(A),s(v=>o(F,`${v??""} `),[()=>i.lib_gitlabConnect_token_description()]),n(d,$)},Et=d=>{var $=ra(),y=E($);{let F=g(()=>!t(p)||!_());z(y,{variant:"primary",get size(){return t(zt)},type:"button",onclick:Lt,get disabled(){return t(F)},children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_connect_label()]),n(nt,A)},$$slots:{default:!0}})}var L=l(y,2);{let F=g(()=>!_());z(L,{variant:"ghost",get size(){return t(gt)},type:"button",get disabled(){return t(F)},onclick:Pt,children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_useToken_label()]),n(nt,A)},$$slots:{default:!0}})}var mt=l(L,2);{var ht=F=>{z(F,{variant:"ghost",get size(){return t(gt)},type:"button",get onclick(){return w()},children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_cancel_label()]),n(nt,A)},$$slots:{default:!0}})};P(mt,F=>{w()&&F(ht)})}O($),n(d,$)};P(at,d=>{t(wt)?d(It):d(Et,-1)})}s(d=>{Mt(S,"id",Q),o(ot,d)},[()=>i.lib_gitlabConnect_host_description()]),n(e,a)};P(Ft,e=>{(k()||b())&&J()?e(_e):k()||b()?e(be,1):e(fe,-1)})}var Ut=l(Ft,2);{var ge=e=>{var a=oa(),u=B(a,!0);s(f=>o(u,f),[()=>i.lib_gitlabConnect_cancelled_label()]),n(e,a)},$e=e=>{var a=la(),u=E(a),f=B(u,!0),G=l(u,2);z(G,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return b()},onclick:()=>q.dispatch(Kt()),children:(S,ot)=>{h();var et=x();s(dt=>o(et,dt),[()=>i.lib_gitlabConnect_checkStatus_label()]),n(S,et)},$$slots:{default:!0}}),O(a),s(S=>o(f,S),[()=>j()==="already-started"?i.lib_gitlabConnect_alreadyStarted_description():i.lib_gitlabConnect_cancelFailed_description()]),n(e,a)};P(Ut,e=>{j()==="cancelled"?e(ge):(j()==="already-started"||j()==="failed")&&e($e,1)})}var me=l(Ut,2);{var he=e=>{var a=ia(),u=B(a,!0);s(()=>o(u,vt())),n(e,a)};P(me,e=>{vt()&&e(he)})}O($t)}s(()=>ze($t,1,De(T()?"space-y-2":"space-y-4"))),n(it,$t);var xe=Xt(de);return M(),xe}export{ua as G,Ne as M};
|
|
1
|
+
import{t as Zt,br as K,bz as Jt,b as Nt,a_ as P,bv as Z,bt as Ie,bp as i}from"./CGWRZzdk.js";import{bs as Qt,ay as yt,be as h,b$ as x,b_ as s,bO as o,W as n,bS as l,bl as B,bn as Xt,aA as V,a7 as Se,aD as t,c9 as g,aB as I,bo as we,bV as kt,br as Ge,ca as Bt,bH as W,bk as Le,a5 as E,bA as O}from"./DYhIMPy1.js";import{n as Ae,p as Pe,v as ze,j as De,I as Ht,u as Mt}from"./BjnZ1Xf3.js";import{c as Te}from"./nmrokYzj.js";import{f as z}from"./KJX0Kw6L.js";import"./ClTZNeVO.js";import{b as Fe}from"./BjcX_fOv.js";import"./C-s9_soQ.js";import"./CzQCBVm9.js";import{b as Ue}from"./CWIcIgSm.js";import{I as Wt}from"./B461Cu-8.js";import{L as qt}from"./HLKPZgVy.js";import"./BEyWfhqM.js";import{G as Ee,x as Oe}from"./BdUSoBxL.js";import{Ix as q,fl as Kt,z as Be,eb as Vt,qv as He,tW as Me,Io as We,oc as qe,hz as Ke}from"./CicdOSYm.js";import{aY as jt,aZ as Rt,a_ as Ve,aT as je,aU as Yt,aV as Re,aW as Ye,b2 as Ze}from"./BrysY2Ec.js";var Je=I('<!> <p class="type-body"> </p>',1);function Ne(it,m){if(new.target)return Zt({component:Ne,...it});Qt(m,!0);let D=K(m,"open",15,!1),H=K(m,"static",7,!1),st=K(m,"title",7),_=K(m,"message",7),k=K(m,"buttons",7),b=K(m,"cancelIndex",7,0),J=K(m,"onSelect",7);function j(r){D(!1),J()?.(r)}var vt={get open(){return D()},set open(r=!1){D(r),V()},get static(){return H()},set static(r=!1){H(r),V()},get title(){return st()},set title(r){st(r),V()},get message(){return _()},set message(r){_(r),V()},get buttons(){return k()},set buttons(r){k(r),V()},get cancelIndex(){return b()},set cancelIndex(r=0){b(r),V()},get onSelect(){return J()},set onSelect(r){J(r),V()},$set:Jt,$on:(r,M)=>Nt(m,r,M)};return Ue(it,{get static(){return H()},role:"alertdialog",get title(){return st()},dismissOnInteractOutside:!1,focusContent:!0,onSubmit:()=>j(k().length-1),onCancel:()=>j(b()),get open(){return D()},set open(M){D(M)},footer:M=>{var T=Se(),w=yt(T);Ae(w,17,k,Pe,(N,Q,R)=>{{let X=g(()=>R===b()?"ghost":R===k().length-1?"primary":"outline");z(N,{get variant(){return t(X)},onclick:()=>j(R),children:(ct,pt)=>{h();var ut=x();s(()=>o(ut,t(Q))),n(ct,ut)},$$slots:{default:!0}})}}),n(M,T)},children:(M,T)=>{var w=Je(),N=yt(w);Te(N,()=>Fe,(X,ct)=>{ct(X,{class:"sr-only",children:(pt,ut)=>{h();var _t=x();s(()=>o(_t,_())),n(pt,_t)},$$slots:{default:!0}})});var Q=l(N,2),R=B(Q,!0);s(()=>o(R,_())),n(M,w)},$$slots:{footer:!0,default:!0}}),Xt(vt)}var Qe=I('<p class="text-sm text-subtle" role="status" data-testid="gitlab-instance-update-required"> </p>'),Xe=I('<p class="break-all type-caption text-subtle" data-testid="gitlab-connect-instance"> </p>'),ta=I('<div class="max-w-sm space-y-3" data-testid="gitlab-connect-device-flow"><!> <div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!> <!></div></div>'),ea=I('<div class="flex flex-wrap items-center gap-2 text-subtle text-sm"><!> <span> </span> <!></div>'),aa=I('<p class="text-xs text-danger" role="alert"> </p>'),na=I('<div class="max-w-sm space-y-1" data-testid="gitlab-connect-token"><!> <!> <p class="text-xs text-subtle"> <!></p></div> <div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>',1),ra=I('<div class="flex flex-wrap items-center gap-2"><!> <!> <!></div>'),sa=I('<div class="max-w-sm space-y-1"><!> <!> <p class="text-xs text-subtle"> </p> <!></div> <!>',1),oa=I('<p class="text-sm text-subtle" role="status"> </p>'),la=I('<div class="space-y-1"><p class="text-sm text-subtle" role="status"> </p> <!></div>'),ia=I('<p class="text-sm text-danger" role="alert"> </p>'),ca=I('<div data-testid="gitlab-connect-form"><!> <!> <!> <!> <!></div>');function ua(it,m){const D=we();if(new.target)return Zt({component:ua,...it});Qt(m,!0);const H=()=>Z(ct,"$storedInstance$",r),st=()=>Z(ee,"$deviceGrantSupported$",r),_=()=>Z(ne,"$instanceSetupSupported$",r),k=()=>Z(pt,"$isAuthenticating$",r),b=()=>Z(ut,"$isCancelling$",r),J=()=>Z(te,"$deviceFlow$",r),j=()=>Z(_t,"$cancelOutcome$",r),vt=()=>Z(ae,"$error$",r),[r,M]=Ie();let T=K(m,"compact",7,!1),w=K(m,"onCancel",7);const N=`${D}-host`,Q=`${D}-host-help`,R=`${D}-host-error`,X=`${D}-token`,ct=jt(),pt=Rt(),ut=Ve(),_t=je(),te=Yt(),ee=Re(),ae=Ye(),ne=Ze();let bt=kt(Ge(jt.select(q.state))),St=kt(!1),tt=kt(""),ft=kt(!1);const p=g(()=>Me(t(bt))),wt=g(()=>t(ft)||t(p)===H()&&st()===!1),Ct=g(()=>t(p)?qe(t(p)):null),re=g(()=>_()&&t(p)!==null&&t(tt).trim().length>0);Bt(()=>{const c=H();t(St)||W(bt,c,!0)}),Bt(()=>{_()||W(tt,"")}),Le(()=>{const c=()=>{const e=q.state;Rt.select(e)&&Yt.select(e)&&q.dispatch(Kt())};return window.addEventListener("focus",c),()=>window.removeEventListener("focus",c)});function Gt(){!_()||!t(p)||t(p)===H()||k()||b()||q.dispatch(He(t(p)))}function se(){W(St,!0),W(tt,"")}function Lt(){!_()||!t(p)||k()||b()||q.dispatch(We(t(p)))}function At(){const c=t(tt).trim();!_()||!c||!t(p)||k()||b()||(q.dispatch(Ke(t(p),c)),W(tt,""))}function Pt(){!_()||b()||(k()&&q.dispatch(Vt()),W(ft,!0))}function oe(){W(ft,!1)}function le(){b()||q.dispatch(Vt())}function ie(){t(Ct)&&Oe(t(Ct),{})}function ce(c){c.key==="Enter"&&(c.preventDefault(),Gt(),t(wt)?document.getElementById(X)?.focus():Lt())}function ue(c){c.key==="Enter"&&(c.preventDefault(),At())}const zt=g(()=>T()?"sm":"xl"),gt=g(()=>T()?"sm":"default");var de={get compact(){return T()},set compact(c=!1){T(c),V()},get onCancel(){return w()},set onCancel(c){w(c),V()},$set:Jt,$on:(c,e)=>Nt(m,c,e)},$t=ca();{const c=e=>{z(e,{variant:"ghost",size:"sm",type:"button",class:"text-muted-foreground hover:text-foreground",get disabled(){return b()},onclick:le,children:(a,u)=>{h();var f=x();s(G=>o(f,G),[()=>b()?i.lib_gitlabConnect_cancelling_label():i.lib_gitlabConnect_cancel_label()]),n(a,f)},$$slots:{default:!0}})};var Dt=E($t);{var ve=e=>{var a=Qe(),u=B(a,!0);s(f=>o(u,f),[()=>i.lib_gitlabConnect_updateRequired_description()]),n(e,a)};P(Dt,e=>{_()||e(ve)})}var Tt=l(Dt,2);{var pe=e=>{var a=Xe(),u=B(a,!0);s(()=>o(u,H())),n(e,a)};P(Tt,e=>{(k()||b())&&e(pe)})}var Ft=l(Tt,2);{var _e=e=>{var a=ta(),u=E(a);{let at=g(()=>i.lib_gitlabConnect_openGitlab_label());Ee(u,{get userCode(){return J().userCode},get verificationUri(){return J().verificationUri},get openLabel(){return t(at)},get compact(){return T()}})}var f=l(u,2),G=E(f);Ht(G,{size:16,class:"shrink-0"});var S=l(G,2),ot=B(S,!0),et=l(S,2);{let at=g(()=>b()||!_());z(et,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return t(at)},onclick:Pt,children:(It,Et)=>{h();var d=x();s($=>o(d,$),[()=>i.lib_gitlabConnect_useToken_label()]),n(It,d)},$$slots:{default:!0}})}var dt=l(et,2);c(dt),O(f),O(a),s(at=>o(ot,at),[()=>i.lib_gitlabConnect_waitingForAuthorization_label()]),n(e,a)},be=e=>{var a=ea(),u=E(a);Ht(u,{size:16,class:"shrink-0"});var f=l(u,2),G=B(f,!0),S=l(f,2);c(S),O(a),s(ot=>o(G,ot),[()=>i.lib_gitlabConnect_connecting_label()]),n(e,a)},fe=e=>{var a=sa(),u=yt(a),f=E(u);qt(f,{get for(){return N},children:(d,$)=>{h();var y=x();s(L=>o(y,L),[()=>i.lib_gitlabConnect_host_label()]),n(d,y)},$$slots:{default:!0}});var G=l(f,2);{let d=g(()=>!_()),$=g(()=>!t(p)||void 0),y=g(()=>t(p)?Q:`${Q} ${R}`);Wt(G,{get id(){return N},type:"text",autocomplete:"url",spellcheck:!1,get disabled(){return t(d)},get"aria-invalid"(){return t($)},get"aria-describedby"(){return t(y)},get placeholder(){return Be},oninput:se,onchange:Gt,onkeydown:ce,get value(){return t(bt)},set value(L){W(bt,L,!0)}})}var S=l(G,2),ot=B(S,!0),et=l(S,2);{var dt=d=>{var $=aa(),y=B($,!0);s(L=>{Mt($,"id",R),o(y,L)},[()=>i.lib_gitlabConnect_invalidInstance_error()]),n(d,$)};P(et,d=>{t(p)||d(dt)})}O(u);var at=l(u,2);{var It=d=>{var $=na(),y=yt($),L=E(y);qt(L,{get for(){return X},children:(v,U)=>{h();var lt=x();s(C=>o(lt,C),[()=>i.lib_gitlabConnect_token_label()]),n(v,lt)},$$slots:{default:!0}});var mt=l(L,2);{let v=g(()=>!_());Wt(mt,{get id(){return X},type:"password",autocomplete:"off",get disabled(){return t(v)},placeholder:"glpat-...",onkeydown:ue,get value(){return t(tt)},set value(U){W(tt,U,!0)}})}var ht=l(mt,2),F=E(ht),nt=l(F);{var xt=v=>{z(v,{variant:"link",size:"sm",type:"button",class:"h-auto px-0 text-xs",onclick:ie,children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_createToken_label({host:t(p)})]),n(U,C)},$$slots:{default:!0}})};P(nt,v=>{t(Ct)&&t(p)&&v(xt)})}O(ht),O(y);var A=l(y,2),Y=E(A);{let v=g(()=>!t(re));z(Y,{variant:"primary",get size(){return t(zt)},type:"button",onclick:At,get disabled(){return t(v)},children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_connect_label()]),n(U,C)},$$slots:{default:!0}})}var Ot=l(Y,2);{var ke=v=>{z(v,{variant:"ghost",get size(){return t(gt)},type:"button",onclick:oe,children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_useDevice_label()]),n(U,C)},$$slots:{default:!0}})};P(Ot,v=>{t(ft)&&!(t(p)===H()&&st()===!1)&&v(ke)})}var ye=l(Ot,2);{var Ce=v=>{z(v,{variant:"ghost",get size(){return t(gt)},type:"button",get onclick(){return w()},children:(U,lt)=>{h();var C=x();s(rt=>o(C,rt),[()=>i.lib_gitlabConnect_cancel_label()]),n(U,C)},$$slots:{default:!0}})};P(ye,v=>{w()&&v(Ce)})}O(A),s(v=>o(F,`${v??""} `),[()=>i.lib_gitlabConnect_token_description()]),n(d,$)},Et=d=>{var $=ra(),y=E($);{let F=g(()=>!t(p)||!_());z(y,{variant:"primary",get size(){return t(zt)},type:"button",onclick:Lt,get disabled(){return t(F)},children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_connect_label()]),n(nt,A)},$$slots:{default:!0}})}var L=l(y,2);{let F=g(()=>!_());z(L,{variant:"ghost",get size(){return t(gt)},type:"button",get disabled(){return t(F)},onclick:Pt,children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_useToken_label()]),n(nt,A)},$$slots:{default:!0}})}var mt=l(L,2);{var ht=F=>{z(F,{variant:"ghost",get size(){return t(gt)},type:"button",get onclick(){return w()},children:(nt,xt)=>{h();var A=x();s(Y=>o(A,Y),[()=>i.lib_gitlabConnect_cancel_label()]),n(nt,A)},$$slots:{default:!0}})};P(mt,F=>{w()&&F(ht)})}O($),n(d,$)};P(at,d=>{t(wt)?d(It):d(Et,-1)})}s(d=>{Mt(S,"id",Q),o(ot,d)},[()=>i.lib_gitlabConnect_host_description()]),n(e,a)};P(Ft,e=>{(k()||b())&&J()?e(_e):k()||b()?e(be,1):e(fe,-1)})}var Ut=l(Ft,2);{var ge=e=>{var a=oa(),u=B(a,!0);s(f=>o(u,f),[()=>i.lib_gitlabConnect_cancelled_label()]),n(e,a)},$e=e=>{var a=la(),u=E(a),f=B(u,!0),G=l(u,2);z(G,{variant:"link",size:"sm",type:"button",class:"px-0",get disabled(){return b()},onclick:()=>q.dispatch(Kt()),children:(S,ot)=>{h();var et=x();s(dt=>o(et,dt),[()=>i.lib_gitlabConnect_checkStatus_label()]),n(S,et)},$$slots:{default:!0}}),O(a),s(S=>o(f,S),[()=>j()==="already-started"?i.lib_gitlabConnect_alreadyStarted_description():i.lib_gitlabConnect_cancelFailed_description()]),n(e,a)};P(Ut,e=>{j()==="cancelled"?e(ge):(j()==="already-started"||j()==="failed")&&e($e,1)})}var me=l(Ut,2);{var he=e=>{var a=ia(),u=B(a,!0);s(()=>o(u,vt())),n(e,a)};P(me,e=>{vt()&&e(he)})}O($t)}s(()=>ze($t,1,De(T()?"space-y-2":"space-y-4"))),n(it,$t);var xe=Xt(de);return M(),xe}export{ua as G,Ne as M};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as tt}from"./
|
|
1
|
+
import{p as tt}from"./DT4LiP7Y.js";import{U as et,aZ as at,V as rt,a_ as it,Y as nt,b0 as ot,b as l,ay as E,X as st,q as lt,aX as ct,aH as dt,d as I,B as gt,r as ht,aJ as pt,O as ft}from"./BdNiI0PS.js";import{p as ut}from"./DkvJR80T.js";import{o as mt}from"./CI-nVEa_.js";var vt=ft.pie,R={sections:new Map,showData:!1},b=R.sections,H=R.showData,St=structuredClone(vt),xt=l(()=>structuredClone(St),"getConfig"),wt=l(()=>{b=new Map,H=R.showData,ht()},"clear"),$t=l(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);b.has(t)||(b.set(t,a),E.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=l(()=>b,"getSections"),yt=l(t=>{H=t},"setShowData"),Dt=l(()=>H,"getShowData"),U={getConfig:xt,clear:wt,setDiagramTitle:ot,getDiagramTitle:nt,setAccTitle:it,getAccTitle:rt,setAccDescription:at,getAccDescription:et,addSection:$t,getSections:Ct,setShowData:yt,getShowData:Dt},bt=l((t,a)=>{tt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),Tt={parse:l(async t=>{const a=await ut("pie",t);E.debug(a),bt(a,U)},"parse")},At=l(t=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${t.pieStrokeColor};
|
|
4
4
|
stroke-width : ${t.pieStrokeWidth};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ie}from"./
|
|
1
|
+
import{g as ie}from"./D61HjMue.js";import{s as re}from"./BXbF11Gp.js";import{b as p,ay as b,X as $,a1 as ae,aP as ne,bh as oe,V as le,a_ as ce,U as he,aZ as de,b0 as ue,Y as fe,T as pe,z as j,r as Se,aW as vt,am as ge,aU as ye,ab as me,aG as Te}from"./BdNiI0PS.js";import{c as Ee}from"./9cPLPH_O.js";import{aP as _e}from"./CTXbgIPd.js";var At=(function(){var t=p(function(V,o,f,n){for(f=f||{},n=V.length;n--;f[V[n]]=o);return f},"o"),e=[1,2],s=[1,3],a=[1,4],r=[2,4],c=[1,9],h=[1,11],u=[1,16],l=[1,17],m=[1,18],y=[1,19],_=[1,33],L=[1,20],R=[1,21],D=[1,22],S=[1,23],w=[1,24],C=[1,26],F=[1,27],I=[1,28],P=[1,29],v=[1,30],z=[1,31],at=[1,32],nt=[1,35],ot=[1,36],lt=[1,37],ct=[1,38],K=[1,34],g=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ht=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],It=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:p(function(o,f,n,T,E,i,B){var d=i.length-1;switch(E){case 3:return T.setRootDoc(i[d]),i[d];case 4:this.$=[];break;case 5:i[d]!="nl"&&(i[d-1].push(i[d]),this.$=i[d-1]);break;case 6:case 7:this.$=i[d];break;case 8:this.$="nl";break;case 12:this.$=i[d];break;case 13:const Q=i[d-1];Q.description=T.trimColon(i[d]),this.$=Q;break;case 14:this.$={stmt:"relation",state1:i[d-2],state2:i[d]};break;case 15:const Tt=T.trimColon(i[d]);this.$={stmt:"relation",state1:i[d-3],state2:i[d-1],description:Tt};break;case 19:this.$={stmt:"state",id:i[d-3],type:"default",description:"",doc:i[d-1]};break;case 20:var G=i[d],X=i[d-2].trim();if(i[d].match(":")){var ut=i[d].split(":");G=ut[0],X=[X,ut[1]]}this.$={stmt:"state",id:G,type:"default",description:X};break;case 21:this.$={stmt:"state",id:i[d-3],type:"default",description:i[d-5],doc:i[d-1]};break;case 22:this.$={stmt:"state",id:i[d],type:"fork"};break;case 23:this.$={stmt:"state",id:i[d],type:"join"};break;case 24:this.$={stmt:"state",id:i[d],type:"choice"};break;case 25:this.$={stmt:"state",id:T.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:i[d-1].trim(),note:{position:i[d-2].trim(),text:i[d].trim()}};break;case 29:this.$=i[d].trim(),T.setAccTitle(this.$);break;case 30:case 31:this.$=i[d].trim(),T.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:i[d-3],url:i[d-2],tooltip:i[d-1]};break;case 33:this.$={stmt:"click",id:i[d-3],url:i[d-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:i[d-1].trim(),classes:i[d].trim()};break;case 36:this.$={stmt:"style",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 37:this.$={stmt:"applyClass",id:i[d-1].trim(),styleClass:i[d].trim()};break;case 38:T.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:T.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:T.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:T.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:i[d].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:i[d-2].trim(),classes:[i[d].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:u,17:l,19:m,22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,7]),t(g,[2,8]),t(g,[2,9]),t(g,[2,10]),t(g,[2,11]),t(g,[2,12],{14:[1,40],15:[1,41]}),t(g,[2,16]),{18:[1,42]},t(g,[2,18],{20:[1,43]}),{23:[1,44]},t(g,[2,22]),t(g,[2,23]),t(g,[2,24]),t(g,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(g,[2,28]),{34:[1,49]},{36:[1,50]},t(g,[2,31]),{13:51,24:_,57:K},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ht,[2,44],{58:[1,56]}),t(ht,[2,45],{58:[1,57]}),t(g,[2,38]),t(g,[2,39]),t(g,[2,40]),t(g,[2,41]),t(g,[2,6]),t(g,[2,13]),{13:58,24:_,57:K},t(g,[2,17]),t(It,r,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(g,[2,29]),t(g,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(g,[2,14],{14:[1,71]}),{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,72],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(g,[2,34]),t(g,[2,35]),t(g,[2,36]),t(g,[2,37]),t(ht,[2,46]),t(ht,[2,47]),t(g,[2,15]),t(g,[2,19]),t(It,r,{7:78}),t(g,[2,26]),t(g,[2,27]),{5:[1,79]},{5:[1,80]},{4:c,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:u,17:l,19:m,21:[1,81],22:y,24:_,25:L,26:R,27:D,28:S,29:w,32:25,33:C,35:F,37:I,38:P,41:v,45:z,48:at,51:nt,52:ot,53:lt,54:ct,57:K},t(g,[2,32]),t(g,[2,33]),t(g,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:p(function(o,f){if(f.recoverable)this.trace(o);else{var n=new Error(o);throw n.hash=f,n}},"parseError"),parse:p(function(o){var f=this,n=[0],T=[],E=[null],i=[],B=this.table,d="",G=0,X=0,ut=2,Q=1,Tt=i.slice.call(arguments,1),k=Object.create(this.lexer),W={yy:{}};for(var Et in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Et)&&(W.yy[Et]=this.yy[Et]);k.setInput(o,W.yy),W.yy.lexer=k,W.yy.parser=this,typeof k.yylloc>"u"&&(k.yylloc={});var _t=k.yylloc;i.push(_t);var ee=k.options&&k.options.ranges;typeof W.yy.parseError=="function"?this.parseError=W.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function se(N){n.length=n.length-2*N,E.length=E.length-N,i.length=i.length-N}p(se,"popStack");function Nt(){var N;return N=T.pop()||k.lex()||Q,typeof N!="number"&&(N instanceof Array&&(T=N,N=T.pop()),N=f.symbols_[N]||N),N}p(Nt,"lex");for(var x,U,O,bt,J={},ft,Y,Rt,pt;;){if(U=n[n.length-1],this.defaultActions[U]?O=this.defaultActions[U]:((x===null||typeof x>"u")&&(x=Nt()),O=B[U]&&B[U][x]),typeof O>"u"||!O.length||!O[0]){var kt="";pt=[];for(ft in B[U])this.terminals_[ft]&&ft>ut&&pt.push("'"+this.terminals_[ft]+"'");k.showPosition?kt="Parse error on line "+(G+1)+`:
|
|
2
2
|
`+k.showPosition()+`
|
|
3
3
|
Expecting `+pt.join(", ")+", got '"+(this.terminals_[x]||x)+"'":kt="Parse error on line "+(G+1)+": Unexpected "+(x==Q?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(kt,{text:k.match,token:this.terminals_[x]||x,line:k.yylineno,loc:_t,expected:pt})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+x);switch(O[0]){case 1:n.push(x),E.push(k.yytext),i.push(k.yylloc),n.push(O[1]),x=null,X=k.yyleng,d=k.yytext,G=k.yylineno,_t=k.yylloc;break;case 2:if(Y=this.productions_[O[1]][1],J.$=E[E.length-Y],J._$={first_line:i[i.length-(Y||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(Y||1)].first_column,last_column:i[i.length-1].last_column},ee&&(J._$.range=[i[i.length-(Y||1)].range[0],i[i.length-1].range[1]]),bt=this.performAction.apply(J,[d,X,G,W.yy,O[1],E,i].concat(Tt)),typeof bt<"u")return bt;Y&&(n=n.slice(0,-1*Y*2),E=E.slice(0,-1*Y),i=i.slice(0,-1*Y)),n.push(this.productions_[O[1]][0]),E.push(J.$),i.push(J._$),Rt=B[n[n.length-2]][n[n.length-1]],n.push(Rt);break;case 3:return!0}}return!0},"parse")},te=(function(){var V={EOF:1,parseError:p(function(f,n){if(this.yy.parser)this.yy.parser.parseError(f,n);else throw new Error(f)},"parseError"),setInput:p(function(o,f){return this.yy=f||this.yy||{},this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:p(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var f=o.match(/(?:\r\n?|\n).*/g);return f?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:p(function(o){var f=o.length,n=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-f),this.offset-=f;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===T.length?this.yylloc.first_column:0)+T[T.length-n.length].length-n[0].length:this.yylloc.first_column-f},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-f]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(o){this.unput(this.match.slice(o))},"less"),pastInput:p(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var o=this.pastInput(),f=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as z}from"./
|
|
1
|
+
import{p as z}from"./DT4LiP7Y.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./BdNiI0PS.js";import{p as I}from"./DkvJR80T.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as B,br as x,bz as H,b as U}from"./CGWRZzdk.js";import{bV as W,br as k,bH as A,aD as y,bs as J,ca as z,a5 as X,b_ as C,W as N,bS as K,a7 as Q,ay as Z,bA as $,bn as ee,c9 as te,at as ae,aA as _,aB as M,bI as re,aG as se}from"./DYhIMPy1.js";import{G as oe}from"./
|
|
1
|
+
import{t as B,br as x,bz as H,b as U}from"./CGWRZzdk.js";import{bV as W,br as k,bH as A,aD as y,bs as J,ca as z,a5 as X,b_ as C,W as N,bS as K,a7 as Q,ay as Z,bA as $,bn as ee,c9 as te,at as ae,aA as _,aB as M,bI as re,aG as se}from"./DYhIMPy1.js";import{G as oe}from"./DHP1DFPI.js";import{n as D,g as G,j as T,l as O,v as P,q as ne,s as ie}from"./BjnZ1Xf3.js";import{I as L,g as V,S}from"./BM1KP-FJ.js";import{bJ as F}from"./KJX0Kw6L.js";import{c as de}from"./B461Cu-8.js";function ce(r,a){const i=[...a].filter(t=>Number.isInteger(t)&&t>=0&&r[t]!==void 0).sort((t,o)=>t-o),u=[];for(const t of i){const o=u.at(-1);!o||t>o.endIndex+1?u.push({startIndex:t,endIndex:t}):t>o.endIndex&&(o.endIndex=t)}return u.map(({startIndex:t,endIndex:o})=>{let c=Number.POSITIVE_INFINITY,d=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=Number.NEGATIVE_INFINITY;for(let l=t;l<=o;l+=1){const n=r[l];n&&(c=Math.min(c,n.top),d=Math.min(d,n.left),g=Math.max(g,n.left+n.width),m=Math.max(m,n.top+n.height))}return{startIndex:t,endIndex:o,rect:{top:c,left:d,width:g-d,height:m-c}}})}function E(r,a){return Math.max(0,Math.min(r.endIndex,a.endIndex)-Math.max(r.startIndex,a.startIndex)+1)}function le(){let r=W(k([])),a=[],i=1;return{get groups(){return y(r)},update(u,t){const o=new Set,c=ce(u,t).map(d=>{const m=a.filter(l=>!o.has(l.id)&&E(l,d)>0).sort((l,n)=>E(n,d)-E(l,d)||l.id-n.id)[0]?.id??i++;return o.add(m),{id:m,...d}});a=c,A(r,c,!0)},reset(){a=[],A(r,[],!0),i=1}}}var ue=M('<div data-proximity-highlight="selected" style="border-radius: var(--radius-row)"></div>'),me=M('<div data-proximity-highlight="hover" style="border-radius: var(--radius-row)"></div>'),pe=M('<div aria-hidden="true"><!> <!></div>');function fe(r,a){if(new.target)return B({component:fe,...r});J(a,!0);let i=x(a,"store",7),u=x(a,"selectedIndexes",23,()=>[]),t=x(a,"selectedClass",7,"bg-selected"),o=x(a,"hoverClass",7,"bg-hover"),c=x(a,"class",7);const d=le(),g=te(()=>i().activeIndex===null?void 0:i().itemRects[i().activeIndex]);z(()=>{d.update(i().itemRects,u())});const m=(e,s)=>{const p=new S(s.rect.top,s.tier),f=new S(s.rect.left,s.tier),b=new S(s.rect.width,s.tier),v=new S(s.rect.height,s.tier),I=ae(()=>{z(()=>{e.style.transform=`translate3d(${f.current}px, ${p.current}px, 0)`,e.style.width=`${b.current}px`,e.style.height=`${v.current}px`})}),w=h=>{p.set(h.rect.top),f.set(h.rect.left),b.set(h.rect.width),v.set(h.rect.height)},q=ne(()=>ie()&&w(s));return{update(h){s=h,w(h)},destroy(){q(),I()}}};var l={get store(){return i()},set store(e){i(e),_()},get selectedIndexes(){return u()},set selectedIndexes(e=[]){u(e),_()},get selectedClass(){return t()},set selectedClass(e="bg-selected"){t(e),_()},get hoverClass(){return o()},set hoverClass(e="bg-hover"){o(e),_()},get class(){return c()},set class(e){c(e),_()},$set:H,$on:(e,s)=>U(a,e,s)},n=pe(),R=X(n);D(R,17,()=>d.groups,e=>e.id,(e,s)=>{var p=ue();G(p,(f,b)=>m?.(f,b),()=>({rect:y(s).rect,tier:"moderate"})),C(f=>P(p,1,f),[()=>T(O("absolute",t()))]),L(2,p,()=>V,()=>({tier:"moderate"})),N(e,p)});var j=K(R,2);return oe(j,()=>i().sessionId,e=>{var s=Q(),p=Z(s);D(p,17,()=>y(g)?[y(g)]:[],f=>0,(f,b)=>{var v=me();G(v,(I,w)=>m?.(I,w),()=>({rect:y(b),tier:"moderate"})),C(I=>P(v,1,I),[()=>T(O("absolute",o()))]),L(2,v,()=>V,()=>({tier:"fast"})),N(f,v)}),N(e,s)}),$(n),C(e=>P(n,1,e),[()=>T(O("pointer-events-none absolute inset-0",c()))]),N(r,n),ee(l)}const Ne=F({base:`${de} menu-row group/menu-item relative z-10 flex w-full min-w-0 cursor-default select-none items-start gap-2.5 border-none bg-transparent px-2.5 py-1.5 transition-colors duration-spring-fast ease-spring-fast focus:text-foreground focus-visible:outline-none data-[menu-item]:font-medium data-[disabled]:pointer-events-none data-[disabled]:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none`,variants:{inset:{true:"pl-8"}}}),Se=F({base:"menu-overlay type-caption relative isolate z-(--layer-popover) overflow-hidden rounded-(--radius-medium) border border-border bg-popover shadow-(--elevation-overlay) [--menu-icon-size:calc(var(--space-3)+var(--space-1)/2)] [--radius-row:calc(var(--radius-small)-var(--space-1)/2)] focus-visible:border-input focus-visible:outline focus-visible:-outline-offset-1 data-[side=bottom]:origin-top data-[side=top]:origin-bottom data-[side=left]:origin-right data-[side=right]:origin-left data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-spring-moderate data-[state=open]:ease-spring-moderate data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-spring-moderate-exit data-[state=closed]:ease-spring-exit motion-reduce:animate-none motion-reduce:transition-none"}),Ce="text-shortcut-foreground",Te=-5,Oe={enter:{tier:"moderate",y:4,scale:.95},exit:{tier:"moderate"}},Y=Symbol("dialog-portal-target");function Pe(r){re(Y,r)}function Ee(){const r=se(Y);return()=>r?.()??void 0}const ge=["[data-bits-floating-content-wrapper]",'[role="combobox"][aria-expanded="true"]','[aria-haspopup]:not([aria-haspopup="false"])[aria-expanded="true"]'].join(", ");function Me(r,a){return r?.querySelector(":scope > [data-bits-floating-content-wrapper]")?!0:a.target instanceof Element&&a.target.closest(ge)!==null}export{fe as P,Ne as a,Se as b,Oe as c,Te as d,Me as e,Ce as m,Pe as p,Ee as u};
|