@intent-hq/web 2.391.1 → 2.392.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{gQ8VFuWN.js → 0TbppU-W.js} +2 -2
- package/web/app/immutable/chunks/{B2awO10u.js → 2OP7IVCM.js} +1 -1
- package/web/app/immutable/chunks/{BZ27qIg1.js → 2z64ELW5.js} +1 -1
- package/web/app/immutable/chunks/{Cr9C4VDu.js → 3rqOYBi3.js} +1 -1
- package/web/app/immutable/chunks/{z0xDttNV.js → 50HYkjWD.js} +3 -3
- package/web/app/immutable/chunks/{DLqZuVvj.js → 52kdRKiP.js} +1 -1
- package/web/app/immutable/chunks/{Dh1j4V0b.js → 7zxUzaYz.js} +1 -1
- package/web/app/immutable/chunks/{Drn9m8Tp.js → 9AKr1UyY.js} +1 -1
- package/web/app/immutable/chunks/{DXCHCOFX.js → 9ryMZ44V.js} +1 -1
- package/web/app/immutable/chunks/{B7hGbqIM.js → AlO3r9jV.js} +1 -1
- package/web/app/immutable/chunks/{CVtLV3_x.js → B0SSzYpD.js} +1 -1
- package/web/app/immutable/chunks/{DuZtgB5V.js → B0oQ37UY.js} +1 -1
- package/web/app/immutable/chunks/{9eqoPT_C.js → B2-ooCTr.js} +1 -1
- package/web/app/immutable/chunks/{C1MYTxgW.js → B2frqTj8.js} +1 -1
- package/web/app/immutable/chunks/{CedswVQA.js → B36ccT8S.js} +1 -1
- package/web/app/immutable/chunks/{g5QqP-QE.js → B6Qz5J1y.js} +1 -1
- package/web/app/immutable/chunks/{DHvVAxAW.js → B6wkNYPs.js} +1 -1
- package/web/app/immutable/chunks/{DG3-me8H.js → B8m3-qrW.js} +1 -1
- package/web/app/immutable/chunks/{YQwkPi_0.js → B97l6Xkk.js} +1 -1
- package/web/app/immutable/chunks/{Cp-4w4r1.js → B9NjB9vD.js} +1 -1
- package/web/app/immutable/chunks/{DPk2fLxi.js → B9R2bql6.js} +1 -1
- package/web/app/immutable/chunks/{Cr5mKkdD.js → B9ZgGXDm.js} +1 -1
- package/web/app/immutable/chunks/{CT8vPg_p.js → BAtAwQ72.js} +2 -2
- package/web/app/immutable/chunks/{D5Jk5CWk.js → BB5TUToP.js} +2 -2
- package/web/app/immutable/chunks/{DGU9U1O6.js → BBfR26V0.js} +1 -1
- package/web/app/immutable/chunks/{C4l6men1.js → BCw-LKCu.js} +1 -1
- package/web/app/immutable/chunks/{WYNXUtt9.js → BDQvAsU6.js} +1 -1
- package/web/app/immutable/chunks/{DDvFH8QS.js → BDRM-DVo.js} +1 -1
- package/web/app/immutable/chunks/{D9T_0Eev.js → BE3g5vcj.js} +3 -3
- package/web/app/immutable/chunks/{KWtYfwVq.js → BE4DZU9i.js} +1 -1
- package/web/app/immutable/chunks/{C3JJkOFb.js → BEGGqaof.js} +1 -1
- package/web/app/immutable/chunks/{CyvzL5p8.js → BFO-Le8U.js} +3 -3
- package/web/app/immutable/chunks/BGSmaq6H.js +1 -0
- package/web/app/immutable/chunks/{K0WiFC8Y.js → BJEFEyAm.js} +1 -1
- package/web/app/immutable/chunks/{CEyWnfg4.js → BJIUXUAo.js} +1 -1
- package/web/app/immutable/chunks/{B_JGVEqN.js → BKGQPtRi.js} +1 -1
- package/web/app/immutable/chunks/BPFSAjsd.js +411 -0
- package/web/app/immutable/chunks/{CV17KbhT.js → BQ5x_RaT.js} +1 -1
- package/web/app/immutable/chunks/{B26ZHg3s.js → BRCr02in.js} +1 -1
- package/web/app/immutable/chunks/{CHIxjTWu.js → BS1zON0P.js} +1 -1
- package/web/app/immutable/chunks/{kkKMJ9w9.js → BS5e_kKu.js} +1 -1
- package/web/app/immutable/chunks/{CpwS8V1F.js → BS9LmSp_.js} +1 -1
- package/web/app/immutable/chunks/{CwqJ7uz4.js → BSMi55yC.js} +1 -1
- package/web/app/immutable/chunks/{BBcnUEuQ.js → BSpgPPjp.js} +1 -1
- package/web/app/immutable/chunks/{6JlgfFWd.js → BT6sDnDt.js} +1 -1
- package/web/app/immutable/chunks/{BmaG8vdR.js → BTE0066U.js} +1 -1
- package/web/app/immutable/chunks/{BRScUzfU.js → BUF0WvAS.js} +1 -1
- package/web/app/immutable/chunks/{CUgl7USU.js → BUPWY1pO.js} +1 -1
- package/web/app/immutable/chunks/{Cnkux63v.js → BVBh582U.js} +1 -1
- package/web/app/immutable/chunks/{BSKVcPN7.js → BVhnyyZ7.js} +1 -1
- package/web/app/immutable/chunks/{CH6Im5iM.js → BYfDvU8j.js} +1 -1
- package/web/app/immutable/chunks/{Ci6PI5sn.js → Bc4EBjSN.js} +1 -1
- package/web/app/immutable/chunks/{CiHhUIjb.js → BdWMbiFk.js} +1 -1
- package/web/app/immutable/chunks/{7-WRRruG.js → BdlwjSpf.js} +1 -1
- package/web/app/immutable/chunks/{D9R5fzn8.js → Beq_QLuz.js} +1 -1
- package/web/app/immutable/chunks/{B2Ny2uiy.js → Bh3yfjRP.js} +1 -1
- package/web/app/immutable/chunks/{DynUeYUu.js → BhYXv0ZM.js} +1 -1
- package/web/app/immutable/chunks/{D3pRyooW.js → Bhul7r_Y.js} +1 -1
- package/web/app/immutable/chunks/{OsJD3pkm.js → Bky3Gaqa.js} +1 -1
- package/web/app/immutable/chunks/{B5-Plsom.js → BlVpCoL1.js} +1 -1
- package/web/app/immutable/chunks/{CwCvyVGi.js → BmqZzhgO.js} +1 -1
- package/web/app/immutable/chunks/{Chbrtg19.js → BnnKw3Va.js} +1 -1
- package/web/app/immutable/chunks/{DmQ5G_6J.js → Bo0PodRV.js} +1 -1
- package/web/app/immutable/chunks/{Cxc8q3rR.js → BonA_mfc.js} +1 -1
- package/web/app/immutable/chunks/{BuyrOC4V.js → Bp6DusVC.js} +1 -1
- package/web/app/immutable/chunks/{DIIj7EWA.js → BpFxCD0b.js} +1 -1
- package/web/app/immutable/chunks/{DqtLBCnq.js → BqRQBnTW.js} +1 -1
- package/web/app/immutable/chunks/{JvFe2B29.js → BuM8LV7z.js} +1 -1
- package/web/app/immutable/chunks/{BM39k1x6.js → BusD2v6a.js} +1 -1
- package/web/app/immutable/chunks/{DF15jnSX.js → BvByaKKp.js} +1 -1
- package/web/app/immutable/chunks/{z4O7yNZ6.js → BvvIG-FE.js} +1 -1
- package/web/app/immutable/chunks/{Bhyo7hBL.js → Bvwrya09.js} +1 -1
- package/web/app/immutable/chunks/{RV6uszBL.js → Bw-Zu1Zf.js} +1 -1
- package/web/app/immutable/chunks/{Dl1AOLZu.js → BwFe8eI9.js} +1 -1
- package/web/app/immutable/chunks/{Dr6-g-BO.js → Bwa2n5jC.js} +1 -1
- package/web/app/immutable/chunks/{QzxpbvSo.js → BwweojP5.js} +1 -1
- package/web/app/immutable/chunks/{CnDgS0vt.js → ByaJIEgQ.js} +1 -1
- package/web/app/immutable/chunks/{BZCcX8wj.js → ByvcSsIj.js} +2 -2
- package/web/app/immutable/chunks/{Bz80vYvX.js → BzXQ5SMs.js} +1 -1
- package/web/app/immutable/chunks/{CPnqf2bo.js → C13CRqsS.js} +1 -1
- package/web/app/immutable/chunks/{CAGrRNbp.js → C1SGWBXH.js} +1 -1
- package/web/app/immutable/chunks/{B4Yz29Q3.js → C2RnxEnO.js} +1 -1
- package/web/app/immutable/chunks/{DcraaizU.js → C3KgmGxd.js} +1 -1
- package/web/app/immutable/chunks/{Dd_KPYBw.js → C6Af0QaF.js} +1 -1
- package/web/app/immutable/chunks/{sFief-xo.js → C7MFACZg.js} +1 -1
- package/web/app/immutable/chunks/{DMEIbJII.js → C7b3vXLD.js} +1 -1
- package/web/app/immutable/chunks/{BMTanQ2Z.js → C8OXQeb2.js} +1 -1
- package/web/app/immutable/chunks/{Bb-kpHQF.js → C8PR5GO9.js} +1 -1
- package/web/app/immutable/chunks/C9DStJW1.js +1 -0
- package/web/app/immutable/chunks/{5az3n8fR.js → C9iwh4F-.js} +1 -1
- package/web/app/immutable/chunks/{CwOdvmTo.js → CA5vNvRD.js} +3 -3
- package/web/app/immutable/chunks/{CnFZbWXv.js → CA6H1-bp.js} +1 -1
- package/web/app/immutable/chunks/{B6m0Dypi.js → CBQrOO2t.js} +1 -1
- package/web/app/immutable/chunks/{Bhq56Jsu.js → CCAtqaSn.js} +1 -1
- package/web/app/immutable/chunks/{CREbzS7Z.js → CCSQmeuF.js} +1 -1
- package/web/app/immutable/chunks/{CCzPC_cB.js → CCyGGl6b.js} +1 -1
- package/web/app/immutable/chunks/{CoSEZL3s.js → CDcxODgf.js} +1 -1
- package/web/app/immutable/chunks/{CAUJiTuz.js → CDtaIFAl.js} +1 -1
- package/web/app/immutable/chunks/{Csqi0oV3.js → CEqrck_t.js} +1 -1
- package/web/app/immutable/chunks/{B2Q_FC4n.js → CGJ5yTzR.js} +3 -3
- package/web/app/immutable/chunks/{BkcCJyDK.js → CH7HNVC2.js} +1 -1
- package/web/app/immutable/chunks/{DLt9OoMP.js → CJItvMq2.js} +1 -1
- package/web/app/immutable/chunks/{By2YlE-l.js → CLX81MHV.js} +1 -1
- package/web/app/immutable/chunks/{BOPrepKH.js → COmspkQo.js} +1 -1
- package/web/app/immutable/chunks/{9qqz3Jr0.js → CPNOsHfj.js} +1 -1
- package/web/app/immutable/chunks/{CA-b7pAY.js → CPav-V5t.js} +2 -2
- package/web/app/immutable/chunks/{C5fxud9g.js → CPmXQBUf.js} +1 -1
- package/web/app/immutable/chunks/{BrL12o40.js → CQClkuxa.js} +1 -1
- package/web/app/immutable/chunks/{BQCtWEZ2.js → CRFyRwf-.js} +1 -1
- package/web/app/immutable/chunks/{CHUYHKuh.js → CRIoGx5T.js} +1 -1
- package/web/app/immutable/chunks/{CbB6SI0i.js → CRm25OCR.js} +1 -1
- package/web/app/immutable/chunks/{mFWmuyR-.js → CS6als-f.js} +1 -1
- package/web/app/immutable/chunks/{CfDqTHT1.js → CSzXeH2S.js} +1 -1
- package/web/app/immutable/chunks/{DHkcvVzr.js → CTkkv_Ih.js} +1 -1
- package/web/app/immutable/chunks/{DSs6r6NG.js → CUiYYsIq.js} +1 -1
- package/web/app/immutable/chunks/{DR_b4dt8.js → CUmvnJK5.js} +1 -1
- package/web/app/immutable/chunks/{DQpGArF7.js → CVx5OKWy.js} +1 -1
- package/web/app/immutable/chunks/{DISm8kek.js → CWS5g6aA.js} +1 -1
- package/web/app/immutable/chunks/{CGmYraIa.js → CWfjuhY2.js} +1 -1
- package/web/app/immutable/chunks/{CRXlvdEs.js → CWtyXmQ4.js} +1 -1
- package/web/app/immutable/chunks/{CWXVdpgZ.js → CXygwMkb.js} +1 -1
- package/web/app/immutable/chunks/{pXrAh3i2.js → CY56l_5k.js} +1 -1
- package/web/app/immutable/chunks/{B1lpukIv.js → CZfU7DE3.js} +1 -1
- package/web/app/immutable/chunks/{Ao0jjYj2.js → CbSZGuz9.js} +1 -1
- package/web/app/immutable/chunks/{DFKhOU69.js → Cc0763mU.js} +1 -1
- package/web/app/immutable/chunks/{DidHgSQp.js → CcBmcC9f.js} +2 -2
- package/web/app/immutable/chunks/{D59tCG3q.js → CcMCIG6E.js} +2 -2
- package/web/app/immutable/chunks/{qWgJ-CUF.js → CccfsETL.js} +2 -2
- package/web/app/immutable/chunks/{BDeGl6ee.js → CdLJ0-dH.js} +1 -1
- package/web/app/immutable/chunks/{-CpNnXIW.js → CdtwTpzR.js} +1 -1
- package/web/app/immutable/chunks/{DQNtbVVY.js → Cdw7QKyr.js} +3 -3
- package/web/app/immutable/chunks/{C9N7yhqm.js → Ce-va2I0.js} +1 -1
- package/web/app/immutable/chunks/{CK543FRe.js → CeHL-3WK.js} +1 -1
- package/web/app/immutable/chunks/{D5al-p9o.js → CewZlXwy.js} +1 -1
- package/web/app/immutable/chunks/{C22cBcHz.js → Ch9YoFhc.js} +1 -1
- package/web/app/immutable/chunks/{COofQgO0.js → ChHRVjww.js} +1 -1
- package/web/app/immutable/chunks/{D__sU8Ug.js → CiNmS1jZ.js} +1 -1
- package/web/app/immutable/chunks/{BlzuDW6O.js → CjrqEuvI.js} +1 -1
- package/web/app/immutable/chunks/{D49mWFig.js → CnPYlvZC.js} +1 -1
- package/web/app/immutable/chunks/{ByP-EusE.js → CngTEvgU.js} +1 -1
- package/web/app/immutable/chunks/{DeFlL2nh.js → CorT7tdR.js} +1 -1
- package/web/app/immutable/chunks/{9GL-RXJZ.js → Cp4SiU7R.js} +1 -1
- package/web/app/immutable/chunks/{DUTvR2si.js → CpK0xLH4.js} +1 -1
- package/web/app/immutable/chunks/CpT48V2z.js +1 -0
- package/web/app/immutable/chunks/{jyQWudgn.js → Cq97NFfR.js} +1 -1
- package/web/app/immutable/chunks/{BczcQRsN.js → CqRvL4xi.js} +1 -1
- package/web/app/immutable/chunks/{DvUsJK3H.js → Ct0fN4Lt.js} +1 -1
- package/web/app/immutable/chunks/{DJcR4XQR.js → CtzbB_EQ.js} +1 -1
- package/web/app/immutable/chunks/{CjpWOZGa.js → Cu9dGfYE.js} +1 -1
- package/web/app/immutable/chunks/{DJqiMUht.js → Cv-fAWZf.js} +1 -1
- package/web/app/immutable/chunks/{CU15H7o_.js → Cx394IAH.js} +1 -1
- package/web/app/immutable/chunks/{Bx1P9uW7.js → CxR-pcVt.js} +1 -1
- package/web/app/immutable/chunks/{CTgYTdXw.js → Cz3WzTlQ.js} +1 -1
- package/web/app/immutable/chunks/{23FyIn6O.js → CzK_7_Jd.js} +1 -1
- package/web/app/immutable/chunks/{BTXzEcFX.js → D-j7vD5Z.js} +1 -1
- package/web/app/immutable/chunks/{CAUle5iU.js → D0DIeAXH.js} +1 -1
- package/web/app/immutable/chunks/{CiKoEJ2m.js → D0qhIm1r.js} +1 -1
- package/web/app/immutable/chunks/{CeoBhFo7.js → D179JMBI.js} +1 -1
- package/web/app/immutable/chunks/{Cgz4dZpP.js → D5ocbEo-.js} +1 -1
- package/web/app/immutable/chunks/{fCtMtGYt.js → D6EyZ2rd.js} +1 -1
- package/web/app/immutable/chunks/{DoB-G8kB.js → D6H34kDj.js} +1 -1
- package/web/app/immutable/chunks/{aWBSU8IQ.js → D7KhILhs.js} +1 -1
- package/web/app/immutable/chunks/{CR5XXYcE.js → D8MIwtpL.js} +1 -1
- package/web/app/immutable/chunks/{DyreqWqr.js → D8cNe_33.js} +1 -1
- package/web/app/immutable/chunks/{CzxEKNiF.js → D9gMMVdB.js} +1 -1
- package/web/app/immutable/chunks/{JiW1DfLK.js → DA3tGWzX.js} +1 -1
- package/web/app/immutable/chunks/{CLMwPQBQ.js → DDDvNwR-.js} +1 -1
- package/web/app/immutable/chunks/{CDh2mZdS.js → DEQnE_KB.js} +1 -1
- package/web/app/immutable/chunks/{DcU8bi_n.js → DEsM7h8K.js} +2 -2
- package/web/app/immutable/chunks/{DMudvlKI.js → DFNKkiho.js} +4 -4
- package/web/app/immutable/chunks/{DcPZfWKB.js → DFRVxmWf.js} +1 -1
- package/web/app/immutable/chunks/{Dgo57zmq.js → DHMxSQaO.js} +1 -1
- package/web/app/immutable/chunks/{CIxnaBAb.js → DIME5LWK.js} +2 -2
- package/web/app/immutable/chunks/{BLtLj2yz.js → DIxibpTv.js} +1 -1
- package/web/app/immutable/chunks/{KaOLys0u.js → DJZIHUd7.js} +1 -1
- package/web/app/immutable/chunks/{HiIoMspb.js → DLPlXnVY.js} +1 -1
- package/web/app/immutable/chunks/{1-MeqddK.js → DL__HI6l.js} +1 -1
- package/web/app/immutable/chunks/{k48f0Jn8.js → DMOXpjfz.js} +1 -1
- package/web/app/immutable/chunks/{BLfqsc2a.js → DNup87JQ.js} +1 -1
- package/web/app/immutable/chunks/{B7pblHOt.js → DON9zoQ1.js} +1 -1
- package/web/app/immutable/chunks/{CwqyVbqi.js → DP31pjuo.js} +3 -3
- package/web/app/immutable/chunks/{Bpi8OSTE.js → DQe_5JbW.js} +1 -1
- package/web/app/immutable/chunks/{BFfRQORP.js → DRMe5Ypb.js} +1 -1
- package/web/app/immutable/chunks/{DoJ49Zrl.js → DTNrtzyx.js} +1 -1
- package/web/app/immutable/chunks/{Q1bO23Hj.js → DTbyG794.js} +1 -1
- package/web/app/immutable/chunks/{DWRtOXBU.js → DTco_120.js} +1 -1
- package/web/app/immutable/chunks/{S3jMTv3a.js → DUcJILSg.js} +1 -1
- package/web/app/immutable/chunks/{Cxmepjfl.js → DWjpzYNk.js} +1 -1
- package/web/app/immutable/chunks/{BFHmbbvG.js → DY9w61PC.js} +6 -6
- package/web/app/immutable/chunks/{CiRkFhK8.js → DYzxLuOL.js} +1 -1
- package/web/app/immutable/chunks/{CKTB5KRw.js → D_R1vNH8.js} +1 -1
- package/web/app/immutable/chunks/{DF54qNJU.js → D_YMc8vN.js} +1 -1
- package/web/app/immutable/chunks/{BGeImWEk.js → D_jEt7ej.js} +1 -1
- package/web/app/immutable/chunks/{BVwQph9_.js → DaTkisKB.js} +1 -1
- package/web/app/immutable/chunks/{DxmPtFKv.js → DaTwSOqs.js} +1 -1
- package/web/app/immutable/chunks/{DE8II0cx.js → DbB491_u.js} +1 -1
- package/web/app/immutable/chunks/{BWQPB65O.js → DbPBKS19.js} +1 -1
- package/web/app/immutable/chunks/{BHgSQJqT.js → Dbqo6rfT.js} +1 -1
- package/web/app/immutable/chunks/{TPru2I57.js → DcrCEeFN.js} +1 -1
- package/web/app/immutable/chunks/{0R5VEpaM.js → DdU2snxg.js} +4 -4
- package/web/app/immutable/chunks/{CUZpLDKB.js → DdYVblGk.js} +1 -1
- package/web/app/immutable/chunks/DejjV5ft.js +1 -0
- package/web/app/immutable/chunks/{D3tqOSzT.js → DepS1LOg.js} +1 -1
- package/web/app/immutable/chunks/{DW8fwVBf.js → DfINI0LK.js} +1 -1
- package/web/app/immutable/chunks/{QeZhJHLb.js → Dgvdn_ax.js} +1 -1
- package/web/app/immutable/chunks/{CktgkomQ.js → DhXSKt_a.js} +1 -1
- package/web/app/immutable/chunks/{B7hWIBzm.js → Dhs7RSq9.js} +1 -1
- package/web/app/immutable/chunks/{CyinuwPx.js → DivmpPFQ.js} +1 -1
- package/web/app/immutable/chunks/{DOhHP999.js → DjAFd7Fr.js} +1 -1
- package/web/app/immutable/chunks/{l7sDKa65.js → Dk9lUzSs.js} +1 -1
- package/web/app/immutable/chunks/{C3jMXj_V.js → DkQdSPDN.js} +1 -1
- package/web/app/immutable/chunks/{DEr2A_-h.js → DlnCrS3y.js} +2 -2
- package/web/app/immutable/chunks/{DBYe3Dcp.js → DmtYsVlu.js} +2 -2
- package/web/app/immutable/chunks/{BM2ubpAw.js → DoFGyuPK.js} +1 -1
- package/web/app/immutable/chunks/{C5tJUrGJ.js → DotCIVLI.js} +1 -1
- package/web/app/immutable/chunks/{BOVldAsb.js → Dp0kLnIL.js} +1 -1
- package/web/app/immutable/chunks/{Dk7Kxi97.js → DqCgFTqN.js} +1 -1
- package/web/app/immutable/chunks/{uyQciu7h.js → DuFY1gwd.js} +4 -4
- package/web/app/immutable/chunks/{BT8mEFV6.js → DuYgHIqV.js} +1 -1
- package/web/app/immutable/chunks/{BJCm9MUD.js → Dusq2uGc.js} +1 -1
- package/web/app/immutable/chunks/{zXLHCuiE.js → DvEcqVUt.js} +1 -1
- package/web/app/immutable/chunks/{B28HQLvX.js → DvdITStP.js} +1 -1
- package/web/app/immutable/chunks/{Dt_7lHy8.js → Dvzvnzzu.js} +1 -1
- package/web/app/immutable/chunks/{Cq8_4net.js → DznISJQO.js} +1 -1
- package/web/app/immutable/chunks/{DhTLwmro.js → EK8GFErl.js} +1 -1
- package/web/app/immutable/chunks/{C2tSFTTb.js → FS0kRzLP.js} +1 -1
- package/web/app/immutable/chunks/Fcr7AvC-.js +1 -0
- package/web/app/immutable/chunks/{Byobtdo1.js → G_kSYo3Y.js} +1 -1
- package/web/app/immutable/chunks/{BKKCpqXK.js → H8hIaDaV.js} +2 -2
- package/web/app/immutable/chunks/{CaX8Mme7.js → KPBWxwIA.js} +1 -1
- package/web/app/immutable/chunks/{GwtGeFMJ.js → KRACSBb9.js} +1 -1
- package/web/app/immutable/chunks/{DupTZXsI.js → KvfW-q1N.js} +1 -1
- package/web/app/immutable/chunks/{D5tDAzIo.js → MFTfhUYi.js} +1 -1
- package/web/app/immutable/chunks/{BS9WBIBb.js → O5ZlQHf9.js} +1 -1
- package/web/app/immutable/chunks/{ChYLETZB.js → OqslD7bF.js} +1 -1
- package/web/app/immutable/chunks/{DXXFBdjF.js → OuI4JmWC.js} +1 -1
- package/web/app/immutable/chunks/{BXwdb0J5.js → PejVYY2W.js} +3 -3
- package/web/app/immutable/chunks/{C9wxB2bb.js → QKQvZF-2.js} +2 -2
- package/web/app/immutable/chunks/R3fZBk-k.js +1 -0
- package/web/app/immutable/chunks/{BNYZa6GV.js → Rq6GuI3F.js} +1 -1
- package/web/app/immutable/chunks/{BcdTbj6d.js → RqSv1iWX.js} +1 -1
- package/web/app/immutable/chunks/{Xgzr3BTD.js → T6UBEOFc.js} +1 -1
- package/web/app/immutable/chunks/{BpezAJRw.js → TdGvVwuC.js} +1 -1
- package/web/app/immutable/chunks/{DSZbBNDD.js → Tgw7Kdvt.js} +1 -1
- package/web/app/immutable/chunks/{P7zPRuFC.js → U5o8u-di.js} +1 -1
- package/web/app/immutable/chunks/{BUSErGiB.js → UWtWVoQE.js} +1 -1
- package/web/app/immutable/chunks/{BCLYeYwk.js → W7uazUja.js} +1 -1
- package/web/app/immutable/chunks/{CDUYzZ2W.js → WWDClKTE.js} +1 -1
- package/web/app/immutable/chunks/{DJSvqrCI.js → WWq3hijy.js} +1 -1
- package/web/app/immutable/chunks/{B9Nn4kQr.js → Xr-aTNRN.js} +1 -1
- package/web/app/immutable/chunks/{DlljGo_I.js → Y8hdNZSZ.js} +1 -1
- package/web/app/immutable/chunks/{Dh-DCh2Y.js → YsAO4v_N.js} +1 -1
- package/web/app/immutable/chunks/{BB2vaoZ2.js → ZIePA90q.js} +3 -3
- package/web/app/immutable/chunks/{C-nTKxY9.js → ZfkZCfTr.js} +1 -1
- package/web/app/immutable/chunks/{CLvqghA8.js → ZmAQurQV.js} +1 -1
- package/web/app/immutable/chunks/{BU3y3Xes.js → _IjN0Lbt.js} +1 -1
- package/web/app/immutable/chunks/{DnzDw_9l.js → a3O-Ns1M.js} +1 -1
- package/web/app/immutable/chunks/{Em5CdgqH.js → aoX2v33V.js} +4 -4
- package/web/app/immutable/chunks/{C00PRSTi.js → b7gnFN68.js} +1 -1
- package/web/app/immutable/chunks/{iQDlfKDR.js → cD292w1o.js} +1 -1
- package/web/app/immutable/chunks/{COo5pTrI.js → ciQFmiC4.js} +1 -1
- package/web/app/immutable/chunks/{ClaP_sir.js → dvKmN4h6.js} +1 -1
- package/web/app/immutable/chunks/{D7QFmXLb.js → f0WUpIfB.js} +1 -1
- package/web/app/immutable/chunks/{Crey45Oa.js → f5b-J-bi.js} +1 -1
- package/web/app/immutable/chunks/{ZX798KkU.js → gKdztwD8.js} +1 -1
- package/web/app/immutable/chunks/{BdhKX9ZN.js → gNR_yDDX.js} +1 -1
- package/web/app/immutable/chunks/{BAMJ8Hnj.js → gX9ZnDRD.js} +1 -1
- package/web/app/immutable/chunks/{BVUW22uN.js → gXHlCg5O.js} +1 -1
- package/web/app/immutable/chunks/{axwUS21u.js → ghzRmqKs.js} +1 -1
- package/web/app/immutable/chunks/{FM3MDwzB.js → gocm4HZf.js} +1 -1
- package/web/app/immutable/chunks/{SdVpHK7d.js → i2Q0D3-m.js} +1 -1
- package/web/app/immutable/chunks/{CdTSfppl.js → iCTyujt5.js} +1 -1
- package/web/app/immutable/chunks/{IxxdIKNN.js → iMqZaR5X.js} +1 -1
- package/web/app/immutable/chunks/{BT5iyspK.js → iNacp7Sr.js} +1 -1
- package/web/app/immutable/chunks/{BjGqF2I6.js → iViWtmHm.js} +1 -1
- package/web/app/immutable/chunks/{D3JNbQ4D.js → jphlY6bT.js} +1 -1
- package/web/app/immutable/chunks/{CEA7jD1C.js → koUs6Gjt.js} +1 -1
- package/web/app/immutable/chunks/{rwibDzZr.js → l3Y4i65_.js} +1 -1
- package/web/app/immutable/chunks/{BTvJ4T_4.js → lK1e5NlM.js} +1 -1
- package/web/app/immutable/chunks/{Cd-qmx8U.js → oM2TfoNE.js} +1 -1
- package/web/app/immutable/chunks/{Di3gErxh.js → pQalwNsE.js} +1 -1
- package/web/app/immutable/chunks/{DWBUvNGh.js → r4dmBxo_.js} +1 -1
- package/web/app/immutable/chunks/{BU9me3Pg.js → rmHQzJ1a.js} +1 -1
- package/web/app/immutable/chunks/s_T1Uukt.js +1 -0
- package/web/app/immutable/chunks/{Cn-Afla1.js → u_H5ILVa.js} +1 -1
- package/web/app/immutable/chunks/{bJK6npyT.js → vJJtTADX.js} +1 -1
- package/web/app/immutable/chunks/{BSZu3BUb.js → vq6mxGLA.js} +1 -1
- package/web/app/immutable/chunks/{B3T1oiJl.js → x4bPxhVW.js} +1 -1
- package/web/app/immutable/chunks/{Cn4-Fvkn.js → x9IQ_8UO.js} +1 -1
- package/web/app/immutable/chunks/{n0_jgWL7.js → z2uEgbos.js} +1 -1
- package/web/app/immutable/entry/{app.B0HiWR5T.js → app.Dh0FLLBd.js} +3 -3
- package/web/app/immutable/entry/start.IMZH36aM.js +1 -0
- package/web/app/immutable/nodes/{0.5oa9JC3V.js → 0.BlcS-Hyh.js} +1 -1
- package/web/app/immutable/nodes/{1.dLY473QL.js → 1.BMTchPFq.js} +1 -1
- package/web/app/immutable/nodes/{10.Dg3iEVmH.js → 10.CfDNhRgU.js} +14 -14
- package/web/app/immutable/nodes/{11.PFTrUEsb.js → 11.CxSRkGHD.js} +1 -1
- package/web/app/immutable/nodes/{12.DUMat2GN.js → 12.B8s5KuaN.js} +1 -1
- package/web/app/immutable/nodes/{13.BEiznOPk.js → 13.J8EpPA9A.js} +1 -1
- package/web/app/immutable/nodes/{14.DFolVj6c.js → 14.C5TLXVit.js} +3 -3
- package/web/app/immutable/nodes/{15.CGEsAjgd.js → 15.DCpm4k7K.js} +1 -1
- package/web/app/immutable/nodes/{16.cptOJ-f9.js → 16.T0PyvW1V.js} +1 -1
- package/web/app/immutable/nodes/{17.BVn1LtfR.js → 17.pi-yfOoM.js} +1 -1
- package/web/app/immutable/nodes/{18.BLC8YWHJ.js → 18.CTVha2lA.js} +1 -1
- package/web/app/immutable/nodes/{19.CqJycQsd.js → 19.C2T81__z.js} +2 -2
- package/web/app/immutable/nodes/{2.BaR1WF3o.js → 2.1iJIAnw5.js} +4 -4
- package/web/app/immutable/nodes/{20.g9As4rvG.js → 20.BHRuLw4-.js} +1 -1
- package/web/app/immutable/nodes/{3.DwF_25Xt.js → 3.BDDby9Gq.js} +1 -1
- package/web/app/immutable/nodes/{4.ttOSy2Tq.js → 4.utfN0vdd.js} +1 -1
- package/web/app/immutable/nodes/{5.BVpoghsD.js → 5.Z6w8za6J.js} +1 -1
- package/web/app/immutable/nodes/6.w_k_ibWb.js +5 -0
- package/web/app/immutable/nodes/{7.BO56ByN2.js → 7.I-q-I1bs.js} +1 -1
- package/web/app/immutable/nodes/{8.CPtVgnSI.js → 8.BgjULPKU.js} +1 -1
- package/web/app/immutable/nodes/9.DOkmR0cl.js +14 -0
- package/web/app/version.json +1 -1
- package/web/generated/paraglide.js +49 -49
- package/web/index.html +18 -18
- package/web/app/immutable/chunks/BaXq2aUL.js +0 -411
- package/web/app/immutable/chunks/Bheykcr9.js +0 -1
- package/web/app/immutable/chunks/C8E14ldW.js +0 -1
- package/web/app/immutable/chunks/CDVPwJHE.js +0 -1
- package/web/app/immutable/chunks/CtfEuoOH.js +0 -1
- package/web/app/immutable/chunks/DRuLniWc.js +0 -1
- package/web/app/immutable/chunks/T9rMC0YB.js +0 -1
- package/web/app/immutable/chunks/jlu1ZSD8.js +0 -1
- package/web/app/immutable/entry/start.BFcXwo9Y.js +0 -1
- package/web/app/immutable/nodes/6.D6pOrTxH.js +0 -5
- package/web/app/immutable/nodes/9.cl9L6J-I.js +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as je,bo as v,bm as c,bw as Ze,b as Xe,br as lr,bs as bt,bq as Gr}from"./CtfEuoOH.js";import{bs as Je,ay as H,be as ht,b$ as ct,b_ as D,bO as J,W as C,bS as h,aD as e,a7 as ut,bl as ke,bn as Ye,c9 as f,aA as w,aB as re,ca as Ue,c0 as It,bH as d,a5 as ie,bA as se,bV as W,br as Rt,bk as qr,bj as Hr,bf as zo,bo as Kr,c5 as pt,aw as or,bz as Wo,cd as Jt}from"./3SdAC2_C.js";import{i as be}from"./DynUeYUu.js";import{c as Y}from"./BZ27qIg1.js";import{g as Pr,i as Go,e as Ct,I as qo}from"./CnFZbWXv.js";import{f as xt,s as Be,g as Ho}from"./B26ZHg3s.js";import{b as kt}from"./Dn334wJv.js";import{b as Er}from"./BT5iyspK.js";import{k as Ko}from"./DFKhOU69.js";import{c as Dt}from"./ChTqQfQN.js";import{a as jo}from"./CC7to1B5.js";import{f as Oe}from"./D9R5fzn8.js";import{F as Zo}from"./CT8vPg_p.js";import{m as vt}from"./C3jMXj_V.js";import{t as Xo}from"./CGmYraIa.js";import{cp as jr,F as ye,aZ as Jo,ar as Yo,cK as Qo,aM as en,a_ as nr,a0 as dr,a2 as ur,b1 as Zr,bb as tn,a8 as rn,aw as on,aC as Xr,cT as nn,ci as Jr,bS as Yr,cn as an}from"./COofQgO0.js";import"./BFfRQORP.js";import{rV as sn,JH as Se,g0 as ln,bE as dn,Ac as un,zu as cn,LI as Fr,dV as fn,bY as gn,LH as vn,v1 as wn,LF as Sr,gI as pn,un as bn,LG as mn,Ll as Lr,LE as Rr}from"./CiKoEJ2m.js";import"./DUTvR2si.js";import{R as hn,g as Yt,h as mt,f as _n,e as Ke,l as Qr,d as eo,K as yn,i as xn,k as Cn,j as In,M as to,E as kn}from"./aWBSU8IQ.js";import{a as ro,B as $t}from"./B5aYN90J.js";import{bK as Pn}from"./DEr2A_-h.js";import{a5 as En,w as Fn,ah as Sn}from"./BZCcX8wj.js";import{m as Ln,z as Rn}from"./BkcCJyDK.js";import{I as Nt}from"./DcraaizU.js";import{d as $n}from"./CQ409-Pj.js";import{H as Tn,I as Un}from"./Bqd7fdCF.js";import{a as An,e as Bn,h as On,g as Nn,k as Mn,p as Dn,b as oo}from"./D4WPlvMg.js";import{e as Vn}from"./KaOLys0u.js";import{i as ar}from"./CL3a4Hm1.js";import{i as zn,a as Wn}from"./Cn-Afla1.js";import{B as Gn}from"./D3JNbQ4D.js";import"./CTgYTdXw.js";import{l as ze}from"./DMEIbJII.js";import{M as no}from"./CeoBhFo7.js";import"./B3T1oiJl.js";import"./Bz80vYvX.js";import{b as qn}from"./C22cBcHz.js";import"./BS9WBIBb.js";import{t as Hn,b as Kn}from"./CXXVPWBH.js";import{T as jn}from"./9eqoPT_C.js";import{c as Zn,d as Xn}from"./BHgSQJqT.js";import{o as $r,s as wt,n as Bt}from"./CIyUrgF0.js";import{g as Jn}from"./DWGXN6Nr.js";import{f as Yn}from"./DXXFBdjF.js";import{ay as Qn,$ as ea}from"./z0xDttNV.js";import{a_ as ta}from"./iQDlfKDR.js";import{i as ra}from"./DKwAaLwd.js";import{o as oa}from"./CUZpLDKB.js";function na(o,t){return o.loadURL(t)}function aa(o){return{previousUrlProp:o||null}}function Tr(o,t){o.previousUrlProp=t}function ia(o,t,n){const g=n||t;return o.previousUrlProp===g?null:(o.previousUrlProp=g,g)}function sa(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ao=Dt("TabBoundsReporter"),la=150;function Qt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(g=>{ao.debug("Failed to report tab bounds",{tabId:o,error:g})})}function Ur(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ao.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function io(o,t){let n=t,g;const m=typeof ResizeObserver>"u"?void 0:new ResizeObserver(P=>{if(!n)return;const b=P[P.length-1]?.contentRect;if(!b)return;const F=n;clearTimeout(g),g=setTimeout(()=>{Qt(F,b.width,b.height)},la)});if(m?.observe(o),n){const P=o.getBoundingClientRect();Qt(n,P.width,P.height)}return{update(P){if(P!==n&&(clearTimeout(g),n&&Ur(n),n=P,n)){const b=o.getBoundingClientRect();Qt(n,b.width,b.height)}},destroy(){clearTimeout(g),m?.disconnect(),n&&Ur(n)}}}function so(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function dt(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||lo(o,t)}function lo(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return ro.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Mt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function da(o){return{...o,width:o.height,height:o.width}}var ua=re('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),er=re("<!> <!> <!>",1),ca=re('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),tr=re("<!> <!>",1);function cr(o,t){if(new.target)return je({component:cr,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=v(t,"onCustom",7);const P=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function F(u){if(u==="fit")return g()({mode:"fit"});const k=Mt.find(O=>O.id===u);k&&g()({mode:"preset",presetId:k.id,width:k.width,height:k.height})}var A={get viewport(){return n()},set viewport(u){n(u),w()},get onViewportChange(){return g()},set onViewportChange(u){g(u),w()},get onCustom(){return m()},set onCustom(u){m(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)},S=er(),s=H(S);Y(s,()=>hn,(u,k)=>{k(u,{get value(){return e(b)},onValueChange:F,children:(O,x)=>{var I=er(),R=H(I);Y(R,()=>Yt,(G,K)=>{K(G,{value:"fit",children:(oe,te)=>{ht();var X=ct();D(le=>J(X,le),[()=>c.browser_viewport_fitPanel_label()]),C(oe,X)},$$slots:{default:!0}})});var T=h(R,2);Pr(T,17,()=>P,Go,(G,K)=>{var oe=er(),te=H(oe);Y(te,()=>mt,(B,ae)=>{ae(B,{})});var X=h(te,2);Y(X,()=>_n,(B,ae)=>{ae(B,{children:(a,l)=>{ht();var j=ct();D(ue=>J(j,ue),[()=>e(K)==="phone"?c.browser_viewport_phoneGroup_label():e(K)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),C(a,j)},$$slots:{default:!0}})});var le=h(X,2);Pr(le,17,()=>Mt.filter(B=>B.category===e(K)),B=>B.id,(B,ae)=>{var a=ut(),l=H(a);Y(l,()=>Yt,(j,ue)=>{ue(j,{get value(){return e(ae).id},children:(Ie,he)=>{var M=ua(),_=H(M),Z=ke(_,!0),V=h(_,2),z=ke(V,!0);D(y=>{J(Z,e(ae).name),J(z,y)},[()=>c.browser_viewport_dimensions_label({width:ze(e(ae).width),height:ze(e(ae).height)})]),C(Ie,M)},$$slots:{default:!0}})}),C(B,a)}),C(G,oe)});var ee=h(T,2);{var ge=G=>{var K=tr(),oe=H(K);Y(oe,()=>mt,(X,le)=>{le(X,{})});var te=h(oe,2);Y(te,()=>Yt,(X,le)=>{le(X,{value:"custom",get onSelect(){return m()},children:(B,ae)=>{var a=ca(),l=H(a),j=ke(l,!0),ue=h(l,2),Ie=ke(ue,!0);D((he,M)=>{J(j,he),J(Ie,M)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})]),C(B,a)},$$slots:{default:!0}})}),C(G,K)};be(ee,G=>{n().mode==="custom"&&G(ge)})}C(O,I)},$$slots:{default:!0}})});var L=h(s,2);{var Q=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);Y(x,()=>Ke,(I,R)=>{R(I,{get onSelect(){return m()},children:(T,ee)=>{ht();var ge=ct();D(G=>J(ge,G),[()=>c.browser_viewport_custom_label()]),C(T,ge)},$$slots:{default:!0}})}),C(u,k)};be(L,u=>{n().mode!=="custom"&&u(Q)})}var U=h(L,2);{var $=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);{let I=f(()=>c.browser_viewport_rotate_label());Y(x,()=>no,(R,T)=>{T(R,{get icon(){return jr},get label(){return e(I)},onSelect:()=>g()(da(n()))})})}C(u,k)};be(U,u=>{n().mode!=="fit"&&u($)})}return C(o,S),Ye(A)}var fa=re('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function fr(o,t){if(new.target)return je({component:fr,...o});Je(t,!0);let n=v(t,"open",15,!1),g=v(t,"viewport",7),m=v(t,"onViewportChange",7),P=v(t,"returnFocus",7);const b=320,F=3840;let A=W(1280),S=W(800),s=W(null);function L(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=F}const Q=f(()=>L(e(A))&&L(e(S)));Ue(()=>{if(n())return()=>{It().then(()=>{P()?.isConnected&&P().focus()})}}),Ue(()=>{n()||(d(A,g().mode==="fit"?1280:g().width,!0),d(S,g().mode==="fit"?800:g().height,!0))});function U(){!e(Q)||e(A)===null||e(S)===null||(m()({mode:"custom",width:e(A),height:e(S)}),n(!1))}var $={get open(){return n()},set open(u=!1){n(u),w()},get viewport(){return g()},set viewport(u){g(u),w()},get onViewportChange(){return m()},set onViewportChange(u){m(u),w()},get returnFocus(){return P()},set returnFocus(u){P(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)};{let u=f(()=>c.browser_viewport_custom_label()),k=f(()=>c.browser_viewport_sizeRange_description({min:ze(b),max:ze(F)})),O=f(()=>c.browser_viewport_apply_label());qn(o,{get title(){return e(u)},get description(){return e(k)},get submitLabel(){return e(O)},get canSubmit(){return e(Q)},onSubmit:U,get initialFocus(){return e(s)},get open(){return n()},set open(x){n(x)},children:(x,I)=>{var R=fa(),T=ie(R),ee=ie(T),ge=ke(ee,!0),G=h(ee,2);{let le=f(()=>!L(e(A)));Nt(G,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(A)},set value(B){d(A,B,!0)},get ref(){return e(s)},set ref(B){d(s,B,!0)}})}se(T);var K=h(T,2),oe=ie(K),te=ke(oe,!0),X=h(oe,2);{let le=f(()=>!L(e(S)));Nt(X,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(S)},set value(B){d(S,B,!0)}})}se(K),se(R),D((le,B)=>{J(ge,le),J(te,B)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),C(x,R)},$$slots:{default:!0}})}return Ye($)}var Ot=re("<!> <!>",1),ot=re("<!> ",1),ga=re('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),va=re("<!> <!> <!> <!> <!>",1),wa=re('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),pa=re("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function uo(o,t){if(new.target)return je({component:uo,...o});Je(t,!0);let n=v(t,"errorCount",7,0),g=v(t,"disabled",7,!1),m=v(t,"collapsed",7,!1),P=v(t,"canGoBack",7,!1),b=v(t,"canGoForward",7,!1),F=v(t,"canSelectElement",7,!1),A=v(t,"selectingElement",7,!1),S=v(t,"viewport",23,()=>({mode:"fit"})),s=v(t,"onGoBack",7),L=v(t,"onGoForward",7),Q=v(t,"onToggleElementPicker",7),U=v(t,"onViewportChange",7),$=v(t,"onOpenExternal",7),u=v(t,"onFullScreen",7),k=v(t,"onCopyUrl",7),O=v(t,"onScreenshot",7),x=v(t,"onOpenConsole",7),I=v(t,"onOpenSource",7),R=v(t,"onOpenInspector",7),T=v(t,"onReloadWithoutCache",7);const ee=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:ze(n())}):c.browser_overflow_trigger_ariaLabel()),ge=f(()=>S().mode==="preset"?Mt.find(l=>l.id===S().presetId):void 0),G=f(()=>S().mode==="fit"?c.browser_viewport_fitPanel_label():e(ge)?.name??c.browser_viewport_dimensions_label({width:ze(S().width),height:ze(S().height)}));let K=W(!1),oe=W(null),te=W(!1);async function X(){d(te,!1),await It(),d(K,!0)}var le={get errorCount(){return n()},set errorCount(l=0){n(l),w()},get disabled(){return g()},set disabled(l=!1){g(l),w()},get collapsed(){return m()},set collapsed(l=!1){m(l),w()},get canGoBack(){return P()},set canGoBack(l=!1){P(l),w()},get canGoForward(){return b()},set canGoForward(l=!1){b(l),w()},get canSelectElement(){return F()},set canSelectElement(l=!1){F(l),w()},get selectingElement(){return A()},set selectingElement(l=!1){A(l),w()},get viewport(){return S()},set viewport(l={mode:"fit"}){S(l),w()},get onGoBack(){return s()},set onGoBack(l){s(l),w()},get onGoForward(){return L()},set onGoForward(l){L(l),w()},get onToggleElementPicker(){return Q()},set onToggleElementPicker(l){Q(l),w()},get onViewportChange(){return U()},set onViewportChange(l){U(l),w()},get onOpenExternal(){return $()},set onOpenExternal(l){$(l),w()},get onFullScreen(){return u()},set onFullScreen(l){u(l),w()},get onCopyUrl(){return k()},set onCopyUrl(l){k(l),w()},get onScreenshot(){return O()},set onScreenshot(l){O(l),w()},get onOpenConsole(){return x()},set onOpenConsole(l){x(l),w()},get onOpenSource(){return I()},set onOpenSource(l){I(l),w()},get onOpenInspector(){return R()},set onOpenInspector(l){R(l),w()},get onReloadWithoutCache(){return T()},set onReloadWithoutCache(l){T(l),w()},$set:Ze,$on:(l,j)=>Xe(t,l,j)},B=Ot(),ae=H(B);Y(ae,()=>to,(l,j)=>{j(l,{get open(){return e(te)},set open(ue){d(te,ue,!0)},children:(ue,Ie)=>{var he=Ot(),M=H(he);{const Z=(V,z)=>{let y=()=>(z?.()).props;{let q=f(()=>c.browser_overflow_trigger_tooltip());Oe(V,lr(y,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return g()},get tooltip(){return e(q)},tooltipSide:"bottom",get"aria-label"(){return e(ee)},"data-testid":"browser-overflow-trigger",get ref(){return e(oe)},set ref(E){d(oe,E,!0)},children:(E,Pe)=>{var fe=Ot(),Qe=H(fe);yn(Qe,{class:"size-3.5"});var nt=h(Qe,2);{var We=Fe=>{Gn(Fe,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ge,at)=>{ht();var it=ct();D(Me=>J(it,Me),[()=>n()>9?"9+":ze(n())]),C(Ge,it)},$$slots:{default:!0}})};be(nt,Fe=>{n()>0&&Fe(We)})}C(E,fe)},$$slots:{default:!0}}))}};Y(M,()=>Qr,(V,z)=>{z(V,{child:Z,$$slots:{child:!0}})})}var _=h(M,2);Y(_,()=>eo,(Z,V)=>{V(Z,{align:"end",class:"w-56",onCloseAutoFocus:z=>e(K)&&z.preventDefault(),children:(z,y)=>{var q=pa(),E=H(q);{var Pe=ve=>{var we=va(),Ee=H(we);{let ce=f(()=>!P());Y(Ee,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return s()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return dr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var Re=h(Ee,2);{let ce=f(()=>!b());Y(Re,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return L()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return ur},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var pe=h(Re,2);{let ce=f(()=>!F());Y(pe,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},onSelect:()=>void Q()?.(),children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var me=h(pe,2);Y(me,()=>xn,(ce,xe)=>{xe(ce,{children:(De,Ne)=>{var st=Ot(),Ce=H(st);{let et=f(()=>!U());Y(Ce,()=>Cn,(Ve,ft)=>{ft(Ve,{get disabled(){return e(et)},children:(St,gt)=>{var Pt=ga(),Et=H(Pt);ye(Et,{get icon(){return Zr},size:"xs",class:"w-4 text-muted-foreground"});var Ft=h(Et,2),Ut=ke(Ft,!0);D(Lt=>J(Ut,Lt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(G)})]),C(St,Pt)},$$slots:{default:!0}})})}var He=h(Ce,2);Y(He,()=>In,(et,Ve)=>{Ve(et,{class:"w-64",children:(ft,St)=>{cr(ft,{get viewport(){return S()},onViewportChange:gt=>U()?.(gt),onCustom:X})},$$slots:{default:!0}})}),C(De,st)},$$slots:{default:!0}})});var Ae=h(me,2);Y(Ae,()=>mt,(ce,xe)=>{xe(ce,{})}),C(ve,we)};be(E,ve=>{m()&&ve(Pe)})}var fe=h(E,2);{var Qe=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>u()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return tn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_fullScreen_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)},nt=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>void $()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return rn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_openExternal_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)};be(fe,ve=>{u()?ve(Qe):$()&&ve(nt,1)})}var We=h(fe,2);Y(We,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void k()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_copyUrl_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Fe=h(We,2);Y(Fe,()=>mt,(ve,we)=>{we(ve,{})});var Ge=h(Fe,2);Y(Ge,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void O()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_screenshot_label()]),C(Ee,pe)},$$slots:{default:!0}})});var at=h(Ge,2);Y(at,()=>mt,(ve,we)=>{we(ve,{})});var it=h(at,2);Y(it,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void x()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Qo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_console_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Me=h(it,2);Y(Me,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void I()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return en},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_source_label()]),C(Ee,pe)},$$slots:{default:!0}})});var qe=h(Me,2);Y(qe,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void R()(),children:(Ee,Re)=>{var pe=wa(),me=H(pe);ye(me,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me,2),ce=ke(Ae,!0);ht(2),D(xe=>J(ce,xe),[()=>c.browser_overflow_inspector_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Le=h(qe,2);Y(Le,()=>mt,(ve,we)=>{we(ve,{})});var _t=h(Le,2);Y(_t,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void T()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return jr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),C(Ee,pe)},$$slots:{default:!0}})}),C(z,q)},$$slots:{default:!0}})}),C(ue,he)},$$slots:{default:!0}})});var a=h(ae,2);return fr(a,{get viewport(){return S()},onViewportChange:l=>U()?.(l),get returnFocus(){return e(oe)},get open(){return e(K)},set open(l){d(K,l,!0)}}),C(o,B),Ye(le)}var ba=re('<span class="truncate"> </span> <!>',1),Ar=re("<!> <!>",1);function co(o,t){if(new.target)return je({component:co,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=W(!1),P=W(!1),b=W(null);const F=f(()=>n().mode==="preset"?Mt.find(k=>k.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})),S=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(F)?e(F).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(S));async function L(){d(m,!1),await It(),d(P,!0)}var Q={get viewport(){return n()},set viewport(k){n(k),w()},get onViewportChange(){return g()},set onViewportChange(k){g(k),w()},$set:Ze,$on:(k,O)=>Xe(t,k,O)},U=Ar(),$=H(U);Y($,()=>to,(k,O)=>{O(k,{get open(){return e(m)},set open(x){d(m,x,!0)},children:(x,I)=>{var R=Ar(),T=H(R);{const ge=(G,K)=>{let oe=()=>(K?.()).props;{let te=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Oe(G,lr(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(te)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(X){d(b,X,!0)},children:(X,le)=>{var B=ba(),ae=H(B),a=ke(ae,!0),l=h(ae,2);ye(l,{get icon(){return on},size:"xs",class:"shrink-0"}),D(()=>J(a,e(S))),C(X,B)},$$slots:{default:!0}}))}};Y(T,()=>Qr,(G,K)=>{K(G,{child:ge,$$slots:{child:!0}})})}var ee=h(T,2);Y(ee,()=>eo,(ge,G)=>{G(ge,{align:"end",class:"w-64",onCloseAutoFocus:K=>e(P)&&K.preventDefault(),children:(K,oe)=>{cr(K,{get viewport(){return n()},get onViewportChange(){return g()},onCustom:L})},$$slots:{default:!0}})}),C(x,R)},$$slots:{default:!0}})});var u=h($,2);return fr(u,{get viewport(){return n()},get onViewportChange(){return g()},get returnFocus(){return e(b)},get open(){return e(P)},set open(k){d(P,k,!0)}}),C(o,U),Ye(Q)}var ma=re('<span data-browser-viewport-readout=""> </span> <!>',1),ha=re('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function fo(o,t){if(new.target)return je({component:fo,...o});Je(t,!0);const n=320,g=3840,m=150,P=24;let b=v(t,"viewport",7),F=v(t,"onViewportChange",7),A=v(t,"chromeOutside",7,!1),S=v(t,"children",7),s=W(Rt(b().mode==="fit"?n:b().width)),L=W(Rt(b().mode==="fit"?n:b().height)),Q,U=W(0),$=W(0),u=W(!1),k=null,O=0,x=0,I=0,R=0,T;const ee=f(()=>b().mode==="fit"),ge=f(()=>c.browser_viewport_dimensions_label({width:ze(e(s)),height:ze(e(L))})),G=f(()=>A()?Math.max(0,e($)-P):e($)),K=f(()=>!e(ee)&&e(U)>0&&e(G)>0?Math.min(1,e(U)/e(s),e(G)/e(L)):1),oe=f(()=>e(s)*e(K)),te=f(()=>e(L)*e(K));Ue(()=>{e(u)||b().mode==="fit"||(d(s,b().width,!0),d(L,b().height,!0))});function X(y){return Math.min(g,Math.max(n,Math.round(y)))}function le(){F()({mode:"custom",width:e(s),height:e(L)})}function B(){clearTimeout(T),T=setTimeout(le,m)}function ae(y){e(ee)||y.button!==0||(y.preventDefault(),d(u,!0),k=y.pointerId,O=y.clientX,x=y.clientY,I=e(s),R=e(L),y.currentTarget instanceof HTMLElement&&y.currentTarget.setPointerCapture?.(y.pointerId))}function a(y){!e(u)||y.pointerId!==k||(d(s,X(I+y.clientX-O),!0),d(L,X(R+y.clientY-x),!0),B())}function l(y){if(!e(u)||y.pointerId!==k)return;clearTimeout(T),d(u,!1),k=null;const q=y.currentTarget;q instanceof HTMLElement&&q.hasPointerCapture?.(y.pointerId)&&q.releasePointerCapture&&q.releasePointerCapture(y.pointerId),le()}qr(()=>{const y=(E,Pe)=>{d(U,E,!0),d($,Pe,!0)};y(Q.clientWidth,Q.clientHeight);const q=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([E])=>{y(E?.contentRect.width??Q.clientWidth,E?.contentRect.height??Q.clientHeight)});return q?.observe(Q),()=>q?.disconnect()}),Hr(()=>clearTimeout(T));var j={get viewport(){return b()},set viewport(y){b(y),w()},get onViewportChange(){return F()},set onViewportChange(y){F(y),w()},get chromeOutside(){return A()},set chromeOutside(y=!1){A(y),w()},get children(){return S()},set children(y){S(y),w()},$set:Ze,$on:(y,q)=>Xe(t,y,q)},ue=ha();{const y=E=>{var Pe=ma(),fe=H(Pe),Qe=ke(fe,!0),nt=h(fe,2);{let We=f(()=>A()?"top-full":"bottom-0"),Fe=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Oe(nt,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(We)??""}`},get"aria-label"(){return e(Fe)},"data-testid":"browser-device-resize-handle",onpointerdown:ae,onpointermove:a,onpointerup:l,onpointercancel:l})}D(()=>{xt(fe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),J(Qe,e(ge))}),C(E,Pe)};var Ie=ie(ue),he=ie(Ie);let q;var M=ie(he);Xo(M,()=>S()??zo);var _=h(M,2);{var Z=E=>{y(E)};be(_,E=>{!e(ee)&&!A()&&E(Z)})}se(he);var V=h(he,2);{var z=E=>{y(E)};be(V,E=>{!e(ee)&&A()&&E(z)})}se(Ie),se(ue),kt(ue,E=>Q=E,()=>Q),D(()=>{xt(Ie,1,`relative ${e(ee)?"h-full w-full":""} ${A()&&!e(ee)?"mb-6":""}`),xt(he,1,`relative overflow-hidden bg-background ${e(ee)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Be(he,"data-browser-device-frame",e(ee)?void 0:""),Be(he,"data-width",e(ee)?void 0:e(s)),Be(he,"data-height",e(ee)?void 0:e(L)),q=Ho(he,"",q,{width:e(ee)?void 0:`${e(oe)}px`,height:e(ee)?void 0:`${e(te)}px`})})}return D(()=>xt(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(ee)?"bg-background":"bg-muted/40"}`)),C(o,ue),Ye(j)}const rr=Dt("BrowserViewSlot"),Br=()=>new Promise(o=>requestAnimationFrame(()=>o())),Or=async()=>{await Br(),await Br()};function Nr(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Mr(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function _a(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function ya(o,t){let n=Dr(o,t),g=`${t.workspaceId}\0${t.tabId}`;return{update(m){const P=`${m.workspaceId}\0${m.tabId}`;if(P===g){n.update(m);return}n.destroy(),g=P,n=Dr(o,m)},destroy(){n.destroy()}}}function Dr(o,t){let n=t;const g=An(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(g.webview);let m=null,P=Promise.resolve(),b="live",F=0,A=null,S=null,s=!1;const L=()=>{A?.remove(),A=null},Q=x=>{m=x;const I=n.tabId;return P=On(I,x.rect,x.visible).catch(R=>rr.debug("Could not place the browser page",{tabId:I,error:R})),P},U=()=>{if(S=null,s)return;const x=Mr(o),I=n.visible&&x!==null&&_a(o)&&b!=="frozen"&&g.ready;g.ready&&(!m||m.visible!==I||x&&!Nr(m.rect,x))&&(Nr(m?.rect??null,x)||Kn(),Q({rect:x??m?.rect??null,visible:I})),S=requestAnimationFrame(U)};S=requestAnimationFrame(U);const $=async x=>{if(b="freezing",g.ready&&m?.visible)try{const I=await g.webview.capturePage?.();if(x!==F||s)return;const R=I?.toDataURL()??"";if(R){const T=document.createElement("img");if(T.alt="",T.setAttribute("aria-hidden","true"),T.dataset.browserViewSnapshot="",T.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",T.src=R,await T.decode().catch(()=>{}),x!==F||s||(L(),o.append(T),A=T,await Or(),x!==F||s))return}}catch(I){rr.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}x!==F||s||(b="frozen")},u=async x=>{if(b="thawing",g.ready&&n.visible){const I=Mr(o);I&&await Q({rect:I,visible:!0}),await Or()}x!==F||s||(L(),b="live")},k=Hn({element:o,onCoveredChange(x){const I=++F;x?$(I):u(I)}});return{update(x){n=x},destroy:()=>{const x=n.tabId;s=!0,S!==null&&cancelAnimationFrame(S),S=null,k(),L(),g.dispose(),n.onWebview?.(null),P.then(()=>Bn(x).catch(I=>rr.debug("Could not take the browser page off screen",{tabId:x,error:I})))}}}var xa=re('<div class="relative h-full w-full overflow-hidden"></div>');function go(o,t){if(new.target)return je({component:go,...o});Je(t,!0);let n=v(t,"tabId",7),g=v(t,"workspaceId",7),m=v(t,"url",7),P=v(t,"pinned",7),b=v(t,"visible",7),F=v(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),w()},get workspaceId(){return g()},set workspaceId(s){g(s),w()},get url(){return m()},set url(s){m(s),w()},get pinned(){return P()},set pinned(s){P(s),w()},get visible(){return b()},set visible(s){b(s),w()},get webview(){return F()},set webview(s=null){F(s),w()},$set:Ze,$on:(s,L)=>Xe(t,s,L)},S=xa();return Ct(S,(s,L)=>ya?.(s,L),()=>({tabId:n(),workspaceId:g(),url:m(),...P()===void 0?{}:{pinned:P()},visible:b(),onWebview:s=>F(s)})),Ct(S,(s,L)=>io?.(s,L),n),D(()=>Be(S,"data-browser-view-slot",n())),C(o,S),Ye(A)}function vo(o,t){if(new.target)return je({component:vo,...o});Je(t,!0);let n=v(t,"active",7),g=v(t,"disabled",7),m=v(t,"onToggle",7);var P={get active(){return n()},set active(b){n(b),w()},get disabled(){return g()},set disabled(b){g(b),w()},get onToggle(){return m()},set onToggle(b){m(b),w()},$set:Ze,$on:(b,F)=>Xe(t,b,F)};{let b=f(()=>n()?"bg-muted text-foreground":""),F=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Oe(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return m()},get disabled(){return g()},get tooltip(){return e(F)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(S,s)=>{ye(S,{get icon(){return nr},size:"xs"})},$$slots:{default:!0}})}return Ye(P)}var Ca=re('<span class="sr-only"> </span>'),Ia=re('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ka=re("<!> <!>",1),Pa=re('<span class="inline-flex shrink-0"><!> <!></span>');function gr(o,t){const n=Kr();if(new.target)return je({component:gr,...o});Je(t,!0);let g=v(t,"label",7),m=v(t,"description",7),P=v(t,"ariaLabel",23,g),b=v(t,"tone",7,"info"),F=v(t,"actionLabel",7),A=v(t,"onAction",7),S=v(t,"actionFocusTarget",7),s=v(t,"descriptionId",7),L=W(!1),Q=!1;async function U(){Q=!0,d(L,!1),await It(),S()?.focus(),A()?.()}var $={get label(){return g()},set label(I){g(I),w()},get description(){return m()},set description(I){m(I),w()},get ariaLabel(){return P()},set ariaLabel(I=g){P(I),w()},get tone(){return b()},set tone(I="info"){b(I),w()},get actionLabel(){return F()},set actionLabel(I){F(I),w()},get onAction(){return A()},set onAction(I){A(I),w()},get actionFocusTarget(){return S()},set actionFocusTarget(I){S(I),w()},get descriptionId(){return s()},set descriptionId(I){s(I),w()},$set:Ze,$on:(I,R)=>Xe(t,I,R)},u=Pa(),k=ie(u);{var O=I=>{var R=Ca(),T=ke(R,!0);D(()=>{Be(R,"id",n),Be(R,"role",b()==="error"?"alert":"status"),J(T,m())}),C(I,R)};be(k,I=>{s()||I(O)})}var x=h(k,2);return Y(x,()=>Xn,(I,R)=>{R(I,{get open(){return e(L)},set open(T){d(L,T,!0)},children:(T,ee)=>{var ge=ka(),G=H(ge);{const oe=(te,X)=>{let le=()=>(X?.()).props;{let B=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),ae=f(()=>s()??n);Oe(te,lr(le,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(B)},get"aria-label"(){return P()},get"aria-describedby"(){return e(ae)},get tooltip(){return m()},get tooltipDisabled(){return e(L)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(a,l)=>{{let j=f(()=>b()==="error"?Xr:b()==="warning"?nn:Zr);ye(a,{get icon(){return e(j)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};Y(G,()=>jn,(te,X)=>{X(te,{child:oe,$$slots:{child:!0}})})}var K=h(G,2);Y(K,()=>Zn,(oe,te)=>{te(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return P()},onCloseAutoFocus:X=>{Q&&S()&&(X.preventDefault(),S().focus()),Q=!1},children:(X,le)=>{var B=Ia(),ae=H(B),a=ke(ae,!0),l=h(ae,2);{var j=ue=>{Oe(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void U(),children:(Ie,he)=>{ht();var M=ct();D(()=>J(M,F())),C(Ie,M)},$$slots:{default:!0}})};be(l,ue=>{F()&&A()&&ue(j)})}D(()=>J(a,m())),C(X,B)},$$slots:{default:!0}})}),C(T,ge)},$$slots:{default:!0}})}),se(u),D(()=>Be(u,"data-browser-status",b())),C(o,u),Ye($)}function Ea(o,t,n){const g=n.width>0?t.width/n.width:1,m=n.height>0?t.height/n.height:1,P=Math.max(0,Math.floor(o.x*g)),b=Math.max(0,Math.floor(o.y*m)),F=Math.min(t.width,Math.ceil((o.x+o.width)*g)),A=Math.min(t.height,Math.ceil((o.y+o.height)*m));return{x:P,y:b,width:Math.max(0,F-P),height:Math.max(0,A-b)}}const Fa=$r({selector:wt().min(1),domPath:wt().min(1),tagName:wt().min(1),id:wt(),className:wt(),textSnippet:wt().max(120),rect:$r({x:Bt().finite(),y:Bt().finite(),width:Bt().finite().nonnegative(),height:Bt().finite().nonnegative()}).strict(),pageUrl:wt().min(1),sourceRef:wt().min(1).optional()}).strict(),Vr="__INTENT_ELEMENT_PICKED__:";function Sa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Vr))return null;let t;try{t=JSON.parse(o.slice(Vr.length))}catch{t=null}const n=Fa.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const La=String.raw`
|
|
1
|
+
import{t as je,bo as v,bm as c,bw as Ze,b as Xe,br as lr,bs as bt,bq as Gr}from"./Fcr7AvC-.js";import{bs as Je,ay as H,be as ht,b$ as ct,b_ as D,bO as J,W as C,bS as h,aD as e,a7 as ut,bl as ke,bn as Ye,c9 as f,aA as w,aB as re,ca as Ue,c0 as It,bH as d,a5 as ie,bA as se,bV as W,br as Rt,bk as qr,bj as Hr,bf as zo,bo as Kr,c5 as pt,aw as or,bz as Wo,cd as Jt}from"./3SdAC2_C.js";import{i as be}from"./BhYXv0ZM.js";import{c as Y}from"./2z64ELW5.js";import{g as Pr,i as Go,e as Ct,I as qo}from"./CA6H1-bp.js";import{f as xt,s as Be,g as Ho}from"./BRCr02in.js";import{b as kt}from"./Dn334wJv.js";import{b as Er}from"./iNacp7Sr.js";import{k as Ko}from"./Cc0763mU.js";import{c as Dt}from"./ChTqQfQN.js";import{a as jo}from"./CC7to1B5.js";import{f as Oe}from"./Beq_QLuz.js";import{F as Zo}from"./BAtAwQ72.js";import{m as vt}from"./DkQdSPDN.js";import{t as Xo}from"./CWfjuhY2.js";import{cp as jr,F as ye,aZ as Jo,ar as Yo,cK as Qo,aM as en,a_ as nr,a0 as dr,a2 as ur,b1 as Zr,bb as tn,a8 as rn,aw as on,aC as Xr,cT as nn,ci as Jr,bS as Yr,cn as an}from"./ChHRVjww.js";import"./DRMe5Ypb.js";import{rV as sn,JH as Se,g0 as ln,bE as dn,Ac as un,zu as cn,LI as Fr,dV as fn,bY as gn,LH as vn,v1 as wn,LF as Sr,gI as pn,un as bn,LG as mn,Ll as Lr,LE as Rr}from"./D0qhIm1r.js";import"./CpK0xLH4.js";import{R as hn,g as Yt,h as mt,f as _n,e as Ke,l as Qr,d as eo,K as yn,i as xn,k as Cn,j as In,M as to,E as kn}from"./D7KhILhs.js";import{a as ro,B as $t}from"./B5aYN90J.js";import{bK as Pn}from"./DlnCrS3y.js";import{a5 as En,w as Fn,ah as Sn}from"./ByvcSsIj.js";import{m as Ln,z as Rn}from"./CH7HNVC2.js";import{I as Nt}from"./C3KgmGxd.js";import{d as $n}from"./CQ409-Pj.js";import{H as Tn,I as Un}from"./Bqd7fdCF.js";import{a as An,e as Bn,h as On,g as Nn,k as Mn,p as Dn,b as oo}from"./D4WPlvMg.js";import{e as Vn}from"./DJZIHUd7.js";import{i as ar}from"./CL3a4Hm1.js";import{i as zn,a as Wn}from"./u_H5ILVa.js";import{B as Gn}from"./jphlY6bT.js";import"./Cz3WzTlQ.js";import{l as ze}from"./C7b3vXLD.js";import{M as no}from"./D179JMBI.js";import"./x4bPxhVW.js";import"./BzXQ5SMs.js";import{b as qn}from"./Ch9YoFhc.js";import"./O5ZlQHf9.js";import{t as Hn,b as Kn}from"./CXXVPWBH.js";import{T as jn}from"./B2-ooCTr.js";import{c as Zn,d as Xn}from"./Dbqo6rfT.js";import{o as $r,s as wt,n as Bt}from"./CIyUrgF0.js";import{g as Jn}from"./DWGXN6Nr.js";import{f as Yn}from"./OuI4JmWC.js";import{ay as Qn,$ as ea}from"./50HYkjWD.js";import{a_ as ta}from"./cD292w1o.js";import{i as ra}from"./DKwAaLwd.js";import{o as oa}from"./DdYVblGk.js";function na(o,t){return o.loadURL(t)}function aa(o){return{previousUrlProp:o||null}}function Tr(o,t){o.previousUrlProp=t}function ia(o,t,n){const g=n||t;return o.previousUrlProp===g?null:(o.previousUrlProp=g,g)}function sa(o,t,n){return t?o.previousUrlProp===null?(o.previousUrlProp=t,{shouldLoad:!1,targetUrl:null}):t===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:n.webviewReady?(o.previousUrlProp=t,n.isValidBrowserUrl(t)?{shouldLoad:!0,targetUrl:t}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const ao=Dt("TabBoundsReporter"),la=150;function Qt(o,t,n){!(t>0)||!(n>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:t,height:n}).catch(g=>{ao.debug("Failed to report tab bounds",{tabId:o,error:g})})}function Ur(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(t=>{ao.debug("Failed to clear tab bounds",{tabId:o,error:t})})}function io(o,t){let n=t,g;const m=typeof ResizeObserver>"u"?void 0:new ResizeObserver(P=>{if(!n)return;const b=P[P.length-1]?.contentRect;if(!b)return;const F=n;clearTimeout(g),g=setTimeout(()=>{Qt(F,b.width,b.height)},la)});if(m?.observe(o),n){const P=o.getBoundingClientRect();Qt(n,P.width,P.height)}return{update(P){if(P!==n&&(clearTimeout(g),n&&Ur(n),n=P,n)){const b=o.getBoundingClientRect();Qt(n,b.width,b.height)}},destroy(){clearTimeout(g),m?.disconnect(),n&&Ur(n)}}}function so(o){let t=o.trim();if(!t)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(t)||(t=(t.includes("localhost")||t.includes("127.0.0.1")||t.includes("0.0.0.0")?"http://":"https://")+t);try{return new URL(t),t}catch{return null}}function dt(o,t=typeof window<"u"?window.location.origin:""){return o==="about:blank"||lo(o,t)}function lo(o,t=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const n=new URL(o);return ro.NAVIGATION_ALLOWED.includes(n.protocol)&&n.origin!==t}catch{return!1}}const Mt=[{id:"iphone-se",name:"iPhone SE",category:"phone",width:375,height:667},{id:"iphone-15",name:"iPhone 15",category:"phone",width:393,height:852},{id:"pixel-8",name:"Pixel 8",category:"phone",width:412,height:915},{id:"ipad-mini",name:"iPad Mini",category:"tablet",width:768,height:1024},{id:"ipad-pro-11",name:"iPad Pro 11″",category:"tablet",width:834,height:1194},{id:"desktop-1280x800",name:"1280 × 800",category:"desktop",width:1280,height:800},{id:"desktop-1440x900",name:"1440 × 900",category:"desktop",width:1440,height:900}];function da(o){return{...o,width:o.height,height:o.width}}var ua=re('<span class="min-w-0 flex-1 truncate"> </span> <span class="type-caption ml-3 text-muted-foreground"> </span>',1),er=re("<!> <!> <!>",1),ca=re('<span class="min-w-0 flex-1"> </span> <span class="type-caption text-muted-foreground"> </span>',1),tr=re("<!> <!>",1);function cr(o,t){if(new.target)return je({component:cr,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=v(t,"onCustom",7);const P=["phone","tablet","desktop"],b=f(()=>n().mode==="fit"?"fit":n().mode==="preset"?n().presetId:"custom");function F(u){if(u==="fit")return g()({mode:"fit"});const k=Mt.find(O=>O.id===u);k&&g()({mode:"preset",presetId:k.id,width:k.width,height:k.height})}var A={get viewport(){return n()},set viewport(u){n(u),w()},get onViewportChange(){return g()},set onViewportChange(u){g(u),w()},get onCustom(){return m()},set onCustom(u){m(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)},S=er(),s=H(S);Y(s,()=>hn,(u,k)=>{k(u,{get value(){return e(b)},onValueChange:F,children:(O,x)=>{var I=er(),R=H(I);Y(R,()=>Yt,(G,K)=>{K(G,{value:"fit",children:(oe,te)=>{ht();var X=ct();D(le=>J(X,le),[()=>c.browser_viewport_fitPanel_label()]),C(oe,X)},$$slots:{default:!0}})});var T=h(R,2);Pr(T,17,()=>P,Go,(G,K)=>{var oe=er(),te=H(oe);Y(te,()=>mt,(B,ae)=>{ae(B,{})});var X=h(te,2);Y(X,()=>_n,(B,ae)=>{ae(B,{children:(a,l)=>{ht();var j=ct();D(ue=>J(j,ue),[()=>e(K)==="phone"?c.browser_viewport_phoneGroup_label():e(K)==="tablet"?c.browser_viewport_tabletGroup_label():c.browser_viewport_desktopGroup_label()]),C(a,j)},$$slots:{default:!0}})});var le=h(X,2);Pr(le,17,()=>Mt.filter(B=>B.category===e(K)),B=>B.id,(B,ae)=>{var a=ut(),l=H(a);Y(l,()=>Yt,(j,ue)=>{ue(j,{get value(){return e(ae).id},children:(Ie,he)=>{var M=ua(),_=H(M),Z=ke(_,!0),V=h(_,2),z=ke(V,!0);D(y=>{J(Z,e(ae).name),J(z,y)},[()=>c.browser_viewport_dimensions_label({width:ze(e(ae).width),height:ze(e(ae).height)})]),C(Ie,M)},$$slots:{default:!0}})}),C(B,a)}),C(G,oe)});var ee=h(T,2);{var ge=G=>{var K=tr(),oe=H(K);Y(oe,()=>mt,(X,le)=>{le(X,{})});var te=h(oe,2);Y(te,()=>Yt,(X,le)=>{le(X,{value:"custom",get onSelect(){return m()},children:(B,ae)=>{var a=ca(),l=H(a),j=ke(l,!0),ue=h(l,2),Ie=ke(ue,!0);D((he,M)=>{J(j,he),J(Ie,M)},[()=>c.browser_viewport_custom_label(),()=>c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})]),C(B,a)},$$slots:{default:!0}})}),C(G,K)};be(ee,G=>{n().mode==="custom"&&G(ge)})}C(O,I)},$$slots:{default:!0}})});var L=h(s,2);{var Q=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);Y(x,()=>Ke,(I,R)=>{R(I,{get onSelect(){return m()},children:(T,ee)=>{ht();var ge=ct();D(G=>J(ge,G),[()=>c.browser_viewport_custom_label()]),C(T,ge)},$$slots:{default:!0}})}),C(u,k)};be(L,u=>{n().mode!=="custom"&&u(Q)})}var U=h(L,2);{var $=u=>{var k=tr(),O=H(k);Y(O,()=>mt,(I,R)=>{R(I,{})});var x=h(O,2);{let I=f(()=>c.browser_viewport_rotate_label());Y(x,()=>no,(R,T)=>{T(R,{get icon(){return jr},get label(){return e(I)},onSelect:()=>g()(da(n()))})})}C(u,k)};be(U,u=>{n().mode!=="fit"&&u($)})}return C(o,S),Ye(A)}var fa=re('<div class="grid grid-cols-2 gap-3"><label class="space-y-1 type-caption"><span> </span> <!></label> <label class="space-y-1 type-caption"><span> </span> <!></label></div>');function fr(o,t){if(new.target)return je({component:fr,...o});Je(t,!0);let n=v(t,"open",15,!1),g=v(t,"viewport",7),m=v(t,"onViewportChange",7),P=v(t,"returnFocus",7);const b=320,F=3840;let A=W(1280),S=W(800),s=W(null);function L(u){return typeof u=="number"&&Number.isInteger(u)&&u>=b&&u<=F}const Q=f(()=>L(e(A))&&L(e(S)));Ue(()=>{if(n())return()=>{It().then(()=>{P()?.isConnected&&P().focus()})}}),Ue(()=>{n()||(d(A,g().mode==="fit"?1280:g().width,!0),d(S,g().mode==="fit"?800:g().height,!0))});function U(){!e(Q)||e(A)===null||e(S)===null||(m()({mode:"custom",width:e(A),height:e(S)}),n(!1))}var $={get open(){return n()},set open(u=!1){n(u),w()},get viewport(){return g()},set viewport(u){g(u),w()},get onViewportChange(){return m()},set onViewportChange(u){m(u),w()},get returnFocus(){return P()},set returnFocus(u){P(u),w()},$set:Ze,$on:(u,k)=>Xe(t,u,k)};{let u=f(()=>c.browser_viewport_custom_label()),k=f(()=>c.browser_viewport_sizeRange_description({min:ze(b),max:ze(F)})),O=f(()=>c.browser_viewport_apply_label());qn(o,{get title(){return e(u)},get description(){return e(k)},get submitLabel(){return e(O)},get canSubmit(){return e(Q)},onSubmit:U,get initialFocus(){return e(s)},get open(){return n()},set open(x){n(x)},children:(x,I)=>{var R=fa(),T=ie(R),ee=ie(T),ge=ke(ee,!0),G=h(ee,2);{let le=f(()=>!L(e(A)));Nt(G,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(A)},set value(B){d(A,B,!0)},get ref(){return e(s)},set ref(B){d(s,B,!0)}})}se(T);var K=h(T,2),oe=ie(K),te=ke(oe,!0),X=h(oe,2);{let le=f(()=>!L(e(S)));Nt(X,{type:"number",min:b,max:F,step:"1",get"aria-invalid"(){return e(le)},get value(){return e(S)},set value(B){d(S,B,!0)}})}se(K),se(R),D((le,B)=>{J(ge,le),J(te,B)},[()=>c.browser_viewport_width_label(),()=>c.browser_viewport_height_label()]),C(x,R)},$$slots:{default:!0}})}return Ye($)}var Ot=re("<!> <!>",1),ot=re("<!> ",1),ga=re('<!> <span class="min-w-0 flex-1 truncate"> </span>',1),va=re("<!> <!> <!> <!> <!>",1),wa=re('<!> <span class="min-w-0 flex-1"> </span> <kbd class="type-caption ml-5 text-muted-foreground" aria-hidden="true">⌘⌥I</kbd>',1),pa=re("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1);function uo(o,t){if(new.target)return je({component:uo,...o});Je(t,!0);let n=v(t,"errorCount",7,0),g=v(t,"disabled",7,!1),m=v(t,"collapsed",7,!1),P=v(t,"canGoBack",7,!1),b=v(t,"canGoForward",7,!1),F=v(t,"canSelectElement",7,!1),A=v(t,"selectingElement",7,!1),S=v(t,"viewport",23,()=>({mode:"fit"})),s=v(t,"onGoBack",7),L=v(t,"onGoForward",7),Q=v(t,"onToggleElementPicker",7),U=v(t,"onViewportChange",7),$=v(t,"onOpenExternal",7),u=v(t,"onFullScreen",7),k=v(t,"onCopyUrl",7),O=v(t,"onScreenshot",7),x=v(t,"onOpenConsole",7),I=v(t,"onOpenSource",7),R=v(t,"onOpenInspector",7),T=v(t,"onReloadWithoutCache",7);const ee=f(()=>n()>0?c.browser_overflow_triggerWithErrors_ariaLabel({count:ze(n())}):c.browser_overflow_trigger_ariaLabel()),ge=f(()=>S().mode==="preset"?Mt.find(l=>l.id===S().presetId):void 0),G=f(()=>S().mode==="fit"?c.browser_viewport_fitPanel_label():e(ge)?.name??c.browser_viewport_dimensions_label({width:ze(S().width),height:ze(S().height)}));let K=W(!1),oe=W(null),te=W(!1);async function X(){d(te,!1),await It(),d(K,!0)}var le={get errorCount(){return n()},set errorCount(l=0){n(l),w()},get disabled(){return g()},set disabled(l=!1){g(l),w()},get collapsed(){return m()},set collapsed(l=!1){m(l),w()},get canGoBack(){return P()},set canGoBack(l=!1){P(l),w()},get canGoForward(){return b()},set canGoForward(l=!1){b(l),w()},get canSelectElement(){return F()},set canSelectElement(l=!1){F(l),w()},get selectingElement(){return A()},set selectingElement(l=!1){A(l),w()},get viewport(){return S()},set viewport(l={mode:"fit"}){S(l),w()},get onGoBack(){return s()},set onGoBack(l){s(l),w()},get onGoForward(){return L()},set onGoForward(l){L(l),w()},get onToggleElementPicker(){return Q()},set onToggleElementPicker(l){Q(l),w()},get onViewportChange(){return U()},set onViewportChange(l){U(l),w()},get onOpenExternal(){return $()},set onOpenExternal(l){$(l),w()},get onFullScreen(){return u()},set onFullScreen(l){u(l),w()},get onCopyUrl(){return k()},set onCopyUrl(l){k(l),w()},get onScreenshot(){return O()},set onScreenshot(l){O(l),w()},get onOpenConsole(){return x()},set onOpenConsole(l){x(l),w()},get onOpenSource(){return I()},set onOpenSource(l){I(l),w()},get onOpenInspector(){return R()},set onOpenInspector(l){R(l),w()},get onReloadWithoutCache(){return T()},set onReloadWithoutCache(l){T(l),w()},$set:Ze,$on:(l,j)=>Xe(t,l,j)},B=Ot(),ae=H(B);Y(ae,()=>to,(l,j)=>{j(l,{get open(){return e(te)},set open(ue){d(te,ue,!0)},children:(ue,Ie)=>{var he=Ot(),M=H(he);{const Z=(V,z)=>{let y=()=>(z?.()).props;{let q=f(()=>c.browser_overflow_trigger_tooltip());Oe(V,lr(y,{variant:"ghost-light",size:"icon-xs",class:"relative",get disabled(){return g()},get tooltip(){return e(q)},tooltipSide:"bottom",get"aria-label"(){return e(ee)},"data-testid":"browser-overflow-trigger",get ref(){return e(oe)},set ref(E){d(oe,E,!0)},children:(E,Pe)=>{var fe=Ot(),Qe=H(fe);yn(Qe,{class:"size-3.5"});var nt=h(Qe,2);{var We=Fe=>{Gn(Fe,{variant:"destructive",class:"absolute -right-1.5 -top-1.5 h-4 min-w-4 px-1 text-xs leading-none","data-testid":"browser-console-error-badge",children:(Ge,at)=>{ht();var it=ct();D(Me=>J(it,Me),[()=>n()>9?"9+":ze(n())]),C(Ge,it)},$$slots:{default:!0}})};be(nt,Fe=>{n()>0&&Fe(We)})}C(E,fe)},$$slots:{default:!0}}))}};Y(M,()=>Qr,(V,z)=>{z(V,{child:Z,$$slots:{child:!0}})})}var _=h(M,2);Y(_,()=>eo,(Z,V)=>{V(Z,{align:"end",class:"w-56",onCloseAutoFocus:z=>e(K)&&z.preventDefault(),children:(z,y)=>{var q=pa(),E=H(q);{var Pe=ve=>{var we=va(),Ee=H(we);{let ce=f(()=>!P());Y(Ee,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return s()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return dr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goBack_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var Re=h(Ee,2);{let ce=f(()=>!b());Y(Re,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},get onSelect(){return L()},children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return ur},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>c.browser_embedded_goForward_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var pe=h(Re,2);{let ce=f(()=>!F());Y(pe,()=>Ke,(xe,De)=>{De(xe,{get disabled(){return e(ce)},onSelect:()=>void Q()?.(),children:(Ne,st)=>{var Ce=ot(),He=H(Ce);ye(He,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var et=h(He);D(Ve=>J(et,` ${Ve??""}`),[()=>A()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel()]),C(Ne,Ce)},$$slots:{default:!0}})})}var me=h(pe,2);Y(me,()=>xn,(ce,xe)=>{xe(ce,{children:(De,Ne)=>{var st=Ot(),Ce=H(st);{let et=f(()=>!U());Y(Ce,()=>Cn,(Ve,ft)=>{ft(Ve,{get disabled(){return e(et)},children:(St,gt)=>{var Pt=ga(),Et=H(Pt);ye(Et,{get icon(){return Zr},size:"xs",class:"w-4 text-muted-foreground"});var Ft=h(Et,2),Ut=ke(Ft,!0);D(Lt=>J(Ut,Lt),[()=>c.browser_viewport_trigger_ariaLabel({mode:e(G)})]),C(St,Pt)},$$slots:{default:!0}})})}var He=h(Ce,2);Y(He,()=>In,(et,Ve)=>{Ve(et,{class:"w-64",children:(ft,St)=>{cr(ft,{get viewport(){return S()},onViewportChange:gt=>U()?.(gt),onCustom:X})},$$slots:{default:!0}})}),C(De,st)},$$slots:{default:!0}})});var Ae=h(me,2);Y(Ae,()=>mt,(ce,xe)=>{xe(ce,{})}),C(ve,we)};be(E,ve=>{m()&&ve(Pe)})}var fe=h(E,2);{var Qe=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>u()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return tn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_fullScreen_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)},nt=ve=>{var we=ut(),Ee=H(we);Y(Ee,()=>Ke,(Re,pe)=>{pe(Re,{onSelect:()=>void $()(),children:(me,Ae)=>{var ce=ot(),xe=H(ce);ye(xe,{get icon(){return rn},size:"xs",class:"w-4 text-muted-foreground"});var De=h(xe);D(Ne=>J(De,` ${Ne??""}`),[()=>c.browser_overflow_openExternal_label()]),C(me,ce)},$$slots:{default:!0}})}),C(ve,we)};be(fe,ve=>{u()?ve(Qe):$()&&ve(nt,1)})}var We=h(fe,2);Y(We,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void k()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Jo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_copyUrl_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Fe=h(We,2);Y(Fe,()=>mt,(ve,we)=>{we(ve,{})});var Ge=h(Fe,2);Y(Ge,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void O()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Yo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_screenshot_label()]),C(Ee,pe)},$$slots:{default:!0}})});var at=h(Ge,2);Y(at,()=>mt,(ve,we)=>{we(ve,{})});var it=h(at,2);Y(it,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void x()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return Qo},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_console_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Me=h(it,2);Y(Me,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void I()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return en},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_source_label()]),C(Ee,pe)},$$slots:{default:!0}})});var qe=h(Me,2);Y(qe,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void R()(),children:(Ee,Re)=>{var pe=wa(),me=H(pe);ye(me,{get icon(){return nr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me,2),ce=ke(Ae,!0);ht(2),D(xe=>J(ce,xe),[()=>c.browser_overflow_inspector_label()]),C(Ee,pe)},$$slots:{default:!0}})});var Le=h(qe,2);Y(Le,()=>mt,(ve,we)=>{we(ve,{})});var _t=h(Le,2);Y(_t,()=>Ke,(ve,we)=>{we(ve,{onSelect:()=>void T()(),children:(Ee,Re)=>{var pe=ot(),me=H(pe);ye(me,{get icon(){return jr},size:"xs",class:"w-4 text-muted-foreground"});var Ae=h(me);D(ce=>J(Ae,` ${ce??""}`),[()=>c.browser_overflow_reloadWithoutCache_label()]),C(Ee,pe)},$$slots:{default:!0}})}),C(z,q)},$$slots:{default:!0}})}),C(ue,he)},$$slots:{default:!0}})});var a=h(ae,2);return fr(a,{get viewport(){return S()},onViewportChange:l=>U()?.(l),get returnFocus(){return e(oe)},get open(){return e(K)},set open(l){d(K,l,!0)}}),C(o,B),Ye(le)}var ba=re('<span class="truncate"> </span> <!>',1),Ar=re("<!> <!>",1);function co(o,t){if(new.target)return je({component:co,...o});Je(t,!0);let n=v(t,"viewport",7),g=v(t,"onViewportChange",7),m=W(!1),P=W(!1),b=W(null);const F=f(()=>n().mode==="preset"?Mt.find(k=>k.id===n().presetId):void 0),A=f(()=>n().mode==="fit"?"":c.browser_viewport_dimensions_label({width:ze(n().width),height:ze(n().height)})),S=f(()=>n().mode==="fit"?c.browser_viewport_fit_short_label():n().mode==="preset"&&e(F)?e(F).name:e(A)),s=f(()=>n().mode==="fit"?c.browser_viewport_fitPanel_label():e(S));async function L(){d(m,!1),await It(),d(P,!0)}var Q={get viewport(){return n()},set viewport(k){n(k),w()},get onViewportChange(){return g()},set onViewportChange(k){g(k),w()},$set:Ze,$on:(k,O)=>Xe(t,k,O)},U=Ar(),$=H(U);Y($,()=>to,(k,O)=>{O(k,{get open(){return e(m)},set open(x){d(m,x,!0)},children:(x,I)=>{var R=Ar(),T=H(R);{const ge=(G,K)=>{let oe=()=>(K?.()).props;{let te=f(()=>c.browser_viewport_trigger_ariaLabel({mode:e(s)}));Oe(G,lr(oe,{variant:"ghost-light",size:"xs",class:"h-6 max-w-36 gap-1 rounded-full bg-muted px-2 text-xs hover:bg-muted/80",get"aria-label"(){return e(te)},"data-testid":"browser-viewport-trigger",get ref(){return e(b)},set ref(X){d(b,X,!0)},children:(X,le)=>{var B=ba(),ae=H(B),a=ke(ae,!0),l=h(ae,2);ye(l,{get icon(){return on},size:"xs",class:"shrink-0"}),D(()=>J(a,e(S))),C(X,B)},$$slots:{default:!0}}))}};Y(T,()=>Qr,(G,K)=>{K(G,{child:ge,$$slots:{child:!0}})})}var ee=h(T,2);Y(ee,()=>eo,(ge,G)=>{G(ge,{align:"end",class:"w-64",onCloseAutoFocus:K=>e(P)&&K.preventDefault(),children:(K,oe)=>{cr(K,{get viewport(){return n()},get onViewportChange(){return g()},onCustom:L})},$$slots:{default:!0}})}),C(x,R)},$$slots:{default:!0}})});var u=h($,2);return fr(u,{get viewport(){return n()},get onViewportChange(){return g()},get returnFocus(){return e(b)},get open(){return e(P)},set open(k){d(P,k,!0)}}),C(o,U),Ye(Q)}var ma=re('<span data-browser-viewport-readout=""> </span> <!>',1),ha=re('<div data-browser-device-frame-container=""><div><div><!> <!></div> <!></div></div>');function fo(o,t){if(new.target)return je({component:fo,...o});Je(t,!0);const n=320,g=3840,m=150,P=24;let b=v(t,"viewport",7),F=v(t,"onViewportChange",7),A=v(t,"chromeOutside",7,!1),S=v(t,"children",7),s=W(Rt(b().mode==="fit"?n:b().width)),L=W(Rt(b().mode==="fit"?n:b().height)),Q,U=W(0),$=W(0),u=W(!1),k=null,O=0,x=0,I=0,R=0,T;const ee=f(()=>b().mode==="fit"),ge=f(()=>c.browser_viewport_dimensions_label({width:ze(e(s)),height:ze(e(L))})),G=f(()=>A()?Math.max(0,e($)-P):e($)),K=f(()=>!e(ee)&&e(U)>0&&e(G)>0?Math.min(1,e(U)/e(s),e(G)/e(L)):1),oe=f(()=>e(s)*e(K)),te=f(()=>e(L)*e(K));Ue(()=>{e(u)||b().mode==="fit"||(d(s,b().width,!0),d(L,b().height,!0))});function X(y){return Math.min(g,Math.max(n,Math.round(y)))}function le(){F()({mode:"custom",width:e(s),height:e(L)})}function B(){clearTimeout(T),T=setTimeout(le,m)}function ae(y){e(ee)||y.button!==0||(y.preventDefault(),d(u,!0),k=y.pointerId,O=y.clientX,x=y.clientY,I=e(s),R=e(L),y.currentTarget instanceof HTMLElement&&y.currentTarget.setPointerCapture?.(y.pointerId))}function a(y){!e(u)||y.pointerId!==k||(d(s,X(I+y.clientX-O),!0),d(L,X(R+y.clientY-x),!0),B())}function l(y){if(!e(u)||y.pointerId!==k)return;clearTimeout(T),d(u,!1),k=null;const q=y.currentTarget;q instanceof HTMLElement&&q.hasPointerCapture?.(y.pointerId)&&q.releasePointerCapture&&q.releasePointerCapture(y.pointerId),le()}qr(()=>{const y=(E,Pe)=>{d(U,E,!0),d($,Pe,!0)};y(Q.clientWidth,Q.clientHeight);const q=typeof ResizeObserver>"u"?void 0:new ResizeObserver(([E])=>{y(E?.contentRect.width??Q.clientWidth,E?.contentRect.height??Q.clientHeight)});return q?.observe(Q),()=>q?.disconnect()}),Hr(()=>clearTimeout(T));var j={get viewport(){return b()},set viewport(y){b(y),w()},get onViewportChange(){return F()},set onViewportChange(y){F(y),w()},get chromeOutside(){return A()},set chromeOutside(y=!1){A(y),w()},get children(){return S()},set children(y){S(y),w()},$set:Ze,$on:(y,q)=>Xe(t,y,q)},ue=ha();{const y=E=>{var Pe=ma(),fe=H(Pe),Qe=ke(fe,!0),nt=h(fe,2);{let We=f(()=>A()?"top-full":"bottom-0"),Fe=f(()=>c.browser_viewport_resizeHandle_ariaLabel());Oe(nt,{type:"button",variant:"ghost",size:"icon-xs",iconOnly:!0,get class(){return`absolute right-0 z-20 size-5 cursor-nwse-resize touch-none border-0 bg-transparent p-0 after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b-2 after:border-r-2 after:border-muted-foreground ${e(We)??""}`},get"aria-label"(){return e(Fe)},"data-testid":"browser-device-resize-handle",onpointerdown:ae,onpointermove:a,onpointerup:l,onpointercancel:l})}D(()=>{xt(fe,1,`pointer-events-none absolute left-1/2 z-10 -translate-x-1/2 rounded bg-background/90 px-1.5 py-0.5 text-xs text-muted-foreground shadow-sm backdrop-blur ${A()?"top-full mt-0.5":"bottom-1"}`),J(Qe,e(ge))}),C(E,Pe)};var Ie=ie(ue),he=ie(Ie);let q;var M=ie(he);Xo(M,()=>S()??zo);var _=h(M,2);{var Z=E=>{y(E)};be(_,E=>{!e(ee)&&!A()&&E(Z)})}se(he);var V=h(he,2);{var z=E=>{y(E)};be(V,E=>{!e(ee)&&A()&&E(z)})}se(Ie),se(ue),kt(ue,E=>Q=E,()=>Q),D(()=>{xt(Ie,1,`relative ${e(ee)?"h-full w-full":""} ${A()&&!e(ee)?"mb-6":""}`),xt(he,1,`relative overflow-hidden bg-background ${e(ee)?"h-full w-full":e(u)?"ring-2 ring-primary/30":""}`),Be(he,"data-browser-device-frame",e(ee)?void 0:""),Be(he,"data-width",e(ee)?void 0:e(s)),Be(he,"data-height",e(ee)?void 0:e(L)),q=Ho(he,"",q,{width:e(ee)?void 0:`${e(oe)}px`,height:e(ee)?void 0:`${e(te)}px`})})}return D(()=>xt(ue,1,`flex h-full w-full items-center justify-center overflow-hidden ${e(ee)?"bg-background":"bg-muted/40"}`)),C(o,ue),Ye(j)}const rr=Dt("BrowserViewSlot"),Br=()=>new Promise(o=>requestAnimationFrame(()=>o())),Or=async()=>{await Br(),await Br()};function Nr(o,t){return o===t?!0:!o||!t?!1:o.x===t.x&&o.y===t.y&&o.width===t.width&&o.height===t.height}function Mr(o){const t=o.getBoundingClientRect();return t.width<=0||t.height<=0?null:{x:t.left,y:t.top,width:t.width,height:t.height}}function _a(o){return o.isConnected?typeof o.checkVisibility=="function"?o.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):!0:!1}function ya(o,t){let n=Dr(o,t),g=`${t.workspaceId}\0${t.tabId}`;return{update(m){const P=`${m.workspaceId}\0${m.tabId}`;if(P===g){n.update(m);return}n.destroy(),g=P,n=Dr(o,m)},destroy(){n.destroy()}}}function Dr(o,t){let n=t;const g=An(o,{tabId:n.tabId,workspaceId:n.workspaceId,url:n.url,...n.pinned===void 0?{}:{pinned:n.pinned}});n.onWebview?.(g.webview);let m=null,P=Promise.resolve(),b="live",F=0,A=null,S=null,s=!1;const L=()=>{A?.remove(),A=null},Q=x=>{m=x;const I=n.tabId;return P=On(I,x.rect,x.visible).catch(R=>rr.debug("Could not place the browser page",{tabId:I,error:R})),P},U=()=>{if(S=null,s)return;const x=Mr(o),I=n.visible&&x!==null&&_a(o)&&b!=="frozen"&&g.ready;g.ready&&(!m||m.visible!==I||x&&!Nr(m.rect,x))&&(Nr(m?.rect??null,x)||Kn(),Q({rect:x??m?.rect??null,visible:I})),S=requestAnimationFrame(U)};S=requestAnimationFrame(U);const $=async x=>{if(b="freezing",g.ready&&m?.visible)try{const I=await g.webview.capturePage?.();if(x!==F||s)return;const R=I?.toDataURL()??"";if(R){const T=document.createElement("img");if(T.alt="",T.setAttribute("aria-hidden","true"),T.dataset.browserViewSnapshot="",T.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;",T.src=R,await T.decode().catch(()=>{}),x!==F||s||(L(),o.append(T),A=T,await Or(),x!==F||s))return}}catch(I){rr.debug("Could not snapshot the browser page",{tabId:n.tabId,error:I})}x!==F||s||(b="frozen")},u=async x=>{if(b="thawing",g.ready&&n.visible){const I=Mr(o);I&&await Q({rect:I,visible:!0}),await Or()}x!==F||s||(L(),b="live")},k=Hn({element:o,onCoveredChange(x){const I=++F;x?$(I):u(I)}});return{update(x){n=x},destroy:()=>{const x=n.tabId;s=!0,S!==null&&cancelAnimationFrame(S),S=null,k(),L(),g.dispose(),n.onWebview?.(null),P.then(()=>Bn(x).catch(I=>rr.debug("Could not take the browser page off screen",{tabId:x,error:I})))}}}var xa=re('<div class="relative h-full w-full overflow-hidden"></div>');function go(o,t){if(new.target)return je({component:go,...o});Je(t,!0);let n=v(t,"tabId",7),g=v(t,"workspaceId",7),m=v(t,"url",7),P=v(t,"pinned",7),b=v(t,"visible",7),F=v(t,"webview",15,null);var A={get tabId(){return n()},set tabId(s){n(s),w()},get workspaceId(){return g()},set workspaceId(s){g(s),w()},get url(){return m()},set url(s){m(s),w()},get pinned(){return P()},set pinned(s){P(s),w()},get visible(){return b()},set visible(s){b(s),w()},get webview(){return F()},set webview(s=null){F(s),w()},$set:Ze,$on:(s,L)=>Xe(t,s,L)},S=xa();return Ct(S,(s,L)=>ya?.(s,L),()=>({tabId:n(),workspaceId:g(),url:m(),...P()===void 0?{}:{pinned:P()},visible:b(),onWebview:s=>F(s)})),Ct(S,(s,L)=>io?.(s,L),n),D(()=>Be(S,"data-browser-view-slot",n())),C(o,S),Ye(A)}function vo(o,t){if(new.target)return je({component:vo,...o});Je(t,!0);let n=v(t,"active",7),g=v(t,"disabled",7),m=v(t,"onToggle",7);var P={get active(){return n()},set active(b){n(b),w()},get disabled(){return g()},set disabled(b){g(b),w()},get onToggle(){return m()},set onToggle(b){m(b),w()},$set:Ze,$on:(b,F)=>Xe(t,b,F)};{let b=f(()=>n()?"bg-muted text-foreground":""),F=f(()=>n()?c.browser_embedded_cancelElementSelection_tooltip():c.browser_embedded_selectElement_tooltip()),A=f(()=>n()?c.browser_embedded_cancelElementSelection_ariaLabel():c.browser_embedded_selectElement_ariaLabel());Oe(o,{variant:"ghost-light",size:"icon-xs",get class(){return e(b)},get onclick(){return m()},get disabled(){return g()},get tooltip(){return e(F)},tooltipSide:"bottom",get"aria-label"(){return e(A)},get"aria-pressed"(){return n()},"data-testid":"browser-select-element",children:(S,s)=>{ye(S,{get icon(){return nr},size:"xs"})},$$slots:{default:!0}})}return Ye(P)}var Ca=re('<span class="sr-only"> </span>'),Ia=re('<p class="min-h-0 overflow-y-auto text-sm text-foreground [overflow-wrap:anywhere]"> </p> <!>',1),ka=re("<!> <!>",1),Pa=re('<span class="inline-flex shrink-0"><!> <!></span>');function gr(o,t){const n=Kr();if(new.target)return je({component:gr,...o});Je(t,!0);let g=v(t,"label",7),m=v(t,"description",7),P=v(t,"ariaLabel",23,g),b=v(t,"tone",7,"info"),F=v(t,"actionLabel",7),A=v(t,"onAction",7),S=v(t,"actionFocusTarget",7),s=v(t,"descriptionId",7),L=W(!1),Q=!1;async function U(){Q=!0,d(L,!1),await It(),S()?.focus(),A()?.()}var $={get label(){return g()},set label(I){g(I),w()},get description(){return m()},set description(I){m(I),w()},get ariaLabel(){return P()},set ariaLabel(I=g){P(I),w()},get tone(){return b()},set tone(I="info"){b(I),w()},get actionLabel(){return F()},set actionLabel(I){F(I),w()},get onAction(){return A()},set onAction(I){A(I),w()},get actionFocusTarget(){return S()},set actionFocusTarget(I){S(I),w()},get descriptionId(){return s()},set descriptionId(I){s(I),w()},$set:Ze,$on:(I,R)=>Xe(t,I,R)},u=Pa(),k=ie(u);{var O=I=>{var R=Ca(),T=ke(R,!0);D(()=>{Be(R,"id",n),Be(R,"role",b()==="error"?"alert":"status"),J(T,m())}),C(I,R)};be(k,I=>{s()||I(O)})}var x=h(k,2);return Y(x,()=>Xn,(I,R)=>{R(I,{get open(){return e(L)},set open(T){d(L,T,!0)},children:(T,ee)=>{var ge=ka(),G=H(ge);{const oe=(te,X)=>{let le=()=>(X?.()).props;{let B=f(()=>b()==="error"?"text-danger":b()==="warning"?"text-warning-ink":"text-muted-foreground"),ae=f(()=>s()??n);Oe(te,lr(le,{variant:"ghost-light",size:"icon-compact",wrapContent:!1,get class(){return e(B)},get"aria-label"(){return P()},get"aria-describedby"(){return e(ae)},get tooltip(){return m()},get tooltipDisabled(){return e(L)},tooltipSide:"bottom",tooltipDelayDuration:300,children:(a,l)=>{{let j=f(()=>b()==="error"?Xr:b()==="warning"?nn:Zr);ye(a,{get icon(){return e(j)},size:"xs",class:"shrink-0"})}},$$slots:{default:!0}}))}};Y(G,()=>jn,(te,X)=>{X(te,{child:oe,$$slots:{child:!0}})})}var K=h(G,2);Y(K,()=>Zn,(oe,te)=>{te(oe,{align:"end",class:"flex max-h-[var(--bits-popover-content-available-height,calc(100dvh-1rem))] w-72 max-w-[calc(100vw-1rem)] flex-col gap-3 p-3",get"aria-label"(){return P()},onCloseAutoFocus:X=>{Q&&S()&&(X.preventDefault(),S().focus()),Q=!1},children:(X,le)=>{var B=Ia(),ae=H(B),a=ke(ae,!0),l=h(ae,2);{var j=ue=>{Oe(ue,{variant:"secondary",size:"sm",class:"self-start",onclick:()=>void U(),children:(Ie,he)=>{ht();var M=ct();D(()=>J(M,F())),C(Ie,M)},$$slots:{default:!0}})};be(l,ue=>{F()&&A()&&ue(j)})}D(()=>J(a,m())),C(X,B)},$$slots:{default:!0}})}),C(T,ge)},$$slots:{default:!0}})}),se(u),D(()=>Be(u,"data-browser-status",b())),C(o,u),Ye($)}function Ea(o,t,n){const g=n.width>0?t.width/n.width:1,m=n.height>0?t.height/n.height:1,P=Math.max(0,Math.floor(o.x*g)),b=Math.max(0,Math.floor(o.y*m)),F=Math.min(t.width,Math.ceil((o.x+o.width)*g)),A=Math.min(t.height,Math.ceil((o.y+o.height)*m));return{x:P,y:b,width:Math.max(0,F-P),height:Math.max(0,A-b)}}const Fa=$r({selector:wt().min(1),domPath:wt().min(1),tagName:wt().min(1),id:wt(),className:wt(),textSnippet:wt().max(120),rect:$r({x:Bt().finite(),y:Bt().finite(),width:Bt().finite().nonnegative(),height:Bt().finite().nonnegative()}).strict(),pageUrl:wt().min(1),sourceRef:wt().min(1).optional()}).strict(),Vr="__INTENT_ELEMENT_PICKED__:";function Sa(o){if(o==="__INTENT_ELEMENT_PICK_CANCELLED__")return{type:"cancelled"};if(!o.startsWith(Vr))return null;let t;try{t=JSON.parse(o.slice(Vr.length))}catch{t=null}const n=Fa.safeParse(t);return n.success?{type:"picked",element:n.data}:{type:"malformed",issues:n.error.issues}}const La=String.raw`
|
|
2
2
|
(function() {
|
|
3
3
|
var PICKED_PREFIX = '__INTENT_ELEMENT_PICKED__:';
|
|
4
4
|
var CANCELLED = '__INTENT_ELEMENT_PICK_CANCELLED__';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var cQ=Object.defineProperty;var NB=Q=>{throw TypeError(Q)};var LQ=(Q,A,B)=>A in Q?cQ(Q,A,{enumerable:!0,configurable:!0,writable:!0,value:B}):Q[A]=B;var x=(Q,A,B)=>LQ(Q,typeof A!="symbol"?A+"":A,B),CB=(Q,A,B)=>A.has(Q)||NB("Cannot "+B);var g=(Q,A,B)=>(CB(Q,A,"read from private field"),B?B.call(Q):A.get(Q)),c=(Q,A,B)=>A.has(Q)?NB("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(Q):A.set(Q,B),M=(Q,A,B,E)=>(CB(Q,A,"write to private field"),E?E.call(Q,B):A.set(Q,B),B),D=(Q,A,B)=>(CB(Q,A,"access private method"),B);var HB=(Q,A,B,E)=>({set _(I){M(Q,A,I,B)},get _(){return g(Q,A,E)}});import{a3 as tQ,r as hQ,Q as jQ}from"./uyQciu7h.js";import{B as oQ,D as YQ}from"./Cn4-Fvkn.js";const T=["none","attribute","attribute.jsx","boolean","comment","comment.doc","constant","constant.builtin","constructor","diff.minus","diff.plus","embedded","emphasis","emphasis.strong","function","function.definition","function.method","keyword","keyword.control","keyword.declaration","keyword.import","keyword.operator","label","namespace","number","operator","predictive","preproc","primary","property","property.json_key","punctuation","punctuation.bracket","punctuation.bracket.html","punctuation.bracket.jsx","punctuation.delimiter","punctuation.delimiter.html","punctuation.delimiter.jsx","punctuation.list_marker","punctuation.markup","punctuation.special","selector","selector.class","selector.id","string","string.escape","string.regex","string.special","string.special.symbol","tag","tag.doctype","tag.jsx","text.jsx","text.literal","title","type","type.builtin","type.class","variable","variable.parameter","variable.special","enum","hint","keyword.jsdoc","link_text","link_uri","selector.pseudo","tag.component.jsx","type.jsdoc","variable.jsdoc","variant","background","foreground"],aQ="--hls-",NQ=new TextEncoder,HQ=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,nQ=/^color\(display-p3\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:\s*\/\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+))?\s*\)$/i;function ZQ(Q){return typeof Q=="string"&&(HQ.test(Q.trim())||nQ.test(Q.trim()))}function FB(Q){return Q["editor.foreground"]??Q.text??Q.foreground}function uB(Q){return Q["editor.background"]??Q.background}const YB=["black","red","green","yellow","blue","magenta","cyan","white","bright_black","bright_red","bright_green","bright_yellow","bright_blue","bright_magenta","bright_cyan","bright_white"],eQ=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function dQ(Q){return YB.map((A,B)=>zB({foreground:Q[`terminal.ansi.${A}`]},"foreground").color??eQ[B])}function OB(Q){return Q===null?"null":Q===void 0?"undefined":typeof Q=="string"?`the string ${JSON.stringify(Q)} (theme ids are not supported; import the theme object from "@pierre/highlights/themes")`:Array.isArray(Q)?"an array":typeof Q=="object"?"themes"in Q&&Array.isArray(Q.themes)?`a ThemeFamily whose first member is ${OB(Q.themes[0])}`:"an object without a `name`":`a ${typeof Q}`}function lQ(Q){return Q!=null&&typeof Q=="object"&&"name"in Q&&typeof Q.name=="string"&&Q.name!==""}function xQ(Q){const A=Q!=null&&typeof Q=="object"&&"themes"in Q&&Q.themes!=null?Q.themes[0]:Q;if(!lQ(A))throw new TypeError(`invalid theme: expected a Theme or ThemeFamily object, received ${OB(Q)}`);return A}function vB(Q,A){let B;for(let E=A;E!=="";){const I=Q[E];if(typeof I=="string")return{...B,color:I};if(I!=null&&typeof I=="object"&&(B??=I,I.color!=null))return{...B,color:I.color};const C=E.lastIndexOf(".");E=C<0?"":E.slice(0,C)}return B}function zB(Q,A){let B,E,I;return A==="background"?B=uB(Q):A==="foreground"?B=FB(Q):({color:B,font_style:E,font_weight:I}=vB(Q.syntax??{},A)??{},(E!=null||I!=null)&&(B??=FB(Q))),ZQ(B)?(B=B.trim().toLowerCase(),B.startsWith("#")&&(B.length<=5&&(B=B.replace(/[^#]/g,"$&$&")),B.length===9&&B.endsWith("ff")&&(B=B.slice(0,7)),B==="#00000000"&&(B=void 0))):B=void 0,{color:B,italic:E==="italic",weight:I!=null&&I>=100&&I<=900?Math.round(I/100)*100:0}}function zA(Q,A){return`var(${A}${Q.replace(/[._]/g,"-")})`}function gA(Q){return Q.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">")}function $B(Q){const A=Q.map(w=>NQ.encode(w));let B=4+8*A.length;const E=new Uint8Array(B+A.reduce((w,G)=>w+G.length,0)),I=new DataView(E.buffer);let C=32;for(let w=0;w<A.length;w++)I.setUint32(4+8*w,B,!0),I.setUint32(8+8*w,A[w].length,!0),E.set(A[w],B),B+=A[w].length,w!==0&&(C=Math.max(C,A[w].length+32));return I.setUint32(0,C,!0),E}const nB=new WeakMap;function SB(Q,A=aQ){const B=xQ(Q),E=B.cssVariables===!0?A:"";let I=nB.get(B);const C=I?.get(E);if(C!==void 0)return C;const w=B.cssVariables===!0?rQ(B.name,A):typeof B.cssVariables=="object"?bQ(B):WQ(B);return I===void 0&&(I=new Map,nB.set(B,I)),I.set(E,w),w}function bQ(Q){const A=Q.cssVariables;if(typeof A!="object")throw new Error("Expected CSS palette");const B=A.prefix??"--hls-",E=R=>{const i=A.defaults?.[R];return`var(${B}${R}${i?`, ${i}`:""})`},I=new Array(T.length).fill(null),C=Q.style.syntax??{};for(let R=1;R<T.length;R++){const i=vB(C,T[R]);I[R]={color:E(i?.color??"foreground"),italic:i?.font_style==="italic",weight:i?.font_weight===void 0?0:Math.round(i.font_weight/100)*100}}const w=E(FB(Q.style)??"foreground"),G=E(uB(Q.style)??"background");let k,S;return{name:Q.name,styles:I,fg:w,bg:G,table:void 0,get htmlOpeners(){return k??=_B(I,w,G)},get ansi(){return S??=YB.map(R=>{const i=Q.style[`terminal.ansi.${R}`];return E(typeof i=="string"?i:`terminal-ansi-${R.replace("_","-")}`)})}}}function rQ(Q,A){let B;const E=()=>B??=TQ(A);let I;return{name:Q,get styles(){return E().styles},get fg(){return E().fg},get bg(){return E().bg},table:void 0,htmlOpeners:void 0,get ansi(){return I??=YB.map(C=>zA(`terminal.ansi.${C}`,A))}}}function TQ(Q){const A=new Array(T.length).fill(null);for(let B=1;B<T.length;B++)A[B]={color:zA(T[B],Q),italic:!1,weight:0};return{styles:A,fg:zA("foreground",Q),bg:zA("background",Q)}}function WQ(Q){const A=Q.style??{},B=new Array(T.length).fill(null),E=new Uint8Array(T.length*5);let I,C,w=!1;for(let S=1;S<T.length;S++){const R=T[S],i=zB(A,R),{color:F,italic:s,weight:J}=i,t=S*5;if(F!==void 0)if(F.startsWith("#")){const a=parseInt(F.slice(1,7),16);E[t]=a>>16,E[t+1]=a>>8&255,E[t+2]=a&255,E[t+3]=F.length===9?parseInt(F.slice(7),16):255}else w=!0;E[t+4]=(s?16:0)|J/100,!(F===void 0&&!s&&J===0)&&(R==="foreground"?I=F:R==="background"?C=F:B[S]=i)}let G,k;return{name:Q.name,styles:B,fg:I,bg:C,table:w?void 0:E,get htmlOpeners(){if(w)return G??=_B(B,I,C)},get ansi(){return k??=dQ(A)}}}function _B(Q,A,B){const E=[`<pre class="highlights" style="${gA((B===void 0?"":`background-color:${B};`)+(A===void 0?"":`color:${A}`))}"><code>`];for(let I=1;I<T.length;I++){const C=Q[I],w=`color:${C?.color??"inherit"}`+(C?.italic===!0?";font-style:italic":"")+(C!=null&&C.weight!==0?`;font-weight:${C.weight}`:"");E.push(`<span style="${gA(w)}">`)}return $B(E)}const XQ=new TextEncoder,yA=new Uint8Array(T.length);for(let Q=0;Q<T.length;Q++){const A=T[Q];A==="string.regex"?yA[Q]=3:A==="comment"||A.startsWith("comment.")?yA[Q]=1:(A==="string"||A.startsWith("string."))&&(yA[Q]=2)}const ZB=new WeakMap,eB=new WeakMap;let fQ=1;const dB=new WeakMap,lB=new WeakMap,xB=new WeakMap;let KQ=0;function PQ(Q){let A=xB.get(Q);return A===void 0&&(A=KQ++,xB.set(Q,A)),A}function bB(Q,A,B){const{name:E,styles:I,fg:C,bg:w,table:G}=Q;return{color:A,role:B,name:E,styles:I,fg:C,bg:w,table:G,get ansi(){return Q.ansi}}}function lA(Q){const{cssVariablePrefix:A}=Q;if(Q.themes==null)return[bB(SB(Q.theme,A),null,"single")];const B=Object.entries(Q.themes).filter(([,R])=>R!=null).sort(([R],[i])=>R<i?-1:1);if(B.length===0)throw new TypeError("themes must not be empty");const E=Q.defaultColor??"light";let I;if(E==="light-dark()"){const R=B.find(([F])=>F==="light"),i=B.find(([F])=>F==="dark");if(R===void 0||i===void 0)throw new TypeError("`themes` must contain `light` and `dark` when defaultColor is 'light-dark()'");B.splice(0,B.length,R,i),I=["light-dark","light-dark"]}else{if(E!==!1){const R=B.findIndex(([i])=>i===E);if(R<0)throw new TypeError(`\`themes\` must contain the defaultColor key \`${E}\``);B.unshift(...B.splice(R,1))}I=B.map((R,i)=>E!==!1&&i===0?"default":"variable")}const C=B.map(([,R])=>SB(R,A)),w=JSON.stringify(B.map(([R],i)=>[PQ(C[i]),I[i],R]));let G=lB.get(C[0]);const k=G?.get(w);if(k!==void 0)return k;const S=B.map(([R],i)=>bB(C[i],R,I[i]));if(G===void 0&&(G=new Map,lB.set(C[0],G)),G.set(w,S),G.size>128){const R=G.keys().next().value;R!==void 0&&G.delete(R)}return S}function xA(Q,A,B,E,I,C,w=0){const G={content:Q.slice(A,B),offset:A+w};if(I[0].role==="single"){const{styles:S,fg:R}=I[0],i=S[E];G.color=i?.color??R;let F=0;i?.italic===!0&&(F|=1),(i?.weight??0)>=600&&(F|=2),G.fontStyle=F}else G.htmlStyle=aB(I,E,C);const k=yA[E];return k!==0&&(G.type=k),G}function AQ(Q,A){let B=ZB.get(Q);B===void 0&&(B=new Map,ZB.set(Q,B));let E=B.get(A);return E===void 0&&(E=[],B.set(A,E)),E}function aB(Q,A,B){const E=AQ(Q,B);let I=E[A];if(I===void 0){if(Q[0].role==="light-dark")I=pQ(Q,A,B);else{I={};for(const{color:C,role:w,styles:G,fg:k}of Q){const S=G[A],R=w==="default";I[R?"color":B+C]=S?.color??k??"inherit",S?.italic===!0&&(I[R?"font-style":`${B}${C}-font-style`]="italic"),S!=null&&S.weight!==0&&(I[R?"font-weight":`${B}${C}-font-weight`]=String(S.weight))}}E[A]=I}return I}function VQ(Q,A){let B=eB.get(Q);B===void 0&&(B=new Map,eB.set(Q,B));const E=B.get(A);if(E!==void 0)return E??void 0;const I=Q.length;if(!(I<=255&&Q.every(J=>J.table!==void 0))){B.set(A,null);return}const C=Q.map(J=>J.role==="default"?new Uint8Array(0):XQ.encode(gA(`${A}${J.color}`))),w=32+16*I,G=w+384*I;let k=64,S=128,R=0;for(const{length:J}of C)k+=64+3*J,S+=48+2*J,R+=J;const i=new Uint8Array(G+R),F=new DataView(i.buffer);i[0]=I,i[1]=Q[0].role==="light-dark"?1:0,F.setUint32(4,w,!0),F.setUint32(8,k,!0),F.setUint32(12,S,!0),F.setUint32(16,fQ++,!0);let s=G;for(let J=0;J<I;J++){const t=32+16*J;F.setUint32(t,s,!0),F.setUint32(t+4,C[J].length,!0),F.setUint32(t+8,Q[J].role==="default"?1:0,!0),i.set(Q[J].table,w+384*J),i.set(C[J],s),s+=C[J].length}return B.set(A,i),i}function mQ(Q,A){let B=dB.get(Q);B===void 0&&(B=new Map,dB.set(Q,B));const E=B.get(A);if(E!==void 0)return E;const{fg:I,bg:C,rootStyle:w}=kB(Q,A),G=[`<pre class="highlights" style="${gA(w??`background-color:${C};color:${I}`)}"><code>`];for(let S=1;S<T.length;S++){const R=aB(Q,S,A);let i="";for(const F in R)i+=`${i===""?"":";"}${F}:${R[F]}`;G.push(`<span style="${gA(i)}">`)}const k=$B(G);return B.set(A,k),k}function pQ(Q,A,B){const[E,I]=Q,C=E.styles[A],w=I.styles[A],G=C?.color??E.fg??"currentcolor",k=w?.color??I.fg??"currentcolor",S={color:G===k?G:`light-dark(${G}, ${k})`},R=C?.italic===!0,i=w?.italic===!0;R&&i?S["font-style"]="italic":(R&&(S[`${B}light-font-style`]="italic"),i&&(S[`${B}dark-font-style`]="italic"));const F=C?.weight??0,s=w?.weight??0;return F!==0&&F===s?S["font-weight"]=String(F):(F!==0&&(S[`${B}light-font-weight`]=String(F)),s!==0&&(S[`${B}dark-font-weight`]=String(s))),S}function BQ(Q,A,B,E,I,C=0){const w=[],G=I??0,{styles:k,fg:S,role:R}=B[0],i=R==="single"?void 0:AQ(B,E);let F=0;for(let s=0;;s+=2){const J=s;for(;s<A.length&&A[s+1]!==4294967295;)s+=2;const t=s===J?F:A[s-2];let a;if(G>0&&t-F>=G)a=[xA(Q,F,t,0,B,E,C)];else{a=new Array((s-J)/2);let o=0;for(let n=J;n<s;n+=2){const Z=A[n];if(Z>F){const h=A[n+1];let L;if(i===void 0){const H=k[h];L={content:Q.slice(F,Z),offset:F+C,color:H?.color??S,fontStyle:(H?.italic===!0?1:0)|((H?.weight??0)>=600?2:0)}}else L={content:Q.slice(F,Z),offset:F+C,htmlStyle:i[h]??aB(B,h,E)};const y=yA[h];y!==0&&(L.type=y),a[o++]=L,F=Z}}a.length=o}if(w.push(a),s===A.length)break;F=A[s]}return w}function kB(Q,A){if(Q[0].role==="single")return{fg:Q[0].fg,bg:Q[0].bg,themeName:Q[0].name};const B=`highlights-themes ${Q.map(C=>C.name).join(" ")}`;if(Q[0].role==="light-dark"){const C=(w,G,k)=>{const S=w??k,R=G??k;return S===R?S:`light-dark(${S}, ${R})`};return{fg:C(Q[0].fg,Q[1].fg,"currentcolor"),bg:C(Q[0].bg,Q[1].bg,"transparent"),themeName:B}}const E=Q.map(C=>C.role==="default"?C.fg??"inherit":`${A}${C.color}:${C.fg??"inherit"}`).join(";"),I=Q.map(C=>C.role==="default"?C.bg??"inherit":`${A}${C.color}-bg:${C.bg??"inherit"}`).join(";");return{fg:E,bg:I,themeName:B,rootStyle:Q[0].role==="default"?void 0:`${E};${I}`}}const sB=1,QQ=2,EQ=4,IQ=8,CQ=16,gQ=32,rB=[0,sB,QQ,EQ,IQ,0,0,CQ,0,gQ],gB=[0,95,135,175,215,255],wB=/\x1b(?:\[([0-?]*)[ -/]*([@-~])|\][^\x07\x1b\n]*(?:\x07|\x1b\\)|[ -/]*[0-~])/y;var wQ=class{constructor(){x(this,"fg",-1);x(this,"bg",-1);x(this,"flags",0);x(this,"styles",new Map)}};function bA(Q){return String(Q).toLowerCase()==="ansi"}function RB(Q,A){if(A<16)return Q.ansi[A];let B=A&16777215;if(A<232){const E=A-16;B=gB[E/36|0]<<16|gB[(E/6|0)%6]<<8|gB[E%6]}else A<256&&(B=(8+(A-232)*10)*65793);return`#${B.toString(16).padStart(6,"0")}`}function UB(Q,A,B,E,I=new wQ,C=0){const w=[],G=E??0;let k=[],S,R,i,F=Q.indexOf("\x1B"),s=0;for(;;){const J=Q.indexOf(`
|
|
1
|
+
var cQ=Object.defineProperty;var NB=Q=>{throw TypeError(Q)};var LQ=(Q,A,B)=>A in Q?cQ(Q,A,{enumerable:!0,configurable:!0,writable:!0,value:B}):Q[A]=B;var x=(Q,A,B)=>LQ(Q,typeof A!="symbol"?A+"":A,B),CB=(Q,A,B)=>A.has(Q)||NB("Cannot "+B);var g=(Q,A,B)=>(CB(Q,A,"read from private field"),B?B.call(Q):A.get(Q)),c=(Q,A,B)=>A.has(Q)?NB("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(Q):A.set(Q,B),M=(Q,A,B,E)=>(CB(Q,A,"write to private field"),E?E.call(Q,B):A.set(Q,B),B),D=(Q,A,B)=>(CB(Q,A,"access private method"),B);var HB=(Q,A,B,E)=>({set _(I){M(Q,A,I,B)},get _(){return g(Q,A,E)}});import{a3 as tQ,r as hQ,Q as jQ}from"./DuFY1gwd.js";import{B as oQ,D as YQ}from"./x9IQ_8UO.js";const T=["none","attribute","attribute.jsx","boolean","comment","comment.doc","constant","constant.builtin","constructor","diff.minus","diff.plus","embedded","emphasis","emphasis.strong","function","function.definition","function.method","keyword","keyword.control","keyword.declaration","keyword.import","keyword.operator","label","namespace","number","operator","predictive","preproc","primary","property","property.json_key","punctuation","punctuation.bracket","punctuation.bracket.html","punctuation.bracket.jsx","punctuation.delimiter","punctuation.delimiter.html","punctuation.delimiter.jsx","punctuation.list_marker","punctuation.markup","punctuation.special","selector","selector.class","selector.id","string","string.escape","string.regex","string.special","string.special.symbol","tag","tag.doctype","tag.jsx","text.jsx","text.literal","title","type","type.builtin","type.class","variable","variable.parameter","variable.special","enum","hint","keyword.jsdoc","link_text","link_uri","selector.pseudo","tag.component.jsx","type.jsdoc","variable.jsdoc","variant","background","foreground"],aQ="--hls-",NQ=new TextEncoder,HQ=/^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i,nQ=/^color\(display-p3\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)\s+[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:\s*\/\s*[+-]?(?:\d+(?:\.\d*)?|\.\d+))?\s*\)$/i;function ZQ(Q){return typeof Q=="string"&&(HQ.test(Q.trim())||nQ.test(Q.trim()))}function FB(Q){return Q["editor.foreground"]??Q.text??Q.foreground}function uB(Q){return Q["editor.background"]??Q.background}const YB=["black","red","green","yellow","blue","magenta","cyan","white","bright_black","bright_red","bright_green","bright_yellow","bright_blue","bright_magenta","bright_cyan","bright_white"],eQ=["#000000","#cd3131","#0dbc79","#e5e510","#2472c8","#bc3fbc","#11a8cd","#e5e5e5","#666666","#f14c4c","#23d18b","#f5f543","#3b8eea","#d670d6","#29b8db","#ffffff"];function dQ(Q){return YB.map((A,B)=>zB({foreground:Q[`terminal.ansi.${A}`]},"foreground").color??eQ[B])}function OB(Q){return Q===null?"null":Q===void 0?"undefined":typeof Q=="string"?`the string ${JSON.stringify(Q)} (theme ids are not supported; import the theme object from "@pierre/highlights/themes")`:Array.isArray(Q)?"an array":typeof Q=="object"?"themes"in Q&&Array.isArray(Q.themes)?`a ThemeFamily whose first member is ${OB(Q.themes[0])}`:"an object without a `name`":`a ${typeof Q}`}function lQ(Q){return Q!=null&&typeof Q=="object"&&"name"in Q&&typeof Q.name=="string"&&Q.name!==""}function xQ(Q){const A=Q!=null&&typeof Q=="object"&&"themes"in Q&&Q.themes!=null?Q.themes[0]:Q;if(!lQ(A))throw new TypeError(`invalid theme: expected a Theme or ThemeFamily object, received ${OB(Q)}`);return A}function vB(Q,A){let B;for(let E=A;E!=="";){const I=Q[E];if(typeof I=="string")return{...B,color:I};if(I!=null&&typeof I=="object"&&(B??=I,I.color!=null))return{...B,color:I.color};const C=E.lastIndexOf(".");E=C<0?"":E.slice(0,C)}return B}function zB(Q,A){let B,E,I;return A==="background"?B=uB(Q):A==="foreground"?B=FB(Q):({color:B,font_style:E,font_weight:I}=vB(Q.syntax??{},A)??{},(E!=null||I!=null)&&(B??=FB(Q))),ZQ(B)?(B=B.trim().toLowerCase(),B.startsWith("#")&&(B.length<=5&&(B=B.replace(/[^#]/g,"$&$&")),B.length===9&&B.endsWith("ff")&&(B=B.slice(0,7)),B==="#00000000"&&(B=void 0))):B=void 0,{color:B,italic:E==="italic",weight:I!=null&&I>=100&&I<=900?Math.round(I/100)*100:0}}function zA(Q,A){return`var(${A}${Q.replace(/[._]/g,"-")})`}function gA(Q){return Q.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">")}function $B(Q){const A=Q.map(w=>NQ.encode(w));let B=4+8*A.length;const E=new Uint8Array(B+A.reduce((w,G)=>w+G.length,0)),I=new DataView(E.buffer);let C=32;for(let w=0;w<A.length;w++)I.setUint32(4+8*w,B,!0),I.setUint32(8+8*w,A[w].length,!0),E.set(A[w],B),B+=A[w].length,w!==0&&(C=Math.max(C,A[w].length+32));return I.setUint32(0,C,!0),E}const nB=new WeakMap;function SB(Q,A=aQ){const B=xQ(Q),E=B.cssVariables===!0?A:"";let I=nB.get(B);const C=I?.get(E);if(C!==void 0)return C;const w=B.cssVariables===!0?rQ(B.name,A):typeof B.cssVariables=="object"?bQ(B):WQ(B);return I===void 0&&(I=new Map,nB.set(B,I)),I.set(E,w),w}function bQ(Q){const A=Q.cssVariables;if(typeof A!="object")throw new Error("Expected CSS palette");const B=A.prefix??"--hls-",E=R=>{const i=A.defaults?.[R];return`var(${B}${R}${i?`, ${i}`:""})`},I=new Array(T.length).fill(null),C=Q.style.syntax??{};for(let R=1;R<T.length;R++){const i=vB(C,T[R]);I[R]={color:E(i?.color??"foreground"),italic:i?.font_style==="italic",weight:i?.font_weight===void 0?0:Math.round(i.font_weight/100)*100}}const w=E(FB(Q.style)??"foreground"),G=E(uB(Q.style)??"background");let k,S;return{name:Q.name,styles:I,fg:w,bg:G,table:void 0,get htmlOpeners(){return k??=_B(I,w,G)},get ansi(){return S??=YB.map(R=>{const i=Q.style[`terminal.ansi.${R}`];return E(typeof i=="string"?i:`terminal-ansi-${R.replace("_","-")}`)})}}}function rQ(Q,A){let B;const E=()=>B??=TQ(A);let I;return{name:Q,get styles(){return E().styles},get fg(){return E().fg},get bg(){return E().bg},table:void 0,htmlOpeners:void 0,get ansi(){return I??=YB.map(C=>zA(`terminal.ansi.${C}`,A))}}}function TQ(Q){const A=new Array(T.length).fill(null);for(let B=1;B<T.length;B++)A[B]={color:zA(T[B],Q),italic:!1,weight:0};return{styles:A,fg:zA("foreground",Q),bg:zA("background",Q)}}function WQ(Q){const A=Q.style??{},B=new Array(T.length).fill(null),E=new Uint8Array(T.length*5);let I,C,w=!1;for(let S=1;S<T.length;S++){const R=T[S],i=zB(A,R),{color:F,italic:s,weight:J}=i,t=S*5;if(F!==void 0)if(F.startsWith("#")){const a=parseInt(F.slice(1,7),16);E[t]=a>>16,E[t+1]=a>>8&255,E[t+2]=a&255,E[t+3]=F.length===9?parseInt(F.slice(7),16):255}else w=!0;E[t+4]=(s?16:0)|J/100,!(F===void 0&&!s&&J===0)&&(R==="foreground"?I=F:R==="background"?C=F:B[S]=i)}let G,k;return{name:Q.name,styles:B,fg:I,bg:C,table:w?void 0:E,get htmlOpeners(){if(w)return G??=_B(B,I,C)},get ansi(){return k??=dQ(A)}}}function _B(Q,A,B){const E=[`<pre class="highlights" style="${gA((B===void 0?"":`background-color:${B};`)+(A===void 0?"":`color:${A}`))}"><code>`];for(let I=1;I<T.length;I++){const C=Q[I],w=`color:${C?.color??"inherit"}`+(C?.italic===!0?";font-style:italic":"")+(C!=null&&C.weight!==0?`;font-weight:${C.weight}`:"");E.push(`<span style="${gA(w)}">`)}return $B(E)}const XQ=new TextEncoder,yA=new Uint8Array(T.length);for(let Q=0;Q<T.length;Q++){const A=T[Q];A==="string.regex"?yA[Q]=3:A==="comment"||A.startsWith("comment.")?yA[Q]=1:(A==="string"||A.startsWith("string."))&&(yA[Q]=2)}const ZB=new WeakMap,eB=new WeakMap;let fQ=1;const dB=new WeakMap,lB=new WeakMap,xB=new WeakMap;let KQ=0;function PQ(Q){let A=xB.get(Q);return A===void 0&&(A=KQ++,xB.set(Q,A)),A}function bB(Q,A,B){const{name:E,styles:I,fg:C,bg:w,table:G}=Q;return{color:A,role:B,name:E,styles:I,fg:C,bg:w,table:G,get ansi(){return Q.ansi}}}function lA(Q){const{cssVariablePrefix:A}=Q;if(Q.themes==null)return[bB(SB(Q.theme,A),null,"single")];const B=Object.entries(Q.themes).filter(([,R])=>R!=null).sort(([R],[i])=>R<i?-1:1);if(B.length===0)throw new TypeError("themes must not be empty");const E=Q.defaultColor??"light";let I;if(E==="light-dark()"){const R=B.find(([F])=>F==="light"),i=B.find(([F])=>F==="dark");if(R===void 0||i===void 0)throw new TypeError("`themes` must contain `light` and `dark` when defaultColor is 'light-dark()'");B.splice(0,B.length,R,i),I=["light-dark","light-dark"]}else{if(E!==!1){const R=B.findIndex(([i])=>i===E);if(R<0)throw new TypeError(`\`themes\` must contain the defaultColor key \`${E}\``);B.unshift(...B.splice(R,1))}I=B.map((R,i)=>E!==!1&&i===0?"default":"variable")}const C=B.map(([,R])=>SB(R,A)),w=JSON.stringify(B.map(([R],i)=>[PQ(C[i]),I[i],R]));let G=lB.get(C[0]);const k=G?.get(w);if(k!==void 0)return k;const S=B.map(([R],i)=>bB(C[i],R,I[i]));if(G===void 0&&(G=new Map,lB.set(C[0],G)),G.set(w,S),G.size>128){const R=G.keys().next().value;R!==void 0&&G.delete(R)}return S}function xA(Q,A,B,E,I,C,w=0){const G={content:Q.slice(A,B),offset:A+w};if(I[0].role==="single"){const{styles:S,fg:R}=I[0],i=S[E];G.color=i?.color??R;let F=0;i?.italic===!0&&(F|=1),(i?.weight??0)>=600&&(F|=2),G.fontStyle=F}else G.htmlStyle=aB(I,E,C);const k=yA[E];return k!==0&&(G.type=k),G}function AQ(Q,A){let B=ZB.get(Q);B===void 0&&(B=new Map,ZB.set(Q,B));let E=B.get(A);return E===void 0&&(E=[],B.set(A,E)),E}function aB(Q,A,B){const E=AQ(Q,B);let I=E[A];if(I===void 0){if(Q[0].role==="light-dark")I=pQ(Q,A,B);else{I={};for(const{color:C,role:w,styles:G,fg:k}of Q){const S=G[A],R=w==="default";I[R?"color":B+C]=S?.color??k??"inherit",S?.italic===!0&&(I[R?"font-style":`${B}${C}-font-style`]="italic"),S!=null&&S.weight!==0&&(I[R?"font-weight":`${B}${C}-font-weight`]=String(S.weight))}}E[A]=I}return I}function VQ(Q,A){let B=eB.get(Q);B===void 0&&(B=new Map,eB.set(Q,B));const E=B.get(A);if(E!==void 0)return E??void 0;const I=Q.length;if(!(I<=255&&Q.every(J=>J.table!==void 0))){B.set(A,null);return}const C=Q.map(J=>J.role==="default"?new Uint8Array(0):XQ.encode(gA(`${A}${J.color}`))),w=32+16*I,G=w+384*I;let k=64,S=128,R=0;for(const{length:J}of C)k+=64+3*J,S+=48+2*J,R+=J;const i=new Uint8Array(G+R),F=new DataView(i.buffer);i[0]=I,i[1]=Q[0].role==="light-dark"?1:0,F.setUint32(4,w,!0),F.setUint32(8,k,!0),F.setUint32(12,S,!0),F.setUint32(16,fQ++,!0);let s=G;for(let J=0;J<I;J++){const t=32+16*J;F.setUint32(t,s,!0),F.setUint32(t+4,C[J].length,!0),F.setUint32(t+8,Q[J].role==="default"?1:0,!0),i.set(Q[J].table,w+384*J),i.set(C[J],s),s+=C[J].length}return B.set(A,i),i}function mQ(Q,A){let B=dB.get(Q);B===void 0&&(B=new Map,dB.set(Q,B));const E=B.get(A);if(E!==void 0)return E;const{fg:I,bg:C,rootStyle:w}=kB(Q,A),G=[`<pre class="highlights" style="${gA(w??`background-color:${C};color:${I}`)}"><code>`];for(let S=1;S<T.length;S++){const R=aB(Q,S,A);let i="";for(const F in R)i+=`${i===""?"":";"}${F}:${R[F]}`;G.push(`<span style="${gA(i)}">`)}const k=$B(G);return B.set(A,k),k}function pQ(Q,A,B){const[E,I]=Q,C=E.styles[A],w=I.styles[A],G=C?.color??E.fg??"currentcolor",k=w?.color??I.fg??"currentcolor",S={color:G===k?G:`light-dark(${G}, ${k})`},R=C?.italic===!0,i=w?.italic===!0;R&&i?S["font-style"]="italic":(R&&(S[`${B}light-font-style`]="italic"),i&&(S[`${B}dark-font-style`]="italic"));const F=C?.weight??0,s=w?.weight??0;return F!==0&&F===s?S["font-weight"]=String(F):(F!==0&&(S[`${B}light-font-weight`]=String(F)),s!==0&&(S[`${B}dark-font-weight`]=String(s))),S}function BQ(Q,A,B,E,I,C=0){const w=[],G=I??0,{styles:k,fg:S,role:R}=B[0],i=R==="single"?void 0:AQ(B,E);let F=0;for(let s=0;;s+=2){const J=s;for(;s<A.length&&A[s+1]!==4294967295;)s+=2;const t=s===J?F:A[s-2];let a;if(G>0&&t-F>=G)a=[xA(Q,F,t,0,B,E,C)];else{a=new Array((s-J)/2);let o=0;for(let n=J;n<s;n+=2){const Z=A[n];if(Z>F){const h=A[n+1];let L;if(i===void 0){const H=k[h];L={content:Q.slice(F,Z),offset:F+C,color:H?.color??S,fontStyle:(H?.italic===!0?1:0)|((H?.weight??0)>=600?2:0)}}else L={content:Q.slice(F,Z),offset:F+C,htmlStyle:i[h]??aB(B,h,E)};const y=yA[h];y!==0&&(L.type=y),a[o++]=L,F=Z}}a.length=o}if(w.push(a),s===A.length)break;F=A[s]}return w}function kB(Q,A){if(Q[0].role==="single")return{fg:Q[0].fg,bg:Q[0].bg,themeName:Q[0].name};const B=`highlights-themes ${Q.map(C=>C.name).join(" ")}`;if(Q[0].role==="light-dark"){const C=(w,G,k)=>{const S=w??k,R=G??k;return S===R?S:`light-dark(${S}, ${R})`};return{fg:C(Q[0].fg,Q[1].fg,"currentcolor"),bg:C(Q[0].bg,Q[1].bg,"transparent"),themeName:B}}const E=Q.map(C=>C.role==="default"?C.fg??"inherit":`${A}${C.color}:${C.fg??"inherit"}`).join(";"),I=Q.map(C=>C.role==="default"?C.bg??"inherit":`${A}${C.color}-bg:${C.bg??"inherit"}`).join(";");return{fg:E,bg:I,themeName:B,rootStyle:Q[0].role==="default"?void 0:`${E};${I}`}}const sB=1,QQ=2,EQ=4,IQ=8,CQ=16,gQ=32,rB=[0,sB,QQ,EQ,IQ,0,0,CQ,0,gQ],gB=[0,95,135,175,215,255],wB=/\x1b(?:\[([0-?]*)[ -/]*([@-~])|\][^\x07\x1b\n]*(?:\x07|\x1b\\)|[ -/]*[0-~])/y;var wQ=class{constructor(){x(this,"fg",-1);x(this,"bg",-1);x(this,"flags",0);x(this,"styles",new Map)}};function bA(Q){return String(Q).toLowerCase()==="ansi"}function RB(Q,A){if(A<16)return Q.ansi[A];let B=A&16777215;if(A<232){const E=A-16;B=gB[E/36|0]<<16|gB[(E/6|0)%6]<<8|gB[E%6]}else A<256&&(B=(8+(A-232)*10)*65793);return`#${B.toString(16).padStart(6,"0")}`}function UB(Q,A,B,E,I=new wQ,C=0){const w=[],G=E??0;let k=[],S,R,i,F=Q.indexOf("\x1B"),s=0;for(;;){const J=Q.indexOf(`
|
|
2
2
|
`,s);let t=J<0?Q.length:J;J>s&&Q.charCodeAt(J-1)===13&&t--;const a=G>0&&t-s>=G;for(;s<t;){F>=0&&F<s&&(F=Q.indexOf("\x1B",s));let o=F>=0&&F<t?F:t,n=o,Z;if(o<t){wB.lastIndex=o;const h=wB.exec(Q);h===null?n=++o:(n=wB.lastIndex,h[2]==="m"&&!(h[1].charCodeAt(0)>=60)&&(Z=h[1]))}if(o>s&&a)R===void 0?(R=xA(Q,s,o,0,A,B,C),k.push(R)):R.content+=Q.slice(s,o);else if(o>s){if(S===void 0){const{fg:h,bg:L,flags:y}=I,H=`${h},${L},${y}`;if(S=I.styles.get(H),S===void 0){const m=((y&EQ)!==0?1:0)|((y&sB)!==0?2:0)|((y&IQ)!==0?4:0)|((y&gQ)!==0?8:0),z=A.map(e=>{let j=h<0?e.fg:RB(e,h),$=L<0?void 0:RB(e,L);return(y&CQ)!==0&&($=j,j=L<0?e.bg:RB(e,L)),(y&QQ)!==0&&j!==void 0&&(j=j.startsWith("#")?j.length===9?j.slice(0,7)+Math.round(parseInt(j.slice(7),16)/2).toString(16).padStart(2,"0"):`${j}80`:`color-mix(in srgb, ${j} 50%, transparent)`),[j,$]});if(A[0].role==="single"){const[e,j]=z[0];S=j===void 0?{color:e,fontStyle:m}:{color:e,bgColor:j,fontStyle:m}}else{const e=[];(m&1)!==0&&e.push(["font-style","italic"]),(m&2)!==0&&e.push(["font-weight","bold"]),(m&12)!==0&&e.push(["text-decoration",(m&12)===12?"underline line-through":(m&4)!==0?"underline":"line-through"]);const j={};if(A[0].role==="light-dark"){const[[$,pA],[qA,sA]]=z,wA=$??"currentcolor",HA=qA??"currentcolor";if(j.color=wA===HA?wA:`light-dark(${wA}, ${HA})`,pA!==void 0||sA!==void 0){const RA=pA??"transparent",uA=sA??"transparent";j["background-color"]=RA===uA?RA:`light-dark(${RA}, ${uA})`}for(const[RA,uA]of e)j[RA]=uA}else for(let $=0;$<A.length;$++){const[pA,qA]=z[$],sA=A[$].role==="default",wA=`${B}${A[$].color}`;j[sA?"color":wA]=pA??"inherit",qA!==void 0&&(j[sA?"background-color":`${wA}-bg`]=qA);for(const[HA,RA]of e)j[sA?HA:`${wA}-${HA}`]=RA}S={htmlStyle:j}}I.styles.set(H,S)}}R!==void 0&&i===S?R.content+=Q.slice(s,o):(R={content:Q.slice(s,o),offset:s+C,...S},i=S,k.push(R))}if(Z!==void 0){const h=Z.split(";");for(let L=0;L<h.length;L++){const y=Number(h[L]);if(y===0)I.fg=-1,I.bg=-1,I.flags=0;else if(y<10)I.flags|=rB[y]??0;else if(y>20&&y<30)I.flags&=~((rB[y-20]??0)|(y===22?sB:0));else if(y>=30&&y<38)I.fg=y-30;else if(y===39)I.fg=-1;else if(y>=40&&y<48)I.bg=y-40;else if(y===49)I.bg=-1;else if(y>=90&&y<98)I.fg=y-82;else if(y>=100&&y<108)I.bg=y-92;else if(y===38||y===48){const H=h[++L];let m=-1;if(H==="5"){const z=Number(h[++L]);Number.isInteger(z)&&z<256&&(m=z)}else if(H==="2"){const z=Number(h[L+1]),e=Number(h[L+2]),j=Number(h[L+3]);L+=3,z>=0&&e>=0&&j>=0&&(m=16777216|Math.min(z,255)<<16|Math.min(e,255)<<8|Math.min(j,255))}m>=0&&(y===38?I.fg=m:I.bg=m)}}S=void 0}s=n}if(w.push(k),J<0)return w;s=J+1,k=[],R=void 0}}const qQ={plain:0,plaintext:0,text:0,txt:0,abap:1,ada:2,adb:2,ads:2,"angular-html":3,apache:4,apacheconf:4,htaccess:4,apex:5,applescript:6,adoc:7,asciidoc:7,asm:8,assembly:8,mips:8,mipsasm:8,riscv:8,s:8,astro:9,awk:10,bash:11,sh:11,shell:11,shellscript:11,shellsession:11,zsh:11,bat:12,batch:12,batchfile:12,cmd:12,dos:12,bib:13,bibtex:13,bicep:14,blade:15,c:16,h:16,c3:17,clj:18,cljc:18,cljs:18,clojure:18,edn:18,cmake:19,cbl:20,cob:20,cobol:20,codeowners:21,codeql:22,ql:22,coffee:23,coffeescript:23,coq:24,rocq:24,"c++":25,cc:25,cpp:25,cxx:25,hh:25,hpp:25,hxx:25,"c#":26,cs:26,csharp:26,css:27,postcss:27,qss:27,csv:28,cu:29,cuda:29,cuh:29,cql:30,cypher:30,d:31,dart:32,dax:33,diff:34,"git-commit":34,"git-rebase":34,patch:34,containerfile:35,docker:35,dockerfile:35,dotenv:36,env:36,elixir:37,ex:37,exs:37,elm:38,erb:39,erl:40,erlang:40,hrl:40,fish:41,f03:42,f08:42,f90:42,f95:42,fortran:42,"fortran-free-form":42,f:43,f77:43,for:43,"fortran-fixed-form":43,"f#":44,fs:44,fsharp:44,fsi:44,fsx:44,gdresource:45,"godot-resource":45,tres:45,tscn:45,gd:46,gdscript:46,gdshader:47,gdshaderinc:47,"godot-shader":47,cucumber:48,feature:48,gherkin:48,gleam:49,comp:50,frag:50,geom:50,glsl:50,vert:50,gnuplot:51,gp:51,go:52,golang:52,gql:53,graphql:53,groq:54,gradle:55,groovy:55,gsh:55,gvy:55,gy:55,nextflow:55,"nextflow-groovy":55,nf:55,hack:56,haml:57,handlebars:58,hbs:58,mustache:58,haskell:59,hs:59,haxe:60,hx:60,hlsl:61,htm:62,html:62,"html-derivative":62,http:63,desktop:64,ini:64,properties:64,systemd:64,java:65,j2:66,jinja:66,jinja2:66,cjs:67,javascript:67,js:67,mjs:67,json:68,jsonc:68,json5:69,jsonl:70,jsonnet:71,libsonnet:71,jsx:72,jl:73,julia:73,just:74,justfile:74,kdl:75,kotlin:76,kt:76,kts:76,latex:77,tex:77,lean:78,lean4:78,less:79,liquid:80,cl:81,el:81,elisp:81,"emacs-lisp":81,lisp:81,lsp:81,racket:81,rkt:81,scheme:81,scm:81,llvm:82,log:83,lua:84,luau:85,make:86,makefile:86,mk:86,markdown:87,md:87,mdc:87,matlab:88,octave:88,mdx:89,mermaid:90,mmd:90,mbt:91,moonbit:91,nginx:92,nim:93,nix:94,m:95,mm:95,objc:95,objcpp:95,"objective-c":95,"objective-cpp":95,objectivec:95,ml:96,mli:96,ocaml:96,odin:97,openscad:98,scad:98,delphi:99,dpk:99,dpr:99,lpr:99,"object-pascal":99,objectpascal:99,pas:99,pascal:99,pp:99,perl:100,pl:100,pm:100,php:101,plsql:102,po:103,pot:103,potx:103,powerquery:104,pq:104,powershell:105,ps:105,ps1:105,psd1:105,psm1:105,pwsh:105,prisma:106,prolog:107,promql:108,proto:109,protobuf:109,jade:110,pug:110,puppet:111,py:112,python:112,qml:113,r:114,rscript:114,cshtml:115,razor:115,reg:116,rosmsg:117,restructuredtext:118,rst:118,rb:119,ruby:119,rs:120,rust:120,sas:121,sass:122,sbt:123,sc:123,scala:123,scss:124,shader:125,shaderlab:125,sol:126,solidity:126,sparql:127,sql:128,stata:129,styl:130,stylus:130,svelte:131,swift:132,tcl:133,hcl:134,terraform:134,tf:134,tfvars:134,toml:135,"angular-ts":136,cts:136,lit:136,mts:136,ts:136,"ts-tags":136,typescript:136,tsrx:137,tsv:138,tsx:139,ttl:140,turtle:140,twig:141,typ:142,typst:142,sv:143,svh:143,"system-verilog":143,systemverilog:143,verilog:143,vhd:144,vhdl:144,vim:145,viml:145,vimscript:145,vue:146,"vue-html":146,wasm:147,wat:147,wgsl:148,mathematica:149,wl:149,wolfram:149,svg:150,xml:150,xsd:150,xsl:150,xslt:150,yaml:151,yml:151,zig:152,zon:152},OA=new TextEncoder,RQ=new TextDecoder("utf-8",{ignoreBOM:!0}),$A=65536,TB=64,iA=81920,WB=[/^\p{ID_Start}$/u,/^[\u200C\u200D\p{ID_Continue}]$/u];let iB;const iQ=qQ;function QB(Q){const A=iQ[String(Q).toLowerCase()];if(typeof A!="number")throw new RangeError(`unknown lang: ${Q}`);return A}function uQ(Q){return typeof iQ[String(Q).toLowerCase()]=="number"||bA(Q)}var rA,TA,WA,XA,fA,P,DB,UA,JB,mB,IB=(mB=class{constructor(A){c(this,P);c(this,rA);c(this,TA);c(this,WA);c(this,XA);c(this,fA,new Uint8Array(0));x(this,"wasmModule");x(this,"instance");x(this,"memory");x(this,"buffer");x(this,"dv");x(this,"pageN");this.wasmModule=A;const B=new WebAssembly.Instance(A,{env:{is_id_start:(E,I)=>D(this,P,JB).call(this,E,I,0),is_id_continue:(E,I)=>D(this,P,JB).call(this,E,I,2)}});this.instance=B,this.memory=B.exports.memory,M(this,rA,B.exports.highlight),M(this,TA,B.exports.highlightStream),this.pageN=this.memory.buffer.byteLength/$A,this.buffer=new Uint8Array(this.memory.buffer),this.dv=new DataView(this.memory.buffer)}writeInput(A,B=0){if(typeof A=="string"){D(this,P,UA).call(this,B+A.length+96);let{read:E,written:I}=OA.encodeInto(A,this.buffer.subarray(iA+B,this.buffer.length-96));if(E<A.length){const C=A.slice(E);D(this,P,UA).call(this,B+I+C.length*3+96),I+=OA.encodeInto(C,this.buffer.subarray(iA+B+I,this.buffer.length-96)).written}return I}if(A instanceof ArrayBuffer&&(A=new Uint8Array(A)),!(A instanceof Uint8Array))throw new TypeError("input must be a string, Uint8Array, or ArrayBuffer");return D(this,P,UA).call(this,B+A.length+96),this.buffer.set(A,iA+B),A.length}codeToHtml(A,B){const E=B.cssVariablePrefix??"--hls-";if(bA(B.lang)){const i=lA(B),{fg:F,bg:s,rootStyle:J}=kB(i,E),t=yB(A),a=UB(t,i[0].role==="single"?[{...i[0],role:"default"}]:i,E);let o=`<pre class="highlights" style="${gA(J??(s===void 0?"":`background-color:${s};`)+(F===void 0?"":`color:${F}`))}"><code>`;for(let n=0,Z=-1;n<a.length;n++){n>0&&(Z=t.indexOf(`
|
|
3
3
|
`,Z+1),o+=t.charCodeAt(Z-1)===13?`\r
|
|
4
4
|
`:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aG as r}from"./3SdAC2_C.js";import{br as e}from"./
|
|
1
|
+
import{aG as r}from"./3SdAC2_C.js";import{br as e}from"./D0qhIm1r.js";const n=Symbol("workspace-route-context");function s(t){return t&&t!=="new"?e(t):null}function u(t,o){return t?.startsWith("/workspace/")?s(o):null}function p(){try{return r(n)}catch{return}}export{n as W,s as a,p as g,u as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./uyQciu7h.js";import{b_ as we,c$ as ue,cr as de,cq as be}from"./BTXzEcFX.js";import{JH as p,Cg as Fe,bJ as ke,i as Ge,LM as me,ir as Ee,bV as Pe,Ec as H,CF as xe,fl as Ve,AL as Ue,e3 as fe,fh as _e,e2 as he,Be,Lq as $e,wy as Xe}from"./CiKoEJ2m.js";import{aO as Se,dX as ge,A as K,P as Re,aK as Q}from"./iQDlfKDR.js";import{h as qe}from"./CT8vPg_p.js";import{c as W}from"./ChTqQfQN.js";import{a as We}from"./BdWqymET.js";import{m as j}from"./C3jMXj_V.js";import"./3SdAC2_C.js";import{bm as n}from"./CtfEuoOH.js";import"./B26ZHg3s.js";import"./CGmYraIa.js";import"./BFfRQORP.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new We("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class q extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new q(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new q(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof q?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new q(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=W("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=W("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=W("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await qe("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|
|
1
|
+
var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./DuFY1gwd.js";import{b_ as we,c$ as ue,cr as de,cq as be}from"./D-j7vD5Z.js";import{JH as p,Cg as Fe,bJ as ke,i as Ge,LM as me,ir as Ee,bV as Pe,Ec as H,CF as xe,fl as Ve,AL as Ue,e3 as fe,fh as _e,e2 as he,Be,Lq as $e,wy as Xe}from"./D0qhIm1r.js";import{aO as Se,dX as ge,A as K,P as Re,aK as Q}from"./cD292w1o.js";import{h as qe}from"./BAtAwQ72.js";import{c as W}from"./ChTqQfQN.js";import{a as We}from"./BdWqymET.js";import{m as j}from"./DkQdSPDN.js";import"./3SdAC2_C.js";import{bm as n}from"./Fcr7AvC-.js";import"./BRCr02in.js";import"./CWfjuhY2.js";import"./DRMe5Ypb.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new We("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class q extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(P),new q(P,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new q(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof q?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new q(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=W("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=W("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=W("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Ge.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Pe(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await qe("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,G=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===G));if(u()&&typeof G=="string"){const S=fe(s,t);A(_e(i,m.id,S,G,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:P})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
|