@dylanpiercey/work 0.0.72 → 0.0.74
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/dist/{_BfXE8Kjn.js → _BDyG-m5v.js} +1225 -317
- package/dist/{_DXDmuFjC.js → _C4T3WOc-.js} +327 -293
- package/dist/{_Dq5wZ9y2.js → _JZKScK_6.js} +2 -2
- package/dist/_wbad_ZHd.js +2 -0
- package/dist/index.mjs +152 -939
- package/dist/public/assets/{_BLZtgkbJ2.js → _0_BxD6tA2.js} +1 -1
- package/dist/public/assets/_0_BxD6tA2.js.br +0 -0
- package/dist/public/assets/{_sUX0JPgf2.js → _B-ZLatX02.js} +1 -1
- package/dist/public/assets/_B-ZLatX02.js.br +0 -0
- package/dist/public/assets/{_CivjiEX92.js → _B-vJ063K2.js} +1 -1
- package/dist/public/assets/_B-vJ063K2.js.br +0 -0
- package/dist/public/assets/{_Drt_09zp.js → _B3-kV650.js} +1 -1
- package/dist/public/assets/_B3-kV650.js.br +0 -0
- package/dist/public/assets/{_-G0Dx3t52.js → _B6cp2Tnt2.js} +1 -1
- package/dist/public/assets/_B6cp2Tnt2.js.br +0 -0
- package/dist/public/assets/{_CTQouXRe.js → _B7qLfWk7.js} +1 -1
- package/dist/public/assets/_B7qLfWk7.js.br +0 -0
- package/dist/public/assets/{_DmLXUxIk.js → _B8yL5yfH.js} +1 -1
- package/dist/public/assets/_B8yL5yfH.js.br +0 -0
- package/dist/public/assets/{_DHelzj06.js → _BAM8hQx8.js} +1 -1
- package/dist/public/assets/_BAM8hQx8.js.br +0 -0
- package/dist/public/assets/{_ChkNS16f.js → _BCELU8uk.js} +1 -1
- package/dist/public/assets/_BCELU8uk.js.br +0 -0
- package/dist/public/assets/{_ckRann09.js → _BEsGJwj1.js} +1 -1
- package/dist/public/assets/_BEsGJwj1.js.br +0 -0
- package/dist/public/assets/{_C5VLAw4k2.js → _BIlkaSXj2.js} +1 -1
- package/dist/public/assets/_BIlkaSXj2.js.br +0 -0
- package/dist/public/assets/{_B7vYPsWj.js → _BRKdH0Xv.js} +1 -1
- package/dist/public/assets/_BRKdH0Xv.js.br +0 -0
- package/dist/public/assets/{_CuFX3MHy2.js → _BRrshe202.js} +1 -1
- package/dist/public/assets/{_CNClKCWp.js → _BSnpBPhR.js} +1 -1
- package/dist/public/assets/_BSnpBPhR.js.br +0 -0
- package/dist/public/assets/{_Csmr2y3G.js → _Bf8W6hR7.js} +1 -1
- package/dist/public/assets/_Bf8W6hR7.js.br +0 -0
- package/dist/public/assets/{_BE8lov_p2.js → _BjS-vjVo2.js} +1 -1
- package/dist/public/assets/_BjS-vjVo2.js.br +0 -0
- package/dist/public/assets/{_DjVNZ4eK2.js → _BsMtWEvw2.js} +1 -1
- package/dist/public/assets/_BsMtWEvw2.js.br +0 -0
- package/dist/public/assets/{_BSSf-PYx.js → _Bsi-MUb-.js} +1 -1
- package/dist/public/assets/_Bsi-MUb-.js.br +0 -0
- package/dist/public/assets/{_BpJS3XpY2.js → _C4OOpxns2.js} +1 -1
- package/dist/public/assets/_C4OOpxns2.js.br +0 -0
- package/dist/public/assets/{_BqE48K5c.js → _C4bcAkxw.js} +20 -20
- package/dist/public/assets/_C4bcAkxw.js.br +0 -0
- package/dist/public/assets/{_BkrDGdOx2.js → _CEjOmogC2.js} +1 -1
- package/dist/public/assets/_CEjOmogC2.js.br +0 -0
- package/dist/public/assets/{_BBWg58GJ2.js → _CHUg0ksH2.js} +1 -1
- package/dist/public/assets/_CHUg0ksH2.js.br +0 -0
- package/dist/public/assets/{_LdAm0jkh.js → _CJmkmGNg.js} +1 -1
- package/dist/public/assets/_CJmkmGNg.js.br +0 -0
- package/dist/public/assets/{_CfjckiVM2.js → _CKkkXYf42.js} +1 -1
- package/dist/public/assets/_CKkkXYf42.js.br +0 -0
- package/dist/public/assets/{_Y-mhaywp2.js → _CL6hsAgf2.js} +1 -1
- package/dist/public/assets/_CL6hsAgf2.js.br +0 -0
- package/dist/public/assets/{_UxrF5q9P.js → _CNHWN4ne.js} +1 -1
- package/dist/public/assets/_CNHWN4ne.js.br +0 -0
- package/dist/public/assets/{_vWJVVrmZ.js → _COQdreVN.js} +1 -1
- package/dist/public/assets/_COQdreVN.js.br +0 -0
- package/dist/public/assets/{_COZ91m9B.js → _CRzcId75.js} +1 -1
- package/dist/public/assets/_CRzcId75.js.br +0 -0
- package/dist/public/assets/{_snCcB5_5.js → _CSSWCImt.js} +1 -1
- package/dist/public/assets/_CSSWCImt.js.br +0 -0
- package/dist/public/assets/{_RF9fz9Iu.js → _CTIj6y6q.js} +1 -1
- package/dist/public/assets/_CTIj6y6q.js.br +0 -0
- package/dist/public/assets/{_D5nVZek7.js → _CVQsXn4K.js} +1 -1
- package/dist/public/assets/_CVQsXn4K.js.br +0 -0
- package/dist/public/assets/{_DX2Uab-U.js → _CY8DnUYp.js} +1 -1
- package/dist/public/assets/_CY8DnUYp.js.br +0 -0
- package/dist/public/assets/{_C82GEkZ4.js → _CbnLiunX.js} +1 -1
- package/dist/public/assets/_CbnLiunX.js.br +0 -0
- package/dist/public/assets/{_BGhBZpWT.js → _Ckz3mCrC.js} +1 -1
- package/dist/public/assets/_Ckz3mCrC.js.br +0 -0
- package/dist/public/assets/{_DAi07M7i.js → _Cl6zL1rb.js} +1 -1
- package/dist/public/assets/_Cl6zL1rb.js.br +0 -0
- package/dist/public/assets/{_CH2m75uw.js → _CmATrSbQ.js} +1 -1
- package/dist/public/assets/_CmATrSbQ.js.br +0 -0
- package/dist/public/assets/{_C41DPP-z2.js → _Cq4B-czG2.js} +1 -1
- package/dist/public/assets/_Cq4B-czG2.js.br +0 -0
- package/dist/public/assets/{_Dx6kLICJ.js → _CqJy9zqf.js} +1 -1
- package/dist/public/assets/_CqJy9zqf.js.br +0 -0
- package/dist/public/assets/{_BXzRffYj.js → _Cv5cB1Gc.js} +1 -1
- package/dist/public/assets/_Cv5cB1Gc.js.br +0 -0
- package/dist/public/assets/{_B61wm226.js → _CvqFUYec.js} +1 -1
- package/dist/public/assets/_CvqFUYec.js.br +0 -0
- package/dist/public/assets/{_f4WTM4Kz.js → _Cy4Qu_lY.js} +1 -1
- package/dist/public/assets/_Cy4Qu_lY.js.br +0 -0
- package/dist/public/assets/{_B_OOMZsL.js → _Cy6s-DjW.js} +1 -1
- package/dist/public/assets/_Cy6s-DjW.js.br +0 -0
- package/dist/public/assets/{_D1XJzdSj.js → _Cymp0KkN.js} +1 -1
- package/dist/public/assets/_Cymp0KkN.js.br +0 -0
- package/dist/public/assets/{_Bohi4mUp.js → _CzvbtXgZ.js} +1 -1
- package/dist/public/assets/_CzvbtXgZ.js.br +0 -0
- package/dist/public/assets/{_KFiFSJT8.js → _D-wyWmAu.js} +1 -1
- package/dist/public/assets/_D-wyWmAu.js.br +0 -0
- package/dist/public/assets/{_BRzgmRS2.js → _DAQlNNDT.js} +1 -1
- package/dist/public/assets/_DAQlNNDT.js.br +0 -0
- package/dist/public/assets/{_CV60RHGa.js → _DCLWmEuS.js} +1 -1
- package/dist/public/assets/_DCLWmEuS.js.br +0 -0
- package/dist/public/assets/{_CnIE6_qB2.js → _DHth5jay2.js} +1 -1
- package/dist/public/assets/_DHth5jay2.js.br +0 -0
- package/dist/public/assets/{_B7vLPjLl.js → _DI_ZoCy4.js} +1 -1
- package/dist/public/assets/_DI_ZoCy4.js.br +0 -0
- package/dist/public/assets/{_Clv6arvL.js → _DPPdU-Av.js} +1 -1
- package/dist/public/assets/_DPPdU-Av.js.br +0 -0
- package/dist/public/assets/{_Wxr28jKW.js → _DPfjt9fQ.js} +1 -1
- package/dist/public/assets/_DPfjt9fQ.js.br +0 -0
- package/dist/public/assets/{_BdVRHt6-.js → _DTZJyM9w.js} +1 -1
- package/dist/public/assets/_DTZJyM9w.js.br +0 -0
- package/dist/public/assets/{_B-xEEN4l2.js → _DXCkImvC2.js} +1 -1
- package/dist/public/assets/{_DFAhtXzm.js → _DdSK0SaL.js} +1 -1
- package/dist/public/assets/_DdSK0SaL.js.br +0 -0
- package/dist/public/assets/{_B0-ns0BU2.js → _Dim3Qa8e2.js} +1 -1
- package/dist/public/assets/_Dim3Qa8e2.js.br +0 -0
- package/dist/public/assets/{_DPL2ZCgQ.js → _DncKjJb4.js} +1 -1
- package/dist/public/assets/_DncKjJb4.js.br +0 -0
- package/dist/public/assets/{_wgItEK0c.js → _DsjVSWqF.js} +1 -1
- package/dist/public/assets/_DsjVSWqF.js.br +0 -0
- package/dist/public/assets/{_DshD8Ycc.js → _DwvzTp2-.js} +1 -1
- package/dist/public/assets/_DwvzTp2-.js.br +0 -0
- package/dist/public/assets/{_C-uc9hBA2.js → _DxrYm2uA2.js} +1 -1
- package/dist/public/assets/_DxrYm2uA2.js.br +0 -0
- package/dist/public/assets/{_B7OMjNs8.js → _DztmqTsm.js} +1 -1
- package/dist/public/assets/_DztmqTsm.js.br +0 -0
- package/dist/public/assets/{_DpENgSEx.js → _ETZIHvA2.js} +1 -1
- package/dist/public/assets/_ETZIHvA2.js.br +0 -0
- package/dist/public/assets/{_BKTem58K.js → _FgVKeYCS.js} +1 -1
- package/dist/public/assets/_FgVKeYCS.js.br +0 -0
- package/dist/public/assets/{_B5x1OTTu.js → _JL1loQ5W.js} +1 -1
- package/dist/public/assets/_JL1loQ5W.js.br +0 -0
- package/dist/public/assets/{_CWUF1FpI.js → _QP0MFlyi.js} +1 -1
- package/dist/public/assets/_QP0MFlyi.js.br +0 -0
- package/dist/public/assets/{_DvcpKhXL.js → _RZIVk7xV.js} +1 -1
- package/dist/public/assets/_RZIVk7xV.js.br +0 -0
- package/dist/public/assets/{_Bj5u_Vnk2.js → _RjnwisyN2.js} +1 -1
- package/dist/public/assets/_RjnwisyN2.js.br +0 -0
- package/dist/public/assets/{_BOQrg7gU2.js → _U11SdqZG2.js} +1 -1
- package/dist/public/assets/_U11SdqZG2.js.br +0 -0
- package/dist/public/assets/{_QPczAdMm2.js → _XSVpb5jO2.js} +1 -1
- package/dist/public/assets/_XSVpb5jO2.js.br +0 -0
- package/dist/public/assets/{_CifL_Zbh.js → _fDUiWXKb.js} +1 -1
- package/dist/public/assets/_fDUiWXKb.js.br +0 -0
- package/dist/public/assets/{_Dixad7y-2.js → _kVKsguoi2.js} +1 -1
- package/dist/public/assets/_kVKsguoi2.js.br +0 -0
- package/dist/public/assets/{_CYgKydU62.js → _o_bMNXwQ2.js} +1 -1
- package/dist/public/assets/_o_bMNXwQ2.js.br +0 -0
- package/dist/public/assets/{_DpCy3kYU.js → _tP5Jh-Ws.js} +45 -45
- package/dist/public/assets/_tP5Jh-Ws.js.br +0 -0
- package/dist/public/assets/{_c9sBllWt.js → _tpRUSSso.js} +1 -1
- package/dist/public/assets/_tpRUSSso.js.br +0 -0
- package/dist/public/assets/{_D-SthL18.js → _uEb-xDmI.js} +1 -1
- package/dist/public/assets/{_BUs7NMrG.js → _uKsdufG5.js} +1 -1
- package/dist/public/assets/_uKsdufG5.js.br +0 -0
- package/dist/public/assets/{_BTXq-nPh2.js → _vs0DFS9r2.js} +1 -1
- package/dist/public/assets/_vs0DFS9r2.js.br +0 -0
- package/dist/public/assets/{app-page-CAw2YLYv.css → app-page-KK8yJIbR.css} +1 -1
- package/dist/public/assets/app-page-KK8yJIbR.css.br +0 -0
- package/dist/public/assets/diff-view-TbHko8ib.css +1 -0
- package/dist/public/assets/diff-view-TbHko8ib.css.br +0 -0
- package/dist/public/assets/new-OSO__hUI.js +1 -0
- package/dist/public/assets/settings-OSO__hUI.js +1 -0
- package/dist/public/assets/w-OSO__hUI.js +1 -0
- package/dist/public/assets/w._-BVUaVdRa.js +1 -0
- package/dist/public/assets/w._-OSO__hUI.js +1 -0
- package/lib/setup/agents.json +66 -0
- package/lib/setup/catalog.d.mts +2 -0
- package/lib/setup/catalog.mjs +9 -10
- package/package.json +3 -3
- package/dist/_DLxkSyzt.js +0 -2
- package/dist/public/assets/_-G0Dx3t52.js.br +0 -0
- package/dist/public/assets/_B0-ns0BU2.js.br +0 -0
- package/dist/public/assets/_B5x1OTTu.js.br +0 -0
- package/dist/public/assets/_B61wm226.js.br +0 -0
- package/dist/public/assets/_B7OMjNs8.js.br +0 -0
- package/dist/public/assets/_B7vLPjLl.js.br +0 -0
- package/dist/public/assets/_B7vYPsWj.js.br +0 -0
- package/dist/public/assets/_BBWg58GJ2.js.br +0 -0
- package/dist/public/assets/_BE8lov_p2.js.br +0 -0
- package/dist/public/assets/_BGhBZpWT.js.br +0 -0
- package/dist/public/assets/_BKTem58K.js.br +0 -0
- package/dist/public/assets/_BLZtgkbJ2.js.br +0 -0
- package/dist/public/assets/_BOQrg7gU2.js.br +0 -0
- package/dist/public/assets/_BRzgmRS2.js.br +0 -0
- package/dist/public/assets/_BSSf-PYx.js.br +0 -0
- package/dist/public/assets/_BTXq-nPh2.js.br +0 -0
- package/dist/public/assets/_BUs7NMrG.js.br +0 -0
- package/dist/public/assets/_BXzRffYj.js.br +0 -0
- package/dist/public/assets/_B_OOMZsL.js.br +0 -0
- package/dist/public/assets/_BdVRHt6-.js.br +0 -0
- package/dist/public/assets/_Bj5u_Vnk2.js.br +0 -0
- package/dist/public/assets/_BkrDGdOx2.js.br +0 -0
- package/dist/public/assets/_Bohi4mUp.js.br +0 -0
- package/dist/public/assets/_BpJS3XpY2.js.br +0 -0
- package/dist/public/assets/_BqE48K5c.js.br +0 -0
- package/dist/public/assets/_C-uc9hBA2.js.br +0 -0
- package/dist/public/assets/_C41DPP-z2.js.br +0 -0
- package/dist/public/assets/_C5VLAw4k2.js.br +0 -0
- package/dist/public/assets/_C82GEkZ4.js.br +0 -0
- package/dist/public/assets/_CH2m75uw.js.br +0 -0
- package/dist/public/assets/_CNClKCWp.js.br +0 -0
- package/dist/public/assets/_COZ91m9B.js.br +0 -0
- package/dist/public/assets/_CTQouXRe.js.br +0 -0
- package/dist/public/assets/_CV60RHGa.js.br +0 -0
- package/dist/public/assets/_CWUF1FpI.js.br +0 -0
- package/dist/public/assets/_CYgKydU62.js.br +0 -0
- package/dist/public/assets/_CfjckiVM2.js.br +0 -0
- package/dist/public/assets/_ChkNS16f.js.br +0 -0
- package/dist/public/assets/_CifL_Zbh.js.br +0 -0
- package/dist/public/assets/_CivjiEX92.js.br +0 -0
- package/dist/public/assets/_Clv6arvL.js.br +0 -0
- package/dist/public/assets/_CnIE6_qB2.js.br +0 -0
- package/dist/public/assets/_Csmr2y3G.js.br +0 -0
- package/dist/public/assets/_D1XJzdSj.js.br +0 -0
- package/dist/public/assets/_D5nVZek7.js.br +0 -0
- package/dist/public/assets/_DAi07M7i.js.br +0 -10
- package/dist/public/assets/_DFAhtXzm.js.br +0 -0
- package/dist/public/assets/_DHelzj06.js.br +0 -0
- package/dist/public/assets/_DPL2ZCgQ.js.br +0 -5
- package/dist/public/assets/_DX2Uab-U.js.br +0 -0
- package/dist/public/assets/_Dixad7y-2.js.br +0 -0
- package/dist/public/assets/_DjVNZ4eK2.js.br +0 -0
- package/dist/public/assets/_DmLXUxIk.js.br +0 -0
- package/dist/public/assets/_DpCy3kYU.js.br +0 -0
- package/dist/public/assets/_DpENgSEx.js.br +0 -0
- package/dist/public/assets/_Drt_09zp.js.br +0 -0
- package/dist/public/assets/_DshD8Ycc.js.br +0 -0
- package/dist/public/assets/_DvcpKhXL.js.br +0 -0
- package/dist/public/assets/_Dx6kLICJ.js.br +0 -0
- package/dist/public/assets/_KFiFSJT8.js.br +0 -0
- package/dist/public/assets/_LdAm0jkh.js.br +0 -0
- package/dist/public/assets/_QPczAdMm2.js.br +0 -0
- package/dist/public/assets/_RF9fz9Iu.js.br +0 -0
- package/dist/public/assets/_UxrF5q9P.js.br +0 -0
- package/dist/public/assets/_Wxr28jKW.js.br +0 -0
- package/dist/public/assets/_Y-mhaywp2.js.br +0 -0
- package/dist/public/assets/_c9sBllWt.js.br +0 -0
- package/dist/public/assets/_ckRann09.js.br +0 -0
- package/dist/public/assets/_f4WTM4Kz.js.br +0 -0
- package/dist/public/assets/_sUX0JPgf2.js.br +0 -0
- package/dist/public/assets/_snCcB5_5.js.br +0 -0
- package/dist/public/assets/_vWJVVrmZ.js.br +0 -0
- package/dist/public/assets/_wgItEK0c.js.br +0 -0
- package/dist/public/assets/app-page-CAw2YLYv.css.br +0 -0
- package/dist/public/assets/diff-view-DCB49VYM.css +0 -1
- package/dist/public/assets/diff-view-DCB49VYM.css.br +0 -0
- package/dist/public/assets/new-C9qRFMyu.js +0 -1
- package/dist/public/assets/settings-C9qRFMyu.js +0 -1
- package/dist/public/assets/w-C9qRFMyu.js +0 -1
- package/dist/public/assets/w._-C9qRFMyu.js +0 -1
- package/dist/public/assets/w._-phpTDxP7.js +0 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/
|
|
2
|
-
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,
|
|
3
|
-
`)}function
|
|
4
|
-
`),a=Math.max(1,t-
|
|
5
|
-
`)}function
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_Cv5cB1Gc.js","assets/_ETZIHvA2.js","assets/_CY8DnUYp.js","assets/_DI_ZoCy4.js","assets/_B8yL5yfH.js","assets/_FgVKeYCS.js","assets/_Cymp0KkN.js","assets/_DPfjt9fQ.js","assets/_BAM8hQx8.js","assets/_fDUiWXKb.js","assets/_BsMtWEvw2.js","assets/_XSVpb5jO2.js","assets/_BXeXVLqQ2.js","assets/_C4OOpxns2.js","assets/_B-ZLatX02.js","assets/_BRrshe202.js","assets/_0_BxD6tA2.js","assets/_CpYNKFv52.js","assets/_bTVj8UrX2.js","assets/_kIpfj7zU2.js","assets/_gzcpVVnB2.js","assets/_o_bMNXwQ2.js","assets/_Cq4B-czG2.js","assets/_Cy4Qu_lY.js","assets/_Bf8W6hR7.js","assets/_CmATrSbQ.js","assets/_BRKdH0Xv.js","assets/_CTIj6y6q.js","assets/_CJmkmGNg.js","assets/_BCELU8uk.js","assets/_DncKjJb4.js","assets/_Ckz3mCrC.js","assets/_DztmqTsm.js","assets/_DCLWmEuS.js","assets/_Bsi-MUb-.js","assets/_tpRUSSso.js","assets/_CSSWCImt.js","assets/_B7qLfWk7.js","assets/_JL1loQ5W.js","assets/_Cl6zL1rb.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_DsKRHcpP2.js","assets/_CYNrtFtB2.js","assets/_DmIc4jLQ2.js","assets/_CY8IvGdO2.js","assets/_CBce3t8t2.js","assets/_DYvRD3hg2.js","assets/_Dl-2e7rI2.js","assets/_woXpYk--.js","assets/_DXCkImvC2.js","assets/_RjnwisyN2.js","assets/_DxrYm2uA2.js","assets/_vs0DFS9r2.js","assets/_CHUg0ksH2.js","assets/_COQdreVN.js","assets/_CRzcId75.js","assets/_Dx-8-gkx.js","assets/_DLbMbJfH.js","assets/_C8oCnwJJ2.js","assets/_QP0MFlyi.js","assets/_BSnpBPhR.js","assets/_CvqFUYec.js","assets/_DdSK0SaL.js","assets/_DPPdU-Av.js","assets/_CbnLiunX.js","assets/_CNHWN4ne.js","assets/_CVQsXn4K.js","assets/_DTZJyM9w.js","assets/_B3-kV650.js","assets/_DVTAwKKz.js","assets/_uKsdufG5.js","assets/_DY5hwH4S2.js","assets/_DJMQeKeT2.js","assets/_CEjOmogC2.js","assets/_B-vJ063K2.js","assets/_U11SdqZG2.js","assets/_DqKBuwfJ2.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN2.js","assets/_CacY0gHj2.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim2.js","assets/_O90oeIOV2.js","assets/_BjS-vjVo2.js","assets/_DOwzaHZ02.js","assets/_B3gFvitq2.js","assets/_Cfkwpbl82.js","assets/_BiFt_7mu2.js","assets/_CMLA9XwU2.js","assets/_BIlkaSXj2.js","assets/_Cy6s-DjW.js","assets/_DAQlNNDT.js","assets/_RZIVk7xV.js","assets/_CzvbtXgZ.js","assets/_Bj61d0ZC.js","assets/_DwvzTp2-.js","assets/_BM315xPC.js","assets/_Cvrh5tZx2.js","assets/_uEb-xDmI.js","assets/_DsjVSWqF.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_BEsGJwj1.js","assets/_CqJy9zqf.js","assets/_D-wyWmAu.js","assets/_Dim3Qa8e2.js","assets/_DHth5jay2.js","assets/_CL6hsAgf2.js","assets/_B6cp2Tnt2.js","assets/_kVKsguoi2.js","assets/_CKkkXYf42.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,O as b,Ot as x,P as S,Q as C,R as ee,S as te,St as w,T as ne,Tt as T,U as re,V as ie,W as ae,X as oe,Y as se,Z as ce,_ as le,_t as E,a as ue,at as de,b as fe,bt as pe,c as me,ct as he,d as ge,dt as _e,et as ve,f as ye,ft as be,g as xe,gt as D,h as Se,ht as O,i as Ce,it as we,j as Te,jt as Ee,k as De,kt as k,l as Oe,lt as ke,m as Ae,mt as je,n as Me,nt as Ne,o as Pe,ot as A,p as Fe,pt as Ie,q as Le,r as Re,rt as ze,s as Be,st as j,t as M,tt as Ve,u as He,ut as Ue,v as We,vt as Ge,w as Ke,wt as N,x as qe,xt as Je,y as Ye,yt as Xe,z as Ze}from"./_C4bcAkxw.js";var Qe=Object.defineProperty,$e=(e,t)=>{let n={};for(var r in e)Qe(n,r,{get:e[r],enumerable:!0});return t||Qe(n,Symbol.toStringTag,{value:`Module`}),n};function et(e){return e.map(e=>{let t=e.pr?String(e.pr.number):`-`,n=e.pr&&(e.pr.headRefOid||e.head)||``,r=e.localHead||e.head||``;return`${e.worktree}#${t}:${n}:L${r}`}).sort().join(`\0`)}function tt(e){return e.repos.flatMap(e=>{let t=e.localHead||``;return e.prs.length?e.prs.map(n=>`${e.worktree}#${n.number}:${n.headRefOid||``}:L${t}`):[`${e.worktree}#-::L${t}`]}).sort().join(`\0`)}function nt(e){let t=[],n=[];for(let r of e.trim().split(/\s+/).filter(Boolean)){let e=r.startsWith(`!`),i=e?r.slice(1):r;i&&(e?n:t).push(rt(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function rt(e){if(!/[*?]/.test(e))return t=>ge(e,t);let t=``;for(let n=0;n<e.length;n++){let r=e[n];r===`*`?e[n+1]===`*`?(t+=`.*`,n++):t+=`[^/]*`:t+=r===`?`?`[^/]`:r.replace(/[.+^${}()|[\]\\]/,`\\$&`)}try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{return t=>ge(e,t)}}var it=`search-mark`,at=`mark.${it}`,ot=`mark.${it}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${it} *,mark.${it} *::before,mark.${it} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${it}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,st={query:``,hit:null},ct=new Map;function lt(e,t){st.query=e,st.hit=t;for(let[e,t]of ct)wt(e,st.query,st.hit?.key===t?st.hit:null);t&&dt(t)}function ut(){st.hit&&dt(st.hit)}function dt(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of ct)if(i===e.key&&(n=!0,mt(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>dt(e,t+1),n?32:48)})})}function ft(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;if(n===`y`){let t=i.top-r.top+e.scrollTop-(r.height/2-i.height/2);return e.scrollTo({top:Math.max(0,t)}),!0}if(e.scrollWidth<=e.clientWidth+1)return!0;let a=Math.min(24,r.width/8);if(i.left>=r.left+a&&i.right<=r.right-a)return!0;let o=i.left-r.left+e.scrollLeft-(r.width/2-i.width/2),s=Math.max(0,e.scrollWidth-e.clientWidth);return e.scrollTo({left:Math.max(0,Math.min(o,s))}),!0}function pt(e,t){let n=t.parentElement,r=e;for(;r&&r!==n;){if(r instanceof HTMLElement&&r.scrollWidth>r.clientWidth+1){let e=getComputedStyle(r).overflowX;if(e===`auto`||e===`scroll`)return r}let e=r.getRootNode(),t=r.parentElement??(e instanceof ShadowRoot?e.host:null);if(t===r)break;r=t}return null}function mt(e,t){let n=e.querySelector(`diffs-container`)?.shadowRoot;if(!n)return!1;let r=n.querySelector(`mark.search-mark.active`)??(()=>{if(t.line<1)return null;let e=[...n.querySelectorAll(`[data-line="${t.line}"]`)],r=t.side||`additions`;return e.find(e=>yt(e)===r)??e[0]??null})();if(!r)return!1;let i=e.closest(`[data-diff-main]`);if(i){if(!ft(i,r,`y`))return!1}else r.scrollIntoView({block:`center`,inline:`nearest`});let a=pt(r,e);return a&&ft(a,r,`x`),!0}function ht(e,t){let n=t&&st.hit?.key===t?st.hit:null;wt(e,st.query,n),n&&dt(n)}function gt(e,t){return ct.set(e,t),ht(e,t),()=>{ct.delete(e)}}function _t(e){ht(e,ct.get(e))}function vt(e){for(let t of[...e.querySelectorAll(at)]){let e=t.parentElement;t.replaceWith(...t.childNodes),e?.normalize()}}function yt(e){let t=e.closest(`[data-code]`);return t?.hasAttribute(`data-deletions`)?`deletions`:t?.hasAttribute(`data-additions`)?`additions`:(e.getAttribute(`data-line-type`)||``).includes(`deletion`)?`deletions`:`additions`}function bt(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(at)||n.push(e);return n}function xt(e,t,n){let r=0;for(let i=0;i<e.length;i++){let a=t[i].length;if(n<=r+a)return{node:e[i],offset:Math.min(a,Math.max(0,n-r))};r+=a}let i=e.at(-1);return i?{node:i,offset:t.at(-1)?.length??0}:null}function St(e,t,n,r,i){let a=xt(e,t,n),o=xt(e,t,r);if(!a||!o)return;let s=document.createRange();s.setStart(a.node,a.offset),s.setEnd(o.node,o.offset);let c=document.createElement(`mark`);c.className=i;try{c.append(s.extractContents()),s.insertNode(c)}catch{}}function Ct(e,t,n,r){let i=bt(e);if(!i.length)return;let a=i.map(e=>e.textContent??``),o=a.join(``),s=n?o:o.toLowerCase(),c=[];for(let e=s.indexOf(t);e!==-1;e=s.indexOf(t,e+t.length))c.push([e,e+t.length]);if(!c.length)return;let l=yt(e),u=Number(e.getAttribute(`data-line`)),d=r&&r.line===u&&(r.side||`additions`)===l?`${it} active`:it;for(let e=c.length-1;e>=0;e--)St(i,a,c[e][0],c[e][1],d)}function wt(e,t,n){let r=[e],i=e.querySelector(`diffs-container`)?.shadowRoot;i&&r.push(i);let a=t.trim(),o=/[A-Z]/.test(a),s=a&&!o?a.toLowerCase():a;for(let e of r)if(vt(e),s)for(let t of e.querySelectorAll(`[data-code] [data-line]`))Ct(t,s,o,n)}var Tt=3;function Et(e,t){let n=new Map;for(let t of e)n.set(t.worktree,[...n.get(t.worktree)||[],t]);let r=[`Review feedback:`],i=0;for(let[e,a]of n){let n=(t||[]).find(t=>t.worktree===e);r.push(``),r.push(Ot(e,n,a));for(let e of a){i++;let t=e.side===`deletions`?`Old`:`New`,a=e.line_start===e.line_end?`line ${e.line_start}`:`lines ${e.line_start}-${e.line_end}`;r.push(``),r.push(`${i}. **${e.path}** (${t} ${a})`);let o=e.snippet??Dt(n,e);if(o!=null){let e=jt(o);r.push(``),r.push(Mt(`${e}diff\n${o}\n${e}`))}r.push(``),r.push(Mt(e.text))}}return r.join(`
|
|
3
|
+
`)}function Dt(e,t){let n=e?.files?.find(e=>e.path===t.path),r=t.side===`deletions`?n?.old:n?.new;return r==null?null:At(r,t.line_start,t.line_end,t.side)}function Ot(e,t,n){if(t?.head){let n=kt(t.head),r=t.baseSha?kt(t.baseSha):``,i=t.pr?.headRefName||t.branch||`HEAD`;return`${e}/${t.pr?` #${t.pr.number}`:``}: \`${i}\` ${n}${t.base?` vs \`${t.base}\` ${r}`:``}`}let r=[...new Set(n.map(e=>e.head).filter(Boolean))];return r.length?`${e}/: ${r.map(e=>kt(e)).join(`, `)}`:`${e}/`}function kt(e,t=12){return e.slice(0,t)}function At(e,t,n,r){let i=e.split(`
|
|
4
|
+
`),a=Math.max(1,t-Tt),o=Math.min(i.length,n+Tt),s=r===`deletions`?`-`:`+`,c=[];for(let e=a;e<=o;e++){let r=e>=t&&e<=n?s:` `;c.push(`${r}${String(e).padStart(4)} | ${i[e-1]??``}`)}return c.join(`
|
|
5
|
+
`)}function jt(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function Mt(e){return e.split(`
|
|
6
6
|
`).map(e=>e&&` ${e}`).join(`
|
|
7
|
-
`)}function
|
|
7
|
+
`)}function Nt(e){let t={dirs:new Map,files:[]};for(let n of e){let e=n.path.split(`/`),r=e.pop(),i=t;for(let t of e){let e=i.dirs.get(t);e||(e={dirs:new Map,files:[]},i.dirs.set(t,e)),i=e}i.files.push({file:n,name:r})}let n=[],r=(e,t,i)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>e.localeCompare(t))){let e=a,s=o;for(;s.dirs.size===1&&!s.files.length;){let[[t,n]]=s.dirs;e+=`/${t}`,s=n}let c=i?`${i}/${e}`:e;n.push({kind:`dir`,label:e,path:c,depth:t}),r(s,t+1,c)}for(let{file:r,name:i}of e.files)n.push({kind:`file`,file:r,name:i,depth:t})};return r(t,0,``),n}var Pt=`_ef _X _g`,Ft=`<span><button type=button title="Copy comments as markdown"> </button><!></span>`,It=` D D l%l`,Lt=(e,t)=>A(e.a,`value`,t),Rt=x(7,e=>v(e.b,e.f||e.g)),zt=E(5,Rt),Bt=E(6,Rt),Vt=(e,t)=>{Lt(e,t[0]?.id),zt(e,t[0]?.title),Bt(e,t[0]?.agent)},Ht=a(3,1,e=>{A(e.b,`disabled`,e._.k),v(e.c,e._.k?`Sending…`:`Send to`),A(e.d,`disabled`,e._.k)}),Ut=n(`h2`,e=>{s(e.b,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){tn(e._,!0);try{await e._.i(e._.s)}finally{tn(e._,!1)}}})()}),Ie(e,`d`)}),Wt=e=>{Ht._(e),Gt._(e),qt._(e),j(e.a,`_eG`),j(e.b,[`_m`,`_eH`]),j(e.d,`_eI`),Ut(e)},Gt=a(3,1,e=>be(e,`d`,e._.l,gn(e))),Kt=Je(3,`<option> </option>`,` D `,0,Vt),qt=a(3,1,e=>Kt(e,[e._.m,`id`])),Jt=x(2,e=>v(e.b,e._.k?`Sending…`:`Send to ${e._.q||e._.r}`),2),Yt=a(3,0,e=>{A(e.a,`disabled`,e._.k),Jt(e)}),Xt=n(`h1`,e=>s(e.a,`click`,function(){(async()=>{if(!(!e._.s||e._.k)){tn(e._,!0);try{await e._.i(e._.s)}finally{tn(e._,!1)}}})()})),Zt=e=>{Yt._(e),Qt._(e),$t._(e),j(e.a,[`_l`,`_m`]),Xt(e)},Qt=a(3,0,Jt),$t=a(3,0,Jt),en=N(9,e=>v(e.c,e.j?`Copied`:`Copy`)),tn=N(10,e=>{Yt(e),Ht(e)}),nn=E(18),rn=x(13,e=>nn(e,e.m.some(t=>t.id===e.l)?e.l:e.m[0]?.id??null)),an=N(11,e=>{rn(e),Gt(e)}),on=n(`h3`,e=>s(e.b,`click`,function(){(async()=>{await e.h()&&(en(e,!0),setTimeout(()=>{en(e,!1)},1500))})()}));function sn(e){j(e.a,`_eF`),j(e.b,`_l`),en(e,!1),tn(e,!1),an(e,null),on(e)}var cn=E(12,e=>{ln(e,e.m[0]?.title),un(e,e.m[0]?.agent),fn(e,e.m.length),rn(e),qt(e)}),ln=E(16,Qt),un=E(17,$t),dn=w(3,`<button type=button> </button>`,` D `,Zt,`<span><button type=button> </button><select aria-label="Send comments to session"></select></span>`,` D D l `,Wt),fn=(e,t)=>dn(e,t===1?0:t?1:2),pn=(e,t)=>cn(e,t||[]),mn=E(7),hn=E(8);function gn(e){return t=>{an(e._,t)}}k(`h0`,gn);var _n=`diffs-container`,vn=/(?=^diff --git)/gm,yn=/(?<=\n)/,bn=/^(---|\+\+\+)\s+([^\t\r\n]+)/,xn=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Sn=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Cn=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,wn=`header-prefix`,Tn=`header-filename-suffix`,En=`header-metadata`,Dn=`header-custom`,On={dark:`pierre-dark`,light:`pierre-light`},kn=`data-theme-css`,An=`data-unsafe-css`,jn=`data-diffs-scrollbar-measure`,Mn=`--diffs-scrollbar-gutter-measured`,Nn=1e5,Pn=Object.freeze({fromStart:0,fromEnd:0}),Fn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},In={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Ln=new Set,Rn=null;function zn(e){Ln.add(e),Rn??=requestAnimationFrame(Vn)}function Bn(e){Ln.delete(e)&&Ln.size===0&&Rn!=null&&(cancelAnimationFrame(Rn),Rn=null)}function Vn(e){let t=new Set(Ln);Ln.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}Rn=Ln.size>0?requestAnimationFrame(Vn):null}function Hn(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Un(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Wn(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var Gn=new TextEncoder,Kn=new TextDecoder(`utf-8`,{ignoreBOM:!0}),qn=/[\uD800-\uDFFF]/,Jn=1024,Yn=new Uint8Array(Jn);function Xn(){Yn.length!==Jn&&(Yn=new Uint8Array(Jn))}function P(e){if(e.length===0)return e;if(qn.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Yn.length<t&&(Yn=new Uint8Array(t));let{written:n}=Gn.encodeInto(e,Yn);return Kn.decode(Yn.subarray(0,n))}function Zn(e,t){return e-(t===0?0:1)}function F(e,t){return Zn(e,t)+t}var Qn=4096,$n=.5;function er(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=nr(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}tr(t,e)}}function tr(e,t){let{hunkContent:n}=e;for(let e=1;e<n.length;e++){let r=n[e],i=n[e-1];if(r.type!==`change`||r.additions>0&&r.deletions>0||i.type!==`context`)continue;let a=r.additions>0,o=a?t.additionLines:t.deletionLines,s=a?r.additionLineIndex:r.deletionLineIndex,c=a?r.additions:r.deletions,l=o[s]??``;if(l.trim()!==``)continue;let u=!0;for(let e=1;e<c;e++)if(o[s+e]!==l){u=!1;break}if(!u)continue;let d=0;for(;d<i.lines&&t.additionLines[i.additionLineIndex+i.lines-1-d]===l;)d++;if(d===0||e===1&&d===i.lines)continue;r.additionLineIndex-=d,r.deletionLineIndex-=d;let f=r.additionLineIndex+r.additions,p=r.deletionLineIndex+r.deletions,m=n[e+1];m?.type===`context`?(m.lines+=d,m.additionLineIndex=f,m.deletionLineIndex=p):n.splice(e+1,0,{type:`context`,lines:d,additionLineIndex:f,deletionLineIndex:p}),i.lines-=d,i.lines===0&&(n.splice(e-1,1),e--)}}function nr(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>Qn)return null;let c=[];for(let t=0;t<n;t++)c.push(ir(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(ir(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=ar(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*$n:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var rr=/\s+/g;function ir(e){return e.replace(rr,``)}function ar(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}function or(e,t){try{return sr(e,t)}finally{Xn()}}function sr(e,{cacheKey:t,isGitDiff:n=vn.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=hr(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=lr(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=fr(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?cr(i.contents):[],deletionLines:!l&&r!=null&&i!=null?cr(r.contents):[],cacheKey:_r(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(Sn),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=P(r.trim()),n!==r&&(c.prevName=P(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?xn:bn):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=P(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=P(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=P(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=P(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=P(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=P(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(Cn)??[];t!=null&&(c.prevObjectId=P(t)),n!=null&&(c.newObjectId=P(n)),r!=null&&(c.mode=P(r))}e.startsWith(`rename from `)&&(c.prevName=P(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=P(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
8
8
|
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
9
|
-
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:
|
|
10
|
-
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function
|
|
11
|
-
`&&n!==`\r`)return!1}return!0}function
|
|
9
|
+
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:_r(p.hunkContext),hunkSpecs:P(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&ur(t)&&!dr(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=vr(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=yr(t);(g==null||g.type!==`change`)&&(g=br(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=yr(t);(g==null||g.type!==`change`)&&(g=br(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=yr(t);(g==null||g.type!==`context`)&&(g=br(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=Wn(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=Wn(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(Zn(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=F(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=F(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),er(c),c}}function cr(e){let t=lr(e);for(let e=0;e<t.length;e++)t[e]=P(t[e]);return t}function lr(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
10
|
+
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function ur(e){let t=e[0];return t===`+`||t===`-`||t===` `}function dr(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
11
|
+
`&&n!==`\r`)return!1}return!0}function fr(e){if(!e.startsWith(`@@ -`))return;let t=4,n=pr(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=pr(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=pr(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=pr(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=mr(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function pr(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function mr(e){return e.endsWith(`\r
|
|
12
12
|
`)?e.slice(0,-2):e.endsWith(`
|
|
13
|
-
`)?e.slice(0,-1):e}function
|
|
14
|
-
`:t)}function
|
|
13
|
+
`)?e.slice(0,-1):e}function hr(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:gr(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=gr(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function gr(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function _r(e){return e==null?e:P(e)}function vr(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function yr(e){let t=e.slice(1);return P(t===``?`
|
|
14
|
+
`:t)}function br(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var xr=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Sr=new class extends xr{};function Cr(e,t,n){return Sr.diff(e,t,n)}function wr(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Tr(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Er(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Dr(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Or(e,t){return Er(e,t,``)}function kr(e,t){return Dr(e,t,``)}function Ar(e,t){return t.slice(0,jr(e,t))}function jr(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Mr(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Nr(e,t){if(t)return Fr(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Pr(e,t){if(t)return Fr(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Fr(e,t){if(!t)return[Pr(e),Nr(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Mr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Ir=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Lr=RegExp(`[${Ir}]+|\\s+|[^${Ir}]`,`ug`);new class extends xr{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Mr(e,r)}else n=e.match(Lr)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Rr(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Rr(n,i,r,null,t.intlSegmenter),e}};function Rr(e,t,n,r,i){if(t&&n){let[a,o]=Fr(t.value,i),[s,c]=Fr(n.value,i);if(e){let r=wr(a,s);e.value=Dr(e.value,s,r),t.value=Or(t.value,r),n.value=Or(n.value,r)}if(r){let e=Tr(o,c);r.value=Er(r.value,c,e),t.value=kr(t.value,e),n.value=kr(n.value,e)}}else if(n){if(e){let e=Pr(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Pr(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Pr(r.value,i),[a,o]=Fr(t.value,i),s=wr(n,a);t.value=Or(t.value,s);let c=Tr(Or(n,s),o);t.value=kr(t.value,c),r.value=Er(r.value,n,c),e.value=Dr(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Pr(r.value,i),n=Ar(Nr(t.value,i),e);t.value=kr(t.value,n)}else if(e){let n=Ar(Nr(e.value,i),Pr(t.value,i));t.value=Or(t.value,n)}}var zr=new class extends xr{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Ir}]+|[^\\S\\n\\r]+|[^${Ir}]`,`ug`);return e.match(t)||[]}};function Br(e,t,n){return zr.diff(e,t,n)}var Vr=new class extends xr{constructor(){super(...arguments),this.tokenize=Ur}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
15
15
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
16
16
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
17
17
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
18
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function
|
|
19
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function
|
|
20
|
-
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function
|
|
21
|
-
`)}let n=[];if(e.isGit){if(t=
|
|
18
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Hr(e,t,n){return Vr.diff(e,t,n)}function Ur(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
19
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Wr(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function Gr(e){if(!Wr(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var Kr={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function qr(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;Hr(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(Hr(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||Xr(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
20
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Jr(e,t){if(t||=Kr,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>Jr(e,t)).join(`
|
|
21
|
+
`)}let n=[];if(e.isGit){if(t=Kr,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+Gr(r)+` `+Gr(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+Gr((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+Gr((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+Gr((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+Gr((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+Gr(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+Gr(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
22
22
|
`)+`
|
|
23
|
-
`}function
|
|
23
|
+
`}function Yr(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;qr(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Jr(e,o.headerOptions):void 0)}}))}else{let s=qr(e,t,n,r,i,a,o);return s?Jr(s,o?.headerOptions):void 0}}function Xr(e){let t=e.endsWith(`
|
|
24
24
|
`),n=e.split(`
|
|
25
25
|
`).map(e=>e+`
|
|
26
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Xr=`/dev/null`;function Zr(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Qr(),a=t??Qr(),o=ar(Jr(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Qr(){return{name:Xr,contents:``}}function $r(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ei(e){return{type:`text`,value:e}}function I({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function ti({name:e,width:t=16,height:n=16,properties:r}){return I({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[I({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function ni(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function ri(e){return I({tagName:`div`,properties:{"data-gutter":``},children:e})}function ii(e,t,n,r={}){return I({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[I({tagName:`span`,properties:{"data-line-number-content":``},children:[ei(`${t}`)]})]})}function ai(e,t,n){return I({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function oi(){return I({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[ti({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function si(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function ci(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var li=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],ui=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ui.prototype.normal={},ui.prototype.property={},ui.prototype.space=void 0;function di(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ui(n,r,t)}function fi(e){return e.toLowerCase()}var L=class{constructor(e,t){this.attribute=t,this.property=e}};L.prototype.attribute=``,L.prototype.booleanish=!1,L.prototype.boolean=!1,L.prototype.commaOrSpaceSeparated=!1,L.prototype.commaSeparated=!1,L.prototype.defined=!1,L.prototype.mustUseProperty=!1,L.prototype.number=!1,L.prototype.overloadedBoolean=!1,L.prototype.property=``,L.prototype.spaceSeparated=!1,L.prototype.space=void 0;var pi=Qe({boolean:()=>R,booleanish:()=>z,commaOrSpaceSeparated:()=>H,commaSeparated:()=>gi,number:()=>B,overloadedBoolean:()=>hi,spaceSeparated:()=>V}),mi=0,R=_i(),z=_i(),hi=_i(),B=_i(),V=_i(),gi=_i(),H=_i();function _i(){return 2**++mi}var vi=Object.keys(pi),yi=class extends L{constructor(e,t,n,r){let i=-1;if(super(e,t),bi(this,`space`,r),typeof n==`number`)for(;++i<vi.length;){let e=vi[i];bi(this,vi[i],(n&pi[e])===pi[e])}}};yi.prototype.defined=!0;function bi(e,t,n){n&&(e[t]=n)}function xi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new yi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[fi(r)]=r,n[fi(a.attribute)]=r}return new ui(t,n,e.space)}var Si=xi({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:z,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:V,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:z,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Ci(e,t){return t in e?e[t]:t}function wi(e,t){return Ci(e,t.toLowerCase())}var Ti=xi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:gi,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:V,autoFocus:R,autoPlay:R,blocking:V,capture:null,charSet:null,checked:R,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:z,controls:R,controlsList:V,coords:B|gi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:hi,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:V,height:B,hidden:hi,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:V,itemRef:V,itemScope:R,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:V,required:R,reversed:R,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:z,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:gi,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:wi}),Ei=xi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:H,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:gi,g2:gi,glyphName:gi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:H,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:H,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:H,rev:H,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:H,requiredFeatures:H,requiredFonts:H,requiredFormats:H,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:H,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:H,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:H,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Ci}),Di=xi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Oi=xi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:wi}),ki=xi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ai=/[A-Z]/g,ji=/-[a-z]/g,Mi=/^data[-\w.:]+$/i;function Ni(e,t){let n=fi(t),r=t,i=L;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Mi.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ji,Fi);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ji.test(e)){let n=e.replace(Ai,Pi);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=yi}return new i(r,t)}function Pi(e){return`-`+e.toLowerCase()}function Fi(e){return e.charAt(1).toUpperCase()}var Ii=di([Si,Ti,Di,Oi,ki],`html`),Li=di([Si,Ei,Di,Oi,ki],`svg`),Ri={}.hasOwnProperty;function zi(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Ri.call(t,e)){let n=String(t[e]);i=Ri.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Bi=/["&'<>`]/g,Vi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Hi=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ui=/[|\\{}()[\]^$+*?.]/g,Wi=new WeakMap;function Gi(e,t){if(e=e.replace(t.subset?Ki(t.subset):Bi,r),t.subset||t.escapeOnly)return e;return e.replace(Vi,n).replace(Hi,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Ki(e){let t=Wi.get(e);return t||(t=qi(e),Wi.set(e,t)),t}function qi(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ui,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Ji=/[\dA-Fa-f]/;function Yi(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Ji.test(String.fromCharCode(t))?r:r+`;`}var Xi=/\d/;function Zi(e,t,n){let r=`&#`+String(e);return n&&t&&!Xi.test(String.fromCharCode(t))?r:r+`;`}var Qi=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),$i={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},ea=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],ta={}.hasOwnProperty,na={},ra;for(ra in $i)ta.call($i,ra)&&(na[$i[ra]]=ra);var ia=/[^\dA-Za-z]/;function aa(e,t,n,r){let i=String.fromCharCode(e);if(ta.call(na,i)){let e=na[i],a=`&`+e;return n&&Qi.includes(e)&&!ea.includes(e)&&(!r||t&&t!==61&&ia.test(String.fromCharCode(t)))?a:a+`;`}return``}function oa(e,t,n){let r=Yi(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=aa(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Zi(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function sa(e,t){return Gi(e,Object.assign({format:oa},t))}var ca=/^>|^->|<!--|-->|--!>|<!-$/g,la=[`>`],ua=[`<`,`>`];function da(e,t,n,r){return r.settings.bogusComments?`<?`+sa(e.value,Object.assign({},r.settings.characterReferences,{subset:la}))+`>`:`<!--`+e.value.replace(ca,i)+`-->`;function i(e){return sa(e,Object.assign({},r.settings.characterReferences,{subset:ua}))}}function fa(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function pa(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ma(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function ha(e){return e.join(` `).trim()}var ga=/[ \t\n\f\r]/g;function _a(e){return typeof e==`object`?e.type===`text`&&va(e.value):va(e)}function va(e){return e.replace(ga,``)===``}var U=xa(1),ya=xa(-1),ba=[];function xa(e){return t;function t(t,n,r){let i=t?t.children:ba,a=(n||0)+e,o=i[a];if(!r)for(;o&&_a(o);)a+=e,o=i[a];return o}}var Sa={}.hasOwnProperty;function Ca(e){return t;function t(t,n,r){return Sa.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var wa=Ca({body:Da,caption:Ta,colgroup:Ta,dd:ja,dt:Aa,head:Ta,html:Ea,li:ka,optgroup:Na,option:Pa,p:Oa,rp:Ma,rt:Ma,tbody:Ia,td:za,tfoot:La,th:za,thead:Fa,tr:Ra});function Ta(e,t,n){let r=U(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&_a(r.value.charAt(0)))}function Ea(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Da(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Oa(e,t,n){let r=U(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function ka(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Aa(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ja(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Ma(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Na(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Pa(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Fa(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Ia(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function La(e,t,n){return!U(n,t)}function Ra(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function za(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Ba=Ca({body:Ua,colgroup:Wa,head:Ha,html:Va,tbody:Ga});function Va(e){let t=U(e,-1);return!t||t.type!==`comment`}function Ha(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Ua(e){let t=U(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&_a(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Wa(e,t,n){let r=ya(n,t),i=U(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&wa(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Ga(e,t,n){let r=ya(n,t),i=U(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&wa(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ka={name:[[`
|
|
26
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Zr=`/dev/null`;function Qr(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??$r(),a=t??$r(),o=or(Yr(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function $r(){return{name:Zr,contents:``}}function ei(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ti(e){return{type:`text`,value:e}}function I({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function ni({name:e,width:t=16,height:n=16,properties:r}){return I({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[I({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function ri(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function ii(e){return I({tagName:`div`,properties:{"data-gutter":``},children:e})}function ai(e,t,n,r={}){return I({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[I({tagName:`span`,properties:{"data-line-number-content":``},children:[ti(`${t}`)]})]})}function oi(e,t,n){return I({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function si(){return I({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[ni({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function ci(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function li(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var ui=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],di=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};di.prototype.normal={},di.prototype.property={},di.prototype.space=void 0;function fi(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new di(n,r,t)}function pi(e){return e.toLowerCase()}var L=class{constructor(e,t){this.attribute=t,this.property=e}};L.prototype.attribute=``,L.prototype.booleanish=!1,L.prototype.boolean=!1,L.prototype.commaOrSpaceSeparated=!1,L.prototype.commaSeparated=!1,L.prototype.defined=!1,L.prototype.mustUseProperty=!1,L.prototype.number=!1,L.prototype.overloadedBoolean=!1,L.prototype.property=``,L.prototype.spaceSeparated=!1,L.prototype.space=void 0;var mi=$e({boolean:()=>R,booleanish:()=>z,commaOrSpaceSeparated:()=>H,commaSeparated:()=>_i,number:()=>B,overloadedBoolean:()=>gi,spaceSeparated:()=>V}),hi=0,R=vi(),z=vi(),gi=vi(),B=vi(),V=vi(),_i=vi(),H=vi();function vi(){return 2**++hi}var yi=Object.keys(mi),bi=class extends L{constructor(e,t,n,r){let i=-1;if(super(e,t),xi(this,`space`,r),typeof n==`number`)for(;++i<yi.length;){let e=yi[i];xi(this,yi[i],(n&mi[e])===mi[e])}}};bi.prototype.defined=!0;function xi(e,t,n){n&&(e[t]=n)}function Si(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new bi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[pi(r)]=r,n[pi(a.attribute)]=r}return new di(t,n,e.space)}var Ci=Si({properties:{ariaActiveDescendant:null,ariaAtomic:z,ariaAutoComplete:null,ariaBusy:z,ariaChecked:z,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:z,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:z,ariaFlowTo:V,ariaGrabbed:z,ariaHasPopup:null,ariaHidden:z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:B,ariaLive:null,ariaModal:z,ariaMultiLine:z,ariaMultiSelectable:z,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:z,ariaReadOnly:z,ariaRelevant:null,ariaRequired:z,ariaRoleDescription:V,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:z,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function wi(e,t){return t in e?e[t]:t}function Ti(e,t){return wi(e,t.toLowerCase())}var Ei=Si({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:_i,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:V,autoFocus:R,autoPlay:R,blocking:V,capture:null,charSet:null,checked:R,cite:null,className:V,closedBy:null,colorSpace:null,cols:B,colSpan:B,command:null,commandFor:null,content:null,contentEditable:z,controls:R,controlsList:V,coords:B|_i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:gi,draggable:z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:V,height:B,hidden:gi,high:B,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:V,itemRef:V,itemScope:R,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:R,optimum:B,pattern:null,ping:V,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:V,required:R,reversed:R,rows:B,rowSpan:B,sandbox:V,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:z,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:z,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:_i,part:V,prefix:null,property:null,results:B,security:null,unselectable:null},space:`html`,transform:Ti}),Di=Si({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:H,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_i,g2:_i,glyphName:_i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:H,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:H,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:H,rev:H,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:H,requiredFeatures:H,requiredFonts:H,requiredFormats:H,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:H,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:H,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:H,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:wi}),Oi=Si({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ki=Si({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ti}),Ai=Si({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ji=/[A-Z]/g,Mi=/-[a-z]/g,Ni=/^data[-\w.:]+$/i;function Pi(e,t){let n=pi(t),r=t,i=L;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ni.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Mi,Ii);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Mi.test(e)){let n=e.replace(ji,Fi);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=bi}return new i(r,t)}function Fi(e){return`-`+e.toLowerCase()}function Ii(e){return e.charAt(1).toUpperCase()}var Li=fi([Ci,Ei,Oi,ki,Ai],`html`),Ri=fi([Ci,Di,Oi,ki,Ai],`svg`),zi={}.hasOwnProperty;function Bi(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&zi.call(t,e)){let n=String(t[e]);i=zi.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Vi=/["&'<>`]/g,Hi=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ui=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Wi=/[|\\{}()[\]^$+*?.]/g,Gi=new WeakMap;function Ki(e,t){if(e=e.replace(t.subset?qi(t.subset):Vi,r),t.subset||t.escapeOnly)return e;return e.replace(Hi,n).replace(Ui,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function qi(e){let t=Gi.get(e);return t||(t=Ji(e),Gi.set(e,t)),t}function Ji(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Wi,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Yi=/[\dA-Fa-f]/;function Xi(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Yi.test(String.fromCharCode(t))?r:r+`;`}var Zi=/\d/;function Qi(e,t,n){let r=`&#`+String(e);return n&&t&&!Zi.test(String.fromCharCode(t))?r:r+`;`}var $i=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ea={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},ta=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],na={}.hasOwnProperty,ra={},ia;for(ia in ea)na.call(ea,ia)&&(ra[ea[ia]]=ia);var aa=/[^\dA-Za-z]/;function oa(e,t,n,r){let i=String.fromCharCode(e);if(na.call(ra,i)){let e=ra[i],a=`&`+e;return n&&$i.includes(e)&&!ta.includes(e)&&(!r||t&&t!==61&&aa.test(String.fromCharCode(t)))?a:a+`;`}return``}function sa(e,t,n){let r=Xi(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=oa(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Qi(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ca(e,t){return Ki(e,Object.assign({format:sa},t))}var la=/^>|^->|<!--|-->|--!>|<!-$/g,ua=[`>`],da=[`<`,`>`];function fa(e,t,n,r){return r.settings.bogusComments?`<?`+ca(e.value,Object.assign({},r.settings.characterReferences,{subset:ua}))+`>`:`<!--`+e.value.replace(la,i)+`-->`;function i(e){return ca(e,Object.assign({},r.settings.characterReferences,{subset:da}))}}function pa(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function ma(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ha(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function ga(e){return e.join(` `).trim()}var _a=/[ \t\n\f\r]/g;function va(e){return typeof e==`object`?e.type===`text`&&ya(e.value):ya(e)}function ya(e){return e.replace(_a,``)===``}var U=Sa(1),ba=Sa(-1),xa=[];function Sa(e){return t;function t(t,n,r){let i=t?t.children:xa,a=(n||0)+e,o=i[a];if(!r)for(;o&&va(o);)a+=e,o=i[a];return o}}var Ca={}.hasOwnProperty;function wa(e){return t;function t(t,n,r){return Ca.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Ta=wa({body:Oa,caption:Ea,colgroup:Ea,dd:Ma,dt:ja,head:Ea,html:Da,li:Aa,optgroup:Pa,option:Fa,p:ka,rp:Na,rt:Na,tbody:La,td:Ba,tfoot:Ra,th:Ba,thead:Ia,tr:za});function Ea(e,t,n){let r=U(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&va(r.value.charAt(0)))}function Da(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function Oa(e,t,n){let r=U(n,t);return!r||r.type!==`comment`}function ka(e,t,n){let r=U(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Aa(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`li`}function ja(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Ma(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Na(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Pa(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Fa(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ia(e,t,n){let r=U(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function La(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Ra(e,t,n){return!U(n,t)}function za(e,t,n){let r=U(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ba(e,t,n){let r=U(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Va=wa({body:Wa,colgroup:Ga,head:Ua,html:Ha,tbody:Ka});function Ha(e){let t=U(e,-1);return!t||t.type!==`comment`}function Ua(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Wa(e){let t=U(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&va(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Ga(e,t,n){let r=ba(n,t),i=U(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Ta(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Ka(e,t,n){let r=ba(n,t),i=U(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Ta(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var qa={name:[[`
|
|
27
27
|
\f\r &/=>`.split(``),`
|
|
28
28
|
\f\r "&'/=>\``.split(``)],[`\0
|
|
29
29
|
\f\r "&'/<=>`.split(``),`\0
|
|
@@ -31,12 +31,12 @@ import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l
|
|
|
31
31
|
\f\r &>`.split(``),`\0
|
|
32
32
|
\f\r "&'<=>\``.split(``)],[`\0
|
|
33
33
|
\f\r "&'<=>\``.split(``),`\0
|
|
34
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function qa(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Li);let l=Ja(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Ba(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!wa(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ja(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Ya(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Ya(e,t,n){let r=Ni(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=sa(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ka.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?ma:ha)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=sa(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ka.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&pa(n,o)>pa(n,e.alternative)&&(o=e.alternative),s=o+sa(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ka.single:Ka.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Xa=[`<`,`&`];function Za(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:sa(e.value,Object.assign({},r.settings.characterReferences,{subset:Xa}))}function Qa(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Za(e,t,n,r)}function $a(e,t,n,r){return r.all(e)}var eo=zi(`type`,{invalid:to,unknown:no,handlers:{comment:da,doctype:fa,element:qa,raw:Qa,root:$a,text:Za}});function to(e){throw Error("Expected node, not `"+e+"`")}function no(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var ro={},io={},ao=[];function oo(e,t){let n=t||ro,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:so,all:co,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||li,characterReferences:n.characterReferences||io,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Li:Ii,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function so(e,t,n){return eo(e,t,n,this)}function co(e){let t=[],n=e&&e.children||ao,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var lo=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),zn(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Hn(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&ci(e.composedPath())||(ko(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(ko(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(ko(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){ko(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();ko(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);ko(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=ho(i)&&this.hoveredLine?.lineElement===i.lineElement;mo(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),mo(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ho(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(_o(i)&&p!=null){p(i);break}if(go(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!ho(i))break;mo(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,ko(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),ko(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),ko(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();ci(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(si(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=oo(oi());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);po(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(bo(t));if(po(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(po(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(po(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&ci(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=bo(e);if(t&&ci(n))return;let r=xo(e);return r==null?this.pathFromAnnotationSlot(e):bo(r)}pathFromAnnotationSlot(e){let t=Co(So(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:bo(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=wo(t)?t:wo(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Hn(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Rn(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{zn(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!Eo(this.renderedSelectedLinesState,n),i=!Eo(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);vo(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=Oo(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=Oo(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:yo(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:yo(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Do(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Do(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function uo({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:fo({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function fo({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function po(e){return e!=null&&`kind`in e&&e.kind===`line`}function mo(e){return e!=null&&`kind`in e&&e.kind===`token`}function ho(e){return po(e)||mo(e)}function go(e){return`type`in e&&e.type===`line-info`}function _o(e){return`kind`in e&&e.kind===`merge-conflict-action`}function vo(e){return e===`current`||e===`incoming`||e===`both`}function yo(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function bo(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function xo(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function So(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function Co(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function wo(e){return e!=null&&typeof e.elementFromPoint==`function`}function To(e,t){return e===t||Hn(e??void 0,t??void 0)}function Eo(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&To(e?.range??null,t.range)}function Do(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function Oo(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function ko(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var Ao=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),No(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?Io(t):Lo(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:jo(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:Mo(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Po(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function jo(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function Mo(e){return Math.max(Math.ceil(e),0)}function No(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Po(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Fo(e))}function Po(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Fo(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function Io(e){e.codeElement.isConnected&&Fo(e)}function Lo(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var Ro=new Map,zo=new Map,Bo=new Map,Vo=new Set;function Ho(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Vo.has(t))return!1;return!0}function Uo(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Vo.has(n.name))continue;let e=Ro.get(n.name);e??(e=n,Ro.set(n.name,e)),Vo.add(e.name),t.loadLanguageSync(e.data)}}function Wo(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Go=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,qo=Object.getOwnPropertyNames,Jo=Object.prototype.hasOwnProperty,Yo=(e,t)=>{let n={};for(var r in e)Go(n,r,{get:e[r],enumerable:!0});return t||Go(n,Symbol.toStringTag,{value:`Module`}),n},Xo=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=qo(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Jo.call(e,s)&&s!==n&&Go(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Ko(t,s))||r.enumerable});return e},Zo=(e,t,n)=>(Xo(e,t,`default`),n&&Xo(n,t,`default`)),Qo=[{id:`abap`,name:`ABAP`,import:(()=>M(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>M(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>M(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>M(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>M(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>M(()=>import(`./_BXzRffYj.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>M(()=>import(`./_DmLXUxIk.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>M(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>M(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>M(()=>import(`./_D1XJzdSj.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>M(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>M(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>M(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>M(()=>import(`./_Cmm7eHzH2.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>M(()=>import(`./_DjVNZ4eK2.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>M(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>M(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>M(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>M(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>M(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>M(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>M(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>M(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>M(()=>import(`./_sUX0JPgf2.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>M(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>M(()=>import(`./_C41DPP-z2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>M(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>M(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>M(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>M(()=>import(`./_CYgKydU62.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>M(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>M(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>M(()=>import(`./_Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>M(()=>import(`./_f4WTM4Kz.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>M(()=>import(`./_C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>M(()=>import(`./_oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>M(()=>import(`./_Csmr2y3G.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>M(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>M(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>M(()=>import(`./_CH2m75uw.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>M(()=>import(`./_LdAm0jkh.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>M(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>M(()=>import(`./_B7vLPjLl.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>M(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>M(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>M(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>M(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>M(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>M(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>M(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>M(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>M(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>M(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>M(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>M(()=>import(`./_DPL2ZCgQ.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>M(()=>import(`./_BGhBZpWT.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>M(()=>import(`./_B7OMjNs8.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>M(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>M(()=>import(`./_CV60RHGa.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>M(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>M(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>M(()=>import(`./_BJitypiv2.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>M(()=>import(`./_C03EYrpw2.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>M(()=>import(`./_DsKRHcpP2.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>M(()=>import(`./_CYNrtFtB2.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>M(()=>import(`./_DmIc4jLQ2.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>M(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>M(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>M(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>M(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>M(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>M(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>M(()=>import(`./_B-xEEN4l2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>M(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>M(()=>import(`./_Bj5u_Vnk2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>M(()=>import(`./_C-uc9hBA2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>M(()=>import(`./_RF9fz9Iu.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>M(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>M(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>M(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>M(()=>import(`./_snCcB5_5.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>M(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>M(()=>import(`./_BTXq-nPh2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>M(()=>import(`./_c9sBllWt.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>M(()=>import(`./_BBWg58GJ2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>M(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>M(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>M(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>M(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>M(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>M(()=>import(`./_DpENgSEx.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>M(()=>import(`./_CuFX3MHy2.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>M(()=>import(`./_vWJVVrmZ.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>M(()=>import(`./_COZ91m9B.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>M(()=>import(`./_DLbMbJfH.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>M(()=>import(`./_CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>M(()=>import(`./_DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>M(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>M(()=>import(`./_DHelzj06.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>M(()=>import(`./_DX2Uab-U.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>M(()=>import(`./_CWUF1FpI.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>M(()=>import(`./_CNClKCWp.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>M(()=>import(`./_CifL_Zbh.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>M(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>M(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>M(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>M(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>M(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>M(()=>import(`./_CTQouXRe.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>M(()=>import(`./_B61wm226.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>M(()=>import(`./_Clv6arvL.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>M(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>M(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>M(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>M(()=>import(`./_UxrF5q9P.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>M(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>M(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>M(()=>import(`./_BdVRHt6-.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>M(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>M(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>M(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>M(()=>import(`./_B5x1OTTu.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>M(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>M(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>M(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>M(()=>import(`./_Drt_09zp.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>M(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>M(()=>import(`./_BUs7NMrG.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>M(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>M(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>M(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>M(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>M(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>M(()=>import(`./_BYnGhZoM2.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>M(()=>import(`./__X_XdTYD2.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>M(()=>import(`./_DY5hwH4S2.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>M(()=>import(`./_DJMQeKeT2.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>M(()=>import(`./_BkrDGdOx2.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>M(()=>import(`./_CivjiEX92.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>M(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>M(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>M(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>M(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>M(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>M(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>M(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>M(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>M(()=>import(`./_BOQrg7gU2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>M(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>M(()=>import(`./_C82GEkZ4.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>M(()=>import(`./_BE8lov_p2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>M(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>M(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>M(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>M(()=>import(`./_C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>M(()=>import(`./_BXeXVLqQ2.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>M(()=>import(`./_DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>M(()=>import(`./_CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>M(()=>import(`./_DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>M(()=>import(`./_iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>M(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>M(()=>import(`./_B_OOMZsL.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>M(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>M(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>M(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>M(()=>import(`./_BRzgmRS2.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>M(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>M(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>M(()=>import(`./_DFAhtXzm.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>M(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>M(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>M(()=>import(`./_DvcpKhXL.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>M(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>M(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>M(()=>import(`./_B7vYPsWj.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>M(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>M(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>M(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>M(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>M(()=>import(`./_Bohi4mUp.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>M(()=>import(`./_BSSf-PYx.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>M(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>M(()=>import(`./_DshD8Ycc.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>M(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>M(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>M(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>M(()=>import(`./_BKTem58K.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>M(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>M(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>M(()=>import(`./_ChkNS16f.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>M(()=>import(`./_D-SthL18.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>M(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>M(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>M(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>M(()=>import(`./_wgItEK0c.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>M(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>M(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>M(()=>import(`./_BLZtgkbJ2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>M(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>M(()=>import(`./_ckRann09.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>M(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>M(()=>import(`./_Dx6kLICJ.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>M(()=>import(`./_KFiFSJT8.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>M(()=>import(`./_CyEgAFGc2.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>M(()=>import(`./_Dh5ihWbf2.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>M(()=>import(`./_BxMlprV52.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>M(()=>import(`./_CohzipZa2.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>M(()=>import(`./_DMoTqEGO2.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>M(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>M(()=>import(`./_B0-ns0BU2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>M(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>M(()=>import(`./_D5nVZek7.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>M(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>M(()=>import(`./_CnIE6_qB2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>M(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>M(()=>import(`./_BpJS3XpY2.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>M(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>M(()=>import(`./_Y-mhaywp2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>M(()=>import(`./_QPczAdMm2.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>M(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>M(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>M(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>M(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>M(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>M(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>M(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>M(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>M(()=>import(`./_-G0Dx3t52.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>M(()=>import(`./_Dixad7y-2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>M(()=>import(`./_CfjckiVM2.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>M(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>M(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>M(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>M(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>M(()=>import(`./_ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>M(()=>import(`./_DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>M(()=>import(`./_DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>M(()=>import(`./_Wxr28jKW.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>M(()=>import(`./_C5VLAw4k2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>M(()=>import(`./_DAi07M7i.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>M(()=>import(`./_BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>M(()=>import(`./_CMLA9XwU2.js`),[]))}],$o=Object.fromEntries(Qo.map(e=>[e.id,e.import])),es=Object.fromEntries(Qo.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ts={...$o,...es},ns=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>M(()=>import(`./_vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>M(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>M(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>M(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>M(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>M(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>M(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>M(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>M(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>M(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>M(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>M(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>M(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>M(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>M(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>M(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>M(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>M(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>M(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>M(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>M(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>M(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>M(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>M(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>M(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>M(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>M(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>M(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>M(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>M(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>M(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>M(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>M(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>M(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>M(()=>import(`./_DVQuIRkW2.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>M(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>M(()=>import(`./_2IIEA8gg2.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>M(()=>import(`./_uhdI0v042.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>M(()=>import(`./_CHQ94UKr2.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>M(()=>import(`./_B5W6OYN72.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>M(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>M(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>M(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>M(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>M(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>M(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>M(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>M(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>M(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>M(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>M(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>M(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>M(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>M(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>M(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>M(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>M(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>M(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>M(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>M(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>M(()=>import(`./_oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>M(()=>import(`./_DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>M(()=>import(`./_fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>M(()=>import(`./_BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>M(()=>import(`./_VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),rs=Qe({createOnigurumaEngine:()=>ks,getDefaultWasmLoader:()=>Os,loadWasm:()=>Ss,setDefaultWasmLoader:()=>Ds}),is=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function as(){return 2147483648}function os(){return typeof performance<`u`?performance.now():Date.now()}var ss=(e,t)=>e+(t-e%t)%t;async function cs(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=as();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,ss(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:os,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var ls=Object.defineProperty,us=(e,t,n)=>t in e?ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>us(e,typeof t==`symbol`?t:t+``,n),G=null;function ds(e){throw new is(e.UTF8ToString(e.getLastOnigError()))}var fs=class e{constructor(t){W(this,`utf16Length`),W(this,`utf8Length`),W(this,`utf16Value`),W(this,`utf8Value`),W(this,`utf16OffsetToUtf8`),W(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},ps=class e{constructor(t){if(W(this,`id`,++e.LAST_ID),W(this,`_onigBinding`),W(this,`content`),W(this,`utf16Length`),W(this,`utf8Length`),W(this,`utf16OffsetToUtf8`),W(this,`utf8OffsetToUtf16`),W(this,`ptr`),!G)throw new is(`Must invoke loadWasm first.`);this._onigBinding=G,this.content=t;let n=new fs(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=G.omalloc(1e4),e._sharedPtrInUse=!0,G.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(G)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};W(ps,`LAST_ID`,0),W(ps,`_sharedPtr`,0),W(ps,`_sharedPtrInUse`,!1);var ms=ps,hs=class{constructor(e){if(W(this,`_onigBinding`),W(this,`_ptr`),!G)throw new is(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new fs(e[r]);t[r]=i.createString(G),n[r]=i.utf8Length}let r=G.omalloc(4*e.length);G.HEAPU32.set(t,r/4);let i=G.omalloc(4*e.length);G.HEAPU32.set(n,i/4);let a=G.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)G.ofree(t[n]);G.ofree(i),G.ofree(r),a===0&&ds(G),this._onigBinding=G,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new ms(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function gs(e){return typeof e.instantiator==`function`}function _s(e){return typeof e.default==`function`}function vs(e){return e.data!==void 0}function ys(e){return typeof Response<`u`&&e instanceof Response}function bs(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var xs;function Ss(e){if(xs)return xs;async function t(){G=await cs(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),gs(n)?n=await n.instantiator(t):_s(n)?n=await n.default(t):(vs(n)&&(n=n.data),ys(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await ws(n)(t):await Ts(n)(t):bs(n)||n instanceof WebAssembly.Module?n=await Cs(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Cs(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return xs=t(),xs}function Cs(e){return t=>WebAssembly.instantiate(e,t)}function ws(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ts(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Es;function Ds(e){Es=e}function Os(){return Es}async function ks(e){return e&&await Ss(e),{createScanner(e){return new hs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new ms(e)}}}var As=Yo({});Zo(As,rs);var K=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function js(e){return Ms(e)}function Ms(e){return Array.isArray(e)?Ns(e):e instanceof RegExp?e:typeof e==`object`?Ps(e):e}function Ns(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ms(e[n]);return t}function Ps(e){let t={};for(let n in e)t[n]=Ms(e[n]);return t}function Fs(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Is(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Is(e.substring(0,e.length-1)):e.substr(~t+1)}var Ls=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Rs=class{static hasCaptures(e){return e!==null&&(Ls.lastIndex=0,Ls.test(e))}static replaceCaptures(e,t,n){return e.replace(Ls,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function zs(e,t){return e<t?-1:+(e>t)}function Bs(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=zs(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Vs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Hs(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Us=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Ws=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ys(e),t)}static createFromParsedTheme(e,t){return Zs(e,t)}_cachedMatchRoot=new Us(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Ks(e.parent,t.parentScopes));return n?new Js(n.fontStyle,n.foreground,n.background):null}},Gs=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ks(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!qs(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function qs(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Js=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ys(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Vs(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Vs(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Xs(l,u,e,o,s,c)}}return n}var Xs=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},q=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(q||{});function Zs(e,t){e.sort((e,t)=>{let n=zs(e.scope,t.scope);return n!==0||(n=Bs(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Qs(t),o=new Js(n,a.getId(r),a.getId(i)),s=new tc(new ec(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Ws(a,o,s)}var Qs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},$s=Object.freeze([]),ec=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||$s,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},tc=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),ec.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Bs(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new ec(e,t,n,r,i))}},nc=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ic(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function rc(e){return e}function ic(e){return e}function ac(e,t){let n=[],r=sc(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(oc(i)){let e=[];do e.push(i),i=r.next();while(oc(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function oc(e){return!!e&&!!e.match(/[\w\.:]+/)}function sc(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function cc(e){typeof e.dispose==`function`&&e.dispose()}var lc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},uc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},dc=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},fc=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new lc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new dc;for(let n of e)pc(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof lc){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function pc(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof lc?hc({baseGrammar:a,selfGrammar:i},r):mc(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new lc(e))}function mc(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];gc([r],t,n)}}function hc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&gc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&gc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function gc(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Fs({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&gc(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Sc(i);switch(a.kind){case 0:hc({...t,selfGrammar:t.baseGrammar},n);break;case 1:hc(t,n);break;case 2:mc(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?mc(a.ruleName,i,n):hc(i,n)}else a.kind===4?n.add(new uc(a.scopeName,a.ruleName)):n.add(new lc(a.scopeName))}}}var _c=class{kind=0},vc=class{kind=1},yc=class{constructor(e){this.ruleName=e}kind=2},bc=class{constructor(e){this.scopeName=e}kind=3},xc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Sc(e){if(e===`$base`)return new _c;if(e===`$self`)return new vc;let t=e.indexOf(`#`);return t===-1?new bc(e):t===0?new yc(e.substring(1)):new xc(e.substring(0,t),e.substring(t+1))}var Cc=/\\(\d+)/,wc=/\\(\d+)/g,Tc=-1,Ec=-2;function Dc(e){return e}function Oc(e){return e}var kc=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Rs.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Rs.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Is(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Rs.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Rs.replaceCaptures(this._contentName,e,t)}},Ac=class extends kc{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},jc=class extends kc{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ic(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Lc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mc=class extends kc{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Lc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nc=class extends kc{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Ic(i,this.id),this.beginCaptures=a,this._end=new Ic(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Lc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Pc=class extends kc{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Ic(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ic(o,Ec),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Lc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Lc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Fc=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Ac(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new jc(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Fs({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Mc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Pc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Nc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Sc(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Mc||e instanceof Nc||e instanceof Pc)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ic=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Cc.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return wc.lastIndex=0,this.source.replace(wc,(e,t)=>Hs(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Lc=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Rc(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Rc(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Rc=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
35
|
-
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},
|
|
36
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new sl(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Uc(this,a,i,0,t,s,!0,r);return cc(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function rl(e,t){return e=js(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var il=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Gs.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Gs(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Gs(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),nc.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},al=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?il.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Oc(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=il.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Dc(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,il.fromExtension(r,n.contentNameScopesList))}},ol=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):ac(e,el).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>ac(e,el).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},sl=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=nc.set(n,0,rc(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=nc.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},cl=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Qc(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},ll=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new cl(Ws.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ws.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ol(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new fc(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},ul=al.NULL;function dl(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function fl(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pl(e){return Array.isArray(e)?e:[e]}async function ml(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function hl(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function gl(e){return e===`ansi`||hl(e)}function _l(e){return e===`none`}function vl(e){return _l(e)}var yl=/(\r?\n)/g;function bl(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(yl),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var xl={light:`#333333`,dark:`#bbbbbb`},Sl={light:`#fffffe`,dark:`#1e1e1e`},Cl=`__shiki_resolved`;function wl(e){if(e?.[Cl])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?xl.light:xl.dark,n||=t.type===`light`?Sl.light:Sl.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Cl,{enumerable:!1,writable:!1,value:!0}),t}async function Tl(e){return[...new Set((await Promise.all(e.filter(e=>!gl(e)).map(async e=>await ml(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function El(e){return(await Promise.all(e.map(async e=>vl(e)?null:wl(await ml(e))))).filter(e=>!!e)}function Dl(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new K(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Ol=class extends ll{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=wl(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ws.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Dl(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new K(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},kl=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Al=0;function jl(e){Al+=1,e.warnings!==!1&&Al>=10&&Al%10==0&&console.warn(`[Shiki] ${Al} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new K("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(wl),i=new Ol(new kl(e.engine,n),r,n,e.langAlias),a;function o(t){return Dl(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new K(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new K(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Tl(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await El(e))}function g(){if(t)throw new K(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Al)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Ml(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([El(e.themes||[]),Tl(e.langs||[]),e.engine]);return jl({...e,themes:t,langs:n,engine:r})}var Nl=new WeakMap;function Pl(e,t){Nl.set(e,t)}function Fl(e){return Nl.get(e)}var Il=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(pl(n).map(e=>[e,ul])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Ll(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ll(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Rl(e,t){if(!(e instanceof Il))throw new K(`Invalid grammar state`);return e.getInternalStack(t)}var zl=/,/,Bl=/ /;function Vl(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(hl(e.resolveLangAlias(n.lang||`text`))||_l(r))return bl(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new K(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new K(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Ul(t,o,i,a,n)}function Hl(...e){if(e.length===2)return Fl(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(hl(i)||_l(a))throw new K(`Plain language does not have grammar state`);if(i===`ansi`)throw new K(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Il(Wl(n,c,o,s,r).stateStack,c.name,o.name)}function Ul(e,t,n,r,i){let a=Wl(e,t,n,r,i),o=new Il(a.stateStack,t.name,n.name);return Pl(a.tokens,o),a.tokens}function Wl(e,t,n,r,i){let a=dl(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=bl(e),u=i.grammarState?Rl(i.grammarState,n.name)??ul:i.grammarContextCode==null?ul:Wl(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=fl(r[nc.getForeground(s)],a),u=nc.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=nc.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(zl).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Bl))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Gl(t.scopes):Kl(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Gl(e){return e.map(e=>({scopeName:e}))}function Kl(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Yl(e,i,t.slice(0,r))}}return n}function ql(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Jl(e,t,n){if(!ql(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ql(e[r],n[i])&&--r,--i;return r===-1}function Yl(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Jl(e,t,n)){r.push(a);break}return r}function Xl(e,t,n,r=Vl){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Fl(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Zl(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Il(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Pl(s,c),s}function Zl(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Ql=/\s+/g;function $l(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Ql)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Ql);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var eu=/:?lang=["']([^"']+)["']/g,tu=/(?:```|~~~)([\w-]+)/g,nu=/\\begin\{([\w-]+)\}/g,ru=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,iu=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function au(e){let t=bl(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function ou(e,t,n){let r=new Set;for(let t of e.matchAll(eu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(tu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(nu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ru)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(iu.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var su=[`color`,`background-color`];function cu(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function lu(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function uu(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=lu(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return cu(e,a)})):e}function du(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>fu(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&su.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function fu(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&q.Italic&&(t[`font-style`]=`italic`),e.fontStyle&q.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&q.Underline&&n.push(`underline`),e.fontStyle&q.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function pu(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function mu(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=au(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new K(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));hu(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return uu(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new K(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=gu(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new K(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new K(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&$l(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function hu(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new K(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new K(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function gu(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(gu).join(``):``}var _u=[mu()];function vu(e){let t=yu(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._u]}function yu(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var bu=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],xu={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Su(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Cu(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function wu(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)xu[r]&&t.push({type:`setDecoration`,value:xu[r]});else if(r<=29){let e=xu[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:bu[r-30]}});else if(r===38){let n=Cu(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:bu[r-40]}});else if(r===48){let n=Cu(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:bu[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:bu[r-100+8]}})}}return t}function Tu(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Su(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=wu(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Eu={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Du(e=Eu){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<bu.length;e++)r.push(t(bu[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Ou=/#([0-9a-f]{3,8})/i,ku=/var\((--[\w-]+-ansi-[\w-]+)\)/,Au={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function ju(e,t,n){let r=dl(e,n),i=bl(t),a=Du(Object.fromEntries(bu.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Au[t]]}))),o=Tu();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=fl(i,r),o=fl(o,r),n.decorations.has(`dim`)&&(i=Mu(i));let s=q.None;return n.decorations.has(`bold`)&&(s|=q.Bold),n.decorations.has(`italic`)&&(s|=q.Italic),n.decorations.has(`underline`)&&(s|=q.Underline),n.decorations.has(`strikethrough`)&&(s|=q.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Mu(e){let t=e.match(Ou);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(ku);return n?`var(${n[1]}-dim)`:e}function Nu(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!hl(r)&&!_l(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return ju(r,t,n)}return Vl(e,t,n)}function Pu(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new K("`themes` option must not be empty");let p=Xl(e,t,n,Nu);if(c=Fl(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new K(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>du(e,h,u,l,d))),c&&Pl(a,c);let g=f.map(e=>dl(e.theme,n));i=Fu(f,m,g,u,l,`fg`,d),r=Fu(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=dl(n.theme,n);a=Nu(e,t,n);let l=e.getTheme(n.theme);r=fl(l.bg,s),i=fl(l.fg,s),o=l.name,c=Fl(a)}else throw new K("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Fu(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=fl(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${fl(t[r][a],n[r])||`inherit`}, ${fl(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Iu=/^\s+$/,Lu=/^(\s*)(.*?)(\s*)$/;function Ru(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ru(e,t,n),codeToTokens:(t,n)=>Pu(e,t,n)}){let i=t;for(let e of vu(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Pu(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Bu(a):d===`never`&&(a=Vu(a)),f&&(a=Hu(a));let p={...r,get source(){return i}};for(let e of vu(n))a=e.tokens?.call(p,a)||a;return zu(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function zu(e,t,n,r=Fl(e)){let i=vu(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:$l,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
37
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=
|
|
34
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Ja(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Ri);let l=Ya(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Va(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Ta(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ya(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=Xa(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function Xa(e,t,n){let r=Pi(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=ca(r.attribute,Object.assign({},e.settings.characterReferences,{subset:qa.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?ha:ga)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=ca(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:qa.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&ma(n,o)>ma(n,e.alternative)&&(o=e.alternative),s=o+ca(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?qa.single:qa.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Za=[`<`,`&`];function Qa(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:ca(e.value,Object.assign({},r.settings.characterReferences,{subset:Za}))}function $a(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Qa(e,t,n,r)}function eo(e,t,n,r){return r.all(e)}var to=Bi(`type`,{invalid:no,unknown:ro,handlers:{comment:fa,doctype:pa,element:Ja,raw:$a,root:eo,text:Qa}});function no(e){throw Error("Expected node, not `"+e+"`")}function ro(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var io={},ao={},oo=[];function so(e,t){let n=t||io,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:co,all:lo,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ui,characterReferences:n.characterReferences||ao,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Ri:Li,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function co(e,t,n){return to(e,t,n,this)}function lo(e){let t=[],n=e&&e.children||oo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var uo=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Bn(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Un(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&li(e.composedPath())||(Ao(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(Ao(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(Ao(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){Ao(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();Ao(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Ao(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=go(i)&&this.hoveredLine?.lineElement===i.lineElement;ho(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ho(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),go(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(vo(i)&&p!=null){p(i);break}if(_o(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!go(i))break;ho(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,Ao(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),Ao(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Ao(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();li(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(ci(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=so(si());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);mo(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(xo(t));if(mo(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(mo(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(mo(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&li(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=xo(e);if(t&&li(n))return;let r=So(e);return r==null?this.pathFromAnnotationSlot(e):xo(r)}pathFromAnnotationSlot(e){let t=wo(Co(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:xo(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=To(t)?t:To(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Un(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,zn(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Bn(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!Do(this.renderedSelectedLinesState,n),i=!Do(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);yo(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=ko(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=ko(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:bo(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:bo(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Oo(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Oo(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function fo({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:po({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function po({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function mo(e){return e!=null&&`kind`in e&&e.kind===`line`}function ho(e){return e!=null&&`kind`in e&&e.kind===`token`}function go(e){return mo(e)||ho(e)}function _o(e){return`type`in e&&e.type===`line-info`}function vo(e){return`kind`in e&&e.kind===`merge-conflict-action`}function yo(e){return e===`current`||e===`incoming`||e===`both`}function bo(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function xo(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function So(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function Co(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function wo(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function To(e){return e!=null&&typeof e.elementFromPoint==`function`}function Eo(e,t){return e===t||Un(e??void 0,t??void 0)}function Do(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Eo(e?.range??null,t.range)}function Oo(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function ko(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function Ao(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var jo=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),Po(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?Lo(t):Ro(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:Mo(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:No(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Fo(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function Mo(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function No(e){return Math.max(Math.ceil(e),0)}function Po(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Fo(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Io(e))}function Fo(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Io(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function Lo(e){e.codeElement.isConnected&&Io(e)}function Ro(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var zo=new Map,Bo=new Map,Vo=new Map,Ho=new Set;function Uo(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Ho.has(t))return!1;return!0}function Wo(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Ho.has(n.name))continue;let e=zo.get(n.name);e??(e=n,zo.set(n.name,e)),Ho.add(e.name),t.loadLanguageSync(e.data)}}function Go(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Ko=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,Jo=Object.getOwnPropertyNames,Yo=Object.prototype.hasOwnProperty,Xo=(e,t)=>{let n={};for(var r in e)Ko(n,r,{get:e[r],enumerable:!0});return t||Ko(n,Symbol.toStringTag,{value:`Module`}),n},Zo=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Jo(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Yo.call(e,s)&&s!==n&&Ko(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=qo(t,s))||r.enumerable});return e},Qo=(e,t,n)=>(Zo(e,t,`default`),n&&Zo(n,t,`default`)),$o=[{id:`abap`,name:`ABAP`,import:(()=>M(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>M(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>M(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>M(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>M(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>M(()=>import(`./_Cv5cB1Gc.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>M(()=>import(`./_B8yL5yfH.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>M(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>M(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>M(()=>import(`./_Cymp0KkN.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>M(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>M(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>M(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>M(()=>import(`./_Cmm7eHzH2.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>M(()=>import(`./_BsMtWEvw2.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>M(()=>import(`./_BWXHIvNe2.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>M(()=>import(`./_B7ZEbQpA2.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>M(()=>import(`./_qdxAdBWQ2.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>M(()=>import(`./_D-usSTwE2.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>M(()=>import(`./_DKpUyyne2.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>M(()=>import(`./_Ci_nEsc72.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>M(()=>import(`./_CUHmPFLl2.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>M(()=>import(`./_CYIUgYqB2.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>M(()=>import(`./_B-ZLatX02.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>M(()=>import(`./_CpYNKFv52.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>M(()=>import(`./_Cq4B-czG2.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>M(()=>import(`./_D0apG41V2.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>M(()=>import(`./_CQ2zXKGN2.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>M(()=>import(`./_kIpfj7zU2.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>M(()=>import(`./_o_bMNXwQ2.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>M(()=>import(`./_CtfBBspg2.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>M(()=>import(`./_DqKBuwfJ2.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>M(()=>import(`./_Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>M(()=>import(`./_Cy4Qu_lY.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>M(()=>import(`./_C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>M(()=>import(`./_oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>M(()=>import(`./_Bf8W6hR7.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>M(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>M(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>M(()=>import(`./_CmATrSbQ.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>M(()=>import(`./_CJmkmGNg.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>M(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>M(()=>import(`./_DI_ZoCy4.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>M(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>M(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>M(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>M(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>M(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>M(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>M(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>M(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>M(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>M(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>M(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>M(()=>import(`./_DncKjJb4.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>M(()=>import(`./_Ckz3mCrC.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>M(()=>import(`./_DztmqTsm.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>M(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>M(()=>import(`./_DCLWmEuS.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>M(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>M(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>M(()=>import(`./_BJitypiv2.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>M(()=>import(`./_C03EYrpw2.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>M(()=>import(`./_DsKRHcpP2.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>M(()=>import(`./_CYNrtFtB2.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>M(()=>import(`./_DmIc4jLQ2.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>M(()=>import(`./_CY8IvGdO2.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>M(()=>import(`./_DYvRD3hg2.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>M(()=>import(`./_CBce3t8t2.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>M(()=>import(`./_CV2tkWYe2.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>M(()=>import(`./_DExj1W_82.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>M(()=>import(`./_Dl-2e7rI2.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>M(()=>import(`./_DXCkImvC2.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>M(()=>import(`./_CSRkHgEL2.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>M(()=>import(`./_RjnwisyN2.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>M(()=>import(`./_DxrYm2uA2.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>M(()=>import(`./_CTIj6y6q.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>M(()=>import(`./_ilITqXS62.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>M(()=>import(`./_7GGW24-e2.js`),[]))},{id:`go`,name:`Go`,import:(()=>M(()=>import(`./_rLFTqkRN2.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>M(()=>import(`./_CSSWCImt.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>M(()=>import(`./_CacY0gHj2.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>M(()=>import(`./_vs0DFS9r2.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>M(()=>import(`./_tpRUSSso.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>M(()=>import(`./_CHUg0ksH2.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>M(()=>import(`./_D8IpX4py2.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>M(()=>import(`./_C8oCnwJJ2.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>M(()=>import(`./_Dh228itO2.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>M(()=>import(`./_CxZEssPk2.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>M(()=>import(`./_Cvrh5tZx2.js`),[]))},{id:`html`,name:`HTML`,import:(()=>M(()=>import(`./_ETZIHvA2.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>M(()=>import(`./_BRrshe202.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>M(()=>import(`./_COQdreVN.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>M(()=>import(`./_CRzcId75.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>M(()=>import(`./_DLbMbJfH.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>M(()=>import(`./_CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>M(()=>import(`./_DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>M(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>M(()=>import(`./_BAM8hQx8.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>M(()=>import(`./_CY8DnUYp.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>M(()=>import(`./_QP0MFlyi.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>M(()=>import(`./_BSnpBPhR.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>M(()=>import(`./_fDUiWXKb.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>M(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>M(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>M(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>M(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>M(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>M(()=>import(`./_B7qLfWk7.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>M(()=>import(`./_CvqFUYec.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>M(()=>import(`./_DPPdU-Av.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>M(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>M(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>M(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>M(()=>import(`./_CNHWN4ne.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>M(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>M(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>M(()=>import(`./_DTZJyM9w.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>M(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>M(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>M(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>M(()=>import(`./_JL1loQ5W.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>M(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>M(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>M(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>M(()=>import(`./_B3-kV650.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>M(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>M(()=>import(`./_uKsdufG5.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>M(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>M(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>M(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>M(()=>import(`./_CFuIV2fl.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>M(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>M(()=>import(`./_BYnGhZoM2.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>M(()=>import(`./__X_XdTYD2.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>M(()=>import(`./_DY5hwH4S2.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>M(()=>import(`./_DJMQeKeT2.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>M(()=>import(`./_CEjOmogC2.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>M(()=>import(`./_B-vJ063K2.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>M(()=>import(`./_IvuFDN5E2.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>M(()=>import(`./_CjNLYCLg2.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>M(()=>import(`./_DHYfO66s2.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>M(()=>import(`./_D1A_Heim2.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>M(()=>import(`./_BsSzOQcm2.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>M(()=>import(`./_O90oeIOV2.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>M(()=>import(`./_B1RWQWA52.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>M(()=>import(`./_BUDT5pXO2.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>M(()=>import(`./_U11SdqZG2.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>M(()=>import(`./_4ZHwLPI52.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>M(()=>import(`./_CbnLiunX.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>M(()=>import(`./_BjS-vjVo2.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>M(()=>import(`./_ot-7Btpt2.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>M(()=>import(`./_DGHpHOYJ2.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>M(()=>import(`./_BiJDBrnU2.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>M(()=>import(`./_C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>M(()=>import(`./_BXeXVLqQ2.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>M(()=>import(`./_DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>M(()=>import(`./_CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>M(()=>import(`./_DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>M(()=>import(`./_iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>M(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>M(()=>import(`./_Cy6s-DjW.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>M(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>M(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>M(()=>import(`./_gzcpVVnB2.js`),[]))},{id:`qml`,name:`QML`,import:(()=>M(()=>import(`./_DAQlNNDT.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>M(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>M(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>M(()=>import(`./_DdSK0SaL.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>M(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>M(()=>import(`./_B3gFvitq2.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>M(()=>import(`./_RZIVk7xV.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>M(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>M(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>M(()=>import(`./_BRKdH0Xv.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>M(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>M(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>M(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>M(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>M(()=>import(`./_CzvbtXgZ.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>M(()=>import(`./_Bsi-MUb-.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>M(()=>import(`./_Cfkwpbl82.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>M(()=>import(`./_DwvzTp2-.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>M(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>M(()=>import(`./_BiFt_7mu2.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>M(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>M(()=>import(`./_FgVKeYCS.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>M(()=>import(`./_bTVj8UrX2.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>M(()=>import(`./_BM315xPC.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>M(()=>import(`./_BCELU8uk.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>M(()=>import(`./_uEb-xDmI.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>M(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>M(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>M(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>M(()=>import(`./_DsjVSWqF.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>M(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>M(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>M(()=>import(`./_0_BxD6tA2.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>M(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>M(()=>import(`./_BEsGJwj1.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>M(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>M(()=>import(`./_CqJy9zqf.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>M(()=>import(`./_D-wyWmAu.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>M(()=>import(`./_CyEgAFGc2.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>M(()=>import(`./_Dh5ihWbf2.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>M(()=>import(`./_BxMlprV52.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>M(()=>import(`./_CohzipZa2.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>M(()=>import(`./_DMoTqEGO2.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>M(()=>import(`./_CZd0xW_V2.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>M(()=>import(`./_Dim3Qa8e2.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>M(()=>import(`./_DswuEJGm2.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>M(()=>import(`./_CVQsXn4K.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>M(()=>import(`./_CcmNWLt02.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>M(()=>import(`./_DHth5jay2.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>M(()=>import(`./_sltzmVWM2.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>M(()=>import(`./_C4OOpxns2.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>M(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>M(()=>import(`./_CL6hsAgf2.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>M(()=>import(`./_XSVpb5jO2.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>M(()=>import(`./_BRdr0IET2.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>M(()=>import(`./_DI99ib-x2.js`),[]))},{id:`v`,name:`V`,import:(()=>M(()=>import(`./_DBj4K9d_2.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>M(()=>import(`./_zf12oZj62.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>M(()=>import(`./_DOwzaHZ02.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>M(()=>import(`./_B2gwz-sJ2.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>M(()=>import(`./_BroJfC0k2.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>M(()=>import(`./_DvXPmvsu2.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>M(()=>import(`./_B6cp2Tnt2.js`),__vite__mapDeps([112,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>M(()=>import(`./_kVKsguoi2.js`),__vite__mapDeps([113,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>M(()=>import(`./_CKkkXYf42.js`),__vite__mapDeps([114,2,3,5,12,70,115])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>M(()=>import(`./_CgoNMtux2.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>M(()=>import(`./_ByWQv1Qj2.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>M(()=>import(`./_C8pVoKbM2.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>M(()=>import(`./_BsKzXJz42.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>M(()=>import(`./_ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>M(()=>import(`./_DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>M(()=>import(`./_DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>M(()=>import(`./_DPfjt9fQ.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>M(()=>import(`./_BIlkaSXj2.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>M(()=>import(`./_Cl6zL1rb.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>M(()=>import(`./_BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>M(()=>import(`./_CMLA9XwU2.js`),[]))}],es=Object.fromEntries($o.map(e=>[e.id,e.import])),ts=Object.fromEntries($o.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ns={...es,...ts},rs=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>M(()=>import(`./_vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>M(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>M(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>M(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>M(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>M(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>M(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>M(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>M(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>M(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>M(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>M(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>M(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>M(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>M(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>M(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>M(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>M(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>M(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>M(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>M(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>M(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>M(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>M(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>M(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>M(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>M(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>M(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>M(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>M(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>M(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>M(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>M(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>M(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>M(()=>import(`./_DVQuIRkW2.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>M(()=>import(`./_Bm3Qr25_2.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>M(()=>import(`./_2IIEA8gg2.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>M(()=>import(`./_uhdI0v042.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>M(()=>import(`./_CHQ94UKr2.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>M(()=>import(`./_B5W6OYN72.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>M(()=>import(`./_BSWPekZh2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>M(()=>import(`./_DDpmG2fV2.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>M(()=>import(`./_B_bV9PQ92.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>M(()=>import(`./_DhmEMT882.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>M(()=>import(`./_eJ-hLW7d2.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>M(()=>import(`./_Cb4Vim4T2.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>M(()=>import(`./_CLwyXe_n2.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>M(()=>import(`./_D7Lr4KcI2.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>M(()=>import(`./_DQwYfKfQ2.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>M(()=>import(`./_DRFjx7u42.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>M(()=>import(`./_DX1BQOs82.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>M(()=>import(`./_aMsaMD1D2.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>M(()=>import(`./_8PwUyIlP2.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>M(()=>import(`./_DO-qXg-I2.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>M(()=>import(`./_DnToyrRv2.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>M(()=>import(`./_B2OO5cIa2.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>M(()=>import(`./_4G7pJPwS2.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>M(()=>import(`./_UdsmMDCL2.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>M(()=>import(`./_C1IUL_tW2.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>M(()=>import(`./_nFMaYfgc2.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>M(()=>import(`./_oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>M(()=>import(`./_DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>M(()=>import(`./_fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>M(()=>import(`./_BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>M(()=>import(`./_VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),is=$e({createOnigurumaEngine:()=>As,getDefaultWasmLoader:()=>ks,loadWasm:()=>Cs,setDefaultWasmLoader:()=>Os}),as=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function os(){return 2147483648}function ss(){return typeof performance<`u`?performance.now():Date.now()}var cs=(e,t)=>e+(t-e%t)%t;async function ls(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=os();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,cs(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:ss,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var us=Object.defineProperty,ds=(e,t,n)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,W=(e,t,n)=>ds(e,typeof t==`symbol`?t:t+``,n),G=null;function fs(e){throw new as(e.UTF8ToString(e.getLastOnigError()))}var ps=class e{constructor(t){W(this,`utf16Length`),W(this,`utf8Length`),W(this,`utf16Value`),W(this,`utf8Value`),W(this,`utf16OffsetToUtf8`),W(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},ms=class e{constructor(t){if(W(this,`id`,++e.LAST_ID),W(this,`_onigBinding`),W(this,`content`),W(this,`utf16Length`),W(this,`utf8Length`),W(this,`utf16OffsetToUtf8`),W(this,`utf8OffsetToUtf16`),W(this,`ptr`),!G)throw new as(`Must invoke loadWasm first.`);this._onigBinding=G,this.content=t;let n=new ps(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=G.omalloc(1e4),e._sharedPtrInUse=!0,G.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(G)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};W(ms,`LAST_ID`,0),W(ms,`_sharedPtr`,0),W(ms,`_sharedPtrInUse`,!1);var hs=ms,gs=class{constructor(e){if(W(this,`_onigBinding`),W(this,`_ptr`),!G)throw new as(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ps(e[r]);t[r]=i.createString(G),n[r]=i.utf8Length}let r=G.omalloc(4*e.length);G.HEAPU32.set(t,r/4);let i=G.omalloc(4*e.length);G.HEAPU32.set(n,i/4);let a=G.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)G.ofree(t[n]);G.ofree(i),G.ofree(r),a===0&&fs(G),this._onigBinding=G,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new hs(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function _s(e){return typeof e.instantiator==`function`}function vs(e){return typeof e.default==`function`}function ys(e){return e.data!==void 0}function bs(e){return typeof Response<`u`&&e instanceof Response}function xs(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var Ss;function Cs(e){if(Ss)return Ss;async function t(){G=await ls(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),_s(n)?n=await n.instantiator(t):vs(n)?n=await n.default(t):(ys(n)&&(n=n.data),bs(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Ts(n)(t):await Es(n)(t):xs(n)||n instanceof WebAssembly.Module?n=await ws(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ws(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Ss=t(),Ss}function ws(e){return t=>WebAssembly.instantiate(e,t)}function Ts(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Es(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Ds;function Os(e){Ds=e}function ks(){return Ds}async function As(e){return e&&await Cs(e),{createScanner(e){return new gs(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new hs(e)}}}var js=Xo({});Qo(js,is);var K=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ms(e){return Ns(e)}function Ns(e){return Array.isArray(e)?Ps(e):e instanceof RegExp?e:typeof e==`object`?Fs(e):e}function Ps(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ns(e[n]);return t}function Fs(e){let t={};for(let n in e)t[n]=Ns(e[n]);return t}function Is(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Ls(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Ls(e.substring(0,e.length-1)):e.substr(~t+1)}var Rs=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,zs=class{static hasCaptures(e){return e!==null&&(Rs.lastIndex=0,Rs.test(e))}static replaceCaptures(e,t,n){return e.replace(Rs,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Bs(e,t){return e<t?-1:+(e>t)}function Vs(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Bs(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Hs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Us(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Ws=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Gs=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Xs(e),t)}static createFromParsedTheme(e,t){return Qs(e,t)}_cachedMatchRoot=new Ws(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>qs(e.parent,t.parentScopes));return n?new Ys(n.fontStyle,n.foreground,n.background):null}},Ks=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function qs(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Js(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Js(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Ys=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Xs(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Hs(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Hs(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Zs(l,u,e,o,s,c)}}return n}var Zs=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},q=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(q||{});function Qs(e,t){e.sort((e,t)=>{let n=Bs(e.scope,t.scope);return n!==0||(n=Vs(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new $s(t),o=new Ys(n,a.getId(r),a.getId(i)),s=new nc(new tc(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Gs(a,o,s)}var $s=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ec=Object.freeze([]),tc=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ec,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},nc=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),tc.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Vs(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new tc(e,t,n,r,i))}},rc=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=ac(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function ic(e){return e}function ac(e){return e}function oc(e,t){let n=[],r=cc(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(sc(i)){let e=[];do e.push(i),i=r.next();while(sc(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function sc(e){return!!e&&!!e.match(/[\w\.:]+/)}function cc(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function lc(e){typeof e.dispose==`function`&&e.dispose()}var uc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},dc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},fc=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},pc=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new uc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new fc;for(let n of e)mc(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof uc){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function mc(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof uc?gc({baseGrammar:a,selfGrammar:i},r):hc(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new uc(e))}function hc(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];_c([r],t,n)}}function gc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&_c(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&_c(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function _c(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Is({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&_c(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Cc(i);switch(a.kind){case 0:gc({...t,selfGrammar:t.baseGrammar},n);break;case 1:gc(t,n);break;case 2:hc(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?hc(a.ruleName,i,n):gc(i,n)}else a.kind===4?n.add(new dc(a.scopeName,a.ruleName)):n.add(new uc(a.scopeName))}}}var vc=class{kind=0},yc=class{kind=1},bc=class{constructor(e){this.ruleName=e}kind=2},xc=class{constructor(e){this.scopeName=e}kind=3},Sc=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Cc(e){if(e===`$base`)return new vc;if(e===`$self`)return new yc;let t=e.indexOf(`#`);return t===-1?new xc(e):t===0?new bc(e.substring(1)):new Sc(e.substring(0,t),e.substring(t+1))}var wc=/\\(\d+)/,Tc=/\\(\d+)/g,Ec=-1,Dc=-2;function Oc(e){return e}function kc(e){return e}var Ac=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=zs.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=zs.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Ls(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:zs.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:zs.replaceCaptures(this._contentName,e,t)}},jc=class extends Ac{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Mc=class extends Ac{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Lc(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Rc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Nc=class extends Ac{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Rc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Pc=class extends Ac{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Lc(i,this.id),this.beginCaptures=a,this._end=new Lc(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Rc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Fc=class extends Ac{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Lc(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Lc(o,Dc),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Rc;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Rc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Ic=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new jc(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Mc(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Is({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Nc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Fc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Pc(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=Cc(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Nc||e instanceof Pc||e instanceof Fc)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Lc=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&wc.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Tc.lastIndex=0,this.source.replace(Tc,(e,t)=>Us(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Rc=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new zc(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new zc(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},zc=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
35
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Bc=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Vc=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Bc(e,8),this._embeddedLanguagesMatcher=new Hc(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Bc(0,0);_getBasicScopeAttributes=new Ws(e=>new Bc(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Hc=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Us(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Uc=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Wc(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Gc(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Uc(i,!0);f()}return new Uc(i,!1);function f(){let o=Kc(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ec){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Zc(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Pc){let r=o;Zc(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Fc){let r=o;Zc(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Zc(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Gc(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Fc&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Xc(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Dc){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Zc(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Kc(e,t,n,r,i,a){let o=qc(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Jc(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function qc(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Yc(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Jc(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Yc(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Yc(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Xc(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Zc(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Wc(e,p,n&&d.start===0,d.start,f,i,!1,0),lc(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Qc(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Qc=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function $c(e,t,n,r,i,a,o,s){return new rl(e,t,n,r,i,a,o,s)}function el(e,t,n,r,i){let a=oc(t,tl),o=Ic.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function tl(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(nl(t[r],e))return n=r+1,!0;return!1})}function nl(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var rl=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Vc(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=il(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=oc(e,tl);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)el(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&el(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Oc(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[kc(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=il(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Ic.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ol.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=rc.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?al.createRootAndLookUpScopeName(a,r,this):al.createRoot(`unknown`,r),t=new ol(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
36
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new cl(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Wc(this,a,i,0,t,s,!0,r);return lc(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function il(e,t){return e=Ms(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var al=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Ks.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Ks(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Ks(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),rc.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},ol=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?al.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:kc(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=al.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Oc(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,al.fromExtension(r,n.contentNameScopesList))}},sl=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):oc(e,tl).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>oc(e,tl).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},cl=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=rc.set(n,0,ic(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=rc.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ll=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,$c(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},ul=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ll(Gs.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Gs.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new sl(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new pc(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},dl=ol.NULL;function fl(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function pl(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function ml(e){return Array.isArray(e)?e:[e]}async function hl(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function gl(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function _l(e){return e===`ansi`||gl(e)}function vl(e){return e===`none`}function yl(e){return vl(e)}var bl=/(\r?\n)/g;function xl(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(bl),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Sl={light:`#333333`,dark:`#bbbbbb`},Cl={light:`#fffffe`,dark:`#1e1e1e`},wl=`__shiki_resolved`;function Tl(e){if(e?.[wl])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Sl.light:Sl.dark,n||=t.type===`light`?Cl.light:Cl.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,wl,{enumerable:!1,writable:!1,value:!0}),t}async function El(e){return[...new Set((await Promise.all(e.filter(e=>!_l(e)).map(async e=>await hl(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Dl(e){return(await Promise.all(e.map(async e=>yl(e)?null:Tl(await hl(e))))).filter(e=>!!e)}function Ol(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new K(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var kl=class extends ul{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Tl(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Gs.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ol(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new K(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Al=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},jl=0;function Ml(e){jl+=1,e.warnings!==!1&&jl>=10&&jl%10==0&&console.warn(`[Shiki] ${jl} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new K("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Tl),i=new kl(new Al(e.engine,n),r,n,e.langAlias),a;function o(t){return Ol(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new K(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new K(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await El(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Dl(e))}function g(){if(t)throw new K(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--jl)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Nl(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Dl(e.themes||[]),El(e.langs||[]),e.engine]);return Ml({...e,themes:t,langs:n,engine:r})}var Pl=new WeakMap;function Fl(e,t){Pl.set(e,t)}function Il(e){return Pl.get(e)}var Ll=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(ml(n).map(e=>[e,dl])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Rl(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Rl(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function zl(e,t){if(!(e instanceof Ll))throw new K(`Invalid grammar state`);return e.getInternalStack(t)}var Bl=/,/,Vl=/ /;function Hl(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(gl(e.resolveLangAlias(n.lang||`text`))||vl(r))return xl(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new K(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new K(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Wl(t,o,i,a,n)}function Ul(...e){if(e.length===2)return Il(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(gl(i)||vl(a))throw new K(`Plain language does not have grammar state`);if(i===`ansi`)throw new K(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Ll(Gl(n,c,o,s,r).stateStack,c.name,o.name)}function Wl(e,t,n,r,i){let a=Gl(e,t,n,r,i),o=new Ll(a.stateStack,t.name,n.name);return Fl(a.tokens,o),a.tokens}function Gl(e,t,n,r,i){let a=fl(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=xl(e),u=i.grammarState?zl(i.grammarState,n.name)??dl:i.grammarContextCode==null?dl:Gl(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=pl(r[rc.getForeground(s)],a),u=rc.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=rc.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Bl).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Vl))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Kl(t.scopes):ql(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Kl(e){return e.map(e=>({scopeName:e}))}function ql(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Xl(e,i,t.slice(0,r))}}return n}function Jl(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Yl(e,t,n){if(!Jl(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Jl(e[r],n[i])&&--r,--i;return r===-1}function Xl(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Yl(e,t,n)){r.push(a);break}return r}function Zl(e,t,n,r=Hl){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Il(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Ql(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Ll(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Fl(s,c),s}function Ql(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var $l=/\s+/g;function eu(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split($l)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split($l);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var tu=/:?lang=["']([^"']+)["']/g,nu=/(?:```|~~~)([\w-]+)/g,ru=/\\begin\{([\w-]+)\}/g,iu=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,au=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function ou(e){let t=xl(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function su(e,t,n){let r=new Set;for(let t of e.matchAll(tu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(nu)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(ru)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(iu)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(au.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var cu=[`color`,`background-color`];function lu(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function uu(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function du(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=uu(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return lu(e,a)})):e}function fu(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>pu(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&cu.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function pu(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&q.Italic&&(t[`font-style`]=`italic`),e.fontStyle&q.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&q.Underline&&n.push(`underline`),e.fontStyle&q.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function mu(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function hu(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=ou(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new K(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));gu(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return du(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new K(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=_u(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new K(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new K(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&eu(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function gu(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new K(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new K(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function _u(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(_u).join(``):``}var vu=[hu()];function yu(e){let t=bu(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...vu]}function bu(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var xu=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Su={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Cu(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function wu(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Tu(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Su[r]&&t.push({type:`setDecoration`,value:Su[r]});else if(r<=29){let e=Su[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:xu[r-30]}});else if(r===38){let n=wu(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:xu[r-40]}});else if(r===48){let n=wu(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:xu[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:xu[r-100+8]}})}}return t}function Eu(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Cu(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Tu(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Du={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Ou(e=Du){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<xu.length;e++)r.push(t(xu[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var ku=/#([0-9a-f]{3,8})/i,Au=/var\((--[\w-]+-ansi-[\w-]+)\)/,ju={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Mu(e,t,n){let r=fl(e,n),i=xl(t),a=Ou(Object.fromEntries(xu.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||ju[t]]}))),o=Eu();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=pl(i,r),o=pl(o,r),n.decorations.has(`dim`)&&(i=Nu(i));let s=q.None;return n.decorations.has(`bold`)&&(s|=q.Bold),n.decorations.has(`italic`)&&(s|=q.Italic),n.decorations.has(`underline`)&&(s|=q.Underline),n.decorations.has(`strikethrough`)&&(s|=q.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Nu(e){let t=e.match(ku);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Au);return n?`var(${n[1]}-dim)`:e}function Pu(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!gl(r)&&!vl(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Mu(r,t,n)}return Hl(e,t,n)}function Fu(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new K("`themes` option must not be empty");let p=Zl(e,t,n,Pu);if(c=Il(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new K(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>fu(e,h,u,l,d))),c&&Fl(a,c);let g=f.map(e=>fl(e.theme,n));i=Iu(f,m,g,u,l,`fg`,d),r=Iu(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=fl(n.theme,n);a=Pu(e,t,n);let l=e.getTheme(n.theme);r=pl(l.bg,s),i=pl(l.fg,s),o=l.name,c=Il(a)}else throw new K("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Iu(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=pl(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${pl(t[r][a],n[r])||`inherit`}, ${pl(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Lu=/^\s+$/,Ru=/^(\s*)(.*?)(\s*)$/;function zu(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>zu(e,t,n),codeToTokens:(t,n)=>Fu(e,t,n)}){let i=t;for(let e of yu(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Fu(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Vu(a):d===`never`&&(a=Hu(a)),f&&(a=Uu(a));let p={...r,get source(){return i}};for(let e of yu(n))a=e.tokens?.call(p,a)||a;return Bu(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Bu(e,t,n,r=Il(e)){let i=yu(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:eu,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
37
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=mu(a.htmlStyle||pu(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Fl(m,r),m}function Vu(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&q.Underline||i.fontStyle&q.Strikethrough));o&&Lu.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Hu(e){return e.map(e=>e.flatMap(e=>{if(Lu.test(e.content))return e;let t=e.content.match(Ru);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Uu(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=mu(e.htmlStyle||pu(e)),i=mu(n.htmlStyle||pu(n)),a=e.fontStyle&&(e.fontStyle&q.Underline||e.fontStyle&q.Strikethrough),o=n.fontStyle&&(n.fontStyle&q.Underline||n.fontStyle&q.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Wu=so;function Gu(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>zu(e,t,n),codeToTokens:(t,n)=>Fu(e,t,n)},i=Wu(zu(e,t,n,r));for(let e of yu(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Ku(e){let t=await Nl(e);return{getLastGrammarState:(...e)=>Ul(t,...e),codeToTokensBase:(e,n)=>Pu(t,e,n),codeToTokensWithThemes:(e,n)=>Zl(t,e,n),codeToTokens:(e,n)=>Fu(t,e,n),codeToHast:(e,n)=>zu(t,e,n),codeToHtml:(e,n)=>Gu(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function qu(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,_l(n))return[];let r=t[n];if(!r)throw new K(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(yl(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new K(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Ku({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ju(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Yu(e,t){let n=Ju(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Xu=qu({langs:ns,themes:rs,engine:()=>(0,js.createOnigurumaEngine)(M(()=>import(`./_BnjxR4X6.js`),[]))}),{codeToHtml:Zu,codeToHast:Qu,codeToTokens:$u,codeToTokensBase:ed,codeToTokensWithThemes:td,getSingletonHighlighter:nd,getLastGrammarState:rd}=Yu(Xu,{guessEmbeddedLanguages:su}),id=4294967295,ad=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:id,end:id,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function od(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function sd(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var cd=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),J=String.raw;function ld(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ud=J`\[\^?`,dd=`c.? | C(?:-.?)?|${J`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${J`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${J`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${J`o\{[^\}]*\}?`}|${J`\d{1,3}`}`,fd=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,pd=new RegExp(J`
|
|
38
38
|
\\ (?:
|
|
39
|
-
${
|
|
39
|
+
${dd}
|
|
40
40
|
| [gk]<[^>]*>?
|
|
41
41
|
| [gk]'[^']*'?
|
|
42
42
|
| .
|
|
@@ -53,20 +53,20 @@ import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l
|
|
|
53
53
|
)?
|
|
54
54
|
| \*[^\)]*\)?
|
|
55
55
|
)?
|
|
56
|
-
| (?:${
|
|
57
|
-
| ${
|
|
56
|
+
| (?:${fd.source})+
|
|
57
|
+
| ${ud}
|
|
58
58
|
| .
|
|
59
|
-
`.replace(/\s+/g,``),`gsu`),
|
|
59
|
+
`.replace(/\s+/g,``),`gsu`),md=new RegExp(J`
|
|
60
60
|
\\ (?:
|
|
61
|
-
${
|
|
61
|
+
${dd}
|
|
62
62
|
| .
|
|
63
63
|
)
|
|
64
64
|
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
65
|
-
| ${
|
|
65
|
+
| ${ud}
|
|
66
66
|
| &&
|
|
67
67
|
| .
|
|
68
|
-
`.replace(/\s+/g,``),`gsu`);function
|
|
69
|
-
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Dd(`dot`,n)}:n===`^`||n===`$`?{token:bd(e.singleline?{"^":J`\A`,$:J`\Z`}[n]:n,n)}:n===`|`?{token:yd(n)}:dd.test(n)?{tokens:qd(n)}:{token:Sd(ad(n),n)}}function gd(e,t,n){let r=[Ed(t[1]===`^`,t)],i=1,a;for(pd.lastIndex=n;a=pd.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Ed(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Sd(93,e));else if(i--,r.push(Cd(e)),!i)break}else{let t=_d(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:pd.lastIndex||e.length}}function _d(e){if(e[0]===`\\`)return vd(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!sd.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Dd(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?wd(e):e===`&&`?Td(e):Sd(ad(e),e)}function vd(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Ld(e);if(`dDhHsSwW`.includes(n))return Vd(e);if(e.startsWith(J`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return Hd(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Sd(ad(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Sd(Gd(e),e);if(Id.has(n))return Sd(Id.get(n),e);if(/\d/.test(n))return kd(t,e);if(e===`\\`)throw Error(J`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Sd(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function yd(e){return{type:`Alternator`,raw:e}}function bd(e,t){return{type:`Assertion`,kind:e,raw:t}}function xd(e){return{type:`Backreference`,raw:e}}function Sd(e,t){return{type:`Character`,value:e,raw:t}}function Cd(e){return{type:`CharacterClassClose`,raw:e}}function wd(e){return{type:`CharacterClassHyphen`,raw:e}}function Td(e){return{type:`CharacterClassIntersector`,raw:e}}function Ed(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Dd(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Od(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:cd(n.flags),raw:t}}function kd(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Ad(e){return{type:`GroupClose`,raw:e}}function jd(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Md(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Nd(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Pd(e){return{type:`Subroutine`,raw:e}}var Fd=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Id=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Ld(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Sd(ad(t.toUpperCase())-64,e)}function Rd(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Ud(n),o=Ud(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Od(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,jd(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function zd(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=Fd.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Md(l,r??null,i?.split(`,`)??null,e)}function Bd(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Nd(t,n,r,e)}function Vd(e){let t=e[1].toLowerCase();return Dd({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function Hd(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Dd(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Ud(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function Wd(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function Gd(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Kd(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[xd(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(J`Octal encoded byte above 177 unsupported "${n}"`)}else r=ad(t);a.push(Sd(r,(e===0?`\\`:``)+t))}return a}function qd(e){let t=[],n=new RegExp(dd,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Bd(e.slice(0,-1)));continue}}}t.push(Bd(e))}return t}function Jd(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Yd(e){return Xd.has(e.type)}var Xd=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Zd(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=md(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return cf();case`Assertion`:return Qd(n);case`Backreference`:return $d(n,a);case`Character`:return ff(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return ef(n,a,t);case`CharacterClassOpen`:return tf(n,a,t);case`CharacterSet`:return nf(n,a);case`Directive`:return gf(n.kind,{flags:n.flags});case`GroupOpen`:return rf(n,a,t);case`NamedCallout`:return bf(n.kind,n.tag,n.arguments);case`Quantifier`:return af(n,a);case`Subroutine`:return of(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Cf(_f(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(J`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(J`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Qd({kind:e}){return lf(cd({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===J`\B`||e===J`\Y`})}function $d({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,uf(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return uf(r)}return i(+r)}function ef(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),mf(o,e);throw Error(`Invalid character class range`)}return ff(ad(`-`))}function tf({negate:e},t,n){let{tokens:r,walk:i}=t,a=[pf()],o=r[t.nextIndex],s=Pf(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(pf()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Pf(r[t.nextIndex],o)}let c=pf({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function nf({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Nf(n);if(sd.has(r)&&!o?.has(r))e=`posix`,n=r;else return Tf(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?xf(n,{negate:t}):hf(e,{negate:t})}function rf(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Ef(e),l=c.type===`AbsenceFunction`,u=Af(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&od(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Ff(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(cf()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(kf(t)||t.type===`CapturingGroup`)throw Error(e)}else if(kf(t)||Af(t)&&t.negate)throw Error(e)}}f=Ff(r[t.nextIndex])}return t.nextIndex++,c}function af({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Yd(a))throw Error(`Quantifier requires a repeatable token`);let o=Sf(e,t,n,a);return i.body.pop(),o}function of({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=wf(i);return r.push(o),o}function sf(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Df(t?.body)}}function cf(e){return{type:`Alternative`,body:Of(e?.body)}}function lf(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function uf(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function df(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!jf(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Df(t?.body)}}function ff(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function pf(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:Of(e?.body)}}function mf(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function hf(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function gf(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:cd(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function _f(e){return{type:`Flags`,...e}}function vf(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:Df(e?.body)}}function yf(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Df(e?.body)}}function bf(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function xf(e,t){let n=!!t?.negate;if(!sd.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Sf(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Cf(e,t){return{type:`Regex`,body:Df(t?.body),flags:e}}function wf(e){return{type:`Subroutine`,ref:e}}function Tf(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Nf(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Mf(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(J`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Ef({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return sf(`repeater`);case`atomic`:return vf({atomic:!0});case`capturing`:return df(i,{name:n});case`group`:return vf({flags:e});case`lookahead`:case`lookbehind`:return yf({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Df(e){if(e===void 0)e=[cf()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function Of(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function kf(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Af(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function jf(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Mf(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Nf(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Pf(e,t){let n=t;return cd(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Ff(e){return cd(e,`Unclosed group`)}function If(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Lf(c).splice(Math.max(0,Rf(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Lf(c).splice(Rf(s)+1)},removeAllPrevSiblings(){let e=Rf(s)+l;return l-=e,Lf(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Rf(s)+l)]=e:cd(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Lf(c).splice(Math.max(0,Rf(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Rf(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Lf(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Rf(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var zf=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Bf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Vf(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Hf=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Uf(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Hf.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Hf.CHAR_CLASS:Hf.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function Wf(e,t,n,r){Uf(e,t,n,r)}function Gf(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Hf.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Kf(e,t,n){return!!Gf(e,t,0,n)}function qf(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Jf=new RegExp(String.raw`(?<noncapturingStart>${zf})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Yf(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Jf.lastIndex=Number.isNaN(c)?0:c+7;f=Jf.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Bf(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Uf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Hf.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Xf=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Zf=new RegExp(String.raw`
|
|
68
|
+
`.replace(/\s+/g,``),`gsu`);function hd(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=Gd(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(pd.lastIndex=0;s=pd.exec(e);){let t=gd(a,e,s[0],pd.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(pd.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?qd(e,u):e).flat(),flags:r}}function gd(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=_d(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:xd(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Fd(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Sd(n)}}if(a===`K`)return{token:kd(`keep`,n)};if(a===`N`||a===`R`)return{token:Od(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Od(`any`,n)};if(a===`X`)return{token:Od(`text_segment`,n)};let e=yd(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Bd(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:zd(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Md(`group`,n)};if(n===`(?>`)return{token:Md(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Md(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Md(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Md(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:jd(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
69
|
+
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Od(`dot`,n)}:n===`^`||n===`$`?{token:xd(e.singleline?{"^":J`\A`,$:J`\Z`}[n]:n,n)}:n===`|`?{token:bd(n)}:fd.test(n)?{tokens:Jd(n)}:{token:Cd(od(n),n)}}function _d(e,t,n){let r=[Dd(t[1]===`^`,t)],i=1,a;for(md.lastIndex=n;a=md.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Dd(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Cd(93,e));else if(i--,r.push(wd(e)),!i)break}else{let t=vd(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:md.lastIndex||e.length}}function vd(e){if(e[0]===`\\`)return yd(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!cd.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Od(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Td(e):e===`&&`?Ed(e):Cd(od(e),e)}function yd(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Rd(e);if(`dDhHsSwW`.includes(n))return Hd(e);if(e.startsWith(J`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return Ud(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Cd(od(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Cd(Kd(e),e);if(Ld.has(n))return Cd(Ld.get(n),e);if(/\d/.test(n))return Ad(t,e);if(e===`\\`)throw Error(J`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Cd(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function bd(e){return{type:`Alternator`,raw:e}}function xd(e,t){return{type:`Assertion`,kind:e,raw:t}}function Sd(e){return{type:`Backreference`,raw:e}}function Cd(e,t){return{type:`Character`,value:e,raw:t}}function wd(e){return{type:`CharacterClassClose`,raw:e}}function Td(e){return{type:`CharacterClassHyphen`,raw:e}}function Ed(e){return{type:`CharacterClassIntersector`,raw:e}}function Dd(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Od(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function kd(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:ld(n.flags),raw:t}}function Ad(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function jd(e){return{type:`GroupClose`,raw:e}}function Md(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Nd(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Pd(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Fd(e){return{type:`Subroutine`,raw:e}}var Id=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Ld=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Rd(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Cd(od(t.toUpperCase())-64,e)}function zd(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=Wd(n),o=Wd(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),kd(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Md(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Bd(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=Id.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Nd(l,r??null,i?.split(`,`)??null,e)}function Vd(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Pd(t,n,r,e)}function Hd(e){let t=e[1].toLowerCase();return Od({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function Ud(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Od(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Wd(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function Gd(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function Kd(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function qd(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Sd(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(J`Octal encoded byte above 177 unsupported "${n}"`)}else r=od(t);a.push(Cd(r,(e===0?`\\`:``)+t))}return a}function Jd(e){let t=[],n=new RegExp(fd,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Vd(e.slice(0,-1)));continue}}}t.push(Vd(e))}return t}function Yd(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Xd(e){return Zd.has(e.type)}var Zd=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Qd(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=hd(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return lf();case`Assertion`:return $d(n);case`Backreference`:return ef(n,a);case`Character`:return pf(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return tf(n,a,t);case`CharacterClassOpen`:return nf(n,a,t);case`CharacterSet`:return rf(n,a);case`Directive`:return _f(n.kind,{flags:n.flags});case`GroupOpen`:return af(n,a,t);case`NamedCallout`:return xf(n.kind,n.tag,n.arguments);case`Quantifier`:return of(n,a);case`Subroutine`:return sf(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=wf(vf(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(J`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(J`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function $d({kind:e}){return uf(ld({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===J`\B`||e===J`\Y`})}function ef({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,df(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return df(r)}return i(+r)}function tf(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),hf(o,e);throw Error(`Invalid character class range`)}return pf(od(`-`))}function nf({negate:e},t,n){let{tokens:r,walk:i}=t,a=[mf()],o=r[t.nextIndex],s=Ff(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(mf()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Ff(r[t.nextIndex],o)}let c=mf({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function rf({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Pf(n);if(cd.has(r)&&!o?.has(r))e=`posix`,n=r;else return Ef(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?Sf(n,{negate:t}):gf(e,{negate:t})}function af(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Df(e),l=c.type===`AbsenceFunction`,u=jf(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&sd(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=If(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(lf()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(Af(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Af(t)||jf(t)&&t.negate)throw Error(e)}}f=If(r[t.nextIndex])}return t.nextIndex++,c}function of({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Xd(a))throw Error(`Quantifier requires a repeatable token`);let o=Cf(e,t,n,a);return i.body.pop(),o}function sf({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=Tf(i);return r.push(o),o}function cf(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Of(t?.body)}}function lf(e){return{type:`Alternative`,body:kf(e?.body)}}function uf(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function df(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function ff(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Mf(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Of(t?.body)}}function pf(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function mf(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:kf(e?.body)}}function hf(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function gf(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function _f(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:ld(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function vf(e){return{type:`Flags`,...e}}function yf(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:Of(e?.body)}}function bf(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Of(e?.body)}}function xf(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function Sf(e,t){let n=!!t?.negate;if(!cd.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Cf(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function wf(e,t){return{type:`Regex`,body:Of(t?.body),flags:e}}function Tf(e){return{type:`Subroutine`,ref:e}}function Ef(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Pf(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Nf(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(J`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Df({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return cf(`repeater`);case`atomic`:return yf({atomic:!0});case`capturing`:return ff(i,{name:n});case`group`:return yf({flags:e});case`lookahead`:case`lookbehind`:return bf({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Of(e){if(e===void 0)e=[lf()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function kf(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function Af(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function jf(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Mf(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Nf(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Pf(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Ff(e,t){let n=t;return ld(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function If(e){return ld(e,`Unclosed group`)}function Lf(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Rf(c).splice(Math.max(0,zf(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Rf(c).splice(zf(s)+1)},removeAllPrevSiblings(){let e=zf(s)+l;return l-=e,Rf(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,zf(s)+l)]=e:ld(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Rf(c).splice(Math.max(0,zf(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,zf(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Rf(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function zf(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Bf=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Vf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Hf(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Uf=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Wf(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Uf.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Uf.CHAR_CLASS:Uf.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function Gf(e,t,n,r){Wf(e,t,n,r)}function Kf(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Uf.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function qf(e,t,n){return!!Kf(e,t,0,n)}function Jf(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Yf=new RegExp(String.raw`(?<noncapturingStart>${Bf})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Xf(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Yf.lastIndex=Number.isNaN(c)?0:c+7;f=Yf.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Vf(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=Wf(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Uf.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Zf=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Qf=new RegExp(String.raw`
|
|
70
70
|
\\(?: \d+
|
|
71
71
|
| c[A-Za-z]
|
|
72
72
|
| [gk]<[^>]+>
|
|
@@ -79,9 +79,9 @@ import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l
|
|
|
79
79
|
| [A-Za-z\-]+:
|
|
80
80
|
| \(DEFINE\)
|
|
81
81
|
))?
|
|
82
|
-
| (?<qBase>${
|
|
82
|
+
| (?<qBase>${Zf})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
83
83
|
| \\?.
|
|
84
|
-
`.replace(/\s+/g,``),`gsu`);function
|
|
84
|
+
`.replace(/\s+/g,``),`gsu`);function $f(e){if(!RegExp(`${Zf}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Qf.lastIndex=0;o=Qf.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Hf(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}Qf.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var ep=String.raw,tp=ep`\(\?R=(?<rDepth>[^\)]+)\)|${ep`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,np=ep`\(\?<(?![=!])(?<captureName>[^>]+)>`,rp=ep`${np}|(?<unnamed>\()(?!\?)`,ip=new RegExp(ep`${np}|${tp}|\(\?|\\?.`,`gsu`),ap=`Cannot use multiple overlapping recursions`;function op(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(tp,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&qf(e,ep`\(\?\(DEFINE\)`,Uf.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=qf(e,ep`\\[1-9]`,Uf.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(ip.lastIndex=0;f=ip.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(sp(m),l)throw Error(ap);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(ip.lastIndex);if(qf(s,tp,Uf.DEFAULT))throw Error(ap);let c=m-1;e=cp(t,s,c,!1,n,a,d),i=dp(i,t,c,a.length,0,d);break}if(h){sp(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(ap);break}if(!u)throw Error(ep`Recursive \g cannot be used outside the referenced group "${r===`external`?h:ep`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Jf(e,p);if(o&&qf(m,ep`${np}|\((?!\?)`,Uf.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=cp(_,v,b,!0,n,a,d);i=dp(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,ip.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),ip.lastIndex),s.set(p,ip.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),ip.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function sp(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function cp(e,t,n,r,i,a,o){let s=new Set;r&&Gf(e+t,np,({groups:{captureName:e}})=>{s.add(e)},Uf.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${lp(`(?:${e}`,`forward`,...c)}(?:)${lp(`${t})`,`backward`,...c)}${t}`}function lp(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=Wf(e,ep`${rp}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),up(i,n),s?e:`(?<${t}${l}>`}return ep`\k<${c}${l}>`},Uf.DEFAULT)}return c}function up(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function dp(e,t,n,r,i,a){if(e.size&&r){let o=0;Gf(t,rp,()=>o++,Uf.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var Y=String.fromCodePoint,X=String.raw,fp={},pp=globalThis.RegExp;fp.flagGroups=(()=>{try{new pp(`(?i:)`)}catch{return!1}return!0})(),fp.unicodeSets=(()=>{try{new pp(`[[]]`,`v`)}catch{return!1}return!0})(),fp.bugFlagVLiteralHyphenIsRange=fp.unicodeSets?(()=>{try{new pp(X`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,fp.bugNestedClassIgnoresNegation=fp.unicodeSets&&new pp(`[[^a]]`,`v`).test(`a`);function mp(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function hp(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function gp(e,t){return vp[e]>=vp[t]}function _p(e,t){if(e==null)throw Error(t??`Value expected`);return e}var vp={ES2025:2025,ES2024:2024,ES2018:2018},yp={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function bp(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!yp[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=fp.flagGroups?`ES2025`:fp.unicodeSets?`ES2024`:`ES2018`),t}var xp=`[ -\r ]`,Sp=new Set([Y(304),Y(305)]),Cp=X`[\p{L}\p{M}\p{N}\p{Pc}]`;function wp(e){if(Sp.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Op.get(n),a=Ep.get(n),o=Dp.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Tp=new Map(`C Other
|
|
85
85
|
Cc Control cntrl
|
|
86
86
|
Cf Format
|
|
87
87
|
Cn Unassigned
|
|
@@ -171,15 +171,15 @@ Uppercase Upper
|
|
|
171
171
|
Variation_Selector VS
|
|
172
172
|
White_Space space
|
|
173
173
|
XID_Continue XIDC
|
|
174
|
-
XID_Start XIDS`.split(/\s/).map(e=>[
|
|
174
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Pf(e),e])),Ep=new Map([[`s`,Y(383)],[Y(383),`s`]]),Dp=new Map([[Y(223),Y(7838)],[Y(107),Y(8490)],[Y(229),Y(8491)],[Y(969),Y(8486)]]),Op=new Map([jp(453),jp(456),jp(459),jp(498),...Mp(8072,8079),...Mp(8088,8095),...Mp(8104,8111),jp(8124),jp(8140),jp(8188)]),kp=new Map([[`alnum`,X`[\p{Alpha}\p{Nd}]`],[`alpha`,X`\p{Alpha}`],[`ascii`,X`\p{ASCII}`],[`blank`,X`[\p{Zs}\t]`],[`cntrl`,X`\p{Cc}`],[`digit`,X`\p{Nd}`],[`graph`,X`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,X`\p{Lower}`],[`print`,X`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,X`[\p{P}\p{S}]`],[`space`,X`\p{space}`],[`upper`,X`\p{Upper}`],[`word`,X`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,X`\p{AHex}`]]);function Ap(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function jp(e){let t=Y(e);return[t.toLowerCase(),t]}function Mp(e,t){return Ap(e,t).map(e=>jp(e))}var Np=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Pp(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Rp(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:gp(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Lf(e,Fp,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Lf(e,Ip,a),Lf(e,Lp,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Fp={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=yf();e.body[0].body.push(bf({negate:!0,body:r}),Ef(`Any`));let i=yf();i.body[0].body.push(Cf(`greedy`,0,1/0,e)),n(Z(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];hp(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Gp(t.get(e));if(n){let t=yf({flags:n});t.body[0].body=e.body,e.body=[Z(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Z(bf({body:[lf({body:[uf(`string_end`)]}),lf({body:[pf(10)]})]}),t));else if(c===`line_start`)o(Z(em(X`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&Zp(e))o(Z(bf({negate:!0}),t));else if(d)throw Error(X`Uses "\G" in a way that requires a subclass`);else o(nm(uf(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Z(em(X`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Cp})(?!${Cp})|(?<!${Cp})(?=${Cp}))`,n=`(?:(?<=${Cp})(?=${Cp})|(?<!${Cp})(?!${Cp}))`;o(Z(em(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!$p(n)&&(n=Wp(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!$p(r)&&(r=Wp(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Z(mf({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(nm(gf(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Z(tm(em(xp),l),t));return}if(s&&(c===`word`||u===`word`)){n(nm(gf(`word`,{negate:l}),t));return}if(c===`any`)n(nm(Ef(`Any`),t));else if(c===`digit`)n(nm(Ef(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(X`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=X`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Z(em(X`(?>\r\n|${i?X`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(nm(Ef(`AHex`,{negate:l}),t));else if(c===`newline`)n(Z(em(l?`[^
|
|
175
175
|
]`:`(?>\r
|
|
176
176
|
?|[
|
|
177
|
-
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Y(e.codePointAt(0)-1)}${Y(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Z($p(`[${e}]`),t))}else n(Z(em($p(Op.get(u)),l),t))}else if(c===`property`)wp.has(Nf(u))||(e.key=`sc`);else if(c===`space`)n(tm(Tf(`space`,{negate:l}),t));else if(c===`word`)n(Z(em($p(Sp),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=vf({flags:c});e.body[0].body=o(),i(Z(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Jd(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(X`Uses "\K" in a way that's unsupported`);let o=yf({behind:!0});o.body[0].body=a(),i(Z(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Z(yf({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=vf();t.body[0].body.push(e.body),e.body=Z(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=qp(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(X`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Qp(n)&&(n=Up(n,t),e.ref=n)}},Fp={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=tm(Vp(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&mp(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=mp(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=pp(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Vp(0):Bp(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Wp(Hp(o,e=>e.type===`Group`&&!!e.flags)),t=e?pp(r.globalFlags,e):r.globalFlags;Rp(t,r.currentFlags)||(l=vf({flags:Gp(t)}),l.body[0].body.push(c))}n(Z(l,t),{traverse:!s})}},Ip={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>zp(t,e));i.length?i.length>1?n(Z(vf({atomic:!0,body:i.reverse().map(e=>cf({body:[uf(e.number)]}))}),t)):e.ref=i[0].number:n(Z(yf({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=df();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Lp(e){If(e,{"*"({node:e,parent:t}){e.parent=t}})}function Rp(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function zp(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Kp(n.parent);for(let r of t){if(r===n)break;if(r===e||Jp(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Bp(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Bp(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Vp(e){let t=wf(e);return t.isRecursive=!0,t}function Hp(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Up(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Wp(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Gp({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Kp(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function qp(e){let t=e.find(e=>e.kind===`search_start`||Zp(e,{negate:!1})||!Yp(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=qp(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Jp(e,t){let n=Kp(e)??[];for(let e of n)if(e===t||Jp(e,t))return!0;return!1}function Yp({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Xp(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Zp(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Jd(e.body[0],{type:`Assertion`,kind:`search_start`})}function Qp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function $p(e,t){let n=Zd(e,{...t,unicodePropertyMap:wp}).body;return n.length>1||n[0].body.length>1?vf({body:n}):n[0].body[0]}function em(e,t){return e.negate=t,e}function tm(e,t){return e.parent=t,e}function Z(e,t){return Lp(e),e.parent=t,e}function nm(e,t){let n=yp(t),r=hp(n.target,`ES2024`),i=hp(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];If(e,rm,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,gp(im[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&mp(f._captureTransfers,e.transferTo,[]).push(t)}),f}var rm={"*":{enter({node:e},t){if(gm(e)){let n=t.getCurrentModI();t.pushModI(e.flags?pp({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){gm(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){um(Y(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),dm(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Mp.has(e.value)&&t.setHasCasedChar()}},im={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?X`\B`:X`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Y(e),r=fm(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&um(n)){let e=Cp(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);dp.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(vm)&&(o=[ff(45),...o.filter(e=>!vm(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||dp.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=vf(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=cf({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(dp.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=fm(n,i),o=fm(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&pm(dm(e)).forEach(e=>{s.add(Array.isArray(e)?`${fm(e[0],i)}-${fm(e[1],i)}`:fm(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:X`[^\n]`;if(e===`digit`)return t?X`\D`:X`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Mp.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?X`\P`:X`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?X`\W`:X`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=pp(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${mm(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+hm(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:X`\g<${t}&R=${r}>`}},am=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),om=new Set([`-`,`\\`,`]`,`^`,`[`]),sm=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),cm=new Map([[9,X`\t`],[10,X`\n`],[11,X`\v`],[12,X`\f`],[13,X`\r`],[8232,X`\u2028`],[8233,X`\u2029`],[65279,X`\uFEFF`]]),lm=/^\p{Cased}$/u;function um(e){return lm.test(e)}function dm(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Y(e);if(!um(t))continue;let o=Cp(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function fm(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(cm.has(e))return cm.get(e);if(e<32||e>126&&e<160||e>262143||t&&_m(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?sm:om:am,a=Y(e);return(i.has(a)?`\\`:``)+a}function pm(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function mm(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function hm({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function gm({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function _m(e){return e>47&&e<58}function vm({type:e,value:t}){return e===`Character`&&t===45}var ym=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=xm(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(bm(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Sm(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function bm(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function xm(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)mp(n,t,{}).transferTo=e;return n}function Sm(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Cm(e,t){let n=wm(e,t);return n.options?new ym(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function wm(e,t){let n=yp(t),r=Np(Zd(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:wp}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=nm(r,n),a=ap(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Yf(Qf(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Tm(e,t){return Cm(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Em(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Tm(e,{target:t.target}),{createScanner(e){return new id(e,t)},createString(e){return{content:e}}}}async function Dm(e){if(Wo())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=zo.get(e);if(t!=null)return t;try{let t=Bo.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(ts,e)&&(t=ts[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return Ro.has(e)||Ro.set(e,n),n});return zo.set(e,n),await n}finally{zo.delete(e)}}function Om(e){return Ro.get(e)??Dm(e)}var km=new Set;function Am(e){let t=[],n=new Set;for(let r of jm(e.themes)){let e=Pm(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return Am({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return Am({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function jm(e){return Mm(e)?[e]:e}function Mm(e){return Pm(e)||Nm(e)}function Nm(e){return typeof e.name==`string`&&typeof e.load==`function`}function Pm(e){return typeof e.getThemes==`function`}function Fm(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Im=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Lm=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Rm=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function zm(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Im(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Lm(i));let c=r,l=s().then(e=>{let a=Fm(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new Rm(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var Bm=zm();function Vm(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Bm.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Bm.getResolvedTheme(n)??Bm.seedResolvedTheme(n,e);km.has(n)||(km.add(n),t.loadThemeSync(e))}}function Hm({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Um(t)}}function Um(e){return async()=>wl(Fm(await e()))}var Wm=`pierre`,Gm=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Km=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],qm=[...Km,...Gm],Jm=new Set(Km);function Ym(e){return Jm.has(e)?`light`:`dark`}var Xm={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},Zm={"pierre-dark":()=>M(()=>import(`./_CpLgRqie.js`),[]),"pierre-dark-soft":()=>M(()=>import(`./_kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>M(()=>import(`./_CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>M(()=>import(`./_B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>M(()=>import(`./_CpjhbsIL.js`),[]),"pierre-light":()=>M(()=>import(`./_CoaEpmwp.js`),[]),"pierre-light-soft":()=>M(()=>import(`./_lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>M(()=>import(`./_D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>M(()=>import(`./_0fSaH845.js`),[]),"pierre-light-tritanopia":()=>M(()=>import(`./_CEbqgOJL.js`),[])};function Qm(e){return Hm({name:e,collection:Wm,colorScheme:Ym(e),displayName:Xm[e],load:Zm[e]})}var $m=Am({themes:qm.map(e=>Qm(e))}),eh=`shiki`,th=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],nh=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),rh=new Set(th);function ih(e){return rh.has(e)?`light`:`dark`}var ah={andromeeda:()=>M(()=>import(`./_vGVdxbeo.js`),[]),"aurora-x":()=>M(()=>import(`./_CDeNXAV0.js`),[]),"ayu-dark":()=>M(()=>import(`./_DluEY0Gj.js`),[]),"ayu-light":()=>M(()=>import(`./_C3h-C4tm.js`),[]),"ayu-mirage":()=>M(()=>import(`./_Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>M(()=>import(`./_C9Q5zVZY.js`),[]),"catppuccin-latte":()=>M(()=>import(`./_CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>M(()=>import(`./_R8nAf1vR.js`),[]),"catppuccin-mocha":()=>M(()=>import(`./_DjuaAJKi.js`),[]),"dark-plus":()=>M(()=>import(`./_Cs2F2srj.js`),[]),dracula:()=>M(()=>import(`./_BHWKrbxM.js`),[]),"dracula-soft":()=>M(()=>import(`./_5eyTD99u.js`),[]),"everforest-dark":()=>M(()=>import(`./_sB-x3p7T.js`),[]),"everforest-light":()=>M(()=>import(`./_Df2xbC6M.js`),[]),"github-dark":()=>M(()=>import(`./_C-LZuMrd.js`),[]),"github-dark-default":()=>M(()=>import(`./_DXG-b-1a.js`),[]),"github-dark-dimmed":()=>M(()=>import(`./_Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>M(()=>import(`./_B_tTalzw.js`),[]),"github-light":()=>M(()=>import(`./_EUqPIrTm.js`),[]),"github-light-default":()=>M(()=>import(`./_BXViO-2h.js`),[]),"github-light-high-contrast":()=>M(()=>import(`./_B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>M(()=>import(`./_C820rvS2.js`),[]),"gruvbox-dark-medium":()=>M(()=>import(`./_BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>M(()=>import(`./_MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>M(()=>import(`./_BC_s9l72.js`),[]),"gruvbox-light-medium":()=>M(()=>import(`./_BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>M(()=>import(`./_BSMLrYjP.js`),[]),horizon:()=>M(()=>import(`./_CE9ld1lL.js`),[]),"horizon-bright":()=>M(()=>import(`./_DSNQnXHK.js`),[]),houston:()=>M(()=>import(`./_CsvMBhTu.js`),[]),"kanagawa-dragon":()=>M(()=>import(`./_Bozd7klA.js`),[]),"kanagawa-lotus":()=>M(()=>import(`./_BmuOG9ZW.js`),[]),"kanagawa-wave":()=>M(()=>import(`./_BML5mF2J.js`),[]),laserwave:()=>M(()=>import(`./_C_8bwKvT.js`),[]),"light-plus":()=>M(()=>import(`./_DVQuIRkW2.js`),[]),"material-theme":()=>M(()=>import(`./_Bm3Qr25_2.js`),[]),"material-theme-darker":()=>M(()=>import(`./_2IIEA8gg2.js`),[]),"material-theme-lighter":()=>M(()=>import(`./_uhdI0v042.js`),[]),"material-theme-ocean":()=>M(()=>import(`./_CHQ94UKr2.js`),[]),"material-theme-palenight":()=>M(()=>import(`./_B5W6OYN72.js`),[]),"min-dark":()=>M(()=>import(`./_BSWPekZh2.js`),[]),"min-light":()=>M(()=>import(`./_DDpmG2fV2.js`),[]),monokai:()=>M(()=>import(`./_B_bV9PQ92.js`),[]),"night-owl":()=>M(()=>import(`./_DhmEMT882.js`),[]),"night-owl-light":()=>M(()=>import(`./_eJ-hLW7d2.js`),[]),nord:()=>M(()=>import(`./_Cb4Vim4T2.js`),[]),"one-dark-pro":()=>M(()=>import(`./_CLwyXe_n2.js`),[]),"one-light":()=>M(()=>import(`./_D7Lr4KcI2.js`),[]),plastic:()=>M(()=>import(`./_DQwYfKfQ2.js`),[]),poimandres:()=>M(()=>import(`./_DRFjx7u42.js`),[]),red:()=>M(()=>import(`./_DX1BQOs82.js`),[]),"rose-pine":()=>M(()=>import(`./_aMsaMD1D2.js`),[]),"rose-pine-dawn":()=>M(()=>import(`./_8PwUyIlP2.js`),[]),"rose-pine-moon":()=>M(()=>import(`./_DO-qXg-I2.js`),[]),"slack-dark":()=>M(()=>import(`./_DnToyrRv2.js`),[]),"slack-ochin":()=>M(()=>import(`./_B2OO5cIa2.js`),[]),"snazzy-light":()=>M(()=>import(`./_4G7pJPwS2.js`),[]),"solarized-dark":()=>M(()=>import(`./_UdsmMDCL2.js`),[]),"solarized-light":()=>M(()=>import(`./_C1IUL_tW2.js`),[]),"synthwave-84":()=>M(()=>import(`./_nFMaYfgc2.js`),[]),"tokyo-night":()=>M(()=>import(`./_oM2G3aXe.js`),[]),vesper:()=>M(()=>import(`./_DdrHHSXu.js`),[]),"vitesse-black":()=>M(()=>import(`./_fwtXNY1n.js`),[]),"vitesse-dark":()=>M(()=>import(`./_BZCL-v6S.js`),[]),"vitesse-light":()=>M(()=>import(`./_VbXTXTou.js`),[])};function oh(e){return Hm({name:e,collection:eh,colorScheme:ih(e),load:ah[e]})}var sh=Am({themes:Object.freeze([...th.map(e=>oh(e)),...nh.map(e=>oh(e))])});function ch(e){if(Wo())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(Bm.hasRegisteredTheme(e))return;let t=sh.getTheme(e);if(t!=null){Bm.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function lh(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function uh(e){ch(e);let t=await Bm.resolveTheme(e);return lh(e,t),t}function dh(e){return Bm.getResolvedTheme(e)??uh(e)}var fh;async function ph({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){fh??=Yu({themes:[],langs:[`text`],engine:n===`shiki-wasm`?ks(M(()=>import(`./_BnjxR4X6.js`),[])):Em()});let r=hh(fh)?await fh:fh;fh=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Om(e);`then`in t?i.push(t):Uo(t,r)}let a=[];for(let t of e){let e=dh(t);`then`in e?a.push(e):Vm(e,fh)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Uo(e,r)}),Promise.all(a).then(e=>{Vm(e,r)})]),r}function mh(){if(fh!=null&&!(`then`in fh))return fh}function hh(e=fh){return e!=null&&`then`in e}for(let e of $m.getThemes())Bm.registerThemeIfAbsent(e.name,e.load);function gh(e=Dn){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function _h(e){for(let t of gh(e))if(!km.has(t))return!1;return!0}function vh(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function yh(e){return I({tagName:`div`,children:[I({tagName:`div`,children:e.annotations?.map(e=>I({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function bh(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function xh({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return I({tagName:`div`,children:[t===`custom`?I({tagName:`slot`,properties:{name:En}}):Sh({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Ch(r)]],properties:i})}function Sh({name:e,prevName:t,iconType:n}){let r=[I({tagName:`slot`,properties:{name:Cn}}),ti({name:bh(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(I({tagName:`div`,children:[I({tagName:`bdi`,children:[ei(t)]})],properties:{"data-prev-name":``}})),r.push(ti({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(I({tagName:`div`,children:[I({tagName:`bdi`,children:[ei(e)]})],properties:{"data-title":``}})),r.push(I({tagName:`slot`,properties:{name:wn}})),I({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Ch(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(I({tagName:`span`,children:[ei(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(I({tagName:`span`,children:[ei(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(I({tagName:`slot`,properties:{name:Tn}})),I({tagName:`div`,children:t,properties:{"data-metadata":``}})}function wh(e){return I({tagName:`pre`,properties:Th(e)})}function Th({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Eh=new Map,Dh={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Oh(e){if(Eh.has(e))return Eh.get(e)??`text`;if(Dh[e]!=null)return Dh[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Eh.has(t[1]))return Eh.get(t[1])??`text`;if(Dh[t[1]]!=null)return Dh[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Eh.has(n)?Eh.get(n)??`text`:Dh[n]??`text`}function kh(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:gh(t),preferredHighlighter:n}}function Ah(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function jh(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(ei(`
|
|
178
|
-
`)),e}var
|
|
177
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Y(e.codePointAt(0)-1)}${Y(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Z(em(`[${e}]`),t))}else n(Z(tm(em(kp.get(u)),l),t))}else if(c===`property`)Tp.has(Pf(u))||(e.key=`sc`);else if(c===`space`)n(nm(Ef(`space`,{negate:l}),t));else if(c===`word`)n(Z(tm(em(Cp),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=yf({flags:c});e.body[0].body=o(),i(Z(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Yd(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(X`Uses "\K" in a way that's unsupported`);let o=bf({behind:!0});o.body[0].body=a(),i(Z(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Z(bf({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=yf();t.body[0].body.push(e.body),e.body=Z(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Jp(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(X`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!$p(n)&&(n=Wp(n,t),e.ref=n)}},Ip={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=nm(Hp(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&hp(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=hp(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=mp(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Hp(0):Vp(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Gp(Up(o,e=>e.type===`Group`&&!!e.flags)),t=e?mp(r.globalFlags,e):r.globalFlags;zp(t,r.currentFlags)||(l=yf({flags:Kp(t)}),l.body[0].body.push(c))}n(Z(l,t),{traverse:!s})}},Lp={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Bp(t,e));i.length?i.length>1?n(Z(yf({atomic:!0,body:i.reverse().map(e=>lf({body:[df(e.number)]}))}),t)):e.ref=i[0].number:n(Z(bf({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=ff();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Rp(e){Lf(e,{"*"({node:e,parent:t}){e.parent=t}})}function zp(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Bp(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=qp(n.parent);for(let r of t){if(r===n)break;if(r===e||Yp(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Vp(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Vp(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Hp(e){let t=Tf(e);return t.isRecursive=!0,t}function Up(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Wp(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Gp(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Kp({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function qp(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Jp(e){let t=e.find(e=>e.kind===`search_start`||Qp(e,{negate:!1})||!Xp(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Jp(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Yp(e,t){let n=qp(e)??[];for(let e of n)if(e===t||Yp(e,t))return!0;return!1}function Xp({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Zp(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Qp(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Yd(e.body[0],{type:`Assertion`,kind:`search_start`})}function $p(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function em(e,t){let n=Qd(e,{...t,unicodePropertyMap:Tp}).body;return n.length>1||n[0].body.length>1?yf({body:n}):n[0].body[0]}function tm(e,t){return e.negate=t,e}function nm(e,t){return e.parent=t,e}function Z(e,t){return Rp(e),e.parent=t,e}function rm(e,t){let n=bp(t),r=gp(n.target,`ES2024`),i=gp(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Lf(e,im,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,_p(am[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&hp(f._captureTransfers,e.transferTo,[]).push(t)}),f}var im={"*":{enter({node:e},t){if(_m(e)){let n=t.getCurrentModI();t.pushModI(e.flags?mp({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){_m(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){dm(Y(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),fm(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Np.has(e.value)&&t.setHasCasedChar()}},am={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?X`\B`:X`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Y(e),r=pm(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&dm(n)){let e=wp(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);fp.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(ym)&&(o=[pf(45),...o.filter(e=>!ym(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||fp.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=yf(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=lf({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(fp.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=pm(n,i),o=pm(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&mm(fm(e)).forEach(e=>{s.add(Array.isArray(e)?`${pm(e[0],i)}-${pm(e[1],i)}`:pm(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:X`[^\n]`;if(e===`digit`)return t?X`\D`:X`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Np.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?X`\P`:X`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?X`\W`:X`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=mp(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${hm(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+gm(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:X`\g<${t}&R=${r}>`}},om=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),sm=new Set([`-`,`\\`,`]`,`^`,`[`]),cm=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),lm=new Map([[9,X`\t`],[10,X`\n`],[11,X`\v`],[12,X`\f`],[13,X`\r`],[8232,X`\u2028`],[8233,X`\u2029`],[65279,X`\uFEFF`]]),um=/^\p{Cased}$/u;function dm(e){return um.test(e)}function fm(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Y(e);if(!dm(t))continue;let o=wp(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function pm(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(lm.has(e))return lm.get(e);if(e<32||e>126&&e<160||e>262143||t&&vm(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?cm:sm:om,a=Y(e);return(i.has(a)?`\\`:``)+a}function mm(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function hm(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function gm({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function _m({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function vm(e){return e>47&&e<58}function ym({type:e,value:t}){return e===`Character`&&t===45}var bm=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Sm(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(xm(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Cm(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function xm(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Sm(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)hp(n,t,{}).transferTo=e;return n}function Cm(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function wm(e,t){let n=Tm(e,t);return n.options?new bm(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Tm(e,t){let n=bp(t),r=Pp(Qd(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Tp}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=rm(r,n),a=op(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Xf($f(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Em(e,t){return wm(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Dm(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Em(e,{target:t.target}),{createScanner(e){return new ad(e,t)},createString(e){return{content:e}}}}async function Om(e){if(Go())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Bo.get(e);if(t!=null)return t;try{let t=Vo.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(ns,e)&&(t=ns[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return zo.has(e)||zo.set(e,n),n});return Bo.set(e,n),await n}finally{Bo.delete(e)}}function km(e){return zo.get(e)??Om(e)}var Am=new Set;function jm(e){let t=[],n=new Set;for(let r of Mm(e.themes)){let e=Fm(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return jm({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return jm({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Mm(e){return Nm(e)?[e]:e}function Nm(e){return Fm(e)||Pm(e)}function Pm(e){return typeof e.name==`string`&&typeof e.load==`function`}function Fm(e){return typeof e.getThemes==`function`}function Im(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Lm=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Rm=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},zm=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Bm(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Lm(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new Rm(i));let c=r,l=s().then(e=>{let a=Im(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new zm(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var Vm=Bm();function Hm(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Vm.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Vm.getResolvedTheme(n)??Vm.seedResolvedTheme(n,e);Am.has(n)||(Am.add(n),t.loadThemeSync(e))}}function Um({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Wm(t)}}function Wm(e){return async()=>Tl(Im(await e()))}var Gm=`pierre`,Km=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],qm=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Jm=[...qm,...Km],Ym=new Set(qm);function Xm(e){return Ym.has(e)?`light`:`dark`}var Zm={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},Qm={"pierre-dark":()=>M(()=>import(`./_CpLgRqie.js`),[]),"pierre-dark-soft":()=>M(()=>import(`./_kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>M(()=>import(`./_CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>M(()=>import(`./_B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>M(()=>import(`./_CpjhbsIL.js`),[]),"pierre-light":()=>M(()=>import(`./_CoaEpmwp.js`),[]),"pierre-light-soft":()=>M(()=>import(`./_lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>M(()=>import(`./_D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>M(()=>import(`./_0fSaH845.js`),[]),"pierre-light-tritanopia":()=>M(()=>import(`./_CEbqgOJL.js`),[])};function $m(e){return Um({name:e,collection:Gm,colorScheme:Xm(e),displayName:Zm[e],load:Qm[e]})}var eh=jm({themes:Jm.map(e=>$m(e))}),th=`shiki`,nh=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],rh=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),ih=new Set(nh);function ah(e){return ih.has(e)?`light`:`dark`}var oh={andromeeda:()=>M(()=>import(`./_vGVdxbeo.js`),[]),"aurora-x":()=>M(()=>import(`./_CDeNXAV0.js`),[]),"ayu-dark":()=>M(()=>import(`./_DluEY0Gj.js`),[]),"ayu-light":()=>M(()=>import(`./_C3h-C4tm.js`),[]),"ayu-mirage":()=>M(()=>import(`./_Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>M(()=>import(`./_C9Q5zVZY.js`),[]),"catppuccin-latte":()=>M(()=>import(`./_CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>M(()=>import(`./_R8nAf1vR.js`),[]),"catppuccin-mocha":()=>M(()=>import(`./_DjuaAJKi.js`),[]),"dark-plus":()=>M(()=>import(`./_Cs2F2srj.js`),[]),dracula:()=>M(()=>import(`./_BHWKrbxM.js`),[]),"dracula-soft":()=>M(()=>import(`./_5eyTD99u.js`),[]),"everforest-dark":()=>M(()=>import(`./_sB-x3p7T.js`),[]),"everforest-light":()=>M(()=>import(`./_Df2xbC6M.js`),[]),"github-dark":()=>M(()=>import(`./_C-LZuMrd.js`),[]),"github-dark-default":()=>M(()=>import(`./_DXG-b-1a.js`),[]),"github-dark-dimmed":()=>M(()=>import(`./_Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>M(()=>import(`./_B_tTalzw.js`),[]),"github-light":()=>M(()=>import(`./_EUqPIrTm.js`),[]),"github-light-default":()=>M(()=>import(`./_BXViO-2h.js`),[]),"github-light-high-contrast":()=>M(()=>import(`./_B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>M(()=>import(`./_C820rvS2.js`),[]),"gruvbox-dark-medium":()=>M(()=>import(`./_BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>M(()=>import(`./_MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>M(()=>import(`./_BC_s9l72.js`),[]),"gruvbox-light-medium":()=>M(()=>import(`./_BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>M(()=>import(`./_BSMLrYjP.js`),[]),horizon:()=>M(()=>import(`./_CE9ld1lL.js`),[]),"horizon-bright":()=>M(()=>import(`./_DSNQnXHK.js`),[]),houston:()=>M(()=>import(`./_CsvMBhTu.js`),[]),"kanagawa-dragon":()=>M(()=>import(`./_Bozd7klA.js`),[]),"kanagawa-lotus":()=>M(()=>import(`./_BmuOG9ZW.js`),[]),"kanagawa-wave":()=>M(()=>import(`./_BML5mF2J.js`),[]),laserwave:()=>M(()=>import(`./_C_8bwKvT.js`),[]),"light-plus":()=>M(()=>import(`./_DVQuIRkW2.js`),[]),"material-theme":()=>M(()=>import(`./_Bm3Qr25_2.js`),[]),"material-theme-darker":()=>M(()=>import(`./_2IIEA8gg2.js`),[]),"material-theme-lighter":()=>M(()=>import(`./_uhdI0v042.js`),[]),"material-theme-ocean":()=>M(()=>import(`./_CHQ94UKr2.js`),[]),"material-theme-palenight":()=>M(()=>import(`./_B5W6OYN72.js`),[]),"min-dark":()=>M(()=>import(`./_BSWPekZh2.js`),[]),"min-light":()=>M(()=>import(`./_DDpmG2fV2.js`),[]),monokai:()=>M(()=>import(`./_B_bV9PQ92.js`),[]),"night-owl":()=>M(()=>import(`./_DhmEMT882.js`),[]),"night-owl-light":()=>M(()=>import(`./_eJ-hLW7d2.js`),[]),nord:()=>M(()=>import(`./_Cb4Vim4T2.js`),[]),"one-dark-pro":()=>M(()=>import(`./_CLwyXe_n2.js`),[]),"one-light":()=>M(()=>import(`./_D7Lr4KcI2.js`),[]),plastic:()=>M(()=>import(`./_DQwYfKfQ2.js`),[]),poimandres:()=>M(()=>import(`./_DRFjx7u42.js`),[]),red:()=>M(()=>import(`./_DX1BQOs82.js`),[]),"rose-pine":()=>M(()=>import(`./_aMsaMD1D2.js`),[]),"rose-pine-dawn":()=>M(()=>import(`./_8PwUyIlP2.js`),[]),"rose-pine-moon":()=>M(()=>import(`./_DO-qXg-I2.js`),[]),"slack-dark":()=>M(()=>import(`./_DnToyrRv2.js`),[]),"slack-ochin":()=>M(()=>import(`./_B2OO5cIa2.js`),[]),"snazzy-light":()=>M(()=>import(`./_4G7pJPwS2.js`),[]),"solarized-dark":()=>M(()=>import(`./_UdsmMDCL2.js`),[]),"solarized-light":()=>M(()=>import(`./_C1IUL_tW2.js`),[]),"synthwave-84":()=>M(()=>import(`./_nFMaYfgc2.js`),[]),"tokyo-night":()=>M(()=>import(`./_oM2G3aXe.js`),[]),vesper:()=>M(()=>import(`./_DdrHHSXu.js`),[]),"vitesse-black":()=>M(()=>import(`./_fwtXNY1n.js`),[]),"vitesse-dark":()=>M(()=>import(`./_BZCL-v6S.js`),[]),"vitesse-light":()=>M(()=>import(`./_VbXTXTou.js`),[])};function sh(e){return Um({name:e,collection:th,colorScheme:ah(e),load:oh[e]})}var ch=jm({themes:Object.freeze([...nh.map(e=>sh(e)),...rh.map(e=>sh(e))])});function lh(e){if(Go())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(Vm.hasRegisteredTheme(e))return;let t=ch.getTheme(e);if(t!=null){Vm.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function uh(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function dh(e){lh(e);let t=await Vm.resolveTheme(e);return uh(e,t),t}function fh(e){return Vm.getResolvedTheme(e)??dh(e)}var ph;async function mh({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){ph??=Xu({themes:[],langs:[`text`],engine:n===`shiki-wasm`?As(M(()=>import(`./_BnjxR4X6.js`),[])):Dm()});let r=gh(ph)?await ph:ph;ph=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=km(e);`then`in t?i.push(t):Wo(t,r)}let a=[];for(let t of e){let e=fh(t);`then`in e?a.push(e):Hm(e,ph)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Wo(e,r)}),Promise.all(a).then(e=>{Hm(e,r)})]),r}function hh(){if(ph!=null&&!(`then`in ph))return ph}function gh(e=ph){return e!=null&&`then`in e}for(let e of eh.getThemes())Vm.registerThemeIfAbsent(e.name,e.load);function _h(e=On){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function vh(e){for(let t of _h(e))if(!Am.has(t))return!1;return!0}function yh(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function bh(e){return I({tagName:`div`,children:[I({tagName:`div`,children:e.annotations?.map(e=>I({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function xh(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Sh({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return I({tagName:`div`,children:[t===`custom`?I({tagName:`slot`,properties:{name:Dn}}):Ch({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[wh(r)]],properties:i})}function Ch({name:e,prevName:t,iconType:n}){let r=[I({tagName:`slot`,properties:{name:wn}}),ni({name:xh(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(I({tagName:`div`,children:[I({tagName:`bdi`,children:[ti(t)]})],properties:{"data-prev-name":``}})),r.push(ni({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(I({tagName:`div`,children:[I({tagName:`bdi`,children:[ti(e)]})],properties:{"data-title":``}})),r.push(I({tagName:`slot`,properties:{name:Tn}})),I({tagName:`div`,children:r,properties:{"data-header-content":``}})}function wh(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(I({tagName:`span`,children:[ti(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(I({tagName:`span`,children:[ti(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(I({tagName:`slot`,properties:{name:En}})),I({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Th(e){return I({tagName:`pre`,properties:Eh(e)})}function Eh({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Dh=new Map,Oh={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function kh(e){if(Dh.has(e))return Dh.get(e)??`text`;if(Oh[e]!=null)return Oh[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Dh.has(t[1]))return Dh.get(t[1])??`text`;if(Oh[t[1]]!=null)return Oh[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Dh.has(n)?Dh.get(n)??`text`:Oh[n]??`text`}function Ah(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:_h(t),preferredHighlighter:n}}function jh(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Mh(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(ti(`
|
|
178
|
+
`)),e}var Nh=Symbol(`no-token`),Ph=Symbol(`multiple-tokens`);function Fh(e){let t=Ih(e);if(t!=null)return t;let n=Nh,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Rh(e,a);for(let t of e.children)Lh(t)}else Lh(e);r.push(e),i=[],a=void 0;return}for(let e of i)Lh(e);r.push(I({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Nh){if(e===Ph){n=Ph;return}if(n===Nh){n=e;return}n!==e&&(n=Ph)}};for(let t of e.children){let e=t.type===`element`?Fh(t):Nh;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function Ih(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Lh(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Lh(t)}}function Rh(e,t){e.properties[`data-char`]=t}function zh(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+Bh(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function Bh(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Vh(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=ri(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Fh(a),i.push(Mh(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Uh,Hh),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Hh}}var Hh=zh({classPrefix:`hl-`}),Uh={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function Wh(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Gh=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Kh=/^0(?:\.0+)?%?$/;function qh(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function Jh(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Yh(e){if(e==null)return null;let t=Jh(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Xh(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Gh.test(t))return!0;let n=qh(t);return n!=null&&Kh.test(n)}function Zh(e,t,n){if(t==null||n==null)return!1;let r=Yh(e),i=Yh(t),a=Yh(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Qh=new WeakMap;function $h(e){let t=Qh.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;eg(r,`editor.background`,i),eg(r,`editor.foreground`,a),eg(r,`sideBar.background`,o),eg(r,`sideBar.foreground`,s),eg(r,`input.background`,n[`input.background`]??o),eg(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),eg(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),eg(r,`gitDecoration.addedResourceForeground`,tg(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),eg(r,`gitDecoration.modifiedResourceForeground`,tg(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),eg(r,`gitDecoration.deletedResourceForeground`,tg(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Xh(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Xh(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(ng(l,o)||Zh(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Qh.set(e,u),u}function eg(e,t,n){n!=null&&n!==``&&(e[t]=n)}function tg(...e){for(let t of e)if(t!=null&&t!==``)return t}function ng(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function rg({theme:e=On,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=$h(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Wh(`global`)}fg:${a.fg};`,r+=`${Wh(`global`)}bg:${a.bg};`,r+=ig(i,n)}else{let n=t.getTheme(e.dark),i=$h(n);r+=`${Wh(`global`)}dark:${i.fg};`,r+=`${Wh(`global`)}dark-bg:${i.bg};`,r+=ig(n,`dark`),n=t.getTheme(e.light),i=$h(n),r+=`${Wh(`global`)}light:${i.fg};`,r+=`${Wh(`global`)}light-bg:${i.bg};`,r+=ig(n,`light`)}return r}function ig(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Wh(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Wh(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Wh(`global`)}${t}modified-color:${a};`),n}function ag(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function og(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function sg(e){return e.startingLine===0&&e.totalLines>0}function cg(e,t){return e.endsWith(`\r
|
|
179
179
|
`)?t+`\r
|
|
180
180
|
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
181
181
|
`)?t+`
|
|
182
|
-
`:t}function
|
|
182
|
+
`:t}function lg(e,t){return I({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}var ug=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
183
183
|
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
184
184
|
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
185
185
|
</symbol>
|
|
@@ -231,7 +231,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Nf(e),e])),Tp=new Map([[`s`,Y(383)],[Y(383),
|
|
|
231
231
|
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
232
232
|
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
233
233
|
</symbol>
|
|
234
|
-
</svg>`;function
|
|
234
|
+
</svg>`;function dg(e,t){return e==null||t==null?e===t:pg(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var fg={};function pg(e=fg,t=fg){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function mg(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function hg(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function gg(){let e=document.createElement(`style`);return e.setAttribute(An,``),e}var _g=`@layer base {
|
|
235
235
|
:host {
|
|
236
236
|
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
237
237
|
"Courier New", monospace;
|
|
@@ -1509,24 +1509,24 @@ XID_Start XIDS`.split(/\s/).map(e=>[Nf(e),e])),Tp=new Map([[`s`,Y(383)],[Y(383),
|
|
|
1509
1509
|
}
|
|
1510
1510
|
|
|
1511
1511
|
@layer theme, rendered, unsafe;
|
|
1512
|
-
`,
|
|
1512
|
+
`,vg;function yg(e){if(vg!=null)return vg;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(jn,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),vg=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),vg}function bg(e){return`${Mn}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var xg=`@layer base, theme, rendered, unsafe;`,Sg=RegExp(`${Eg(Mn)}\\s*:\\s*[^;]+;`);function Cg(e){return`${xg}
|
|
1513
1513
|
@layer unsafe {
|
|
1514
1514
|
${e}
|
|
1515
|
-
}`}function
|
|
1515
|
+
}`}function wg(e,t=`system`,n){return`${xg}
|
|
1516
1516
|
@layer rendered {
|
|
1517
1517
|
:host {${t===`system`?``:`
|
|
1518
1518
|
color-scheme: ${t};`}
|
|
1519
|
-
${
|
|
1519
|
+
${bg(n)}
|
|
1520
1520
|
${e}
|
|
1521
1521
|
}
|
|
1522
|
-
}`}function wg(e,t){let n=yg(t);return e.replace(xg,n)}function Tg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Eg({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function Dg(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Og(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function kg(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function Ag(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function jg(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function Mg({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Ng(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Ng(){let e=document.createElement(`style`);return e.setAttribute(On,``),e}var Pg=void 0;function Fg(){return Pg??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(gg)),t.adoptedStyleSheets=[e]}connectedCallback(){vg(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(gn,t)}function Ig(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function Lg(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function Rg(e){return e===``?[]:e.split(vn)}function zg(e,t,n){let r=e===`clone`?Lg(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return Bg(r,Hg(r,n),Ug(r,n));case`rename-pure`:{let e=Ug(r,n);Wg(r,n);let t=Rg(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,Kg(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function Bg(e,t,n){let r=Rg(t.contents),i=Rg(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=Vg(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,Kg(e,t,n),e}function Vg(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Xn(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=F(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=F(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function Hg(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function Ug(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Wg(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Gg(e,t,n){return e.cacheKey==null?qg(t,n):`${e.cacheKey}:hydrated`}function Kg(e,t,n){let r=Gg(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function qg(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var Jg=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Yg(e,t){return Vn(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Xg(e){return I({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Zg(e){return I({tagName:`div`,children:[I({tagName:`span`,children:[ei(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function Qg(e){return I({tagName:`div`,children:[ti({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function $g({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(I({tagName:`div`,children:[ei(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(Qg(`up`)),s++),o||(e.push(Qg(`down`)),s++)):(e.push(Qg(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(I({tagName:`div`,children:[I({tagName:`span`,children:[ei(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(I({tagName:`div`,children:[ei(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(I({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(I({tagName:`slot`,properties:{name:i}})),I({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function e_(e,t){return`hunk-separator-${e}-${t}`}function t_(e){let t=e.at(-1);return t==null?0:Math.max(F(t.additionStart,t.additionCount),F(t.deletionStart,t.deletionCount))}function n_(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function r_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function i_({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function a_(e){return[Xn(e.additionStart,e.additionCount)+1,F(e.additionStart,e.additionCount)+1]}function o_({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function s_(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-F(t.additionStart,t.additionCount),r=e.deletionLines.length-F(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function c_({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-F(n.additionStart,n.additionCount),i=e.deletionLines.length-F(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function l_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=c_({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function u_({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=a_(a);if(t<o){let s=o_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=l_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=a_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function d_({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=a_(n),l=o_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=l_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function f_({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=p_({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Xn(r.deletionStart,r.deletionCount),s=Xn(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=o_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?l_({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(g_(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,g_(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(g_(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=__(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(v_({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(g_(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function p_({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=m_({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function m_({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=o_({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?l_({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function h_(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function g_(e,t,n,r,i,a){let[o,s]=h_(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function __(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function v_({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,te=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&te!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:te};if(w!=null&&te==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||te==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:te}}var y_={forcePlainText:!1};function b_(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=y_){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=ng({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??S_();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}f_({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&x_({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=C_({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function x_({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Un(e),t=Un(t),e.length>s||t.length>s))return;let c=o===`char`?Sr(e,t):zr(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(i_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),i_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?i_({item:e,arr:l,enableJoin:d,isLastItem:t}):i_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(r_({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(r_({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function S_(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function C_({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=Dn,...l}}){let u=s??Oh(e.name),d=s??Oh(t.name),{state:f,transformers:p}=Bh(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Uh(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Uh(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,ig(i.codeToHast(Un(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,ig(i.codeToHast(Un(t.contents),m)))}}function w_(e,t){let n=Zr({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function T_(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function E_(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function D_(e,t){return t.length>0&&t.length<e.deletionLines.length&&E_(t)}function O_(e,t,n){let r=e.deletionLines.join(``),i=T_(t.length,r),a=Zr({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function k_(e,t){return O_(e,[``],t)}function A_(e,t){if(e.additionLines.length===0)return k_(e,t);if(D_(e,e.additionLines))return O_(e,e.additionLines,t);let n=e.additionLines,r=w_(e,t);return M_(r,n),r}function j_(e){return e.length>1&&e.at(-1)===``}function M_(e,t){if(!j_(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&F(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,H_(e);return}}}function N_(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return P_(e,w_(e,n));let r=Array.from(t);if(r.length===0)return P_(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||Un(r)===Un(i))return P_(e,w_(e,n))}let i=F_(e,r);if(i.size===0)return P_(e,w_(e,n));for(let t of i)if(!L_(e,t,n))return P_(e,w_(e,n));return H_(e),s_(e)?P_(e,w_(e,n)):P_(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function P_(e,t){return Object.assign(e,t),t}function F_(e,t){let n=new Set;for(let r of t){let t=I_(e,r);if(t==null)return new Set;n.add(t)}return n}function I_(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function L_(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=Zr({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(z_(r,s),R_(e,t),!0)}function R_(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
1522
|
+
}`}function Tg(e,t){let n=bg(t);return e.replace(Sg,n)}function Eg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Dg({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function Og(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function kg(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function Ag(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function jg(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Mg(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function Ng({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=Pg(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function Pg(){let e=document.createElement(`style`);return e.setAttribute(kn,``),e}var Fg=void 0;function Ig(){return Fg??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(_g)),t.adoptedStyleSheets=[e]}connectedCallback(){yg(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(_n,t)}function Lg(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function Rg(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function zg(e){return e===``?[]:e.split(yn)}function Bg(e,t,n){let r=e===`clone`?Rg(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return Vg(r,Ug(r,n),Wg(r,n));case`rename-pure`:{let e=Wg(r,n);Gg(r,n);let t=zg(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,qg(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function Vg(e,t,n){let r=zg(t.contents),i=zg(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=Hg(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,qg(e,t,n),e}function Hg(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(Zn(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=F(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=F(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function Ug(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function Wg(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Gg(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Kg(e,t,n){return e.cacheKey==null?Jg(t,n):`${e.cacheKey}:hydrated`}function qg(e,t,n){let r=Kg(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function Jg(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var Yg=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Xg(e,t){return Hn(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Zg(e){return I({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Qg(e){return I({tagName:`div`,children:[I({tagName:`span`,children:[ti(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function $g(e){return I({tagName:`div`,children:[ni({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function e_({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(I({tagName:`div`,children:[ti(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push($g(`up`)),s++),o||(e.push($g(`down`)),s++)):(e.push($g(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(I({tagName:`div`,children:[I({tagName:`span`,children:[ti(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(I({tagName:`div`,children:[ti(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(I({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(I({tagName:`slot`,properties:{name:i}})),I({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function t_(e,t){return`hunk-separator-${e}-${t}`}function n_(e){let t=e.at(-1);return t==null?0:Math.max(F(t.additionStart,t.additionCount),F(t.deletionStart,t.deletionCount))}function r_(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function i_({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function a_({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function o_(e){return[Zn(e.additionStart,e.additionCount)+1,F(e.additionStart,e.additionCount)+1]}function s_({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function c_(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-F(t.additionStart,t.additionCount),r=e.deletionLines.length-F(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function l_({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-F(n.additionStart,n.additionCount),i=e.deletionLines.length-F(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function u_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=l_({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function d_({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=o_(a);if(t<o){let s=s_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=u_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=o_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function f_({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=o_(n),l=s_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=u_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function p_({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=m_({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Zn(r.deletionStart,r.deletionCount),s=Zn(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=s_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?u_({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(__(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,__(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(__(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=v_(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(y_({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(__(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function m_({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=h_({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function h_({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=s_({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?u_({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function g_(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function __(e,t,n,r,i,a){let[o,s]=g_(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function v_(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function y_({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,te=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,w=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(te==null&&w!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:w};if(te!=null&&w==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:te,additionLine:void 0};if(te==null||w==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:te,additionLine:w}}var b_={forcePlainText:!1};function x_(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=b_){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=rg({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??C_();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}p_({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&S_({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=w_({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function S_({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Wn(e),t=Wn(t),e.length>s||t.length>s))return;let c=o===`char`?Cr(e,t):Br(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(a_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),a_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?a_({item:e,arr:l,enableJoin:d,isLastItem:t}):a_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(i_({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(i_({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function C_(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function w_({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=On,...l}}){let u=s??kh(e.name),d=s??kh(t.name),{state:f,transformers:p}=Vh(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Wh(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Wh(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,ag(i.codeToHast(Wn(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,ag(i.codeToHast(Wn(t.contents),m)))}}function T_(e,t){let n=Qr({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function E_(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function D_(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function O_(e,t){return t.length>0&&t.length<e.deletionLines.length&&D_(t)}function k_(e,t,n){let r=e.deletionLines.join(``),i=E_(t.length,r),a=Qr({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function A_(e,t){return k_(e,[``],t)}function j_(e,t){if(e.additionLines.length===0)return A_(e,t);if(O_(e,e.additionLines))return k_(e,e.additionLines,t);let n=e.additionLines,r=T_(e,t);return N_(r,n),r}function M_(e){return e.length>1&&e.at(-1)===``}function N_(e,t){if(!M_(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&F(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,U_(e);return}}}function P_(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return F_(e,T_(e,n));let r=Array.from(t);if(r.length===0)return F_(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||Wn(r)===Wn(i))return F_(e,T_(e,n))}let i=I_(e,r);if(i.size===0)return F_(e,T_(e,n));for(let t of i)if(!R_(e,t,n))return F_(e,T_(e,n));return U_(e),c_(e)?F_(e,T_(e,n)):F_(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function F_(e,t){return Object.assign(e,t),t}function I_(e,t){let n=new Set;for(let r of t){let t=L_(e,r);if(t==null)return new Set;n.add(t)}return n}function L_(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function R_(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=Qr({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(B_(r,s),z_(e,t),!0)}function z_(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
1523
1523
|
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1524
|
-
`)}function z_(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>B_(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,V_(e)}function B_(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function V_(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function H_(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Xn(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,V_(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=F(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-F(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var U_=new WeakMap;function W_(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function G_(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function K_(e,t){let n=e.hunks,r=e.additionLines,i=W_(r),a=i===r?e:{...e,additionLines:i},o=nv(n,tv(a,t),e.deletionLines.length),s=av(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,hv(e),M_(e,r),cv(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function q_(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<dv(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:dv(r);if(i==null||t<i||o!=null&&o!==s)return K_(e,n);o=s}if(o!=null){if(J_(e,i,o,r,n)){e.editSessionDirty=!0;return}return K_(e,n)}}function J_(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=Y_(e),o=e.hunks[n];if(o.hunkContent.some(X_))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function Y_(e){let t=U_.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return U_.set(e,{lines:e.deletionLines,set:n}),n}function X_(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function Z_(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function Q_(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=o_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=fv(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=l_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=fv(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function $_(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=fv(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,fv(i)+i.deletionCount,e.deletionLines.length),n}function ev(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?w_(e,t):A_(e,t)),!0)}function tv(e,t){if(G_(e.deletionLines,e.additionLines)==null)return[];let n=Zr({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=B_(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function nv(e,t,n){let r=e.map((e,t)=>{let n=fv(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&rv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=iv(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function rv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function iv(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function av(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);sv(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);sv(s,c,i,r),r+=c,i+=c,n.push(ov(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function ov(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:pv(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:mv(t.additionStart,r),deletionStart:pv(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:mv(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${pv(t.deletionStart,i)},${i} +${pv(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return V_(s),s}function sv(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function cv(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(fv(r)!==fv(i)||r.deletionCount!==i.deletionCount||dv(r)!==dv(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!lv(r,i))return!0}return!1}function lv(e,t){let n=uv(e),r=uv(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*uv(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function dv(e){return Xn(e.additionStart,e.additionCount)}function fv(e){return Xn(e.deletionStart,e.deletionCount)}function pv(e,t){return t===0?e:e+1}function mv(e,t){return t===0?e-1:e}function hv(e){H_(e);for(let t=0;t<e.hunks.length;t++)R_(e,t)}function gv(e){let t=e.lang??Oh(e.name),n=e.lang??(e.prevName==null?`text`:Oh(e.prevName));return t===`text`&&n===`text`}var _v=-1,vv=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++_v}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:Dn},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=_h(e.theme??Dn)?mh():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,k_(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||gv(e.diff)||Nv(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);Yg(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Nn}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=Un(l);c&&(i.additionLines[t]=sg(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,k_(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(D_(i,i.additionLines))Object.assign(i,O_(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=q_(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,N_(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Z_(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=Av(e,r),n.code.additionLines=Ov(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,k_(t,this.options.parseDiffOptions)),n.code.additionLines[0]=kv(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,A_(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(D_(e,n)){Object.assign(e,O_(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(K_(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>yh(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=Dn,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Mn,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await ph(kh(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Nv(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!Yg(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!gv(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??Oh(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??Dn}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Ig(e,n.diff)||!Yg(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Pn){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||gv(e)||Nv(e,this.getTokenizeMaxLength()),l=!Ig(e,this.renderCache.diff),u=!vh(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&n_(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,n_(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??Oh(e.name);let t=this.highlighter!=null&&_h(i.theme),n=this.highlighter!=null&&Ho(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=Pn){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return wh({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Nv(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Oh(e.name);let n=this.highlighter!=null&&_h(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Ho(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=b_(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(f_({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=kv(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!Yg(this.renderCache.options,n)||!Ig(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Yg(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Ig(e,n.diff)&&Yg(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=Pv(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:ri(),deletionsGutterAST:ri(),additionsGutterAST:ri(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=c_({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,ai(void 0,`buffer`,this.size)),h?.push(Xg(this.size))):(x.pushToGutter(`deletions`,ai(void 0,`buffer`,this.size)),g?.push(Xg(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,ii(t,n,r,i))};function w(e){C.flush(),a===`unified`?Tv(`unified`,e,x):(Tv(`deletions`,e,x),Tv(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),f_({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&Sv(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Ev(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Ev(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),wv({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Sv(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&Cv(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Ev(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Ev(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}wv({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Cv(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),te=_?n.noEOFCRDeletions:!1,ne=_?n.noEOFCRAdditions:!1,re=(s?.noEOFCR??!1)||te,ie=(o?.noEOFCR??!1)||ne;if(ie||re){if(a===`split`&&C.flush(),re){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(Zg(e)),x.pushToGutter(`unified`,ai(e,`metadata`,1))):(x.deletionsContentAST.push(Zg(e)),x.pushToGutter(`deletions`,ai(e,`metadata`,1)),ie||(x.pushToGutter(`additions`,ai(void 0,`buffer`,1)),x.additionsContentAST.push(Xg(1))))}if(ie){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(Zg(e)),x.pushToGutter(`unified`,ai(e,`metadata`,1))):(x.additionsContentAST.push(Zg(e)),x.pushToGutter(`additions`,ai(e,`metadata`,1)),re||(x.pushToGutter(`deletions`,ai(void 0,`buffer`,1)),x.deletionsContentAST.push(Xg(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let te=Math.max(t_(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ne=t.bufferBefore>0||t.bufferAfter>0,re=!f&&e.type!==`deleted`,ie=!f&&e.type!==`new`,ae=x.rowCount>0||ne;h=re&&ae?h:void 0,g=ie&&ae?g:void 0,_=f&&ae?_:void 0;let oe=this.createPreElement(g!=null&&h!=null,te);return{unifiedGutterAST:f&&ae?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:ie&&ae?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:re&&ae?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:oe,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:te,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=ri(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,cg(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(I({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(I({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(I({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return oo(this.renderFullAST(e,t))}renderPartialHTML(e,t){return oo(t==null?e:I({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!og(n))return;let i=e.type===`new`?[]:yv(ag(this.deletionAnnotations)),a=e.type===`deleted`?[]:yv(ag(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){wv({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}wv({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(Ah(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(Ah(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return xh({fileOrDiff:e,mode:t,stickyHeader:n})}};function yv(e){return e?.map(e=>Ah(e))??[]}var bv=new Intl.PluralRules(`en-US`);function xv(e){return`${e} unmodified line${bv.select(e)===`one`?``:`s`}`}function Sv(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Cv(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function wv({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,ai(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,ai(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,ai(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Tv(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,$g({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push($g({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,$g({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push($g({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=e_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?xv(n):`More unchanged context may be available`;c.pushToGutter(e,$g({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push($g({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Ev(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Dv(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Ov(e,t,n,r){let i=Dv(e),a=Dv(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=kv(e,r.getLineText(e));return l}function kv(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function Av(e,t){let n=[],r=Mv(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!jv(i)?i+r:i)}return n}function jv(e){return e.endsWith(`
|
|
1525
|
-
`)||e.endsWith(`\r`)}function
|
|
1524
|
+
`)}function B_(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>V_(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,H_(e)}function V_(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function H_(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function U_(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(Zn(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,H_(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=F(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-F(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var W_=new WeakMap;function G_(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function K_(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function q_(e,t){let n=e.hunks,r=e.additionLines,i=G_(r),a=i===r?e:{...e,additionLines:i},o=rv(n,nv(a,t),e.deletionLines.length),s=ov(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,gv(e),N_(e,r),lv(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function J_(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<fv(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:fv(r);if(i==null||t<i||o!=null&&o!==s)return q_(e,n);o=s}if(o!=null){if(Y_(e,i,o,r,n)){e.editSessionDirty=!0;return}return q_(e,n)}}function Y_(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=X_(e),o=e.hunks[n];if(o.hunkContent.some(Z_))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function X_(e){let t=W_.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return W_.set(e,{lines:e.deletionLines,set:n}),n}function Z_(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function Q_(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function $_(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=s_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=pv(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=u_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=pv(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function ev(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=pv(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,pv(i)+i.deletionCount,e.deletionLines.length),n}function tv(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?T_(e,t):j_(e,t)),!0)}function nv(e,t){if(K_(e.deletionLines,e.additionLines)==null)return[];let n=Qr({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=V_(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function rv(e,t,n){let r=e.map((e,t)=>{let n=pv(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&iv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=av(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function iv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function av(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function ov(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);cv(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);cv(s,c,i,r),r+=c,i+=c,n.push(sv(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function sv(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:mv(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:hv(t.additionStart,r),deletionStart:mv(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:hv(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${mv(t.deletionStart,i)},${i} +${mv(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return H_(s),s}function cv(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function lv(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(pv(r)!==pv(i)||r.deletionCount!==i.deletionCount||fv(r)!==fv(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!uv(r,i))return!0}return!1}function uv(e,t){let n=dv(e),r=dv(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*dv(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function fv(e){return Zn(e.additionStart,e.additionCount)}function pv(e){return Zn(e.deletionStart,e.deletionCount)}function mv(e,t){return t===0?e:e+1}function hv(e,t){return t===0?e-1:e}function gv(e){U_(e);for(let t=0;t<e.hunks.length;t++)z_(e,t)}function _v(e){let t=e.lang??kh(e.name),n=e.lang??(e.prevName==null?`text`:kh(e.prevName));return t===`text`&&n===`text`}var vv=-1,yv=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++vv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:On},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=vh(e.theme??On)?hh():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,A_(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||_v(e.diff)||Pv(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);Xg(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Pn}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=Wn(l);c&&(i.additionLines[t]=cg(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,A_(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(O_(i,i.additionLines))Object.assign(i,k_(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=J_(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,P_(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Q_(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=jv(e,r),n.code.additionLines=kv(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,A_(t,this.options.parseDiffOptions)),n.code.additionLines[0]=Av(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,j_(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(O_(e,n)){Object.assign(e,k_(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(q_(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>bh(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=On,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Nn,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await mh(Ah(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Pv(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!Xg(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!_v(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??kh(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??On}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Lg(e,n.diff)||!Xg(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Fn){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||_v(e)||Pv(e,this.getTokenizeMaxLength()),l=!Lg(e,this.renderCache.diff),u=!yh(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&r_(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,r_(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??kh(e.name);let t=this.highlighter!=null&&vh(i.theme),n=this.highlighter!=null&&Uo(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=Fn){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return Th({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Pv(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??kh(e.name);let n=this.highlighter!=null&&vh(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Uo(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=x_(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(p_({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=Av(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!Xg(this.renderCache.options,n)||!Lg(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!Xg(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Lg(e,n.diff)&&Xg(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=Fv(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:ii(),deletionsGutterAST:ii(),additionsGutterAST:ii(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=l_({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,oi(void 0,`buffer`,this.size)),h?.push(Zg(this.size))):(x.pushToGutter(`deletions`,oi(void 0,`buffer`,this.size)),g?.push(Zg(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,ai(t,n,r,i))};function te(e){C.flush(),a===`unified`?Ev(`unified`,e,x):(Ev(`deletions`,e,x),Ev(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),p_({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&te({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&Cv(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Dv(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Dv(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Tv({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Cv(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&wv(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Dv(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Dv(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Tv({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&wv(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),w=_?n.noEOFCRDeletions:!1,ne=_?n.noEOFCRAdditions:!1,T=(s?.noEOFCR??!1)||w,re=(o?.noEOFCR??!1)||ne;if(re||T){if(a===`split`&&C.flush(),T){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(Qg(e)),x.pushToGutter(`unified`,oi(e,`metadata`,1))):(x.deletionsContentAST.push(Qg(e)),x.pushToGutter(`deletions`,oi(e,`metadata`,1)),re||(x.pushToGutter(`additions`,oi(void 0,`buffer`,1)),x.additionsContentAST.push(Zg(1))))}if(re){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(Qg(e)),x.pushToGutter(`unified`,oi(e,`metadata`,1))):(x.additionsContentAST.push(Qg(e)),x.pushToGutter(`additions`,oi(e,`metadata`,1)),T||(x.pushToGutter(`deletions`,oi(void 0,`buffer`,1)),x.deletionsContentAST.push(Zg(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&te({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let w=Math.max(n_(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),ne=t.bufferBefore>0||t.bufferAfter>0,T=!f&&e.type!==`deleted`,re=!f&&e.type!==`new`,ie=x.rowCount>0||ne;h=T&&ie?h:void 0,g=re&&ie?g:void 0,_=f&&ie?_:void 0;let ae=this.createPreElement(g!=null&&h!=null,w);return{unifiedGutterAST:f&&ie?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:re&&ie?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:T&&ie?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:ae,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:w,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=ii(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,lg(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(I({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(I({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(I({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return so(this.renderFullAST(e,t))}renderPartialHTML(e,t){return so(t==null?e:I({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!sg(n))return;let i=e.type===`new`?[]:bv(og(this.deletionAnnotations)),a=e.type===`deleted`?[]:bv(og(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Tv({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Tv({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(jh(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(jh(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return Sh({fileOrDiff:e,mode:t,stickyHeader:n})}};function bv(e){return e?.map(e=>jh(e))??[]}var xv=new Intl.PluralRules(`en-US`);function Sv(e){return`${e} unmodified line${xv.select(e)===`one`?``:`s`}`}function Cv(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function wv(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Tv({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,oi(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,oi(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,oi(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Ev(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,e_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(e_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,e_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(e_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=t_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Sv(n):`More unchanged context may be available`;c.pushToGutter(e,e_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(e_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Dv(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Ov(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function kv(e,t,n,r){let i=Ov(e),a=Ov(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=Av(e,r.getLineText(e));return l}function Av(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function jv(e,t){let n=[],r=Nv(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!Mv(i)?i+r:i)}return n}function Mv(e){return e.endsWith(`
|
|
1525
|
+
`)||e.endsWith(`\r`)}function Nv(e){for(let t of e){if(t.endsWith(`\r
|
|
1526
1526
|
`))return`\r
|
|
1527
1527
|
`;if(t.endsWith(`
|
|
1528
1528
|
`))return`
|
|
1529
1529
|
`;if(t.endsWith(`\r`))return`\r`}return`
|
|
1530
|
-
`}function Nv(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Pv(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Fv(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Iv(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function Lv(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function Rv({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function zv(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Ag(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Bv(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Vv=-1,Hv=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Vv}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:Dn},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Ao,this.scrollSyncManager=new Jg,this.interactionManager=new lo(`diff`,uo(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return zv(e)}createHunksRenderer(e){return new vv(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Xn(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(uo(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Vn(this.appliedThemeCSS.theme,this.options.theme??Dn)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){zn(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=Rv(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Kv(this.pre,Wv({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||qv(this.headerElement,Gv({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Dg(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Zr(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Bv(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(zg(`merge`,e,t),this.setHydratedState(t),await Lv(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=Rv(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!Uv(u,this.deletionFile)||!Uv(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&vh(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Zr(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(ev(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,Fn);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||n_(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return f_({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Q_(e,this.hunksRenderer.getExpandedHunksMap(),t);return ev(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap($_(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return u_({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return d_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=a_(o);if(e<s){let c=o_({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=l_({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=a_(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Rn(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||gv(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Iv(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${Ah(r)}`,a=this.annotationCache.get(i);if(a==null||!Fv(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:pg(Ah(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=mg();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:kg(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):kg(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=lg;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??oo(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,En,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Cn,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,wn,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Tn,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=hg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Sg(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??Dn,s=typeof o==`string`?o:{...o},c=vg(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Mg({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Cg(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=wg(this.themeCSSStyle.textContent??``,vg(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Fg()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?jg(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Jv(t[0]),a=Jv(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=oo(i),r.content.innerHTML=oo(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Eg({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Eg({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=Eg({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Jv(r?.[0]),a=Jv(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=Jv(n?.[0]),i=Jv(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=oo(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?jg(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Jv(t[0]),i=Jv(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};ug(u,this.appliedPreAttributes)||(Og(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Uv(e,t){return e==null||t==null?e==null&&t==null:$r(e,t)}function Wv({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Gv({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Kv(e,t,n=!1){return!n&&e==null&&t}function qv(e,t,n=!1){return e==null&&t&&!n}function Jv(e){if(e!=null&&e.type===`element`)return e.children??[]}var Yv=200,Xv=40;function Zv(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=Yv)break;let e=a.length,n=$v(t.old,t.new),o=new Set;ey(t,t.new,`additions`,i,r,o,a,n.additions),ey(t,t.old,`deletions`,i,r,o,a,n.deletions),a.length===e&&Qv(t.path,i,r)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function Qv(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function $v(e,t){let n=new Set,r=new Set;if(e==null&&t==null)return{additions:n,deletions:r};try{let i=Zr(e==null?null:{name:`old`,contents:e},t==null?null:{name:`new`,contents:t});for(let e of i.hunks){for(let t=0;t<e.additionCount;t++)n.add(e.additionStart+t);for(let t=0;t<e.deletionCount;t++)r.add(e.deletionStart+t)}}catch{}return{additions:n,deletions:r}}function ey(e,t,n,r,i,a,o,s){if(!t||o.length>=Yv||!s.size)return;let c=0,l=t.split(`
|
|
1531
|
-
`);for(let t=0;t<l.length;t++){if(o.length>=
|
|
1532
|
-
`)),mb=e,e}var gb=new CSSStyleSheet;gb.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+at);var _b=We(`f0`,0),vb=(e,t)=>j(e.a,[`_gv`,t]),yb=O(`f1`,e=>ne(e,{file:e.e,comments:e.f,draft:e.g,sessions:e.h,onMount:function(){let t=()=>e.h||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.className=`_eO`;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=(e,n,r)=>{let i=t()[0];if(!n)return e.className=`_l ${r?ae:``} _m`,e.textContent=`Send`,i&&(e.title=`Send to ${i.title||i.agent}`),e;let a=document.createElement(`span`);return a.className=`_eM`,r&&(a.style.cssText=`font-size:.75rem;`),e.className=`_m _eN`,e.textContent=`Send to`,a.append(e,n),a},o=t=>{if(t.snippet==null)return null;let n=t.side===`deletions`?e.e.old:e.e.new;if(n==null||kt(n,t.line_start,t.line_end,t.side)===t.snippet)return null;let r=document.createElement(`span`);return r.className=`_F ${Ie.warn}`,r.textContent=`changed since`,r.title=`The file changed here after this comment was written; the agent gets the lines as they were.`,r},s=s=>{if(!s)return;let c=document.createElement(`div`);c.style.cssText=db;let l=document.createElement(`p`);l.textContent=s.text,l.style.cssText=`margin:0;white-space:pre-wrap;`;let u=document.createElement(`div`);u.style.cssText=fb;let d=document.createElement(`button`);d.type=`button`,d.textContent=`Remove`,d.className=`_l ${ae}`,d.onclick=()=>e.i?.(s.id);let f=t().length>0&&!!e.j,p=document.createElement(`button`);p.type=`button`,p.dataset.role=`send`,p.textContent=`Send`,p.hidden=!f;let m=f?n():null,h=m?`Send to`:p.textContent;p.onclick=()=>{(async()=>{let t=r(m);if(!(!t||p.disabled)){i([d,p],!0,h);try{await e.j?.(s.id,t)}finally{i([d,p],!1,h)}}})()},u.append(d),f&&u.append(a(p,m,!0));let g=o(s);return g&&u.append(g),c.append(l,u),c},c=()=>{let o=document.createElement(`div`);o.style.cssText=db;let s=document.createElement(`textarea`);s.placeholder=`Add a comment…`,s.rows=3,s.className=`_R`,s.style.cssText=`resize:vertical;`+(se()?`font-size:16px;`:``);let c=document.createElement(`button`);c.type=`button`,c.textContent=`Add`,c.className=`_l`;let l=document.createElement(`button`);l.type=`button`,l.dataset.role=`send`,l.textContent=`Send`;let u=document.createElement(`button`);u.type=`button`,u.textContent=`Cancel`,u.className=`_l`;let d=t().length>0&&!!e.k;l.hidden=!d;let f=d?n():null,p=d?a(l,f,!1):l,m=l.textContent;c.onclick=()=>{s.value.trim()&&e.l?.(s.value)},l.onclick=()=>{(async()=>{let t=s.value.trim(),n=r(f);if(!(!t||!n||l.disabled)){i([c,l,u],!0,m);try{await e.k?.(t,n)}finally{i([c,l,u],!1,m)}}})()},u.onclick=()=>e.m?.(),s.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d?l.onclick():c.onclick()),e.key===`Escape`&&u.onclick()};let h=document.createElement(`div`);h.style.cssText=fb,h.append(c),d&&h.append(p),h.append(u),o.append(s,h);let g=()=>s.scrollIntoView({block:`center`,behavior:`smooth`});return s.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,g),s.addEventListener(`blur`,()=>e.removeEventListener(`resize`,g),{once:!0}))}),setTimeout(()=>{s.scrollIntoView({block:`center`,behavior:`instant`}),s.focus()},0),o},l=new Map,u,d={draft:!0},f,p=new Hv({diffStyle:m()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.n?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?f??=c():s(t.comment)}}),h=()=>{let t=[],n=new Map;for(let r of e.f||[]){let e=l.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return l=n,e.g&&(u!==e.g&&(u=e.g,d={draft:!0},f=void 0),t.push({side:e.g.side,lineNumber:e.g.end,metadata:d})),t},g=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(gb)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,gb,hb()])},_=()=>{if(e.e.old==null&&e.e.new==null){e.o?.(`could not read ${e.e.path}`);return}let t=p.render({containerWrapper:e.a,oldFile:e.e.old==null?null:{name:e.e.oldPath||e.e.path,contents:e.e.old},newFile:e.e.new==null?null:{name:e.e.path,contents:e.e.new},lineAnnotations:h()});Promise.resolve(t).then(()=>{g(),gt(e.a)}).catch(t=>e.o?.(`diff render: ${t}`))};_();let v=new AbortController;return se()&&lb(_b(e),v.signal),{instance:p,render:_,dragAbort:v,unregSearch:ht(e.a,e.e.key),shownFile:e.e,shownComments:e.f,shownDraft:e.g,shownSessions:e.h}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),bb=s(15,yb,10),xb=T(4,bb),Sb=T(5,bb),Cb=T(6,bb),wb=T(7,bb),Tb=T(8,bb),Eb=T(9,bb),Db=T(10,bb),Ob=T(11,bb),kb=T(12,bb),Ab=T(13,bb),jb=T(14,bb),Mb=`<section><div><!><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><!><!><span><span><!> file<!></span><!><!></span></div><!></section>`,Nb=` D D%b%b D D l b D l%l%b%b%b E%c%l%b%m%l`,Pb=e=>j(e.a,[`_fX`,`_fP`]),Fb=e=>j(e.a,[`_fX`,`_fP`]),Ib=e=>j(e.a,[`_fX`,`_fP`]),Lb=e=>j(e.a,[`_w`,`_fM`]),Rb=w(7,0,e=>D(e.b,e._.y)),zb=e=>{Rb._(e),j(e.a,`_p`)},Bb=w(10,0,e=>D(e.b,e._.bu)),Vb=e=>{Bb._(e),j(e.a,[`_F`,Ie.accent,`_fK`])},Hb=w(17,0,e=>D(e.b,e._.bk)),Ub=e=>{Hb._(e),Wb._(e),j(e.a,`_fB`),j(e.c,`_fC`)},Wb=w(17,0,e=>D(e.d,e._.bl)),Gb=s(2,e=>A(e.a,`title`,`${e._.au?`#${e._.au.number}`:e._.ay} is already in ${e._.aw}; showing the working tree only`),2),Kb=w(12,0,Gb),qb=e=>{Kb._(e),Jb._(e),Yb._(e),j(e.a,[`_F`,`_fL`])},Jb=w(12,0,e=>{D(e.b,e._.aw),Gb(e)}),Yb=w(12,0,Gb),Xb=w(3,1,e=>D(e.b,re(e._.b7))),Zb=e=>{Xb._(e),j(e.a,cb)},Qb=w(3,0,e=>D(e.d,e._.b0)),$b=e=>{Qb._(e),ex._(e),tx._(e),nx._(e),j(e.a,[`_p`,`_r`]),j(e.c,cb)},ex=w(3,0,e=>D(e.b,e._.b4)),tx=w(3,0,e=>A(e.a,`href`,`${e._.b6}/files`)),nx=w(3,0,e=>A(e.a,`title`,e._.bv)),rx=w(2,1,e=>D(e.b,e._.b3)),ix=e=>{rx._(e),j(e.a,sb)},ax=s(1,e=>Cb(e.a,e._._._._.ak&&e._._._._.ak.key===e._._.l?e._._._._.ak:null)),ox=E(107,ax,e=>e._._._._),sx=e=>{ox(e),cx(e),ux(e),fx(e),mx(e),hx(e),gx(e),_x(e),vx(e),yx(e),bx(e),xx(e),e.a,vb(e.a,`_fP`)},cx=E(108,e=>wb(e.a,e._._._._.al),e=>e._._._._),lx=s(2,e=>Ab(e.a,bw(e))),ux=E(109,lx,e=>e._._._._),dx=s(3,e=>Ob(e.a,xw(e))),fx=E(110,dx,e=>e._._._._),px=s(4,e=>Db(e.a,Sw(e))),mx=E(111,px,e=>e._._._._),hx=E(112,e=>kb(e.a,Cw(e)),e=>e._._._._),gx=E(113,e=>Tb(e.a,ww(e)),e=>e._._._._),_x=E(114,e=>Eb(e.a,Tw(e)),e=>e._._._._),vx=E(115,e=>jb(e.a,Ew(e)),e=>e._._._._),yx=E(27,e=>{xb(e.a,e._._.k),lx(e),dx(e),px(e)},e=>e._._),bx=E(28,ax,e=>e._._),xx=E(29,e=>Sb(e.a,e._._.x),e=>e._._),Sx=O(`r10`,e=>ne(e,{onMount:function(){e._._._._.v.observeNear(e.a,()=>{kx(e._,!0)})}})),Cx=E(94,Sx,e=>e._._._._),wx=N(0,`<div></div>`,` `,e=>{Cx(e),j(e.a,[`_fR`,`_fP`])},ub,(e=>`/${e}&`)(` b`),sx),Tx=s(3,e=>wx(e,e.b||e.c?1:0)),Ex=T(2,Tx),Dx=s(4,e=>Ex(e,e._._._.ai===e._.l)),Ox=E(105,Dx,e=>e._._._),kx=a(1,Tx),Ax=e=>{Ox(e),jx._(e),kx(e,!1)},jx=w(8,3,Dx),Mx=s(12,e=>A(e.a,`hidden`,!e._._.y.has(e.l))),Nx=E(96,Mx,e=>e._._),Px=N(8,`<p>binary file</p>`,` `,Ib,`<p>file too large to display</p>`,` `,Fb,`<p>file could not be read</p>`,` `,Pb,`<!><!><!>`,`b%`,Ax),Fx=s(26,e=>Px(e,e.t?0:e.u?1:e.v==null&&e.w==null?2:e.z?3:4),4),Ix=a(25,e=>{ge(e,`a`,e.z),Fx(e)}),Lx=O(`r11`,e=>l(e.a,`toggle`,function(t,n){if(Ix(e,n.open),!n.open){let e=n.closest(`[data-diff-main]`);if(e){let t=n.getBoundingClientRect().top-e.getBoundingClientRect().top;t<0&&(e.scrollTop+=t)}}})),Rx=e=>{Nx(e),Hx(e),Gx(e),Kx(e),j(e.b,`_fQ`),j(e.c,`_fV`),Ix(e,!0),Lx(e)},zx=k(xx),Bx=T(23,e=>{Jx(e,e.x.length),zx(e)}),Vx=s(13,e=>Bx(e,e._._.ah.get(e.l)||[])),Hx=E(104,Vx,e=>e._._),Ux=s(14,e=>j(e.a,[`_fO`,e._._.ai===e.l&&`_ft`])),Wx=s(15,e=>j(e.e,[`_fW`,e._._.ai===e.l&&e._._.aj<1&&`_fu`]),2),Gx=E(105,e=>{Ux(e),Wx(e)},e=>e._._),Kx=E(106,Wx,e=>e._._),qx=N(7,`<span>💬 <!></span>`,` Db%`,zb),Jx=T(24,e=>{qx(e,+!e.y),Rb(e)}),Yx=k(bx),Xx=T(11,e=>{A(e.a,`data-key`,e.l),Vx(e),Ux(e),Mx(e),Wx(e),jx(e),Yx(e)}),Zx=(e,t)=>{A(e.c,`data-status`,t),D(e.d,t)},Qx=(e,t)=>{A(e.e,`title`,t),D(e.f,t)},$x=N(6,`<span title="Changed since your last visit"></span>`,` `,Lb),eS=(e,t)=>$x(e,+!t),tS=T(19,Fx),nS=T(20,Fx),rS=T(21,Fx),iS=T(22,Fx),aS=(e,t)=>sS(e,t[0]),oS=k(yx),sS=T(10,e=>{Xx(e,e.k?.key),Zx(e,e.k?.status),Qx(e,e.k?.path),eS(e,e.k?.changedSince),tS(e,e.k?.binary),nS(e,e.k?.tooLarge),rS(e,e.k?.old),iS(e,e.k?.new),oS(e)}),cS=me(1,`<details><summary><span> </span><span><bdi> </bdi></span><!><!></summary><!></details>`,` D D D l E m%b%l%`,Rx,aS),lS=w(19,0,e=>cS(e,[e._.x,`key`])),uS=e=>{lS._(e),pS._(e),mS._(e),j(e.b,`_fN`)},dS=n(2,0),fS=s(3,e=>dS(e,!e._.a5||!e._.a6)),pS=w(19,0,fS),mS=w(19,0,fS),hS=w(18,0,e=>{j(e.a,[`_fE`,{_fD:e._.ad}]),A(e.a,`aria-pressed`,e._.ad?`true`:`false`),A(e.a,`title`,e._.ad?`Show every file`:`Show only files changed since your last visit`)}),gS=O(`r9`,e=>l(e.a,`click`,function(){e._.ae()})),_S=e=>{hS._(e),vS._(e),gS(e)},vS=w(18,0,e=>D(e.b,e._.bn)),yS=s(3,e=>D(e.b,ob(e._.ay,e._.a1,e._.a2)),2),bS=w(13,0,yS),xS=e=>{bS._(e),SS._(e),wS._(e),TS._(e),ES._(e),DS._(e),j(e.a,[`_F`,`_fL`])},SS=w(13,0,yS),CS=s(4,e=>A(e.a,`title`,`This view is ${Ot(e._.b1)} (${e._.ax}); checked out is ${Ot(e._.bc)} (${e._.ay})`),3),wS=w(13,0,CS),TS=w(13,0,e=>{CS(e),yS(e)}),ES=w(13,0,CS),DS=w(13,0,e=>{D(e.c,Ot(e._.bc,7)),CS(e)}),OS=w(11,0,e=>A(e.a,`disabled`,e._.aa)),kS=O(`r8`,e=>l(e.a,`click`,function(){e._.ab()})),AS=e=>{OS._(e),MS._(e),NS._(e),PS._(e),j(e.a,[`_F`,Ie.warn,`_fL`]),kS(e)},jS=s(3,e=>A(e.a,`title`,`origin/${e._.ax} ${e._.b1} · GitHub ${e._.b9}. Reload to re-ask GitHub`),2),MS=w(11,0,jS),NS=w(11,0,e=>{D(e.b,Ot(e._.b1,7)),jS(e)}),PS=w(11,0,e=>{D(e.c,Ot(e._.b9,7)),jS(e)}),FS=s(6,e=>A(e.a,`title`,e._.a6?`Show ${e._.bi} files`:`Hide files`)),IS=s(5,e=>j(e.b,[`_fS`,!e._.a6&&`_fT`,e._.a8&&`_fU`])),LS=w(2,0,e=>{A(e.a,`aria-expanded`,e._.a6?`false`:`true`),D(e.c,e._.a6?`▸`:`▾`),FS(e),IS(e)}),RS=O(`r7`,e=>l(e.a,`click`,function(){e._.a9()})),zS=e=>{LS._(e),BS._(e),VS._(e),HS._(e),j(e.a,`_fy`),j(e.d,sb),RS(e)},BS=w(2,0,e=>{A(e.a,`aria-busy`,e._.a8?`true`:`false`),IS(e)}),VS=w(2,0,e=>D(e.e,e._.b3)),HS=w(2,0,FS),US=(e,t)=>{KS(e,t?.pr),tC(e,t?.base),nC(e,t?.branch),iC(e,t?.head),aC(e,t?.baseSha),oC(e,t?.worktree),sC(e,t?.id),cC(e,t?.full_name),uC(e,t?.githubDrift),pC(e,t?.contained),mC(e,t?.localHead)},WS=N(3,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,$b,`<span> </span>`,` D `,Zb),GS=s(79,e=>A(e.a,`hidden`,!e.bf&&!e.au&&e.a4!==e.b5),3),KS=T(56,e=>{YS(e,e.au?.baseRefName),XS(e,e.au?.headRefName),ZS(e,e.au?.title),QS(e,e.au?.number),$S(e,e.au?.url),eC(e,e.au?.headRefOid),WS(e,+!e.au),GS(e),Kb(e)}),qS=(e,t)=>{IC(e,t?.title),LC(e,t?.base),RC(e,t?.head),BC(e,t?.topic)},JS=s(61,e=>qS(e,ab(e.av||e.aw,e.ax||e.ay,e.a1,e.a2)),5),YS=T(57,JS),XS=T(59,e=>{JS(e),MS(e),wS(e)}),ZS=T(62,Qb),QS=T(66,ex),$S=T(68,tx),eC=T(71,PS),tC=T(58,e=>{JS(e),Jb(e)}),nC=T(60,e=>{JS(e),TS(e),Yb(e)}),rC=s(89,e=>A(e.e,`title`,`${e.bq} · ${e.b1.slice(0,7)}…${e.b2.slice(0,7)}`),2),iC=T(63,e=>{rC(e),NS(e),ES(e)}),aC=T(64,rC),oC=T(65,e=>{VS(e),rx(e)}),sC=T(67,GS),cC=T(69,Xb),lC=N(11,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,AS),uC=(e,t)=>lC(e,+!t),dC=N(12,`<span>already in <!></span>`,` Db%`,qb),fC=s(73,e=>dC(e,e.ba&&e.a0?0:1)),pC=T(72,fC),mC=T(74,DS),hC=T(93,nx),gC=e=>{hC(e,e.au?`${e.au.title}: ${e.au.headRefName} ${e.b1} vs ${e.aw} ${e.b2}`:``)},_C=e=>{A(e.a,`data-pr`,e.au?`${e.b3}/${e.au.number}`:void 0)},vC=T(22,e=>{US(e,e.w),gC(e),_C(e)}),yC=(e,t)=>{PC(e,t?.additions),FC(e,t?.deletions)},bC=(e,t)=>{CC(e,t?.length),yC(e,(()=>{let e=0,n=0;for(let r of t)e+=r.additions||0,n+=r.deletions||0;return{additions:e,deletions:n}})())},xC=T(80,e=>{D(e.p,e.bi),D(e.q,e.bi===1?``:`s`),HS(e)}),SC=s(78,e=>xC(e,e.bf||e.a0)),CC=T(77,e=>{SC(e),GS(e)}),wC=s(25,e=>bC(e,e.x.filter(t=>e.y.has(t.key)))),TC=N(18,`<button type=button><!> new</button>`,` D%`,_S),EC=s(86,e=>TC(e,e.bn||e.ad?0:1)),DC=T(85,e=>{EC(e),vS(e)}),OC=T(23,e=>{jC(e,e.x?.length),DC(e,e.x.filter(e=>e.changedSince).length),wC(e),lS(e)}),kC=k(Nx),AC=T(24,e=>{wC(e),kC(e)}),jC=T(26,e=>{SC(e),fC(e)}),MC=N(17,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,Ub),NC=s(84,e=>MC(e,e.bk||e.bl?0:1)),PC=T(82,e=>{NC(e),Hb(e)}),FC=T(83,e=>{NC(e),Wb(e)}),IC=T(88,rC),LC=(e,t)=>D(e.g,t),RC=(e,t)=>D(e.j,t),zC=N(10,`<span> </span>`,` D `,Vb),BC=T(92,e=>{zC(e,+!e.bu),Bb(e)}),VC=T(27,e=>{JS(e),bS(e)}),HC=T(28,e=>{JS(e),SS(e)});function UC(e){j(e.a,`_fv`),j(e.e,`_fG`),j(e.f,[`_F`,`_fH`]),j(e.h,[`_H`,`_fJ`]),j(e.i,[`_F`,`_fI`]),j(e.o,`_fA`)}var WC=T(30,GS),GC=s(33,e=>j(e.b,[`_fw`,{_fx:e.a5&&e.a6}])),KC=N(2,`<button type=button><span aria-hidden=true> </span><span> </span></button>`,` D D l D `,zS,`<span> </span>`,` D `,ix),qC=N(19,`<!><!><div></div><!><!>`,`b%b b%`,uS),JC=s(42,e=>qC(e,!e.a5||!e.a6||e.af?0:1),2),YC=T(31,e=>{KC(e,+!e.a5),GC(e),JC(e),pS(e)}),XC=T(32,e=>{GC(e),JC(e),LS(e),mS(e)}),ZC=N(13,`<span>local <!> <!></span>`,` Db%c%`,xS),QC=(e,t)=>ZC(e,+!t),$C=T(39,e=>{EC(e),hS(e)}),ew=T(41,JC),tw=k(Cx),nw=T(21,e=>{vC(e,e.v.repo),OC(e,e.v.files),AC(e,e.v.shownKeys),VC(e,e.v.workspaceBranch),HC(e,e.v.workspaceName),WC(e,e.v.findHit?.repo),rw(e,e.v.findHit?.key),iw(e,e.v.findHit?.line),YC(e,e.v.collapsible),XC(e,e.v.collapsed),aw(e,e.v.expanding),ow(e,e.v.onToggle),sw(e,e.v.loading),cw(e,e.v.onReload),QC(e,e.v.localDiffers),$C(e,e.v.onlyNew),lw(e,e.v.onToggleNew),ew(e,e.v.opened),uw(e,e.v.commentsByFile),dw(e,e.v.draft),fw(e,e.v.sessions),pw(e,e.v.onSelect),mw(e,e.v.onSaveComment),hw(e,e.v.onSendDraft),gw(e,e.v.onCancelDraft),_w(e,e.v.onDeleteComment),vw(e,e.v.onSendComment),yw(e,e.v.onError),tw(e)}),rw=T(44,k(Gx,Ox)),iw=T(45,k(Kx)),aw=T(34,BS),ow=T(35),sw=T(36,OS),cw=T(37),lw=T(40),uw=T(43,k(Hx)),dw=T(46,k(ox)),fw=T(47,k(cx)),pw=T(48,k(ux)),mw=T(49,k(fx)),hw=T(50,k(mx)),gw=T(51,k(hx)),_w=T(52,k(gx)),vw=T(53,k(_x)),yw=T(54,k(vx));function bw(e){return function(t){e._._._._.am(e._._.k,t)}}function xw(e){return function(t){e._._._._.an(e._._.k,t)}}function Sw(e){return function(t,n){e._._._._.ao(e._._.k,t,n)}}function Cw(e){return function(){e._._._._.ap()}}function ww(e){return function(t){e._._._._.aq(t)}}function Tw(e){return function(t,n){e._._._._.ar(t,n)}}function Ew(e){return function(t){e._._._._.as(t)}}b(`r0`,bw),b(`r1`,xw),b(`r2`,Sw),b(`r3`,Cw),b(`r4`,ww),b(`r5`,Tw),b(`r6`,Ew);var Dw=`_gu _i`,Ow=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,kw=` D l`,Aw=s(18,e=>ke(e,`b`,e.l,Kw(e))),jw=T(11,Aw),Mw=s(10,e=>jw(e,(e.j??e.h)||``)),Nw=T(17,Aw),Pw=s(16,e=>Nw(e,qw(e))),Fw=T(15,Pw),Iw=s(14,e=>Fw(e,Jw(e)),2),Lw=Ke(7,e=>{Mw(e),Iw(e)}),Rw=s(6,e=>Lw(e,e.e,e.f)),zw=T(4,Rw),Bw=T(5,Rw),Vw=a(9,e=>{Mw(e),Iw(e)}),Hw=(e,t)=>Gw(e,t.timer),Uw=O(`k3`,e=>{He(e,`b`),l(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function Ww(e){j(e.a,`_gt`),j(e.b,Dw),Vw(e,null),Hw(e,{timer:0}),Uw(e)}var Gw=T(13,e=>{Iw(e),Pw(e)});function Kw(e){return function(t){e.r(t)}}function qw(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,Vw(e,null),Lw(e,``);return}Vw(e,t),e.n=setTimeout(e.p,150)}}function Jw(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;Vw(e,null),Lw(e,t)}}b(`k0`,Kw),b(`k2`,qw),b(`k1`,Jw);var Yw=(e=>`<aside><div>${e}</div><!><!></aside>`)(Ow),Xw=(e=>` D D/${e}&l%b%l`)(kw),Zw=e=>j(e.a,`_fb`),Qw=e=>j(e.a,[`_w`,`_fa`]),$w=e=>j(e.a,`_e5`),eT=N(6,`<span>💬</span>`,` `,Zw),tT=s(7,e=>eT(e,+!e._._._._.a6.has(e._.i))),nT=E(38,tT,e=>e._._._._),rT=e=>{nT(e),oT(e),cT(e),lT._(e),uT._(e),dT._(e),fT._(e),pT._(e),j(e.a,`_e9`),j(e.b,`_fd`),j(e.d,`_e_`)},iT=N(5,`<span title="Changed since your last visit"></span>`,` `,Qw),aT=s(8,e=>iT(e,+!e._._._._.a7.has(e._.i))),oT=E(39,aT,e=>e._._._._),sT=s(9,e=>A(e.a,`href`,e._._._._.a8(e._.i))),cT=E(40,sT,e=>e._._._._),lT=w(0,1,e=>Fe(e.a,`padding-left:${.5+e._.f*.75}rem`)),uT=w(0,1,e=>{sT(e),aT(e),tT(e)}),dT=w(0,1,e=>A(e.a,`title`,e._.j)),fT=w(0,1,e=>{A(e.b,`data-status`,e._.k),D(e.c,e._.k)}),pT=w(0,1,e=>D(e.e,e._.l)),mT=s(4,e=>{j(e.a,[`_e8`,{_e2:e._._._._.a5.has(e._._.f(e._.e))}]),D(e.c,e._._._._.a5.has(e._._.f(e._.e))?`▸`:`▾`)},2),hT=E(37,mT,e=>e._._._._),gT=O(`i5`,e=>l(e.a,`click`,function(){let t=new Set(e._._._._.a5);t.delete(e._._.f(e._.e))||t.add(e._._.f(e._.e)),bE(e._._._._,t)})),_T=e=>{hT(e),vT(e),yT._(e),bT._(e),xT._(e),j(e.b,`_fc`),gT(e)},vT=E(10,mT,e=>e._._),yT=w(0,0,e=>{A(e.a,`title`,e._.e),mT(e)}),bT=w(0,0,e=>Fe(e.a,`padding-left:${.35+e._.f*.75}rem`)),xT=w(0,0,e=>D(e.d,e._.g)),ST=N(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,_T,`<a><span> </span><span> </span><!><!></a>`,` D D l D l%b%`,rT),CT=s(3,e=>ST(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),wT=Ye(1,CT),TT=wT,ET=T(2,e=>{OT(e,e.c?.path),kT(e,e.c?.depth),AT(e,e.c?.label),jT(e,e.c?.file?.key),MT(e,e.c?.file?.path),NT(e,e.c?.file?.status),PT(e,e.c?.name),CT(e)}),DT=(e,t)=>ET(e,t[0]),OT=T(4,yT),kT=T(5,e=>{bT(e),lT(e)}),AT=T(6,xT),jT=T(8,uT),MT=T(9,dT),NT=T(10,fT),PT=T(11,pT),FT=n(3,0,2),IT=s(9,e=>FT(e,!e._._.y.has(e._.i))),LT=E(35,IT,e=>e._._),RT=T(8,wT),zT=s(7,e=>RT(e,PE(e)),2),BT=T(6,zT),VT=e=>{LT(e),HT(e),WT._(e),qT._(e),BT(e,FE)},HT=E(37,zT,e=>e._._),UT=T(5,k(vT)),WT=w(5,0,e=>{UT(e,IE(e)),zT(e),IT(e)}),GT=me(1,`<!><!><!>`,`b%`,TT,DT),KT=(e,t)=>GT(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),qT=w(5,0,e=>KT(e,Mt(e._.m))),JT=s(9,e=>{j(e.b,[`_e7`,{_e2:e._.y.has(e.i)}]),D(e.d,e._.y.has(e.i)?`▸`:`▾`)}),YT=N(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,VT),XT=s(10,e=>YT(e,!e._.y.has(e.i)||e._.a0.has(e.i)?0:1),2),ZT=Ye(4,e=>{JT(e),XT(e)}),QT=O(`i6`,e=>l(e.b,`click`,function(){let t=e.i,n=new Set(e._.y);n.delete(t)||(uE(e._,new Set([...e._.a0,t])),n.add(t)),oE(e._,n)})),$T=e=>{ZT._(e),eE._(e),j(e.a,`_e6`),j(e.c,`_fc`),QT(e)},eE=Ye(4,XT),tE=T(8,e=>{JT(e),XT(e),WT(e)}),nE=(e,t)=>D(e.e,t),rE=(e,t)=>{tE(e,t[0]?.id),nE(e,t[0]?.label),iE(e,t[0]?.files)},iE=T(12,qT),aE=k(LT),oE=Ke(24,e=>{ZT(e),aE(e)}),sE=s(9,e=>oE(e,e.h,e.i)),cE=T(7,sE),lE=T(8,sE),uE=Ke(26,eE),dE=s(12,e=>uE(e,e.k,e.l)),fE=T(10,dE),pE=T(11,dE),mE=N(3,`<p>No files match.</p>`,` `,$w),hE=s(30,e=>mE(e,!e.x&&e.a2?0:1)),gE=Ke(28,e=>{zw(e.c,e.a2),hE(e)}),_E=s(15,e=>gE(e,e.n,e.o)),vE=T(13,_E),yE=T(14,_E),bE=a(31,k(HT,hT));function xE(e){j(e.b,`_e4`),Ww(e.c),Bw(e.c,LE(e)),bE(e,new Set)}var SE=T(32,k(nT)),CE=(e,t)=>SE(e,t||new Set),wE=T(33,k(oT)),TE=(e,t)=>wE(e,t||new Set),EE=T(34,k(cT)),DE=s(20,e=>EE(e,RE(e))),OE=T(18,DE),kE=T(19,DE),AE=(e,t)=>j(e.a,[`_e3`,{_e2:t===!1}]),jE=T(23,hE),ME=me(4,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,$T,rE),NE=(e,t)=>{jE(e,t?.length),ME(e,[t,`id`])};function PE(e){return t=>{let n=e.g(t);for(let r of e._._.a5){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function FE(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function IE(e){return t=>`${e._.i}/${t}`}function LE(e){return t=>{gE(e,t)}}function RE(e){return t=>oe({workspaceId:e.s,view:`diff`,scope:e.t??null,file:t})}b(`i4`,PE),b(`i3`,FE),b(`i2`,IE),b(`i1`,LE),b(`i0`,RE);var zE=`<!><!><!>`,BE=e=>j(e.a,`_fq`),VE=e=>j(e.a,[`_w`,`_fr`]),HE=w(4,0,e=>D(e.b,e._.s)),UE=e=>{HE._(e),j(e.a,`_fn`)},WE=N(8,`<span>💬</span>`),GE=s(12,e=>WE(e,+!e._._.w.has(e.l))),KE=E(30,GE,e=>e._._),qE=O(`e3`,e=>l(e.a,`click`,function(){vD(e._._,!1)})),JE=e=>{KE(e),ZE(e),$E(e),nD(e),j(e.a,[`_fl`,`_u`]),j(e.b,`_fs`),j(e.d,`_fm`),j(e.f,`_fo`),qE(e)},YE=N(7,`<span title="Changed since your last visit"></span>`,` `,VE),XE=s(13,e=>YE(e,+!e._._.x.has(e.l))),ZE=E(31,XE,e=>e._._),QE=s(14,e=>A(e.a,`href`,e._._.z(e.l))),$E=E(33,QE,e=>e._._),eD=(e,t)=>{iD(e,t?.dir),aD(e,t?.name)},tD=s(15,e=>eD(e,e._._.a0(e.l))),nD=E(34,tD,e=>e._._),rD=N(4,`<span><bdi><!>/</bdi></span>`,` E%`,UE),iD=T(18,e=>{rD(e,+!e.s),HE(e)}),aD=(e,t)=>D(e.g,t),oD=T(11,e=>{tD(e),QE(e),XE(e),GE(e)}),sD=(e,t)=>{A(e.b,`data-status`,t),D(e.c,t)},cD=me(12,`<a><span> </span><span><!><span><bdi> </bdi></span></span><!><!></a>`,` D D l D%b E n%b%`,JE,(e,t)=>{oD(e,t[0]?.key),sD(e,t[0]?.status)}),lD=w(0,0,e=>cD(e,[e._.m,`key`])),uD=O(`e4`,e=>{l(e.a,`click`,function(){vD(e._,!1)}),l(e.h,`click`,function(){vD(e._,!1)})}),dD=e=>{lD._(e),mD._(e),hD._(e),gD._(e),j(e.a,`_fg`),j(e.b,`_fh`),j(e.c,`_fi`),j(e.d,`_ff`),j(e.e,`_fj`),j(e.h,[d,`_fe`]),r(e.i),Xe(e.i,16),C(e.i),j(e.j,`_fp`),Ww(e.k),Bw(e.k,VD(e)),j(e.l,`_fk`),uD(e)},fD=N(13,`<p>No files match.</p>`,` `,BE),pD=s(14,e=>D(e.g,e._.n===e._.y?``:` / ${e._.y}`)),mD=w(0,0,e=>{D(e.f,e._.n),fD(e,+!!e._.n),pD(e)}),hD=w(0,0,e=>zw(e.k,e._.u)),gD=w(0,0,pD),_D=N(0,((e,t)=>`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>${e}</button></div><div>${t}</div><div><!><!></div></div>`)(ie,Ow),((e,t)=>` b D D b D%b%l D/${e}&m D/${t}&l D%b%m`)(f,kw),dD),vD=Ke(18,e=>_D(e,+!e.s)),yD=s(5,e=>vD(e,e.d,e.e)),bD=T(3,yD),xD=T(4,yD),SD=Ke(20,hD),CD=s(8,e=>SD(e,e.g,e.h)),wD=T(6,CD),TD=T(7,CD),ED=T(22,k(KE)),DD=(e,t)=>ED(e,t||new Set),OD=T(23,k(ZE)),kD=(e,t)=>OD(e,t||new Set),AD=T(24,gD),jD=s(14,e=>AD(e,e.l??e.n)),MD=T(11,jD),ND=T(13,e=>{jD(e),mD(e)}),PD=T(25,k($E)),FD=s(17,e=>PD(e,HD(e))),ID=T(15,FD),LD=T(16,FD),RD=T(26);function zD(e){RD(e,UD)}var BD=T(12,e=>{ND(e,e.m?.length),lD(e)});function VD(e){return t=>{SD(e._,t)}}function HD(e){return t=>oe({workspaceId:e.p,view:`diff`,scope:e.q??null,file:t})}function UD(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t),name:e.slice(t+1)}}b(`e2`,VD),b(`e0`,HD),b(`e1`,UD);var WD=((e,t,n,r)=>`<div><div><div><div><!><h1>Review</h1><!><!></div><div><!><button title="Refresh diff">${e}</button><!><div role=group aria-label="Review scope"><button type=button title="Committed changes only (base…tip, no working-tree edits)">Committed</button><button type=button title="Committed changes plus uncommitted and untracked files">Working tree</button><button type=button title="Only uncommitted and untracked files, against HEAD">Uncommitted</button></div><span><select aria-label="Review scope"><option value=committed>Committed</option><option value=working>Working tree</option><option value=dirty>Uncommitted</option></select></span><div>${t}</div><!></div></div><div data-diff-main><!><!><!><!><!></div></div>${n}${r}</div>`)(te,ny,Yw,zE),GD=((e,t,n,r)=>` D D D D%b b%b%l D%b D/${e}&l%b D b b l D l D/${t}&l%m D%b%b%b%b%m/${n}&/${r}&l`)(c,ry,Xw,`b%c`),KD=e=>{j(e.a,`_ew`),j(e.b,[`_ex`,`_ey`]),j(e.c,[`_ex`,`_ez`]),j(e.d,[`_ex`,`_eA`]),j(e.e,[`_ex`,`_ez`]),j(e.f,[`_ex`,`_eA`])},qD=w(21,0,e=>A(e.a,`hidden`,e._.b3)),JD=O(`j44`,e=>l(e.a,`click`,function(){e._.dg()})),YD=e=>{qD._(e),j(e.a,[h,`_ek`,`_eb`]),Ae(e.b),Pe(e.b,14),be(e.b),JD(e)},XD=w(12,0,e=>D(e.b,e._.cp)),ZD=O(`j43`,e=>l(e.a,`click`,function(){kA(e._,!0)})),QD=e=>{XD._(e),j(e.a,[`_l`,`_eB`]),ZD(e)},$D=w(9,0,e=>{j(e.a,[Nt,`_eb`,{_ea:e._.b1}]),A(e.a,`title`,e._.b1?`Hide file tree`:`Show file tree`)}),eO=O(`j42`,e=>l(e.a,`click`,function(){OA(e._,!e._.b1),ye(e._.b1)})),tO=e=>{$D._(e),he(e.b),ze(e.b,14),Ne(e.b),eO(e)},nO=s(2,e=>D(e.b,e._.b0===`dirty`?`Nothing uncommitted.`:e._.cf.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),rO=w(26,0,nO),iO=e=>{rO._(e),aO._(e),j(e.a,`_bB`)},aO=w(26,0,nO),oO=E(164,e=>D(e.b,e._._.b0===`committed`?``:`, showing uncommitted changes only`),e=>e._._),sO=e=>{oO(e),cO(e)},cO=E(5,e=>D(e.a,e._.e)),lO=ue(`j46`,`<!><!>.`,`%b%`,sO),uO=e=>{x(e.a),y(e.a,lO(e)),Ee(e.a,`warn`),_(e.a,`inline`),o(e.a),t(e.a),v(e.a),De(e.a,{})},dO=(e,t)=>p(e.a,`${t}: base not found`),fO=(e,t)=>{dO(e,t[0]?.worktree),pO(e,t[0]?.base)},pO=T(4,k(cO)),mO=s(2,e=>D(e.b,e._.ba.trim()?`No matches in review.`:e._.az&&!e._.ax?`Nothing changed since your last visit.`:`No files match "${e._.ax}".`),2),hO=w(26,1,mO),gO=e=>{hO._(e),_O._(e),vO._(e),j(e.a,`_bB`)},_O=w(26,1,mO),vO=w(26,1,mO),yO=E(160,e=>D(e.a,e._._.au),e=>e._._),bO=ue(`j45`,` `,` `,yO),xO=e=>{x(e.a),y(e.a,bO(e)),v(e.a,nM(e)),o(e.a),t(e.a),Ee(e.a),_(e.a),p(e.a),De(e.a,{})},SO=w(6,0,e=>{D(e.b,e._.as),D(e.c,e._.as===1?``:`s`)}),CO=e=>{SO._(e),j(e.a,`_ei`)},Q=s(1,e=>nw(e.a,{repo:e._.c,files:e._.g,shownKeys:e._._.cr,collapsible:e._._.cg>1,collapsed:e._._.be.has(e._.c?.id),expanding:e._._.bg.has(e._.c?.id),opened:e._._.bf.has(e._.c?.id),onToggle:dM(e),workspaceBranch:e._._.an||``,workspaceName:e._._.ao||``,localDiffers:e._._.cz.has(e._.c?.id),onlyNew:e._._.az,onToggleNew:uM(e),onReload:e._._.ca,loading:e._._.av,findHit:e._._.bc,commentsByFile:e._._.cw,draft:e._._.at,sessions:e._._.am||[],observeNear:e._._.bn,onSelect:lM(e),onSaveComment:cM(e),onSendDraft:sM(e),onCancelDraft:oM(e),onDeleteComment:aM(e),onSendComment:iM(e),onError:rM(e)}),22),wO=E(155,Q,e=>e._._),TO=e=>{wO(e),EO(e),DO(e),OO(e),kO(e),AO(e),jO(e),MO(e),NO(e),PO(e),FO(e),IO(e),LO(e),RO(e),zO(e),BO(e),VO(e),HO(e),UO(e),WO(e),GO(e),KO._(e),qO._(e),UC(e.a)},EO=E(156,Q,e=>e._._),DO=E(157,Q,e=>e._._),OO=E(159,Q,e=>e._._),kO=E(161,Q,e=>e._._),AO=E(163,Q,e=>e._._),jO=E(168,Q,e=>e._._),MO=E(169,Q,e=>e._._),NO=E(170,Q,e=>e._._),PO=E(171,Q,e=>e._._),FO=E(172,Q,e=>e._._),IO=E(173,Q,e=>e._._),LO=E(175,Q,e=>e._._),RO=E(177,Q,e=>e._._),zO=E(179,Q,e=>e._._),BO=E(180,Q,e=>e._._),VO=E(182,Q,e=>e._._),HO=E(183,Q,e=>e._._),UO=E(186,Q,e=>e._._),WO=E(187,Q,e=>e._._),GO=E(188,Q,e=>e._._),KO=w(0,0,Q),qO=w(0,0,Q),JO=T(6,e=>{tk(e,e.g.length),qO(e)}),YO=s(4,e=>JO(e,e._.ct.get(e.d)||[])),XO=Ye(27,YO),ZO=e=>{XO._(e),ek._(e)},QO=N(0,Mb,(e=>`/${e}&`)(Nb),TO),$O=s(8,e=>QO(e,e.h||e.f&&e._.d0?0:1),2),ek=Ye(27,$O),tk=T(7,$O),nk=T(3,YO),rk=T(5,$O),ik=(e,t)=>ak(e,t[0]),ak=T(2,e=>{nk(e,e.c?.id),rk(e,e.c?.pr),KO(e)}),ok=w(7,0,e=>fn(e.b,e._.am)),sk=e=>{ok._(e),ck._(e),lk._(e),j(e.a,`_eh`),on(e.b)},ck=w(7,0,e=>pn(e.b,e._.dc)),lk=w(7,0,e=>mn(e.b,e._.dd)),uk=w(4,0,e=>A(e.a,`href`,`/w/${e._.ad}`)),dk=e=>{uk._(e),j(e.a,[h,`_eg`]),Je(e.b),Ue(e.b,14),le(e.b)},fk=(e,t)=>{TE(e.a2,t),kD(e.a3,t)},pk=T(125,k(RO)),mk=(e,t)=>NE(e.a2,t),hk=s(129,e=>mk(e,e.cf.filter(t=>(e.cu.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.cu.get(t.id)||[]})))),gk=T(128,hk),_k=s(122,e=>gk(e,new Map(e.cf.map(t=>[t.id,e.cn.filter(e=>e.repo===t.id)])))),vk=T(121,e=>{BD(e.a3,e.cn),qj(e,e.cn?.length),pk(e,new Set(e.cn.map(e=>e.key))),_k(e)}),yk=s(120,e=>vk(e,e.cl?e.ck.filter(t=>e.cl.has(t.key)||t.key===e.bd):e.ck),2),bk=T(118,e=>{By(e.u,e.ck),yk(e)}),xk=s(116,e=>bk(e,(()=>{let t=tt(e.ax);return e.ch.filter(n=>t(n.key)&&(!e.az||n.changedSince))})()),2),Sk=T(115,e=>{Kj(e,e.ch?.length),e.ch.filter(e=>e.changedSince).length,fk(e,new Set(e.ch.filter(e=>e.changedSince).map(e=>e.key))),xk(e)}),Ck=T(133,k(BO)),wk=T(138,k(VO)),Tk=s(137,e=>wk(e,fM(e)),4),Ek=T(149,k(WO)),Dk=s(145,e=>Ek(e,pM(e)),4),Ok=T(136,e=>{Tk(e),Dk(e)}),kk=me(25,u,(e=>`/${e}&`)(g),uO,fO),Ak=me(27,`<!><!><!>`,`b%`,ZO,ik),jk=T(113,e=>{Gj(e,e.cf.length),Sk(e,e.cf.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Ck(e,new Set(e.cf.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),Ok(e,mM(e)),kk(e,[e.cf.filter(e=>e.baseMissing),`id`]),Ak(e,[e.cf,`id`]),_k(e),hk(e),aO(e)}),Mk=O(`j49`,e=>ne(e,{active:e.ah,load:e.c1,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.ae||``,lastNonce:e.ai||0,lastFileNonce:e.aj||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,Be().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.ad&&e.c9()},{signal:t.signal}),Be().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.av)return;let r=t.data,i=r&&r[e.ad];if(!i)return;let a=et(i);!a||!e.bw||a===e.bw||e.cc()},{signal:t.signal}),window.addEventListener(`pagehide`,()=>{this.active&&n.loaded&&e.cd()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.ca(),!this.active&&this.loaded&&this.wasActive&&e.cd(),this.wasActive=!!this.active;let t=e.ae||``,n=e.ai||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bq(t)):(this.lastPr=t,this.lastNonce=n);let r=e.aj||0;this.loaded&&e.af&&r!==this.lastFileNonce&&e.bu(e.af),this.lastFileNonce=r,e.a6&&e.a6!==e.b0&&e.c4(e.a6,!1)},onDestroy:function(){e.bx&&clearTimeout(e.bx),this.loaded&&e.cd(),this.abort.abort()}})),$=s(112,Mk,18),Nk=s(103,e=>ve(e,`s`,e.b0,hM(e))),Pk=T(102,e=>{$(e),Nk(e)}),Fk=s(101,e=>Pk(e,gM(e)),2),Ik=T(110,$),Lk=s(109,e=>Ik(e,_M(e))),Rk=k(IO),zk=T(108,e=>{Lk(e),$(e),Rk(e)}),Bk=s(100,e=>zk(e,vM(e))),Vk=T(99,e=>{Fk(e),Bk(e),$(e)}),Hk=s(98,e=>Vk(e,yM(e)),7),Uk=T(88,e=>{Hk(e),$(e)}),Wk=s(87,e=>Uk(e,bM(e)),3),Gk=T(111,$),Kk=s(52,e=>Gk(e,xM(e))),qk=T(127,XO),Jk=e=>{qk(e,new Map(e.cf.map(t=>[t.id,e.ch.filter(e=>e.repo===t.id)])))},Yk=N(9,(e=>`<button>${e}</button>`)(Oe),(e=>` D/${e}&l`)(Ve),tO),Xk=N(12,`<button title="Jump to file">Files (<!>)</button>`,` Db%`,QD),Zk=N(21,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(Ce),(e=>` D/${e}&l`)(Se),YD),Qk=T(134,e=>{Yk(e,+!e.d0),Xk(e,+!e.d0),Zk(e,+!e.d0),ek(e)}),$k=e=>{Qk(e,!e.ap||e.cj>0)},eA=T(146,ck),tA=T(147,lk),nA=T(148,k(UO)),rA=s(144,e=>{eA(e,SM(e)),tA(e,CM(e)),nA(e,wM(e))}),iA=T(143,e=>{rA(e),Dk(e)}),aA=s(141,e=>iA(e,TM(e)),4),oA=N(24,`<div aria-hidden=true><div></div><div></div><div></div><div></div><div></div></div>`,` D b b b b `,KD),sA=s(58,e=>oA(e,!e.ap&&e.av?0:1)),cA=N(26,`<p> </p>`,` D `,iO,`<p> </p>`,` D `,gO),lA=s(124,e=>cA(e,e.ap&&!e.cj?0:e.ap&&!e.cp&&!e.bc?1:2),3),uA=a(51,e=>{jk(e,e.ap||[]),Wk(e),Kk(e),Jk(e),$k(e),aA(e),sA(e),lA(e)}),dA=(e,t)=>{CE(e.a2,t),DD(e.a3,t)},fA=k(zO),pA=T(130,e=>{dA(e,new Set(e.cw.keys())),fA(e)}),mA=T(142,k(HO)),hA=s(140,e=>mA(e,EM(e))),gA=a(53,e=>{nj(e,e.ar?.length),pA(e,(()=>{let t=new Map;for(let n of e.ar){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),Tk(e),hA(e),aA(e),rA(e)}),_A=k(OO),vA=a(55,e=>{Tk(e),Dk(e),_A(e)}),yA=N(23,u,(e=>`/${e}&`)(g),xO),bA=k(yO),xA=a(56,e=>{yA(e,+!e.au),bA(e)}),SA=k(kO),CA=a(57,e=>{A(e.k,`disabled`,e.av),ee(e.l,e.av&&`_B`),A(e.o,`disabled`,e.av),A(e.p,`disabled`,e.av),A(e.q,`disabled`,e.av),A(e.s,`disabled`,e.av),$(e),sA(e),SA(e)}),wA=a(59,e=>{vE(e.a2,e.ax),wD(e.a3,e.ax),xk(e),hO(e)}),TA=(e,t)=>{yE(e.a2,t),TD(e.a3,t)},EA=k(AO),DA=a(61,e=>{xk(e),EA(e),_O(e)}),OA=a(63,e=>{AE(e.a2,e.b1),$D(e)}),kA=a(64,e=>bD(e.a3,e.b2)),AA=T(119,yk),jA=e=>{AA(e,e.ba.trim()?new Set(e.bb):null)},MA=a(71,e=>{bj(e,e.b9?.query),xj(e,e.b9?.keys),Cj(e,e.b9?.hit),jA(e)}),NA=T(153,k(GO)),PA=s(79,e=>NA(e,OM(e)),2),FA=k(MO),IA=a(76,e=>{cE(e.a2,e.be),Wk(e),PA(e),FA(e)}),LA=k(NO),RA=a(77,e=>{fE(e.a2,e.bf),Wk(e),PA(e),LA(e)}),zA=k(PO),BA=a(78,e=>{PA(e),zA(e)}),VA=(e,t)=>{Dj(e,t.cbs),Oj(e,t.io),kj(e,t.root)},HA=T(92,e=>{Hk(e),$(e)}),UA=s(91,e=>HA(e,kM(e)),2),WA=T(152,e=>Ey(e.u,AM(e))),GA=s(90,e=>WA(e,jM(e))),KA=T(86,e=>{Wk(e),UA(e),GA(e)}),qA=T(89,e=>{UA(e),GA(e)}),JA=(e,t)=>{jj(e,t.sig),Mj(e,t.timer)},YA=(e,t)=>Nj(e,t.seq),XA=(e,t)=>Vj(e,t.busy),ZA=T(135,e=>{Tk(e),Dk(e)}),QA=O(`j47`,e=>{l(e.k,`click`,function(){e.ca()}),l(e.o,`click`,function(){e.c4(`committed`)}),l(e.p,`click`,function(){e.c4(`working`)}),l(e.q,`click`,function(){e.c4(`dirty`)}),xe(e,`s`)});function $A(e){j(e.a,`_d_`),j(e.b,`_ee`),j(e.c,`_ef`),j(e.f,`_ej`),j(e.i,`_ed`),j(e.k,[h,`_eb`]),Ge(e.l),i(e.l,14),j(e.n,`_eq`),j(e.r,[`_j`,`_et`]),j(e.s,[`_k`,`_eu`]),Ry(e.u),py(e.u,RM(e)),xy(e.u),Sy(e.u),Ty(e.u),j(e.w,`_en`),xE(e.a2),lE(e.a2,LM(e)),pE(e.a2,IM(e)),zD(e.a3),xD(e.a3,FM(e)),uA(e,null),gA(e,[]),vA(e,null),xA(e,null),CA(e,!1),wA(e,``),TA(e,DM(e)),DA(e,!1),OA(e,S()),kA(e,!1),MA(e,{query:``,hit:null,keys:[]}),IA(e,new Set),RA(e,new Set),BA(e,new Set),VA(e,{io:null,root:null,cbs:null}),KA(e,MM(e)),qA(e,NM(e)),JA(e,{sig:``,timer:0}),YA(e,{seq:0}),XA(e,{busy:0}),ZA(e,PM),QA(e)}var ej=N(6,`<span><!> comment<!></span>`,` D%c%`,CO),tj=N(7,(e=>`<span>${e}</span>`)(Pt),(e=>` D/${e}&l`)(Ft),sk),nj=T(54,e=>{j(e.d,[`_ep`,{_eo:!e.as}]),ej(e,+!e.as),tj(e,+!e.as),SO(e)}),rj=k(oO),ij=a(62,e=>{j(e.o,[`_es`,{_er:e.b0===`committed`}]),A(e.o,`aria-pressed`,e.b0===`committed`?`true`:`false`),j(e.p,[`_es`,{_er:e.b0===`working`}]),A(e.p,`aria-pressed`,e.b0===`working`?`true`:`false`),j(e.q,[`_es`,{_er:e.b0===`dirty`}]),A(e.q,`aria-pressed`,e.b0===`dirty`?`true`:`false`),kE(e.a2,e.b0),LD(e.a3,e.b0),Hk(e),Fk(e),Bk(e),$(e),Nk(e),rj(e),rO(e)}),aj=T(32,e=>{ij(e,e.a6??ce()),$(e)}),oj=Ke(65,e=>{j(e.t,[`_em`,{_el:!e.b3}]),fy(e.u,e.b3),qD(e)}),sj=s(35,e=>oj(e,e.a7,e.a8)),cj=T(33,sj),lj=T(34,sj),uj=O(`j50`,e=>{e.aa!=null&&e.aa!==e.b5&&gj(e,e.aa)}),dj=s(68,uj),fj=O(`j48`,e=>{e.ah&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.dg()))},{capture:!0,signal:Te(e,0)})}),pj=s(151,e=>{fe(e,0),fj(e)}),mj=T(150,pj),hj=s(70,e=>mj(e,zM(e))),gj=a(67,e=>{Jy(e.u,e.b5),dj(e),hj(e)}),_j=T(36,e=>{gj(e,e.aa||0),dj(e)}),vj=T(69,e=>{qy(e.u,e.b7),hj(e)}),yj=(e,t)=>vj(e,t||{focus:BM}),bj=T(72,vO),xj=T(73),Sj=k(jO),Cj=T(74,e=>{wj(e,e.bc?.key),lA(e),Sj(e)}),wj=T(75,yk),Tj=T(85),Ej=s(84,e=>Tj(e,VM(e)),2),Dj=T(81,Ej),Oj=T(82,Ej),kj=T(83,Ej),Aj=T(38,UA),jj=T(94,e=>{Hk(e),$(e)}),Mj=T(95,e=>{Lk(e),$(e)}),Nj=T(97,Hk),Pj=T(139,e=>{hA(e),aA(e)}),Fj=T(107,$),Ij=s(106,e=>Fj(e,UM(e))),Lj=T(39,e=>{OE(e.a2,e.ad),ID(e.a3,e.ad),Pj(e,HM(e)),Hk(e),Ij(e),Kk(e),$(e),Tk(e),Dk(e),uk(e)}),Rj=T(40,e=>{Hk(e),$(e)}),zj=T(41,e=>{Hk(e),$(e)}),Bj=T(42,Fk),Vj=T(105,e=>{Ij(e),aA(e)}),Hj=T(43,e=>{$(e),pj(e)}),Uj=T(44,$),Wj=T(45,$),Gj=T(114,k(LO)),Kj=T(117,e=>{MD(e.a3,e.cj),lA(e)}),qj=T(123,e=>{lA(e),XD(e)}),Jj=T(46,aA),Yj=N(4,(e=>`<a title="Back to terminal (Esc)">${e}</a>`)(pe),(e=>` D/${e}&l`)(qe),dk),Xj=(e,t)=>Yj(e,+!t),Zj=(e,t)=>{aj(e,t.scope),cj(e,t.findOpen),lj(e,t.findOpenChange),_j(e,t.findTick),yj(e,t.findFocusRef),Aj(e,t.onFileChange),Lj(e,t.workspaceId),Rj(e,t.focusPr),zj(e,t.focusFile),Bj(e,t.onScopeChange),Hj(e,t.active),Uj(e,t.focusNonce),Wj(e,t.focusFileNonce),Jj(e,t.onSent),Xj(e,t.onExit),$j(e,t.sessions),eM(e,t.workspaceBranch),tM(e,t.workspaceName)},Qj=k(wO),$j=T(48,e=>{ok(e),Qj(e)}),eM=T(49,k(EO)),tM=T(50,k(DO));function nM(e){return function(){xA(e._,null)}}function rM(e){return function(t){xA(e._._,t)}}function iM(e){return function(t,n){e._._.de(t,n)}}function aM(e){return function(t){e._._.d8(t)}}function oM(e){return function(){vA(e._._,null)}}function sM(e){return function(t,n,r){e._._.df(t,n,r)}}function cM(e){return function(t,n){e._._.d4(t,n)}}function lM(e){return function(t,n){vA(e._._,{key:t.key,side:n.side||`additions`,start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)})}}function uM(e){return function(){DA(e._._,!e._._.az)}}function dM(e){return function(){e._._.dj(e._.c?.id)}}function fM(e){return async(t,n)=>{let r=e.at;if(vA(e,null),r)try{let i=await Me(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d1(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.d2(t,r)})});gA(e,e.ar.concat(i))}catch(t){xA(e,String(t.message||t))}}}function pM(e){return(t,n,r)=>{let i=e.at,a=n.trim();if(!i||!a)return Promise.resolve(!1);let o={id:-1,workspace_id:e.ad,worktree:e.d1(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``,...e.d2(t,i)};return e.d9([o],{session:r},[])}}function mM(e){return(t,n)=>{let r=e.cf.find(e=>e.id===t.repo),i=n.side===`deletions`?t.old:t.new;return{head:r?.head,snippet:i==null?void 0:kt(i,n.start,n.end,n.side===`deletions`?`deletions`:`additions`)}}}function hM(e){return function(t){e.c4(t)}}function gM(t){return(n,r=!0)=>{n!==t.b0&&(ij(t,n),r&&e(n),t.ag?.(n),t.c1(n))}}function _M(e){return()=>{e.bx&&clearTimeout(e.bx),e.bx=setTimeout(()=>{e.bx=0,e.ca()},250)}}function vM(e){return()=>e.c1(e.b0,!0)}function yM(e){return async(t=e.b0,n=!1)=>{let r=++e.bz;CA(e,!0),xA(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([Me(`/api/workspaces/${e.ad}/diff${a}`),Me(`/api/workspaces/${e.ad}/review`)]);if(r!==e.bz)return;uA(e,o),gA(e,s.comments||[]),e.bw=$e(o),e.ae?e.bq(e.ae):e.af&&e.bu(e.af)}catch(t){if(r!==e.bz)return;xA(e,String(t.message||t))}finally{r===e.bz&&CA(e,!1)}}}function bM(e){return t=>{if(!t)return;let n=e.ap||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bf);for(let t of n)e.be.has(t.id)||i.add(t.id);r&&i.add(r.id),RA(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);IA(e,a),BA(e,new Set);let o=Date.now(),s=()=>{let n=e.w,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}e.bo(r)};requestAnimationFrame(s)}}function xM(e){return()=>{if(!e.ap)return;let t={},n={};for(let r of e.ap){(!t[r.worktree]||!r.pr)&&(t[r.worktree]=r.head);for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})}}function SM(e){return()=>e.d9(e.ar,{clipboard:!0},`all`)}function CM(e){return t=>e.d9(e.ar,{session:t},`all`)}function wM(e){return(t,n)=>{let r=e.ar.find(e=>e.id===t);return r?e.d9([r],{session:n},[t]):Promise.resolve(!1)}}function TM(e){return async(t,n,r)=>{if(!t.length)return!0;e.c7++;try{let i=Tt(t,e.ap);if(`clipboard`in n){if(!await de(i))return xA(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Me(`/api/sessions/${n.session}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${i}`,...we()||{}})}),e.ak?.(n.session);if(vA(e,null),r===`all`)gA(e,[]);else{let t=new Set(r);gA(e,e.ar.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.d5(r).catch(()=>{}),!0}catch(t){return xA(e,String(t.message||t)),!1}finally{e.c7--}}}function EM(e){return async t=>{gA(e,e.ar.filter(e=>e.id!==t)),await e.d5([t]).catch(()=>{})}}function DM(e){return t=>{wA(e,t)}}function OM(e){return t=>{if(e.bg.has(t)){let n=new Set(e.bg);n.delete(t),BA(e,n),e.be.has(t)||IA(e,new Set([...e.be,t]));return}if(e.be.has(t)){if(e.bf.has(t)){let n=new Set(e.be);n.delete(t),IA(e,n);return}BA(e,new Set([...e.bg,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e.bg.has(t))return;let n=new Set(e.be);n.delete(t),IA(e,n);let r=new Set(e.bg);r.delete(t),BA(e,r)})})}else RA(e,new Set([...e.bf,t])),IA(e,new Set([...e.be,t]))}}function kM(e){return t=>{e.ac?.(t);let n=Date.now(),r=()=>{let i=e.br(t);if(i){e.bo(i);return}Date.now()-n<2500&&requestAnimationFrame(r)};r()}}function AM(e){return function(t){e.di(t)}}function jM(e){return t=>{if(MA(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.br(n.key);if(r){if(n.line<1){e.bo(r);return}ct(t.query,n),lt()}},0)}}function MM(e){return t=>{let n=e.w;if(!n){t.scrollIntoView({block:`start`});return}let r=t.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,r-8)})}}function NM(e){return t=>{let n=e.w?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function PM(e){return e.includes(`#`)?e.split(`#`)[0]:e}function FM(e){return t=>{kA(e,t)}}function IM(e){return t=>{RA(e,t)}}function LM(e){return t=>{IA(e,t)}}function RM(e){return t=>{oj(e,t)}}function zM(e){return()=>{oj(e,!0),gj(e,e.b5+1),e.b7.focus()}}function BM(){}function VM(e){return(t,n)=>{e.bj??=new WeakMap,e.bj.set(t,n);let r=e.w||null;(!e.bk||e.bl!==r)&&(e.bk?.disconnect(),e.bl=r,e.bk=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bk.unobserve(n.target),e.bj.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bk.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.w,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bk?.unobserve(t),n())})}}function HM(e){return t=>t===`all`?fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.ad}/review/${t}`,{method:`DELETE`})))}function UM(e){return async()=>{if(!e.c7)try{let t=await Me(`/api/workspaces/${e.ad}/review`);if(e.c7)return;gA(e,t.comments||[])}catch{}}}b(`j29`,nM),b(`j38`,rM),b(`j37`,iM),b(`j36`,aM),b(`j35`,oM),b(`j34`,sM),b(`j33`,cM),b(`j32`,lM),b(`j31`,uM),b(`j30`,dM),b(`j16`,fM),b(`j23`,pM),b(`j15`,mM),b(`j0`,hM),b(`j9`,gM),b(`j12`,_M),b(`j11`,vM),b(`j8`,yM),b(`j5`,bM),b(`j13`,xM),b(`j20`,SM),b(`j21`,CM),b(`j22`,wM),b(`j19`,TM),b(`j18`,EM),b(`j1`,DM),b(`j26`,OM),b(`j7`,kM),b(`j28`,AM),b(`j25`,jM),b(`j4`,MM),b(`j6`,NM),b(`j14`,PM),b(`j41`,FM),b(`j40`,IM),b(`j39`,LM),b(`j27`,RM),b(`j24`,zM),b(`j2`,BM),b(`j3`,VM),b(`j17`,HM),b(`j10`,UM);var WM=Re(`j`,WD,GD,$A,Zj);export{WM as default,Qe as t};
|
|
1530
|
+
`}function Pv(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Fv(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Iv(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Lv(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function Rv(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function zv({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function Bv(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:jg(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Vv(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Hv=-1,Uv=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Hv}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:On},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new jo,this.scrollSyncManager=new Yg,this.interactionManager=new uo(`diff`,fo(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return Bv(e)}createHunksRenderer(e){return new yv(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=Zn(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(fo(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Hn(this.appliedThemeCSS.theme,this.options.theme??On)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){Bn(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=zv(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),qv(this.pre,Gv({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Jv(this.headerElement,Kv({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Og(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Qr(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Vv(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(Bg(`merge`,e,t),this.setHydratedState(t),await Rv(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=zv(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!Wv(u,this.deletionFile)||!Wv(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&yh(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Qr(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(tv(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,In);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||r_(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return p_({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=$_(e,this.hunksRenderer.getExpandedHunksMap(),t);return tv(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(ev(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return d_({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return f_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=o_(o);if(e<s){let c=s_({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=u_({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=o_(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){zn(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||_v(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Lv(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${jh(r)}`,a=this.annotationCache.get(i);if(a==null||!Iv(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:mg(jh(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=hg();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Ag(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Ag(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=ug;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??so(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Dn,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,wn,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Tn,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,En,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=gg(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Cg(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??On,s=typeof o==`string`?o:{...o},c=yg(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=Ng({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:wg(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=Tg(this.themeCSSStyle.textContent??``,yg(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Ig()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?Mg(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Yv(t[0]),a=Yv(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=so(i),r.content.innerHTML=so(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Dg({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Dg({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=Dg({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Yv(r?.[0]),a=Yv(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=Yv(n?.[0]),i=Yv(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=so(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?Mg(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Yv(t[0]),i=Yv(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};dg(u,this.appliedPreAttributes)||(kg(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Wv(e,t){return e==null||t==null?e==null&&t==null:ei(e,t)}function Gv({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Kv({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function qv(e,t,n=!1){return!n&&e==null&&t}function Jv(e,t,n=!1){return e==null&&t&&!n}function Yv(e){if(e!=null&&e.type===`element`)return e.children??[]}var Xv=200,Zv=40;function Qv(e,t){let n=t.trim();if(!n)return[];let r=/[A-Z]/.test(n),i=r?n:n.toLowerCase(),a=[];for(let t of e){if(a.length>=Xv)break;let e=a.length,n=ey(t.old,t.new),o=new Set;ty(t,t.new,`additions`,i,r,o,a,n.additions),ty(t,t.old,`deletions`,i,r,o,a,n.deletions),a.length===e&&$v(t.path,i,r)&&a.push({key:t.key,path:t.path,repo:t.repo,line:0,side:null,preview:t.path})}return a}function $v(e,t,n){let r=n?e:e.toLowerCase();if(!r.includes(t))return!1;let i=e.lastIndexOf(`/`),a=i>=0?e.slice(i+1):e,o=a.lastIndexOf(`.`);if(o<=0)return!0;let s=a.slice(o+1);if(!(n?s:s.toLowerCase()).includes(t))return!0;let c=e.length-s.length;for(let e=r.indexOf(t);e!==-1;e=r.indexOf(t,e+1))if(e<c)return!0;return!1}function ey(e,t){let n=new Set,r=new Set;if(e==null&&t==null)return{additions:n,deletions:r};try{let i=Qr(e==null?null:{name:`old`,contents:e},t==null?null:{name:`new`,contents:t});for(let e of i.hunks){for(let t=0;t<e.additionCount;t++)n.add(e.additionStart+t);for(let t=0;t<e.deletionCount;t++)r.add(e.deletionStart+t)}}catch{}return{additions:n,deletions:r}}function ty(e,t,n,r,i,a,o,s){if(!t||o.length>=Xv||!s.size)return;let c=0,l=t.split(`
|
|
1531
|
+
`);for(let t=0;t<l.length;t++){if(o.length>=Xv||c>=Zv)return;let u=t+1;if(!s.has(u))continue;let d=l[t],f=(i?d:d.toLowerCase()).indexOf(r);f<0||n===`deletions`&&a.has(d)||(n===`additions`&&a.add(d),c++,o.push({key:e.key,path:e.path,repo:e.repo,line:u,side:n,preview:ny(d,f,r.length)}))}}function ny(e,t,n){let r=Math.max(0,t-36),i=Math.min(e.length,t+n+36);return(r>0?`…`:``)+e.slice(r,i)+(i<e.length?`…`:``)}var ry=(e=>`<div><input type=search enterkeyhint=search autocomplete=off placeholder="Find in review" aria-label="Find in review"><span> </span><button type=button title="Previous match">↑</button><button type=button title="Next match">↓</button><button type=button title="Close find">${e}</button></div>`)(ie),iy=(e=>` D b D l b b D/${e}&m`)(f),ay=n(`g8`,e=>{e.a9=!!e.w,e.u&&(e.u.focus=e.an)}),oy=x(50,ay,3),sy=n(`g7`,e=>l(e,{onMount:function(){let t=new AbortController;return document.addEventListener(`keydown`,t=>{if(!e.a9)return;if(t.key===`Escape`){if(document.querySelector(`dialog[open]`)||t.target instanceof HTMLTextAreaElement)return;t.preventDefault(),e.am();return}let n=t.metaKey||t.ctrlKey;(t.key===`F3`||n&&t.key.toLowerCase()===`g`)&&(t.preventDefault(),e.al(t.shiftKey?-1:1))},{signal:t.signal}),e.ae=e.v,e.af=!!e.w,e.w&&e.an(),{abort:t}},onUpdate:function(){e.v!==e.ae&&(e.ae=e.v,e.w&&e.an()),e.w&&!e.af?(e.af=!0,e.an()):!e.w&&e.af&&(e.af=!1,e.ac&&=(clearTimeout(e.ac),0),lt(``,null),wy(e,{query:``,hit:null,keys:[]}))},onDestroy:function(){e.ac&&clearTimeout(e.ac),this.abort.abort(),lt(``,null),wy(e,{query:``,hit:null,keys:[]})}})),cy=x(51,sy,8),ly=x(33,e=>v(e.d,e.w&&(e.y||``).trim()?e.a3?`${e.a6+1}/${e.a3}`:`0/0`:``),3),uy=x(30,e=>{A(e.e,`disabled`,!e.a3||!e.w),A(e.f,`disabled`,!e.a3||!e.w)}),dy=T(22,e=>{j(e.a,[`_eK`,!e.w&&`_eJ`]),A(e.a,`aria-hidden`,e.w?`false`:`true`),A(e.b,`tabindex`,e.w?0:-1),A(e.e,`tabindex`,e.w?0:-1),A(e.f,`tabindex`,e.w?0:-1),A(e.g,`tabindex`,e.w?0:-1),oy(e),cy(e),ly(e),uy(e)}),fy=x(12,e=>dy(e,e.k,e.l)),py=E(10,fy),my=E(11,fy),hy=(e,t)=>By(e,t?.length),gy=x(26,e=>hy(e,Qv(e.t,e.y||``))),_y=E(47,cy),vy=x(44,e=>_y(e,Xy(e)),4),yy=x(46,e=>Ue(e,`b`,e.y||``,Zy(e))),by=T(24,e=>{gy(e),vy(e),yy(e),ly(e)}),xy=x(15,e=>by(e,e.n,e.o)),Sy=E(13,xy),Cy=E(14,xy),wy=T(14),Ty=x(18,e=>wy(e,e.q,e.r)),Ey=E(16,Ty),Dy=E(17,Ty),Oy=E(32,e=>{vy(e),ly(e)}),ky=x(31,e=>Oy(e,e.a3?Math.min(e.a1,e.a3-1):-1)),Ay=E(45,yy),jy=x(43,e=>Ay(e,Qy(e)),3),My=E(42,e=>{jy(e),vy(e)}),Ny=x(36,e=>My(e,$y(e)),2),Py=N(27,e=>{ky(e),Ny(e)}),Fy=(e,t)=>Wy(e,t.open),Iy=(e,t)=>{Gy(e,t.timer),Ky(e,t.tick),qy(e,t.wasOpen)},Ly=E(49,e=>{oy(e),cy(e)}),Ry=n(`g6`,e=>{_e(e,`b`),s(e.b,`keydown`,function(t){if(e.w){if(t.key===`Escape`){t.preventDefault(),e.am();return}t.key===`Enter`&&(t.preventDefault(),e.al(t.shiftKey?-1:1))}}),s(e.e,`mousedown`,function(e){e.preventDefault()}),s(e.e,`click`,function(){e.al(-1)}),s(e.f,`mousedown`,function(e){e.preventDefault()}),s(e.f,`click`,function(){e.al(1)}),s(e.g,`mousedown`,function(e){e.preventDefault()}),s(e.g,`click`,function(){e.am()})});function zy(e){j(e.b,Re),j(e.c,`_eN`),j(e.e,Me),j(e.f,Me),j(e.g,Me),r(e.h),Ze(e.h,14),ee(e.h),Py(e,0),Fy(e,{open:!1}),Iy(e,{timer:0,tick:0,wasOpen:!1}),Ly(e,eb(e)),Ry(e)}var By=E(29,e=>{ky(e),ly(e),uy(e)}),Vy=E(19,e=>{gy(e),Ny(e),jy(e)}),Hy=E(48,cy),Uy=x(39,e=>Hy(e,tb(e))),Wy=E(35,e=>{Ny(e),jy(e),vy(e),Uy(e),oy(e),cy(e)}),Gy=E(38,e=>{jy(e),vy(e),Uy(e),cy(e)}),Ky=E(40,cy),qy=E(41,cy),Jy=E(20,oy),Yy=E(21,cy);function Xy(e){return t=>{e.a9&&(e.ac&&=(clearTimeout(e.ac),0),e.ag(e.y||``,(e.a6<0?0:e.a6)+t))}}function Zy(e){return function(t){e.aj(t)}}function Qy(e){return t=>{e.a9&&(by(e,t),Py(e,0),lt(t,Qv(e.t,t)[0]??null),e.ac&&clearTimeout(e.ac),e.ac=setTimeout(()=>{e.ac=0,e.ag(t,0)},80))}}function $y(e){return(t,n)=>{if(!e.a9)return;let r=Qv(e.t,t),i=[...new Set(r.map(e=>e.key))];if(!r.length){Py(e,0),lt(t,null),wy(e,{query:t,hit:null,keys:i});return}Py(e,(n%r.length+r.length)%r.length);let a=r[e.a1];lt(t,a),wy(e,{query:t,hit:a,keys:i})}}function eb(e){return()=>{let t=e.b;t&&(t.focus(),t.select(),document.activeElement!==t&&setTimeout(()=>{t.focus(),t.select()},0))}}function tb(e){return()=>{dy(e,!1),e.a9=!1,e.ac&&=(clearTimeout(e.ac),0),lt(``,null),wy(e,{query:``,hit:null,keys:[]})}}k(`g3`,Xy),k(`g0`,Zy),k(`g2`,Qy),k(`g1`,$y),k(`g5`,eb),k(`g4`,tb);function nb(e){let t=e.replace(/^origin\//,``);return rb(t.includes(`/`)?t.slice(t.lastIndexOf(`/`)+1):t)}function rb(e){return e.replace(/-[a-z0-9]{1,6}$/i,``)||e}function ib(e,t){if(!t)return``;let n=e.replace(/^origin\//,``),r=t.replace(/^origin\//,``);return n.startsWith(`${r}-`)?n.slice(r.length+1):``}function ab(e){let t=rb(e);if(t.length<=20)return t;let n=t.split(`-`);return n.length>1?n[n.length-1]:t}function ob(e,t,n=``,r=``){let i=(e||`base`).replace(/^origin\//,``),a=(t||`HEAD`).replace(/^origin\//,``),o=(n||``).replace(/^origin\//,``),s=!!o&&(a===o||a.startsWith(`${o}-`));return{base:i,head:s?r||nb(o):ab(a),topic:s?ib(a,o):``,title:a===i?i:`${a} vs ${i}`}}function sb(e,t=``,n=``){let r=e.replace(/^origin\//,``);if(!r||r===`HEAD`)return r||`HEAD`;let i=t.replace(/^origin\//,``);if(i&&(r===i||r.startsWith(`${i}-`))){let e=n||nb(i),t=ib(r,i);return t?`${e} [${t}]`:e}return ab(r)}var cb=`_f6 _u`,lb=`_gb _t`;function ub(e,t){let n=null,r=()=>{if(!n||t.aborted)return;let i=e().closest(`[data-diff-main]`);if(i){let t=i.getBoundingClientRect(),r=0;if(n.y>=t.bottom-110?r=Math.max(4,Math.min(20,(n.y-(t.bottom-110))/3)):n.y<=t.top+110&&(r=-Math.max(4,Math.min(20,(t.top+110-n.y)/3))),r){i.scrollTop+=r;let a=e().getBoundingClientRect(),o=Math.max(t.top+12,a.top+48),s=Math.min(t.bottom-12,a.bottom-48),c=Math.max(o,Math.min(n.y,s));document.dispatchEvent(new PointerEvent(`pointermove`,{clientX:n.x,clientY:c,pointerId:n.pointerId,pointerType:`touch`,bubbles:!0,composed:!0}))}}requestAnimationFrame(r)};e().addEventListener(`pointerdown`,e=>{e.pointerType!==`mouse`&&e.composedPath().some(e=>e instanceof HTMLElement&&e.hasAttribute?.(`data-column-number`))&&(n={pointerId:e.pointerId,x:e.clientX,y:e.clientY},requestAnimationFrame(r))},{capture:!0,signal:t}),document.addEventListener(`pointermove`,e=>{n&&e.pointerId===n.pointerId&&e.isTrusted&&(n.x=e.clientX,n.y=e.clientY)},{capture:!0,passive:!0,signal:t});for(let e of[`pointerup`,`pointercancel`])document.addEventListener(e,e=>{n&&e.pointerId===n.pointerId&&(n=null)},{capture:!0,signal:t})}var db=`<div></div>`,fb=`background:var(--panel);border-block:1px solid var(--border);padding:.5rem .75rem;font-family:system-ui,sans-serif;font-size:.85rem;display:flex;flex-direction:column;gap:.35rem;`,pb=`display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;`,mb=[`_l`,ae,`_m`,`_R`,`_F`,Le.warn,`_eG`,`_eH`,`_eI`],hb=null;function gb(){if(hb)return hb;let e=new CSSStyleSheet,t=mb.flatMap(e=>e.split(/\s+/)).filter(Boolean).map(e=>`.${e}`),n=[],r=e=>t.some(t=>RegExp(`${t.replace(/[.$]/g,`\\$&`)}(?![\\w-])`).test(e));for(let e of document.styleSheets){let t;try{t=e.cssRules}catch{continue}for(let e of t){let t=e.selectorText;t&&r(t)&&n.push(e.cssText)}}return n.unshift(`button, select { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; } textarea { font: inherit; font-family: system-ui, sans-serif; color: inherit; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.45rem 0.6rem; } textarea:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }`),e.replaceSync(n.join(`
|
|
1532
|
+
`)),hb=e,e}var _b=new CSSStyleSheet;_b.replaceSync(`:host { display: block; max-width: 100%; overflow-x: auto; } @media (pointer: coarse) { pre[data-diff] { touch-action: pan-x pan-y; } [data-column-number], [data-gutter-utility-slot] { touch-action: none !important; } }`+ot);var vb=Xe(`f0`,0),yb=(e,t)=>j(e.a,[`_gw`,t]),bb=n(`f1`,e=>l(e,{file:e.e,comments:e.f,draft:e.g,sessions:e.h,onMount:function(){let t=()=>e.h||[],n=()=>{let e=t();if(e.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.className=`_eI`;for(let t of e){let e=document.createElement(`option`);e.value=t.id,e.textContent=t.title||t.agent,n.append(e)}return n},r=e=>e?.value||t()[0]?.id||null,i=(e,t,n)=>{for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)},a=(e,n,r)=>{let i=t()[0];if(!n)return e.className=`_l ${r?ae:``} _m`,e.textContent=`Send`,i&&(e.title=`Send to ${i.title||i.agent}`),e;let a=document.createElement(`span`);return a.className=`_eG`,r&&(a.style.cssText=`font-size:.75rem;`),e.className=`_m _eH`,e.textContent=`Send to`,a.append(e,n),a},o=t=>{if(t.snippet==null)return null;let n=t.side===`deletions`?e.e.old:e.e.new;if(n==null||At(n,t.line_start,t.line_end,t.side)===t.snippet)return null;let r=document.createElement(`span`);return r.className=`_F ${Le.warn}`,r.textContent=`changed since`,r.title=`The file changed here after this comment was written; the agent gets the lines as they were.`,r},s=s=>{if(!s)return;let c=document.createElement(`div`);c.style.cssText=fb;let l=document.createElement(`p`);l.textContent=s.text,l.style.cssText=`margin:0;white-space:pre-wrap;`;let u=document.createElement(`div`);u.style.cssText=pb;let d=document.createElement(`button`);d.type=`button`,d.textContent=`Remove`,d.className=`_l ${ae}`,d.onclick=()=>e.i?.(s.id);let f=t().length>0&&!!e.j,p=document.createElement(`button`);p.type=`button`,p.dataset.role=`send`,p.textContent=`Send`,p.hidden=!f;let m=f?n():null,h=m?`Send to`:p.textContent;p.onclick=()=>{(async()=>{let t=r(m);if(!(!t||p.disabled)){i([d,p],!0,h);try{await e.j?.(s.id,t)}finally{i([d,p],!1,h)}}})()},u.append(d),f&&u.append(a(p,m,!0));let g=o(s);return g&&u.append(g),c.append(l,u),c},c=()=>{let o=document.createElement(`div`);o.style.cssText=fb;let s=document.createElement(`textarea`);s.placeholder=`Add a comment…`,s.rows=3,s.className=`_R`,s.style.cssText=`resize:vertical;`+(se()?`font-size:16px;`:``);let c=document.createElement(`button`);c.type=`button`,c.textContent=`Add`,c.className=`_l`;let l=document.createElement(`button`);l.type=`button`,l.dataset.role=`send`,l.textContent=`Send`;let u=document.createElement(`button`);u.type=`button`,u.textContent=`Cancel`,u.className=`_l`;let d=t().length>0&&!!e.k;l.hidden=!d;let f=d?n():null,p=d?a(l,f,!1):l,m=l.textContent;c.onclick=()=>{s.value.trim()&&e.l?.(s.value)},l.onclick=()=>{(async()=>{let t=s.value.trim(),n=r(f);if(!(!t||!n||l.disabled)){i([c,l,u],!0,m);try{await e.k?.(t,n)}finally{i([c,l,u],!1,m)}}})()},u.onclick=()=>e.m?.(),s.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d?l.onclick():c.onclick()),e.key===`Escape`&&u.onclick()};let h=document.createElement(`div`);h.style.cssText=pb,h.append(c),d&&h.append(p),h.append(u),o.append(s,h);let g=()=>s.scrollIntoView({block:`center`,behavior:`smooth`});return s.addEventListener(`focus`,()=>{let e=window.visualViewport;e&&(e.addEventListener(`resize`,g),s.addEventListener(`blur`,()=>e.removeEventListener(`resize`,g),{once:!0}))}),setTimeout(()=>{s.scrollIntoView({block:`center`,behavior:`instant`}),s.focus()},0),o},l=new Map,u,d={draft:!0},f,p=new Uv({diffStyle:m()?`unified`:`split`,disableFileHeader:!0,enableLineSelection:!0,onLineSelectionEnd(t){if(!t)return;let n=t.endSide!=null&&t.endSide!==t.side;e.n?.({side:t.side,start:t.start,end:n?t.start:t.end})},renderAnnotation(e){let t=e.metadata||{};return t.draft?f??=c():s(t.comment)}}),h=()=>{let t=[],n=new Map;for(let r of e.f||[]){let e=l.get(r.id)||{comment:r};n.set(r.id,e),t.push({side:r.side,lineNumber:r.line_end,metadata:e})}return l=n,e.g&&(u!==e.g&&(u=e.g,d={draft:!0},f=void 0),t.push({side:e.g.side,lineNumber:e.g.end,metadata:d})),t},g=()=>{let t=e.a.querySelector(`diffs-container`)?.shadowRoot;t&&!t.adoptedStyleSheets.includes(_b)&&(t.adoptedStyleSheets=[...t.adoptedStyleSheets,_b,gb()])},_=()=>{if(e.e.old==null&&e.e.new==null){e.o?.(`could not read ${e.e.path}`);return}let t=p.render({containerWrapper:e.a,oldFile:e.e.old==null?null:{name:e.e.oldPath||e.e.path,contents:e.e.old},newFile:e.e.new==null?null:{name:e.e.path,contents:e.e.new},lineAnnotations:h()});Promise.resolve(t).then(()=>{g(),_t(e.a)}).catch(t=>e.o?.(`diff render: ${t}`))};_();let v=new AbortController;return se()&&ub(vb(e),v.signal),{instance:p,render:_,dragAbort:v,unregSearch:gt(e.a,e.e.key),shownFile:e.e,shownComments:e.f,shownDraft:e.g,shownSessions:e.h}},onUpdate:function(){this.shownDraft&&!this.draft&&this.instance.setSelectedLines(null),(this.file!==this.shownFile||this.comments!==this.shownComments||this.draft!==this.shownDraft||this.sessions!==this.shownSessions)&&(this.shownFile=this.file,this.shownComments=this.comments,this.shownDraft=this.draft,this.shownSessions=this.sessions,this.render())},onDestroy:function(){this.unregSearch(),this.dragAbort.abort(),this.instance.cleanUp?.()}})),xb=x(15,bb,10),Sb=E(4,xb),Cb=E(5,xb),wb=E(6,xb),Tb=E(7,xb),Eb=E(8,xb),Db=E(9,xb),Ob=E(10,xb),kb=E(11,xb),Ab=E(12,xb),jb=E(13,xb),Mb=E(14,xb),Nb=`<section><div><!><!><span><span> </span><span aria-hidden=true>vs</span><span> </span><!></span><!><!><!><span><span><!> file<!></span><!><!></span></div><!></section>`,Pb=` D D%b%b D D l b D l%l%b%b%b E%c%l%b%m%l`,Fb=e=>j(e.a,[`_gt`,`_gl`]),Ib=e=>j(e.a,[`_gt`,`_gl`]),Lb=e=>j(e.a,[`_gt`,`_gl`]),Rb=e=>j(e.a,[`_w`,`_gi`]),zb=a(7,0,e=>v(e.b,e._.z)),Bb=e=>{zb._(e),j(e.a,`_p`)},Vb=a(10,0,e=>v(e.b,e._.bw)),Hb=e=>{Vb._(e),j(e.a,[`_F`,Le.accent,`_gg`])},Ub=a(17,0,e=>v(e.b,e._.bm)),Wb=e=>{Ub._(e),Gb._(e),j(e.a,`_f8`),j(e.c,`_f9`)},Gb=a(17,0,e=>v(e.d,e._.bn)),Kb=x(2,e=>A(e.a,`title`,`${e._.aw?`#${e._.aw.number}`:e._.b0} is already in ${e._.ay}; showing the working tree only`),2),qb=a(12,0,Kb),Jb=e=>{qb._(e),Yb._(e),Xb._(e),j(e.a,[`_F`,`_gh`])},Yb=a(12,0,e=>{v(e.b,e._.ay),Kb(e)}),Xb=a(12,0,Kb),Zb=a(3,1,e=>v(e.b,re(e._.b9))),Qb=e=>{Zb._(e),j(e.a,lb)},$b=a(3,0,e=>v(e.d,e._.b2)),ex=e=>{$b._(e),tx._(e),nx._(e),rx._(e),j(e.a,[`_p`,`_r`]),j(e.c,lb)},tx=a(3,0,e=>v(e.b,e._.b6)),nx=a(3,0,e=>A(e.a,`href`,`${e._.b8}/files`)),rx=a(3,0,e=>A(e.a,`title`,e._.bx)),ix=a(2,1,e=>v(e.b,e._.b5)),ax=e=>{ix._(e),j(e.a,cb)},ox=x(1,e=>wb(e.a,e._._._._.am&&e._._._._.am.key===e._._.l?e._._._._.am:null)),sx=D(111,ox,e=>e._._._._),cx=e=>{sx(e),lx(e),dx(e),px(e),hx(e),gx(e),_x(e),vx(e),yx(e),bx(e),xx(e),Sx(e),e.a,yb(e.a,`_gl`)},lx=D(112,e=>Tb(e.a,e._._._._.an),e=>e._._._._),ux=x(2,e=>jb(e.a,Dw(e))),dx=D(113,ux,e=>e._._._._),fx=x(3,e=>kb(e.a,Ow(e))),px=D(114,fx,e=>e._._._._),mx=x(4,e=>Ob(e.a,kw(e))),hx=D(115,mx,e=>e._._._._),gx=D(116,e=>Ab(e.a,Aw(e)),e=>e._._._._),_x=D(117,e=>Eb(e.a,jw(e)),e=>e._._._._),vx=D(118,e=>Db(e.a,Mw(e)),e=>e._._._._),yx=D(119,e=>Mb(e.a,Nw(e)),e=>e._._._._),bx=D(29,e=>{Sb(e.a,e._._.k),ux(e),fx(e),mx(e)},e=>e._._),xx=D(30,ox,e=>e._._),Sx=D(31,e=>Cb(e.a,e._._.y),e=>e._._),Cx=n(`r11`,e=>l(e,{onMount:function(){e._._._._.v.observeNear(e.a,()=>{Ax(e._,!0)})}})),wx=D(96,Cx,e=>e._._._._),Tx=w(0,`<div></div>`,` `,e=>{wx(e),j(e.a,[`_gn`,`_gl`])},db,(e=>`/${e}&`)(` b`),cx),Ex=x(3,e=>Tx(e,e.b||e.c?1:0)),Dx=E(2,Ex),Ox=x(4,e=>Dx(e,e._._._.aj===e._.l)),kx=D(108,Ox,e=>e._._._),Ax=N(1,Ex),jx=e=>{kx(e),Mx._(e),Ax(e,!1)},Mx=a(8,3,Ox),Nx=x(12,e=>A(e.a,`hidden`,!e._._.y.has(e.l))),Px=D(98,Nx,e=>e._._),Fx=n(`r12`,e=>{ke(e,`a`),s(e.a,`toggle`,function(e,t){if(!t.open){let e=t.closest(`[data-diff-main]`);if(e){let n=t.getBoundingClientRect().top-e.getBoundingClientRect().top;n<0&&(e.scrollTop+=n)}}})}),Ix=e=>{Px(e),Bx(e),Kx(e),Yx(e),Xx(e),Zx(e),j(e.b,`_gm`),j(e.c,`_gr`),Fx(e)},Lx=O(Sx),Rx=E(24,e=>{$x(e,e.y.length),Lx(e)}),zx=x(13,e=>Rx(e,e._._.ah.get(e.l)||[])),Bx=D(106,zx,e=>e._._),Vx=x(27,e=>he(e,`a`,e.a0,Pw(e)),2),Hx=w(8,`<p>binary file</p>`,` `,Lb,`<p>file too large to display</p>`,` `,Ib,`<p>file could not be read</p>`,` `,Fb,`<!><!><!>`,`b%`,jx),Ux=x(28,e=>Hx(e,e.u?0:e.v?1:e.w==null&&e.x==null?2:e.a0?3:4),4),Wx=E(26,e=>{Vx(e),Ux(e)}),Gx=x(14,e=>Wx(e,!e._._.ai.has(e.l))),Kx=D(107,Gx,e=>e._._),qx=x(15,e=>j(e.a,[`_gk`,e._._.aj===e.l&&`_f0`])),Jx=x(16,e=>j(e.e,[`_gs`,e._._.aj===e.l&&e._._.al<1&&`_f1`]),2),Yx=D(108,e=>{qx(e),Jx(e)},e=>e._._),Xx=D(109,Vx,e=>e._._),Zx=D(110,Jx,e=>e._._),Qx=w(7,`<span>💬 <!></span>`,` Db%`,Bb),$x=E(25,e=>{Qx(e,+!e.z),zb(e)}),eS=O(xx),tS=E(11,e=>{A(e.a,`data-key`,e.l),zx(e),Gx(e),Vx(e),qx(e),Nx(e),Jx(e),Mx(e),eS(e)}),nS=(e,t)=>{A(e.c,`data-status`,t),v(e.d,t)},rS=(e,t)=>{A(e.e,`title`,t),v(e.f,t)},iS=w(6,`<span title="Changed since your last visit"></span>`,` `,Rb),aS=(e,t)=>iS(e,+!t),oS=E(20,Ux),sS=E(21,Ux),cS=E(22,Ux),lS=E(23,Ux),uS=(e,t)=>fS(e,t[0]),dS=O(bx),fS=E(10,e=>{tS(e,e.k?.key),nS(e,e.k?.status),rS(e,e.k?.path),aS(e,e.k?.changedSince),oS(e,e.k?.binary),sS(e,e.k?.tooLarge),cS(e,e.k?.old),lS(e,e.k?.new),dS(e)}),pS=Je(1,`<details><summary><span> </span><span><bdi> </bdi></span><!><!></summary><!></details>`,` D D D l E m%b%l%`,Ix,uS),mS=a(19,0,e=>pS(e,[e._.x,`key`])),hS=e=>{mS._(e),vS._(e),yS._(e),j(e.b,`_gj`)},gS=Ee(2,0),_S=x(3,e=>gS(e,!e._.a5||!e._.a6)),vS=a(19,0,_S),yS=a(19,0,_S),bS=a(18,0,e=>{j(e.a,[`_ga`,{_f_:e._.ad}]),A(e.a,`aria-pressed`,e._.ad?`true`:`false`),A(e.a,`title`,e._.ad?`Show every file`:`Show only files changed since your last visit`)}),xS=n(`r10`,e=>s(e.a,`click`,function(){e._.ae()})),SS=e=>{bS._(e),CS._(e),xS(e)},CS=a(18,0,e=>v(e.b,e._.bp)),wS=x(3,e=>v(e.b,sb(e._.b0,e._.a1,e._.a2)),2),TS=a(13,0,wS),ES=e=>{TS._(e),DS._(e),kS._(e),AS._(e),jS._(e),MS._(e),j(e.a,[`_F`,`_gh`])},DS=a(13,0,wS),OS=x(4,e=>A(e.a,`title`,`This view is ${kt(e._.b3)} (${e._.az}); checked out is ${kt(e._.be)} (${e._.b0})`),3),kS=a(13,0,OS),AS=a(13,0,e=>{OS(e),wS(e)}),jS=a(13,0,OS),MS=a(13,0,e=>{v(e.c,kt(e._.be,7)),OS(e)}),NS=a(11,0,e=>A(e.a,`disabled`,e._.aa)),PS=n(`r9`,e=>s(e.a,`click`,function(){e._.ab()})),FS=e=>{NS._(e),LS._(e),RS._(e),zS._(e),j(e.a,[`_F`,Le.warn,`_gh`]),PS(e)},IS=x(3,e=>A(e.a,`title`,`origin/${e._.az} ${e._.b3} · GitHub ${e._.bb}. Reload to re-ask GitHub`),2),LS=a(11,0,IS),RS=a(11,0,e=>{v(e.b,kt(e._.b3,7)),IS(e)}),zS=a(11,0,e=>{v(e.c,kt(e._.bb,7)),IS(e)}),BS=x(6,e=>A(e.a,`title`,e._.a6?`Show ${e._.bk} files`:`Hide files`)),VS=x(5,e=>j(e.b,[`_go`,!e._.a6&&`_gp`,e._.a8&&`_gq`])),HS=a(2,0,e=>{A(e.a,`aria-expanded`,e._.a6?`false`:`true`),v(e.c,e._.a6?`▸`:`▾`),BS(e),VS(e)}),US=n(`r8`,e=>s(e.a,`click`,function(){e._.a9()})),WS=e=>{HS._(e),GS._(e),KS._(e),qS._(e),j(e.a,`_f5`),j(e.d,cb),US(e)},GS=a(2,0,e=>{A(e.a,`aria-busy`,e._.a8?`true`:`false`),VS(e)}),KS=a(2,0,e=>v(e.e,e._.b5)),qS=a(2,0,BS),JS=(e,t)=>{ZS(e,t?.pr),oC(e,t?.base),sC(e,t?.branch),lC(e,t?.head),uC(e,t?.baseSha),dC(e,t?.worktree),fC(e,t?.id),pC(e,t?.full_name),hC(e,t?.githubDrift),vC(e,t?.contained),yC(e,t?.localHead)},YS=w(3,`<a target=_blank rel=noopener>#<!></a><span> </span>`,` Db%l D `,ex,`<span> </span>`,` D `,Qb),XS=x(81,e=>A(e.a,`hidden`,!e.bh&&!e.aw&&e.a4!==e.b7),3),ZS=E(58,e=>{eC(e,e.aw?.baseRefName),tC(e,e.aw?.headRefName),nC(e,e.aw?.title),rC(e,e.aw?.number),iC(e,e.aw?.url),aC(e,e.aw?.headRefOid),YS(e,+!e.aw),XS(e),qb(e)}),QS=(e,t)=>{VC(e,t?.title),HC(e,t?.base),UC(e,t?.head),GC(e,t?.topic)},$S=x(63,e=>QS(e,ob(e.ax||e.ay,e.az||e.b0,e.a1,e.a2)),5),eC=E(59,$S),tC=E(61,e=>{$S(e),LS(e),kS(e)}),nC=E(64,$b),rC=E(68,tx),iC=E(70,nx),aC=E(73,zS),oC=E(60,e=>{$S(e),Yb(e)}),sC=E(62,e=>{$S(e),AS(e),Xb(e)}),cC=x(91,e=>A(e.e,`title`,`${e.bs} · ${e.b3.slice(0,7)}…${e.b4.slice(0,7)}`),2),lC=E(65,e=>{cC(e),RS(e),jS(e)}),uC=E(66,cC),dC=E(67,e=>{KS(e),ix(e)}),fC=E(69,XS),pC=E(71,Zb),mC=w(11,`<button type=button>behind GitHub <!> → <!></button>`,` Db%c%`,FS),hC=(e,t)=>mC(e,+!t),gC=w(12,`<span>already in <!></span>`,` Db%`,Jb),_C=x(75,e=>gC(e,e.bc&&e.a0?0:1)),vC=E(74,_C),yC=E(76,MS),bC=E(95,rx),xC=e=>{bC(e,e.aw?`${e.aw.title}: ${e.aw.headRefName} ${e.b3} vs ${e.ay} ${e.b4}`:``)},SC=e=>{A(e.a,`data-pr`,e.aw?`${e.b5}/${e.aw.number}`:void 0)},CC=E(22,e=>{JS(e,e.w),xC(e),SC(e)}),wC=(e,t)=>{zC(e,t?.additions),BC(e,t?.deletions)},TC=(e,t)=>{OC(e,t?.length),wC(e,(()=>{let e=0,n=0;for(let r of t)e+=r.additions||0,n+=r.deletions||0;return{additions:e,deletions:n}})())},EC=E(82,e=>{v(e.p,e.bk),v(e.q,e.bk===1?``:`s`),qS(e)}),DC=x(80,e=>EC(e,e.bh||e.a0)),OC=E(79,e=>{DC(e),XS(e)}),kC=x(25,e=>TC(e,e.x.filter(t=>e.y.has(t.key)))),AC=w(18,`<button type=button><!> new</button>`,` D%`,SS),jC=x(88,e=>AC(e,e.bp||e.ad?0:1)),MC=E(87,e=>{jC(e),CS(e)}),NC=E(23,e=>{IC(e,e.x?.length),MC(e,e.x.filter(e=>e.changedSince).length),kC(e),mS(e)}),PC=O(Px),FC=E(24,e=>{kC(e),PC(e)}),IC=E(26,e=>{DC(e),_C(e)}),LC=w(17,`<span>+<!></span><span>−<!></span>`,` Db%l Db%`,Wb),RC=x(86,e=>LC(e,e.bm||e.bn?0:1)),zC=E(84,e=>{RC(e),Ub(e)}),BC=E(85,e=>{RC(e),Gb(e)}),VC=E(90,cC),HC=(e,t)=>v(e.g,t),UC=(e,t)=>v(e.j,t),WC=w(10,`<span> </span>`,` D `,Hb),GC=E(94,e=>{WC(e,+!e.bw),Vb(e)}),KC=E(27,e=>{$S(e),TS(e)}),qC=E(28,e=>{$S(e),DS(e)});function JC(e){j(e.a,`_f2`),j(e.e,`_gc`),j(e.f,[`_F`,`_gd`]),j(e.h,[`_H`,`_gf`]),j(e.i,[`_F`,`_ge`]),j(e.o,`_f7`)}var YC=E(30,XS),XC=x(33,e=>j(e.b,[`_f3`,{_f4:e.a5&&e.a6}])),ZC=w(2,`<button type=button><span aria-hidden=true> </span><span> </span></button>`,` D D l D `,WS,`<span> </span>`,` D `,ax),QC=w(19,`<!><!><div></div><!><!>`,`b%b b%`,hS),$C=x(42,e=>QC(e,!e.a5||!e.a6||e.af?0:1),2),ew=E(31,e=>{ZC(e,+!e.a5),XC(e),$C(e),vS(e)}),tw=E(32,e=>{XC(e),$C(e),HS(e),yS(e)}),nw=w(13,`<span>local <!> <!></span>`,` Db%c%`,ES),rw=(e,t)=>nw(e,+!t),iw=E(39,e=>{jC(e),bS(e)}),aw=E(41,$C),ow=O(wx),sw=E(21,e=>{CC(e,e.v.repo),NC(e,e.v.files),FC(e,e.v.shownKeys),KC(e,e.v.workspaceBranch),qC(e,e.v.workspaceName),YC(e,e.v.findHit?.repo),cw(e,e.v.findHit?.key),lw(e,e.v.findHit?.line),ew(e,e.v.collapsible),tw(e,e.v.collapsed),uw(e,e.v.expanding),dw(e,e.v.onToggle),fw(e,e.v.loading),pw(e,e.v.onReload),rw(e,e.v.localDiffers),iw(e,e.v.onlyNew),mw(e,e.v.onToggleNew),aw(e,e.v.opened),hw(e,e.v.commentsByFile),gw(e,e.v.collapsedFiles),_w(e,e.v.onFileToggle),vw(e,e.v.draft),yw(e,e.v.sessions),bw(e,e.v.onSelect),xw(e,e.v.onSaveComment),Sw(e,e.v.onSendDraft),Cw(e,e.v.onCancelDraft),ww(e,e.v.onDeleteComment),Tw(e,e.v.onSendComment),Ew(e,e.v.onError),ow(e)}),cw=E(45,O(Yx,kx)),lw=E(47,O(Zx)),uw=E(34,GS),dw=E(35),fw=E(36,NS),pw=E(37),mw=E(40),hw=E(43,O(Bx)),gw=E(44,O(Kx)),_w=E(46,O(Xx)),vw=E(48,O(sx)),yw=E(49,O(lx)),bw=E(50,O(dx)),xw=E(51,O(px)),Sw=E(52,O(hx)),Cw=E(53,O(gx)),ww=E(54,O(_x)),Tw=E(55,O(vx)),Ew=E(56,O(yx));function Dw(e){return function(t){e._._._._.ao(e._._.k,t)}}function Ow(e){return function(t){e._._._._.ap(e._._.k,t)}}function kw(e){return function(t,n){e._._._._.aq(e._._.k,t,n)}}function Aw(e){return function(){e._._._._.ar()}}function jw(e){return function(t){e._._._._.as(t)}}function Mw(e){return function(t,n){e._._._._.at(t,n)}}function Nw(e){return function(t){e._._._._.au(t)}}function Pw(e){return function(t){e._._.ak(e.l,t)}}k(`r1`,Dw),k(`r2`,Ow),k(`r3`,kw),k(`r4`,Aw),k(`r5`,jw),k(`r6`,Mw),k(`r7`,Nw),k(`r0`,Pw);var Fw=`_gv _i`,Iw=`<div><input type=search placeholder="Filter files…" aria-label="Filter files"></div>`,Lw=` D l`,Rw=x(18,e=>Ue(e,`b`,e.l,eT(e))),zw=E(11,Rw),Bw=x(10,e=>zw(e,(e.j??e.h)||``)),Vw=E(17,Rw),Hw=x(16,e=>Vw(e,tT(e))),Uw=E(15,Hw),Ww=x(14,e=>Uw(e,nT(e)),2),Gw=T(7,e=>{Bw(e),Ww(e)}),Kw=x(6,e=>Gw(e,e.e,e.f)),qw=E(4,Kw),Jw=E(5,Kw),Yw=N(9,e=>{Bw(e),Ww(e)}),Xw=(e,t)=>$w(e,t.timer),Zw=n(`k3`,e=>{_e(e,`b`),s(e.b,`keydown`,function(t){t.key===`Enter`&&e.p(),t.key===`Escape`&&e.l&&(t.preventDefault(),e.r(``))})});function Qw(e){j(e.a,`_gu`),j(e.b,Fw),Yw(e,null),Xw(e,{timer:0}),Zw(e)}var $w=E(13,e=>{Ww(e),Hw(e)});function eT(e){return function(t){e.r(t)}}function tT(e){return t=>{if(e.n&&clearTimeout(e.n),!t){e.n=0,Yw(e,null),Gw(e,``);return}Yw(e,t),e.n=setTimeout(e.p,150)}}function nT(e){return()=>{e.n&&=(clearTimeout(e.n),0);let t=e.j===null?e.h||``:e.j;Yw(e,null),Gw(e,t)}}k(`k0`,eT),k(`k2`,tT),k(`k1`,nT);var rT=(e=>`<aside><div>${e}</div><!><!></aside>`)(Iw),iT=(e=>` D D/${e}&l%b%l`)(Lw),aT=e=>j(e.a,`_fe`),oT=e=>j(e.a,[`_w`,`_fd`]),sT=e=>j(e.a,`_e7`),cT=x(7,e=>j(e.a,[`_fb`,{_fa:e._._._._.z?.has(e._.i)}])),lT=x(11,e=>A(e.a,`title`,e._._._._.z?.has(e._.i)?`${e._.j} (folded — click to open)`:e._.j),2),uT=D(37,e=>{cT(e),lT(e)},e=>e._._._._),dT=e=>{uT(e),mT(e),_T(e),yT(e),bT._(e),xT._(e),ST._(e),CT._(e),wT._(e),j(e.b,`_fg`),j(e.d,`_fc`)},fT=w(6,`<span>💬</span>`,` `,aT),pT=x(8,e=>fT(e,+!e._._._._.a8.has(e._.i))),mT=D(41,pT,e=>e._._._._),hT=w(5,`<span title="Changed since your last visit"></span>`,` `,oT),gT=x(9,e=>hT(e,+!e._._._._.a9.has(e._.i))),_T=D(42,gT,e=>e._._._._),vT=x(10,e=>A(e.a,`href`,e._._._._.aa(e._.i))),yT=D(43,vT,e=>e._._._._),bT=a(0,1,e=>je(e.a,`padding-left:${.5+e._.f*.75}rem`)),xT=a(0,1,e=>{vT(e),cT(e),lT(e),gT(e),pT(e)}),ST=a(0,1,lT),CT=a(0,1,e=>{A(e.b,`data-status`,e._.k),v(e.c,e._.k)}),wT=a(0,1,e=>v(e.e,e._.l)),TT=x(4,e=>{j(e.a,[`_e_`,{_e4:e._._._._.a7.has(e._._.f(e._.e))}]),v(e.c,e._._._._.a7.has(e._._.f(e._.e))?`▸`:`▾`)},2),ET=D(40,TT,e=>e._._._._),DT=n(`i5`,e=>s(e.a,`click`,function(){let t=new Set(e._._._._.a7),n=!t.delete(e._._.f(e._.e));n&&t.add(e._._.f(e._.e)),jE(e._._._._,t),e._._._._.y?.(e._._._.m.filter(t=>t.path.startsWith(`${e._.e}/`)).map(e=>e.key),n)})),OT=e=>{ET(e),kT(e),AT._(e),jT._(e),MT._(e),j(e.b,`_ff`),DT(e)},kT=D(10,TT,e=>e._._),AT=a(0,0,e=>{A(e.a,`title`,e._.e),TT(e)}),jT=a(0,0,e=>je(e.a,`padding-left:${.35+e._.f*.75}rem`)),MT=a(0,0,e=>v(e.d,e._.g)),NT=w(0,`<button type=button><span> </span><!>/</button>`,` D D l%`,OT,`<a><span> </span><span> </span><!><!></a>`,` D D l D l%b%`,dT),PT=x(3,e=>NT(e,!e._.i(e.c)&&e.c?.kind===`dir`?0:!e._.i(e.c)&&e.c?.kind!==`dir`?1:2)),FT=pe(1,PT),IT=FT,LT=E(2,e=>{zT(e,e.c?.path),BT(e,e.c?.depth),VT(e,e.c?.label),HT(e,e.c?.file?.key),UT(e,e.c?.file?.path),WT(e,e.c?.file?.status),GT(e,e.c?.name),PT(e)}),RT=(e,t)=>LT(e,t[0]),zT=E(4,AT),BT=E(5,e=>{jT(e),bT(e)}),VT=E(6,MT),HT=E(8,xT),UT=E(9,ST),WT=E(10,CT),GT=E(11,wT),KT=Ee(3,0,2),qT=x(9,e=>KT(e,!e._._.a0.has(e._.i))),JT=D(38,qT,e=>e._._),YT=E(8,FT),XT=x(7,e=>YT(e,qE(e)),2),ZT=E(6,XT),QT=e=>{JT(e),$T(e),tE._(e),iE._(e),ZT(e,JE)},$T=D(40,XT,e=>e._._),eE=E(5,O(kT)),tE=a(5,0,e=>{eE(e,YE(e)),XT(e),qT(e)}),nE=Je(1,`<!><!><!>`,`b%`,IT,RT),rE=(e,t)=>nE(e,[t,e=>e.kind===`dir`?`d:${e.path}`:e.file.key]),iE=a(5,0,e=>rE(e,Nt(e._.m))),aE=x(9,e=>{j(e.b,[`_e9`,{_e4:e._.a0.has(e.i)}]),v(e.d,e._.a0.has(e.i)?`▸`:`▾`)}),oE=w(5,`<!><!><!><!><!><!>`,`b%b%b%b%`,QT),sE=x(10,e=>oE(e,!e._.a0.has(e.i)||e._.a2.has(e.i)?0:1),2),cE=pe(4,e=>{aE(e),sE(e)}),lE=n(`i6`,e=>s(e.b,`click`,function(){let t=e.i,n=new Set(e._.a0);n.delete(t)||(xE(e._,new Set([...e._.a2,t])),n.add(t)),_E(e._,n)})),uE=e=>{cE._(e),dE._(e),j(e.a,`_e8`),j(e.c,`_ff`),lE(e)},dE=pe(4,sE),fE=E(8,e=>{aE(e),sE(e),tE(e)}),pE=(e,t)=>v(e.e,t),mE=(e,t)=>{fE(e,t[0]?.id),pE(e,t[0]?.label),hE(e,t[0]?.files)},hE=E(12,iE),gE=O(JT),_E=T(26,e=>{cE(e),gE(e)}),vE=x(9,e=>_E(e,e.h,e.i)),yE=E(7,vE),bE=E(8,vE),xE=T(28,dE),SE=x(12,e=>xE(e,e.k,e.l)),CE=E(10,SE),wE=E(11,SE),TE=w(3,`<p>No files match.</p>`,` `,sT),EE=x(32,e=>TE(e,!e.x&&e.a4?0:1)),DE=T(30,e=>{qw(e.c,e.a4),EE(e)}),OE=x(15,e=>DE(e,e.n,e.o)),kE=E(13,OE),AE=E(14,OE),jE=N(33,O($T,ET));function ME(e){j(e.b,`_e6`),Qw(e.c),Jw(e.c,XE(e)),jE(e,new Set)}var NE=E(34,O(mT)),PE=(e,t)=>NE(e,t||new Set),FE=E(35,O(_T)),IE=(e,t)=>FE(e,t||new Set),LE=E(36,O(yT)),RE=x(20,e=>LE(e,ZE(e))),zE=E(18,RE),BE=E(19,RE),VE=(e,t)=>j(e.a,[`_e5`,{_e4:t===!1}]),HE=E(23,EE),UE=Je(4,`<div><button type=button><span> </span> </button><!></div>`,` D D D l l%`,uE,mE),WE=(e,t)=>{HE(e,t?.length),UE(e,[t,`id`])},GE=E(24),KE=E(25,O(uT));function qE(e){return t=>{let n=e.g(t);for(let r of e._._.a7){let i=r.indexOf(`/`),a=r.slice(0,i),o=r.slice(i+1);if(a===e._.i&&(t.kind!==`dir`||t.path!==o)&&(n===o||n.startsWith(`${o}/`)))return!0}return!1}}function JE(e){return e.kind===`dir`?e.path:e.file.path.includes(`/`)?e.file.path.slice(0,e.file.path.lastIndexOf(`/`)):``}function YE(e){return t=>`${e._.i}/${t}`}function XE(e){return t=>{DE(e,t)}}function ZE(e){return t=>oe({workspaceId:e.s,view:`diff`,scope:e.t??null,file:t})}k(`i4`,qE),k(`i3`,JE),k(`i2`,YE),k(`i1`,XE),k(`i0`,ZE);var QE=`<!><!><!>`,$E=e=>j(e.a,`_ft`),eD=e=>j(e.a,[`_w`,`_fu`]),tD=a(4,0,e=>v(e.b,e._.s)),nD=e=>{tD._(e),j(e.a,`_fq`)},rD=w(8,`<span>💬</span>`),iD=x(12,e=>rD(e,+!e._._.w.has(e.l))),aD=D(30,iD,e=>e._._),oD=n(`e3`,e=>s(e.a,`click`,function(){jD(e._._,!1)})),sD=e=>{aD(e),uD(e),fD(e),hD(e),j(e.a,[`_fo`,`_u`]),j(e.b,`_fv`),j(e.d,`_fp`),j(e.f,`_fr`),oD(e)},cD=w(7,`<span title="Changed since your last visit"></span>`,` `,eD),lD=x(13,e=>cD(e,+!e._._.x.has(e.l))),uD=D(31,lD,e=>e._._),dD=x(14,e=>A(e.a,`href`,e._._.z(e.l))),fD=D(33,dD,e=>e._._),pD=(e,t)=>{_D(e,t?.dir),vD(e,t?.name)},mD=x(15,e=>pD(e,e._._.a0(e.l))),hD=D(34,mD,e=>e._._),gD=w(4,`<span><bdi><!>/</bdi></span>`,` E%`,nD),_D=E(18,e=>{gD(e,+!e.s),tD(e)}),vD=(e,t)=>v(e.g,t),yD=E(11,e=>{mD(e),dD(e),lD(e),iD(e)}),bD=(e,t)=>{A(e.b,`data-status`,t),v(e.c,t)},xD=Je(12,`<a><span> </span><span><!><span><bdi> </bdi></span></span><!><!></a>`,` D D l D%b E n%b%`,sD,(e,t)=>{yD(e,t[0]?.key),bD(e,t[0]?.status)}),SD=a(0,0,e=>xD(e,[e._.m,`key`])),CD=n(`e4`,e=>{s(e.a,`click`,function(){jD(e._,!1)}),s(e.h,`click`,function(){jD(e._,!1)})}),wD=e=>{SD._(e),DD._(e),OD._(e),kD._(e),j(e.a,`_fj`),j(e.b,`_fk`),j(e.c,`_fl`),j(e.d,`_fi`),j(e.e,`_fm`),j(e.h,[d,`_fh`]),r(e.i),Ze(e.i,16),ee(e.i),j(e.j,`_fs`),Qw(e.k),Jw(e.k,eO(e)),j(e.l,`_fn`),CD(e)},TD=w(13,`<p>No files match.</p>`,` `,$E),ED=x(14,e=>v(e.g,e._.n===e._.y?``:` / ${e._.y}`)),DD=a(0,0,e=>{v(e.f,e._.n),TD(e,+!!e._.n),ED(e)}),OD=a(0,0,e=>qw(e.k,e._.u)),kD=a(0,0,ED),AD=w(0,((e,t)=>`<div></div><div role=dialog aria-label="Jump to file"><div><strong>Files</strong><span><!><!></span><button type=button title=Close aria-label=Close>${e}</button></div><div>${t}</div><div><!><!></div></div>`)(ie,Iw),((e,t)=>` b D D b D%b%l D/${e}&m D/${t}&l D%b%m`)(f,Lw),wD),jD=T(18,e=>AD(e,+!e.s)),MD=x(5,e=>jD(e,e.d,e.e)),ND=E(3,MD),PD=E(4,MD),FD=T(20,OD),ID=x(8,e=>FD(e,e.g,e.h)),LD=E(6,ID),RD=E(7,ID),zD=E(22,O(aD)),BD=(e,t)=>zD(e,t||new Set),VD=E(23,O(uD)),HD=(e,t)=>VD(e,t||new Set),UD=E(24,kD),WD=x(14,e=>UD(e,e.l??e.n)),GD=E(11,WD),KD=E(13,e=>{WD(e),DD(e)}),qD=E(25,O(fD)),JD=x(17,e=>qD(e,tO(e))),YD=E(15,JD),XD=E(16,JD),ZD=E(26);function QD(e){ZD(e,nO)}var $D=E(12,e=>{KD(e,e.m?.length),SD(e)});function eO(e){return t=>{FD(e._,t)}}function tO(e){return t=>oe({workspaceId:e.p,view:`diff`,scope:e.q??null,file:t})}function nO(e){let t=e.lastIndexOf(`/`);return t<0?{dir:``,name:e}:{dir:e.slice(0,t),name:e.slice(t+1)}}k(`e2`,eO),k(`e0`,tO),k(`e1`,nO);var rO=((e,t,n,r)=>`<div><div><div><div><!><h1>Review</h1><!><!></div><div><!><button title="Refresh diff">${e}</button><!><div role=group aria-label="Review scope"><button type=button title="Committed changes only (base…tip, no working-tree edits)">Committed</button><button type=button title="Committed changes plus uncommitted and untracked files">Working tree</button><button type=button title="Only uncommitted and untracked files, against HEAD">Uncommitted</button></div><span><select aria-label="Review scope"><option value=committed>Committed</option><option value=working>Working tree</option><option value=dirty>Uncommitted</option></select></span><div>${t}</div><!></div></div><div data-diff-main><!><!><!><!><!></div></div>${n}${r}</div>`)(ne,ry,rT,QE),iO=((e,t,n,r)=>` D D D D%b b%b%l D%b D/${e}&l%b D b b l D l D/${t}&l%m D%b%b%b%b%m/${n}&/${r}&l`)(c,iy,iT,`b%c`),aO=e=>{j(e.a,`_ez`),j(e.b,[`_eA`,`_eB`]),j(e.c,[`_eA`,`_eC`]),j(e.d,[`_eA`,`_eD`]),j(e.e,[`_eA`,`_eC`]),j(e.f,[`_eA`,`_eD`])},oO=a(21,0,e=>A(e.a,`hidden`,e._.b3)),sO=n(`j47`,e=>s(e.a,`click`,function(){e._.di()})),cO=e=>{oO._(e),j(e.a,[h,`_en`,`_ee`]),Ae(e.b),Fe(e.b,14),ye(e.b),sO(e)},lO=a(12,0,e=>v(e.b,e._.cr)),uO=n(`j46`,e=>s(e.a,`click`,function(){WA(e._,!0)})),dO=e=>{lO._(e),j(e.a,[`_l`,`_eE`]),uO(e)},fO=a(9,0,e=>{j(e.a,[Pt,`_ee`,{_ed:e._.b1}]),A(e.a,`title`,e._.b1?`Hide file tree`:`Show file tree`)}),pO=n(`j45`,e=>s(e.a,`click`,function(){UA(e._,!e._.b1),ve(e._.b1)})),mO=e=>{fO._(e),me(e.b),Be(e.b,14),Pe(e.b),pO(e)},hO=x(2,e=>v(e.b,e._.b0===`dirty`?`Nothing uncommitted.`:e._.ch.some(e=>e.pr)?`No file changes on these PRs.`:`No changes vs base.`)),gO=a(26,0,hO),_O=e=>{gO._(e),vO._(e),j(e.a,`_bB`)},vO=a(26,0,hO),yO=D(166,e=>v(e.b,e._._.b0===`committed`?``:`, showing uncommitted changes only`),e=>e._._),bO=e=>{yO(e),xO(e)},xO=D(5,e=>v(e.a,e._.e)),SO=Ge(`j49`,`<!><!>.`,`%b%`,bO),CO=e=>{S(e.a),b(e.a,SO(e)),Te(e.a,`warn`),_(e.a,`inline`),o(e.a),t(e.a),y(e.a),De(e.a,{})},wO=(e,t)=>p(e.a,`${t}: base not found`),TO=(e,t)=>{wO(e,t[0]?.worktree),EO(e,t[0]?.base)},EO=E(4,O(xO)),DO=x(2,e=>v(e.b,e._.ba.trim()?`No matches in review.`:e._.az&&!e._.ax?`Nothing changed since your last visit.`:`No files match "${e._.ax}".`),2),OO=a(26,1,DO),kO=e=>{OO._(e),AO._(e),jO._(e),j(e.a,`_bB`)},AO=a(26,1,DO),jO=a(26,1,DO),MO=D(162,e=>v(e.a,e._._.au),e=>e._._),NO=Ge(`j48`,` `,` `,MO),PO=e=>{S(e.a),b(e.a,NO(e)),y(e.a,bM(e)),o(e.a),t(e.a),Te(e.a),_(e.a),p(e.a),De(e.a,{})},FO=a(6,0,e=>{v(e.b,e._.as),v(e.c,e._.as===1?``:`s`)}),IO=e=>{FO._(e),j(e.a,`_el`)},Q=x(1,e=>sw(e.a,{repo:e._.c,files:e._.g,shownKeys:e._._.ct,collapsible:e._._.ci>1,collapsed:e._._.be.has(e._.c?.id),expanding:e._._.bi.has(e._.c?.id),opened:e._._.bh.has(e._.c?.id),onToggle:AM(e),workspaceBranch:e._._.an||``,workspaceName:e._._.ao||``,localDiffers:e._._.d1.has(e._.c?.id),onlyNew:e._._.az,onToggleNew:kM(e),onReload:e._._.cc,loading:e._._.av,findHit:e._._.bc,commentsByFile:e._._.cy,draft:e._._.at,sessions:e._._.am||[],observeNear:e._._.bp,collapsedFiles:e._._.bf,onFileToggle:OM(e),onSelect:DM(e),onSaveComment:EM(e),onSendDraft:TM(e),onCancelDraft:wM(e),onDeleteComment:CM(e),onSendComment:SM(e),onError:xM(e)}),24),LO=D(157,Q,e=>e._._),RO=e=>{LO(e),zO(e),BO(e),VO(e),HO(e),UO(e),WO(e),GO(e),KO(e),qO(e),JO(e),YO(e),XO(e),ZO(e),QO(e),$O(e),ek(e),tk(e),nk(e),rk(e),ik(e),ak(e),ok(e),sk._(e),ck._(e),JC(e.a)},zO=D(158,Q,e=>e._._),BO=D(159,Q,e=>e._._),VO=D(161,Q,e=>e._._),HO=D(163,Q,e=>e._._),UO=D(165,Q,e=>e._._),WO=D(170,Q,e=>e._._),GO=D(171,Q,e=>e._._),KO=D(172,Q,e=>e._._),qO=D(173,Q,e=>e._._),JO=D(174,Q,e=>e._._),YO=D(175,Q,e=>e._._),XO=D(176,Q,e=>e._._),ZO=D(177,Q,e=>e._._),QO=D(179,Q,e=>e._._),$O=D(181,Q,e=>e._._),ek=D(183,Q,e=>e._._),tk=D(184,Q,e=>e._._),nk=D(186,Q,e=>e._._),rk=D(187,Q,e=>e._._),ik=D(190,Q,e=>e._._),ak=D(191,Q,e=>e._._),ok=D(192,Q,e=>e._._),sk=a(0,0,Q),ck=a(0,0,Q),lk=E(6,e=>{gk(e,e.g.length),ck(e)}),uk=x(4,e=>lk(e,e._.cv.get(e.d)||[])),dk=pe(27,uk),fk=e=>{dk._(e),hk._(e)},pk=w(0,Nb,(e=>`/${e}&`)(Pb),RO),mk=x(8,e=>pk(e,e.h||e.f&&e._.d2?0:1),2),hk=pe(27,mk),gk=E(7,mk),_k=E(3,uk),vk=E(5,mk),yk=(e,t)=>bk(e,t[0]),bk=E(2,e=>{_k(e,e.c?.id),vk(e,e.c?.pr),sk(e)}),xk=a(7,0,e=>pn(e.b,e._.am)),Sk=e=>{xk._(e),Ck._(e),wk._(e),j(e.a,`_ek`),sn(e.b)},Ck=a(7,0,e=>mn(e.b,e._.de)),wk=a(7,0,e=>hn(e.b,e._.df)),Tk=a(4,0,e=>A(e.a,`href`,`/w/${e._.ad}`)),Ek=e=>{Tk._(e),j(e.a,[h,`_ej`]),Ye(e.b),We(e.b,14),le(e.b)},Dk=(e,t)=>{IE(e.a2,t),HD(e.a3,t)},Ok=E(127,O($O)),kk=(e,t)=>WE(e.a2,t),Ak=x(131,e=>kk(e,e.ch.filter(t=>(e.cw.get(t.id)||[]).length).map(t=>({id:t.id,label:t.pr?`${t.worktree} #${t.pr.number}`:t.worktree,files:e.cw.get(t.id)||[]})))),jk=E(130,Ak),Mk=x(124,e=>jk(e,new Map(e.ch.map(t=>[t.id,e.cp.filter(e=>e.repo===t.id)])))),Nk=E(123,e=>{$D(e.a3,e.cp),dM(e,e.cp?.length),Ok(e,new Set(e.cp.map(e=>e.key))),Mk(e)}),Pk=x(122,e=>Nk(e,e.cn?e.cm.filter(t=>e.cn.has(t.key)||t.key===e.bd):e.cm),2),Fk=E(120,e=>{Vy(e.u,e.cm),Pk(e)}),Ik=x(118,e=>Fk(e,(()=>{let t=nt(e.ax);return e.cj.filter(n=>t(n.key)&&(!e.az||n.changedSince))})()),2),Lk=E(117,e=>{uM(e,e.cj?.length),e.cj.filter(e=>e.changedSince).length,Dk(e,new Set(e.cj.filter(e=>e.changedSince).map(e=>e.key))),Ik(e)}),Rk=E(135,O(tk)),zk=E(140,O(nk)),Bk=x(139,e=>zk(e,jM(e)),4),Vk=E(151,O(ak)),Hk=x(147,e=>Vk(e,MM(e)),4),Uk=E(138,e=>{Bk(e),Hk(e)}),Wk=Je(25,u,(e=>`/${e}&`)(g),CO,TO),Gk=Je(27,`<!><!><!>`,`b%`,fk,yk),Kk=E(115,e=>{lM(e,e.ch.length),Lk(e,e.ch.flatMap(e=>e.files.map(t=>({...t,repo:e.id,key:`${e.worktree}/${t.path}`})))),Rk(e,new Set(e.ch.filter(e=>!!e.pr&&!!e.localHead&&(e.localHead!==e.head||e.branch!==e.pr.headRefName)).map(e=>e.id))),Uk(e,NM(e)),Wk(e,[e.ch.filter(e=>e.baseMissing),`id`]),Gk(e,[e.ch,`id`]),Mk(e),Ak(e),vO(e)}),qk=n(`j52`,e=>l(e,{active:e.ah,load:e.c3,onMount:function(){let t=new AbortController,n={abort:t,loaded:!1,wasActive:!1,lastPr:e.ae||``,lastNonce:e.ai||0,lastFileNonce:e.aj||0,start:()=>{this.active&&!n.loaded&&(n.loaded=!0,this.load())}};return n.wasActive=!!this.active,Ve().addEventListener(`review.changed`,t=>{n.loaded&&t.data?.workspaceId===e.ad&&e.cb()},{signal:t.signal}),Ve().addEventListener(`status.changed`,t=>{if(!this.active||!n.loaded||e.av)return;let r=t.data,i=r&&r[e.ad];if(!i)return;let a=tt(i);!a||!e.by||a===e.by||e.ce()},{signal:t.signal}),window.addEventListener(`pagehide`,()=>{this.active&&n.loaded&&e.cf()},{signal:t.signal}),n.start(),n},onUpdate:function(){this.start(),this.active&&this.loaded&&!this.wasActive&&e.cc(),!this.active&&this.loaded&&this.wasActive&&e.cf(),this.wasActive=!!this.active;let t=e.ae||``,n=e.ai||0;this.loaded&&t&&n!==this.lastNonce?(this.lastNonce=n,this.lastPr=t,e.bs(t)):(this.lastPr=t,this.lastNonce=n);let r=e.aj||0;this.loaded&&e.af&&r!==this.lastFileNonce&&e.bw(e.af),this.lastFileNonce=r,e.a6&&e.a6!==e.b0&&e.c6(e.a6,!1)},onDestroy:function(){e.bz&&clearTimeout(e.bz),this.loaded&&e.cf(),this.abort.abort()}})),$=x(114,qk,18),Jk=x(105,e=>be(e,`s`,e.b0,PM(e))),Yk=E(104,e=>{$(e),Jk(e)}),Xk=x(103,e=>Yk(e,FM(e)),2),Zk=E(112,$),Qk=x(111,e=>Zk(e,IM(e))),$k=O(ZO),eA=E(110,e=>{Qk(e),$(e),$k(e)}),tA=x(102,e=>eA(e,LM(e))),nA=E(101,e=>{Xk(e),tA(e),$(e)}),rA=x(100,e=>nA(e,RM(e)),7),iA=E(90,e=>{rA(e),$(e)}),aA=x(89,e=>iA(e,zM(e)),3),oA=E(113,$),sA=x(52,e=>oA(e,BM(e))),cA=E(129,dk),lA=e=>{cA(e,new Map(e.ch.map(t=>[t.id,e.cj.filter(e=>e.repo===t.id)])))},uA=w(9,(e=>`<button>${e}</button>`)(Oe),(e=>` D/${e}&l`)(He),mO),dA=w(12,`<button title="Jump to file">Files (<!>)</button>`,` Db%`,dO),fA=w(21,(e=>`<button title="Find in review (⌘/Ctrl+F)" aria-label="Find in review">${e}</button>`)(Se),(e=>` D/${e}&l`)(xe),cO),pA=E(136,e=>{uA(e,+!e.d2),dA(e,+!e.d2),fA(e,+!e.d2),hk(e)}),mA=e=>{pA(e,!e.ap||e.cl>0)},hA=E(148,Ck),gA=E(149,wk),_A=E(150,O(ik)),vA=x(146,e=>{hA(e,VM(e)),gA(e,HM(e)),_A(e,UM(e))}),yA=E(145,e=>{vA(e),Hk(e)}),bA=x(143,e=>yA(e,WM(e)),4),xA=w(24,`<div aria-hidden=true><div></div><div></div><div></div><div></div><div></div></div>`,` D b b b b `,aO),SA=x(58,e=>xA(e,!e.ap&&e.av?0:1)),CA=w(26,`<p> </p>`,` D `,_O,`<p> </p>`,` D `,kO),wA=x(126,e=>CA(e,e.ap&&!e.cl?0:e.ap&&!e.cr&&!e.bc?1:2),3),TA=N(51,e=>{Kk(e,e.ap||[]),aA(e),sA(e),lA(e),mA(e),bA(e),SA(e),wA(e)}),EA=(e,t)=>{PE(e.a2,t),BD(e.a3,t)},DA=O(ek),OA=E(132,e=>{EA(e,new Set(e.cy.keys())),DA(e)}),kA=E(144,O(rk)),AA=x(142,e=>kA(e,GM(e))),jA=N(53,e=>{bj(e,e.ar?.length),OA(e,(()=>{let t=new Map;for(let n of e.ar){let e=`${n.worktree}/${n.path}`;t.set(e,[...t.get(e)||[],n])}return t})()),Bk(e),AA(e),bA(e),vA(e)}),MA=O(VO),NA=N(55,e=>{Bk(e),Hk(e),MA(e)}),PA=w(23,u,(e=>`/${e}&`)(g),PO),FA=O(MO),IA=N(56,e=>{PA(e,+!e.au),FA(e)}),LA=O(HO),RA=N(57,e=>{A(e.k,`disabled`,e.av),te(e.l,e.av&&`_B`),A(e.o,`disabled`,e.av),A(e.p,`disabled`,e.av),A(e.q,`disabled`,e.av),A(e.s,`disabled`,e.av),$(e),SA(e),LA(e)}),zA=N(59,e=>{kE(e.a2,e.ax),LD(e.a3,e.ax),Ik(e),OO(e)}),BA=(e,t)=>{AE(e.a2,t),RD(e.a3,t)},VA=O(UO),HA=N(61,e=>{Ik(e),VA(e),AO(e)}),UA=N(63,e=>{VE(e.a2,e.b1),fO(e)}),WA=N(64,e=>ND(e.a3,e.b2)),GA=E(121,Pk),KA=e=>{GA(e,e.ba.trim()?new Set(e.bb):null)},qA=N(71,e=>{Rj(e,e.b9?.query),zj(e,e.b9?.keys),Vj(e,e.b9?.hit),KA(e)}),JA=E(155,O(ok)),YA=x(81,e=>JA(e,qM(e)),2),XA=O(GO),ZA=N(76,e=>{yE(e.a2,e.be),aA(e),YA(e),XA(e)}),QA=E(78,O(qO)),$A=O(KO),ej=N(77,e=>{KE(e.a2,e.bf),QA(e,JM(e)),$A(e)}),tj=O(JO),nj=N(79,e=>{CE(e.a2,e.bh),aA(e),YA(e),tj(e)}),rj=O(YO),ij=N(80,e=>{YA(e),rj(e)}),aj=(e,t)=>{Gj(e,t.cbs),Kj(e,t.io),qj(e,t.root)},oj=E(94,e=>{rA(e),$(e)}),sj=x(93,e=>oj(e,YM(e)),2),cj=E(154,e=>Dy(e.u,XM(e))),lj=x(92,e=>cj(e,ZM(e))),uj=E(88,e=>{aA(e),sj(e),lj(e)}),dj=E(91,e=>{sj(e),lj(e)}),fj=(e,t)=>{Yj(e,t.sig),Xj(e,t.timer)},pj=(e,t)=>Zj(e,t.seq),mj=(e,t)=>aM(e,t.busy),hj=E(137,e=>{Bk(e),Hk(e)}),gj=n(`j50`,e=>{s(e.k,`click`,function(){e.cc()}),s(e.o,`click`,function(){e.c6(`committed`)}),s(e.p,`click`,function(){e.c6(`working`)}),s(e.q,`click`,function(){e.c6(`dirty`)}),Ie(e,`s`)});function _j(e){j(e.a,`_ec`),j(e.b,`_eh`),j(e.c,`_ei`),j(e.f,`_em`),j(e.i,`_eg`),j(e.k,[h,`_ee`]),Ke(e.l),i(e.l,14),j(e.n,`_et`),j(e.r,[`_j`,`_ew`]),j(e.s,[`_k`,`_ex`]),zy(e.u),my(e.u,aN(e)),Sy(e.u),Cy(e.u),Ey(e.u),j(e.w,`_eq`),ME(e.a2),bE(e.a2,iN(e)),wE(e.a2,rN(e)),GE(e.a2,nN(e)),QD(e.a3),PD(e.a3,tN(e)),TA(e,null),jA(e,[]),NA(e,null),IA(e,null),RA(e,!1),zA(e,``),BA(e,KM(e)),HA(e,!1),UA(e,C()),WA(e,!1),qA(e,{query:``,hit:null,keys:[]}),ZA(e,new Set),ej(e,new Set),nj(e,new Set),ij(e,new Set),aj(e,{io:null,root:null,cbs:null}),uj(e,QM(e)),dj(e,$M(e)),fj(e,{sig:``,timer:0}),pj(e,{seq:0}),mj(e,{busy:0}),hj(e,eN),gj(e)}var vj=w(6,`<span><!> comment<!></span>`,` D%c%`,IO),yj=w(7,(e=>`<span>${e}</span>`)(Ft),(e=>` D/${e}&l`)(It),Sk),bj=E(54,e=>{j(e.d,[`_es`,{_er:!e.as}]),vj(e,+!e.as),yj(e,+!e.as),FO(e)}),xj=O(yO),Sj=N(62,e=>{j(e.o,[`_ev`,{_eu:e.b0===`committed`}]),A(e.o,`aria-pressed`,e.b0===`committed`?`true`:`false`),j(e.p,[`_ev`,{_eu:e.b0===`working`}]),A(e.p,`aria-pressed`,e.b0===`working`?`true`:`false`),j(e.q,[`_ev`,{_eu:e.b0===`dirty`}]),A(e.q,`aria-pressed`,e.b0===`dirty`?`true`:`false`),BE(e.a2,e.b0),XD(e.a3,e.b0),rA(e),Xk(e),tA(e),$(e),Jk(e),xj(e),gO(e)}),Cj=E(32,e=>{Sj(e,e.a6??ce()),$(e)}),wj=T(65,e=>{j(e.t,[`_ep`,{_eo:!e.b3}]),py(e.u,e.b3),oO(e)}),Tj=x(35,e=>wj(e,e.a7,e.a8)),Ej=E(33,Tj),Dj=E(34,Tj),Oj=n(`j53`,e=>{e.aa!=null&&e.aa!==e.b5&&Pj(e,e.aa)}),kj=x(68,Oj),Aj=n(`j51`,e=>{e.ah&&window.addEventListener(`keydown`,t=>{!(t.metaKey||t.ctrlKey)||t.altKey||t.shiftKey||t.key.toLowerCase()===`f`&&(t.target instanceof HTMLTextAreaElement||(t.preventDefault(),e.di()))},{capture:!0,signal:we(e,0)})}),jj=x(153,e=>{de(e,0),Aj(e)}),Mj=E(152,jj),Nj=x(70,e=>Mj(e,oN(e))),Pj=N(67,e=>{Yy(e.u,e.b5),kj(e),Nj(e)}),Fj=E(36,e=>{Pj(e,e.aa||0),kj(e)}),Ij=E(69,e=>{Jy(e.u,e.b7),Nj(e)}),Lj=(e,t)=>Ij(e,t||{focus:sN}),Rj=E(72,jO),zj=E(73),Bj=O(WO),Vj=E(74,e=>{Hj(e,e.bc?.key),wA(e),Bj(e)}),Hj=E(75,Pk),Uj=E(87),Wj=x(86,e=>Uj(e,cN(e)),2),Gj=E(83,Wj),Kj=E(84,Wj),qj=E(85,Wj),Jj=E(38,sj),Yj=E(96,e=>{rA(e),$(e)}),Xj=E(97,e=>{Qk(e),$(e)}),Zj=E(99,rA),Qj=E(141,e=>{AA(e),bA(e)}),$j=E(109,$),eM=x(108,e=>$j(e,uN(e))),tM=E(39,e=>{zE(e.a2,e.ad),YD(e.a3,e.ad),Qj(e,lN(e)),rA(e),eM(e),sA(e),$(e),Bk(e),Hk(e),Tk(e)}),nM=E(40,e=>{rA(e),$(e)}),rM=E(41,e=>{rA(e),$(e)}),iM=E(42,Xk),aM=E(107,e=>{eM(e),bA(e)}),oM=E(43,e=>{$(e),jj(e)}),sM=E(44,$),cM=E(45,$),lM=E(116,O(QO)),uM=E(119,e=>{GD(e.a3,e.cl),wA(e)}),dM=E(125,e=>{wA(e),lO(e)}),fM=E(46,bA),pM=w(4,(e=>`<a title="Back to terminal (Esc)">${e}</a>`)(fe),(e=>` D/${e}&l`)(qe),Ek),mM=(e,t)=>pM(e,+!t),hM=(e,t)=>{Cj(e,t.scope),Ej(e,t.findOpen),Dj(e,t.findOpenChange),Fj(e,t.findTick),Lj(e,t.findFocusRef),Jj(e,t.onFileChange),tM(e,t.workspaceId),nM(e,t.focusPr),rM(e,t.focusFile),iM(e,t.onScopeChange),oM(e,t.active),sM(e,t.focusNonce),cM(e,t.focusFileNonce),fM(e,t.onSent),mM(e,t.onExit),_M(e,t.sessions),vM(e,t.workspaceBranch),yM(e,t.workspaceName)},gM=O(LO),_M=E(48,e=>{xk(e),gM(e)}),vM=E(49,O(zO)),yM=E(50,O(BO));function bM(e){return function(){IA(e._,null)}}function xM(e){return function(t){IA(e._._,t)}}function SM(e){return function(t,n){e._._.dg(t,n)}}function CM(e){return function(t){e._._.da(t)}}function wM(e){return function(){NA(e._._,null)}}function TM(e){return function(t,n,r){e._._.dh(t,n,r)}}function EM(e){return function(t,n){e._._.d6(t,n)}}function DM(e){return function(t,n){NA(e._._,{key:t.key,side:n.side||`additions`,start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)})}}function OM(e){return function(t,n){e._._.bg([t],!n)}}function kM(e){return function(){HA(e._._,!e._._.az)}}function AM(e){return function(){e._._.dl(e._.c?.id)}}function jM(e){return async(t,n)=>{let r=e.at;if(NA(e,null),r)try{let i=await Ne(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`comment`,worktree:e.d3(t.repo),path:t.path,side:r.side,line_start:r.start,line_end:r.end,text:n.trim(),...e.d4(t,r)})});jA(e,e.ar.concat(i))}catch(t){IA(e,String(t.message||t))}}}function MM(e){return(t,n,r)=>{let i=e.at,a=n.trim();if(!i||!a)return Promise.resolve(!1);let o={id:-1,workspace_id:e.ad,worktree:e.d3(t.repo),path:t.path,side:i.side===`deletions`?`deletions`:`additions`,line_start:i.start,line_end:i.end,text:a,created_at:``,...e.d4(t,i)};return e.db([o],{session:r},[])}}function NM(e){return(t,n)=>{let r=e.ch.find(e=>e.id===t.repo),i=n.side===`deletions`?t.old:t.new;return{head:r?.head,snippet:i==null?void 0:At(i,n.start,n.end,n.side===`deletions`?`deletions`:`additions`)}}}function PM(e){return function(t){e.c6(t)}}function FM(t){return(n,r=!0)=>{n!==t.b0&&(Sj(t,n),r&&e(n),t.ag?.(n),t.c3(n))}}function IM(e){return()=>{e.bz&&clearTimeout(e.bz),e.bz=setTimeout(()=>{e.bz=0,e.cc()},250)}}function LM(e){return()=>e.c3(e.b0,!0)}function RM(e){return async(t=e.b0,n=!1)=>{let r=++e.c1;RA(e,!0),IA(e,null);try{let i=new URLSearchParams;t!==`committed`&&i.set(`scope`,t),n&&i.set(`refresh`,`1`);let a=i.size?`?${i}`:``,[o,s]=await Promise.all([Ne(`/api/workspaces/${e.ad}/diff${a}`),Ne(`/api/workspaces/${e.ad}/review`)]);if(r!==e.c1)return;TA(e,o),jA(e,s.comments||[]),e.by=et(o),e.ae?e.bs(e.ae):e.af&&e.bw(e.af)}catch(t){if(r!==e.c1)return;IA(e,String(t.message||t))}finally{r===e.c1&&RA(e,!1)}}}function zM(e){return t=>{if(!t)return;let n=e.ap||[],r=n.find(e=>e.pr&&`${e.worktree}/${e.pr.number}`===t),i=new Set(e.bh);for(let t of n)e.be.has(t.id)||i.add(t.id);r&&i.add(r.id),nj(e,i);let a=new Set;for(let e of n)(!r||e.id!==r.id)&&a.add(e.id);ZA(e,a),ij(e,new Set);let o=Date.now(),s=()=>{let n=e.w,r=n?.querySelector(`[data-pr="${CSS.escape(t)}"]`);if(!n||!r){Date.now()-o<2500&&requestAnimationFrame(s);return}e.bq(r)};requestAnimationFrame(s)}}function BM(e){return()=>{if(!e.ap)return;let t={},n={};for(let r of e.ap){(!t[r.worktree]||!r.pr)&&(t[r.worktree]=r.head);for(let e of r.files)e.hash&&(n[`${r.worktree}/${e.path}`]=e.hash)}fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})}}function VM(e){return()=>e.db(e.ar,{clipboard:!0},`all`)}function HM(e){return t=>e.db(e.ar,{session:t},`all`)}function UM(e){return(t,n)=>{let r=e.ar.find(e=>e.id===t);return r?e.db([r],{session:n},[t]):Promise.resolve(!1)}}function WM(e){return async(t,n,r)=>{if(!t.length)return!0;e.c9++;try{let i=Et(t,e.ap);if(`clipboard`in n){if(!await ue(i))return IA(e,`Copy failed: the clipboard needs HTTPS in this browser.`),!1}else await Ne(`/api/sessions/${n.session}/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({text:`Please address this review feedback, then summarize what you changed.\n\n${i}`,...Ce()||{}})}),e.ak?.(n.session);if(NA(e,null),r===`all`)jA(e,[]);else{let t=new Set(r);jA(e,e.ar.filter(e=>!t.has(e.id)))}return(r===`all`||r.length)&&await e.d7(r).catch(()=>{}),!0}catch(t){return IA(e,String(t.message||t)),!1}finally{e.c9--}}}function GM(e){return async t=>{jA(e,e.ar.filter(e=>e.id!==t)),await e.d7([t]).catch(()=>{})}}function KM(e){return t=>{zA(e,t)}}function qM(e){return t=>{if(e.bi.has(t)){let n=new Set(e.bi);n.delete(t),ij(e,n),e.be.has(t)||ZA(e,new Set([...e.be,t]));return}if(e.be.has(t)){if(e.bh.has(t)){let n=new Set(e.be);n.delete(t),ZA(e,n);return}ij(e,new Set([...e.bi,t])),requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!e.bi.has(t))return;let n=new Set(e.be);n.delete(t),ZA(e,n);let r=new Set(e.bi);r.delete(t),ij(e,r)})})}else nj(e,new Set([...e.bh,t])),ZA(e,new Set([...e.be,t]))}}function JM(e){return(t,n)=>{let r=new Set(e.bf);for(let e of t)n?r.add(e):r.delete(e);(r.size!==e.bf?.size||[...r].some(t=>!e.bf.has(t)))&&ej(e,r)}}function YM(e){return t=>{e.ac?.(t);let n=Date.now(),r=()=>{let i=e.bt(t);if(i){e.bq(i);return}Date.now()-n<2500&&requestAnimationFrame(r)};r()}}function XM(e){return function(t){e.dk(t)}}function ZM(e){return t=>{if(qA(e,t),!t.hit)return;let n=t.hit;setTimeout(()=>{let r=e.bt(n.key);if(r){if(n.line<1){e.bq(r);return}lt(t.query,n),ut()}},0)}}function QM(e){return t=>{let n=e.w;if(!n){t.scrollIntoView({block:`start`});return}let r=t.getBoundingClientRect().top-n.getBoundingClientRect().top+n.scrollTop;n.scrollTo({top:Math.max(0,r-8)})}}function $M(e){return t=>{let n=e.w?.querySelector(`details[data-key="${CSS.escape(t)}"]`);return n&&(n.open=!0),n}}function eN(e){return e.includes(`#`)?e.split(`#`)[0]:e}function tN(e){return t=>{WA(e,t)}}function nN(e){return function(t,n){e.bg(t,n)}}function rN(e){return t=>{nj(e,t)}}function iN(e){return t=>{ZA(e,t)}}function aN(e){return t=>{wj(e,t)}}function oN(e){return()=>{wj(e,!0),Pj(e,e.b5+1),e.b7.focus()}}function sN(){}function cN(e){return(t,n)=>{e.bl??=new WeakMap,e.bl.set(t,n);let r=e.w||null;(!e.bm||e.bn!==r)&&(e.bm?.disconnect(),e.bn=r,e.bm=new IntersectionObserver(t=>{for(let n of t)n.isIntersecting&&(e.bm.unobserve(n.target),e.bl.get(n.target)?.())},{root:r,rootMargin:`800px 0px`})),e.bm.observe(t),requestAnimationFrame(()=>{if(!t.isConnected)return;let r=e.w,i=t.getBoundingClientRect(),a=r?r.getBoundingClientRect():{top:0,bottom:window.innerHeight};i.bottom>=a.top-800&&i.top<=a.bottom+800&&(e.bm?.unobserve(t),n())})}}function lN(e){return t=>t===`all`?fetch(`/api/workspaces/${e.ad}/review`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`clear`})}):Promise.all(t.map(t=>fetch(`/api/workspaces/${e.ad}/review/${t}`,{method:`DELETE`})))}function uN(e){return async()=>{if(!e.c9)try{let t=await Ne(`/api/workspaces/${e.ad}/review`);if(e.c9)return;jA(e,t.comments||[])}catch{}}}k(`j30`,bM),k(`j40`,xM),k(`j39`,SM),k(`j38`,CM),k(`j37`,wM),k(`j36`,TM),k(`j35`,EM),k(`j34`,DM),k(`j33`,OM),k(`j32`,kM),k(`j31`,AM),k(`j17`,jM),k(`j24`,MM),k(`j16`,NM),k(`j0`,PM),k(`j10`,FM),k(`j13`,IM),k(`j12`,LM),k(`j9`,RM),k(`j6`,zM),k(`j14`,BM),k(`j21`,VM),k(`j22`,HM),k(`j23`,UM),k(`j20`,WM),k(`j19`,GM),k(`j1`,KM),k(`j27`,qM),k(`j3`,JM),k(`j8`,YM),k(`j29`,XM),k(`j26`,ZM),k(`j5`,QM),k(`j7`,$M),k(`j15`,eN),k(`j44`,tN),k(`j43`,nN),k(`j42`,rN),k(`j41`,iN),k(`j28`,aN),k(`j25`,oN),k(`j2`,sN),k(`j4`,cN),k(`j18`,lN),k(`j11`,uN);var dN=ze(`j`,rO,iO,_j,hM);export{dN as default,$e as t};
|