@dylanpiercey/work 0.0.198 → 0.0.200
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/index.mjs +25664 -22560
- package/dist/public/assets/_-NFS7BzH.js +1 -0
- package/dist/public/assets/_-UNKhS_v.js +1 -0
- package/dist/public/assets/{_D5L8I-l6.js → _-a63w4gs.js} +1 -1
- package/dist/public/assets/_-a63w4gs.js.br +0 -0
- package/dist/public/assets/{_DBgC6pSG.js → _0a-Qn03w.js} +1 -1
- package/dist/public/assets/_0a-Qn03w.js.br +0 -0
- package/dist/public/assets/_6OhPRNDQ.js +1 -0
- package/dist/public/assets/_6V2gJJp2.js +1 -0
- package/dist/public/assets/_772AjyQx.js +1 -0
- package/dist/public/assets/_772AjyQx.js.br +0 -0
- package/dist/public/assets/_7NzdrKUy.js +1 -0
- package/dist/public/assets/_9j-B4HwE.js +1 -0
- package/dist/public/assets/_9j-B4HwE.js.br +0 -0
- package/dist/public/assets/{_BVhDa8AS.js → _B-fGcnRc.js} +1 -1
- package/dist/public/assets/_B-fGcnRc.js.br +0 -0
- package/dist/public/assets/_B3TRNHbG.js +1 -0
- package/dist/public/assets/_B4GGCyjX.js +1 -0
- package/dist/public/assets/{_S0SsdbnP.js → _B5Xxnd2H.js} +1 -1
- package/dist/public/assets/_B5Xxnd2H.js.br +0 -0
- package/dist/public/assets/_B5zdNVhF.js +168 -0
- package/dist/public/assets/_B5zdNVhF.js.br +0 -0
- package/dist/public/assets/_B6WkyAbQ.js +1 -0
- package/dist/public/assets/{_DJRzHHPO.js → _B7VRjiD4.js} +1 -1
- package/dist/public/assets/_BAh_nsLB.js +1 -0
- package/dist/public/assets/{_DNTUKUkr.js → _BDL1UG7m.js} +1 -1
- package/dist/public/assets/_BDL1UG7m.js.br +0 -0
- package/dist/public/assets/_BEiRQ3b2.js +1 -0
- package/dist/public/assets/_BFUaOU25.js +1 -0
- package/dist/public/assets/{_0bNpq_Od.js → _BHu5ZPXc.js} +1 -1
- package/dist/public/assets/_BHu5ZPXc.js.br +0 -0
- package/dist/public/assets/_BIHS7mjH.js +1 -0
- package/dist/public/assets/_BIZ0fYRL.js +1 -0
- package/dist/public/assets/_BK-g0j_U.js +1 -0
- package/dist/public/assets/{_t3yF4GJM.js → _BKlsi2bj.js} +1 -1
- package/dist/public/assets/_BKlsi2bj.js.br +0 -0
- package/dist/public/assets/{_DApFf-Du.js → _BNfVEwBn.js} +1 -1
- package/dist/public/assets/_BNfVEwBn.js.br +0 -0
- package/dist/public/assets/_BP2xF_GY.js +1 -0
- package/dist/public/assets/_BP2xF_GY.js.br +0 -0
- package/dist/public/assets/_BQZfwCKg.js +1 -0
- package/dist/public/assets/{_D3KU9c5P.js → _BSI2Wkep.js} +1 -1
- package/dist/public/assets/_BSI2Wkep.js.br +0 -0
- package/dist/public/assets/_BUa5Oj8j.js +1 -0
- package/dist/public/assets/_BVfp9grF.js +1 -0
- package/dist/public/assets/{_B_C8Mg1b.js → _BWKLoahK.js} +1 -1
- package/dist/public/assets/_BWKLoahK.js.br +0 -0
- package/dist/public/assets/{_CNcCChyO.js → _BYP4_JOp.js} +1 -1
- package/dist/public/assets/_BYP4_JOp.js.br +0 -0
- package/dist/public/assets/_BeOg0U0J.js +2 -0
- package/dist/public/assets/_BeOg0U0J.js.br +0 -0
- package/dist/public/assets/{_v0lZuQ-1.js → _BeirXVdz.js} +1 -1
- package/dist/public/assets/_BeirXVdz.js.br +0 -0
- package/dist/public/assets/{_CEJNkgrb.js → _Bf9q_Bno.js} +1 -1
- package/dist/public/assets/_Bf9q_Bno.js.br +0 -0
- package/dist/public/assets/{_OVbe0fvD.js → _BfyG4tcV.js} +1 -1
- package/dist/public/assets/_BfyG4tcV.js.br +0 -0
- package/dist/public/assets/{_DwEFaBdE.js → _Bg4lwCJV.js} +1 -1
- package/dist/public/assets/_Bg4lwCJV.js.br +0 -0
- package/dist/public/assets/{_BXzJtHiF.js → _BhJKgMaw.js} +1 -1
- package/dist/public/assets/_BhJKgMaw.js.br +0 -0
- package/dist/public/assets/_BiYZMrJv.js +2640 -0
- package/dist/public/assets/_BiYZMrJv.js.br +0 -0
- package/dist/public/assets/_BjfUHHxy.js +1 -0
- package/dist/public/assets/_BjfUHHxy.js.br +0 -0
- package/dist/public/assets/{_BIULk7FY.js → _Bk41JZKk.js} +1 -1
- package/dist/public/assets/_Bk41JZKk.js.br +0 -0
- package/dist/public/assets/_BkLPKV-t.js +1 -0
- package/dist/public/assets/{_6fXseVVz.js → _BlHIP5qP.js} +1 -1
- package/dist/public/assets/_BlHIP5qP.js.br +0 -0
- package/dist/public/assets/_Bm-aszqk.js +1 -0
- package/dist/public/assets/{_CiJXzOpK.js → _Bm4Nm2IP.js} +1 -1
- package/dist/public/assets/_Bm4Nm2IP.js.br +0 -0
- package/dist/public/assets/{_B_4eHSpm.js → _BmlpCOYn.js} +1 -1
- package/dist/public/assets/_BmlpCOYn.js.br +0 -0
- package/dist/public/assets/_BnaRk6_n.js +1 -0
- package/dist/public/assets/{_BggJLA1_.js → _Bp8q2TPw.js} +1 -1
- package/dist/public/assets/_Bp8q2TPw.js.br +0 -0
- package/dist/public/assets/{_B5StVYF6.js → _BqD1BGDP.js} +1 -1
- package/dist/public/assets/_BqD1BGDP.js.br +0 -0
- package/dist/public/assets/{_Dy4S_A2m.js → _Bqb6txxl.js} +1 -1
- package/dist/public/assets/_Bqb6txxl.js.br +0 -0
- package/dist/public/assets/_BrBU_TOS.js +1 -0
- package/dist/public/assets/_BtCezCZb.js +1 -0
- package/dist/public/assets/{_CCwt6cBc.js → _BtOdAkX5.js} +1 -1
- package/dist/public/assets/_BtOdAkX5.js.br +0 -0
- package/dist/public/assets/_Btpcwj27.js +1 -0
- package/dist/public/assets/_By0WbjtY.js +1 -0
- package/dist/public/assets/_ByfyKiUO.js +6 -0
- package/dist/public/assets/_ByfyKiUO.js.br +0 -0
- package/dist/public/assets/{_C1kAFId8.js → _Bz8yRnFp.js} +1 -1
- package/dist/public/assets/_Bz8yRnFp.js.br +0 -0
- package/dist/public/assets/_BzMG3xNN.js +1 -0
- package/dist/public/assets/_BzMG3xNN.js.br +0 -0
- package/dist/public/assets/{_Ch4Bpzn_.js → _BzpK7qDk.js} +1 -1
- package/dist/public/assets/_BzpK7qDk.js.br +0 -0
- package/dist/public/assets/_Bztf87pN.js +1 -0
- package/dist/public/assets/_C-8OjcAG.js +86 -0
- package/dist/public/assets/_C-8OjcAG.js.br +0 -0
- package/dist/public/assets/_C6R9n3Mq.js +1 -0
- package/dist/public/assets/_C6R9n3Mq.js.br +0 -0
- package/dist/public/assets/{_BMIWLwHE.js → _C7FZr17P.js} +1 -1
- package/dist/public/assets/_C7FZr17P.js.br +0 -0
- package/dist/public/assets/{_BK9i2P3k.js → _C8sh1m9a.js} +1 -1
- package/dist/public/assets/_C8sh1m9a.js.br +0 -0
- package/dist/public/assets/_C9Cgmfti.js +1 -0
- package/dist/public/assets/_C9Cgmfti.js.br +0 -0
- package/dist/public/assets/{_DXMbGrjj.js → _CAFRR2DX.js} +1 -1
- package/dist/public/assets/_CAFRR2DX.js.br +0 -0
- package/dist/public/assets/{_CJGL0lvW.js → _CB2ZuI-9.js} +1 -1
- package/dist/public/assets/_CB2ZuI-9.js.br +0 -0
- package/dist/public/assets/{_DIeJpzm3.js → _CDSqeNt5.js} +1 -1
- package/dist/public/assets/_CDSqeNt5.js.br +0 -0
- package/dist/public/assets/_CHlgT5mg.js +1 -0
- package/dist/public/assets/{_B9HxhiqE.js → _CKz7xRlk.js} +1 -1
- package/dist/public/assets/_CKz7xRlk.js.br +0 -0
- package/dist/public/assets/_CM-SnEEL.js +1 -0
- package/dist/public/assets/{_CdzWzG8M.js → _CN4cLrcb.js} +1 -1
- package/dist/public/assets/_CN4cLrcb.js.br +0 -0
- package/dist/public/assets/{_DkRBy2f_.js → _CNNnvZKA.js} +1 -1
- package/dist/public/assets/_CNNnvZKA.js.br +0 -0
- package/dist/public/assets/{_Dw880M9B.js → _CNnRZ0Zn.js} +1 -1
- package/dist/public/assets/_CNnRZ0Zn.js.br +0 -0
- package/dist/public/assets/{_BJQ2Y6DP.js → _CO_Bcjkm.js} +1 -1
- package/dist/public/assets/_CO_Bcjkm.js.br +0 -0
- package/dist/public/assets/{_DcHotOlK.js → _CQ6_ymvy.js} +1 -1
- package/dist/public/assets/_CQ6_ymvy.js.br +0 -0
- package/dist/public/assets/_CRsdWI_C.js +1 -0
- package/dist/public/assets/_CTr_ImCs.js +1 -0
- package/dist/public/assets/{_DZcAKw3P.js → _CVww3g-c.js} +1 -1
- package/dist/public/assets/_CbazO5Ud.js +1 -0
- package/dist/public/assets/_CbgaWI4j.js +1 -0
- package/dist/public/assets/{_BZlzIrNM.js → _Ce_0bZQm.js} +1 -1
- package/dist/public/assets/_Ce_0bZQm.js.br +0 -0
- package/dist/public/assets/{_C9fqX4vB.js → _CfxhLV3g.js} +1 -1
- package/dist/public/assets/{_DpSu73pS.js → _Ch7yUbtQ.js} +1 -1
- package/dist/public/assets/_Ch7yUbtQ.js.br +0 -0
- package/dist/public/assets/_ChQSK4Lg.js +1 -0
- package/dist/public/assets/{_DOKq-7nt.js → _Cl3Ud3ZP.js} +1 -1
- package/dist/public/assets/_Cl3Ud3ZP.js.br +0 -0
- package/dist/public/assets/{_x_XUGGSA.js → _CnpHtynD.js} +1 -1
- package/dist/public/assets/_CnpHtynD.js.br +0 -0
- package/dist/public/assets/{_DMdqORi3.js → _CoDl9-JQ.js} +1 -1
- package/dist/public/assets/_CoDl9-JQ.js.br +0 -0
- package/dist/public/assets/{_CDBTOJV7.js → _Cp7MoS5M.js} +1 -1
- package/dist/public/assets/_Cp7MoS5M.js.br +0 -0
- package/dist/public/assets/_CrYu306G.js +1 -0
- package/dist/public/assets/_CsOpF5vZ.js +1 -0
- package/dist/public/assets/_CuB1ha-w.js +1 -0
- package/dist/public/assets/_CuJf86gL.js +1 -0
- package/dist/public/assets/{_D0SvJpzb.js → _CuvrVgtu.js} +1 -1
- package/dist/public/assets/_CuvrVgtu.js.br +0 -0
- package/dist/public/assets/{_mx0u5F7j.js → _D0Y7lnbw.js} +1 -1
- package/dist/public/assets/_D0Y7lnbw.js.br +0 -0
- package/dist/public/assets/_D0hATs5X.js +1 -0
- package/dist/public/assets/_D5nuXrWp.js +1 -0
- package/dist/public/assets/{_B8iJi2pt.js → _D7Wm0a4a.js} +1 -1
- package/dist/public/assets/_D7Wm0a4a.js.br +0 -0
- package/dist/public/assets/{_CZGbNTgO.js → _D82kGQg7.js} +1 -1
- package/dist/public/assets/_D82kGQg7.js.br +0 -0
- package/dist/public/assets/{_By_fuZbd.js → _D9zEm7HF.js} +1 -1
- package/dist/public/assets/_D9zEm7HF.js.br +0 -0
- package/dist/public/assets/{_FMwpfKJh.js → _DEK5ie3W.js} +1 -1
- package/dist/public/assets/_DEK5ie3W.js.br +0 -0
- package/dist/public/assets/{_BofgUgCl.js → _DEQkZr11.js} +1 -1
- package/dist/public/assets/_DEQkZr11.js.br +0 -0
- package/dist/public/assets/{_B8TcMuPN.js → _DHDb5YGz.js} +1 -1
- package/dist/public/assets/_DHDb5YGz.js.br +0 -0
- package/dist/public/assets/_DJ1bY7In.js +1 -0
- package/dist/public/assets/_DL2mVTmv.js +1 -0
- package/dist/public/assets/{_e58SVS_5.js → _DLcinIFO.js} +1 -1
- package/dist/public/assets/_DLcinIFO.js.br +0 -0
- package/dist/public/assets/{_Cdw9U5OX.js → _DLiAE28h.js} +1 -1
- package/dist/public/assets/_DLiAE28h.js.br +0 -0
- package/dist/public/assets/{_Btiz8gFh.js → _DNKfIeMU.js} +1 -1
- package/dist/public/assets/_DNKfIeMU.js.br +0 -0
- package/dist/public/assets/{_CZhbwMZe.js → _DRL_n9J6.js} +1 -1
- package/dist/public/assets/_DRL_n9J6.js.br +0 -0
- package/dist/public/assets/_DSgQl7Pk.js +1 -0
- package/dist/public/assets/_DTHmOuNc.js +1 -0
- package/dist/public/assets/{_BQxoz96i.js → _DVY3fcEK.js} +1 -1
- package/dist/public/assets/_DVY3fcEK.js.br +0 -0
- package/dist/public/assets/{_CXWbjEP0.js → _DZz9MbXl.js} +1 -1
- package/dist/public/assets/_DZz9MbXl.js.br +0 -0
- package/dist/public/assets/_DgL926dJ.js +1 -0
- package/dist/public/assets/_Dgj4909A.js +1 -0
- package/dist/public/assets/_Dhg6lcCk.js +1 -0
- package/dist/public/assets/_Dkx2Sfog.js +1 -0
- package/dist/public/assets/{_DmFs1Utt.js → _DmGYdsRW.js} +1 -1
- package/dist/public/assets/_DmGYdsRW.js.br +0 -0
- package/dist/public/assets/{_oIKkSCKy.js → _DqLPCQ3u.js} +1 -1
- package/dist/public/assets/_DqLPCQ3u.js.br +0 -0
- package/dist/public/assets/_DrrDVRu1.js +1 -0
- package/dist/public/assets/_DsK6R8lY.js +1 -0
- package/dist/public/assets/_DtyN2rzV.js +1 -0
- package/dist/public/assets/{_C0zcVe1s.js → _DvAdP_No.js} +1 -1
- package/dist/public/assets/_DvAdP_No.js.br +0 -0
- package/dist/public/assets/_DwAMNetA.js +1 -0
- package/dist/public/assets/_DwAMNetA.js.br +0 -0
- package/dist/public/assets/{_sGKd4e0n.js → _DwQ8mMHG.js} +1 -1
- package/dist/public/assets/_DwQ8mMHG.js.br +0 -0
- package/dist/public/assets/{_Blp9DYCK.js → _DxYTNHIt.js} +1 -1
- package/dist/public/assets/_DxYTNHIt.js.br +0 -0
- package/dist/public/assets/{_CljessIq.js → _DxitXEJj.js} +1 -1
- package/dist/public/assets/_DxitXEJj.js.br +0 -0
- package/dist/public/assets/_Dy1vnD3T.js +1 -0
- package/dist/public/assets/_Dy1vnD3T.js.br +0 -0
- package/dist/public/assets/_DzMERi3P.js +1 -0
- package/dist/public/assets/_DzMERi3P.js.br +0 -0
- package/dist/public/assets/_DzX3VDiq.js +1 -0
- package/dist/public/assets/{_CK65eJYm.js → _E3SkFtD-.js} +1 -1
- package/dist/public/assets/_E3SkFtD-.js.br +0 -0
- package/dist/public/assets/{_DW_O6H-y.js → _ESvbV1Pz.js} +1 -1
- package/dist/public/assets/_ESvbV1Pz.js.br +0 -0
- package/dist/public/assets/_Fy9qN7GH.js +1 -0
- package/dist/public/assets/_GhixQ9h3.js +1 -0
- package/dist/public/assets/_HEPFIxLb.js +1 -0
- package/dist/public/assets/_Jc9EjAZV.js +1 -0
- package/dist/public/assets/_MsfXZA7P.js +1 -0
- package/dist/public/assets/_OZFXEHQn.js +1 -0
- package/dist/public/assets/_OZFXEHQn.js.br +0 -0
- package/dist/public/assets/_R3EqoYPX.js +1 -0
- package/dist/public/assets/{_CfKaigDY.js → _RJzr0dZO.js} +1 -1
- package/dist/public/assets/_RJzr0dZO.js.br +0 -0
- package/dist/public/assets/_XDn5I7G_.js +1 -0
- package/dist/public/assets/_XkAOArBG.js +1 -0
- package/dist/public/assets/_XwiJuNGt.js +1 -0
- package/dist/public/assets/_XwiJuNGt.js.br +0 -0
- package/dist/public/assets/{_B4X_zPcA.js → _Ys64d1hY.js} +1 -1
- package/dist/public/assets/_Ys64d1hY.js.br +0 -0
- package/dist/public/assets/_YzHfdk9-.js +1 -0
- package/dist/public/assets/_a0IobEaK.js +1 -0
- package/dist/public/assets/_a0IobEaK.js.br +0 -0
- package/dist/public/assets/{_BPgWrtVf.js → _bLJ6s3tx.js} +1 -1
- package/dist/public/assets/_bLJ6s3tx.js.br +0 -0
- package/dist/public/assets/{_0MbXVcSe.js → _cuV0tCcy.js} +1 -1
- package/dist/public/assets/_cuV0tCcy.js.br +0 -0
- package/dist/public/assets/_dVr8FSlb.js +1 -0
- package/dist/public/assets/_do7rh2Pl.js +1 -0
- package/dist/public/assets/_h9FAQpfV.js +1 -0
- package/dist/public/assets/_jEkh7vZn.js +9 -0
- package/dist/public/assets/_jEkh7vZn.js.br +0 -0
- package/dist/public/assets/{_B8rIpPzF.js → _nS3ataej.js} +1 -1
- package/dist/public/assets/_nS3ataej.js.br +0 -0
- package/dist/public/assets/{_B-zsST8q.js → _pOJtcYjD.js} +1 -1
- package/dist/public/assets/_pOJtcYjD.js.br +0 -0
- package/dist/public/assets/{_BIG5VZ4Z.js → _uXj9T0xP.js} +1 -1
- package/dist/public/assets/_uXj9T0xP.js.br +0 -0
- package/dist/public/assets/_ucgLoo05.js +1 -0
- package/dist/public/assets/_w-xkXZ8E.js +1 -0
- package/dist/public/assets/_wlSaEyny.js +1 -0
- package/dist/public/assets/_wtK9ZE_Z.js +1 -0
- package/dist/public/assets/{_Cw8g9JDU.js → _xqWrEpUY.js} +1 -1
- package/dist/public/assets/_xqWrEpUY.js.br +0 -0
- package/dist/public/assets/{app-page-i4C1mZEJ.css → app-page-7H08c3I-.css} +1 -1
- package/dist/public/assets/app-page-7H08c3I-.css.br +0 -0
- package/dist/public/assets/command-palette-DznLnS4u.css +1 -0
- package/dist/public/assets/command-palette-DznLnS4u.css.br +0 -0
- package/dist/public/assets/files-view-C2DU1cWR.css +1 -0
- package/dist/public/assets/files-view-C2DU1cWR.css.br +0 -0
- package/dist/public/assets/files-view-igDTlyDJ.js +2 -0
- package/dist/public/assets/group.css.ts-bSDNRl7w.css +1 -0
- package/dist/public/assets/group.css.ts-bSDNRl7w.css.br +0 -0
- package/dist/public/assets/{icon-search-B4XHh_CO.css → icon-search-DfWEAb0U.css} +1 -1
- package/dist/public/assets/icon-search-DfWEAb0U.css.br +0 -0
- package/dist/public/assets/key-bar.css.ts-BTJZg39o.css +1 -0
- package/dist/public/assets/key-bar.css.ts-BTJZg39o.css.br +0 -0
- package/dist/public/assets/manage-workspace-CtbbyFTz.css +1 -0
- package/dist/public/assets/manage-workspace-DEA0DakP.js +2 -0
- package/dist/public/assets/{modal-view-DR14P4Vp.css → modal-view-UBeCgIX7.css} +1 -1
- package/dist/public/assets/modal-view-UBeCgIX7.css.br +0 -0
- package/dist/public/assets/new-BghcDO9d.js +1 -0
- package/dist/public/assets/new-workspace-BXOfY6rJ.js +2 -0
- package/dist/public/assets/new-workspace-Bwp3x-k4.css +1 -0
- package/dist/public/assets/new-workspace-Bwp3x-k4.css.br +0 -0
- package/dist/public/assets/port-chip-koYvmCHX.css +1 -0
- package/dist/public/assets/port-chip-koYvmCHX.css.br +0 -0
- package/dist/public/assets/prompt-dialog-CMO-DYPR.css +1 -0
- package/dist/public/assets/prompt-dialog-CMO-DYPR.css.br +0 -0
- package/dist/public/assets/quick-open-BtnVdokh.css +1 -0
- package/dist/public/assets/quick-open-BtnVdokh.css.br +0 -0
- package/dist/public/assets/repo-picker-ksIdHgVt.css +1 -0
- package/dist/public/assets/repo-picker-ksIdHgVt.css.br +2 -0
- package/dist/public/assets/review-view-6oyNdZlh.css +1 -0
- package/dist/public/assets/review-view-6oyNdZlh.css.br +0 -0
- package/dist/public/assets/review-view-SNOuunsb.js +2 -0
- package/dist/public/assets/section-FKuEPvAV.css +1 -0
- package/dist/public/assets/section-FKuEPvAV.css.br +0 -0
- package/dist/public/assets/settings-BghcDO9d.js +1 -0
- package/dist/public/assets/settings-page-BkSdJnGO.js +2 -0
- package/dist/public/assets/settings-page-CrEBYIgM.css +1 -0
- package/dist/public/assets/settings-page-CrEBYIgM.css.br +0 -0
- package/dist/public/assets/skill-row-bJ0ycL8_.css +1 -0
- package/dist/public/assets/sso-auth-B-FuRIHY.css +1 -0
- package/dist/public/assets/sso-auth-B-FuRIHY.css.br +0 -0
- package/dist/public/assets/w-BghcDO9d.js +1 -0
- package/dist/public/assets/w._-9IPZWvbQ.js +1 -0
- package/dist/public/assets/w._-BghcDO9d.js +1 -0
- package/dist/public/assets/w._-DsoxEZXy.js +1 -0
- package/package.json +1 -1
- package/dist/public/assets/_0MbXVcSe.js.br +0 -0
- package/dist/public/assets/_0bNpq_Od.js.br +0 -0
- package/dist/public/assets/_3A53x_11.js +0 -1
- package/dist/public/assets/_3tZA10Xt.js +0 -2801
- package/dist/public/assets/_3tZA10Xt.js.br +0 -0
- package/dist/public/assets/_4C-pzw-U.js +0 -1
- package/dist/public/assets/_4Jx3rZB3.js +0 -1
- package/dist/public/assets/_6fXseVVz.js.br +0 -0
- package/dist/public/assets/_Aaj0WYjQ.js +0 -1
- package/dist/public/assets/_B-zsST8q.js.br +0 -0
- package/dist/public/assets/_B4X_zPcA.js.br +0 -0
- package/dist/public/assets/_B4x1Ar8Y.js +0 -1
- package/dist/public/assets/_B5StVYF6.js.br +0 -0
- package/dist/public/assets/_B7aK3vGn.js +0 -1
- package/dist/public/assets/_B8TcMuPN.js.br +0 -0
- package/dist/public/assets/_B8iJi2pt.js.br +0 -0
- package/dist/public/assets/_B8nGNkIS.js +0 -1
- package/dist/public/assets/_B8rIpPzF.js.br +0 -0
- package/dist/public/assets/_B9HxhiqE.js.br +0 -0
- package/dist/public/assets/_BE9Nb8VY.js +0 -1
- package/dist/public/assets/_BIG5VZ4Z.js.br +0 -0
- package/dist/public/assets/_BIULk7FY.js.br +0 -0
- package/dist/public/assets/_BJQ2Y6DP.js.br +0 -0
- package/dist/public/assets/_BK9i2P3k.js.br +0 -0
- package/dist/public/assets/_BLX9BNdi.js +0 -1
- package/dist/public/assets/_BMIWLwHE.js.br +0 -0
- package/dist/public/assets/_BPgWrtVf.js.br +0 -0
- package/dist/public/assets/_BQxoz96i.js.br +0 -0
- package/dist/public/assets/_BU4H4QjV.js +0 -1
- package/dist/public/assets/_BUIAIA9j.js +0 -1
- package/dist/public/assets/_BVhDa8AS.js.br +0 -0
- package/dist/public/assets/_BXzJtHiF.js.br +0 -0
- package/dist/public/assets/_BYgzreQb.js +0 -1
- package/dist/public/assets/_BZgNzbSE.js +0 -2
- package/dist/public/assets/_BZgNzbSE.js.br +0 -0
- package/dist/public/assets/_BZlzIrNM.js.br +0 -0
- package/dist/public/assets/_B_4eHSpm.js.br +0 -0
- package/dist/public/assets/_B_C8Mg1b.js.br +0 -0
- package/dist/public/assets/_Ba9udh-9.js +0 -1
- package/dist/public/assets/_Bf44GLWw.js +0 -1
- package/dist/public/assets/_BggJLA1_.js.br +0 -0
- package/dist/public/assets/_BiEnOZPI.js +0 -1
- package/dist/public/assets/_BiJOguB5.js +0 -1
- package/dist/public/assets/_BjnpWMH5.js +0 -1
- package/dist/public/assets/_BjsSfXZW.js +0 -1
- package/dist/public/assets/_Blp9DYCK.js.br +0 -0
- package/dist/public/assets/_BofgUgCl.js.br +0 -0
- package/dist/public/assets/_Btiz8gFh.js.br +0 -0
- package/dist/public/assets/_By_fuZbd.js.br +0 -0
- package/dist/public/assets/_BzoVBQQV.js +0 -1
- package/dist/public/assets/_C0zcVe1s.js.br +0 -0
- package/dist/public/assets/_C1kAFId8.js.br +0 -0
- package/dist/public/assets/_C2fBuiAT.js +0 -1
- package/dist/public/assets/_C31V_Nt0.js +0 -1
- package/dist/public/assets/_C5gPPOOA.js +0 -1
- package/dist/public/assets/_CCwt6cBc.js.br +0 -0
- package/dist/public/assets/_CDBTOJV7.js.br +0 -0
- package/dist/public/assets/_CEJNkgrb.js.br +0 -0
- package/dist/public/assets/_CG1iZdce.js +0 -1
- package/dist/public/assets/_CIl290bw.js +0 -1
- package/dist/public/assets/_CJ4oVYCp.js +0 -1
- package/dist/public/assets/_CJGL0lvW.js.br +0 -0
- package/dist/public/assets/_CK65eJYm.js.br +0 -0
- package/dist/public/assets/_CMDhPKMI.js +0 -1
- package/dist/public/assets/_CMDhPKMI.js.br +0 -0
- package/dist/public/assets/_CNcCChyO.js.br +0 -0
- package/dist/public/assets/_CUtmkhg2.js +0 -1
- package/dist/public/assets/_CXWbjEP0.js.br +0 -0
- package/dist/public/assets/_CZGbNTgO.js.br +0 -0
- package/dist/public/assets/_CZhbwMZe.js.br +0 -0
- package/dist/public/assets/_CZswgiNr.js +0 -1
- package/dist/public/assets/_CZswgiNr.js.br +0 -0
- package/dist/public/assets/_Cdw9U5OX.js.br +0 -0
- package/dist/public/assets/_CdzWzG8M.js.br +0 -0
- package/dist/public/assets/_CeIK9Vcg.js +0 -1
- package/dist/public/assets/_CfKaigDY.js.br +0 -0
- package/dist/public/assets/_Ch4Bpzn_.js.br +0 -0
- package/dist/public/assets/_ChQIwrTz.js +0 -1
- package/dist/public/assets/_ChQIwrTz.js.br +0 -0
- package/dist/public/assets/_CiJXzOpK.js.br +0 -0
- package/dist/public/assets/_CisXuU89.js +0 -1
- package/dist/public/assets/_CljessIq.js.br +0 -0
- package/dist/public/assets/_CmMzFrwK.js +0 -1
- package/dist/public/assets/_CmMzFrwK.js.br +0 -0
- package/dist/public/assets/_CnYl85rz.js +0 -1
- package/dist/public/assets/_Cq7wIjY_.js +0 -1
- package/dist/public/assets/_CqVlxuqg.js +0 -1
- package/dist/public/assets/_CsRWU4jP.js +0 -1
- package/dist/public/assets/_CsXZz87A.js +0 -1
- package/dist/public/assets/_Cvih66_W.js +0 -1
- package/dist/public/assets/_Cw8g9JDU.js.br +0 -0
- package/dist/public/assets/_CwUSM3_K.js +0 -1
- package/dist/public/assets/_D0SvJpzb.js.br +0 -0
- package/dist/public/assets/_D3KU9c5P.js.br +0 -0
- package/dist/public/assets/_D5L8I-l6.js.br +0 -0
- package/dist/public/assets/_D68MPeN_.js +0 -1
- package/dist/public/assets/_D9UjR1wv.js +0 -1
- package/dist/public/assets/_D9UjR1wv.js.br +0 -0
- package/dist/public/assets/_DAYUY_mY.js +0 -1
- package/dist/public/assets/_DApFf-Du.js.br +0 -0
- package/dist/public/assets/_DBgC6pSG.js.br +0 -0
- package/dist/public/assets/_DC5Dtd8V.js +0 -1
- package/dist/public/assets/_DCE-ttoo.js +0 -9
- package/dist/public/assets/_DCE-ttoo.js.br +0 -0
- package/dist/public/assets/_DIeJpzm3.js.br +0 -0
- package/dist/public/assets/_DIoDmY9H.js +0 -1
- package/dist/public/assets/_DMdqORi3.js.br +0 -0
- package/dist/public/assets/_DNTUKUkr.js.br +0 -0
- package/dist/public/assets/_DNdknsGz.js +0 -1
- package/dist/public/assets/_DOJho7wg.js +0 -1
- package/dist/public/assets/_DOJho7wg.js.br +0 -0
- package/dist/public/assets/_DOKq-7nt.js.br +0 -0
- package/dist/public/assets/_DOW1WHeh.js +0 -1
- package/dist/public/assets/_DOW1WHeh.js.br +0 -0
- package/dist/public/assets/_DQJeVQRh.js +0 -1
- package/dist/public/assets/_DQPZ_gMG.js +0 -1
- package/dist/public/assets/_DQPZ_gMG.js.br +0 -0
- package/dist/public/assets/_DQQonU3w.js +0 -6
- package/dist/public/assets/_DQQonU3w.js.br +0 -0
- package/dist/public/assets/_DR0OiJB5.js +0 -1
- package/dist/public/assets/_DW_O6H-y.js.br +0 -0
- package/dist/public/assets/_DXIo8HpM.js +0 -1
- package/dist/public/assets/_DXMbGrjj.js.br +0 -0
- package/dist/public/assets/_DZ9AjglW.js +0 -1
- package/dist/public/assets/_DZkOOp-M.js +0 -1
- package/dist/public/assets/_DaXhejkn.js +0 -1
- package/dist/public/assets/_DbaaR2fn.js +0 -86
- package/dist/public/assets/_DbaaR2fn.js.br +0 -0
- package/dist/public/assets/_DcHotOlK.js.br +0 -0
- package/dist/public/assets/_DdYyufjz.js +0 -1
- package/dist/public/assets/_De6U1yos.js +0 -1
- package/dist/public/assets/_De6U1yos.js.br +0 -0
- package/dist/public/assets/_DfM9jO21.js +0 -1
- package/dist/public/assets/_DfM9jO21.js.br +0 -0
- package/dist/public/assets/_DkRBy2f_.js.br +0 -0
- package/dist/public/assets/_DlNqbijs.js +0 -1
- package/dist/public/assets/_DmFs1Utt.js.br +0 -0
- package/dist/public/assets/_Dnw3Y3VQ.js +0 -1
- package/dist/public/assets/_Dp7dWMLi.js +0 -1
- package/dist/public/assets/_DpSu73pS.js.br +0 -0
- package/dist/public/assets/_DqRNAihg.js +0 -1
- package/dist/public/assets/_Dt8mpgeW.js +0 -1
- package/dist/public/assets/_Dw880M9B.js.br +0 -0
- package/dist/public/assets/_DwEFaBdE.js.br +0 -0
- package/dist/public/assets/_Dy4S_A2m.js.br +0 -0
- package/dist/public/assets/_F7ODVJf7.js +0 -1
- package/dist/public/assets/_F7ODVJf7.js.br +0 -0
- package/dist/public/assets/_FMwpfKJh.js.br +0 -0
- package/dist/public/assets/_GHKO-Gqk.js +0 -1
- package/dist/public/assets/_Ibn8XBox.js +0 -1
- package/dist/public/assets/_Ibn8XBox.js.br +0 -0
- package/dist/public/assets/_OVbe0fvD.js.br +0 -0
- package/dist/public/assets/_S0SsdbnP.js.br +0 -0
- package/dist/public/assets/_S9kAX5oa.js +0 -1
- package/dist/public/assets/_SlRagSbv.js +0 -1
- package/dist/public/assets/_U-lVqtpJ.js +0 -1
- package/dist/public/assets/_U-lVqtpJ.js.br +0 -0
- package/dist/public/assets/_VNgKOzDO.js +0 -1
- package/dist/public/assets/_YrTBFaWQ.js +0 -1
- package/dist/public/assets/_e4WYue8n.js +0 -1
- package/dist/public/assets/_e58SVS_5.js.br +0 -0
- package/dist/public/assets/_ff3WHmh-.js +0 -1
- package/dist/public/assets/_hvHdq4dT.js +0 -1
- package/dist/public/assets/_jZOmjqR_.js +0 -1
- package/dist/public/assets/_krh26UYB.js +0 -1
- package/dist/public/assets/_mx0u5F7j.js.br +0 -0
- package/dist/public/assets/_oIKkSCKy.js.br +0 -0
- package/dist/public/assets/_ohWFtYuq.js +0 -1
- package/dist/public/assets/_rnm6ARwk.js +0 -1
- package/dist/public/assets/_sGKd4e0n.js.br +0 -0
- package/dist/public/assets/_t3yF4GJM.js.br +0 -0
- package/dist/public/assets/_ubLmP4Sp.js +0 -1
- package/dist/public/assets/_v0lZuQ-1.js.br +0 -0
- package/dist/public/assets/_x_XUGGSA.js.br +0 -0
- package/dist/public/assets/app-page-i4C1mZEJ.css.br +0 -0
- package/dist/public/assets/command-palette-CTIbUH22.css +0 -1
- package/dist/public/assets/command-palette-CTIbUH22.css.br +0 -0
- package/dist/public/assets/files-view-C_gu0deu.js +0 -2
- package/dist/public/assets/files-view-DiHOXqp3.css +0 -1
- package/dist/public/assets/files-view-DiHOXqp3.css.br +0 -0
- package/dist/public/assets/group.css.ts-DkHzYLC_.css +0 -1
- package/dist/public/assets/group.css.ts-DkHzYLC_.css.br +0 -0
- package/dist/public/assets/icon-search-B4XHh_CO.css.br +0 -0
- package/dist/public/assets/key-bar.css.ts-CbGYKVtb.css +0 -1
- package/dist/public/assets/key-bar.css.ts-CbGYKVtb.css.br +0 -0
- package/dist/public/assets/manage-workspace-BhEfyhCZ.js +0 -2
- package/dist/public/assets/manage-workspace-C5JRczkL.css +0 -1
- package/dist/public/assets/modal-view-DR14P4Vp.css.br +0 -0
- package/dist/public/assets/new-aZKrZ7z6.js +0 -1
- package/dist/public/assets/new-workspace-5cfHsdD-.js +0 -2
- package/dist/public/assets/new-workspace-DXqJonRU.css +0 -1
- package/dist/public/assets/new-workspace-DXqJonRU.css.br +0 -0
- package/dist/public/assets/port-chip-BzW1eC-h.css +0 -1
- package/dist/public/assets/port-chip-BzW1eC-h.css.br +0 -0
- package/dist/public/assets/prompt-dialog-Cngg9xmw.css +0 -1
- package/dist/public/assets/prompt-dialog-Cngg9xmw.css.br +0 -0
- package/dist/public/assets/quick-open-FsUXrkDi.css +0 -1
- package/dist/public/assets/quick-open-FsUXrkDi.css.br +0 -0
- package/dist/public/assets/repo-picker-C4DYC9dZ.css +0 -1
- package/dist/public/assets/repo-picker-C4DYC9dZ.css.br +0 -3
- package/dist/public/assets/review-view-CkG8zcfD.js +0 -2
- package/dist/public/assets/review-view-JHqeAzx5.css +0 -1
- package/dist/public/assets/review-view-JHqeAzx5.css.br +0 -0
- package/dist/public/assets/section-DncyjwUi.css +0 -1
- package/dist/public/assets/section-DncyjwUi.css.br +0 -0
- package/dist/public/assets/settings-aZKrZ7z6.js +0 -1
- package/dist/public/assets/settings-page-CST99SED.js +0 -2
- package/dist/public/assets/settings-page-rYO5_GvI.css +0 -1
- package/dist/public/assets/settings-page-rYO5_GvI.css.br +0 -0
- package/dist/public/assets/skill-row-ChQm9ooq.css +0 -1
- package/dist/public/assets/sso-auth-C2HBp8cP.css +0 -1
- package/dist/public/assets/sso-auth-C2HBp8cP.css.br +0 -0
- package/dist/public/assets/w-aZKrZ7z6.js +0 -1
- package/dist/public/assets/w._-Bg5IDzW7.js +0 -1
- package/dist/public/assets/w._-C2hhF8-w.js +0 -1
- package/dist/public/assets/w._-aZKrZ7z6.js +0 -1
|
@@ -1,2801 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_Blp9DYCK.js","assets/_CMDhPKMI.js","assets/_DQPZ_gMG.js","assets/_Ibn8XBox.js","assets/icon-search-B4XHh_CO.css","assets/_1ROJt5O3.js","assets/_U-lVqtpJ.js","assets/command-palette-CTIbUH22.css","assets/_CCwt6cBc.js","assets/_CEJNkgrb.js","assets/_BK9i2P3k.js","assets/_CiJXzOpK.js","assets/_BJQ2Y6DP.js","assets/_0bNpq_Od.js","assets/_DW_O6H-y.js","assets/_BZlzIrNM.js","assets/_t3yF4GJM.js","assets/_CfKaigDY.js","assets/_DNTUKUkr.js","assets/_BXeXVLqQ.js","assets/_DmFs1Utt.js","assets/_0MbXVcSe.js","assets/_DJRzHHPO.js","assets/_DOKq-7nt.js","assets/_YkIvmgMd.js","assets/_bTVj8UrX.js","assets/_B5StVYF6.js","assets/_BAfg1_wL.js","assets/_gzcpVVnB.js","assets/_CXWbjEP0.js","assets/_DkRBy2f_.js","assets/_Ch4Bpzn_.js","assets/_BIG5VZ4Z.js","assets/_D3KU9c5P.js","assets/_BIULk7FY.js","assets/_CZGbNTgO.js","assets/_BXzJtHiF.js","assets/_BggJLA1_.js","assets/_By_fuZbd.js","assets/_Dw880M9B.js","assets/_CK65eJYm.js","assets/_D0SvJpzb.js","assets/_B4X_zPcA.js","assets/_CJGL0lvW.js","assets/_Btiz8gFh.js","assets/_BPgWrtVf.js","assets/_OVbe0fvD.js","assets/_BaHq4SXp.js","assets/_BYOwaDjH.js","assets/_CQJs3lWb.js","assets/_CYNrtFtB.js","assets/_DmIc4jLQ.js","assets/_DbYA3moe.js","assets/_CBce3t8t.js","assets/_DYvRD3hg.js","assets/_Dl-2e7rI.js","assets/_woXpYk--.js","assets/_C9fqX4vB.js","assets/_DApFf-Du.js","assets/_CNcCChyO.js","assets/_B8iJi2pt.js","assets/_B-zsST8q.js","assets/_B_4eHSpm.js","assets/_B8TcMuPN.js","assets/_Dx-8-gkx.js","assets/_DekxQCZG.js","assets/_C8oCnwJJ.js","assets/_Cw8g9JDU.js","assets/_DwEFaBdE.js","assets/_CljessIq.js","assets/_DXMbGrjj.js","assets/_x_XUGGSA.js","assets/_D5L8I-l6.js","assets/_CdzWzG8M.js","assets/_e58SVS_5.js","assets/_BQxoz96i.js","assets/_C0zcVe1s.js","assets/_DVTAwKKz.js","assets/_B8rIpPzF.js","assets/_DWQbgPoS.js","assets/_DJMQeKeT.js","assets/_mx0u5F7j.js","assets/_Dy4S_A2m.js","assets/_oIKkSCKy.js","assets/_DqKBuwfJ.js","assets/_oqKa8noW.js","assets/_CnvKMtbv.js","assets/_IyjqRm3v.js","assets/_rLFTqkRN.js","assets/_CacY0gHj.js","assets/_B5eOa1yu.js","assets/_Dixweg8N.js","assets/_D1A_Heim.js","assets/_O90oeIOV.js","assets/_DpSu73pS.js","assets/_DOwzaHZ0.js","assets/_B3gFvitq.js","assets/_Cfkwpbl8.js","assets/_BiFt_7mu.js","assets/_CMLA9XwU.js","assets/_FMwpfKJh.js","assets/_v0lZuQ-1.js","assets/_C1kAFId8.js","assets/_6fXseVVz.js","assets/_DcHotOlK.js","assets/_Bj61d0ZC.js","assets/_BVhDa8AS.js","assets/_DB-OQ-9y.js","assets/_Cvrh5tZx.js","assets/_DZcAKw3P.js","assets/_sGKd4e0n.js","assets/_L8AbGenz.js","assets/_ByJddavk.js","assets/_CZhbwMZe.js","assets/_CDBTOJV7.js","assets/_DBgC6pSG.js","assets/_BofgUgCl.js","assets/_S0SsdbnP.js","assets/_BMIWLwHE.js","assets/_DMdqORi3.js","assets/_qdxAdBWQ.js","assets/_Ci_nEsc7.js","assets/_CYpm1nAK.js","assets/_BNLmms1o.js","assets/_CCSX75yM.js","assets/_CyEgAFGc.js","assets/_Dh5ihWbf.js","assets/_B2gwz-sJ.js","assets/_B9HxhiqE.js","assets/_B_C8Mg1b.js","assets/_DIeJpzm3.js","assets/_B6D30XZt.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{C as e,M as t,N as n,T as r,j as i,n as a,t as o}from"./_CMDhPKMI.js";import{B as s,F as c,G as l,H as u,I as d,K as f,L as p,N as m,O as h,P as g,R as _,S as v,W as y,a as b,b as x,d as S,i as C,t as w,u as T,x as E,y as D,z as O}from"./_DQPZ_gMG.js";import{C as k,E as A,S as ee,T as j,W as te,Z as M,_ as ne,_t as re,a as ie,b as ae,bn as oe,gn as se,ht as ce,i as le,n as ue,r as de,t as fe,v as pe,vt as me,w as he,wt as ge,x as _e,y as ve}from"./_Ibn8XBox.js";import{c as ye,i as be,l as xe,n as Se,o as Ce,r as we,s as Te}from"./_DZ9AjglW.js";import{_ as Ee,g as De,h as Oe,v as N}from"./_U-lVqtpJ.js";import{a as ke,c as Ae,d as je,f as Me,i as Ne,l as Pe,n as Fe,o as Ie,p as Le,r as Re,s as ze,t as Be,u as Ve}from"./_DOJho7wg.js";import{t as He}from"./_CcFCI5Av.js";import{a as Ue,i as We,n as Ge,r as Ke,t as qe}from"./_BiJOguB5.js";import{a as Je,i as Ye,n as Xe,r as Ze,t as Qe}from"./_BE9Nb8VY.js";var $e=`diffs-container`,et=(()=>{try{return!1}catch{return!1}})(),tt=/(?=^From [a-f0-9]+ .+$)/m,nt=/(?=^diff --git)/gm,rt=/(?<=\n)/,it=/^(---|\+\+\+)\s+([^\t\r\n]+)/,at=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,ot=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,st=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,ct=`header-prefix`,lt=`header-filename-suffix`,ut=`header-metadata`,P=`header-custom`,F={dark:`pierre-dark`,light:`pierre-light`},dt=`data-theme-css`,ft=`data-unsafe-css`,pt=`data-diffs-scrollbar-measure`,mt=`data-diffs-code-view-header`,ht=`data-diffs-code-view-footer`,gt=`--diffs-scrollbar-gutter-measured`,_t=1e5,vt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},yt={...vt,hunkLineCount:1},bt={paddingTop:8,paddingBottom:8,gap:8},xt={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},St=Object.freeze({fromStart:0,fromEnd:0}),Ct={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},wt={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Tt=new Map,Et=new Map,Dt=new Map,Ot=new Set;function kt(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Ot.has(t))return!1;return!0}function At(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Ot.has(n.name))continue;let e=Tt.get(n.name);e??(e=n,Tt.set(n.name,e));let r=e.data.find(t=>t.name===e.name||t.aliases?.includes(e.name)===!0);if(r==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${e.name}" as its name or an alias.`);t.loadLanguageSync(e.data);try{t.getLanguage(e.name)}catch{throw Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${e.name}". Load the alias first or give the grammar a unique name.`)}Ot.add(e.name)}}function jt(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Mt=Object.defineProperty,Nt=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyNames,Ft=Object.prototype.hasOwnProperty,It=(e,t)=>{let n={};for(var r in e)Mt(n,r,{get:e[r],enumerable:!0});return t||Mt(n,Symbol.toStringTag,{value:`Module`}),n},Lt=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Pt(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ft.call(e,s)&&s!==n&&Mt(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Nt(t,s))||r.enumerable});return e},Rt=(e,t,n)=>(Lt(e,t,`default`),n&&Lt(n,t,`default`)),zt=[{id:`abap`,name:`ABAP`,import:(()=>w(()=>import(`./_CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>w(()=>import(`./_Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>w(()=>import(`./_C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>w(()=>import(`./_CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>w(()=>import(`./__6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>w(()=>import(`./_Blp9DYCK.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>w(()=>import(`./_CiJXzOpK.js`),__vite__mapDeps([11,0,1,2,3,4,5,6,7,8,9,10,12])))},{id:`apache`,name:`Apache Conf`,import:(()=>w(()=>import(`./_U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>w(()=>import(`./_KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>w(()=>import(`./_0bNpq_Od.js`),__vite__mapDeps([13,9,1,2,3,4,5,6,7,10,8,14,15,16])))},{id:`applescript`,name:`AppleScript`,import:(()=>w(()=>import(`./_CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>w(()=>import(`./_4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>w(()=>import(`./_SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>w(()=>import(`./_Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>w(()=>import(`./_CfKaigDY.js`),__vite__mapDeps([17,9,1,2,3,4,5,6,7,10,16,18,19,20])))},{id:`awk`,name:`AWK`,import:(()=>w(()=>import(`./_BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>w(()=>import(`./_B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>w(()=>import(`./_qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>w(()=>import(`./_D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>w(()=>import(`./_DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>w(()=>import(`./_Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>w(()=>import(`./_CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>w(()=>import(`./_CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>w(()=>import(`./_0MbXVcSe.js`),__vite__mapDeps([21,9,1,2,3,4,5,6,7,10,8,14,15,16,22,23])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>w(()=>import(`./_YkIvmgMd.js`),__vite__mapDeps([24,25])))},{id:`c`,name:`C`,import:(()=>w(()=>import(`./_B5StVYF6.js`).then(e=>e.n),__vite__mapDeps([26,1,2,3,4,5,6,7])))},{id:`c3`,name:`C3`,import:(()=>w(()=>import(`./_D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>w(()=>import(`./_CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>w(()=>import(`./_BAfg1_wL.js`),__vite__mapDeps([27,28])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>w(()=>import(`./_CXWbjEP0.js`),__vite__mapDeps([29,26,1,2,3,4,5,6,7])))},{id:`clarity`,name:`Clarity`,import:(()=>w(()=>import(`./_CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>w(()=>import(`./_DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>w(()=>import(`./_Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>w(()=>import(`./_DkRBy2f_.js`),__vite__mapDeps([30,8,1,2,3,4,5,6,7,9,10,15])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>w(()=>import(`./_C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>w(()=>import(`./_oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>w(()=>import(`./_Ch4Bpzn_.js`),__vite__mapDeps([31,9,1,2,3,4,5,6,7])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>w(()=>import(`./_Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>w(()=>import(`./_DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>w(()=>import(`./_BIG5VZ4Z.js`).then(e=>e.n),__vite__mapDeps([32,1,2,3,4,5,6,7,33,34,26])))},{id:`crystal`,name:`Crystal`,import:(()=>w(()=>import(`./_CZGbNTgO.js`),__vite__mapDeps([35,9,1,2,3,4,5,6,7,10,8,23,26,36])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>w(()=>import(`./_oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>w(()=>import(`./_BK9i2P3k.js`).then(e=>e.n),__vite__mapDeps([10,1,2,3,4,5,6,7])))},{id:`csv`,name:`CSV`,import:(()=>w(()=>import(`./_Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>w(()=>import(`./_CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>w(()=>import(`./_ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>w(()=>import(`./_qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>w(()=>import(`./_CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>w(()=>import(`./_BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>w(()=>import(`./_Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>w(()=>import(`./_woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>w(()=>import(`./_IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>w(()=>import(`./__5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>w(()=>import(`./_DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>w(()=>import(`./_BggJLA1_.js`),__vite__mapDeps([37,8,1,2,3,4,5,6,7,9,10,18,22])))},{id:`elixir`,name:`Elixir`,import:(()=>w(()=>import(`./_By_fuZbd.js`),__vite__mapDeps([38,8,1,2,3,4,5,6,7,9,10])))},{id:`elm`,name:`Elm`,import:(()=>w(()=>import(`./_Dw880M9B.js`),__vite__mapDeps([39,34,1,2,3,4,5,6,7,26])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>w(()=>import(`./_c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>w(()=>import(`./_CK65eJYm.js`),__vite__mapDeps([40,8,1,2,3,4,5,6,7,9,10,41,14,15,23,26,32,33,34,36,42,43,18,20,44,45,46])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>w(()=>import(`./_BaHq4SXp.js`),__vite__mapDeps([47,48])))},{id:`fennel`,name:`Fennel`,import:(()=>w(()=>import(`./_DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>w(()=>import(`./_BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>w(()=>import(`./_C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>w(()=>import(`./_CQJs3lWb.js`),__vite__mapDeps([49,50])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>w(()=>import(`./_CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>w(()=>import(`./_DmIc4jLQ.js`),__vite__mapDeps([51,48])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>w(()=>import(`./_DbYA3moe.js`),__vite__mapDeps([52,53,54])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>w(()=>import(`./_DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>w(()=>import(`./_CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>w(()=>import(`./_CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>w(()=>import(`./_DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>w(()=>import(`./_Dl-2e7rI.js`),__vite__mapDeps([55,56])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>w(()=>import(`./_C9fqX4vB.js`),__vite__mapDeps([57,36,1,2,3,4,5,6,7])))},{id:`gleam`,name:`Gleam`,import:(()=>w(()=>import(`./_CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>w(()=>import(`./_DApFf-Du.js`),__vite__mapDeps([58,9,1,2,3,4,5,6,7,10,8,18])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>w(()=>import(`./_CNcCChyO.js`),__vite__mapDeps([59,9,1,2,3,4,5,6,7,10,8,18])))},{id:`glsl`,name:`GLSL`,import:(()=>w(()=>import(`./_BIULk7FY.js`).then(e=>e.n),__vite__mapDeps([34,1,2,3,4,5,6,7,26])))},{id:`gn`,name:`GN`,import:(()=>w(()=>import(`./_ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>w(()=>import(`./_7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>w(()=>import(`./_rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>w(()=>import(`./_CJGL0lvW.js`).then(e=>e.n),__vite__mapDeps([43,1,2,3,4,5,6,7,9,18,20,44])))},{id:`groovy`,name:`Groovy`,import:(()=>w(()=>import(`./_CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>w(()=>import(`./_B8iJi2pt.js`),__vite__mapDeps([60,8,1,2,3,4,5,6,7,9,10,23])))},{id:`haml`,name:`Ruby Haml`,import:(()=>w(()=>import(`./_B4X_zPcA.js`).then(e=>e.n),__vite__mapDeps([42,1,2,3,4,5,6,7,9,10])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>w(()=>import(`./_B-zsST8q.js`),__vite__mapDeps([61,9,1,2,3,4,5,6,7,10,8,46])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>w(()=>import(`./_D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>w(()=>import(`./_C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>w(()=>import(`./_Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>w(()=>import(`./_CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>w(()=>import(`./_Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>w(()=>import(`./_CCwt6cBc.js`).then(e=>e.n),__vite__mapDeps([8,1,2,3,4,5,6,7,9,10])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>w(()=>import(`./_DJRzHHPO.js`),__vite__mapDeps([22,8,1,2,3,4,5,6,7,9,10])))},{id:`http`,name:`HTTP`,import:(()=>w(()=>import(`./_B_4eHSpm.js`),__vite__mapDeps([62,14,1,2,3,4,5,6,7,15,16,36,43,9,18,20,44])))},{id:`hurl`,name:`Hurl`,import:(()=>w(()=>import(`./_B8TcMuPN.js`),__vite__mapDeps([63,14,1,2,3,4,5,6,7,15,64,43,9,18,20,44])))},{id:`hxml`,name:`HXML`,import:(()=>w(()=>import(`./_DekxQCZG.js`),__vite__mapDeps([65,66])))},{id:`hy`,name:`Hy`,import:(()=>w(()=>import(`./_CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>w(()=>import(`./_DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>w(()=>import(`./_B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>w(()=>import(`./_BZlzIrNM.js`).then(e=>e.n),__vite__mapDeps([15,1,2,3,4,5,6,7])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>w(()=>import(`./_CEJNkgrb.js`).then(e=>e.n),__vite__mapDeps([9,1,2,3,4,5,6,7])))},{id:`jinja`,name:`Jinja`,import:(()=>w(()=>import(`./_Cw8g9JDU.js`),__vite__mapDeps([67,8,1,2,3,4,5,6,7,9,10])))},{id:`jison`,name:`Jison`,import:(()=>w(()=>import(`./_DwEFaBdE.js`),__vite__mapDeps([68,9,1,2,3,4,5,6,7])))},{id:`json`,name:`JSON`,import:(()=>w(()=>import(`./_t3yF4GJM.js`).then(e=>e.n),__vite__mapDeps([16,1,2,3,4,5,6,7])))},{id:`json5`,name:`JSON5`,import:(()=>w(()=>import(`./_BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>w(()=>import(`./_CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>w(()=>import(`./_CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>w(()=>import(`./_CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>w(()=>import(`./_DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>w(()=>import(`./_Btiz8gFh.js`).then(e=>e.n),__vite__mapDeps([44,1,2,3,4,5,6,7])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>w(()=>import(`./_CljessIq.js`),__vite__mapDeps([69,9,1,2,3,4,5,6,7,23,28,32,33,34,26,70])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>w(()=>import(`./_x_XUGGSA.js`),__vite__mapDeps([71,9,1,2,3,4,5,6,7,18,28,36,41,10,8,14,15,23,26,32,33,34,42,43,20,44,45,46,72])))},{id:`kdl`,name:`KDL`,import:(()=>w(()=>import(`./_CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>w(()=>import(`./_DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>w(()=>import(`./_C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>w(()=>import(`./_CdzWzG8M.js`),__vite__mapDeps([73,74,1,2,3,4,5,6,7,70])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>w(()=>import(`./_CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>w(()=>import(`./_DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>w(()=>import(`./_BQxoz96i.js`),__vite__mapDeps([75,9,1,2,3,4,5,6,7,10,8,16])))},{id:`llvm`,name:`LLVM IR`,import:(()=>w(()=>import(`./_DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>w(()=>import(`./_BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>w(()=>import(`./_Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>w(()=>import(`./_BPgWrtVf.js`).then(e=>e.n),__vite__mapDeps([45,1,2,3,4,5,6,7,26])))},{id:`luau`,name:`Luau`,import:(()=>w(()=>import(`./_C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>w(()=>import(`./_Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>w(()=>import(`./_BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>w(()=>import(`./_C0zcVe1s.js`),__vite__mapDeps([76,10,1,2,3,4,5,6,7,12,18,77])))},{id:`matlab`,name:`MATLAB`,import:(()=>w(()=>import(`./_D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>w(()=>import(`./_B8rIpPzF.js`),__vite__mapDeps([78,22,8,1,2,3,4,5,6,7,9,10,46,48])))},{id:`mdx`,name:`MDX`,import:(()=>w(()=>import(`./_DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>w(()=>import(`./_BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>w(()=>import(`./_BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>w(()=>import(`./_fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>w(()=>import(`./_DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>w(()=>import(`./_BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>w(()=>import(`./__X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>w(()=>import(`./_DWQbgPoS.js`),__vite__mapDeps([79,80])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>w(()=>import(`./_DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>w(()=>import(`./_mx0u5F7j.js`),__vite__mapDeps([81,45,1,2,3,4,5,6,7,26])))},{id:`nim`,name:`Nim`,import:(()=>w(()=>import(`./_Dy4S_A2m.js`),__vite__mapDeps([82,9,1,2,3,4,5,6,7,10,8,14,15,26,34,48])))},{id:`nix`,name:`Nix`,import:(()=>w(()=>import(`./_IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>w(()=>import(`./_CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>w(()=>import(`./_DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>w(()=>import(`./_D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>w(()=>import(`./_BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>w(()=>import(`./_O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>w(()=>import(`./_B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>w(()=>import(`./_BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>w(()=>import(`./_oIKkSCKy.js`),__vite__mapDeps([83,9,1,2,3,4,5,6,7,10,8,12,15,14,16,18,20,23,26,28,84,31,33,32,34,36,85,86,56,87,38,45,46,41,42,43,44,48,47,55,57,88,89,90,70,72,73,74,77,91,82,92,93,94,95,96,97,98,99,100])))},{id:`pascal`,name:`Pascal`,import:(()=>w(()=>import(`./_4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>w(()=>import(`./_D5L8I-l6.js`),__vite__mapDeps([72,9,1,2,3,4,5,6,7,10,8,14,15,23])))},{id:`php`,name:`PHP`,import:(()=>w(()=>import(`./_DpSu73pS.js`),__vite__mapDeps([94,9,1,2,3,4,5,6,7,10,8,14,15,16,23])))},{id:`pkl`,name:`Pkl`,import:(()=>w(()=>import(`./_ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>w(()=>import(`./_DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>w(()=>import(`./_BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>w(()=>import(`./_C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>w(()=>import(`./_BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>w(()=>import(`./_DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>w(()=>import(`./_CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>w(()=>import(`./_DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>w(()=>import(`./_iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>w(()=>import(`./_DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>w(()=>import(`./_v0lZuQ-1.js`),__vite__mapDeps([101,9,1,2,3,4,5,6,7,10,8])))},{id:`puppet`,name:`Puppet`,import:(()=>w(()=>import(`./_CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>w(()=>import(`./_9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>w(()=>import(`./_gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>w(()=>import(`./_C1kAFId8.js`),__vite__mapDeps([102,9,1,2,3,4,5,6,7])))},{id:`qmldir`,name:`QML Directory`,import:(()=>w(()=>import(`./_DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>w(()=>import(`./_Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>w(()=>import(`./_DXMbGrjj.js`).then(e=>e.n),__vite__mapDeps([70,1,2,3,4,5,6,7])))},{id:`racket`,name:`Racket`,import:(()=>w(()=>import(`./_DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>w(()=>import(`./_B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>w(()=>import(`./_6fXseVVz.js`),__vite__mapDeps([103,8,1,2,3,4,5,6,7,9,10,85])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>w(()=>import(`./_C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>w(()=>import(`./_CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>w(()=>import(`./_D3KU9c5P.js`).then(e=>e.n),__vite__mapDeps([33,1,2,3,4,5,6,7])))},{id:`rel`,name:`Rel`,import:(()=>w(()=>import(`./_BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>w(()=>import(`./_Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>w(()=>import(`./_VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>w(()=>import(`./_CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>w(()=>import(`./_DcHotOlK.js`),__vite__mapDeps([104,9,1,2,3,4,5,6,7,22,8,10,28,105,32,33,34,26,36,46,41,14,15,23,42,43,18,20,44,45])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>w(()=>import(`./_D0SvJpzb.js`),__vite__mapDeps([41,9,1,2,3,4,5,6,7,10,8,14,15,23,26,32,33,34,36,42,43,18,20,44,45,46])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>w(()=>import(`./_Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>w(()=>import(`./_BVhDa8AS.js`),__vite__mapDeps([106,23,1,2,3,4,5,6,7])))},{id:`sass`,name:`Sass`,import:(()=>w(()=>import(`./_DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>w(()=>import(`./_BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>w(()=>import(`./_DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>w(()=>import(`./_BJQ2Y6DP.js`).then(e=>e.n),__vite__mapDeps([12,1,2,3,4,5,6,7,10])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>w(()=>import(`./_bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>w(()=>import(`./_DB-OQ-9y.js`),__vite__mapDeps([107,108])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>w(()=>import(`./_BXzJtHiF.js`).then(e=>e.n),__vite__mapDeps([36,1,2,3,4,5,6,7])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>w(()=>import(`./_DZcAKw3P.js`),__vite__mapDeps([109,36,1,2,3,4,5,6,7])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>w(()=>import(`./_BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>w(()=>import(`./_Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>w(()=>import(`./_Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>w(()=>import(`./_sGKd4e0n.js`),__vite__mapDeps([110,8,1,2,3,4,5,6,7,9,10])))},{id:`sparql`,name:`SPARQL`,import:(()=>w(()=>import(`./_L8AbGenz.js`),__vite__mapDeps([111,112])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>w(()=>import(`./_BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>w(()=>import(`./_DOKq-7nt.js`).then(e=>e.n),__vite__mapDeps([23,1,2,3,4,5,6,7])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>w(()=>import(`./_BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>w(()=>import(`./_CZhbwMZe.js`),__vite__mapDeps([113,23,1,2,3,4,5,6,7])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>w(()=>import(`./_B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>w(()=>import(`./_CDBTOJV7.js`),__vite__mapDeps([114,9,1,2,3,4,5,6,7])))},{id:`svelte`,name:`Svelte`,import:(()=>w(()=>import(`./_DBgC6pSG.js`),__vite__mapDeps([115,9,1,2,3,4,5,6,7,10,18,19])))},{id:`swift`,name:`Swift`,import:(()=>w(()=>import(`./_CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>w(()=>import(`./_Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>w(()=>import(`./_BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>w(()=>import(`./_CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>w(()=>import(`./_DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>w(()=>import(`./_CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>w(()=>import(`./_BofgUgCl.js`),__vite__mapDeps([116,9,1,2,3,4,5,6,7,10,88])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>w(()=>import(`./_DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>w(()=>import(`./_e58SVS_5.js`).then(e=>e.n),__vite__mapDeps([74,1,2,3,4,5,6,7,70])))},{id:`toml`,name:`TOML`,import:(()=>w(()=>import(`./_CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>w(()=>import(`./_S0SsdbnP.js`),__vite__mapDeps([117,9,1,2,3,4,5,6,7,10,8,14,15,18,23,34,26])))},{id:`tsv`,name:`TSV`,import:(()=>w(()=>import(`./_sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>w(()=>import(`./_DmFs1Utt.js`).then(e=>e.n),__vite__mapDeps([20,1,2,3,4,5,6,7])))},{id:`turtle`,name:`Turtle`,import:(()=>w(()=>import(`./_ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>w(()=>import(`./_BMIWLwHE.js`),__vite__mapDeps([118,9,1,2,3,4,5,6,7,10,12,28,41,8,14,15,23,26,32,33,34,36,42,43,18,20,44,45,46,94,16])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>w(()=>import(`./_DNTUKUkr.js`).then(e=>e.n),__vite__mapDeps([18,1,2,3,4,5,6,7])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>w(()=>import(`./_BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>w(()=>import(`./_DMdqORi3.js`),__vite__mapDeps([119,9,1,2,3,4,5,6,7,10,8,12,15,14,16,18,20,120,121,23,26,28,84,31,33,32,34,36,85,86,56,87,38,45,46,41,42,43,44,48,47,51,55,57,88,89,61,90,122,70,69,72,73,74,77,123,91,92,94,95,96,97,98,100,124,101,125,126,118,127])))},{id:`v`,name:`V`,import:(()=>w(()=>import(`./_DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>w(()=>import(`./_zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>w(()=>import(`./_DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>w(()=>import(`./_B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>w(()=>import(`./_BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>w(()=>import(`./_DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>w(()=>import(`./_B9HxhiqE.js`),__vite__mapDeps([128,9,1,2,3,4,5,6,7,10,8,16,18,22])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>w(()=>import(`./_B_C8Mg1b.js`),__vite__mapDeps([129,9,1,2,3,4,5,6,7])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>w(()=>import(`./_DIeJpzm3.js`),__vite__mapDeps([130,9,1,2,3,4,5,6,7,10,12,19,77,131])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>w(()=>import(`./_CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>w(()=>import(`./_ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>w(()=>import(`./_C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>w(()=>import(`./_BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>w(()=>import(`./_ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>w(()=>import(`./_DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>w(()=>import(`./_DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>w(()=>import(`./_DW_O6H-y.js`).then(e=>e.n),__vite__mapDeps([14,1,2,3,4,5,6,7,15])))},{id:`xsl`,name:`XSL`,import:(()=>w(()=>import(`./_FMwpfKJh.js`),__vite__mapDeps([100,14,1,2,3,4,5,6,7,15])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>w(()=>import(`./_OVbe0fvD.js`).then(e=>e.n),__vite__mapDeps([46,1,2,3,4,5,6,7])))},{id:`zenscript`,name:`ZenScript`,import:(()=>w(()=>import(`./_BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>w(()=>import(`./_CMLA9XwU.js`),[]))}],Bt=Object.fromEntries(zt.map(e=>[e.id,e.import])),Vt=Object.fromEntries(zt.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Ht={...Bt,...Vt},Ut=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>w(()=>import(`./_vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>w(()=>import(`./_CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>w(()=>import(`./_DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>w(()=>import(`./_C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>w(()=>import(`./_Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>w(()=>import(`./_C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>w(()=>import(`./_CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>w(()=>import(`./_R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>w(()=>import(`./_DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>w(()=>import(`./_Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>w(()=>import(`./_BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>w(()=>import(`./_5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>w(()=>import(`./_sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>w(()=>import(`./_Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>w(()=>import(`./_C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>w(()=>import(`./_DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>w(()=>import(`./_Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>w(()=>import(`./_B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>w(()=>import(`./_EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>w(()=>import(`./_BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>w(()=>import(`./_B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>w(()=>import(`./_C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>w(()=>import(`./_BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>w(()=>import(`./_MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>w(()=>import(`./_BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>w(()=>import(`./_BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>w(()=>import(`./_BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>w(()=>import(`./_CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>w(()=>import(`./_DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>w(()=>import(`./_CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>w(()=>import(`./_Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>w(()=>import(`./_BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>w(()=>import(`./_BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>w(()=>import(`./_C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>w(()=>import(`./_DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>w(()=>import(`./_Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>w(()=>import(`./_2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>w(()=>import(`./_uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>w(()=>import(`./_CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>w(()=>import(`./_B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>w(()=>import(`./_BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>w(()=>import(`./_DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>w(()=>import(`./_B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>w(()=>import(`./_DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>w(()=>import(`./_eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>w(()=>import(`./_Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>w(()=>import(`./_CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>w(()=>import(`./_D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>w(()=>import(`./_DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>w(()=>import(`./_DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>w(()=>import(`./_DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>w(()=>import(`./_aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>w(()=>import(`./_8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>w(()=>import(`./_DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>w(()=>import(`./_DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>w(()=>import(`./_B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>w(()=>import(`./_4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>w(()=>import(`./_UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>w(()=>import(`./_C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>w(()=>import(`./_nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>w(()=>import(`./_oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>w(()=>import(`./_DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>w(()=>import(`./_fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>w(()=>import(`./_BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>w(()=>import(`./_VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),Wt=t({createOnigurumaEngine:()=>vn,getDefaultWasmLoader:()=>_n,loadWasm:()=>dn,setDefaultWasmLoader:()=>gn}),Gt=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Kt(){return 2147483648}function qt(){return typeof performance<`u`?performance.now():Date.now()}var Jt=(e,t)=>e+(t-e%t)%t;async function Yt(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=Kt();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,Jt(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:qt,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 Xt=Object.defineProperty,Zt=(e,t,n)=>t in e?Xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t,n)=>Zt(e,typeof t==`symbol`?t:t+``,n),Qt=null;function $t(e){throw new Gt(e.UTF8ToString(e.getLastOnigError()))}var en=class e{constructor(t){I(this,`utf16Length`),I(this,`utf8Length`),I(this,`utf16Value`),I(this,`utf8Value`),I(this,`utf16OffsetToUtf8`),I(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}},tn=class e{constructor(t){if(I(this,`id`,++e.LAST_ID),I(this,`_onigBinding`),I(this,`content`),I(this,`utf16Length`),I(this,`utf8Length`),I(this,`utf16OffsetToUtf8`),I(this,`utf8OffsetToUtf16`),I(this,`ptr`),!Qt)throw new Gt(`Must invoke loadWasm first.`);this._onigBinding=Qt,this.content=t;let n=new en(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=Qt.omalloc(1e4),e._sharedPtrInUse=!0,Qt.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(Qt)}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)}};I(tn,`LAST_ID`,0),I(tn,`_sharedPtr`,0),I(tn,`_sharedPtrInUse`,!1);var nn=tn,rn=class{constructor(e){if(I(this,`_onigBinding`),I(this,`_ptr`),!Qt)throw new Gt(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new en(e[r]);t[r]=i.createString(Qt),n[r]=i.utf8Length}let r=Qt.omalloc(4*e.length);Qt.HEAPU32.set(t,r/4);let i=Qt.omalloc(4*e.length);Qt.HEAPU32.set(n,i/4);let a=Qt.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)Qt.ofree(t[n]);Qt.ofree(i),Qt.ofree(r),a===0&&$t(Qt),this._onigBinding=Qt,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 nn(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 an(e){return typeof e.instantiator==`function`}function on(e){return typeof e.default==`function`}function sn(e){return e.data!==void 0}function cn(e){return typeof Response<`u`&&e instanceof Response}function ln(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 un;function dn(e){if(un)return un;async function t(){Qt=await Yt(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),an(n)?n=await n.instantiator(t):on(n)?n=await n.default(t):(sn(n)&&(n=n.data),cn(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await pn(n)(t):await mn(n)(t):ln(n)||n instanceof WebAssembly.Module?n=await fn(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await fn(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return un=t(),un}function fn(e){return t=>WebAssembly.instantiate(e,t)}function pn(e){return t=>WebAssembly.instantiateStreaming(e,t)}function mn(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var hn;function gn(e){hn=e}function _n(){return hn}async function vn(e){return e&&await dn(e),{createScanner(e){return new rn(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new nn(e)}}}var yn=It({});Rt(yn,Wt);var L=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function bn(e){return xn(e)}function xn(e){return Array.isArray(e)?Sn(e):e instanceof RegExp?e:typeof e==`object`?Cn(e):e}function Sn(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=xn(e[n]);return t}function Cn(e){let t={};for(let n in e)t[n]=xn(e[n]);return t}function wn(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Tn(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Tn(e.substring(0,e.length-1)):e.substr(~t+1)}var En=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Dn=class{static hasCaptures(e){return e!==null&&(En.lastIndex=0,En.test(e))}static replaceCaptures(e,t,n){return e.replace(En,(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 On(e,t){return e<t?-1:+(e>t)}function kn(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=On(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function An(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 jn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Mn=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}},Nn=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Rn(e),t)}static createFromParsedTheme(e,t){return Vn(e,t)}_cachedMatchRoot=new Mn(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=>Fn(e.parent,t.parentScopes));return n?new Ln(n.fontStyle,n.foreground,n.background):null}},Pn=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 Fn(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&&!In(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function In(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Ln=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Rn(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`&&An(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&An(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 zn(l,u,e,o,s,c)}}return n}var zn=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}},Bn=(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))(Bn||{});function Vn(e,t){e.sort((e,t)=>{let n=On(e.scope,t.scope);return n!==0||(n=kn(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 Hn(t),o=new Ln(n,a.getId(r),a.getId(i)),s=new Gn(new Wn(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 Nn(a,o,s)}var Hn=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)}},Un=Object.freeze([]),Wn=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Un,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)}},Gn=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(),Wn.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(kn(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 Wn(e,t,n,r,i))}},Kn=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=Jn(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 qn(e){return e}function Jn(e){return e}function Yn(e,t){let n=[],r=Zn(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(Xn(i)){let e=[];do e.push(i),i=r.next();while(Xn(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 Xn(e){return!!e&&!!e.match(/[\w\.:]+/)}function Zn(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 Qn(e){typeof e.dispose==`function`&&e.dispose()}var $n=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},er=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},tr=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))}},nr=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new $n(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new tr;for(let n of e)rr(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof $n){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 rr(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 $n?ar({baseGrammar:a,selfGrammar:i},r):ir(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 $n(e))}function ir(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];or([r],t,n)}}function ar(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&or(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&or(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function or(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?wn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&or(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=fr(i);switch(a.kind){case 0:ar({...t,selfGrammar:t.baseGrammar},n);break;case 1:ar(t,n);break;case 2:ir(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?ir(a.ruleName,i,n):ar(i,n)}else a.kind===4?n.add(new er(a.scopeName,a.ruleName)):n.add(new $n(a.scopeName))}}}var sr=class{kind=0},cr=class{kind=1},lr=class{constructor(e){this.ruleName=e}kind=2},ur=class{constructor(e){this.scopeName=e}kind=3},dr=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function fr(e){if(e===`$base`)return new sr;if(e===`$self`)return new cr;let t=e.indexOf(`#`);return t===-1?new ur(e):t===0?new lr(e.substring(1)):new dr(e.substring(0,t),e.substring(t+1))}var pr=/\\(\d+)/,mr=/\\(\d+)/g,hr=-1,gr=-2;function _r(e){return e}function vr(e){return e}var yr=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Dn.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Dn.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Tn(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:Dn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Dn.replaceCaptures(this._contentName,e,t)}},br=class extends yr{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!`)}},xr=class extends yr{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Er(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 Dr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Sr=class extends yr{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 Dr,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Cr=class extends yr{_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 Er(i,this.id),this.beginCaptures=a,this._end=new Er(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 Dr;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}},wr=class extends yr{_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 Er(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Er(o,gr),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 Dr;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 Dr,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Tr=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new br(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new xr(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=wn({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Sr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new wr(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 Cr(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=fr(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 Sr||e instanceof Cr||e instanceof wr)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Er=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`&&pr.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 mr.lastIndex=0,this.source.replace(mr,(e,t)=>jn(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}},Dr=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 Or(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 Or(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Or=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(`
|
|
3
|
-
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},kr=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Ar=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new kr(e,8),this._embeddedLanguagesMatcher=new jr(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 kr(0,0);_getBasicScopeAttributes=new Mn(e=>new kr(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/},jr=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])=>jn(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 Mr=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Nr(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Pr(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 Mr(i,!0);f()}return new Mr(i,!1);function f(){let o=Fr(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===hr){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Br(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 Cr){let r=o;Br(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 wr){let r=o;Br(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(Br(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 Pr(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 wr&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=zr(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==gr){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Br(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 Fr(e,t,n,r,i,a){let o=Ir(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Lr(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 Ir(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Rr(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 Lr(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}=Rr(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 Rr(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function zr(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Br(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));Nr(e,p,n&&d.start===0,d.start,f,i,!1,0),Qn(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 Vr(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Vr=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Hr(e,t,n,r,i,a,o,s){return new Kr(e,t,n,r,i,a,o,s)}function Ur(e,t,n,r,i){let a=Yn(t,Wr),o=Tr.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 Wr(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(Gr(t[r],e))return n=r+1,!0;return!1})}function Gr(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 Kr=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Ar(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=qr(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Yn(e,Wr);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)Ur(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&&Ur(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(_r(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[vr(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]=qr(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=Tr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Yr.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Kn.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Jr.createRootAndLookUpScopeName(a,r,this):Jr.createRoot(`unknown`,r),t=new Yr(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
4
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new Zr(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Nr(this,a,i,0,t,s,!0,r);return Qn(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function qr(e,t){return e=bn(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 Jr=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=Pn.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Pn(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Pn(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(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Kn.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}},Yr=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)?Jr.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(1)}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:vr(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=Jr.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,_r(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Jr.fromExtension(r,n.contentNameScopesList))}},Xr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Yn(e,Wr).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Yn(e,Wr).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}},Zr=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=Kn.set(n,0,qn(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Kn.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}},Qr=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,Hr(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},$r=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Qr(Nn.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Nn.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 Xr(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new nr(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)}},ei=Yr.NULL;function ti(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 ni(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function ri(e){return Array.isArray(e)?e:[e]}async function ii(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function ai(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function oi(e){return e===`ansi`||ai(e)}function si(e){return e===`none`}function ci(e){return si(e)}var li=/(\r?\n)/g;function ui(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(li),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 di={light:`#333333`,dark:`#bbbbbb`},fi={light:`#fffffe`,dark:`#1e1e1e`},pi=`__shiki_resolved`;function mi(e){if(e?.[pi])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`?di.light:di.dark,n||=t.type===`light`?fi.light:fi.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,pi,{enumerable:!1,writable:!1,value:!0}),t}async function hi(e){return[...new Set((await Promise.all(e.filter(e=>!oi(e)).map(async e=>await ii(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function gi(e){return(await Promise.all(e.map(async e=>ci(e)?null:mi(await ii(e))))).filter(e=>!!e)}function _i(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 L(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var vi=class extends $r{_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=mi(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=Nn.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=_i(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 L(`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))}},yi=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}},bi=0;function xi(e){bi+=1,e.warnings!==!1&&bi>=10&&bi%10==0&&console.warn(`[Shiki] ${bi} 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 L("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(mi),i=new vi(new yi(e.engine,n),r,n,e.langAlias),a;function o(t){return _i(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new L(`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 L(`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 hi(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await gi(e))}function g(){if(t)throw new L(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--bi)}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 Si(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([gi(e.themes||[]),hi(e.langs||[]),e.engine]);return xi({...e,themes:t,langs:n,engine:r})}var Ci=new WeakMap;function wi(e,t){Ci.set(e,t)}function Ti(e){return Ci.get(e)}var Ei=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(ri(n).map(e=>[e,ei])),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 Di(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Di(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 Oi(e,t){if(!(e instanceof Ei))throw new L(`Invalid grammar state`);return e.getInternalStack(t)}var ki=/,/,Ai=/ /;function ji(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(ai(e.resolveLangAlias(n.lang||`text`))||si(r))return ui(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 L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Ni(t,o,i,a,n)}function Mi(...e){if(e.length===2)return Ti(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(ai(i)||si(a))throw new L(`Plain language does not have grammar state`);if(i===`ansi`)throw new L(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Ei(Pi(n,c,o,s,r).stateStack,c.name,o.name)}function Ni(e,t,n,r,i){let a=Pi(e,t,n,r,i),o=new Ei(a.stateStack,t.name,n.name);return wi(a.tokens,o),a.tokens}function Pi(e,t,n,r,i){let a=ti(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=ui(e),u=i.grammarState?Oi(i.grammarState,n.name)??ei:i.grammarContextCode==null?ei:Pi(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=ni(r[Kn.getForeground(s)],a),u=Kn.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Kn.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(ki).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Ai))})}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`?Fi(t.scopes):Ii(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Fi(e){return e.map(e=>({scopeName:e}))}function Ii(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:zi(e,i,t.slice(0,r))}}return n}function Li(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Ri(e,t,n){if(!Li(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Li(e[r],n[i])&&--r,--i;return r===-1}function zi(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Ri(e,t,n)){r.push(a);break}return r}function Bi(e,t,n,r=ji){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:Ti(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Vi(...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 Ei(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&wi(s,c),s}function Vi(...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 Hi=[`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 Wi(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 Gi(e){return e.toLowerCase()}var Ki=class{constructor(e,t){this.attribute=t,this.property=e}};Ki.prototype.attribute=``,Ki.prototype.booleanish=!1,Ki.prototype.boolean=!1,Ki.prototype.commaOrSpaceSeparated=!1,Ki.prototype.commaSeparated=!1,Ki.prototype.defined=!1,Ki.prototype.mustUseProperty=!1,Ki.prototype.number=!1,Ki.prototype.overloadedBoolean=!1,Ki.prototype.property=``,Ki.prototype.spaceSeparated=!1,Ki.prototype.space=void 0;var qi=t({boolean:()=>R,booleanish:()=>Yi,commaOrSpaceSeparated:()=>Qi,commaSeparated:()=>Zi,number:()=>z,overloadedBoolean:()=>Xi,spaceSeparated:()=>B}),Ji=0,R=$i(),Yi=$i(),Xi=$i(),z=$i(),B=$i(),Zi=$i(),Qi=$i();function $i(){return 2**++Ji}var ea=Object.keys(qi),ta=class extends Ki{constructor(e,t,n,r){let i=-1;if(super(e,t),na(this,`space`,r),typeof n==`number`)for(;++i<ea.length;){let e=ea[i];na(this,ea[i],(n&qi[e])===qi[e])}}};ta.prototype.defined=!0;function na(e,t,n){n&&(e[t]=n)}function ra(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ta(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Gi(r)]=r,n[Gi(a.attribute)]=r}return new Ui(t,n,e.space)}var ia=ra({properties:{ariaActiveDescendant:null,ariaAtomic:Yi,ariaAutoComplete:null,ariaBusy:Yi,ariaChecked:Yi,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:Yi,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:Yi,ariaFlowTo:B,ariaGrabbed:Yi,ariaHasPopup:null,ariaHidden:Yi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:z,ariaLive:null,ariaModal:Yi,ariaMultiLine:Yi,ariaMultiSelectable:Yi,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Yi,ariaReadOnly:Yi,ariaRelevant:null,ariaRequired:Yi,ariaRoleDescription:B,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Yi,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function aa(e,t){return t in e?e[t]:t}function oa(e,t){return aa(e,t.toLowerCase())}var sa=ra({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Zi,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alpha:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:B,autoFocus:R,autoPlay:R,blocking:B,capture:null,charSet:null,checked:R,cite:null,className:B,closedBy:null,colorSpace:null,cols:z,colSpan:z,command:null,commandFor:null,content:null,contentEditable:Yi,controls:R,controlsList:B,coords:z|Zi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Xi,draggable:Yi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:B,height:z,hidden:Xi,high:z,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:B,itemRef:B,itemScope:R,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,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:z,pattern:null,ping:B,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:B,required:R,reversed:R,rows:z,rowSpan:z,sandbox:B,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootCustomElementRegistry:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shadowRootSerializable:R,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Yi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:Yi,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,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:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Yi,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:R,disablePictureInPicture:R,disableRemotePlayback:R,exportParts:Zi,part:B,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:oa}),ca=ra({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:Qi,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:B,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:Zi,g2:Zi,glyphName:Zi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Qi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Qi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Qi,rev:Qi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Qi,requiredFeatures:Qi,requiredFonts:Qi,requiredFormats:Qi,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Qi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Qi,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Qi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:aa}),la=ra({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()}}),ua=ra({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:oa}),da=ra({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),fa=/[A-Z]/g,pa=/-[a-z]/g,ma=/^data[-\w.:]+$/i;function ha(e,t){let n=Gi(t),r=t,i=Ki;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ma.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(pa,_a);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!pa.test(e)){let n=e.replace(fa,ga);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ta}return new i(r,t)}function ga(e){return`-`+e.toLowerCase()}function _a(e){return e.charAt(1).toUpperCase()}var va=Wi([ia,sa,la,ua,da],`html`),ya=Wi([ia,ca,la,ua,da],`svg`),ba={}.hasOwnProperty;function xa(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&ba.call(t,e)){let n=String(t[e]);i=ba.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 Sa=/["&'<>`]/g,Ca=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wa=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ta=/[|\\{}()[\]^$+*?.]/g,Ea=new WeakMap;function Da(e,t){return e=e.replace(t.subset?Oa(t.subset):Sa,r),t.subset||t.escapeOnly?e:e.replace(Ca,n).replace(wa,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 Oa(e){let t=Ea.get(e);return t||(t=ka(e),Ea.set(e,t)),t}function ka(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ta,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Aa=/[\dA-Fa-f]/;function ja(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Aa.test(String.fromCharCode(t))?r:r+`;`}var Ma=/\d/;function Na(e,t,n){let r=`&#`+String(e);return n&&t&&!Ma.test(String.fromCharCode(t))?r:r+`;`}var Pa=`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(`.`),Fa={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:`€`},Ia=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],La={}.hasOwnProperty,Ra={},za;for(za in Fa)La.call(Fa,za)&&(Ra[Fa[za]]=za);var Ba=/[^\dA-Za-z]/;function Va(e,t,n,r){let i=String.fromCharCode(e);if(La.call(Ra,i)){let e=Ra[i],a=`&`+e;return n&&Pa.includes(e)&&!Ia.includes(e)&&(!r||t&&t!==61&&Ba.test(String.fromCharCode(t)))?a:a+`;`}return``}function Ha(e,t,n){let r=ja(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Va(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Na(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Ua(e,t){return Da(e,Object.assign({format:Ha},t))}var Wa=/^>|^->|<!--|-->|--!>|<!-$/g,Ga=[`>`],Ka=[`<`,`>`];function qa(e,t,n,r){return r.settings.bogusComments?`<?`+Ua(e.value,Object.assign({},r.settings.characterReferences,{subset:Ga}))+`>`:`<!--`+e.value.replace(Wa,i)+`-->`;function i(e){return Ua(e,Object.assign({},r.settings.characterReferences,{subset:Ka}))}}function Ja(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Ya(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 Xa(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Za(e){return e.join(` `).trim()}var Qa=/[ \t\n\f\r]/g;function $a(e){return typeof e==`object`?e.type===`text`&&eo(e.value):eo(e)}function eo(e){return e.replace(Qa,``)===``}var to=io(1),no=io(-1),ro=[];function io(e){return t;function t(t,n,r){let i=t?t.children:ro,a=(n||0)+e,o=i[a];if(!r)for(;o&&$a(o);)a+=e,o=i[a];return o}}var ao={}.hasOwnProperty;function oo(e){return t;function t(t,n,r){return ao.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var so=oo({body:uo,caption:co,colgroup:co,dd:ho,dt:mo,head:co,html:lo,li:po,optgroup:_o,option:vo,p:fo,rp:go,rt:go,tbody:bo,td:Co,tfoot:xo,th:Co,thead:yo,tr:So});function co(e,t,n){let r=to(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&$a(r.value.charAt(0)))}function lo(e,t,n){let r=to(n,t);return!r||r.type!==`comment`}function uo(e,t,n){let r=to(n,t);return!r||r.type!==`comment`}function fo(e,t,n){let r=to(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 po(e,t,n){let r=to(n,t);return!r||r.type===`element`&&r.tagName===`li`}function mo(e,t,n){let r=to(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function ho(e,t,n){let r=to(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function go(e,t,n){let r=to(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function _o(e,t,n){let r=to(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function vo(e,t,n){let r=to(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function yo(e,t,n){let r=to(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function bo(e,t,n){let r=to(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function xo(e,t,n){return!to(n,t)}function So(e,t,n){let r=to(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Co(e,t,n){let r=to(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var wo=oo({body:Do,colgroup:Oo,head:Eo,html:To,tbody:ko});function To(e){let t=to(e,-1);return!t||t.type!==`comment`}function Eo(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 Do(e){let t=to(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 Oo(e,t,n){let r=no(n,t),i=to(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function ko(e,t,n){let r=no(n,t),i=to(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&so(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ao={name:[[`
|
|
5
|
-
\f\r &/=>`.split(``),`
|
|
6
|
-
\f\r "&'/=>\``.split(``)],[`\0
|
|
7
|
-
\f\r "&'/<=>`.split(``),`\0
|
|
8
|
-
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
9
|
-
\f\r &>`.split(``),`\0
|
|
10
|
-
\f\r "&'<=>\``.split(``)],[`\0
|
|
11
|
-
\f\r "&'<=>\``.split(``),`\0
|
|
12
|
-
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function jo(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=ya);let l=Mo(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!wo(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||!so(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Mo(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=No(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 No(e,t,n){let r=ha(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=Ua(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ao.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Xa:Za)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Ua(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ao.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Ya(n,o)>Ya(n,e.alternative)&&(o=e.alternative),s=o+Ua(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ao.single:Ao.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Po=[`<`,`&`];function Fo(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Ua(e.value,Object.assign({},r.settings.characterReferences,{subset:Po}))}function Io(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Fo(e,t,n,r)}function Lo(e,t,n,r){return r.all(e)}var Ro=xa(`type`,{invalid:zo,unknown:Bo,handlers:{comment:qa,doctype:Ja,element:jo,raw:Io,root:Lo,text:Fo}});function zo(e){throw Error("Expected node, not `"+e+"`")}function Bo(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Vo={},Ho={},Uo=[];function Wo(e,t){let n=t||Vo,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Go,all:Ko,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||Hi,characterReferences:n.characterReferences||Ho,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?ya:va,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Go(e,t,n){return Ro(e,t,n,this)}function Ko(e){let t=[],n=e&&e.children||Uo,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var qo=/\s+/g;function Jo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(qo)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(qo);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var Yo=/:?lang=["']([^"']+)["']/g,Xo=/(?:```|~~~)([\w-]+)/g,Zo=/\\begin\{([\w-]+)\}/g,Qo=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,$o=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function es(e){let t=ui(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 ts(e,t,n){let r=new Set;for(let t of e.matchAll(Yo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Xo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Zo)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Qo)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if($o.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var ns=[`color`,`background-color`];function rs(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 is(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 as(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=is(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 rs(e,a)})):e}function os(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>ss(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&&ns.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 L('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 ss(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Bn.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Bn.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Bn.Underline&&n.push(`underline`),e.fontStyle&Bn.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function cs(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function ls(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=es(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new L(`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 L(`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 L(`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)}));us(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 as(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 L(`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+=ds(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new L(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new L(`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&&Jo(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 us(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new L(`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 L(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function ds(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(ds).join(``):``}var fs=[ls()];function ps(e){let t=ms(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...fs]}function ms(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 hs=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],gs={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function _s(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 vs(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 ys(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)gs[r]&&t.push({type:`setDecoration`,value:gs[r]});else if(r<=29){let e=gs[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:hs[r-30]}});else if(r===38){let n=vs(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:hs[r-40]}});else if(r===48){let n=vs(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:hs[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:hs[r-100+8]}})}}return t}function bs(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=_s(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=ys(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 xs={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 Ss(e=xs){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<hs.length;e++)r.push(t(hs[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 Cs=/#([0-9a-f]{3,8})/i,ws=/var\((--[\w-]+-ansi-[\w-]+)\)/,Ts={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 Es(e,t,n){let r=ti(e,n),i=ui(t),a=Ss(Object.fromEntries(hs.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Ts[t]]}))),o=bs();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=ni(i,r),o=ni(o,r),n.decorations.has(`dim`)&&(i=Ds(i));let s=Bn.None;return n.decorations.has(`bold`)&&(s|=Bn.Bold),n.decorations.has(`italic`)&&(s|=Bn.Italic),n.decorations.has(`underline`)&&(s|=Bn.Underline),n.decorations.has(`strikethrough`)&&(s|=Bn.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Ds(e){let t=e.match(Cs);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(ws);return n?`var(${n[1]}-dim)`:e}function Os(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!ai(r)&&!si(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Es(r,t,n)}return ji(e,t,n)}function ks(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 L("`themes` option must not be empty");let p=Bi(e,t,n,Os);if(c=Ti(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new L(`\`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=>os(e,h,u,l,d))),c&&wi(a,c);let g=f.map(e=>ti(e.theme,n));i=As(f,m,g,u,l,`fg`,d),r=As(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=ti(n.theme,n);a=Os(e,t,n);let l=e.getTheme(n.theme);r=ni(l.bg,s),i=ni(l.fg,s),o=l.name,c=Ti(a)}else throw new L("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function As(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=ni(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 L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${ni(t[r][a],n[r])||`inherit`}, ${ni(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var js=/^\s+$/,Ms=/^(\s*)(.*?)(\s*)$/;function Ns(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Ns(e,t,n),codeToTokens:(t,n)=>ks(e,t,n)}){let i=t;for(let e of ps(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=ks(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Fs(a):d===`never`&&(a=Is(a)),f&&(a=Ls(a));let p={...r,get source(){return i}};for(let e of ps(n))a=e.tokens?.call(p,a)||a;return Ps(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Ps(e,t,n,r=Ti(e)){let i=ps(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:Jo,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:`
|
|
13
|
-
`}));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=cs(a.htmlStyle||ss(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&&wi(m,r),m}function Fs(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Bn.Underline||i.fontStyle&Bn.Strikethrough));o&&js.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 Is(e){return e.map(e=>e.flatMap(e=>{if(js.test(e.content))return e;let t=e.content.match(Ms);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 Ls(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=cs(e.htmlStyle||ss(e)),i=cs(n.htmlStyle||ss(n)),a=e.fontStyle&&(e.fontStyle&Bn.Underline||e.fontStyle&Bn.Strikethrough),o=n.fontStyle&&(n.fontStyle&Bn.Underline||n.fontStyle&Bn.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Rs=Wo;function zs(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Ns(e,t,n),codeToTokens:(t,n)=>ks(e,t,n)},i=Rs(Ns(e,t,n,r));for(let e of ps(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Bs(e){let t=await Si(e);return{getLastGrammarState:(...e)=>Mi(t,...e),codeToTokensBase:(e,n)=>Os(t,e,n),codeToTokensWithThemes:(e,n)=>Bi(t,e,n),codeToTokens:(e,n)=>ks(t,e,n),codeToHast:(e,n)=>Ns(t,e,n),codeToHtml:(e,n)=>zs(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Vs(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,oi(n))return[];let r=t[n];if(!r)throw new L(`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(ci(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new L(`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 Bs({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 Hs(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 Us(e,t){let n=Hs(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 Ws=Vs({langs:Ht,themes:Ut,engine:()=>(0,yn.createOnigurumaEngine)(w(()=>import(`./_sWLklcDZ.js`),[]))}),{codeToHtml:Gs,codeToHast:Ks,codeToTokens:qs,codeToTokensBase:Js,codeToTokensWithThemes:Ys,getSingletonHighlighter:Xs,getLastGrammarState:Zs}=Us(Ws,{guessEmbeddedLanguages:ts}),Qs=4294967295,$s=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:Qs,end:Qs,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 ec(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function tc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var nc=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),rc=String.raw;function ic(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ac=rc`\[\^?`,oc=`c.? | C(?:-.?)?|${rc`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${rc`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${rc`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${rc`o\{[^\}]*\}?`}|${rc`\d{1,3}`}`,sc=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,cc=new RegExp(rc`
|
|
14
|
-
\\ (?:
|
|
15
|
-
${oc}
|
|
16
|
-
| [gk]<[^>]*>?
|
|
17
|
-
| [gk]'[^']*'?
|
|
18
|
-
| .
|
|
19
|
-
)
|
|
20
|
-
| \( (?:
|
|
21
|
-
\? (?:
|
|
22
|
-
[:=!>({]
|
|
23
|
-
| <[=!]
|
|
24
|
-
| <[^>]*>
|
|
25
|
-
| '[^']*'
|
|
26
|
-
| ~\|?
|
|
27
|
-
| #(?:[^)\\]|\\.?)*
|
|
28
|
-
| [^:)]*[:)]
|
|
29
|
-
)?
|
|
30
|
-
| \*[^\)]*\)?
|
|
31
|
-
)?
|
|
32
|
-
| (?:${sc.source})+
|
|
33
|
-
| ${ac}
|
|
34
|
-
| .
|
|
35
|
-
`.replace(/\s+/g,``),`gsu`),lc=new RegExp(rc`
|
|
36
|
-
\\ (?:
|
|
37
|
-
${oc}
|
|
38
|
-
| .
|
|
39
|
-
)
|
|
40
|
-
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
41
|
-
| ${ac}
|
|
42
|
-
| &&
|
|
43
|
-
| .
|
|
44
|
-
`.replace(/\s+/g,``),`gsu`);function uc(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=Bc(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(cc.lastIndex=0;s=cc.exec(e);){let t=dc(a,e,s[0],cc.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(cc.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`?Hc(e,u):e).flat(),flags:r}}function dc(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=fc(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:gc(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Ac(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:_c(n)}}if(a===`K`)return{token:wc(`keep`,n)};if(a===`N`||a===`R`)return{token:Cc(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Cc(`any`,n)};if(a===`X`)return{token:Cc(`text_segment`,n)};let e=mc(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Fc(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:Pc(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Dc(`group`,n)};if(n===`(?>`)return{token:Dc(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Dc(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Dc(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Dc(`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:Ec(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
45
|
-
`,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:Cc(`dot`,n)}:n===`^`||n===`$`?{token:gc(e.singleline?{"^":rc`\A`,$:rc`\Z`}[n]:n,n)}:n===`|`?{token:hc(n)}:sc.test(n)?{tokens:Uc(n)}:{token:vc(ec(n),n)}}function fc(e,t,n){let r=[Sc(t[1]===`^`,t)],i=1,a;for(lc.lastIndex=n;a=lc.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Sc(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(vc(93,e));else if(i--,r.push(yc(e)),!i)break}else{let t=pc(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:lc.lastIndex||e.length}}function pc(e){if(e[0]===`\\`)return mc(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!nc.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Cc(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?bc(e):e===`&&`?xc(e):vc(ec(e),e)}function mc(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Nc(e);if(`dDhHsSwW`.includes(n))return Lc(e);if(e.startsWith(rc`\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 Rc(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 vc(ec(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return vc(Vc(e),e);if(Mc.has(n))return vc(Mc.get(n),e);if(/\d/.test(n))return Tc(t,e);if(e===`\\`)throw Error(rc`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return vc(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function hc(e){return{type:`Alternator`,raw:e}}function gc(e,t){return{type:`Assertion`,kind:e,raw:t}}function _c(e){return{type:`Backreference`,raw:e}}function vc(e,t){return{type:`Character`,value:e,raw:t}}function yc(e){return{type:`CharacterClassClose`,raw:e}}function bc(e){return{type:`CharacterClassHyphen`,raw:e}}function xc(e){return{type:`CharacterClassIntersector`,raw:e}}function Sc(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Cc(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function wc(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:ic(n.flags),raw:t}}function Tc(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Ec(e){return{type:`GroupClose`,raw:e}}function Dc(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Oc(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function kc(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Ac(e){return{type:`Subroutine`,raw:e}}var jc=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Mc=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Nc(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return vc(ec(t.toUpperCase())-64,e)}function Pc(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=zc(n),o=zc(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),wc(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Dc(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Fc(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=jc.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 Oc(l,r??null,i?.split(`,`)??null,e)}function Ic(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 kc(t,n,r,e)}function Lc(e){let t=e[1].toLowerCase();return Cc({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function Rc(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Cc(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function zc(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 Bc(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 Vc(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 Hc(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[_c(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(rc`Octal encoded byte above 177 unsupported "${n}"`)}else r=ec(t);a.push(vc(r,(e===0?`\\`:``)+t))}return a}function Uc(e){let t=[],n=new RegExp(sc,`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(Ic(e.slice(0,-1)));continue}}}t.push(Ic(e))}return t}function Wc(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 Gc(e){return Kc.has(e.type)}var Kc=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function qc(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=uc(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 rl();case`Assertion`:return Jc(n);case`Backreference`:return Yc(n,a);case`Character`:return sl(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Xc(n,a,t);case`CharacterClassOpen`:return Zc(n,a,t);case`CharacterSet`:return Qc(n,a);case`Directive`:return dl(n.kind,{flags:n.flags});case`GroupOpen`:return $c(n,a,t);case`NamedCallout`:return hl(n.kind,n.tag,n.arguments);case`Quantifier`:return el(n,a);case`Subroutine`:return tl(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=vl(fl(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(rc`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(rc`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Jc({kind:e}){return il(ic({"^":`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===rc`\B`||e===rc`\Y`})}function Yc({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,al(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 al(r)}return i(+r)}function Xc(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(),ll(o,e);throw Error(`Invalid character class range`)}return sl(ec(`-`))}function Zc({negate:e},t,n){let{tokens:r,walk:i}=t,a=[cl()],o=r[t.nextIndex],s=kl(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(cl()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=kl(r[t.nextIndex],o)}let c=cl({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 Qc({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Ol(n);if(nc.has(r)&&!o?.has(r))e=`posix`,n=r;else return bl(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?gl(n,{negate:t}):ul(e,{negate:t})}function $c(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=xl(e),l=c.type===`AbsenceFunction`,u=Tl(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&tc(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Al(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(rl()),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(wl(t)||t.type===`CapturingGroup`)throw Error(e)}else if(wl(t)||Tl(t)&&t.negate)throw Error(e)}}f=Al(r[t.nextIndex])}return t.nextIndex++,c}function el({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Gc(a))throw Error(`Quantifier requires a repeatable token`);let o=_l(e,t,n,a);return i.body.pop(),o}function tl({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=yl(i);return r.push(o),o}function nl(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Sl(t?.body)}}function rl(e){return{type:`Alternative`,body:Cl(e?.body)}}function il(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function al(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function ol(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!El(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:Sl(t?.body)}}function sl(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 cl(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:Cl(e?.body)}}function ll(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function ul(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 dl(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:ic(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function fl(e){return{type:`Flags`,...e}}function pl(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:Sl(e?.body)}}function ml(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Sl(e?.body)}}function hl(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function gl(e,t){let n=!!t?.negate;if(!nc.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function _l(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 vl(e,t){return{type:`Regex`,body:Sl(t?.body),flags:e}}function yl(e){return{type:`Subroutine`,ref:e}}function bl(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Ol(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Dl(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(rc`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function xl({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return nl(`repeater`);case`atomic`:return pl({atomic:!0});case`capturing`:return ol(i,{name:n});case`group`:return pl({flags:e});case`lookahead`:case`lookbehind`:return ml({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Sl(e){if(e===void 0)e=[rl()];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 Cl(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 wl(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Tl(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function El(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Dl(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 Ol(e){return e.replace(/[- _]+/g,``).toLowerCase()}function kl(e,t){let n=t;return ic(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Al(e){return ic(e,`Unclosed group`)}function jl(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(){Ml(c).splice(Math.max(0,Nl(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Ml(c).splice(Nl(s)+1)},removeAllPrevSiblings(){let e=Nl(s)+l;return l-=e,Ml(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Nl(s)+l)]=e:ic(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Ml(c).splice(Math.max(0,Nl(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,Nl(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 Ml(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Nl(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Pl=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Fl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Il(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Ll=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function Rl(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===Ll.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Ll.CHAR_CLASS:Ll.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 zl(e,t,n,r){Rl(e,t,n,r)}function Bl(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===Ll.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Vl(e,t,n){return!!Bl(e,t,0,n)}function Hl(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 Ul=new RegExp(String.raw`(?<noncapturingStart>${Pl})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Wl(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(Ul.lastIndex=Number.isNaN(c)?0:c+7;f=Ul.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),Fl(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=Rl(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}`},Ll.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Gl=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Kl=new RegExp(String.raw`
|
|
46
|
-
\\(?: \d+
|
|
47
|
-
| c[A-Za-z]
|
|
48
|
-
| [gk]<[^>]+>
|
|
49
|
-
| [pPu]\{[^\}]+\}
|
|
50
|
-
| u[A-Fa-f\d]{4}
|
|
51
|
-
| x[A-Fa-f\d]{2}
|
|
52
|
-
)
|
|
53
|
-
| \((?: \? (?: [:=!>]
|
|
54
|
-
| <(?:[=!]|[^>]+>)
|
|
55
|
-
| [A-Za-z\-]+:
|
|
56
|
-
| \(DEFINE\)
|
|
57
|
-
))?
|
|
58
|
-
| (?<qBase>${Gl})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
59
|
-
| \\?.
|
|
60
|
-
`.replace(/\s+/g,``),`gsu`);function ql(e){if(!RegExp(`${Gl}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(Kl.lastIndex=0;o=Kl.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=Il(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}Kl.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Jl=String.raw,Yl=Jl`\(\?R=(?<rDepth>[^\)]+)\)|${Jl`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Xl=Jl`\(\?<(?![=!])(?<captureName>[^>]+)>`,Zl=Jl`${Xl}|(?<unnamed>\()(?!\?)`,Ql=new RegExp(Jl`${Xl}|${Yl}|\(\?|\\?.`,`gsu`),$l=`Cannot use multiple overlapping recursions`;function eu(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Yl,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Vl(e,Jl`\(\?\(DEFINE\)`,Ll.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Vl(e,Jl`\\[1-9]`,Ll.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Ql.lastIndex=0;f=Ql.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(tu(m),l)throw Error($l);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(Ql.lastIndex);if(Vl(s,Yl,Ll.DEFAULT))throw Error($l);let c=m-1;e=nu(t,s,c,!1,n,a,d),i=au(i,t,c,a.length,0,d);break}if(h){tu(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error($l);break}if(!u)throw Error(Jl`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Jl`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Hl(e,p);if(o&&Vl(m,Jl`${Xl}|\((?!\?)`,Ll.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=nu(_,v,b,!0,n,a,d);i=au(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Ql.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Ql.lastIndex),s.set(p,Ql.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Ql.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function tu(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 nu(e,t,n,r,i,a,o){let s=new Set;r&&zl(e+t,Xl,({groups:{captureName:e}})=>{s.add(e)},Ll.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${ru(`(?:${e}`,`forward`,...c)}(?:)${ru(`${t})`,`backward`,...c)}${t}`}function ru(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+=Rl(e,Jl`${Zl}|\\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),iu(i,n),s?e:`(?<${t}${l}>`}return Jl`\k<${c}${l}>`},Ll.DEFAULT)}return c}function iu(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function au(e,t,n,r,i,a){if(e.size&&r){let o=0;zl(t,Zl,()=>o++,Ll.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 ou=String.fromCodePoint,V=String.raw,su={},cu=globalThis.RegExp;su.flagGroups=(()=>{try{new cu(`(?i:)`)}catch{return!1}return!0})(),su.unicodeSets=(()=>{try{new cu(`[[]]`,`v`)}catch{return!1}return!0})(),su.bugFlagVLiteralHyphenIsRange=su.unicodeSets?(()=>{try{new cu(V`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,su.bugNestedClassIgnoresNegation=su.unicodeSets&&new cu(`[[^a]]`,`v`).test(`a`);function lu(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function uu(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function du(e,t){return pu[e]>=pu[t]}function fu(e,t){if(e==null)throw Error(t??`Value expected`);return e}var pu={ES2025:2025,ES2024:2024,ES2018:2018},mu={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function hu(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!mu[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=su.flagGroups?`ES2025`:su.unicodeSets?`ES2024`:`ES2018`),t}var gu=`[ -\r ]`,_u=new Set([ou(304),ou(305)]),vu=V`[\p{L}\p{M}\p{N}\p{Pc}]`;function yu(e){if(_u.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Cu.get(n),a=xu.get(n),o=Su.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 bu=new Map(`C Other
|
|
61
|
-
Cc Control cntrl
|
|
62
|
-
Cf Format
|
|
63
|
-
Cn Unassigned
|
|
64
|
-
Co Private_Use
|
|
65
|
-
Cs Surrogate
|
|
66
|
-
L Letter
|
|
67
|
-
LC Cased_Letter
|
|
68
|
-
Ll Lowercase_Letter
|
|
69
|
-
Lm Modifier_Letter
|
|
70
|
-
Lo Other_Letter
|
|
71
|
-
Lt Titlecase_Letter
|
|
72
|
-
Lu Uppercase_Letter
|
|
73
|
-
M Mark Combining_Mark
|
|
74
|
-
Mc Spacing_Mark
|
|
75
|
-
Me Enclosing_Mark
|
|
76
|
-
Mn Nonspacing_Mark
|
|
77
|
-
N Number
|
|
78
|
-
Nd Decimal_Number digit
|
|
79
|
-
Nl Letter_Number
|
|
80
|
-
No Other_Number
|
|
81
|
-
P Punctuation punct
|
|
82
|
-
Pc Connector_Punctuation
|
|
83
|
-
Pd Dash_Punctuation
|
|
84
|
-
Pe Close_Punctuation
|
|
85
|
-
Pf Final_Punctuation
|
|
86
|
-
Pi Initial_Punctuation
|
|
87
|
-
Po Other_Punctuation
|
|
88
|
-
Ps Open_Punctuation
|
|
89
|
-
S Symbol
|
|
90
|
-
Sc Currency_Symbol
|
|
91
|
-
Sk Modifier_Symbol
|
|
92
|
-
Sm Math_Symbol
|
|
93
|
-
So Other_Symbol
|
|
94
|
-
Z Separator
|
|
95
|
-
Zl Line_Separator
|
|
96
|
-
Zp Paragraph_Separator
|
|
97
|
-
Zs Space_Separator
|
|
98
|
-
ASCII
|
|
99
|
-
ASCII_Hex_Digit AHex
|
|
100
|
-
Alphabetic Alpha
|
|
101
|
-
Any
|
|
102
|
-
Assigned
|
|
103
|
-
Bidi_Control Bidi_C
|
|
104
|
-
Bidi_Mirrored Bidi_M
|
|
105
|
-
Case_Ignorable CI
|
|
106
|
-
Cased
|
|
107
|
-
Changes_When_Casefolded CWCF
|
|
108
|
-
Changes_When_Casemapped CWCM
|
|
109
|
-
Changes_When_Lowercased CWL
|
|
110
|
-
Changes_When_NFKC_Casefolded CWKCF
|
|
111
|
-
Changes_When_Titlecased CWT
|
|
112
|
-
Changes_When_Uppercased CWU
|
|
113
|
-
Dash
|
|
114
|
-
Default_Ignorable_Code_Point DI
|
|
115
|
-
Deprecated Dep
|
|
116
|
-
Diacritic Dia
|
|
117
|
-
Emoji
|
|
118
|
-
Emoji_Component EComp
|
|
119
|
-
Emoji_Modifier EMod
|
|
120
|
-
Emoji_Modifier_Base EBase
|
|
121
|
-
Emoji_Presentation EPres
|
|
122
|
-
Extended_Pictographic ExtPict
|
|
123
|
-
Extender Ext
|
|
124
|
-
Grapheme_Base Gr_Base
|
|
125
|
-
Grapheme_Extend Gr_Ext
|
|
126
|
-
Hex_Digit Hex
|
|
127
|
-
IDS_Binary_Operator IDSB
|
|
128
|
-
IDS_Trinary_Operator IDST
|
|
129
|
-
ID_Continue IDC
|
|
130
|
-
ID_Start IDS
|
|
131
|
-
Ideographic Ideo
|
|
132
|
-
Join_Control Join_C
|
|
133
|
-
Logical_Order_Exception LOE
|
|
134
|
-
Lowercase Lower
|
|
135
|
-
Math
|
|
136
|
-
Noncharacter_Code_Point NChar
|
|
137
|
-
Pattern_Syntax Pat_Syn
|
|
138
|
-
Pattern_White_Space Pat_WS
|
|
139
|
-
Quotation_Mark QMark
|
|
140
|
-
Radical
|
|
141
|
-
Regional_Indicator RI
|
|
142
|
-
Sentence_Terminal STerm
|
|
143
|
-
Soft_Dotted SD
|
|
144
|
-
Terminal_Punctuation Term
|
|
145
|
-
Unified_Ideograph UIdeo
|
|
146
|
-
Uppercase Upper
|
|
147
|
-
Variation_Selector VS
|
|
148
|
-
White_Space space
|
|
149
|
-
XID_Continue XIDC
|
|
150
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Ol(e),e])),xu=new Map([[`s`,ou(383)],[ou(383),`s`]]),Su=new Map([[ou(223),ou(7838)],[ou(107),ou(8490)],[ou(229),ou(8491)],[ou(969),ou(8486)]]),Cu=new Map([Eu(453),Eu(456),Eu(459),Eu(498),...Du(8072,8079),...Du(8088,8095),...Du(8104,8111),Eu(8124),Eu(8140),Eu(8188)]),wu=new Map([[`alnum`,V`[\p{Alpha}\p{Nd}]`],[`alpha`,V`\p{Alpha}`],[`ascii`,V`\p{ASCII}`],[`blank`,V`[\p{Zs}\t]`],[`cntrl`,V`\p{Cc}`],[`digit`,V`\p{Nd}`],[`graph`,V`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,V`\p{Lower}`],[`print`,V`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,V`[\p{P}\p{S}]`],[`space`,V`\p{space}`],[`upper`,V`\p{Upper}`],[`word`,V`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,V`\p{AHex}`]]);function Tu(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Eu(e){let t=ou(e);return[t.toLowerCase(),t]}function Du(e,t){return Tu(e,t).map(e=>Eu(e))}var Ou=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function ku(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Nu(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:du(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};jl(e,Au,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 jl(e,ju,a),jl(e,Mu,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Au={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=pl();e.body[0].body.push(ml({negate:!0,body:r}),bl(`Any`));let i=pl();i.body[0].body.push(_l(`greedy`,0,1/0,e)),n(H(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];uu(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Bu(t.get(e));if(n){let t=pl({flags:n});t.body[0].body=e.body,e.body=[H(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(H(ml({body:[rl({body:[il(`string_end`)]}),rl({body:[sl(10)]})]}),t));else if(c===`line_start`)o(H(Yu(V`(?<=\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&&Ku(e))o(H(ml({negate:!0}),t));else if(d)throw Error(V`Uses "\G" in a way that requires a subclass`);else o(Zu(il(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(H(Yu(V`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${vu})(?!${vu})|(?<!${vu})(?=${vu}))`,n=`(?:(?<=${vu})(?=${vu})|(?<!${vu})(?!${vu}))`;o(H(Yu(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Ju(n)&&(n=zu(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Ju(r)&&(r=zu(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(H(cl({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(Zu(ul(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(H(Xu(Yu(gu),l),t));return}if(s&&(c===`word`||u===`word`)){n(Zu(ul(`word`,{negate:l}),t));return}if(c===`any`)n(Zu(bl(`Any`),t));else if(c===`digit`)n(Zu(bl(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(V`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=V`\p{RI}{2}|${e}(?:\u200D${e})*`;n(H(Yu(V`(?>\r\n|${i?V`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Zu(bl(`AHex`,{negate:l}),t));else if(c===`newline`)n(H(Yu(l?`[^
|
|
151
|
-
]`:`(?>\r
|
|
152
|
-
?|[
|
|
153
|
-
\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-${ou(e.codePointAt(0)-1)}${ou(e.codePointAt(2)+1)}-\u{10FFFF}`),n(H(Yu(`[${e}]`),t))}else n(H(Xu(Yu(wu.get(u)),l),t))}else if(c===`property`)bu.has(Ol(u))||(e.key=`sc`);else if(c===`space`)n(Zu(bl(`space`,{negate:l}),t));else if(c===`word`)n(H(Xu(Yu(vu),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=pl({flags:c});e.body[0].body=o(),i(H(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Wc(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(V`Uses "\K" in a way that's unsupported`);let o=ml({behind:!0});o.body[0].body=a(),i(H(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(H(ml({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=pl();t.body[0].body.push(e.body),e.body=H(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=Uu(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(V`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Ju(n)&&(n=zu(n,t),e.ref=n)}},ju={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=Zu(Lu(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&uu(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=uu(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=lu(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?Lu(0):Iu(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Bu(Ru(o,e=>e.type===`Group`&&!!e.flags)),t=e?lu(r.globalFlags,e):r.globalFlags;Pu(t,r.currentFlags)||(l=pl({flags:Vu(t)}),l.body[0].body.push(c))}n(H(l,t),{traverse:!s})}},Mu={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=>Fu(t,e));i.length?i.length>1?n(H(pl({atomic:!0,body:i.reverse().map(e=>rl({body:[al(e.number)]}))}),t)):e.ref=i[0].number:n(H(ml({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=ol();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Nu(e){jl(e,{"*"({node:e,parent:t}){e.parent=t}})}function Pu(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Fu(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Hu(n.parent);for(let r of t){if(r===n)break;if(r===e||Wu(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Iu(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]=Iu(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Lu(e){let t=yl(e);return t.isRecursive=!0,t}function Ru(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function zu(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 Bu(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 Vu({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 Hu(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Uu(e){let t=e.find(e=>e.kind===`search_start`||qu(e,{negate:!1})||!Gu(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=Uu(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Wu(e,t){let n=Hu(e)??[];for(let e of n)if(e===t||Wu(e,t))return!0;return!1}function Gu({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Ku(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function qu(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Wc(e.body[0],{type:`Assertion`,kind:`search_start`})}function Ju(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Yu(e,t){let n=qc(e,{...t,unicodePropertyMap:bu}).body;return n.length>1||n[0].body.length>1?pl({body:n}):n[0].body[0]}function Xu(e,t){return e.negate=t,e}function Zu(e,t){return e.parent=t,e}function H(e,t){return Nu(e),e.parent=t,e}function Qu(e,t){let n=hu(t),r=du(n.target,`ES2024`),i=du(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];jl(e,$u,{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,fu(ed[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&&uu(f._captureTransfers,e.transferTo,[]).push(t)}),f}var $u={"*":{enter({node:e},t){if(fd(e)){let n=t.getCurrentModI();t.pushModI(e.flags?lu({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){fd(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){od(ou(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),sd(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Ou.has(e.value)&&t.setHasCasedChar()}},ed={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?V`\B`:V`\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=ou(e),r=cd(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&od(n)){let e=yu(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`);su.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(md)&&(o=[sl(45),...o.filter(e=>!md(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||su.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=pl(),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=rl({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`&&!(su.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=cd(n,i),o=cd(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&ld(sd(e)).forEach(e=>{s.add(Array.isArray(e)?`${cd(e[0],i)}-${cd(e[1],i)}`:cd(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?`.`:`[^]`:V`[^\n]`;if(e===`digit`)return t?V`\D`:V`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Ou.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?V`\P`:V`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?V`\W`:V`\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=lu(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${ud(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)+dd(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})`:V`\g<${t}&R=${r}>`}},td=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),nd=new Set([`-`,`\\`,`]`,`^`,`[`]),rd=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),id=new Map([[9,V`\t`],[10,V`\n`],[11,V`\v`],[12,V`\f`],[13,V`\r`],[8232,V`\u2028`],[8233,V`\u2029`],[65279,V`\uFEFF`]]),ad=/^\p{Cased}$/u;function od(e){return ad.test(e)}function sd(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=ou(e);if(!od(t))continue;let o=yu(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function cd(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(id.has(e))return id.get(e);if(e<32||e>126&&e<160||e>262143||t&&pd(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?rd:nd:td,a=ou(e);return(i.has(a)?`\\`:``)+a}function ld(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 ud(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 dd({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 fd({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function pd(e){return e>47&&e<58}function md({type:e,value:t}){return e===`Character`&&t===45}var hd=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=_d(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&&(gd(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||=vd(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 gd(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 _d(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)uu(n,t,{}).transferTo=e;return n}function vd(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 yd(e,t){let n=bd(e,t);return n.options?new hd(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function bd(e,t){let n=hu(t),r=ku(qc(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:bu}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Qu(r,n),a=eu(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Wl(ql(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 xd(e,t){return yd(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Sd(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>xd(e,{target:t.target}),{createScanner(e){return new $s(e,t)},createString(e){return{content:e}}}}async function Cd(e){if(jt())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=Et.get(e);if(t!=null)return t;try{let t=Dt.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Ht,e)&&(t=Ht[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 Tt.has(e)||Tt.set(e,n),n});return Et.set(e,n),await n}finally{Et.delete(e)}}function wd(e){return Tt.get(e)??Cd(e)}function Td(e=F){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Ed=new Set;function Dd(e){for(let t of Td(e))if(!Ed.has(t))return!1;return!0}function Od(e){let t=[],n=new Set;for(let r of kd(e.themes)){let e=Md(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 Od({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 Od({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function kd(e){return Ad(e)?[e]:e}function Ad(e){return Md(e)||jd(e)}function jd(e){return typeof e.name==`string`&&typeof e.load==`function`}function Md(e){return typeof e.getThemes==`function`}function Nd(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Pd=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Fd=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Id=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Ld(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Pd(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 Fd(i));let c=r,l=s().then(e=>{let a=Nd(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 Id(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 Rd=Ld();function zd(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Rd.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Rd.getResolvedTheme(n)??Rd.seedResolvedTheme(n,e);Ed.has(n)||(Ed.add(n),t.loadThemeSync(e))}}function Bd({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Vd(t)}}function Vd(e){return async()=>mi(Nd(await e()))}var Hd=`pierre`,Ud=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Wd=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Gd=[...Wd,...Ud],Kd=new Set(Wd);function qd(e){return Kd.has(e)?`light`:`dark`}var Jd={"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`},Yd={"pierre-dark":()=>w(()=>import(`./_CpLgRqie.js`),[]),"pierre-dark-soft":()=>w(()=>import(`./_kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>w(()=>import(`./_CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>w(()=>import(`./_B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>w(()=>import(`./_CpjhbsIL.js`),[]),"pierre-light":()=>w(()=>import(`./_CoaEpmwp.js`),[]),"pierre-light-soft":()=>w(()=>import(`./_lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>w(()=>import(`./_D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>w(()=>import(`./_0fSaH845.js`),[]),"pierre-light-tritanopia":()=>w(()=>import(`./_CEbqgOJL.js`),[])};function Xd(e){return Bd({name:e,collection:Hd,colorScheme:qd(e),displayName:Jd[e],load:Yd[e]})}var Zd=Od({themes:Gd.map(e=>Xd(e))}),Qd=`shiki`,$d=[`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`],ef=`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(`.`),tf=new Set($d);function nf(e){return tf.has(e)?`light`:`dark`}var rf={andromeeda:()=>w(()=>import(`./_vGVdxbeo.js`),[]),"aurora-x":()=>w(()=>import(`./_CDeNXAV0.js`),[]),"ayu-dark":()=>w(()=>import(`./_DluEY0Gj.js`),[]),"ayu-light":()=>w(()=>import(`./_C3h-C4tm.js`),[]),"ayu-mirage":()=>w(()=>import(`./_Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>w(()=>import(`./_C9Q5zVZY.js`),[]),"catppuccin-latte":()=>w(()=>import(`./_CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>w(()=>import(`./_R8nAf1vR.js`),[]),"catppuccin-mocha":()=>w(()=>import(`./_DjuaAJKi.js`),[]),"dark-plus":()=>w(()=>import(`./_Cs2F2srj.js`),[]),dracula:()=>w(()=>import(`./_BHWKrbxM.js`),[]),"dracula-soft":()=>w(()=>import(`./_5eyTD99u.js`),[]),"everforest-dark":()=>w(()=>import(`./_sB-x3p7T.js`),[]),"everforest-light":()=>w(()=>import(`./_Df2xbC6M.js`),[]),"github-dark":()=>w(()=>import(`./_C-LZuMrd.js`),[]),"github-dark-default":()=>w(()=>import(`./_DXG-b-1a.js`),[]),"github-dark-dimmed":()=>w(()=>import(`./_Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>w(()=>import(`./_B_tTalzw.js`),[]),"github-light":()=>w(()=>import(`./_EUqPIrTm.js`),[]),"github-light-default":()=>w(()=>import(`./_BXViO-2h.js`),[]),"github-light-high-contrast":()=>w(()=>import(`./_B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>w(()=>import(`./_C820rvS2.js`),[]),"gruvbox-dark-medium":()=>w(()=>import(`./_BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>w(()=>import(`./_MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>w(()=>import(`./_BC_s9l72.js`),[]),"gruvbox-light-medium":()=>w(()=>import(`./_BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>w(()=>import(`./_BSMLrYjP.js`),[]),horizon:()=>w(()=>import(`./_CE9ld1lL.js`),[]),"horizon-bright":()=>w(()=>import(`./_DSNQnXHK.js`),[]),houston:()=>w(()=>import(`./_CsvMBhTu.js`),[]),"kanagawa-dragon":()=>w(()=>import(`./_Bozd7klA.js`),[]),"kanagawa-lotus":()=>w(()=>import(`./_BmuOG9ZW.js`),[]),"kanagawa-wave":()=>w(()=>import(`./_BML5mF2J.js`),[]),laserwave:()=>w(()=>import(`./_C_8bwKvT.js`),[]),"light-plus":()=>w(()=>import(`./_DVQuIRkW.js`),[]),"material-theme":()=>w(()=>import(`./_Bm3Qr25_.js`),[]),"material-theme-darker":()=>w(()=>import(`./_2IIEA8gg.js`),[]),"material-theme-lighter":()=>w(()=>import(`./_uhdI0v04.js`),[]),"material-theme-ocean":()=>w(()=>import(`./_CHQ94UKr.js`),[]),"material-theme-palenight":()=>w(()=>import(`./_B5W6OYN7.js`),[]),"min-dark":()=>w(()=>import(`./_BSWPekZh.js`),[]),"min-light":()=>w(()=>import(`./_DDpmG2fV.js`),[]),monokai:()=>w(()=>import(`./_B_bV9PQ9.js`),[]),"night-owl":()=>w(()=>import(`./_DhmEMT88.js`),[]),"night-owl-light":()=>w(()=>import(`./_eJ-hLW7d.js`),[]),nord:()=>w(()=>import(`./_Cb4Vim4T.js`),[]),"one-dark-pro":()=>w(()=>import(`./_CLwyXe_n.js`),[]),"one-light":()=>w(()=>import(`./_D7Lr4KcI.js`),[]),plastic:()=>w(()=>import(`./_DQwYfKfQ.js`),[]),poimandres:()=>w(()=>import(`./_DRFjx7u4.js`),[]),red:()=>w(()=>import(`./_DX1BQOs8.js`),[]),"rose-pine":()=>w(()=>import(`./_aMsaMD1D.js`),[]),"rose-pine-dawn":()=>w(()=>import(`./_8PwUyIlP.js`),[]),"rose-pine-moon":()=>w(()=>import(`./_DO-qXg-I.js`),[]),"slack-dark":()=>w(()=>import(`./_DnToyrRv.js`),[]),"slack-ochin":()=>w(()=>import(`./_B2OO5cIa.js`),[]),"snazzy-light":()=>w(()=>import(`./_4G7pJPwS.js`),[]),"solarized-dark":()=>w(()=>import(`./_UdsmMDCL.js`),[]),"solarized-light":()=>w(()=>import(`./_C1IUL_tW.js`),[]),"synthwave-84":()=>w(()=>import(`./_nFMaYfgc.js`),[]),"tokyo-night":()=>w(()=>import(`./_oM2G3aXe.js`),[]),vesper:()=>w(()=>import(`./_DdrHHSXu.js`),[]),"vitesse-black":()=>w(()=>import(`./_fwtXNY1n.js`),[]),"vitesse-dark":()=>w(()=>import(`./_BZCL-v6S.js`),[]),"vitesse-light":()=>w(()=>import(`./_VbXTXTou.js`),[])};function af(e){return Bd({name:e,collection:Qd,colorScheme:nf(e),load:rf[e]})}var of=Od({themes:Object.freeze([...$d.map(e=>af(e)),...ef.map(e=>af(e))])});function sf(e){if(jt())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(Rd.hasRegisteredTheme(e))return;let t=of.getTheme(e);if(t!=null){Rd.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function cf(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function lf(e){sf(e);let t=await Rd.resolveTheme(e);return cf(e,t),t}function uf(e){return Rd.getResolvedTheme(e)??lf(e)}var df;async function ff({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){df??=Ws({themes:[],langs:[`text`],engine:n===`shiki-wasm`?vn(w(()=>import(`./_sWLklcDZ.js`),[])):Sd()});let r=hf(df)?await df:df;df=r;let i=[];for(let e of Array.from(new Set(t))){if(e===`text`||e===`ansi`)continue;let t=wd(e);`then`in t?i.push(t):At(t,r)}let a=[];for(let t of e){let e=uf(t);`then`in e?a.push(e):zd(e,df)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{At(e,r)}),Promise.all(a).then(e=>{zd(e,r)})]),r}function pf(e=df){return e!=null&&!(`then`in e)}function mf(e){if(!(df==null||`then`in df)&&(e==null||Dd(e.theme)&&kt(e.lang)))return df}function hf(e=df){return e!=null&&`then`in e}async function gf(e){await ff(e)}for(let e of Zd.getThemes())Rd.registerThemeIfAbsent(e.name,e.load);var _f=new Set,vf=null;function yf(e){_f.add(e),vf??=requestAnimationFrame(xf)}function bf(e){_f.delete(e)&&_f.size===0&&vf!=null&&(cancelAnimationFrame(vf),vf=null)}function xf(e){let t=new Set(_f);_f.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}vf=_f.size>0?requestAnimationFrame(xf):null}function Sf(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Cf(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function wf(e,t){let n=e?.theme??F,r=t?.theme??F,i=Tf(e),a=Tf(t);return Cf(n,r)&&Sf(e,t,[`theme`,`parseDiffOptions`])&&Sf(i,a)}function Tf(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Ef(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Df({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Of(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function kf(e){return{type:`text`,value:e}}function U({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Af({name:e,width:t=16,height:n=16,properties:r}){return U({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[U({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function jf(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 Mf(e){return U({tagName:`div`,properties:{"data-gutter":``},children:e})}function Nf(e,t,n,r={}){return U({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[U({tagName:`span`,properties:{"data-line-number-content":``},children:[kf(`${t}`)]})]})}function Pf(e,t,n){return U({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 Ff(){return U({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Af({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function If(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Lf(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 Rf=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(),bf(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||Ef(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&&Lf(e.composedPath())||(ip(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)&&(ip(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(ip(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){ip(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();ip(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);ip(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=Uf(i)&&this.hoveredLine?.lineElement===i.lineElement;Hf(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Hf(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Uf(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Gf(i)&&p!=null){p(i);break}if(Wf(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Uf(i))break;Hf(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,ip(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})()),ip(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),ip(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();Lf(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(If(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=Wo(Ff());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);Vf(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(Jf(t));if(Vf(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(Vf(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(Vf(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&&Lf(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=Jf(e);if(t&&Lf(n))return;let r=Yf(e);return r==null?this.pathFromAnnotationSlot(e):Jf(r)}pathFromAnnotationSlot(e){let t=Xf(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return Jf(t);let n=Qf(Zf(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:Jf(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=$f(t)?t:$f(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)}Ef(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,yf(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=()=>{bf(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!tp(this.renderedSelectedLinesState,n),i=!tp(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);Kf(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=rp(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=rp(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:qf(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:qf(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:np(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:np(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 zf({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:Bf({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 Bf({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 Vf(e){return e!=null&&`kind`in e&&e.kind===`line`}function Hf(e){return e!=null&&`kind`in e&&e.kind===`token`}function Uf(e){return Vf(e)||Hf(e)}function Wf(e){return`type`in e&&e.type===`line-info`}function Gf(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Kf(e){return e===`current`||e===`incoming`||e===`both`}function qf(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Jf(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function Yf(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 Xf(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function Zf(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 Qf(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 $f(e){return e!=null&&typeof e.elementFromPoint==`function`}function ep(e,t){return e===t||Ef(e??void 0,t??void 0)}function tp(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&ep(e?.range??null,t.range)}function np(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function rp(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 ip(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 ap=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),cp(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`?dp(t):fp(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:op(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:sp(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&lp(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 op(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function sp(e){return Math.max(Math.ceil(e),0)}function cp(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?lp(e,{codeWidthChanged:!0,numberWidthChanged:!0}):up(e))}function lp(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 up(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 dp(e){e.codeElement.isConnected&&up(e)}function fp(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`)}function pp(e){return Rd.hasResolvedThemes(e)}function mp(e,t){return Cf(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function hp(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 gp(e){return U({tagName:`div`,children:[U({tagName:`div`,children:e.annotations?.map(e=>U({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function _p(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 vp({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 U({tagName:`div`,children:[t===`custom`?U({tagName:`slot`,properties:{name:P}}):yp({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[bp(r)]],properties:i})}function yp({name:e,prevName:t,iconType:n}){let r=[U({tagName:`slot`,properties:{name:ct}}),Af({name:_p(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(U({tagName:`div`,children:[U({tagName:`bdi`,children:[kf(t)]})],properties:{"data-prev-name":``}})),r.push(Af({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(U({tagName:`div`,children:[U({tagName:`bdi`,children:[kf(e)]})],properties:{"data-title":``}})),r.push(U({tagName:`slot`,properties:{name:lt}})),U({tagName:`div`,children:r,properties:{"data-header-content":``}})}function bp(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(U({tagName:`span`,children:[kf(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(U({tagName:`span`,children:[kf(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(U({tagName:`slot`,properties:{name:ut}})),U({tagName:`div`,children:t,properties:{"data-metadata":``}})}function xp(e){return U({tagName:`pre`,properties:Sp(e)})}function Sp({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 Cp=new Map,wp=0,Tp={"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 Ep(e){if(Cp.has(e))return Cp.get(e)??`text`;if(Tp[e]!=null)return Tp[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Cp.has(t[1]))return Cp.get(t[1])??`text`;if(Tp[t[1]]!=null)return Tp[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Cp.has(n)?Cp.get(n)??`text`:Tp[n]??`text`}function Dp(){return wp}function Op(){return Object.fromEntries(Cp)}function kp(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:Array.isArray(e)?e:[e??`text`],themes:Td(t),preferredHighlighter:n}}function Ap(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function jp(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function Mp(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(kf(`
|
|
154
|
-
`)),e}var Np=Symbol(`no-token`),Pp=Symbol(`multiple-tokens`);function Fp(e){let t=Ip(e);if(t!=null)return t;let n=Np,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`){Rp(e,a);for(let t of e.children)Lp(t)}else Lp(e);r.push(e),i=[],a=void 0;return}for(let e of i)Lp(e);r.push(U({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Np){if(e===Pp){n=Pp;return}if(n===Np){n=e;return}n!==e&&(n=Pp)}};for(let t of e.children){let e=t.type===`element`?Fp(t):Np;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 Ip(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Lp(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Lp(t)}}function Rp(e,t){e.properties[`data-char`]=t}function zp(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+Bp(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 Bp(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 Vp(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=jf(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Fp(a),i.push(Mp(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(Up,Hp),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:Hp}}var Hp=zp({classPrefix:`hl-`}),Up={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 Wp(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Gp=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Kp=/^0(?:\.0+)?%?$/;function qp(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 Jp(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 Yp(e){if(e==null)return null;let t=Jp(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 Xp(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Gp.test(t))return!0;let n=qp(t);return n!=null&&Kp.test(n)}function Zp(e,t,n){if(t==null||n==null)return!1;let r=Yp(e),i=Yp(t),a=Yp(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Qp=new WeakMap;function $p(e){let t=Qp.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;em(r,`editor.background`,i),em(r,`editor.foreground`,a),em(r,`sideBar.background`,o),em(r,`sideBar.foreground`,s),em(r,`input.background`,n[`input.background`]??o),em(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),em(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),em(r,`gitDecoration.addedResourceForeground`,tm(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),em(r,`gitDecoration.modifiedResourceForeground`,tm(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),em(r,`gitDecoration.deletedResourceForeground`,tm(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Xp(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Xp(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(nm(l,o)||Zp(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Qp.set(e,u),u}function em(e,t,n){n!=null&&n!==``&&(e[t]=n)}function tm(...e){for(let t of e)if(t!=null&&t!==``)return t}function nm(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function rm({theme:e=F,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=$p(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Wp(`global`)}fg:${a.fg};`,r+=`${Wp(`global`)}bg:${a.bg};`,r+=im(i,n)}else{let n=t.getTheme(e.dark),i=$p(n);r+=`${Wp(`global`)}dark:${i.fg};`,r+=`${Wp(`global`)}dark-bg:${i.bg};`,r+=im(n,`dark`),n=t.getTheme(e.light),i=$p(n),r+=`${Wp(`global`)}light:${i.fg};`,r+=`${Wp(`global`)}light-bg:${i.bg};`,r+=im(n,`light`)}return r}function im(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Wp(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Wp(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Wp(`global`)}${t}modified-color:${a};`),n}function am(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`)}var om=10,sm=13,cm=4,lm=40;function um(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
|
|
155
|
-
`),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
|
|
156
|
-
`,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
|
|
157
|
-
`,o)),t.push(o),++a===cm){if(o-i<=lm){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===om||r===sm)&&(r===sm&&n+1<e.length&&e.charCodeAt(n+1)===om&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function dm(e){let t=um(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}function fm(e,t){for(let n of t)e.push(n)}var pm={forcePlainText:!1};function mm(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=pm){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=Vp(i),f=a?`text`:e.lang??Ep(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=rm({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:Wp(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:Wp(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=am(t.codeToHast(hm(l?gm(c??dm(e.contents),o,s):e.contents),h)),_=l?Array(o):g;return l&&fm(_,g),{code:_,themeStyles:m,baseThemeType:p}}function hm(e){return e.replace(/\r(?!\n)/g,`
|
|
158
|
-
`)}function gm(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}function _m(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var vm=`-1,-1`;function ym(e){return e?.some(e=>e.lineNumber===0)??!1}function bm(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function xm(e){return e.startingLine===0&&e.totalLines>0}function Sm(e,t){return e.endsWith(`\r
|
|
159
|
-
`)?t+`\r
|
|
160
|
-
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
161
|
-
`)?t+`
|
|
162
|
-
`:t}function Cm(e,t){return U({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function wm(e){return(e.lang??Ep(e.name))===`text`}function Tm(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var Em=-1,Dm=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`file-renderer:${++Em}`;highlighter;file;renderCache;pendingHighlightResult;computedLang=`text`;lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;get fileCache(){return this.renderCache?.file}constructor(e={theme:F},t=Ap,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=Dd(e.theme??F)?mf():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(e,t){let{editSessionActive:n,renderCache:r}=this;if(this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.file=e,r==null||n&&r.file===e)return;let{options:i}=this.getRenderOptions(e),a=r.file===e,o=t!=null&&_m(r.file,t),{result:s}=r;if(!r.highlighted||s==null||!mp(r.options,i)||!a&&!o){this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;return}if(a)return;this.renderCache={...r,file:e,result:{...s,code:[...s.code]}};let{lineCache:c}=this;this.lineCache=c!=null&&t!=null&&Tm(c,t)?{cacheKey:void 0,file:e,sourceContents:e.contents,lines:c.lines}:void 0}endEditSession(e){this.editSessionActive=!1,this.pendingHighlightResult=void 0;let{renderCache:t}=this;e!=null&&t!=null&&t.file!==e&&_m(t.file,e)&&(t.file=e)}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.file=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}clearRenderCache(){this.pendingStructuralRows=void 0,this.renderCache=void 0,this.pendingHighlightResult=void 0}hydrate(e){this.file=e;let{options:t}=this.getRenderOptions(e),n=Om(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!mp(t,r.options)&&(r=void 0),this.renderCache??={file:e,hydrated:!0,options:t,highlighted:!n&&!wm(e),result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??Ep(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??F}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():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.getFileRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{tokenizeMaxLineLength:e=1e3}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:e}})(),{renderCache:n}=this;return n?.result==null||!_m(e,n.file)||!mp(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getFileForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null)return e;let{renderCache:n}=this;if(n==null)return e;if(_m(n.file,e))return n.file;let r=dm(e.contents),i=e.contents.length===0||wm(e)||Om(r.length,this.getTokenizeMaxLength());return this.canRenderFile(e,t,i)?e:n.file}canRenderFile(e,t,n){let{renderCache:r}=this;return r==null||_m(r.file,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&Dd(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&Dd(t.theme)}getOrCreateLineCache(e){let{lineCache:t}=this;return(t==null||!Tm(t,e))&&(t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:dm(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){let t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return;let{file:i,result:a}=r;if(a==null)return;let o=n?new Map:void 0;this.pendingStructuralRows=o;let s=this.lineCache!=null&&Tm(this.lineCache,i)?this.lineCache:void 0;for(let[t,n]of e){if(o==null&&s!=null&&t<s.lines.length){let e=n.map(e=>e[2]).join(``);s.lines[t]=Sm(s.lines[t]??``,e)}let e={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},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}]})};o==null?a.code[t]=e:o.set(t,e)}a.baseThemeType=t,r.isDirty=!0,o==null&&s!=null&&(i.contents=s.lines.join(``),s.sourceContents=i.contents)}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;if(this.pendingStructuralRows=void 0,n==null)return;let{file:r,result:i}=n;if(i==null)return;let a=this.lineCache!=null&&Tm(this.lineCache,r)?this.lineCache.lines:dm(r.contents),o=dm(e.getText());if(a.length!==o.length){let r=Math.min(a.length,o.length),s=0;for(;s<r&&a[s]===o[s];)s++;let c=0;for(;c<r-s&&a[a.length-1-c]===o[o.length-1-c];)c++;let l=i.code;i.code=Array(o.length);for(let e=0;e<s;e++)i.code[e]=l[e];for(let e=0;e<c;e++)i.code[o.length-1-e]=l[a.length-1-e];if(t!==void 0)for(let[e,n]of t)e<o.length&&(i.code[e]=n);for(let t=s;t<o.length-c;t++)i.code[t]??={type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:e.getLineText(t)}]}]};for(let e=0;e<i.code.length;e++){let t=i.code[e];t?.type===`element`&&(t.properties[`data-line`]=e+1,t.properties[`data-line-index`]=e)}n.isDirty=!0}this.lineCache={cacheKey:r.cacheKey,file:r,sourceContents:r.contents,lines:o},this.textDocumentCache.set(r,e),r.contents=e.getText()}renderFile(e=this.file,t=Ct){if(this.file=e,e==null){this.pendingHighlightResult=void 0;return}let{options:n,forceHighlight:r}=this.getRenderOptions(e),i=this.getReadyRenderResult(e,n);this.pendingHighlightResult=void 0,i!=null&&(this.renderCache={...i,file:e,renderRange:void 0},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let a=this.getOrCreateLineCache(e),o=e.contents.length>0,s=!o||wm(e)||Om(a.length,this.getTokenizeMaxLength()),c=this.canRenderFile(e,n,s),l=!_m(e,this.renderCache.file),u=!hp(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let i=this.renderCache.result==null&&this.renderCache.highlighted&&!s&&!l&&jp(t);c&&!i&&(s||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e)}else{this.computedLang=e.lang??Ep(e.name),this.highlighter??=mf();let t=this.highlighter!=null&&Dd(n.theme),i=this.highlighter!=null&&kt(this.computedLang),a=!s&&i;if(c&&this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=Ct){this.file=e;let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=Om(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??Ep(e.name);let n=this.highlighter!=null&&pp(Td(this.getLocalHighlightTheme())),r=t||this.highlighter!=null&&kt(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:mm(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let a=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,s=[],c=Mf(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=xm(t)?bm(this.lineAnnotations):void 0;d!=null&&(c.children.push(Pf(`context`,`annotation`,1)),s.push(gp({type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:d.map(e=>this.annotationSlotName(e))})),u++);for(let r=t.startingLine;r<l;r++){let t=r+1,i=n[r];if(i==null){let n=`FileRenderer.processFileResult: Line doesnt exist`;throw console.error(n,{name:e.name,lineIndex:r,lineNumber:t}),Error(n)}c.children.push(Nf(`context`,t,`${r}`)),s.push(i),u++;let a=this.lineAnnotations[t];a!=null&&(c.children.push(Pf(`context`,`annotation`,1)),s.push(gp({type:`annotation`,hunkIndex:0,lineIndex:t,annotations:a.map(e=>this.annotationSlotName(e))})),u++)}return c.properties.style=`grid-row: span ${u}`,{file:e,gutterAST:c.children??[],contentAST:s,preAST:this.createPreElement(a),headerAST:o?void 0:this.renderHeader(e),totalLines:a,rowCount:u,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return vp({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return Wo(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(U({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=Mf();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,Cm(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return Wo(t?U({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await ff(kp(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{file:i,renderCache:a}=this;i!=null&&a!=null&&_m(e,i)&&mp(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&mp(a.options,n)&&_m(a.file,i)||(this.pendingHighlightResult={file:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getFileResultCache(e);if(n!=null&&mp(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&_m(n.file,e)&&mp(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{file:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&_m(e,n.file)&&mp(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return xp({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Om(e,t){return e>t}var km=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
163
|
-
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
164
|
-
<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"/>
|
|
165
|
-
</symbol>
|
|
166
|
-
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
167
|
-
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
168
|
-
</symbol>
|
|
169
|
-
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
170
|
-
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
171
|
-
</symbol>
|
|
172
|
-
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
173
|
-
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
174
|
-
</symbol>
|
|
175
|
-
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
176
|
-
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
177
|
-
</symbol>
|
|
178
|
-
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
179
|
-
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
180
|
-
</symbol>
|
|
181
|
-
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
182
|
-
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
183
|
-
</symbol>
|
|
184
|
-
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
185
|
-
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
186
|
-
</symbol>
|
|
187
|
-
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
188
|
-
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
189
|
-
</symbol>
|
|
190
|
-
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
191
|
-
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
192
|
-
</symbol>
|
|
193
|
-
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
194
|
-
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 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.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
195
|
-
</symbol>
|
|
196
|
-
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
197
|
-
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 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.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
198
|
-
</symbol>
|
|
199
|
-
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
200
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 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.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
201
|
-
</symbol>
|
|
202
|
-
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
203
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.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.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
204
|
-
</symbol>
|
|
205
|
-
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
206
|
-
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.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.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
207
|
-
</symbol>
|
|
208
|
-
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
209
|
-
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 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.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
210
|
-
</symbol>
|
|
211
|
-
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
212
|
-
<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"/>
|
|
213
|
-
</symbol>
|
|
214
|
-
</svg>`;function Am(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function jm(e,t){return e==null||t==null?e===t:Nm(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 Mm={};function Nm(e=Mm,t=Mm){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 Pm(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Fm(){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 Im(){let e=document.createElement(`style`);return e.setAttribute(ft,``),e}var Lm=`@layer base {
|
|
215
|
-
:host {
|
|
216
|
-
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
217
|
-
"Courier New", monospace;
|
|
218
|
-
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
219
|
-
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
220
|
-
--diffs-mixer: light-dark(#000, #fff);
|
|
221
|
-
--diffs-gap-fallback: 8px;
|
|
222
|
-
--diffs-scrollbar-gutter-fallback: 6px;
|
|
223
|
-
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
224
|
-
--diffs-added-light: #0dbe4e;
|
|
225
|
-
--diffs-added-dark: #5ecc71;
|
|
226
|
-
--diffs-modified-light: #009fff;
|
|
227
|
-
--diffs-modified-dark: #69b1ff;
|
|
228
|
-
--diffs-deleted-light: #ff2e3f;
|
|
229
|
-
--diffs-deleted-dark: #ff6762;
|
|
230
|
-
--diffs-warning-light: #d5a910;
|
|
231
|
-
--diffs-warning-dark: #ffd452;
|
|
232
|
-
color-scheme: light dark;
|
|
233
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
234
|
-
font-size: var(--diffs-font-size, 13px);
|
|
235
|
-
line-height: var(--diffs-line-height, 20px);
|
|
236
|
-
font-feature-settings: var(--diffs-font-features);
|
|
237
|
-
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
238
|
-
--diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
|
|
239
|
-
--diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
|
|
240
|
-
--diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
|
|
241
|
-
--diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
|
|
242
|
-
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
243
|
-
--diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
|
|
244
|
-
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
245
|
-
--diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
|
|
246
|
-
--diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
|
|
247
|
-
--diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
|
|
248
|
-
--diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
|
|
249
|
-
--diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
|
|
250
|
-
--diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
|
|
251
|
-
--diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
|
|
252
|
-
--diffs-selection-base: var(--diffs-modified-base);
|
|
253
|
-
--diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
|
|
254
|
-
background-color: var(--diffs-bg);
|
|
255
|
-
color: var(--diffs-fg);
|
|
256
|
-
display: block;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
pre, code, [data-error-wrapper] {
|
|
260
|
-
isolation: isolate;
|
|
261
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
262
|
-
outline: none;
|
|
263
|
-
margin: 0;
|
|
264
|
-
padding: 0;
|
|
265
|
-
display: block;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
pre, code {
|
|
269
|
-
background-color: var(--diffs-bg);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
code {
|
|
273
|
-
contain: content;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
input, button {
|
|
277
|
-
font-family: inherit;
|
|
278
|
-
font-size: inherit;
|
|
279
|
-
line-height: inherit;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
*, :before, :after {
|
|
283
|
-
box-sizing: border-box;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
[data-icon-sprite] {
|
|
287
|
-
display: none;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
[data-diffs-header], [data-separator] {
|
|
291
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
[data-diffs-header][data-sticky] {
|
|
295
|
-
z-index: 1;
|
|
296
|
-
background-color: var(--diffs-bg);
|
|
297
|
-
position: sticky;
|
|
298
|
-
top: 0;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
[data-file-info] {
|
|
302
|
-
color: var(--fg);
|
|
303
|
-
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
304
|
-
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
305
|
-
padding: 10px;
|
|
306
|
-
font-weight: 700;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
[data-diff], [data-file] {
|
|
310
|
-
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
311
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
312
|
-
|
|
313
|
-
&[data-dehydrated] {
|
|
314
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
318
|
-
background-color: var(--diffs-bg-context);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
@supports (-webkit-touch-callout: none) {
|
|
323
|
-
:host {
|
|
324
|
-
--diffs-scrollbar-gutter-fallback: 0px;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
[data-line] span, [data-edit-prediction-suffix] span {
|
|
329
|
-
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
330
|
-
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
331
|
-
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
332
|
-
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
333
|
-
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
337
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
338
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
339
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
340
|
-
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
341
|
-
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
342
|
-
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
343
|
-
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
344
|
-
color: var(--diffs-fg);
|
|
345
|
-
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
[data-line], [data-no-newline] {
|
|
349
|
-
&[data-decoration-bg] {
|
|
350
|
-
--mix-deco-light: 92%;
|
|
351
|
-
--mix-deco-dark: 85%;
|
|
352
|
-
|
|
353
|
-
&[data-decoration-bg-depth="2"] {
|
|
354
|
-
--mix-deco-light: 88%;
|
|
355
|
-
--mix-deco-dark: 80%;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
&[data-decoration-bg-depth="3"] {
|
|
359
|
-
--mix-deco-light: 85%;
|
|
360
|
-
--mix-deco-dark: 78%;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
364
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
365
|
-
var(--diffs-bg) var(--mix-deco-light),
|
|
366
|
-
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
367
|
-
var(--diffs-bg) var(--mix-deco-dark),
|
|
368
|
-
var(--diffs-decoration-bg)));
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
373
|
-
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
374
|
-
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
375
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
[data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
|
|
379
|
-
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
380
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
384
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
385
|
-
var(--diffs-bg) 78%,
|
|
386
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
387
|
-
var(--diffs-bg) 68%,
|
|
388
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
389
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
393
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
394
|
-
var(--diffs-bg) 78%,
|
|
395
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
396
|
-
var(--diffs-bg) 68%,
|
|
397
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
398
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
402
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
403
|
-
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
:where([data-background]) {
|
|
407
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
408
|
-
--mix-light: 91%;
|
|
409
|
-
--mix-dark: 85%;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
& [data-line], & [data-no-newline] {
|
|
413
|
-
--mix-light: 88%;
|
|
414
|
-
--mix-dark: 80%;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
418
|
-
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
419
|
-
|
|
420
|
-
&[data-line-type="change-deletion"] {
|
|
421
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
422
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
423
|
-
|
|
424
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
425
|
-
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
426
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
430
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
431
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
432
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
433
|
-
var(--diffs-diff-line-mix-target)));
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
&[data-line-type="change-addition"] {
|
|
437
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
438
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
439
|
-
|
|
440
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
441
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
442
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
446
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
447
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
448
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
449
|
-
var(--diffs-diff-line-mix-target)));
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
&[data-merge-conflict="current"] {
|
|
453
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
454
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
455
|
-
|
|
456
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
457
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
458
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
462
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
463
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
464
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
465
|
-
var(--diffs-diff-line-mix-target)));
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
&[data-merge-conflict="incoming"] {
|
|
469
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
470
|
-
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
471
|
-
|
|
472
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
473
|
-
color: var(--diffs-modified-base);
|
|
474
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
478
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
479
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
480
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
481
|
-
var(--diffs-diff-line-mix-target)));
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
487
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
488
|
-
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
489
|
-
|
|
490
|
-
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
491
|
-
--mix-selection-light: 82%;
|
|
492
|
-
--mix-selection-dark: 75%;
|
|
493
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
497
|
-
--mix-selection-light: 75%;
|
|
498
|
-
--mix-selection-dark: 60%;
|
|
499
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
500
|
-
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
504
|
-
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
505
|
-
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
506
|
-
var(--mix-selection-light),
|
|
507
|
-
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
511
|
-
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
512
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
513
|
-
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
514
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
515
|
-
var(--diffs-selection-mix-target)));
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
520
|
-
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
521
|
-
var(--diffs-computed-selected-line-bg)
|
|
522
|
-
var(--diffs-editor-active-line-source-mix, 100%),
|
|
523
|
-
var(--diffs-selection-emphasis-mix-target));
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
@media (pointer: fine) {
|
|
527
|
-
[data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
|
|
528
|
-
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
529
|
-
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
530
|
-
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
531
|
-
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
532
|
-
var(--diffs-hover-mix-target)));
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
537
|
-
color: var(--diffs-selection-number-fg);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
[data-no-newline] {
|
|
541
|
-
user-select: none;
|
|
542
|
-
|
|
543
|
-
& span {
|
|
544
|
-
opacity: .6;
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
[data-diff-type="split"][data-overflow="scroll"] {
|
|
549
|
-
grid-template-columns: 1fr 1fr;
|
|
550
|
-
display: grid;
|
|
551
|
-
|
|
552
|
-
& [data-additions] {
|
|
553
|
-
border-left: 1px solid var(--diffs-bg);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
& [data-deletions] {
|
|
557
|
-
border-right: 1px solid var(--diffs-bg);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
[data-code] {
|
|
562
|
-
grid-auto-flow: dense;
|
|
563
|
-
grid-template-columns: var(--diffs-code-grid);
|
|
564
|
-
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
565
|
-
overscroll-behavior-x: none;
|
|
566
|
-
tab-size: var(--diffs-tab-size, 2);
|
|
567
|
-
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
568
|
-
padding-bottom: max(0px,
|
|
569
|
-
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
570
|
-
var(--diffs-scrollbar-gutter)));
|
|
571
|
-
scrollbar-gutter: stable;
|
|
572
|
-
align-self: flex-start;
|
|
573
|
-
display: grid;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
[data-diffs-scrollbar-measure] {
|
|
577
|
-
opacity: 0;
|
|
578
|
-
pointer-events: none;
|
|
579
|
-
scrollbar-gutter: auto;
|
|
580
|
-
grid-template-columns: none;
|
|
581
|
-
width: 100px;
|
|
582
|
-
height: 100px;
|
|
583
|
-
padding: 0;
|
|
584
|
-
position: absolute;
|
|
585
|
-
top: -200px;
|
|
586
|
-
left: -200px;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
[data-container-size] {
|
|
590
|
-
container-type: inline-size;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
[data-code]::-webkit-scrollbar {
|
|
594
|
-
width: 0;
|
|
595
|
-
height: var(--diffs-scrollbar-gutter);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
[data-code]::-webkit-scrollbar-track {
|
|
599
|
-
background: none;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
[data-code]::-webkit-scrollbar-thumb {
|
|
603
|
-
background-color: #0000;
|
|
604
|
-
background-clip: content-box;
|
|
605
|
-
border: 1px solid #0000;
|
|
606
|
-
border-radius: 3px;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
[data-code]::-webkit-scrollbar-corner {
|
|
610
|
-
background-color: #0000;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
@supports ((-moz-appearance: none)) {
|
|
614
|
-
[data-code] {
|
|
615
|
-
scrollbar-width: thin;
|
|
616
|
-
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
617
|
-
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
622
|
-
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
623
|
-
padding-top: 0;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
[data-gutter] {
|
|
628
|
-
grid-template-rows: subgrid;
|
|
629
|
-
grid-template-columns: subgrid;
|
|
630
|
-
z-index: 3;
|
|
631
|
-
background-color: var(--diffs-bg);
|
|
632
|
-
grid-column: 1;
|
|
633
|
-
display: grid;
|
|
634
|
-
position: relative;
|
|
635
|
-
|
|
636
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
637
|
-
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
[data-content] {
|
|
642
|
-
grid-template-rows: subgrid;
|
|
643
|
-
grid-template-columns: subgrid;
|
|
644
|
-
background-color: var(--diffs-bg);
|
|
645
|
-
grid-column: 2;
|
|
646
|
-
min-width: 0;
|
|
647
|
-
display: grid;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
651
|
-
grid-auto-flow: dense;
|
|
652
|
-
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
653
|
-
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
654
|
-
display: grid;
|
|
655
|
-
|
|
656
|
-
& [data-code] {
|
|
657
|
-
display: contents;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
& [data-deletions] {
|
|
661
|
-
& [data-gutter] {
|
|
662
|
-
grid-column: 1;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
& [data-content] {
|
|
666
|
-
border-right: 1px solid var(--diffs-bg);
|
|
667
|
-
grid-column: 2;
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
& [data-additions] {
|
|
672
|
-
& [data-gutter] {
|
|
673
|
-
border-left: 1px solid var(--diffs-bg);
|
|
674
|
-
grid-column: 3;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
& [data-content] {
|
|
678
|
-
grid-column: 4;
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
684
|
-
overflow: clip;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
[data-overflow="scroll"] [data-gutter] {
|
|
688
|
-
position: sticky;
|
|
689
|
-
left: 0;
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
[data-interactive-lines] [data-line] {
|
|
693
|
-
cursor: pointer;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
[data-interactive-line-numbers] [data-column-number] {
|
|
697
|
-
cursor: pointer;
|
|
698
|
-
touch-action: none;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
[data-content-buffer], [data-gutter-buffer] {
|
|
702
|
-
user-select: none;
|
|
703
|
-
min-height: 1lh;
|
|
704
|
-
position: relative;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
[data-gutter-buffer] {
|
|
708
|
-
padding-left: 2ch;
|
|
709
|
-
padding-right: 1ch;
|
|
710
|
-
|
|
711
|
-
&:before {
|
|
712
|
-
content: "";
|
|
713
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
714
|
-
display: block;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
[data-gutter-buffer="annotation"] {
|
|
719
|
-
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
720
|
-
min-height: 0;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
[data-gutter-buffer="buffer"] {
|
|
724
|
-
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
[data-content-buffer] {
|
|
728
|
-
background-position: 5px 0;
|
|
729
|
-
background-size: 8px 8px;
|
|
730
|
-
background-origin: border-box;
|
|
731
|
-
background-image: repeating-linear-gradient(-45deg,
|
|
732
|
-
transparent,
|
|
733
|
-
transparent calc(3px * 1.414),
|
|
734
|
-
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
735
|
-
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
736
|
-
grid-column: 1;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
[data-separator] {
|
|
740
|
-
box-sizing: content-box;
|
|
741
|
-
background-color: var(--diffs-bg);
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
[data-separator="simple"] {
|
|
745
|
-
min-height: 4px;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
749
|
-
background-color: var(--diffs-bg-separator);
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
753
|
-
height: 32px;
|
|
754
|
-
position: relative;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
[data-separator-wrapper] {
|
|
758
|
-
user-select: none;
|
|
759
|
-
fill: currentColor;
|
|
760
|
-
background-color: var(--diffs-bg);
|
|
761
|
-
align-items: center;
|
|
762
|
-
height: 100%;
|
|
763
|
-
display: flex;
|
|
764
|
-
position: absolute;
|
|
765
|
-
inset-inline: 0;
|
|
766
|
-
}
|
|
767
|
-
|
|
768
|
-
[data-content] [data-separator-wrapper] {
|
|
769
|
-
display: none;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
[data-separator="metadata"] [data-separator-wrapper] {
|
|
773
|
-
background-color: var(--diffs-bg-separator);
|
|
774
|
-
height: 100%;
|
|
775
|
-
color: var(--diffs-fg-number);
|
|
776
|
-
white-space: nowrap;
|
|
777
|
-
text-overflow: ellipsis;
|
|
778
|
-
min-width: min-content;
|
|
779
|
-
padding-inline: 1ch;
|
|
780
|
-
inset-inline: 100% auto;
|
|
781
|
-
overflow: hidden;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
[data-separator="line-info"] {
|
|
785
|
-
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
786
|
-
|
|
787
|
-
& [data-separator-wrapper] {
|
|
788
|
-
min-width: 16px;
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
793
|
-
margin-block: 0;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
[data-separator="line-info"][data-separator-first] {
|
|
797
|
-
margin-top: 0;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
[data-separator="line-info"][data-separator-last] {
|
|
801
|
-
margin-bottom: 0;
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
[data-expand-index] [data-separator-wrapper] {
|
|
805
|
-
grid-template-columns: 32px auto;
|
|
806
|
-
display: grid;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
810
|
-
grid-template-columns: 32px 32px auto;
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
[data-expand-button], [data-separator-content] {
|
|
814
|
-
background-color: var(--diffs-bg-separator);
|
|
815
|
-
flex: none;
|
|
816
|
-
align-items: center;
|
|
817
|
-
display: flex;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
[data-expand-index] [data-separator-content]:hover {
|
|
821
|
-
cursor: pointer;
|
|
822
|
-
text-decoration: underline;
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
[data-expand-button] {
|
|
826
|
-
cursor: pointer;
|
|
827
|
-
min-width: 32px;
|
|
828
|
-
color: var(--diffs-fg-number);
|
|
829
|
-
border-right: 2px solid var(--diffs-bg);
|
|
830
|
-
flex-shrink: 0;
|
|
831
|
-
justify-content: center;
|
|
832
|
-
align-self: stretch;
|
|
833
|
-
|
|
834
|
-
&:hover {
|
|
835
|
-
color: var(--diffs-fg);
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
&[data-expand-all-button] {
|
|
839
|
-
display: none;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
[data-expand-down] [data-icon] {
|
|
844
|
-
transform: scaleY(-1);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
[data-separator-content] {
|
|
848
|
-
height: 100%;
|
|
849
|
-
color: var(--diffs-fg-number);
|
|
850
|
-
flex: auto;
|
|
851
|
-
justify-content: flex-start;
|
|
852
|
-
padding: 0 1ch;
|
|
853
|
-
overflow: hidden;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
857
|
-
& [data-separator-content] {
|
|
858
|
-
user-select: none;
|
|
859
|
-
height: 100%;
|
|
860
|
-
overflow: clip;
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
[data-unmodified-lines] {
|
|
865
|
-
text-overflow: ellipsis;
|
|
866
|
-
white-space: nowrap;
|
|
867
|
-
flex: 0 auto;
|
|
868
|
-
min-width: 0;
|
|
869
|
-
display: block;
|
|
870
|
-
overflow: hidden;
|
|
871
|
-
}
|
|
872
|
-
|
|
873
|
-
@supports (width: 1cqi) {
|
|
874
|
-
[data-unified] {
|
|
875
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
876
|
-
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
877
|
-
width: 100cqi;
|
|
878
|
-
|
|
879
|
-
& [data-separator-content] {
|
|
880
|
-
border-radius: 6px;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
885
|
-
border-top-left-radius: unset;
|
|
886
|
-
border-bottom-left-radius: unset;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
[data-gutter] {
|
|
891
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
892
|
-
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
& [data-separator="line-info"] [data-separator-content] {
|
|
896
|
-
border-top-left-radius: 6px;
|
|
897
|
-
border-bottom-left-radius: 6px;
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
901
|
-
border-top-left-radius: unset;
|
|
902
|
-
border-bottom-left-radius: unset;
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
[data-additions] {
|
|
907
|
-
& [data-content] [data-separator="line-info"] {
|
|
908
|
-
background-color: var(--diffs-bg);
|
|
909
|
-
|
|
910
|
-
& [data-separator-wrapper] {
|
|
911
|
-
display: none;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
916
|
-
background-color: var(--diffs-bg-separator);
|
|
917
|
-
border-top-right-radius: 6px;
|
|
918
|
-
border-bottom-right-radius: 6px;
|
|
919
|
-
height: 100%;
|
|
920
|
-
display: block;
|
|
921
|
-
|
|
922
|
-
& [data-separator-content], & [data-expand-button] {
|
|
923
|
-
display: none;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
929
|
-
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
933
|
-
background-color: var(--diffs-bg-separator);
|
|
934
|
-
height: 100%;
|
|
935
|
-
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
936
|
-
border-top-right-radius: 6px;
|
|
937
|
-
border-bottom-right-radius: 6px;
|
|
938
|
-
display: block;
|
|
939
|
-
|
|
940
|
-
& [data-separator-content], & [data-expand-button] {
|
|
941
|
-
display: none;
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
946
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
947
|
-
border-top-left-radius: 6px;
|
|
948
|
-
border-bottom-left-radius: 6px;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
@media (pointer: fine) {
|
|
953
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
954
|
-
&[data-separator-multi-button] {
|
|
955
|
-
& [data-expand-up] {
|
|
956
|
-
border-top-left-radius: 6px;
|
|
957
|
-
border-bottom-left-radius: unset;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
& [data-expand-down] {
|
|
961
|
-
border-bottom-left-radius: 6px;
|
|
962
|
-
border-top-left-radius: unset;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
@media (pointer: coarse) {
|
|
970
|
-
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
971
|
-
grid-template-columns: 34px 34px auto;
|
|
972
|
-
|
|
973
|
-
& [data-separator-content] {
|
|
974
|
-
grid-column: unset;
|
|
975
|
-
grid-row: unset;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
@supports (width: 1cqi) {
|
|
980
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
981
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
982
|
-
border-top-left-radius: 6px;
|
|
983
|
-
border-bottom-left-radius: 6px;
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
&[data-separator-multi-button] {
|
|
987
|
-
& [data-expand-up] {
|
|
988
|
-
border-top-left-radius: 6px;
|
|
989
|
-
border-bottom-left-radius: 6px;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
& [data-expand-down] {
|
|
993
|
-
border-bottom-left-radius: unset;
|
|
994
|
-
border-top-left-radius: unset;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
@media (pointer: fine) {
|
|
1002
|
-
[data-separator-wrapper][data-separator-multi-button] {
|
|
1003
|
-
grid-template-rows: 50% 50%;
|
|
1004
|
-
display: grid;
|
|
1005
|
-
|
|
1006
|
-
& [data-separator-content] {
|
|
1007
|
-
grid-area: 1 / 2 / -1;
|
|
1008
|
-
min-width: min-content;
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
& [data-expand-button] {
|
|
1012
|
-
grid-column: 1;
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1017
|
-
grid-template-columns: 34px auto;
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
1021
|
-
grid-template-columns: 100% auto;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
1025
|
-
& [data-separator-multi-button] {
|
|
1026
|
-
& [data-expand-up] {
|
|
1027
|
-
border-bottom: 1px solid var(--diffs-bg);
|
|
1028
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
& [data-expand-down] {
|
|
1032
|
-
border-top: 1px solid var(--diffs-bg);
|
|
1033
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
1040
|
-
display: none;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
[data-line-annotation] {
|
|
1044
|
-
min-height: var(--diffs-annotation-min-height, 0);
|
|
1045
|
-
z-index: 2;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
[data-merge-conflict-actions] {
|
|
1049
|
-
z-index: 2;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
[data-separator="custom"] {
|
|
1053
|
-
grid-template-columns: subgrid;
|
|
1054
|
-
display: grid;
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
[data-line], [data-column-number], [data-no-newline] {
|
|
1058
|
-
padding-inline: 1ch;
|
|
1059
|
-
position: relative;
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
[data-indicators="classic"] [data-line] {
|
|
1063
|
-
padding-inline-start: 2ch;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
[data-indicators="classic"] {
|
|
1067
|
-
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1068
|
-
&[data-no-newline], &[data-line] {
|
|
1069
|
-
&:before {
|
|
1070
|
-
user-select: none;
|
|
1071
|
-
width: 1ch;
|
|
1072
|
-
height: 1lh;
|
|
1073
|
-
display: inline-block;
|
|
1074
|
-
position: absolute;
|
|
1075
|
-
top: 0;
|
|
1076
|
-
left: 0;
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
|
|
1081
|
-
& [data-line-type="change-addition"] {
|
|
1082
|
-
&[data-line], &[data-no-newline] {
|
|
1083
|
-
&:before {
|
|
1084
|
-
content: "+";
|
|
1085
|
-
color: var(--diffs-addition-base);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
& [data-line-type="change-deletion"] {
|
|
1091
|
-
&[data-line], &[data-no-newline] {
|
|
1092
|
-
&:before {
|
|
1093
|
-
content: "-";
|
|
1094
|
-
color: var(--diffs-deletion-base);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
[data-indicators="bars"] {
|
|
1101
|
-
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1102
|
-
&[data-column-number] {
|
|
1103
|
-
&:before {
|
|
1104
|
-
content: "";
|
|
1105
|
-
user-select: none;
|
|
1106
|
-
contain: strict;
|
|
1107
|
-
width: 4px;
|
|
1108
|
-
height: 100%;
|
|
1109
|
-
display: block;
|
|
1110
|
-
position: absolute;
|
|
1111
|
-
top: 0;
|
|
1112
|
-
left: 0;
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
& [data-line-type="change-deletion"] {
|
|
1118
|
-
&[data-column-number] {
|
|
1119
|
-
&:before {
|
|
1120
|
-
background-image: linear-gradient(0deg,
|
|
1121
|
-
var(--diffs-bg-deletion) 50%,
|
|
1122
|
-
var(--diffs-deletion-base) 50%);
|
|
1123
|
-
background-repeat: repeat;
|
|
1124
|
-
background-size: 2px 2px;
|
|
1125
|
-
background-size: calc(1lh / round(1lh / 2px))
|
|
1126
|
-
calc(1lh / round(1lh / 2px));
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
& [data-line-type="change-addition"] {
|
|
1132
|
-
&[data-column-number] {
|
|
1133
|
-
&:before {
|
|
1134
|
-
background-color: var(--diffs-addition-base);
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
|
|
1140
|
-
[data-overflow="wrap"] {
|
|
1141
|
-
& [data-line] {
|
|
1142
|
-
white-space: pre-wrap;
|
|
1143
|
-
word-break: break-word;
|
|
1144
|
-
}
|
|
1145
|
-
|
|
1146
|
-
& [data-annotation-content] {
|
|
1147
|
-
word-break: break-word;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
[data-overflow="scroll"] [data-line] {
|
|
1152
|
-
white-space: pre;
|
|
1153
|
-
min-height: 1lh;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
[data-column-number] {
|
|
1157
|
-
box-sizing: content-box;
|
|
1158
|
-
text-align: right;
|
|
1159
|
-
user-select: none;
|
|
1160
|
-
color: var(--diffs-fg-number);
|
|
1161
|
-
padding-left: 2ch;
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
[data-line-number-content] {
|
|
1165
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1166
|
-
z-index: 1;
|
|
1167
|
-
display: inline-block;
|
|
1168
|
-
position: relative;
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
[data-disable-line-numbers] {
|
|
1172
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1173
|
-
min-width: 4px;
|
|
1174
|
-
padding: 0;
|
|
1175
|
-
|
|
1176
|
-
&:before {
|
|
1177
|
-
min-width: 0;
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
& [data-line-number-content] {
|
|
1182
|
-
display: none;
|
|
1183
|
-
}
|
|
1184
|
-
|
|
1185
|
-
& [data-gutter-utility-slot] {
|
|
1186
|
-
right: unset;
|
|
1187
|
-
justify-content: flex-start;
|
|
1188
|
-
left: 0;
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1192
|
-
left: 6px;
|
|
1193
|
-
}
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
[data-file][data-disable-line-numbers] {
|
|
1197
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1198
|
-
border-right: 0;
|
|
1199
|
-
min-width: 0;
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
[data-diff-span] {
|
|
1204
|
-
box-decoration-break: clone;
|
|
1205
|
-
border-radius: 3px;
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1208
|
-
[data-line-type="change-addition"] [data-diff-span] {
|
|
1209
|
-
background-color: var(--diffs-bg-addition-emphasis);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1213
|
-
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1217
|
-
color: var(--diffs-fg);
|
|
1218
|
-
padding-left: 1ch;
|
|
1219
|
-
}
|
|
1220
|
-
|
|
1221
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1222
|
-
align-items: center;
|
|
1223
|
-
display: flex;
|
|
1224
|
-
|
|
1225
|
-
&:after {
|
|
1226
|
-
color: var(--diffs-fg-conflict-marker);
|
|
1227
|
-
font-size: .75rem;
|
|
1228
|
-
font-style: normal;
|
|
1229
|
-
line-height: 1.25rem;
|
|
1230
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1231
|
-
padding-left: 1ch;
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
[data-merge-conflict="marker-start"]:after {
|
|
1236
|
-
content: "(Current Change)";
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
[data-merge-conflict="marker-end"]:after {
|
|
1240
|
-
content: "(Incoming Change)";
|
|
1241
|
-
}
|
|
1242
|
-
|
|
1243
|
-
[data-merge-conflict-actions-content] {
|
|
1244
|
-
min-height: 1.75rem;
|
|
1245
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1246
|
-
color: var(--diffs-fg);
|
|
1247
|
-
align-items: center;
|
|
1248
|
-
gap: .25rem;
|
|
1249
|
-
padding-inline: .5rem;
|
|
1250
|
-
font-size: .75rem;
|
|
1251
|
-
line-height: 1.2;
|
|
1252
|
-
display: flex;
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
[data-merge-conflict-action] {
|
|
1256
|
-
appearance: none;
|
|
1257
|
-
color: var(--diffs-fg-number);
|
|
1258
|
-
font: inherit;
|
|
1259
|
-
cursor: pointer;
|
|
1260
|
-
background: none;
|
|
1261
|
-
border: 0;
|
|
1262
|
-
padding: 0;
|
|
1263
|
-
font-style: normal;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
[data-merge-conflict-action]:hover {
|
|
1267
|
-
color: var(--diffs-fg);
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
[data-merge-conflict-action="current"]:hover {
|
|
1271
|
-
color: var(--diffs-addition-base);
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
[data-merge-conflict-action="incoming"]:hover {
|
|
1275
|
-
color: var(--diffs-modified-base);
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
[data-merge-conflict-action-separator] {
|
|
1279
|
-
color: var(--diffs-fg-number);
|
|
1280
|
-
opacity: .6;
|
|
1281
|
-
user-select: none;
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
[data-diffs-header="default"] {
|
|
1285
|
-
background-color: var(--diffs-bg);
|
|
1286
|
-
justify-content: space-between;
|
|
1287
|
-
align-items: center;
|
|
1288
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1289
|
-
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1290
|
-
z-index: 2;
|
|
1291
|
-
flex-direction: row;
|
|
1292
|
-
padding-inline: 16px;
|
|
1293
|
-
display: flex;
|
|
1294
|
-
position: relative;
|
|
1295
|
-
top: 0;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
[data-header-content] {
|
|
1299
|
-
align-items: center;
|
|
1300
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1301
|
-
white-space: nowrap;
|
|
1302
|
-
flex-direction: row;
|
|
1303
|
-
min-width: 0;
|
|
1304
|
-
display: flex;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1308
|
-
text-overflow: ellipsis;
|
|
1309
|
-
white-space: nowrap;
|
|
1310
|
-
direction: rtl;
|
|
1311
|
-
min-width: 0;
|
|
1312
|
-
overflow: hidden;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
[data-prev-name] {
|
|
1316
|
-
opacity: .7;
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
[data-rename-icon] {
|
|
1320
|
-
fill: currentColor;
|
|
1321
|
-
flex-grow: 0;
|
|
1322
|
-
flex-shrink: 0;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
[data-diffs-header="default"] [data-metadata] {
|
|
1326
|
-
white-space: nowrap;
|
|
1327
|
-
align-items: center;
|
|
1328
|
-
gap: 1ch;
|
|
1329
|
-
display: flex;
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
[data-diffs-header="default"] [data-additions-count] {
|
|
1333
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1334
|
-
color: var(--diffs-addition-base);
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
[data-diffs-header="default"] [data-deletions-count] {
|
|
1338
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1339
|
-
color: var(--diffs-deletion-base);
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
[data-change-icon] {
|
|
1343
|
-
fill: currentColor;
|
|
1344
|
-
flex-shrink: 0;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1348
|
-
color: var(--diffs-modified-base);
|
|
1349
|
-
}
|
|
1350
|
-
|
|
1351
|
-
[data-change-icon="new"] {
|
|
1352
|
-
color: var(--diffs-addition-base);
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
[data-change-icon="deleted"] {
|
|
1356
|
-
color: var(--diffs-deletion-base);
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
[data-change-icon="file"] {
|
|
1360
|
-
opacity: .6;
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
[data-annotation-content] {
|
|
1364
|
-
z-index: 2;
|
|
1365
|
-
isolation: isolate;
|
|
1366
|
-
white-space: normal;
|
|
1367
|
-
align-self: flex-start;
|
|
1368
|
-
min-width: 0;
|
|
1369
|
-
display: flow-root;
|
|
1370
|
-
position: relative;
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1374
|
-
width: var(--diffs-column-content-width, auto);
|
|
1375
|
-
left: var(--diffs-column-number-width, 0);
|
|
1376
|
-
position: sticky;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
[data-annotation-slot] {
|
|
1380
|
-
text-wrap-mode: wrap;
|
|
1381
|
-
word-break: normal;
|
|
1382
|
-
white-space-collapse: collapse;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
[data-gutter-utility-slot] {
|
|
1386
|
-
touch-action: none;
|
|
1387
|
-
justify-content: flex-end;
|
|
1388
|
-
display: flex;
|
|
1389
|
-
position: absolute;
|
|
1390
|
-
top: 0;
|
|
1391
|
-
bottom: 0;
|
|
1392
|
-
right: 0;
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
[data-utility-button] {
|
|
1396
|
-
appearance: none;
|
|
1397
|
-
cursor: pointer;
|
|
1398
|
-
width: 1lh;
|
|
1399
|
-
height: 1lh;
|
|
1400
|
-
font-size: var(--diffs-font-size, 13px);
|
|
1401
|
-
line-height: var(--diffs-line-height, 20px);
|
|
1402
|
-
background-color: var(--diffs-modified-base);
|
|
1403
|
-
color: var(--diffs-bg);
|
|
1404
|
-
fill: currentColor;
|
|
1405
|
-
z-index: 4;
|
|
1406
|
-
touch-action: none;
|
|
1407
|
-
border: none;
|
|
1408
|
-
border-radius: 4px;
|
|
1409
|
-
justify-content: center;
|
|
1410
|
-
align-items: center;
|
|
1411
|
-
margin-right: calc(-1lh + 1ch);
|
|
1412
|
-
padding: 0;
|
|
1413
|
-
display: flex;
|
|
1414
|
-
position: relative;
|
|
1415
|
-
|
|
1416
|
-
&:before {
|
|
1417
|
-
content: "";
|
|
1418
|
-
display: block;
|
|
1419
|
-
position: absolute;
|
|
1420
|
-
inset: 0 0 0 -4px;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
[data-decoration-bar-stack] {
|
|
1425
|
-
pointer-events: none;
|
|
1426
|
-
isolation: isolate;
|
|
1427
|
-
z-index: 1;
|
|
1428
|
-
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1429
|
-
box-sizing: content-box;
|
|
1430
|
-
border-left: 2px solid var(--diffs-bg);
|
|
1431
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1432
|
-
width: 6px;
|
|
1433
|
-
position: absolute;
|
|
1434
|
-
top: 0;
|
|
1435
|
-
bottom: 0;
|
|
1436
|
-
right: -2px;
|
|
1437
|
-
|
|
1438
|
-
[data-decoration-bar-depth="1"] & {
|
|
1439
|
-
background-color: color-mix(in lab,
|
|
1440
|
-
var(--diffs-bg) 20%,
|
|
1441
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1442
|
-
}
|
|
1443
|
-
|
|
1444
|
-
[data-decoration-bar-depth="2"] & {
|
|
1445
|
-
background-color: color-mix(in lab,
|
|
1446
|
-
var(--diffs-bg) 45%,
|
|
1447
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
[data-decoration-bar-depth="3"] & {
|
|
1451
|
-
background-color: color-mix(in lab,
|
|
1452
|
-
var(--diffs-bg) 65%,
|
|
1453
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
[data-decoration-bar-start] & {
|
|
1457
|
-
border-top-left-radius: 5px;
|
|
1458
|
-
border-top-right-radius: 5px;
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
[data-decoration-bar-end] & {
|
|
1462
|
-
z-index: 3;
|
|
1463
|
-
border-bottom-right-radius: 5px;
|
|
1464
|
-
border-bottom-left-radius: 5px;
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
[data-placeholder] {
|
|
1469
|
-
contain: strict;
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
[data-error-wrapper] {
|
|
1473
|
-
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1474
|
-
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1475
|
-
scrollbar-width: none;
|
|
1476
|
-
max-height: 400px;
|
|
1477
|
-
overflow: auto;
|
|
1478
|
-
|
|
1479
|
-
& [data-error-message] {
|
|
1480
|
-
color: var(--diffs-deletion-base);
|
|
1481
|
-
font-size: 18px;
|
|
1482
|
-
font-weight: bold;
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
& [data-error-stack] {
|
|
1486
|
-
color: var(--diffs-fg-number);
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
@layer theme, rendered, unsafe;
|
|
1492
|
-
`,Rm;function zm(e){if(Rm!=null)return Rm;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(pt,`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),Rm=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Rm}function Bm(e){return`${gt}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var Vm=`@layer base, theme, rendered, unsafe;`,Hm=RegExp(`${Km(gt)}\\s*:\\s*[^;]+;`);function Um(e){return`${Vm}
|
|
1493
|
-
@layer unsafe {
|
|
1494
|
-
${e}
|
|
1495
|
-
}`}function Wm(e,t=`system`,n){return`${Vm}
|
|
1496
|
-
@layer rendered {
|
|
1497
|
-
:host {${t===`system`?``:`
|
|
1498
|
-
color-scheme: ${t};`}
|
|
1499
|
-
${Bm(n)}
|
|
1500
|
-
${e}
|
|
1501
|
-
}
|
|
1502
|
-
}`}function Gm(e,t){let n=Bm(t);return e.replace(Hm,n)}function Km(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var qm=new WeakMap;function Jm(e){return qm.get(e)??e}function Ym({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 Xm(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Zm(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 Qm(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function $m(e,t,n){let r=new Map;for(let i of e){let e=Jm(i);r.set(e,n?.slotNames.get(e)??t(i))}return{provided:e,current:e,slotNames:r}}function eh(e,t,n){for(let r of t){let t=Jm(r);e.slotNames.has(t)||e.slotNames.set(t,n(r))}e.provided=t,e.current=t}function th(e,t,n){if(e==null)return n(t);let r=Jm(t),i=e.slotNames.get(r);return i??(i=n(t),e.slotNames.set(r,i)),i}function nh(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function rh(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:nh(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function ih(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 ah({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=oh(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function oh(){let e=document.createElement(`style`);return e.setAttribute(dt,``),e}var sh=void 0;function ch(){return sh??=`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(Lm)),t.adoptedStyleSheets=[e]}connectedCallback(){zm(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define($e,t)}var lh=[``];function uh(e){let t={...e};return delete t.cacheKey,t}var dh=-1,fh=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++dh}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;editSession;renderedFile;renderRange;enabled=!0;editor;constructor(e={theme:F},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new Dm(e,this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager),this.resizeManager=new ap,this.interactionManager=new Rf(`file`,zf(e)),this.workerManager?.subscribeToThemeChanges(this)}getAnnotationSlotName=e=>th(this.editSession?.annotations,e,Ap);handleHighlightRender=()=>{this.rerender()};rerender(){this.enabled&&this.file!=null&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}getTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??F}getLatestFile(e=this.file){return this.editSession?.file??e}getRenderedFile(){return this.renderedFile}getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}updateExternalFile(e,t){if(_m(this.file,e))return!1;let n=this.editSession!=null;return this.file=e,n||this.editor!=null?this.installEditSession(e,n?void 0:this.editor?.__getDocumentContents(e),!0):this.editSession=void 0,this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=$m(t,Ap,this.editSession.annotations)),!0}installEditSession(e,t,n=!1){let r=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===e.contents,i=uh(t??e);this.editSession={file:i,externalReplacement:n&&r,annotations:this.editSession?.annotations??$m(this.lineAnnotations,Ap)},this.fileRenderer.beginEditSession(i,r?e:void 0)}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(zf(this.options))}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&&!Cf(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,eh(t,e,Ap))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.fileRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){this.code!=null&&(this.code.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e===`wrap`,columnVariables:this.shouldApplyColumnVariables(e)?`apply`:`measure`}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e===`scroll`&&this.getLatestAnnotations().length>0}cleanUp(e=!1){let t=this.editor;this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=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.placeHolder?.remove(),this.placeHolder=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0,this.editSession=void 0,this.renderedFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;if(!this.enabled)throw Error(`File.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`File.hydrate: hydrate can only be called before the instance has rendered or hydrated`);this.hydrateElements(t,n);let o=this.editor!=null;o||ph(this.pre,i,this.options.collapsed)||mh(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,forceRender:o||e.forceRender,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Xm(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;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}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(rh(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderedFile=e,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.getLatestFile()){return e==null?lh:this.fileRenderer.getOrCreateLineCache(e)}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let{editor:e,fileContainer:t,renderRange:n}=this,r=this.getLatestAnnotations(),i=this.getLatestFile();if(e==null||t==null||i==null)return;let a=a=>{this.enabled&&this.editor===e&&this.fileContainer===t&&this.getLatestFile()===i&&e.__syncRenderView({highlighter:a,fileContainer:t,file:i,lineAnnotations:r,renderRange:n,externalDocument:this.editSession?.externalReplacement===!0})},o=this.getTheme(),s=i.lang??Ep(i.name),c=mf({theme:o,lang:s});c==null?ff({themes:Td(o),langs:Array.from(new Set([`text`,s])),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.externalReplacement=!1)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(){}__attachEditor(e){if(this.editor!=null)throw Error(`File.__attachEditor: an editor is already attached`);this.editor=e;let t=()=>{this.editor=void 0,this.fileRenderer.endEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`File.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){this.editSession==null?this.file!=null&&this.installEditSession(this.file,e.__getDocumentContents(this.file)):this.fileRenderer.beginEditSession(this.editSession.file);let t=this.editSession?.file;this.fileRenderer.editorRenderReady()?(this.fileRenderer.fileCache===t&&(this.renderedFile=t),this.syncRenderViewToEditor()):this.rerender()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,file:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{file:a,annotations:o}=n;if(this.editor!=null)throw Error(`File.__completeEditSession: detach the editor before completing the session`);let s=o?.current,c,l=!1,u;if(t==null)throw Error(`File.__completeEditSession: editor is required for completion`);let d={...a},f={file:d,editor:t,originalFile:r,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(f);try{if(t.__emitEditComplete(f),this.options.onEditComplete?.(f)===`accept`){if(d.cacheKey!=null&&d.cacheKey===r.cacheKey)throw Error(`File.__completeEditSession: an accepted file must not reuse the replaced file cacheKey`);c=d}}catch(e){l=!0,u=e}e&&c!=null&&(this.file=c,s!=null&&(this.lineAnnotations=s)),this.editSession=void 0;let{renderedFile:p,file:m}=this;if(this.fileRenderer.endEditSession(m),p!=null&&m!=null&&p!==m&&_m(p,m)&&(this.renderedFile=m),e&&this.fileContainer!=null&&this.rerender(),l)throw u}applyDocumentChange(e,t){let n=this.editSession?.file;if(n==null)throw Error(`File.applyDocumentChange: requires an active edit session`);this.fileRenderer.beginEditSession(n),this.fileRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}updateRenderCache(e,t,n){let r=this.editSession?.file;if(r==null)throw Error(`File.updateRenderCache: requires an active edit session`);this.fileRenderer.beginEditSession(r),this.fileRenderer.updateRenderCache(e,t,n?.lineCountChangeInFlight)}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:c=!1,themeType:l=`system`}=this.options,u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(o),m=!_m(this.file,e);m&&this.updateExternalFile(e,o);let h=this.getLatestFile(e)??e;if(!c&&!n&&hp(u,this.renderRange)&&!m&&!p&&!f){let e=this.applyCachedThemeState(l);return e&&this.finalizeRender(),e}this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.fileRenderer.setOptions(rh(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:g=!1,disableFileHeader:_=!1}=this.options;if(_&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.fileRenderer.renderFile(h,wt);e!=null&&this.applyThemeState(t,e.themeStyles,l,e.baseThemeType),e?.headerAST!=null&&this.applyHeaderToDOM(e.headerAST,t,e.file),this.renderedFile=e?.file??h,this.injectUnsafeCSS()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f||!_m(this.renderedFile,h))||!this.applyPartialRender(h,d,u)){let n=this.fileRenderer.renderFile(h,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t,n.file),this.applyFullRender(n,e),this.renderedFile=n.file}this.applyBuffers(e,u),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,a||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(g)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}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.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(this.placeHolder.style.setProperty(`height`,`${e}px`),!0)}async primeHighlightCache(e=this.file){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||wm(e))return;let n=this.options.tokenizeMaxLength??1e5;this.fileRenderer.getOrCreateLineCache(e).length>n||await t.primeFileHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.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.code=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}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,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!Am(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Pm(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}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=Fm();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}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??=Im(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Um(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=zm(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=ah({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Wm(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=Gm(this.themeCSSStyle.textContent??``,zm(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&ch()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=Ym({code:this.code}),r=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();let i=()=>{if(n.childElementCount>=2)for(let e=0;e<2;e++){let t=n.children[e],i=r[e];t.innerHTML=Wo(i.children),t.style.cssText=i.properties.style}else n.innerHTML=Wo(r);t.contains(n)||t.replaceChildren(n)};this.shouldGuardRebuildScroll()?ih(t,i):i(),this.lastRowCount=e.rowCount}applyPartialRender(e,t,n){if(t==null||n==null)return!1;let{code:r}=this,i=r==null?void 0:this.getColumns(r);if(r==null||i==null)return!1;let a=t.startingLine,o=n.startingLine,s=t.totalLines===1/0?1/0:a+t.totalLines,c=n.totalLines===1/0?1/0:o+n.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l)return!1;if(!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))throw Error(`File.applyPartialRender: failed to trim to overlap`);let{length:d}=i.content.children,f=(t,n)=>{if(!(n<=0))return this.fileRenderer.renderFile(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},p=o<l?f(o,l-o):void 0;if(p===void 0&&o<l)return!1;let m=c===1/0?1/0:Math.max(0,c-u),h=c>u?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){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}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;a===0&&(r.set(0,0),i+=1,a=n[i]);for(let e=0;e<o.length;e+=1){let t=o[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(s!=null){for(;a!=null&&s>=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}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}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??Wo(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)return;let{renderHeaderPrefix:i,renderHeaderFilenameSuffix:a,renderCustomHeader:o,renderHeaderMetadata:s}=this.options;if(o!=null){let e=o(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,P,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let e=i?.(n)??void 0,r=a?.(n)??void 0,o=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,ct,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,lt,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,ut,o),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}getOrCreateFileContainerNode(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:Qm(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Qm(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=km;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.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};jm(i,this.appliedPreAttributes)||(Zm(e,i),this.appliedPreAttributes=i)}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 ph(e,t,n=!1){return!n&&e==null&&t!=null}function mh(e,t,n=!1){return e==null&&t!=null&&!n}function hh(e){return{...vt,...e}}function gh(e,t){let n=_h(e,t);return t?n:e.diffHeaderHeight+n}function _h(e,t){return e.paddingTop??(t?e.spacing:0)}function vh(e){return e.paddingBottom??e.spacing}function yh(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var bh=5e3,xh=new Map,Sh=-1;function Ch(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var wh=class extends fh{virtualizer;metrics;__id=`virtualized-file:${++Sh}`;renderType=`virtualized`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0,ghostTextRows:xh};pendingRender;isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=vt,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){let n=hh(e);(t||!Sf(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.resetLayoutCache(),!0):!1}hasLineAnnotations(){return this.getLatestAnnotations().some(e=>e.lineNumber>0)}hasUniformLineHeights(){let{overflow:e=`scroll`}=this.options;return e===`scroll`&&!this.hasLineAnnotations()&&this.cache.heights.size===0}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!wf(t,e),r=Ch(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.ghostTextRows=xh,this.renderRange!=null&&t&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}applyGhostTextRows(e){let{heights:t,ghostTextRows:n}=this.cache;if(n===e)return!1;let{lineHeight:r}=this.metrics,i=!1;for(let a of new Set([...n.keys(),...e.keys()])){let o=n.get(a)??0,s=e.get(a)??0;if(s===o)continue;let c=(t.get(a)??r)-o*r+s*r;c===r?t.delete(a):t.set(a,c),i=!0}return this.cache.ghostTextRows=e,i}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.getLayoutFile()==null)return this.height!==0&&(e=!0),this.height=0,e;let{overflow:t=`scroll`}=this.options;this.top=this.getVirtualizedTop();let n=this.editor?.__getGhostTextRows()??xh;if(e=this.applyGhostTextRows(n),this.placeHolder!=null||t===`scroll`&&this.getLatestAnnotations().length===0&&!this.isResizeDebuggingEnabled())return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let{lineHeight:r}=this.metrics;if(this.code==null)return e;let i=this.code.children[1];if(!(i instanceof HTMLElement))return e;let a=ym(this.getLatestAnnotations());if(this.renderRange!=null&&a&&xm(this.renderRange)){let t=Th(i)??0;t!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=t,e=!0)}else!a&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(i==null)continue;let a=Number(i),o=t.getBoundingClientRect().height+(n.get(a)??0)*r,s=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(s=!0),o+=t.nextElementSibling.getBoundingClientRect().height);let c=this.getLineHeight(a,s);o!==c&&(e=!0,o===this.metrics.lineHeight*(s?2:1)?this.cache.heights.delete(a):this.cache.heights.set(a,o))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));updateCodeViewLayout(e,t,n,r){let i=!_m(this.file,e);i&&this.updateExternalFile(e,r);let{pendingRenderFile:a,layoutFileChanged:o,renderedFileChanged:s,annotationsChanged:c}=this.updatePendingRender(e,r),l=n?.resetFileLayoutCache===!0||o||c;n?.metrics!=null&&(this.metrics=n.metrics,l=!0);let{collapsed:u=!1}=this.options;return this.currentCollapsed!==u&&(this.currentCollapsed=u,l=!0),l&&this.resetLayoutCache(),i&&(this.layoutDirty=!0),!this.forceRenderOverride&&(i||s||c)&&(this.forceRenderOverride=!0),this.top=t,this.computeApproximateSize(!1,a),this.height}getLayoutFile(){return this.pendingRender?.file??this.getRenderedFile()}getLinePosition(e){let t=this.getLayoutFile();if(t==null||e<1)return;let{disableFileHeader:n=!1,collapsed:r=!1}=this.options,i=this.fileRenderer.getLineCount(t)-1,a=gh(this.metrics,n);if(r||i<0)return{top:a,height:0};let o=Math.min(Math.max(e-1,0),i),{lineHeight:s}=this.metrics;if(a+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())return{top:a+o*s,height:s};let c=this.getLayoutCheckpointBeforeLineIndex(o);a=c?.top??a;for(let e=c?.lineIndex??0;e<o;e++)a+=this.getLineHeight(e,!1);return{top:a,height:this.getLineHeight(o,!1)}}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutFile();if(t==null||this.renderRange==null)return;let{disableFileHeader:n=!1,collapsed:r=!1}=this.options;if(r||this.renderRange.totalLines<=0)return;let i=this.fileRenderer.getLineCount(t)-1;if(i<0)return;let a=gh(this.metrics,n),o=Math.min(this.renderRange.startingLine,i),s=Math.min(o+this.renderRange.totalLines-1,i);if(s<o)return;let{fileAnnotationHeight:c}=this.cache;if(this.hasUniformLineHeights()){let{lineHeight:t}=this.metrics,n=a+(o===0?c:this.renderRange.bufferBefore),r=o+Math.max(Math.ceil((e-n)/t),0);return r>s?void 0:{lineNumber:r+1,top:a+c+r*t}}let l=a+(o===0?c:this.renderRange.bufferBefore);for(let t=o;t<=s;t++){if(l>=e)return{lineNumber:t+1,top:l};l+=this.getLineHeight(t)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutFile();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!_m(this.getRenderedFile(),this.getLatestFile()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutFile()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(this.editor?.__getGhostTextRows()??xh);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,{lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(t),c=gh(this.metrics,i),l=vh(this.metrics);if(this.height+=c,a){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,this.hasUniformLineHeights())this.height+=s*o;else for(let e=0;e<s;e++)this.addLayoutCheckpoint(e,this.height),this.height+=this.getLineHeight(e,!1);if(s>0&&(this.height+=l),this.fileContainer!=null&&n&&!r){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFile.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFile.computeApproximateSize: computed height doesnt match`,{name:t.name,elementHeight:e.height,computedHeight:this.height})}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.file==null)return;let e=this.getLatestFile(),t=e==null?void 0:this.fileRenderer.getFileForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!_m(this.getRenderedFile(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1);let i=this.getRenderedFile();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...i}){let a=!_m(this.file,t);a&&(this.updateExternalFile(t,r),this.cachedHeaderHTML=void 0);let{pendingRenderFile:o,layoutFileChanged:s,renderedFileChanged:c,annotationsChanged:l}=this.pendingRender!=null&&this.pendingRender.latestFile===(this.getLatestFile(t)??t)?{pendingRenderFile:this.pendingRender.file,layoutFileChanged:!1,renderedFileChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(t,r),{forceRenderOverride:u,isSetup:d}=this;if(this.forceRenderOverride=void 0,(l||s)&&this.resetLayoutCache(),e=this.getOrCreateFileContainerNode(e),d)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,o));else{this.computeApproximateSize(!1,o);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFile.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!a||!d))return this.renderPlaceholder(this.height);let f=this.virtualizer.getWindowSpecs(),p=this.top??0,m=this.computeRenderRangeFromWindow(o,p,f);return super.render({file:t,fileContainer:e,renderRange:m,lineAnnotations:r,forceRender:(u??n)||l||c||a,...i})}finalizeRender(){if(this.getRenderedFile()!==this.pendingRender?.file)throw Error(`VirtualizedFile.render: rendered a different file than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestFile(e)??e,r=this.getRenderedFile(),i=this.pendingRender?.file??r,a=this.fileRenderer.getFileForNextRender(n);return this.pendingRender={latestFile:n,file:a},{pendingRenderFile:a,annotationsChanged:this.syncLineAnnotations(t),layoutFileChanged:!_m(i,a),renderedFileChanged:!_m(r,a)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}addLayoutCheckpoint(e,t){e%bh===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFile: invalid checkpoint index`);if(n.lineIndex%t===0)return n}}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1}=this.options,{hunkLineCount:a,lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(e),c=this.height,l=gh(this.metrics,i),u=s>0?vh(this.metrics):0,{fileAnnotationHeight:d}=this.cache,f=l+d,p=Math.max(0,c-l-d-u),m=ym(this.getLatestAnnotations()),h=t+l,g=d>0&&m&&h<r&&h+d>n;if(t<n-c||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u};if(s<=a)return{startingLine:0,totalLines:a,bufferBefore:0,bufferAfter:0};let _=Math.ceil(Math.max(r-n,0)/o),v=Math.ceil(_/a)*a+a,y=v/a,b=(n+r)/2;if(this.hasUniformLineHeights()){let e=t+f,i=e+p;if(!g&&!(e<r&&i>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u};let m=Math.floor(g&&b<t+f?0:(b-(t+f))/o),h=Math.floor(m/a)-Math.floor(y/2),_=Math.ceil(s/a),x=Math.max(0,Math.min(h,_))*a,S=h<0?v+h*a:v,C=x===0?0:d+x*o,w=Math.min(S,s-x);return{startingLine:x,totalLines:S,bufferBefore:C,bufferAfter:Math.max(0,(s-x-w)*o)}}let x=y,S=[],C=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-v*o*2),a),w=t+(C?.top??f),T=C?.lineIndex??0,E,D,O,k=C?.lineIndex??0;for(let e=k;e<s;e++){let i=T%a===0,o=Math.floor(T/a);if(i&&(S[o]=w-(t+f),O!=null)){if(O<=0)break;O--}let s=this.getLineHeight(e,!1);w>n-s&&w<r&&(E??=o),w+s>b&&(D??=o),O==null&&w>=r&&i&&(O=x),T++,w+=s}if(E==null){if(g)E=0,D=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-l-u}}D??=E;let A=Math.round(D-y/2),ee=Math.max(0,Math.ceil(s/a)-y),j=Math.max(0,Math.min(A,ee)),te=j*a,M=A<0?v+A*a:v,ne=S[j]??0,re=te===0?0:d+ne,ie=j+M/a,ae=ie<S.length?p-S[ie]:p-(w-t-f);return{startingLine:te,totalLines:M,bufferBefore:re,bufferAfter:Math.max(0,ae)}}};function Th(e){let t;for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===vm&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function W(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function Eh(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Dh(e){return e.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))}))}function Oh(e){return{...e,hunks:Dh(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function kh(e,t){return e-(t===0?0:1)}function Ah(e,t){return kh(e,t)+t}var jh=1;function Mh(e,...t){return`ck${jh}:${JSON.stringify([e,...t])}`}function Nh(e){return e===``?[]:e.split(rt)}function Ph(e,t,n){let r=e===`clone`?Oh(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return Fh(r,Lh(r,n),Rh(r,n));case`rename-pure`:{let e=Rh(r,n);zh(r,n);let t=Nh(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,Vh(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function Fh(e,t,n){let r=Nh(t.contents),i=Nh(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=Ih(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,Vh(e,t,n),e}function Ih(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(kh(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=Ah(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=Ah(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function Lh(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function Rh(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function zh(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Bh(e,t,n){return e.cacheKey==null?Hh(t,n):`${e.cacheKey}:hydrated`}function Vh(e,t,n){let r=Bh(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function Hh(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?Mh(`hydrated-files`,e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}function Uh(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var Wh=new TextEncoder,Gh=new TextDecoder(`utf-8`,{ignoreBOM:!0}),Kh=/[\uD800-\uDFFF]/,qh=1024,Jh=new Uint8Array(qh);function Yh(){Jh.length!==qh&&(Jh=new Uint8Array(qh))}function Xh(e){if(e.length===0)return e;if(Kh.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Jh.length<t&&(Jh=new Uint8Array(t));let{written:n}=Wh.encodeInto(e,Jh);return Gh.decode(Jh.subarray(0,n))}var Zh=4096,Qh=.5;function $h(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=tg(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}eg(t,e)}}function eg(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 tg(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)>Zh)return null;let c=[];for(let t=0;t<n;t++)c.push(rg(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(rg(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+=ig(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*Qh: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 ng=/\s+/g;function rg(e){return e.replace(ng,``)}function ig(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 ag(e,t,n=!1,r){let i=Cg(e),a=i?fg(e):pg(e),o,s=[];for(let e of a){if(i&&!nt.test(e)){if(o==null)o=Xh(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!i&&!mg(e)){if(o==null)o=Xh(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let a=sg(e,{cacheKey:t==null?void 0:r==null?Mh(`patch-file`,t,String(s.length)):Mh(`patch-file`,t,String(r),String(s.length)),isGitDiff:i,throwOnError:n});a!=null&&s.push(a)}return{patchMetadata:o,files:s}}function og(e,t){try{return sg(e,t)}finally{Yh()}}function sg(e,{cacheKey:t,isGitDiff:n=nt.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=wg(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=dg(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=bg(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?ug(i.contents):[],deletionLines:!l&&r!=null&&i!=null?ug(r.contents):[],cacheKey:Eg(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(ot),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=Xh(r.trim()),n!==r&&(c.prevName=Xh(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?at:it):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=Xh(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=Xh(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=Xh(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=Xh(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=Xh(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=Xh(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(st)??[];t!=null&&(c.prevObjectId=Xh(t)),n!=null&&(c.newObjectId=Xh(n)),r!=null&&(c.mode=Xh(r))}e.startsWith(`rename from `)&&(c.prevName=Xh(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=Xh(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
1503
|
-
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
1504
|
-
`||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:Eg(p.hunkContext),hunkSpecs:Xh(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(!vg(t)||yg(t))break;if(a)throw Error(`parsePatchContent: hunk has more lines than expected`)}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=Dg(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Og(t);(g==null||g.type!==`change`)&&(g=kg(`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=Og(t);(g==null||g.type!==`change`)&&(g=kg(`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=Og(t);(g==null||g.type!==`context`)&&(g=kg(`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]=Uh(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=Uh(c.deletionLines[e]))}}}if(x!==b.additionCount||S!==b.deletionCount){if(a)throw Error(`parsePatchContent: hunk line count mismatch`);console.error(`parsePatchContent: hunk line count mismatch: "${f.trimEnd()}", declared old/new ${b.deletionCount}/${b.additionCount}, parsed old/new ${S}/${x}`);let e=kh(b.additionStart,b.additionCount)+(x===0?0:1),t=kh(b.deletionStart,b.deletionCount)+(S===0?0:1);if(!l){let n=e-b.additionStart,r=t-b.deletionStart;b.additionLineIndex+=n,b.deletionLineIndex+=r;for(let e of b.hunkContent)e.additionLineIndex+=n,e.deletionLineIndex+=r}b.additionStart=e,b.deletionStart=t,b.additionCount=x,b.deletionCount=S}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(kh(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=Ah(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=Ah(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),$h(c),c}}function cg(e,t,n=!1){let r=[],i=lg(e)?e.split(tt):[e];for(let e of i)try{r.push(ag(e,t,n,t==null?void 0:r.length))}catch(e){if(n)throw e;console.error(e)}finally{Yh()}return r}function lg(e){return e.startsWith(`From `)||e.includes(`
|
|
1505
|
-
From `)}function ug(e){let t=dg(e);for(let e=0;e<t.length;e++)t[e]=Xh(t[e]);return t}function dg(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
1506
|
-
`,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 fg(e){return wg(e,`diff --git`)}function pg(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=_g(e,r);if(i<=0&&a<=0){if(hg(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=_g(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=bg(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function mg(e){return hg(e,0)}function hg(e,t){let n=_g(e,t);return gg(e,t,`---`)&&gg(e,n,`+++`)}function gg(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
|
|
1507
|
-
`||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function _g(e,t){let n=e.indexOf(`
|
|
1508
|
-
`,t);return n===-1?e.length:n+1}function vg(e){let t=e[0];return t===`+`||t===`-`||t===` `}function yg(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
1509
|
-
`&&n!==`\r`)return!1}return!0}function bg(e){if(!e.startsWith(`@@ -`))return;let t=4,n=xg(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=xg(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=xg(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=xg(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=Sg(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function xg(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 Sg(e){return e.endsWith(`\r
|
|
1510
|
-
`)?e.slice(0,-2):e.endsWith(`
|
|
1511
|
-
`)?e.slice(0,-1):e}function Cg(e){return e.startsWith(`diff --git`)||e.includes(`
|
|
1512
|
-
diff --git`)}function wg(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Tg(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Tg(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Tg(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function Eg(e){return e==null?e:Xh(e)}function Dg(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function Og(e){let t=e.slice(1);return Xh(t===``?`
|
|
1513
|
-
`:t)}function kg(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 Ag=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}},jg=new class extends Ag{};function Mg(e,t,n){return jg.diff(e,t,n)}function Ng(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Pg(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 Fg(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 Ig(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 Lg(e,t){return Fg(e,t,``)}function Rg(e,t){return Ig(e,t,``)}function zg(e,t){return t.slice(0,Bg(e,t))}function Bg(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 Vg(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 Hg(e,t){if(t)return Wg(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Ug(e,t){if(t)return Wg(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Wg(e,t){if(!t)return[Ug(e),Hg(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Vg(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Gg=`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}`,Kg=RegExp(`[${Gg}]+|\\s+|[^${Gg}]`,`ug`);new class extends Ag{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=Vg(e,r)}else n=e.match(Kg)||[];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)&&qg(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&qg(n,i,r,null,t.intlSegmenter),e}};function qg(e,t,n,r,i){if(t&&n){let[a,o]=Wg(t.value,i),[s,c]=Wg(n.value,i);if(e){let r=Ng(a,s);e.value=Ig(e.value,s,r),t.value=Lg(t.value,r),n.value=Lg(n.value,r)}if(r){let e=Pg(o,c);r.value=Fg(r.value,c,e),t.value=Rg(t.value,e),n.value=Rg(n.value,e)}}else if(n){if(e){let e=Ug(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Ug(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Ug(r.value,i),[a,o]=Wg(t.value,i),s=Ng(n,a);t.value=Lg(t.value,s);let c=Pg(Lg(n,s),o);t.value=Rg(t.value,c),r.value=Fg(r.value,n,c),e.value=Ig(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Ug(r.value,i),n=zg(Hg(t.value,i),e);t.value=Rg(t.value,n)}else if(e){let n=zg(Hg(e.value,i),Ug(t.value,i));t.value=Lg(t.value,n)}}var Jg=new class extends Ag{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Gg}]+|[^\\S\\n\\r]+|[^${Gg}]`,`ug`);return e.match(t)||[]}};function Yg(e,t,n){return Jg.diff(e,t,n)}var Xg=new class extends Ag{constructor(){super(...arguments),this.tokenize=Qg}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
1514
|
-
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
1515
|
-
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
1516
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
1517
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Zg(e,t,n){return Xg.diff(e,t,n)}function Qg(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1518
|
-
`));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 $g(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function e_(e){if(!$g(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 t_={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function n_(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;Zg(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(Zg(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||a_(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(`
|
|
1519
|
-
`)?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 r_(e,t){if(t||=t_,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=>r_(e,t)).join(`
|
|
1520
|
-
`)}let n=[];if(e.isGit){if(t=t_,!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 `+e_(r)+` `+e_(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 `+e_((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+e_((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+e_((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+e_((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(`--- `+e_(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+e_(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(`
|
|
1521
|
-
`)+`
|
|
1522
|
-
`}function i_(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;n_(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?r_(e,o.headerOptions):void 0)}}))}else{let s=n_(e,t,n,r,i,a,o);return s?r_(s,o?.headerOptions):void 0}}function a_(e){let t=e.endsWith(`
|
|
1523
|
-
`),n=e.split(`
|
|
1524
|
-
`).map(e=>e+`
|
|
1525
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var o_=`/dev/null`;function s_(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??c_(),a=t??c_(),o=og(i_(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey,r=t?.cacheKey;return n!=null&&r!=null?Mh(`diff`,n,r):void 0})(),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 c_(){return{name:o_,contents:``}}var l_=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 u_(e,t){return Cf(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function d_(e){return U({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function f_(e){return U({tagName:`div`,children:[U({tagName:`span`,children:[kf(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function p_(e){return U({tagName:`div`,children:[Af({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 m_({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(U({tagName:`div`,children:[kf(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(p_(`up`)),s++),o||(e.push(p_(`down`)),s++)):(e.push(p_(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(U({tagName:`div`,children:[U({tagName:`span`,children:[kf(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(U({tagName:`div`,children:[kf(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(U({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(U({tagName:`slot`,properties:{name:i}})),U({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 h_(e,t){return`hunk-separator-${e}-${t}`}function g_(e){let t=e.at(-1);return t==null?0:Math.max(Ah(t.additionStart,t.additionCount),Ah(t.deletionStart,t.deletionCount))}function __({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 v_({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 y_(e){return[kh(e.additionStart,e.additionCount)+1,Ah(e.additionStart,e.additionCount)+1]}function b_({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 x_(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-Ah(t.additionStart,t.additionCount),r=e.deletionLines.length-Ah(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function S_({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-Ah(n.additionStart,n.additionCount),i=e.deletionLines.length-Ah(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 C_({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=S_({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 w_({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]=y_(a);if(t<o){let s=b_({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=C_({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]=y_(a);return t<o+i.fromStart||t>=o+i.rangeSize}function T_({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]=y_(n),l=b_({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=C_({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 E_({type:e,metrics:t}){return t.hunkSeparatorHeight??yh(e)}function D_({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function O_({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function k_(e){return e!==`simple`&&e!==`metadata`}function A_({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!O_({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=E_({type:e,metrics:t}),a=D_({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function j_({type:e,metrics:t}){if(!k_(e))return;let n=E_({type:e,metrics:t}),r=D_({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function M_({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=N_({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=kh(r.deletionStart,r.deletionCount),s=kh(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=b_({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?C_({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(I_(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,I_(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(I_(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=L_(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(R_({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(I_(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 N_({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=P_({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 P_({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=b_({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?C_({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 F_(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 I_(e,t,n,r,i,a){let[o,s]=F_(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 L_(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 R_({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,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var z_={forcePlainText:!1};function B_(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=z_){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=rm({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)??H_();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)}M_({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&&V_({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}=U_({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 fm(f.deletionLines,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 fm(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function V_({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=Uh(e),t=Uh(t),e.length>s||t.length>s))return;let c=o===`char`?Mg(e,t):Yg(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?(v_({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),v_({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?v_({item:e,arr:l,enableJoin:d,isLastItem:t}):v_({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(__({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(__({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function H_(){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 U_({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??Ep(e.name),d=s??Ep(t.name),{state:f,transformers:p}=Vp(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Wp(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Wp(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,am(i.codeToHast(Uh(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,am(i.codeToHast(Uh(t.contents),m)))}}function W_(e,t){let n=s_({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 G_(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 K_(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function q_(e,t){return t.length>0&&t.length<e.deletionLines.length&&K_(t)}function J_(e,t,n){let r=e.deletionLines.join(``),i=G_(t.length,r),a=s_({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 Y_(e,t){return J_(e,[``],t)}function X_(e,t){if(e.additionLines.length===0)return Y_(e,t);if(q_(e,e.additionLines))return J_(e,e.additionLines,t);let n=e.additionLines,r=W_(e,t);return Q_(r,n),r}function Z_(e){return e.length>1&&e.at(-1)===``}function Q_(e,t){if(!Z_(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&&Ah(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,cv(e);return}}}function $_(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return ev(e,W_(e,n));let r=Array.from(t);if(r.length===0)return ev(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||Uh(r)===Uh(i))return ev(e,W_(e,n))}let i=tv(e,r);if(i.size===0)return ev(e,W_(e,n));for(let t of i)if(!rv(e,t,n))return ev(e,W_(e,n));return cv(e),x_(e)?ev(e,W_(e,n)):ev(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function ev(e,t){return Object.assign(e,t),t}function tv(e,t){let n=new Set;for(let r of t){let t=nv(e,r);if(t==null)return new Set;n.add(t)}return n}function nv(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 rv(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=s_({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:(av(r,s),iv(e,t),!0)}function iv(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(`
|
|
1526
|
-
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1527
|
-
`)}function av(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>ov(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,sv(e)}function ov(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function sv(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 cv(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(kh(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,sv(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=Ah(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-Ah(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var lv=new WeakMap;function uv(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function dv(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 fv(e,t){let n=e.hunks,r=e.additionLines,i=uv(r),a=i===r?e:{...e,additionLines:i},o=Sv(n,xv(a,t),e.deletionLines.length),s=Tv(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Fv(e),Q_(e,r),Ov(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function pv(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<jv(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:jv(r);if(i==null||t<i||o!=null&&o!==s)return fv(e,n);o=s}if(o!=null){if(mv(e,i,o,r,n)){e.editSessionDirty=!0;return}return fv(e,n)}}function mv(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=hv(e),o=e.hunks[n];if(o.hunkContent.some(gv))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 hv(e){let t=lv.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return lv.set(e,{lines:e.deletionLines,set:n}),n}function gv(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function _v(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 vv(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=b_({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=Mv(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=C_({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=Mv(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function yv(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=Mv(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,Mv(i)+i.deletionCount,e.deletionLines.length),n}function bv(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?W_(e,t):X_(e,t)),!0)}function xv(e,t){if(dv(e.deletionLines,e.additionLines)==null)return[];let n=s_({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=ov(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 Sv(e,t,n){let r=e.map((e,t)=>{let n=Mv(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&&Cv(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=wv(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 Cv(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function wv(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 Tv(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`);Dv(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`);Dv(s,c,i,r),r+=c,i+=c,n.push(Ev(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 Ev(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:Nv(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Pv(t.additionStart,r),deletionStart:Nv(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Pv(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Nv(t.deletionStart,i)},${i} +${Nv(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return sv(s),s}function Dv(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function Ov(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(Mv(r)!==Mv(i)||r.deletionCount!==i.deletionCount||jv(r)!==jv(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!kv(r,i))return!0}return!1}function kv(e,t){let n=Av(e),r=Av(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*Av(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 jv(e){return kh(e.additionStart,e.additionCount)}function Mv(e){return kh(e.deletionStart,e.deletionCount)}function Nv(e,t){return t===0?e:e+1}function Pv(e,t){return t===0?e-1:e}function Fv(e){cv(e);for(let t=0;t<e.hunks.length;t++)iv(e,t)}function Iv(e){let t=e.lang??Ep(e.name),n=e.lang??(e.prevName==null?`text`:Ep(e.prevName));return t===`text`&&n===`text`}var Lv=-1,Rv=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Lv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=[`text`];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:F},t=Ap,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=Dd(e.theme??F)?mf():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(e,t){let{editSessionActive:n,renderCache:r}=this;if(this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.diff=e,!e.isPartial&&e.additionLines.length===0){Object.assign(e,Y_(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(r==null||n&&r.diff===e)return;let{options:i}=this.getRenderOptions(e),a=r.diff===e,o=t!=null&&W(r.diff,t),{result:s}=r;if(!r.highlighted||s==null||!u_(r.options,i)||!a&&!o){this.clearRenderCache();return}a||(this.renderCache={diff:e,options:i,highlighted:!0,result:{...s,code:{...s.code,additionLines:[...s.code.additionLines]}},renderRange:r.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!W(t.diff,e)||Iv(e)||Zv(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(e).then(t=>this.applyRefreshedResult(e,t)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){let{diff:n,renderCache:r}=this;if(t==null||n==null||r==null||!W(n,e)||!W(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);u_(i,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}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)??St}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){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return!1;let{result:i,diff:a}=r;if(i==null)return!1;if(a.isPartial)throw Error(`Could not update render cache for partial diff`);let o=i.code.additionLines,s=this.pendingStructuralRows=n?new Map:void 0,c=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},r=n.map(e=>e[2]).join(``),i=t<a.additionLines.length,u=i?a.additionLines[t]??``:``,d=Uh(u);s==null&&i&&(a.additionLines[t]=Sm(u,r),d!==r&&(c.push(t),l.set(t,u)));let f={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}]})};s==null?o[t]=f:s.set(t,f)}let u=!1;if(c.length>0){if(this.editSessionActive){if(a.additionLines.length<=1&&a.additionLines.join(``)===``)this.applyRecomputePreservingSessionType(a,Y_(a,this.options.parseDiffOptions)),u=!0;else if(q_(a,a.additionLines))this.applyRecomputePreservingSessionType(a,J_(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=pv(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,$_(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=_v(this.expandedHunks,e))}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;if(this.pendingStructuralRows=void 0,n==null)return;let{diff:r,result:i}=n;if(i==null)return;if(r.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:a}=r;if(r.additionLines=Yv(e),i.code.additionLines=qv(a,r.additionLines,i.code.additionLines,e),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,Y_(r,this.options.parseDiffOptions)),i.code.additionLines[0]=Jv(0,e.getLineText(0))):this.editSessionActive?this.applySessionDocumentChange(r):Object.assign(r,X_(r,this.options.parseDiffOptions)),t!=null)for(let[e,n]of t)e<i.code.additionLines.length&&(i.code.additionLines[e]=n);n.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(q_(e,n)){this.applyRecomputePreservingSessionType(e,J_(e,n,t));return}this.applyExpansionRemap(fv(e,t))}applyRecomputePreservingSessionType(e,t){let n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}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=>gp(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=F,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=_t,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 ff(kp(this.computedLangs,{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=Zv(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!u_(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!Iv(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.computedLangs=Xv(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??F}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||!W(e,n.diff)||!u_(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(W(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||Iv(e)||Zv(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||W(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&Dd(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&Dd(t.theme)}renderDiff(e=this.diff,t=Ct){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getReadyRenderResult(e,i);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},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||Iv(e)||Zv(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!W(e,this.renderCache.diff),d=!hp(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&jp(t);l&&!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(u||d))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||d||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,jp(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=Xv(e),this.highlighter??=mf();let t=this.highlighter!=null&&Dd(i.theme),n=this.highlighter!=null&&kt(this.computedLangs),r=!c&&n;if(l&&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.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=Ct){this.diff=e;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 xp({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Zv(e,this.getTokenizeMaxLength());this.computedLangs=t?[`text`]:Xv(e);let n=this.highlighter!=null&&Dd(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&kt(this.computedLangs);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(M_({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]=Jv(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){let{diff:i,renderCache:a}=this;i!=null&&a!=null&&W(i,e)&&u_(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&u_(a.options,n)&&W(a.diff,i)||(this.pendingHighlightResult={diff:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(n!=null&&u_(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&W(n.diff,e)&&u_(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&W(e,n.diff)&&u_(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,f=a===`unified`,p=Qv(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:Mf(),deletionsGutterAST:Mf(),additionsGutterAST:Mf(),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=S_({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`,Pf(void 0,`buffer`,this.size)),h?.push(d_(this.size))):(x.pushToGutter(`deletions`,Pf(void 0,`buffer`,this.size)),g?.push(d_(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,Nf(t,n,r,i))};function T(e){C.flush(),a===`unified`?Wv(`unified`,e,x):(Wv(`deletions`,e,x),Wv(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),M_({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&&T({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&&Vv(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});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Gv(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Gv(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Uv({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&&Vv(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&Hv(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=Gv(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Gv(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Uv({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Hv(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),E=_?n.noEOFCRDeletions:!1,D=_?n.noEOFCRAdditions:!1,O=(s?.noEOFCR??!1)||E,k=(o?.noEOFCR??!1)||D;if(k||O){if(a===`split`&&C.flush(),O){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(f_(e)),x.pushToGutter(`unified`,Pf(e,`metadata`,1))):(x.deletionsContentAST.push(f_(e)),x.pushToGutter(`deletions`,Pf(e,`metadata`,1)),k||(x.pushToGutter(`additions`,Pf(void 0,`buffer`,1)),x.additionsContentAST.push(d_(1))))}if(k){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(f_(e)),x.pushToGutter(`unified`,Pf(e,`metadata`,1))):(x.additionsContentAST.push(f_(e)),x.pushToGutter(`additions`,Pf(e,`metadata`,1)),O||(x.pushToGutter(`deletions`,Pf(void 0,`buffer`,1)),x.deletionsContentAST.push(d_(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&T({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 E=Math.max(g_(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),D=t.bufferBefore>0||t.bufferAfter>0,O=!f&&e.type!==`deleted`,k=!f&&e.type!==`new`,A=x.rowCount>0||D;h=O&&A?h:void 0,g=k&&A?g:void 0,_=f&&A?_:void 0;let ee=this.createPreElement(g!=null&&h!=null,E);return{fileDiff:e,unifiedGutterAST:f&&A?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:k&&A?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:O&&A?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:ee,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(e),totalLines:E,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=Mf(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Cm(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(U({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(U({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(U({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Wo(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Wo(t==null?e:U({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(!xm(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(bm(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(bm(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Uv({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Uv({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(this.annotationSlotName(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(this.annotationSlotName(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}}getAnnotationNames(e){return e?.map(e=>this.annotationSlotName(e))??[]}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return vp({fileOrDiff:e,mode:t,stickyHeader:n})}},zv=new Intl.PluralRules(`en-US`);function Bv(e){return`${e} unmodified line${zv.select(e)===`one`?``:`s`}`}function Vv(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Hv(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 Uv({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`,Pf(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`,Pf(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`,Pf(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Wv(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,m_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(m_({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,m_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(m_({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=h_(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Bv(n):`More unchanged context may be available`;c.pushToGutter(e,m_({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(m_({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 Gv(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Kv(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function qv(e,t,n,r){let i=Kv(e),a=Kv(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 e=s;e<t.length;e++)l[e]??=Jv(e,r.getLineText(e));return l}function Jv(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 Yv(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function Xv(e){if(e.lang!=null)return[e.lang];let t=Ep(e.prevName??e.name),n=Ep(e.name);return t===n?[n]:[t,n]}function Zv(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Qv(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function $v(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function ey(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 ty(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function ny({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 ry(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:nh(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 iy(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function ay(e){let t={...e};return delete t.cacheKey,t}function oy(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??Ep(e.name),r=t.lang??Ep(t.name),i=e.type!==`new`,a=t.type!==`new`;return e.name!==t.name||n!==r||i!==a||e.deletionLines.length!==t.deletionLines.length||e.deletionLines.some((e,n)=>e!==t.deletionLines[n])}function sy(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function cy(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&sy(n.lines,t.deletionLines)}var ly=-1,uy=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++ly}`;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;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:F},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new ap,this.scrollSyncManager=new l_,this.interactionManager=new Rf(`diff`,zf(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()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??F}getHunksRendererOptions(e){return ry(e)}createHunksRenderer(e){return new Rv(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;let r=e.hunks.at(-1),i,a;hunkIterator:for(let o of e.hunks){let e=n===`deletions`?o.deletionStart:o.additionStart,s=n===`deletions`?o.deletionCount:o.additionCount,c=kh(e,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(t<c){let e=c-t;i=Math.max(u-e,0),a=Math.max(l-e,0);break hunkIterator}if(t>=c+s){if(o===r){let e=t-(c+s);i=u+o.unifiedLineCount+e,a=l+o.splitLineCount+e;break hunkIterator}continue}for(let e of o.hunkContent)if(e.type===`context`){if(t<c+e.lines){let e=t-c;a=l+e,i=u+e;break hunkIterator}c+=e.lines,l+=e.lines,u+=e.lines}else{let r=n===`deletions`?e.deletions:e.additions;if(t<c+r){let r=t-c;i=u+(n===`additions`?e.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(e.deletions,e.additions),u+=e.deletions+e.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(zf(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&&!Cf(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>th(this.editSession?.annotations,e,Ap);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,eh(t,e,Ap))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}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.getLatestAnnotations().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){let{editor:t}=this;bf(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),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,e||(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.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),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.editSession=void 0,this.renderedDiff=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=ny(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||hy(this.pre,py({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||gy(this.headerElement,my({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,forceRender:l||a.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Xm(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?s_(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=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;if(e==null||t==null||!iy(e)||this.pendingFiles?.fileDiff===e)return;let n=this.loadFilesForDiff(e,t),r=this.pendingFiles={fileDiff:e,promise:n};r.promise=n.finally(()=>{this.pendingFiles===r&&(this.pendingFiles=void 0)})}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)}}async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(Ph(`merge`,e,t),this.setHydratedState(t),this.startHydratedEditSession(e)){this.rerender();return}await ty(()=>this.primeHighlightCache(e)),this.enabled&&this.fileDiff===e&&this.rerender()}}startHydratedEditSession(e){if(e.isPartial)throw Error(`FileDiff.startHydratedEditSession: diffs cannot be partial for editing`);if(this.fileDiff!==e)return!1;let{editor:t}=this;return this.editSession?.outgoingDiff==null?t==null||this.editSession!=null?!1:(this.installEditSession(e,t.__getDocumentContents(dy(e)),t.__getDocumentSessionState()),!0):(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(W(this.fileDiff,e))return!1;let n=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,n==null?this.editor!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e,this.editor.__getDocumentContents(dy(e)),this.editor.__getDocumentSessionState())):(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=n)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=$m(t,Ap,this.editSession.annotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:Nh(t.contents),a=n!=null&&cy(n,e);if(n!=null&&!a)throw Error(`FileDiff: retained session cannot resume against a different old file`);if(t!=null&&t.contents!==r&&!a)throw Error(`FileDiff: retained edits are missing their diff session state`);let o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===r,s=ay(e);t!=null&&i!=null&&!o&&(s.name=t.name,s.lang=t.lang),a&&n!=null&&i!=null&&(s.additionLines=i,s.type=n.type,s.hunks=n.hunks,s.editSessionDirty=!0,cv(s)),this.editSession={diff:s,annotations:this.editSession?.annotations??$m(this.lineAnnotations,Ap),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(s,o&&!a?e:void 0)}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}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let l=ny(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;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=_&&(!fy(u,this.deletionFile)||!fy(d,this.additionFile)),y=e!=null&&!W(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&hp(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&!y||e==null&&!v)){let e=this.applyCachedThemeState(p);return e&&this.finalizeRender(),e}let x;e==null&&_&&(v||this.fileDiff==null)&&(x=s_(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,i):x!=null&&(y=!0,this.updateExternalDiff(x,i)),y&&this.clearReusableHeader(),i!=null&&this.setLineAnnotations(i);let C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(bv(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:w=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(C,wt);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a,e.fileDiff),this.renderSeparators([]),this.renderedDiff=e?.fileDiff??C,this.injectUnsafeCSS()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g||!W(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(C,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a,t.fileDiff),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.renderedDiff=t.fileDiff}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}finalizeRender(){}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)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){let{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),r=this.computeEditorRenderRange(this.renderRange),i=this.getLatestDiff();if(e==null||t==null||i==null||i.isPartial)return;let a=a=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==i)return;let o=this.editSession?.outgoingDiff,s=this.fileDiff,c=o!=null&&s!=null&&o!==i,l=c?oy(o,s):!1;e.__syncRenderView({highlighter:a,fileContainer:t,fileDiff:i,lineAnnotations:n,renderRange:r,externalDocument:c,resetHistory:l})},o=this.getTheme(),s=i.lang??Ep(i.name),c=mf({theme:o,lang:s});c==null?ff({themes:Td(o),langs:[`text`,s],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}computeEditorRenderRange(e){let t=this.getLatestDiff();if(e==null||t==null||jp(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return M_({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}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:n,outgoingDiff:r}={}}=this;if(r!=null&&t!=null){if(!t.isPartial&&oy(r,t))return;n=r}if(!(n==null||n.isPartial))return{diffSession:{oldFile:n.type===`new`?null:{name:n.prevName??n.name,lines:e?[...n.deletionLines]:n.deletionLines},type:n.type,hunks:e?Dh(n.hunks):n.hunks},hasChanges:n.editSessionDirty===!0}}__attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw Error(`FileDiff.__attachEditor: an editor is already attached`);let t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`FileDiff.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){let{fileDiff:t}=this,n=this.editSession?.outgoingDiff;n!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===n&&this.installEditSession(t);let r=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;r==null?this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff):this.installEditSession(r,e.__getDocumentContents(dy(r)),e.__getDocumentSessionState()),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();let i=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(i!=null&&this.hunksRenderer.diffCache===i&&(this.renderedDiff=i),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,fileDiff:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{diff:a,annotations:o}=n;if(this.editor!=null)throw Error(`FileDiff.__completeEditSession: detach the editor before completing the session`);this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();let s=o?.current,c,l=null,u=null,d=!1,f;if(t==null)throw Error(`FileDiff.__completeEditSession: editor is required for completion`);let p=Oh(a),m={name:p.name,contents:p.additionLines.join(``)};p.lang!=null&&(m.lang=p.lang);let h={fileDiff:p,editor:t,originalFileDiff:r,oldFile:p.type===`new`?null:{name:p.prevName??p.name,contents:p.deletionLines.join(``)},newFile:m,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(h);try{if(t.__emitEditComplete(h),this.options.onEditComplete?.(h)===`accept`){if(p.cacheKey!=null&&p.cacheKey===r.cacheKey)throw Error(`FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey`);c=p,l=h.oldFile,u=h.newFile}}catch(e){d=!0,f=e}if(e&&c!=null&&(this.fileDiff=c,this.additionFile!=null&&(this.deletionFile=l,this.additionFile=u),s!=null&&(this.lineAnnotations=s)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),d)throw f}finalizeEditSessionHunks(){let e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=vv(e,this.hunksRenderer.getExpandedHunksMap(),t);return bv(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(yv(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){let n=this.editSession?.diff;if(n==null)throw Error(`FileDiff.applyDocumentChange: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let r=this.editSession?.diff;if(r==null)throw Error(`FileDiff.updateRenderCache: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(r);let{shouldRefreshDiffsView:i,lineCountChangeInFlight:a}=n;if(this.hunksRenderer.updateRenderCache(e,t,a)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!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))}detachAdditionLines(){let e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){let t=this.getRenderedDiff();if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return w_({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.getRenderedDiff();if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return T_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.getRenderedDiff(),{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]=y_(o);if(e<s){let c=b_({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=C_({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]=y_(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(){yf(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.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(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||Iv(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.headerCache.lastRenderedHTML=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||!ey(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,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!$v(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:Pm(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}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=Fm();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.headerCache.lastRenderedHTML=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:Qm(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Qm(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=km;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,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{headerCache:{fileDiff:r,html:i,lastRenderedHTML:a}}=this,o=(n!==this.editSession?.diff&&W(r,n)?i:void 0)??Wo(e);if(this.headerCache.html=o,this.headerCache.fileDiff=n,o!==a){let e=document.createElement(`div`);e.innerHTML=o;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.headerCache.lastRenderedHTML=o}if(this.isContainerManaged)return;let{renderCustomHeader:s,renderHeaderPrefix:c,renderHeaderFilenameSuffix:l,renderHeaderMetadata:u}=this.options;if(s!=null){let e=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,P,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let d=c?.(n)??void 0,f=l?.(n)??void 0,p=u?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,ct,d),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,lt,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,ut,p),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=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??=Im(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Um(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=zm(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=ah({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Wm(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=Gm(this.themeCSSStyle.textContent??``,zm(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&ch()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?ih(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=_y(t[0]),a=_y(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=Wo(i),r.content.innerHTML=Wo(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=Ym({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=Ym({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=Ym({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({fileDiff:e,previousRenderRange:t,renderRange:n}){let{pre:r,codeUnified:i,codeAdditions:a,codeDeletions:o,options:{diffStyle:s=`split`}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;let c=this.getCodeColumns(s,i,o,a);if(c==null)return!1;let l=t.startingLine,u=n.startingLine,d=l+t.totalLines,f=u+n.totalLines,p=Math.max(l,u),m=Math.min(d,f);if(m<=p)return!1;let h=Math.max(0,p-l),g=Math.max(0,d-m),_=this.trimColumns({columns:c,trimStart:h,trimEnd:g,previousStart:l,overlapStart:p,overlapEnd:m,diffStyle:s});if(_<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<_)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let v=this.lastRowCount-_,y=(t,n)=>{if(!(n<=0))return this.hunksRenderer.renderDiff(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},b=y(u,Math.max(p-u,0));if(b==null&&u<p)return!1;let x=y(m,Math.max(f-m,0));if(x==null&&f>m)return!1;let S=(e,t)=>{if(e!=null){if(s===`unified`&&!Array.isArray(c))this.insertPartialHTML(s,c,e,t);else if(s===`split`&&Array.isArray(c))this.insertPartialHTML(s,c,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);v+=e.rowCount,this.renderedDiff=e.fileDiff}};return this.cleanupErrorWrapper(),S(b,`afterbegin`),S(x,`beforeend`),this.lastRowCount!==v&&(this.applyRowSpan(s,c,v),this.lastRowCount=v),!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(){let e=this.getLatestDiff();if(this.options.diffStyle!==`split`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;let r=(e,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(e,t),i=_y(r?.[0]),a=_y(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)}};r(`deletions`,n[0]),r(`additions`,n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`unified`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;let r=this.hunksRenderer.renderCodeAST(`unified`,t),i=_y(r?.[0]),a=_y(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=Wo(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?ih(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=_y(t[0]),i=_y(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};jm(u,this.appliedPreAttributes)||(Zm(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 dy(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function fy(e,t){return e==null||t==null?e==null&&t==null:Eh(e,t)}function py({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function my({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function hy(e,t,n=!1){return!n&&e==null&&t}function gy(e,t,n=!1){return e==null&&t&&!n}function _y(e){if(e!=null&&e.type===`element`)return e.children??[]}function vy({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=gh(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=b_({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=A_({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=yy(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?C_({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=j_({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=j_({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=vh(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function yy(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return by(e,t)}function by(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var xy=3e3,Sy=new Map,Cy=-1,wy=class extends uy{__id=`little-virtualized-file-diff:${++Cy}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:Sy,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=hh(n)}setMetrics(e,t=!1){let n=hh(e);(t||!Sf(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.resetLayoutCache({includeEstimatedHeights:!1}),!0):!1}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){let t=this.getLatestAnnotations();return ym(t)?t.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!wf(t,e),r=n&&My(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Ny(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=Sy,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){let{cache:{heightDeltas:n,ghostTextRows:r,ghostTextRowsByIndex:i},metrics:{lineHeight:a}}=this;if(r===t)return!1;let o=this.getDiffStyle(),s=new Map;for(let[n,r]of t){let t=this.getLineIndexForDiff(e,n+1,`additions`);t!=null&&s.set(o===`split`?t[1]:t[0],r)}let c=!1;for(let e of new Set([...i.keys(),...s.keys()])){let t=((s.get(e)??0)-(i.get(e)??0))*a;if(t===0)continue;let r=(n.get(e)??0)+t;r===0?n.delete(e):n.set(e,r),this.cache.measuredHeightDeltaTotal+=t,c=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=s,c}reconcileHeights(){let e=!1,{options:{overflow:t=`scroll`},cache:{ghostTextRowsByIndex:n},metrics:{lineHeight:r}}=this,i=this.placeHolder==null?this.getRenderedDiff():this.getLayoutDiff();if(this.fileContainer==null||i==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(i,this.editor?.__getGhostTextRows()??Sy);let a=this.getLatestAnnotations();if(this.placeHolder!=null||t===`scroll`&&a.length===0&&!this.isResizeDebuggingEnabled())return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let o=this.getDiffStyle(),s=o===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],c=this.hasFileAnnotations(i);if(this.renderRange!=null&&c&&xm(this.renderRange)){let t=Ty(s)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!c&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of s){if(t==null)continue;let i=t.children[1];if(!(i instanceof HTMLElement))continue;let a=o===`split`&&t===this.codeDeletions;for(let t of i.children){if(!(t instanceof HTMLElement))continue;let i=t.dataset.lineIndex;if(i==null)continue;let s=Ly(i,o),c=n.get(s)??0;if(a&&c>0)continue;let l=t.getBoundingClientRect().height+c*r,u=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(u=!0),l+=t.nextElementSibling.getBoundingClientRect().height);let d=this.getEstimatedLineHeight(u),f=this.cache.heightDeltas.get(s)??0,p=l-d;p!==f&&(e=!0,this.cache.measuredHeightDeltaTotal+=p-f,p===0?this.cache.heightDeltas.delete(s):this.cache.heightDeltas.set(s,p))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,r){let i=!1,a=!1,{pendingExpansions:o,pendingHydratedDiff:s,options:{collapsed:c=!1}}=this;if(s!=null&&(this.pendingHydratedDiff=void 0,s.expectedDiff===e&&(Object.assign(e,s.nextDiff),this.setHydratedState(s.files),this.startHydratedEditSession(e),this.forceRenderOverride=!0,i=!0,a=!0)),o!=null){this.pendingExpansions=void 0;for(let{hunkIndex:e,direction:t,expansionLineCountOverride:n}of o)this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,a=!0}let l=this.updateExternalDiff(e,r),{pendingRenderDiff:u,layoutDiffChanged:d,renderedDiffChanged:f,annotationsChanged:p}=this.updatePendingRender(e,r);return!this.forceRenderOverride&&(l||f||p)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||d||p)&&(i=!0),(d||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(a=!0),n?.metrics!=null&&(this.metrics=hh(n.metrics),i=!0,a=!0),this.currentCollapsed!==c&&(this.currentCollapsed=c,i=!0),i?this.resetLayoutCache({includeEstimatedHeights:a}):a&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t=`additions`){let n=this.getLayoutDiff();if(n==null||e<1)return;let r=this.getLineIndexForDiff(n,e,t);if(r==null)return;let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,c=this.getDiffStyle(),l=this.getHunkSeparatorType(),u=c===`split`?r[1]:r[0];this.approximateLayoutCheckpoints(n);let d=gh(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return M_({diff:n,diffStyle:c,startingLine:f?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=c===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=A_({type:l,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(p+=r.gapBefore,u>=o-n&&u<o)return m={top:p,height:r.height},!0;p+=r.height+r.gapAfter}}let s=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===u)return m={top:p,height:s},!0;if(p+=s,r>0){let e=j_({type:l,metrics:this.metrics});if(e!=null){if(u>o&&u<=o+r)return m={top:p+e.gapBefore,height:e.height},!0;p+=e.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutDiff();if(t==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);let c=this.getLayoutCheckpointBeforeTop(e),l=c?.top??gh(this.metrics,n)+this.cache.fileAnnotationHeight,u;return M_({diff:t,diffStyle:o,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:a,additionLine:c})=>{let d=o===`split`?c?.splitLineIndex??a?.splitLineIndex:c?.unifiedLineIndex??a?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=A_({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(l+=e.totalHeight)}if(l>=e&&(a==null?c!=null&&(u={lineNumber:c.lineNumber,side:`additions`,top:l}):u={lineNumber:a.lineNumber,side:`deletions`,top:l},u!=null))return!0;let f=this.getLineHeight(d,(c?.noEOFCR??!1)||(a?.noEOFCR??!1));if(l+=f,i>0){let e=j_({type:s,metrics:this.metrics});e!=null&&(l+=e.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!W(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(this.isAdvancedMode()){let n=Ph(`clone`,e,t);if(await ty(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(Ph(`merge`,e,t),this.setHydratedState(t),!this.startHydratedEditSession(e)&&(await ty(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return w_({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),this.enabled&&this.fileDiff!=null&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;let e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!W(this.getRenderedDiff(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});let i=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??Sy);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=gh(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=vy({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:Py(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=ny(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!Iy(s,this.deletionFile)||!Iy(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=s_(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!W(this.fileDiff,u),m=p||l;if(e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;p&&this.updateExternalDiff(u,r);let{pendingRenderDiff:h,layoutDiffChanged:g,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(u,r);if((v||g)&&this.resetLayoutCache({includeEstimatedHeights:g}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,h));else{this.computeApproximateSize(!1,h);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return a!=null&&(this.deletionFile=s,this.additionFile=c),p&&this.clearReusableHeader(),this.renderPlaceholder(this.height);let y=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(h,b,y);return super.render({fileDiff:u,fileContainer:e,renderRange:x,lineAnnotations:r,forceRender:(d??n)||v||_||p,...a,...i})}finalizeRender(){if(this.getRenderedDiff()!==this.pendingRender?.diff)throw Error(`VirtualizedFileDiff.render: rendered a different diff than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestDiff(e)??e,r=this.getRenderedDiff(),{pendingRender:i}=this,a=i?.diff??r,o=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!W(a,o),renderedDiffChanged:!W(r,o)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return Fy(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=Py(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=Ey(this.cache.heightDeltas),u=gh(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=ky(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+Ay(i,e)*this.metrics.lineHeight+Dy(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=xy}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+Dy(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=b_({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?A_({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?C_({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?j_({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:jy({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=b_({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=C_({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=Py(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=gh(this.metrics,i),h=e.hunks.length>0?vh(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,T=w,E=[],D=(n+r)/2,O=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),k=t+(O?.top??_),A=O?.renderedLineIndex??0,ee,j,te;if(M_({diff:e,diffStyle:l,startingLine:O?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?A_({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;k+=y;let b=A%s===0,x=Math.floor(A/s);if(b&&(E[x]=k-(t+_+y),te!=null)){if(te<=0)return!0;te--}let S=this.getLineHeight(l===`split`?m:h,g);if(k>n-S&&k<r&&(ee??=x),j==null&&k+S>D&&(j=x),te==null&&k>=r&&b&&(te=T),A++,k+=S,c>0||v&&d){let e=j_({type:u,metrics:this.metrics});e!=null&&(k<r&&k+e.totalHeight>n&&(ee??=x),j==null&&k+e.totalHeight>D&&(j=x),k+=e.totalHeight)}return!1}}),ee==null){if(x)ee=0,j=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}j??=ee;let M=Math.round(j-w/2),ne=Math.max(0,Math.ceil(p/s)-w),re=Math.max(0,Math.min(M,ne)),ie=re*s,ae=M<0?C+M*s:C,oe=E[re]??0,se=ie===0?0:g+oe,ce=re+ae/s,le=ce<E.length?v-E[ce]:v-(k-t-_);return{startingLine:ie,totalLines:ae,bufferBefore:se,bufferAfter:Math.max(0,le)}}};function Ty(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===vm&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function Ey(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function Dy({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=Oy(e,n);return(t[Oy(e,r)]??0)-(t[i]??0)}function Oy(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function ky(e){return Math.ceil(e/xy)*xy}function Ay(e,t){let n=0;for(let r of e)r<t&&n++;return n}function jy({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function My(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function Ny(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Py(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Fy(e){return typeof e==`function`?`custom`:e??`line-info`}function Iy(e,t){return e==null||t==null?e==null&&t==null:Eh(e,t)}function Ly(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function Ry(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:zy(e.items,t.items)}function zy(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.instance!==i.instance||r.version!==i.version)return!1}return!0}function By(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(mt,``),t.before(r)):(r.setAttribute(ht,``),t.after(r)),n?.observe(r),r}function Vy(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var Hy=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),Uy=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],Wy=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],Gy=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],Ky=Symbol(`CodeView.itemOptionsState`);function qy(e,t){Object.defineProperty(e,Ky,{configurable:!1,enumerable:!1,value:t})}function Jy(e){return e[Ky]}function Yy(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Xy=120,Zy=1,Qy=`--diffs-overflow-override`,$y=12e6,eb=1e6,tb=2e6,nb=1e7,rb=11e6;function ib(e){if(e==null)throw Error(`CodeView: createEditor is required for items with edit: true`)}var ab=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),ob=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=yt;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;pendingHighlighterTheme;isContainerManaged;constructor(e={theme:F},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??bt}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??yt.hunkLineCount,lineHeight:e?.lineHeight??yt.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??yt.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??yt.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??xt}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return et&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<Zy||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),ab&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(Qy,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Xy)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(Qy,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element!=null&&(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??By(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){bf(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();let e=[...this.itemEditors.values()].map(e=>{let t=this.idToItem.get(e.state.id);return t!=null&&(e.state.removedItem=t.item),{record:e,instance:t?.instance}});this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear();let t=!1,n;for(let{record:r,instance:i}of e)try{r.editor.cleanUp(`discard`),i?.cleanUp()}catch(e){t||(t=!0,n=e)}if(this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator(),t)throw n}cleanUp(){let e=!1,t;try{this.reset()}catch(n){e=!0,t=n}if(this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0,e)throw t}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement($e),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))db(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return Of()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncItemEditors(),this.syncSelection()}removeItem(e){let t=this.idToItem.get(e);if(t==null)return console.error(`CodeView.removeItem: unknown item id "${e}"`),!1;let n=[];for(let e of this.items)e!==t&&n.push(e.item);return this.setItems(n),!0}setItems(e){let t;this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||(t=this.reconcileItems(e)),this.syncItemEditors(t),this.syncSelection()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=sb(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;cb(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!Sf(r,i),o=!Sf(n,this.getLayout());o&&this.syncLayout();let s=a||lb(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||ub(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),wf(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(e=this.idToItem){this.root!=null&&this.items.length!==0&&this.pendingScrollTarget==null&&(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),e))}render(t=!1){e.__STOP||(t?(bf(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):yf(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.getStats().workersFailed?this.isSharedHighlighterReady():e.isInitialized()?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{(e.managerState===`initialized`||e.workersFailed)&&(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0,this.pendingHighlighterTheme=void 0)}isSharedHighlighterReady(){let e=this.workerManager?.getFileRenderOptions().theme??this.options.theme??F;return pf()&&Dd(e)?(this.clearReadySubscription(),!0):(Cf(this.pendingHighlighterTheme,e)||this.clearReadySubscription(),this.isReadySubscription??=(()=>{this.pendingHighlighterTheme=e;let t=!1;return gf({themes:Td(e),langs:[],preferredHighlighter:this.options.preferredHighlighter}).then(()=>{t||(this.clearReadySubscription(),this.render(!0))},e=>{t||(this.clearReadySubscription(),console.error(e))}),()=>{t=!0}})(),!1)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e!==this.slotCoordinator&&(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=_b(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(t!=null||n!=null||r!=null)return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new wy(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new wh(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&Ef(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return e.item.edit===!0&&e.item.collapsed!==!0}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t),i;try{if(r==null){ib(n);let r=Jy(e.instance.options);if(r==null)throw Error(`CodeView.attachItemEditor: instance options are missing their state`);let a=e=>{let t=this.idToItem.get(r.id);t!=null&&this.options.onItemEditChange?.(e,t.item)},o=this.options.getEditStateKey?.(e.item);if(e.type===`diff`){let s=n(`file-diff`,{onChange:a},o);i=s,this.itemEditors.set(t,{editor:s,state:r,dispose:s.edit(e.instance)})}else{let s=n(`file`,{onChange:a},o);i=s,this.itemEditors.set(t,{editor:s,state:r,dispose:s.edit(e.instance)})}}else r.dispose=(e.type,r.editor.edit(e.instance));this.attachedEditors.add(t)}catch(t){throw i?.cleanUp(),this.releaseRenderedItem(e),t}}syncItemEditors(e){if(this.itemEditors.size===0)return;let t=[];for(let[n,r]of this.itemEditors){let i=this.idToItem.get(n),a=e?.get(n);if(a==null&&i!=null){let{edit:e=!1,collapsed:t=!1}=i.item;if(e){t&&this.attachedEditors.delete(n)&&r.editor.cleanUp(`recycle`);continue}}else a!=null&&(r.state.removedItem=a.item);this.itemEditors.delete(n),this.attachedEditors.delete(n),t.push(r)}if(t.length===0)return;let n=!1,r;for(let e of t){try{e.dispose()}catch(e){n||(n=!0,r=e)}let t=this.idToItem.get(e.state.id);t!=null&&this.markItemLayoutDirty(t)}if(this.render(),n)throw r}requireItemFromState(e){let t=this.idToItem.get(e.id)?.item??e.removedItem;if(t==null)throw Error(`CodeView.onItemEditComplete: unknown item "${e.id}"`);return t}completeFileItemEdit(e,t){let n=this.requireItemFromState(e);if(n.type!==`file`)throw Error(`CodeView.onItemEditComplete: item "${e.id}" is not a file item`);let r={...n,file:t.file,annotations:t.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(t,n,r)??`reject`)===`reject`?`reject`:(this.idToItem.has(n.id)&&this.updateItem(r),`accept`)}completeDiffItemEdit(e,t){let n=this.requireItemFromState(e);if(n.type!==`diff`)throw Error(`CodeView.onItemEditComplete: item "${e.id}" is not a diff item`);let r={...n,fileDiff:t.fileDiff,annotations:t.lineAnnotations,edit:!1,version:(n.version??0)+1};return(this.options.onItemEditComplete?.(t,n,r)??`reject`)===`reject`?`reject`:(this.idToItem.has(n.id)&&this.updateItem(r),`accept`)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n!=null&&n.type!==`position`&&n.id===e&&(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of Uy)Yy(e,t,()=>this.options[t]);Yy(e,`stickyHeader`,()=>this.options.stickyHeaders),Yy(e,`collapsed`,e=>{let t=Jy(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed}),Yy(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=Jy(e);if(t!=null)return e=>this.completeFileItemEdit(t,e)});for(let t of Wy)this.defineItemSharedCallback(e,`file`,t);for(let t of Gy)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of Hy)Yy(e,t,()=>this.options[t]);Yy(e,`stickyHeader`,()=>this.options.stickyHeaders),Yy(e,`hunkSeparators`,()=>this.options.hunkSeparators),Yy(e,`collapsed`,e=>{let t=Jy(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed}),Yy(e,`onEditComplete`,e=>{if(this.options.onItemEditComplete==null)return;let t=Jy(e);if(t!=null)return e=>this.completeDiffItemEdit(t,e)});for(let t of Wy)this.defineItemSharedCallback(e,`diff`,t);for(let t of Gy)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return qy(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return qy(t,{id:e}),t}updateItemOptionsId(e,t){let n=Jy(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(n!=null&&n.type===t)return n}defineItemSharedCallback(e,t,n){Yy(e,n,e=>{if(this.options[n]==null)return;let r=Jy(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){Yy(e,n,e=>{let r=Jy(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)},i[n]=a),a})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s=new Map,c;for(let s=0;s<e.length;s++){let l=e[s];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,s,0);d.index=s,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(c=Math.min(c??s,s))):c=Math.min(c??s,s),t[s]!==d&&(c=Math.min(c??s,s)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}if(c==null){if(r.size===0)return;c=Math.max(i.length-1,0)}this.capturePendingLayoutAnchor(a);for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;s.set(n.item.id,n),this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);c=Math.min(c??a,a)}return this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(c),this.scrollDirty=!0,this.render(),s.size>0?s:void 0}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version!==t.version&&(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>rb}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),$y):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=Vy(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=Vy(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>rb&&t<i,o=n<eb&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(nb,r):tb):{pagedScrollTop:Vy(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=Vy(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${fb(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${fb(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=Df({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),hb(this.stickyContainer,t.element,h),n.virtualizedSetup(),mb(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(hb(this.stickyContainer,t.element,h),mb(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=Vy(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container!=null&&this.containerHeight!==e&&(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(r!=null&&i!=null)return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);if(t==null){this.stickyOffset.style.height=`${this.getPagedLayoutTop(e.top)}px`;return}this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null){this.renderState.firstIndex===-1&&(this.stickyOffset.style.height=``);return}let{stickyTop:t,stickyBottom:n}=e;(n-t!==this.renderState.stickyHeight||t!==this.renderState.stickyTop||n!==this.renderState.stickyBottom)&&this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{let t=!1;for(let n of e)if(n.target===this.stickyContainer){let e=n.borderBoxSize[0].blockSize;if(Math.abs(e-this.renderState.stickyHeight)>=Zy){let e=this.getScrollTop(),n=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let r=n==null?void 0:this.resolveAnchoredScrollTop(n);if(r!=null){let t=r-e;this.applyScrollFix(r,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else if(n.target===this.header.element||n.target===this.footer.element){let e=n.target===this.header.element?this.header:this.footer,r=n.borderBoxSize[0].blockSize;if(r!==e.height){let n=this.getScrollTop(),i=this.getScrollAnchor(n);this.setHostHeight(e,r);let a=i==null?void 0:this.resolveAnchoredScrollTop(i);if(a!=null){let e=a-n;this.applyScrollFix(a,n,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),t=!0}}else this.scrollDirty=!0,this.heightDirty=!0,t=!0;t&&this.render(!0)};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e,t=this.idToItem){let n,{pendingLayoutAnchor:r}=this;if(r!=null){let e=this.idToItem.get(r.id);if(e!=null&&t.get(r.id)===e)return r;e!=null&&(n=e)}if(e<=0)return;let{firstIndex:i,lastIndex:a,stickyTop:o,stickyBottom:s}=this.renderState;if(i===-1||a===-1)return;let c=this.getHeight();if(o!==-1&&s!==-1){for(let r=i;r<=a;r++){let i=this.items[r];if(i==null)continue;let a=this.getItemTopOffset()+i.top;if(a+i.height<=e)continue;if(a>=e+c)break;if(t.get(i.item.id)!==i){n??=i;continue}if(a>=e)return{type:`item`,id:i.item.id,viewportOffset:a-e};let o=this.getScrollAnchorViewportTop(a,e)-a,s=i.instance.getNumericScrollAnchor(o);if(s!=null){let t=a+s.top;return{type:`line`,id:i.item.id,lineNumber:s.lineNumber,side:s.side,viewportOffset:t-e}}}if(n!=null)for(let e=n.index+1;e<this.items.length;e++){let n=this.items[e];if(n!=null&&t.get(n.item.id)===n)return{type:`item`,id:n.item.id,viewportOffset:0}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=Vy(this.clampScrollTop(e)),i=Vy(t),{scrollPageOffset:a}=this,o=Vy(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;(r!==this.renderState.scrollTop||r!==i||l!==o||u)&&(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null||Vy(this.getScrollTop())===Vy(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);Ry(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);e.top=r,e.height=e.type===`diff`?e.instance.updateCodeViewLayout(e.item.fileDiff,r,t,e.item.annotations??[]):e.instance.updateCodeViewLayout(e.item.file,r,t,e.item.annotations??[]),r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function sb(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.updateCodeViewLayout(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.updateCodeViewLayout(e.item.file,e.top,void 0,e.item.annotations??[])}function cb(e,t){return!Cf(e.theme??F,t.theme??F)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function lb(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function ub(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function db(e){return e instanceof SVGElement||Qm(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function fb(e){let t=pb(e.start,e.side),n=pb(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function pb(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function mb(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function hb(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function gb(e){return(e.annotations?.length??0)>0}function _b(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)gb(t.item)&&i.push(t);return i.length>0?i:void 0}function vb(e){let t=[];for(let n of e){let e=Tt.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function yb(e){for(let t of Array.isArray(e)?e:[e])if(!Tt.has(t))return!1;return!0}async function bb(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=wd(r)??Cd(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function xb(e){return Rd.getResolvedThemes(e)}function Sb(e,t){try{let n=Bd({name:e,load:t});Rd.registerTheme(n.name,n.load)}catch(t){if(t instanceof Pd){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}throw t}}async function Cb(e){for(let t of e)sf(t);let t=await Rd.resolveThemes(e);for(let n=0;n<e.length;n++)cf(e[n],t[n]);return t}var wb=3;function Tb(e,t){return[...e].sort((e,t)=>Eb(e.worktree).localeCompare(Eb(t.worktree))||e.path.localeCompare(t.path)||e.line_start-t.line_start).map((e,n)=>{let r=`## ${n+1}. ${Ob(e)}`,i=Db(e,t);if(i&&(r+=` [on ${i}]`),e.side===`deletions`){let n=(t||[]).find(t=>t.worktree===Eb(e.worktree))?.base;r+=n?` [removed from ${n}]`:` [removed]`}let a=[r];if(e.snippet!=null&&e.line_end>0){let t=Ab(e.snippet),n=Pb(t);a.push(`${n}${jb(e.path)}\n${t}\n${n}`)}return a.push(e.text),a.join(`
|
|
1528
|
-
`)}).join(`
|
|
1529
|
-
|
|
1530
|
-
`)}function Eb(e){return e.split(/[@#]/)[0]}function Db(e,t){let n=Eb(e.worktree),r=t||[],i=(e.worktree===n?void 0:r.find(t=>t.id===e.worktree))??(e.head?r.find(t=>t.worktree===n&&t.head===e.head):void 0);if(i&&i.id&&i.id!==n){let e=i.pr?.headRefName||i.headRef||i.branch,t=i.pr?` #${i.pr.number}`:``;if(e)return`${e}${t}`}let a=e.worktree.includes(`@`)?e.worktree.split(`@`)[1]:``;return a?`topic ${a}`:``}function Ob(e){let t=`${Eb(e.worktree)}/${e.path}`;return e.line_end<=0?t:e.line_start===e.line_end?`${t}:${e.line_start}`:`${t}:${e.line_start}-${e.line_end}`}var kb=1;function Ab(e){let t=e.split(`
|
|
1531
|
-
`).map(e=>{let t=/^([ +\->])\s*(\d+) \| ?(.*)$/.exec(e);return t?{on:t[1]!==` `,n:t[2],code:t[3]}:null});if(t.some(e=>!e))return e;let n=t,r=n.findIndex(e=>e.on),i=n.findLastIndex(e=>e.on),a=r<0?n:n.slice(Math.max(0,r-kb),i+kb+1),o=Math.max(...a.map(e=>e.n.length));return a.map(e=>`${e.on?`>`:` `} ${e.n.padStart(o)} | ${e.code}`).join(`
|
|
1532
|
-
`)}function jb(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`),r=n>0?t.slice(n+1).toLowerCase():``;return/^[a-z0-9]{1,10}$/.test(r)?r:``}function Mb(e,t=12){return e.slice(0,t)}function Nb(e,t,n,r){let i=e.split(`
|
|
1533
|
-
`),a=Math.max(1,t-wb),o=Math.min(i.length,n+wb),s=r===`deletions`?`-`:r===`file`?`>`:`+`,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(`
|
|
1534
|
-
`)}function Pb(e){let t=3,n=/`+/g,r;for(;r=n.exec(e);)t=Math.max(t,r[0].length+1);return"`".repeat(t)}function Fb(e){return e.split(/[@#]/)[0]}function Ib(e){return e.split(`
|
|
1535
|
-
`).filter(e=>e[0]===`+`||e[0]===`-`||e[0]===`>`).map(e=>e.slice(1)).join(`
|
|
1536
|
-
`)}var Lb=`_la _b2 _bw`,Rb=`_lc _4`;function zb(t){if(t.length<=1)return null;let n=document.createElement(`select`);n.setAttribute(`aria-label`,`Send to session`),n.className=`_li`;for(let r of t){let t=document.createElement(`option`);t.value=r.id,t.textContent=e(r),n.append(t)}return n}var Bb=(e,t)=>e?.value||t[0]?.id||null;function Vb(e,t,n){for(let r of e)r.disabled=t,n&&r.dataset.role===`send`&&(r.textContent=t?`Sending…`:n)}function Hb(e,t){let n=document.createElement(`button`);return n.type=`button`,n.textContent=e,n.className=t,n}function Ub(t,n,r,i){if(!n){t.className=`_r ${i?ce:``} _s`,t.textContent=`Send`;let n=r[0];return n&&(t.title=`Send to ${e(n)}`),t}let a=document.createElement(`span`);return a.className=`_lg ${i?`_kB`:``}`,t.className=`_s _lh`,t.textContent=`Send to`,a.append(t,n),a}function Wb(e,t,n){e.onkeydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t()),e.key===`Escape`&&(e.preventDefault(),n())}}function Gb(e,t,n){let r=document.createElement(`div`);r.className=`_kx`;let i=document.createElement(`div`),a=document.createElement(`div`);a.className=`_kA`;let o=()=>{i.replaceChildren(),a.replaceChildren();let r=document.createElement(`p`);r.className=`_ky`,r.textContent=e.text;let o=Hb(`Remove`,`_r ${ce}`);o.onclick=()=>n.onDelete(e.id);let c=Hb(`Edit`,`_r ${ce}`);c.hidden=!n.onEdit,c.onclick=()=>s();let l=t.sessions(),u=l.length>0&&!!n.onSend,d=Hb(`Send`,``);d.dataset.role=`send`,d.hidden=!u;let f=u?zb(l):null,p=f?`Send to`:`Send`;if(d.onclick=()=>{(async()=>{let t=Bb(f,l);if(t&&!d.disabled){Vb([o,c,d],!0,p);try{await n.onSend?.(e.id,t)}finally{Vb([o,c,d],!1,p)}}})()},a.append(c,o),u&&a.append(Ub(d,f,l,!0)),n.drifted){let e=document.createElement(`span`);e.className=`_9 ${ge.warn} _kC`,e.textContent=`changed since`,e.title=`These lines changed since the comment; the agent gets them as they were`,a.append(e)}i.append(r)},s=()=>{i.replaceChildren(),a.replaceChildren();let t=document.createElement(`textarea`);t.value=e.text,t.rows=3,t.className=`_bj _kz`;let r=Hb(`Save`,`_r _s`),s=Hb(`Cancel`,`_r`),c=()=>{let i=t.value.trim();if(!i||i===e.text){o();return}(async()=>{Vb([r,s],!0);try{await n.onEdit?.(e.id,i),e.text=i,o()}catch{Vb([r,s],!1)}})()};r.onclick=c,s.onclick=()=>o(),Wb(t,c,o),a.append(r,s),i.append(t),setTimeout(()=>{t.focus({preventScroll:!0}),t.setSelectionRange(t.value.length,t.value.length)},0)};return o(),r.append(i,a),r}function Kb(e,t){let n=document.createElement(`div`);n.className=`_kx`;let r=document.createElement(`textarea`);r.placeholder=`Add a comment…`,r.rows=3,r.className=`_bj _kz`;let i=Hb(`Add`,`_r`),a=Hb(`Send`,``);a.dataset.role=`send`;let o=Hb(`Cancel`,`_r`),s=e.sessions(),c=s.length>0&&!!t.onSend;a.hidden=!c;let l=c?zb(s):null,u=c?Ub(a,l,s,!1):a,d=a.textContent,f=()=>{r.value.trim()&&t.onSave(r.value)},p=()=>{(async()=>{let e=r.value.trim(),n=Bb(l,s);if(e&&n&&!a.disabled){Vb([i,a,o],!0,d);try{await t.onSend?.(e,n)}finally{Vb([i,a,o],!1,d)}}})()};i.onclick=f,a.onclick=p,o.onclick=()=>t.onCancel(),Wb(r,c?p:f,()=>t.onCancel());let m=document.createElement(`div`);m.className=`_kA`,m.append(i),c&&m.append(u),m.append(o),n.append(r,m),r.addEventListener(`focus`,()=>{let t=window.visualViewport;if(!t)return;let i=()=>e.reveal(n,!0);t.addEventListener(`resize`,i),r.addEventListener(`blur`,()=>t.removeEventListener(`resize`,i),{once:!0})});let h=(e=0)=>{if(!r.isConnected||!r.getClientRects().length){e<120&&requestAnimationFrame(()=>h(e+1));return}r.focus({preventScroll:!0})};return setTimeout(h,0),n}var qb=e=>`/api/workspaces/${e}/review`;async function Jb(e){return(await se(qb(e))).comments||[]}function Yb(e,t){return oe(qb(e),{action:`comment`,...t})}function Xb(e,t,n){return oe(`${qb(e)}/${t}`,{text:n},`PATCH`)}function Zb(e,t){return t===`all`?oe(qb(e),{action:`clear`}):Promise.all(t.map(t=>se(`${qb(e)}/${t}`,{method:`DELETE`})))}function Qb(e,t,n){fetch(qb(e),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`seen`,heads:t,dirty:n}),keepalive:!0}).catch(()=>{})}var $b=`search-mark`,ex=`mark.${$b}`,tx=`mark.${$b}{display:inline;background:#ffd24a;color:#1a1408;-webkit-text-fill-color:#1a1408;border-radius:3px;padding:0 2px}mark.${$b} *,mark.${$b} *::before,mark.${$b} *::after{color:inherit!important;-webkit-text-fill-color:inherit!important;background:transparent!important}mark.${$b}.active{background:#ffb000;box-shadow:0 0 0 1px #c98400}`,nx={query:``,hit:null,keys:null},rx=new Map,ix=new WeakMap,ax=(e,t)=>t?`${e}\n${t.line}\n${t.side||``}`:e;function ox(e,t,n){nx.query=e,nx.hit=t,nx.keys=n?new Set(n):null;for(let[e,t]of rx)dx(e,t,!1);t&&sx(t)}function sx(e,t=0){requestAnimationFrame(()=>{requestAnimationFrame(()=>{let n=!1;for(let[r,i]of rx)if(i===e.key&&(n=!0,ux(r,e)||t>=40))return;t>=40||(!n||t<12)&&setTimeout(()=>sx(e,t+1),n?32:48)})})}function cx(e,t){if(e.scrollWidth<=e.clientWidth+1)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=Math.min(24,n.width/8);if(r.left>=n.left+i&&r.right<=n.right-i)return;let a=r.left-n.left+e.scrollLeft-(n.width/2-r.width/2),o=Math.max(0,e.scrollWidth-e.clientWidth);e.scrollTo({left:Math.max(0,Math.min(a,o))})}function lx(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 ux(e,t){let n=e.shadowRoot??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=>hx(e)===r)??e[0]??null})();if(!r)return!1;let i=r.getBoundingClientRect();if(i.height===0&&i.width===0)return!1;let a=lx(r,e);return a&&cx(a,r),!0}function dx(e,t,n=!0){let r=t&&nx.hit?.key===t?nx.hit:null,i=nx.query.trim(),a=!!i&&!!nx.keys&&!!t&&!nx.keys.has(t),o=a?``:ax(i,r),s=ix.get(e)!==o;(n||s)&&(ix.set(e,o),xx(e,a?``:i,r),r&&s&&sx(r))}function fx(e,t){return rx.set(e,t),dx(e,t),()=>{rx.delete(e),ix.delete(e)}}function px(e){dx(e,rx.get(e))}function mx(e){let t=e.querySelectorAll(ex);if(!t.length)return;let n=new Set;for(let e of[...t])e.parentElement&&n.add(e.parentElement),e.replaceWith(...e.childNodes);for(let e of n)e.normalize()}function hx(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 gx(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[];for(let e=t.nextNode();e;e=t.nextNode())e.parentElement?.closest(ex)||n.push(e);return n}function _x(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 vx(e,t,n,r,i){let a=_x(e,t,n),o=_x(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 yx(e,t,n,r){let i=gx(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=Sx(e,r)?`${$b} active`:$b;for(let e=c.length-1;e>=0;e--)vx(i,a,c[e][0],c[e][1],l)}var bx=new WeakMap;function xx(e,t,n){let r=[e],i=e.shadowRoot??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(!s){mx(e);continue}for(let t of e.querySelectorAll(`[data-code] [data-line]`)){let e=t.textContent||``,r=(o?e:e.toLowerCase()).includes(s),i=r?`${o?`s`:`i`}${s}\n${t.getAttribute(`data-line`)}\n${+!!Sx(t,n)}`:``,a=!!t.querySelector(ex);i!==(a?bx.get(t):``)&&(a&&mx(t),bx.set(t,i),r&&yx(t,s,o,n))}}}function Sx(e,t){return!!t&&t.line===Number(e.getAttribute(`data-line`))&&(t.side||`additions`)===hx(e)}var Cx=n(i(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n||=self).lru_map=n.lru_map||{})})(e,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),wx=Symbol(`IGNORE_RESPONSE`),Tx=1e4,Ex=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},Dx=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`)}},Ox=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=F,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new Cx.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Cx.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??F,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||u_(a,this.renderOptions))return;let o=Td(e),c=[];if(Cf(a.theme,this.renderOptions.theme)||(c=pp(o)?xb(o):await Cb(o)),!s())return;if(this.highlighter!=null)zd(c,this.highlighter);else{let e=await ff({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof Ex||!s())return;throw e}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);jx(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0){if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=Td(this.renderOptions.theme),i=[];if(i=pp(r)?xb(r):await Cb(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=yb(e)?vb(e):await bb(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([ff({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof Ex||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.activeTaskById.clear();for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,Nx(e));this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=Dp(),i=r>0?Op():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>this.handleWorkerError(o,e)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};o.pendingSetupRequestId=s,this.activeTaskById.set(s,c),this.executeTask(o,c)}))}let a=this.options.workerInitializationTimeout??Tx,o;try{await Promise.race([Promise.all(n),new Promise((e,t)=>{o=setTimeout(()=>{t(Error(`WorkerPoolManager: worker initialization timed out after ${a}ms`))},a)})])}finally{o!=null&&clearTimeout(o)}}handleWorkerError(e,t){console.error(`Worker error:`,t,e);let{pendingSetupRequestId:n}=e;if(n==null)return;let r=this.activeTaskById.get(n);r?.type===`initialize`&&(r.reject(Nx(t)),this.cleanWorkerAndTask(e,r))}drainQueue=()=>{if(this._queuedDrain=void 0,this.initialized===!0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=Ax(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);wm(t)||n!=null&&mp(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeFileHighlightCache: worker pool is not working`));let t=this.getOrCreateFileHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateFileHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||wm(e)||t!=null&&mp(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`file`?r:void 0;{let t=this.submitCacheTask({type:`file`,file:e},n);return t.type===`file`?t:void 0}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return mm(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);Iv(t)||n!=null&&u_(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeDiffHighlightCache: worker pool is not working`));let t=this.getOrCreateDiffHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}getOrCreateDiffHighlightCacheTask(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Iv(e)||t!=null&&u_(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);if(r!=null)return r.primeCache=!0,r.type===`diff`?r:void 0;{let t=this.submitCacheTask({type:`diff`,diff:e},n);return t.type===`diff`?t:void 0}}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:B_(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers();let e=new Ex;for(let t of this.queuedTasks)this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new Ex;for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):jx(t)&&this.rejectRenderTaskCallbacks(t,e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r}}})();return this.enqueueRenderTask(a),a}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(e=>!kt(e));r.length>0&&ff({themes:Td(this.renderOptions.theme),langs:[`text`,...r],preferredHighlighter:this.preferredHighlighter}).catch(e=>{console.error(e)});let i=n.filter(t=>!e.langs.has(t));if(i.length>0&&(yb(i)?t.request.resolvedLanguages=vb(i):t.request.resolvedLanguages=await bb(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.rejectRenderTaskCallbacks(t,Nx(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw wx;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(jx(n))this.notifyHighlightError(n,e),this.rejectRenderTaskCallbacks(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}if(jx(n))for(let{name:t}of n.request.resolvedLanguages??[])e.langs.add(t);switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!mp(i,this.getFileRenderOptions()))throw wx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!u_(i,this.getDiffRenderOptions()))throw wx;let{request:a}=n;this.syncCustomExtensionVersion(e,a),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:r,options:i}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==wx&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,jx(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(jx(t)&&(this.rejectRenderTaskCallbacks(t,new Dx),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){kx(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);try{t.type===`file`?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type===`diff`&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),jx(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,Nx(n))):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=Dp();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=Op())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of Mx(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new Dx),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new Dx),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){for(let t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(let n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))jx(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of Mx(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of Mx(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of Mx(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of Mx(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Eh(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&W(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())jx(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function kx(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function Ax(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??Ep(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??Ep(e.request.diff.name)),t.add(e.request.diff.lang??Ep(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function jx(e){return e?.type===`file`||e?.type===`diff`}function Mx(e){return e.instances}function Nx(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){if(`error`in e&&e.error instanceof Error)return e.error;if(`message`in e&&typeof e.message==`string`)return Error(e.message)}return Error(String(e))}var Px;function Fx({poolOptions:e,highlighterOptions:t}){return Px??=new Ox(e,t),Px}var Ix=`/assets/worker-BK3lyuKh.js`,Lx={dark:`work-dark`,light:`work-light`};function Rx(e,t){let n=(t,n)=>xe(e.colors?.[t]??``)??xe(n),r=n(`editor.background`,e.bg??(t?`#000`:`#fff`)),i=n(`gitDecoration.addedResourceForeground`,t?`#5ecc71`:`#0dbe4e`),a=n(`gitDecoration.deletedResourceForeground`,t?`#ff6762`:`#ff2e3f`),o=t?.2:.12,s=t?.2:.15,c=Te(r,i,o),l=Te(r,a,o);return[r,c,l,Te(c,i,s),Te(l,a,s)]}function zx(e,t){let n=e.type===`dark`,r=Rx(e,n),i=n?be:we,a=new Map,o=e=>{let t=a.get(e);if(t===void 0){let n=xe(e);t=n?Ce(ye(n,i,r)):e,a.set(e,t)}return t},[s,c,l]=r,u={...e.colors};for(let[e,t]of[[`gitDecoration.addedResourceForeground`,c],[`gitDecoration.deletedResourceForeground`,l],[`gitDecoration.modifiedResourceForeground`,s]]){let n=xe(u[e]??``);n&&(u[e]=Ce(ye(n,i,[s,t])))}return{...e,name:t,colors:u,settings:e.settings?.map(e=>e.settings?.foreground?{...e,settings:{...e.settings,foreground:o(e.settings.foreground)}}:e),semanticTokenColors:e.semanticTokenColors&&Object.fromEntries(Object.entries(e.semanticTokenColors).map(([e,t])=>[e,o(t)]))}}Sb(Lx.light,async()=>zx(await lf(`pierre-light`),Lx.light)),Sb(Lx.dark,async()=>zx(await lf(`pierre-dark`),Lx.dark));var Bx;function Vx(){return Bx??=Fx({poolOptions:{workerFactory:()=>new Worker(Ix,{type:`module`}),poolSize:Math.min(2,navigator.hardwareConcurrency||2),totalASTLRUCacheSize:32},highlighterOptions:{theme:Lx}})}var Hx={apng:`image/apng`,avif:`image/avif`,bmp:`image/bmp`,gif:`image/gif`,ico:`image/x-icon`,jpeg:`image/jpeg`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`,webp:`image/webp`,pdf:`application/pdf`};function Ux(e){let t=e.lastIndexOf(`.`),n=Hx[t<0?``:e.slice(t+1).toLowerCase()];return n?{kind:n===`application/pdf`?`pdf`:`image`,type:n}:null}var Wx=`_gJ _bp _m`,Gx=`<h1> </h1><nav aria-label="Review views"><a title="Every file in the workspace">Files</a><a title="What changed">Diff</a></nav>`,Kx=` D l D b l`;function qx(e){b(e.a,`_Q`),b(e.c,[`_bB`,`_lt`])}var Jx=(e,t)=>{l(e.b,t===`files`?`Files`:`Review`),b(e.d,[`_bD`,t===`files`&&`_bC`]),C(e.d,`aria-current`,t===`files`?`page`:void 0),b(e.e,[`_bD`,t===`changes`&&`_bC`]),C(e.e,`aria-current`,t===`changes`?`page`:void 0)},Yx=(e,t)=>C(e.d,`href`,t),Xx=(e,t)=>C(e.e,`href`,t),Zx=j,Qx=(e=>`/${e}&`)(A);function $x(e){k(e.a,te)}var eS=(e,t)=>he(e.a,t),tS=(e,t)=>ee(e.a,t),nS=((e,t,n)=>`<div><div role=group><button type=button><span aria-hidden=true>${e}<span> </span></span><!></button><button type=button aria-label="Send options" aria-haspopup=menu></button></div><span>${t} No comments</span></div><div popover=auto role=menu><!><button type=button role=menuitem><span>${n}</span><span>Copy as markdown</span></button></div>`)(Zx,Zx,Ye),rS=((e,t,n)=>` D D D D/${e}& D m%l l D/${t}&m D%b D D/${n}&l m`)(Qx,Qx,Je),iS=e=>{Ke(e.a),Ge(e.a,12),qe(e.a)},aS=c(7,3,t=>l(t.b,e(t._.a6))),oS=e=>{aS._(e),b(e.a,[`_k9`,`_S`]),b(e.c,`_R`)},sS=c(7,0,e=>l(e.a,e._.z===`copied`?`Copied`:`Copy failed`)),cS=sS,lS=g(1,We,(e=>`/${e}&`)(Ue),iS),uS=s(8,e=>{C(e.a,`aria-checked`,e.h===e._._.a9?`true`:`false`),lS(e,e.h===e._._.a9?0:1)}),dS=x(43,uS,e=>e._._),fS=y(`r2`,e=>O(e.a,`click`,function(){OS(e._._,e.h),e._._.l.hidePopover()})),pS=e=>{dS(e),b(e.a,Rb),b(e.b,`_ld`),Ee(e.c,14),De(e.c),b(e.d,`_le`),fS(e)},mS=E(7,uS),hS=(e,t)=>Oe(e.c,t),gS=(t,n)=>{l(t.e,e(n)),mS(t,n?.id),hS(t,n?.agent)},_S=h(1,(e=>`<button type=button role=menuitemradio><span></span>${e}<span> </span></button>`)(N),(e=>` D b/${e}& D m`)(`b%c`),pS,(e,t)=>gS(e,t[0])),vS=c(12,0,e=>_S(e,[e._.a3,`id`])),yS=e=>{vS._(e),b(e.a,`_lb`),b(e.c,`_lf`)},bS=E(38),xS=s(33,e=>bS(e,KS(e)),2),SS=g(7,` `,` `,cS,`Sending…`,0,0,`Copy`,0,0,`<span>Send to <!></span><span>Send</span>`,` Db%l `,oS,`Send`),CS=s(34,e=>SS(e,e.z?0:e.x?1:e.a6?e.a5>1?3:4:2),3),wS=d(23,e=>{C(e.c,`disabled`,e.x),C(e.i,`disabled`,e.x),xS(e),CS(e)}),TS=s(37,t=>C(t.c,`title`,t.u?t.a6?`Send ${t.aa} to ${e(t.a6)}`:`Copy ${t.aa} as markdown`:`No comments to send`),2),ES=E(32,e=>{VS(e,e.a6?.id),xS(e),TS(e),CS(e),aS(e)}),DS=s(30,e=>ES(e,e.a3.find(t=>t.id===e.y)??e.a3[0]??null)),OS=d(24,DS),kS=d(25,e=>{CS(e),sS(e)}),AS=(e,t)=>IS(e,t.id),jS=y(`r3`,e=>{O(e.c,`click`,function(){e.a6?e.ac():e.ad()}),O(e.i,`click`,function(){let t=e.l;t.showPopover(),r(t,e.b.getBoundingClientRect(),{align:`end`})}),O(e.n,`click`,function(){e.l.hidePopover(),e.ad()})});function MS(e){b(e.c,`_k6`),b(e.d,[`_w`,`_k7`]),$x(e.e),eS(e.e,18),tS(e.e,`_x`),b(e.f,[re,`_k8`]),b(e.i,`_k_`),$x(e.k),eS(e.k,16),tS(e.k),b(e.l,Lb),b(e.n,Rb),b(e.o,`_ld`),Ze(e.p),Xe(e.p,14),Qe(e.p),b(e.q,`_le`),wS(e,!1),OS(e,null),kS(e,null),AS(e,{id:0}),jS(e)}var NS=E(39),PS=s(28,e=>NS(e,qS(e))),FS=y(`r4`,e=>_(e,{onDestroy:function(){clearTimeout(e.a1)}})),IS=E(27,e=>{PS(e),FS(e)}),LS=E(29,e=>{zS(e,e.a3.length),DS(e),vS(e)}),RS=g(12,`<span>Send to</span><!><span role=separator></span>`,` b%b `,yS),zS=E(31,e=>{RS(e,+!e.a5),CS(e)}),BS=(e,t)=>LS(e,t||[]),VS=E(35,D(dS)),HS=E(36,e=>{C(e.b,`aria-label`,e.aa),TS(e)}),US=E(20,e=>{b(e.a,[`_k2`,!e.u&&`_k4`]),b(e.b,[`_k1`,!e.u&&`_k3`]),C(e.b,`inert`,!e.u),l(e.g,e.u>99?`99+`:e.u),b(e.j,[`_k5`,!!e.u&&`_k3`]),HS(e,Se(e.u,`comment`)),TS(e)}),WS=E(21,xS),GS=E(22,PS),KS=e=>()=>{(async()=>{if(e.a6&&!e.x){wS(e,!0);try{await e.v(e.a6?.id)}finally{wS(e,!1)}}})()},qS=e=>()=>{(async()=>{kS(e,await e.w()?`copied`:`failed`),clearTimeout(e.a1),e.a1=setTimeout(()=>{kS(e,null)},1500)})()};u.r0=KS,u.r1=qS;var JS=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1537
|
-
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
1538
|
-
<path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
|
|
1539
|
-
</symbol>
|
|
1540
|
-
<symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
|
|
1541
|
-
<circle cx="3" cy="3" r="3" />
|
|
1542
|
-
</symbol>
|
|
1543
|
-
<symbol id="file-tree-icon-file" viewBox="0 0 16 16">
|
|
1544
|
-
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
|
|
1545
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
1546
|
-
</symbol>
|
|
1547
|
-
<symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
|
|
1548
|
-
<path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
|
|
1549
|
-
</symbol>
|
|
1550
|
-
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
1551
|
-
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
1552
|
-
</symbol>
|
|
1553
|
-
</svg>`,YS=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
1554
|
-
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
1555
|
-
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
1556
|
-
</symbol>`,XS=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
1557
|
-
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
1558
|
-
</symbol>`,ZS=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
1559
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1560
|
-
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
1561
|
-
</symbol>`,QS=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
1562
|
-
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
1563
|
-
</symbol>`,$S=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
1564
|
-
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
1565
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
1566
|
-
</symbol>`,eC=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
1567
|
-
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
1568
|
-
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
1569
|
-
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
1570
|
-
</symbol>`,tC=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
1571
|
-
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
1572
|
-
</symbol>`,nC=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
|
|
1573
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
1574
|
-
</symbol>`,rC=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
1575
|
-
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
1576
|
-
</symbol>`,iC=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
|
|
1577
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
1578
|
-
</symbol>`,aC=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
1579
|
-
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
1580
|
-
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
1581
|
-
</symbol>`,oC=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
1582
|
-
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
1583
|
-
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
1584
|
-
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
1585
|
-
</symbol>`,sC=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
1586
|
-
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
1587
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
1588
|
-
</symbol>`,cC=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
1589
|
-
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
1590
|
-
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
1591
|
-
</symbol>`,lC=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
1592
|
-
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
1593
|
-
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
1594
|
-
</symbol>`,uC=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
1595
|
-
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
1596
|
-
</symbol>`,dC=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
1597
|
-
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
1598
|
-
</symbol>`,fC=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
1599
|
-
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
1600
|
-
</symbol>`,pC=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
1601
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
1602
|
-
</symbol>`,mC=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
1603
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1604
|
-
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
1605
|
-
</symbol>`,hC=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
1606
|
-
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
1607
|
-
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
1608
|
-
</symbol>`,gC=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
1609
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1610
|
-
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
1611
|
-
</symbol>`,_C=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
1612
|
-
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
1613
|
-
</symbol>`,vC=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
1614
|
-
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
1615
|
-
</symbol>`,yC=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
1616
|
-
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
1617
|
-
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
1618
|
-
</symbol>`,bC=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
1619
|
-
<defs>
|
|
1620
|
-
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
1621
|
-
<stop stop-color="currentColor"/>
|
|
1622
|
-
<stop offset="1" stop-color="currentColor" stop-opacity="0"/>
|
|
1623
|
-
</linearGradient>
|
|
1624
|
-
</defs>
|
|
1625
|
-
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
1626
|
-
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
1627
|
-
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
1628
|
-
</symbol>`,xC=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
1629
|
-
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
1630
|
-
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
1631
|
-
</symbol>`,SC=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
1632
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
1633
|
-
</symbol>`,CC=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
1634
|
-
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
1635
|
-
</symbol>`,wC=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
1636
|
-
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
1637
|
-
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
1638
|
-
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
1639
|
-
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
1640
|
-
</symbol>`,TC=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
1641
|
-
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
1642
|
-
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
1643
|
-
</symbol>`,EC=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
1644
|
-
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
1645
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
1646
|
-
</symbol>`,DC=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
1647
|
-
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
1648
|
-
</symbol>`,OC=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
1649
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
1650
|
-
</symbol>`,kC=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
1651
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
1652
|
-
</symbol>`,AC=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
1653
|
-
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
1654
|
-
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
1655
|
-
</symbol>`,jC=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
1656
|
-
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
1657
|
-
</symbol>`,MC=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
1658
|
-
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
1659
|
-
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
1660
|
-
</symbol>`,NC=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
1661
|
-
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
1662
|
-
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
1663
|
-
</symbol>`,PC=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
1664
|
-
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
1665
|
-
</symbol>`,FC=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
1666
|
-
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
1667
|
-
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
1668
|
-
</symbol>`,IC=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
1669
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
1670
|
-
</symbol>`,LC=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
1671
|
-
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
1672
|
-
</symbol>`,RC=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
1673
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
1674
|
-
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
1675
|
-
</symbol>`,zC=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
1676
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
1677
|
-
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
1678
|
-
</symbol>`,BC=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
1679
|
-
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
1680
|
-
</symbol>`,VC=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
1681
|
-
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
1682
|
-
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
1683
|
-
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
1684
|
-
</symbol>`,HC=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
1685
|
-
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
1686
|
-
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
1687
|
-
</symbol>`,UC=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
1688
|
-
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
1689
|
-
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
1690
|
-
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
1691
|
-
</symbol>`,WC=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
1692
|
-
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
1693
|
-
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
1694
|
-
</symbol>`,GC=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
1695
|
-
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
1696
|
-
</symbol>`,KC=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
1697
|
-
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
1698
|
-
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
1699
|
-
</symbol>`,qC=[ZS,nC,iC,aC,oC,sC,uC,dC,fC,mC,hC,gC,_C,vC,yC,TC,DC,OC,PC,FC,RC,zC,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
1700
|
-
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
1701
|
-
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
1702
|
-
</symbol>`],JC=[YS,XS,QS,$S,eC,tC,rC,cC,lC,pC,bC,xC,SC,CC,wC,EC,kC,AC,jC,MC,NC,IC,LC,BC,VC,HC,UC,WC,GC,KC];function YC(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
1703
|
-
`)}\n</svg>`)}var XC=YC(JS,qC),ZC={minimal:JS,standard:XC,complete:YC(XC,JC)},QC={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},$C={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},ew={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},tw=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),nw=new Set([`complete`]);function rw(e){return ZC[e===`none`?`minimal`:e]}function iw(e){return`file-tree-builtin-${e}`}function aw(e){return e!==`none`&&nw.has(e)}function ow(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=QC[t.toLowerCase()];if(i!=null&&(r||tw.has(i)))return i;for(let e of n){if(r){let t=ew[e];if(t!=null)return t}let t=$C[e];if(t!=null&&(r||tw.has(t)))return t}return`default`}var sw=`file-tree-container`,cw=`data-file-tree-style`,lw=`data-file-tree-unsafe-css`,uw=`data-file-tree-scrollbar-measure`,dw=`data-file-tree-scrollbar-gutter-measured`,fw=`--trees-scrollbar-gutter-measured`,pw=`header`,mw=`context-menu`,hw=`context-menu-trigger`;function gw(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function _w(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(gw(e)?`none`:`complete`),colored:e.colored??!0}}var vw=e=>e.trim().toLowerCase(),yw=e=>e.split(`/`).at(-1)??e,bw=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function xw(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function Sw(e){let t=_w(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(vw(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let s=yw(o),c=s.toLowerCase(),l=r.get(c);if(l!=null)return xw(l,e);for(let[t,n]of a)if(c.includes(t))return xw(n,e);let u=bw(s);for(let t of u){let n=i.get(t);if(n!=null)return xw(n,e)}let d=ow(t.set,s,u);if(d!=null&&t.set!==`none`){if(d==="default"){let t=n?.[e];if(t!=null)return xw(t,e)}return{name:iw(d),remappedFrom:e,token:d}}}let s=n?.[e];return s==null?{name:e}:xw(s,e)}}}var Cw=5,ww=32,Tw=128;function Ew(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Dw(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function Ow(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function kw(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function Aw(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function jw(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function Mw(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,Iw(e,t)}function Nw(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=kw(e).get(t);if(i===void 0)return;let a=i>>Cw;e.childVisibleChunkSums[a]+=r}function Pw(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=Lw(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=ww}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function Fw(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>Cw;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<Cw}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function Iw(e,t){if(t.childIds.length<Tw){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/ww),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>Cw]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function Lw(e,t,n,r){let i=Math.min(t.childIds.length,n+ww),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var Rw=7,zw=3,Bw=8,Vw=4;function Hw(e,t,n=0){return e<<Vw|n<<zw|t}function Uw(e){return e.depthAndFlags>>>Vw}function Ww(e){return(e.depthAndFlags&Bw)>>zw}function G(e){return(e.depthAndFlags&Bw)!==0}function Gw(e){return e.depthAndFlags&Rw}function Kw(e,t){return(Gw(e)&t)!==0}function qw(e,t){e.depthAndFlags|=t}function Jw(e,t){e.depthAndFlags=Hw(t,Gw(e),Ww(e))}var Yw=Symbol(`benchmarkInstrumentation`);function Xw(e,t){return t==null||Object.defineProperty(e,Yw,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function Zw(e){return e==null?null:e[Yw]??null}function K(e,t,n){return e==null?n():e.measurePhase(t,n)}function Qw(e,t,n){Number.isFinite(n)&&e!=null&&e.setCounter(t,n)}function $w(e){return e>=48&&e<=57}function eT(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!$w(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&$w(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function tT(e){let t=e.toLowerCase();return{lowerValue:t,tokens:eT(t)}}function nT(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function rT(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=nT(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function iT(e,t,n){let r=rT(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function aT(e,t){return iT(e,t,tT)}function oT(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function sT(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=oT(e,r);return a===oT(t,r)?aT(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function cT(e,t){return sT(e,t)}function lT(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=tT(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=oT(e,n);return o===oT(t,n)?iT(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function uT(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=tT(r);return e.sortKeyById[t]=i,i}function dT(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function fT(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function pT(e){let{hasTrailingSlash:t,segments:n}=fT(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function mT(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=fT(e);return{requiresDirectory:t,segments:n}}function hT(){let e=new Map;return e.set(``,0),{idByValue:e,valueById:[``],sortKeyById:[tT(``)]}}function gT(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function _T(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var vT=Symbol(`pathStorePreparedInputKind`);function yT(e,t){return e[vT]=t,e}function bT(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function xT(e,t,n){return n==="default"?cT(e,t):n(bT(e),bT(t))}function ST(){return{depthAndFlags:Hw(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function CT(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function wT(e){return e.isDirectory?e.segments.length:e.segments.length-1}function TT(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function ET(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function DT(e,t={}){return NT(e,t).map(e=>e.path)}function OT(e,t={}){let n=NT(e,t);return yT({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function kT(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return yT({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function AT(e){let t=e,n=t.preparedPaths;if(t[vT]===`prepared`&&n!=null)return n;if(!TT(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function jT(e){let t=e;return t[vT]===`presorted`&&t.presortedPaths!=null||ET(t.presortedPaths)?t.presortedPaths:null}function MT(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function NT(e,t={}){let n=dT(t),r=Zw(t);Qw(r,`workload.inputFiles`,e.length);let i=K(r,`store.preparePathEntries.parse`,()=>e.map(e=>pT(e)));return K(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>xT(e,t,n.sort))),i}var PT=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[ST()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=hT();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=Zw(e),this.options=dT(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,Ew())}appendPaths(e){return K(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>pT(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,K(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return K(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null){if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:Hw(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:Hw(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d,m=a+1}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:Hw(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=pT(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null){if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:Hw(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:Hw(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=pT(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(K(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||K(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?lT(this.lastPreparedPath,e,this.segmentSortKeyCache):xT(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=wT(e),i=n==null?0:wT(n),a=n==null?0:CT(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=gT(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:Hw(Uw(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),Aw(i,s),s}createFileChildUnchecked(e,t){let n=gT(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hw(Uw(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Aw(r,a),a}getOrCreateDirectoryChild(e,t){let n=gT(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!G(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hw(Uw(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Aw(r,a),this.directories.set(a,Ew()),a}createDirectoryChild(e,t){let n=gT(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:Hw(Uw(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),Aw(r,a),this.directories.set(a,Ew()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!G(n))throw Error(`Path is not a directory: "${t}"`);if(Kw(n,1))throw Error(`Duplicate path: "${t}"`);qw(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,Dw());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(G(a)){let t=Dw();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;G(n)&&this.directories.set(t,Ew());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),Aw(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!G(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return Mw(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function FT(e,t=`closed`,n=null){let r=LT(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function IT(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function LT(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function RT(e,t){return Kw(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion!==`closed`&&Uw(t)<=e.defaultExpansion}function zT(e,t,n=e.snapshot.nodes[t]){return n==null||!G(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:RT(e,n)}function BT(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!G(r))return;let i=RT(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function VT(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function HT(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function UT(e,t){let n=VT(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function WT(e,t){let n=VT(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function GT(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function KT(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function qT(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function JT(e,t){e.directoryLoadInfoById.delete(t)}function YT(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function XT(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function ZT(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function QT(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function $T(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function eE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function tE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function nE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function rE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function iE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function aE(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oE(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function sE(e,t,n){return{...n,visibleCountDelta:vE(e)-t}}function cE(e,t){let n=vE(e),r=IT();e.transactionStack.push(r);try{t()}catch(t){throw dE(e,r,!1),t}dE(e,r,!0,vE(e)-n)}function lE(e,t){let n=e.instrumentation;if(n==null){uE(e,t);return}K(n,`store.events.record`,()=>uE(e,t))}function uE(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){gE(e,t);return}n.events.push(t),hE(n,t)}function dE(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?mE(i,t):K(n,`store.events.batch.merge`,()=>mE(i,t));return}let a=fE(t,r),o=e.instrumentation;if(o==null){gE(e,a);return}K(o,`store.events.batch.commit`,()=>gE(e,a))}function fE(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function pE(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function mE(e,t){for(let n of t.events)e.events.push(n);pE(e,t)}function hE(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function gE(e,t){let n=e.instrumentation;if(n==null){_E(e,t);return}K(n,`store.events.emit`,()=>_E(e,t))}function _E(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function vE(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function yE(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!G(n)||Kw(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!G(a)?null:i}function bE(e,t){let n=t;for(;;){let t=yE(e,n);if(t==null)return n;n=t}}function xE(e,t){let n=[t],r=t;for(;;){let t=yE(e,r);if(t==null)return n;n.push(t),r=t}}function SE(e,t){let n=t==null?e.snapshot.rootId:jE(e,t);return n==null?[]:NE(e,n)}function CE(e,t){let n=pT(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=JE(e,qE(e,r)),{createdNodeIds:a,directoryId:o}=PE(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Y(e,o);if(Kw(n,1))throw Error(`Path already exists: "${t}"`);qw(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=IE(e,o,n.basename),s.add(c);OE(e,o);let l=JE(e,o);return XT({affectedAncestorIds:AE(e,c),affectedNodeIds:[...s],path:t,projectionChanged:YE(i,l)})}function wE(e,t,n){let r=jE(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Y(e,r);if(Kw(i,2))throw Error(`The root node cannot be removed`);if(G(i)&&J(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=JE(e,a),s=GE(e,r);zE(e,a,r,i.nameId),KE(e,a),OE(e,a);let c=JE(e,a);return ZT({affectedAncestorIds:AE(e,a),affectedNodeIds:s,path:t,projectionChanged:YE(o,c),recursive:n.recursive===!0})}function TE(e,t,n,r){let i=jE(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Y(e,i);if(Kw(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=UE(e,i,n),c=JE(e,a.parentId),l=JE(e,s.parentId),u=_T(e.snapshot.segmentTable,a.nameId),d=gT(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(G(a)&&$E(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=Ow(e.snapshot.nodes,J(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&WE(e,p,o,Ww(a))===`skip`)return null;let m=a.parentId;zE(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),QE(e,i),RE(e,s.parentId,i),KE(e,m),e.pathCacheVersion++,OE(e,m),s.parentId!==m&&OE(e,s.parentId);let h=JE(e,m),g=JE(e,s.parentId);return QT({affectedAncestorIds:[...new Set([...AE(e,m),...AE(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:XE([c,l],[h,g]),to:q(e,i)})}function EE(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function DE(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function q(e,t){let n=Y(e,t),r=EE(e,t);if(r!=null)return r;if(Kw(n,2))return DE(e,t,``);let i=q(e,n.parentId),a=_T(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return DE(e,t,G(n)?`${o}/`:o)}function OE(e,t){let n=e.instrumentation;if(n==null){tD(e,t);return}K(n,`store.recomputeCountsUpwardFrom`,()=>tD(e,t))}function kE(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!G(o)){eD(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){eD(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function AE(e,t){let n=[],r=t;for(;r!=null;){let t=Y(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function jE(e,t){if(t.length===0)return e.snapshot.rootId;let n=mT(t);return ME(e,n.segments,n.requiresDirectory)}function ME(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=J(e,r),a=Ow(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Y(e,r);return n&&!G(i)?null:r}function J(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function Y(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kw(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function NE(e,t){let n=e.snapshot.nodes[t];if(n===void 0||Kw(n,4))return[];if(!G(n))return[q(e,t)];if(J(e,t).childIds.length===0)return Kw(n,1)&&!Kw(n,2)?[q(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||Kw(n,4)){i.pop();continue}if(!G(n)){r.push(q(e,t.nodeId)),i.pop();continue}let a=J(e,t.nodeId);if(a.childIds.length===0){Kw(n,1)&&!Kw(n,2)&&r.push(q(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function PE(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=gT(e.snapshot.segmentTable,i),a=J(e,r),o=Ow(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!G(Y(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=FE(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function FE(e,t,n){let r=Y(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hw(Uw(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,Ew()),RE(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function IE(e,t,n){let r=gT(e.snapshot.segmentTable,n),i=J(e,t);if(Ow(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${rD(e,t,n)}"`);let a=Y(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Hw(Uw(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),RE(e,t,o),e.activeNodeCount++,o}function LE(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}BE(e,n,o)<0?i=a:r=a+1}return r}function RE(e,t,n){let r=J(e,t),i=Y(e,n);Ow(e.snapshot.nodes,r).set(i.nameId,n),Nw(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=LE(e,r,n);r.childIds.splice(a,0,n),jw(r,a),Iw(e.snapshot.nodes,r)}function zE(e,t,n,r){let i=J(e,t),a=kw(i),o=a.get(n)??-1;Ow(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&Nw(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),jw(i,o),Iw(e.snapshot.nodes,i))}function BE(e,t,n){let r=e.snapshot.options.sort;return r==="default"?VE(e,t,n):r(HE(e,t),HE(e,n))}function VE(e,t,n){let r=Y(e,t),i=Y(e,n),a=G(r);if(a!==G(i))return a?-1:1;let o=rT(uT(e.snapshot.segmentTable,r.nameId),uT(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=_T(e.snapshot.segmentTable,r.nameId),c=_T(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function HE(e,t){let n=Y(e,t),r=q(e,t),i=G(n),a=i?r.slice(0,-1):r;return{basename:_T(e.snapshot.segmentTable,n.nameId),depth:Uw(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function UE(e,t,n){let r=Y(e,t),i=jE(e,n);if(i!=null){let t=Y(e,i);if(G(t))return{basename:_T(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=mT(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=mT(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:ME(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function WE(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${q(e,t)}"`);let i=Y(e,t);if(Ww(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(G(i)&&J(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return GE(e,t),zE(e,a,t,o),KE(e,a),OE(e,a),`handled`}function GE(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Y(e,t.nodeId);if(t.visitedChildren||!G(i)){G(i)&&e.snapshot.directories.delete(t.nodeId),qw(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),JT(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=J(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function KE(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||Kw(t,2)||J(e,n).childIds.length>0)return;qw(t,1),n=t.parentId===n?null:t.parentId}}function qE(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=Ow(e.snapshot.nodes,J(e,n)).get(t);if(i==null||!G(Y(e,i)))break;n=i}return n}function JE(e,t){let n=ZE(e,t);if(n==null)return null;let r=bE(e,n),i=Y(e,r),a=n===r?null:xE(e,n).map(t=>q(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:J(e,r).childIds.length>0,path:q(e,r),terminalKind:Ww(i)})}function YE(e,t){return XE([e],[t])}function XE(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function ZE(e,t){let n=t;for(;n!=null;){let t=Y(e,n);if(!G(t)||Kw(t,2))return null;if(!zT(e,n,t))return n;n=t.parentId}return null}function QE(e,t){let n=Y(e,t);if(Jw(n,(t===e.snapshot.rootId?-1:Uw(Y(e,n.parentId)))+1),!G(n))return;let r=J(e,t);for(let t of r.childIds)QE(e,t)}function $E(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Y(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function eD(e,t,n=Y(e,t),r=!1){let i=e.instrumentation;if(i==null){nD(e,t,n,r);return}K(i,`store.recomputeNodeCounts`,()=>nD(e,t,n,r))}function tD(e,t){let n=t;for(;n!=null;){let t=Y(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(eD(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&Nw(J(e,s),n,a,o),n=s}}function nD(e,t,n,r){if(!G(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=J(e,t);if(r){let t=e.instrumentation;t==null?Mw(e.snapshot.nodes,i):K(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>Mw(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,Kw(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=yE(e,t)==null?zT(e,t,n)?1+o:1:o}function rD(e,t,n){let r=q(e,t);return r.length===0?n:`${r}${n}`}function iD(e){return e!=null&&!Kw(e,4)}function aD(e,t){let n=e.snapshot.nodes[t];return!iD(n)||!G(n)||Kw(n,2)?null:n}function oD(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&iD(e.snapshot.nodes[n])&&(t+=1);return t}function sD(e){return Math.max(0,e.valueById.length-1)}function cD(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:oD(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:sD(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function lD(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function uD(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)aD(e,n)!=null&&t.push(q(e,n));for(let t of e.expandedDirectoryIds)aD(e,t)!=null&&n.push(q(e,t));return{collapsedPaths:t,expandedPaths:n}}function dD(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)aD(e,n)!=null&&HT(e,n)!==`loaded`&&t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:q(e,n)});return t}function fD(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=jE(e,n);t!=null&&BT(e,t,!0,Y(e,t))}for(let n of t.collapsedPaths){let t=jE(e,n);t!=null&&BT(e,t,!1,Y(e,t))}}function pD(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=jE(e,n.path);t!=null&&aD(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function mD(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function hD(e){let t=e.snapshot.segmentTable,n=hT();for(let r of e.snapshot.nodes)if(iD(r)){if(Kw(r,2)){r.nameId=0;continue}r.nameId=gT(n,_T(t,r.nameId))}e.snapshot.segmentTable=n}function gD(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!iD(r)||!G(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return iD(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Y(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),Mw(e.snapshot.nodes,n)}}function _D(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(iD(n))break;--t}e.snapshot.nodes.length=t+1}function vD(e){let t=uD(e),n=dD(e);K(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>mD(e)),K(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>hD(e)),K(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>gD(e)),K(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>_D(e)),K(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>fD(e,t)),K(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>pD(e,n)),K(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>kE(e,e.snapshot.rootId))}function yD(e){let t=uD(e),n=dD(e),r=K(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>SE(e)),i=Xw({...e.snapshot.options},e.instrumentation),a=K(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new PT(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,K(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>fD(e,t)),K(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>pD(e,n)),K(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>kE(e,e.snapshot.rootId))}function bD(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function xD(e,t){let n=cD(e);t===`stable`?K(e.instrumentation,`store.cleanup.stable`,()=>vD(e)):K(e.instrumentation,`store.cleanup.aggressive`,()=>yD(e));let r=cD(e);return lD(t,t===`stable`,n,r)}var SD=64;function CD(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function wD(e){return Y(e,e.snapshot.rootId).visibleSubtreeCount}function TD(e,t,n,r){let i=Y(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function ED(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:GD(e,t.cursor),setSize:t.setSize,subtreeEndIndex:TD(e,t.cursor,t.index,n)}}function DD(e,t,n,r,i,a){let o=J(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=Pw(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return OD(e,u,l,r+c,i+1,s,o.childIds.length,a)}function OD(e,t,n,r,i,a,o,s){if(!G(Y(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=zD(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Y(e,c.terminalNodeId);if(!G(l)||!zT(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return DD(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function kD(e,t){let n=wD(e);if(t<0||t>=n)return null;let r=DD(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>q(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=ED(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:GD(e,r.cursor),setSize:r.setSize,subtreeEndIndex:TD(e,r.cursor,r.index,n)}}function AD(e,t,n){let r=e.instrumentation,i=wD(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return WD(e,o+1);let t=[],n=ID(e,a);for(let r=a;r<=o&&n!=null;r++){let r=GD(e,n);t.push(r),n=VD(e,n)}return t}let s=[],c=0,l=0,u=K(r,`store.getVisibleSlice.selectFirstRow`,()=>ID(e,a));for(let t=a;t<=o&&u!=null;t++){let t=K(r,`store.getVisibleSlice.materializeRow`,()=>GD(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=K(r,`store.getVisibleSlice.advanceCursor`,()=>VD(e,u))}return Qw(r,`workload.visibleRowsRead`,s.length),Qw(r,`workload.flattenedRowsRead`,c),Qw(r,`workload.flattenedSegmentsRead`,l),s}function jD(e,t=wD(e)){let n=e.instrumentation;return n==null?UD(e,t):K(n,`store.getVisibleTreeProjection`,()=>UD(e,t))}function MD(e){return HD(jD(e))}function ND(e,t){let n=jE(e,t);if(n==null||n===e.snapshot.rootId||G(Y(e,n))&&bE(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Y(e,i).parentId,n=J(e,t),s=kw(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=Fw(a,n,s),t!==o){let n=Y(e,t),a=yE(e,t);if(!zT(e,t,n)&&a!==i)return null;bE(e,t)===t&&(r+=1)}i=t}return r}function PD(e,t){let n=jE(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return zT(e,n,r)?null:(BT(e,n,!0,r),OE(e,n),$T({affectedAncestorIds:AE(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function FD(e,t){let n=jE(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Y(e,n);if(!G(r))throw Error(`Path is not a directory: "${t}"`);return zT(e,n,r)?(BT(e,n,!1,r),OE(e,n),eE({affectedAncestorIds:AE(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function ID(e,t){return t<0||t>=wD(e)?null:LD(e,e.snapshot.rootId,t,-1)}function LD(e,t,n,r){let i=J(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?Pw(e.snapshot.nodes,i,n):K(a,`store.getVisibleSlice.selectChildIndex`,()=>Pw(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return RD(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function RD(e,t,n,r){if(!G(Y(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=zD(e,t,r);if(n===0)return i;let a=Y(e,i.terminalNodeId);if(!G(a)||!zT(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return LD(e,i.terminalNodeId,n-1,i.visibleDepth)}function zD(e,t,n){return G(Y(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:bE(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:K(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>bE(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function BD(e,t){let n=Y(e,t);if(!G(n))return!0;let r=n.parentId;return r===e.snapshot.rootId||yE(e,r)!==t}function VD(e,t){let n=Y(e,t.terminalNodeId);if(G(n)){let r=J(e,t.terminalNodeId);if(zT(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:RD(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Y(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=J(e,n),o=kw(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return RD(e,s,0,i);BD(e,r)&&i--,r=n}}function HD(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function UD(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(SD);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=CD(o,y);let x,S=_;if(G(v))S=f?bE(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:q(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&G(C)&&zT(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function WD(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!G(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:q(e,f)};continue}let h=l?bE(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=GD(e,g);let _=i[h];_!=null&&G(_)&&zT(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function GD(e,t){let n=Y(e,t.terminalNodeId),r=G(n)?KD(e,t):null,i=q(e,t.terminalNodeId),a=_T(e.snapshot.segmentTable,n.nameId),o=G(n)&&J(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?xE(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:_T(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}}):K(c,`store.getVisibleSlice.flatten.collectSegments`,()=>xE(e,t.headNodeId).map(n=>{let r=Y(e,n);return{isTerminal:n===t.terminalNodeId,name:_T(e.snapshot.segmentTable,r.nameId),nodeId:n,path:q(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:G(n)&&zT(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:G(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function KD(e,t){if(t.headNodeId===t.terminalNodeId)return HT(e,t.terminalNodeId);let n=xE(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=HT(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}var qD=8;function JD(e){let{nodes:t,directories:n,rootId:r,options:i}=e,a=t.length,o=new Int32Array(a),s=new Int32Array(a),c=new Int32Array(a),l=new Int32Array(a),u=new Int32Array(a),d=new Int32Array(a),f=new Int32Array(a);for(let e=0;e<a;e+=1){let n=t[e];n!=null&&(o[e]=n.parentId,s[e]=n.nameId,c[e]=n.depthAndFlags,l[e]=n.subtreeNodeCount,u[e]=n.visibleSubtreeCount)}let p=0;for(let e of n.values())p+=e.childIds.length;let m=new Int32Array(p),h=0;for(let[e,t]of n){let n=t.childIds;d[e]=h,f[e]=n.length;for(let e=0;e<n.length;e+=1)m[h]=n[e],h+=1}return{nodeCount:a,rootId:r,flattenEmptyDirectories:i.flattenEmptyDirectories===!0,parentId:o,nameId:s,depthAndFlags:c,subtreeNodeCount:l,visibleSubtreeCount:u,childStart:d,childCount:f,childIdsFlat:m}}function YD(e){let{nodeCount:t,rootId:n,flattenEmptyDirectories:r,depthAndFlags:i,subtreeNodeCount:a,visibleSubtreeCount:o,childStart:s,childCount:c,childIdsFlat:l}=e;for(let e=t-1;e>=1;--e){if((i[e]&qD)===0)continue;let t=s[e],n=c[e],u=0,d=0;for(let e=0;e<n;e+=1){let n=l[t+e];u+=a[n],d+=o[n]}a[e]=1+u;let f;f=r&&n===1?(i[l[t]]&qD)===0?1+d:d:1+d,o[e]=f}let u=s[n],d=c[n],f=0,p=0;for(let e=0;e<d;e+=1){let t=l[u+e];f+=a[t],p+=o[t]}a[n]=1+f,o[n]=p}function XD(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!G(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&Iw(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&G(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,Iw(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function ZD(e){let{directories:t,nodes:n,rootId:r}=e.snapshot,i=JD(e.snapshot);YD(i);let a=i.subtreeNodeCount,o=i.visibleSubtreeCount;for(let e=0;e<n.length;e+=1){let t=n[e];t!=null&&(t.subtreeNodeCount=a[e],t.visibleSubtreeCount=o[e])}for(let[e,i]of t){let t=i.childIds,a=t.length,o=0,s=0;for(let e=0;e<a;e++){let r=t[e];if(r==null)continue;let i=n[r];o+=i.subtreeNodeCount,s+=i.visibleSubtreeCount}i.totalChildSubtreeNodeCount=o,i.totalChildVisibleSubtreeCount=s,(e===r||a>=128)&&Iw(n,i)}}function QD(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var $D=class e{#e;constructor(e={}){let t=Zw(e),n=K(t,`store.builder.create`,()=>new PT(e));if(e.preparedInput!=null){let t=jT(e.preparedInput);t==null?n.appendPreparedPaths(AT(e.preparedInput),!1):n.appendPresortedPaths(t,MT(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(K(t,`store.preparePathEntries`,()=>NT(r,e)))}let r=K(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=K(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=K(t,`store.state.create`,()=>FT(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:K(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||QD(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&K(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?e.useSoaCountSweep===!0?K(t,`store.state.initializeOpenVisibleCountsViaSoa`,()=>ZD(this.#e)):K(t,`store.state.initializeOpenVisibleCounts`,()=>XD(this.#e)):K(t,`store.state.recomputeCounts`,()=>kE(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return DT(e,t)}static prepareInput(e,t={}){return OT(e,t)}static preparePresortedInput(e){return kT(e)}list(e){return K(this.#e.instrumentation,`store.list`,()=>SE(this.#e,e))}add(e){K(this.#e.instrumentation,`store.add`,()=>{let t=wD(this.#e);lE(this.#e,sE(this.#e,t,CE(this.#e,e)))})}remove(e,t={}){K(this.#e.instrumentation,`store.remove`,()=>{let n=wD(this.#e);lE(this.#e,sE(this.#e,n,wE(this.#e,e,t)))})}move(e,t,n={}){K(this.#e.instrumentation,`store.move`,()=>{let r=wD(this.#e),i=TE(this.#e,e,t,n);i!=null&&lE(this.#e,sE(this.#e,r,i))})}batch(e){cE(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision})}})}getVisibleCount(){return K(this.#e.instrumentation,`store.getVisibleCount`,()=>wD(this.#e))}getVisibleSlice(e,t){return K(this.#e.instrumentation,`store.getVisibleSlice`,()=>AD(this.#e,e,t))}getVisibleRowContext(e){return K(this.#e.instrumentation,`store.getVisibleRowContext`,()=>kD(this.#e,e))}getVisibleTreeProjection(){return MD(this.#e)}getVisibleTreeProjectionData(e){return jD(this.#e,e)}getVisibleIndex(e){return K(this.#e.instrumentation,`store.getVisibleIndex`,()=>ND(this.#e,e))}getPathInfo(e){return K(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=jE(this.#e,e);if(t==null)return null;let n=Y(this.#e,t);return{depth:Uw(n),kind:G(n)?`directory`:`file`,path:q(this.#e,t)}})}isExpanded(e){return K(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Y(this.#e,t);return zT(this.#e,t,n)})}expand(e){K(this.#e.instrumentation,`store.expand`,()=>{let t=wD(this.#e),n=PD(this.#e,e);n!=null&&lE(this.#e,sE(this.#e,t,n))})}collapse(e){K(this.#e.instrumentation,`store.collapse`,()=>{let t=wD(this.#e),n=FD(this.#e,e);n!=null&&lE(this.#e,sE(this.#e,t,n))})}on(e,t){return YT(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return HT(this.#e,t)}markDirectoryUnloaded(e){K(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(J(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=wD(this.#e);WT(this.#e,t),lE(this.#e,sE(this.#e,n,tE({affectedAncestorIds:AE(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return K(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=wD(this.#e),r=UT(this.#e,t);return lE(this.#e,sE(this.#e,n,nE({affectedAncestorIds:AE(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return K(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||HT(this.#e,n)!==`loading`||!KT(this.#e,n,e.attemptId))return!1;let r=q(this.#e,n);this.validateChildPatch(r,t);let i=wD(this.#e),a=[];for(let e of t.operations){eO(r,e);let t=wD(this.#e);switch(e.type){case`add`:a.push(sE(this.#e,t,CE(this.#e,e.path)));break;case`remove`:a.push(sE(this.#e,t,wE(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=TE(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(sE(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return lE(this.#e,sE(this.#e,i,rE({affectedAncestorIds:AE(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:q(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return K(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=wD(this.#e),r=GT(this.#e,t,e.attemptId);return lE(this.#e,sE(this.#e,n,iE({affectedAncestorIds:AE(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:q(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return K(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=wD(this.#e),i=qT(this.#e,n,e.attemptId,t);return lE(this.#e,sE(this.#e,r,aE({affectedAncestorIds:AE(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:q(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return K(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(bD(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=wD(this.#e),n=xD(this.#e,e.mode??`stable`);return lE(this.#e,sE(this.#e,t,oE({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=J(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??tT(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=rT(uT(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!G(Y(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=Y(this.#e,n);zT(this.#e,n,i)||(BT(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=Y(this.#e,e);if(!zT(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=jE(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!G(Y(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!G(Y(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=Y(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Y(this.#e,e),r=yE(this.#e,e);if(!zT(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function eO(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`)}}var tO={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function nO(e,t){if(typeof e==`number`)return{itemHeight:t??tO.default.itemHeight,factor:e};let n=tO[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var rO=tO.default.itemHeight,iO=`@layer base {
|
|
1704
|
-
:host {
|
|
1705
|
-
--trees-accent: var(--trees-accent-override, #009fff);
|
|
1706
|
-
--trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
|
|
1707
|
-
--trees-fg-muted: var(--trees-fg-muted-override, var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a)));
|
|
1708
|
-
--trees-bg: var(--trees-bg-override, var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415)));
|
|
1709
|
-
--trees-bg-muted: var(--trees-bg-muted-override, var(--trees-theme-list-hover-bg, light-dark(color-mix(in lab,
|
|
1710
|
-
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
1711
|
-
var(--trees-bg)), color-mix(in lab,
|
|
1712
|
-
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
1713
|
-
var(--trees-bg)))));
|
|
1714
|
-
--trees-input-bg: var(--trees-input-bg-override, light-dark(#f8f8f8, #070707));
|
|
1715
|
-
--trees-added-light: #16a994;
|
|
1716
|
-
--trees-added-dark: #00cab1;
|
|
1717
|
-
--trees-ignored-light: #adadb1;
|
|
1718
|
-
--trees-ignored-dark: #4a4a4e;
|
|
1719
|
-
--trees-modified-light: #1ca1c7;
|
|
1720
|
-
--trees-modified-dark: #08c0ef;
|
|
1721
|
-
--trees-renamed-light: #d5a910;
|
|
1722
|
-
--trees-renamed-dark: #ffd452;
|
|
1723
|
-
--trees-untracked-light: #16a994;
|
|
1724
|
-
--trees-untracked-dark: #00cab1;
|
|
1725
|
-
--trees-deleted-light: #ff2e3f;
|
|
1726
|
-
--trees-deleted-dark: #ff6762;
|
|
1727
|
-
--trees-border-color: var(--trees-border-color-override, var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707)));
|
|
1728
|
-
--trees-indent-guide-bg: var(--trees-indent-guide-bg-override, color-mix(in lab, var(--trees-fg-muted) 25%, transparent));
|
|
1729
|
-
--trees-density: var(--trees-density-override, 1);
|
|
1730
|
-
--trees-border-radius: var(--trees-border-radius-override, calc(6px * var(--trees-density)));
|
|
1731
|
-
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
1732
|
-
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
1733
|
-
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
1734
|
-
--trees-font-weight-semibold: var(--trees-font-weight-semibold-override, 600);
|
|
1735
|
-
--trees-focus-ring-color: var(--trees-focus-ring-color-override, var(--trees-theme-focus-ring, var(--trees-accent)));
|
|
1736
|
-
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
1737
|
-
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
1738
|
-
--trees-search-fg: var(--trees-search-fg-override, var(--trees-theme-input-fg, var(--trees-fg)));
|
|
1739
|
-
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
1740
|
-
--trees-search-bg: var(--trees-search-bg-override, var(--trees-theme-input-bg, var(--trees-input-bg)));
|
|
1741
|
-
--trees-scrollbar-thumb: var(--trees-scrollbar-thumb-override, var(--trees-theme-scrollbar-thumb, color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))));
|
|
1742
|
-
--trees-selected-fg: var(--trees-selected-fg-override, var(--trees-theme-list-active-selection-fg, var(--trees-fg)));
|
|
1743
|
-
--trees-selected-bg: var(--trees-selected-bg-override, var(--trees-theme-list-active-selection-bg, light-dark(color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)), color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg)))));
|
|
1744
|
-
--trees-selected-focused-border-color: var(--trees-selected-focused-border-color-override, var(--trees-theme-focus-ring, var(--trees-accent)));
|
|
1745
|
-
--trees-status-added: var(--trees-status-added-override, var(--trees-theme-git-added-fg, light-dark(var(--trees-added-light), var(--trees-added-dark))));
|
|
1746
|
-
--trees-status-ignored: var(--trees-status-ignored-override, var(--trees-theme-git-ignored-fg, light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))));
|
|
1747
|
-
--trees-status-modified: var(--trees-status-modified-override, var(--trees-theme-git-modified-fg, light-dark(var(--trees-modified-light), var(--trees-modified-dark))));
|
|
1748
|
-
--trees-status-renamed: var(--trees-status-renamed-override, var(--trees-theme-git-renamed-fg, light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))));
|
|
1749
|
-
--trees-status-untracked: var(--trees-status-untracked-override, var(--trees-theme-git-untracked-fg, light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))));
|
|
1750
|
-
--trees-status-deleted: var(--trees-status-deleted-override, var(--trees-theme-git-deleted-fg, light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))));
|
|
1751
|
-
--trees-git-modified-color: var(--trees-git-modified-color-override, var(--trees-status-modified));
|
|
1752
|
-
--trees-git-added-color: var(--trees-git-added-color-override, var(--trees-status-added));
|
|
1753
|
-
--trees-git-ignored-color: var(--trees-git-ignored-color-override, var(--trees-status-ignored));
|
|
1754
|
-
--trees-git-deleted-color: var(--trees-git-deleted-color-override, var(--trees-status-deleted));
|
|
1755
|
-
--trees-git-renamed-color: var(--trees-git-renamed-color-override, var(--trees-status-renamed));
|
|
1756
|
-
--trees-git-untracked-color: var(--trees-git-untracked-color-override, var(--trees-status-untracked));
|
|
1757
|
-
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
1758
|
-
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
1759
|
-
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
1760
|
-
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
1761
|
-
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
1762
|
-
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
1763
|
-
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
1764
|
-
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
1765
|
-
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
1766
|
-
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
1767
|
-
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
1768
|
-
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
1769
|
-
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
1770
|
-
--trees-file-icon-color-default: var(--trees-file-icon-color, var(--trees-icon-gray));
|
|
1771
|
-
--trees-file-icon-color-astro: var(--trees-file-icon-color, var(--trees-icon-purple));
|
|
1772
|
-
--trees-file-icon-color-babel: var(--trees-file-icon-color, var(--trees-icon-yellow));
|
|
1773
|
-
--trees-file-icon-color-bash: var(--trees-file-icon-color, var(--trees-icon-green));
|
|
1774
|
-
--trees-file-icon-color-biome: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1775
|
-
--trees-file-icon-color-bootstrap: var(--trees-file-icon-color, var(--trees-icon-indigo));
|
|
1776
|
-
--trees-file-icon-color-browserslist: var(--trees-file-icon-color, var(--trees-icon-yellow));
|
|
1777
|
-
--trees-file-icon-color-bun: var(--trees-file-icon-color, var(--trees-icon-mauve));
|
|
1778
|
-
--trees-file-icon-color-c: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1779
|
-
--trees-file-icon-color-cpp: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1780
|
-
--trees-file-icon-color-claude: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1781
|
-
--trees-file-icon-color-css: var(--trees-file-icon-color, var(--trees-icon-indigo));
|
|
1782
|
-
--trees-file-icon-color-database: var(--trees-file-icon-color, var(--trees-icon-purple));
|
|
1783
|
-
--trees-file-icon-color-docker: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1784
|
-
--trees-file-icon-color-eslint: var(--trees-file-icon-color, var(--trees-icon-indigo));
|
|
1785
|
-
--trees-file-icon-color-git: var(--trees-file-icon-vermilion, var(--trees-icon-vermilion));
|
|
1786
|
-
--trees-file-icon-color-go: var(--trees-file-icon-color, var(--trees-icon-cyan));
|
|
1787
|
-
--trees-file-icon-color-graphql: var(--trees-file-icon-color, var(--trees-icon-pink));
|
|
1788
|
-
--trees-file-icon-color-html: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1789
|
-
--trees-file-icon-color-image: var(--trees-file-icon-color, var(--trees-icon-pink));
|
|
1790
|
-
--trees-file-icon-color-javascript: var(--trees-file-icon-color, var(--trees-icon-yellow));
|
|
1791
|
-
--trees-file-icon-color-json: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1792
|
-
--trees-file-icon-color-markdown: var(--trees-file-icon-color, var(--trees-icon-green));
|
|
1793
|
-
--trees-file-icon-color-mcp: var(--trees-file-icon-color, var(--trees-icon-teal));
|
|
1794
|
-
--trees-file-icon-color-npm: var(--trees-file-icon-color, var(--trees-icon-red));
|
|
1795
|
-
--trees-file-icon-color-oxc: var(--trees-file-icon-cyan, var(--trees-icon-cyan));
|
|
1796
|
-
--trees-file-icon-color-postcss: var(--trees-file-icon-color, var(--trees-icon-red));
|
|
1797
|
-
--trees-file-icon-color-prettier: var(--trees-file-icon-color, var(--trees-icon-teal));
|
|
1798
|
-
--trees-file-icon-color-python: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1799
|
-
--trees-file-icon-color-react: var(--trees-file-icon-color, var(--trees-icon-cyan));
|
|
1800
|
-
--trees-file-icon-color-ruby: var(--trees-file-icon-color, var(--trees-icon-red));
|
|
1801
|
-
--trees-file-icon-color-rust: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1802
|
-
--trees-file-icon-color-sass: var(--trees-file-icon-color, var(--trees-icon-pink));
|
|
1803
|
-
--trees-file-icon-color-svg: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1804
|
-
--trees-file-icon-color-svelte: var(--trees-file-icon-color, var(--trees-icon-red));
|
|
1805
|
-
--trees-file-icon-color-svgo: var(--trees-file-icon-color, var(--trees-icon-green));
|
|
1806
|
-
--trees-file-icon-color-swift: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1807
|
-
--trees-file-icon-color-table: var(--trees-file-icon-color, var(--trees-icon-teal));
|
|
1808
|
-
--trees-file-icon-color-text: var(--trees-file-icon-color, var(--trees-icon-gray));
|
|
1809
|
-
--trees-file-icon-color-tailwind: var(--trees-file-icon-color, var(--trees-icon-cyan));
|
|
1810
|
-
--trees-file-icon-color-terraform: var(--trees-file-icon-color, var(--trees-icon-indigo));
|
|
1811
|
-
--trees-file-icon-color-typescript: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1812
|
-
--trees-file-icon-color-vite: var(--trees-file-icon-color, var(--trees-icon-purple));
|
|
1813
|
-
--trees-file-icon-color-vscode: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1814
|
-
--trees-file-icon-color-vue: var(--trees-file-icon-color, var(--trees-icon-green));
|
|
1815
|
-
--trees-file-icon-color-wasm: var(--trees-file-icon-color, var(--trees-icon-indigo));
|
|
1816
|
-
--trees-file-icon-color-webpack: var(--trees-file-icon-color, var(--trees-icon-blue));
|
|
1817
|
-
--trees-file-icon-color-yml: var(--trees-file-icon-color, var(--trees-icon-red));
|
|
1818
|
-
--trees-file-icon-color-zig: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1819
|
-
--trees-file-icon-color-zip: var(--trees-file-icon-color, var(--trees-icon-orange));
|
|
1820
|
-
--trees-level-gap: var(--trees-level-gap-override, calc(8px * var(--trees-density)));
|
|
1821
|
-
--trees-item-padding-x: var(--trees-item-padding-x-override, calc(8px * var(--trees-density)));
|
|
1822
|
-
--trees-item-margin-x: var(--trees-item-margin-x-override, calc(2px * var(--trees-density)));
|
|
1823
|
-
--trees-item-row-gap: var(--trees-item-row-gap-override, calc(6px * var(--trees-density)));
|
|
1824
|
-
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
1825
|
-
--trees-icon-nudge: var(--trees-icon-nudge-override, calc(1px * var(--trees-density)));
|
|
1826
|
-
--trees-row-height: var(--trees-item-height, 30px);
|
|
1827
|
-
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
1828
|
-
--trees-action-lane-width: var(--trees-action-lane-width-override, calc(var(--trees-icon-width) + 2px));
|
|
1829
|
-
--trees-context-menu-trigger-inline-offset: calc(var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
1830
|
-
var(--trees-focus-ring-width));
|
|
1831
|
-
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
1832
|
-
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
1833
|
-
color-scheme: light dark;
|
|
1834
|
-
font-size: var(--trees-font-size);
|
|
1835
|
-
color: var(--trees-fg);
|
|
1836
|
-
background-color: var(--trees-bg);
|
|
1837
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
1838
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1839
|
-
font-family: var(--trees-font-family);
|
|
1840
|
-
font-weight: var(--trees-font-weight-regular);
|
|
1841
|
-
flex-direction: column;
|
|
1842
|
-
display: flex;
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
:host([data-file-tree-virtualized="true"]) {
|
|
1846
|
-
height: 100%;
|
|
1847
|
-
overflow: hidden;
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
[data-file-tree-virtualized-wrapper="true"], [data-file-tree-virtualized-root="true"] {
|
|
1851
|
-
flex-direction: column;
|
|
1852
|
-
height: 100%;
|
|
1853
|
-
display: flex;
|
|
1854
|
-
overflow: hidden;
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
[data-file-tree-virtualized-scroll="true"], [data-file-tree-scrollbar-measure="true"] {
|
|
1858
|
-
--trees-scrollbar-thumb-current: transparent;
|
|
1859
|
-
scrollbar-gutter: stable;
|
|
1860
|
-
overflow-y: auto;
|
|
1861
|
-
|
|
1862
|
-
&:hover {
|
|
1863
|
-
--trees-scrollbar-thumb-current: var(--trees-scrollbar-thumb);
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
&::-webkit-scrollbar {
|
|
1867
|
-
width: var(--trees-scrollbar-gutter);
|
|
1868
|
-
height: var(--trees-scrollbar-gutter);
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
&::-webkit-scrollbar-track {
|
|
1872
|
-
background: none;
|
|
1873
|
-
}
|
|
1874
|
-
|
|
1875
|
-
&::-webkit-scrollbar-thumb {
|
|
1876
|
-
background-color: var(--trees-scrollbar-thumb-current);
|
|
1877
|
-
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
1878
|
-
background-clip: content-box;
|
|
1879
|
-
border: 1px solid #0000;
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
&::-webkit-scrollbar-corner {
|
|
1883
|
-
background-color: #0000;
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
[data-file-tree-scrollbar-measure="true"] {
|
|
1888
|
-
visibility: hidden;
|
|
1889
|
-
pointer-events: none;
|
|
1890
|
-
width: 100px;
|
|
1891
|
-
height: 100px;
|
|
1892
|
-
position: absolute;
|
|
1893
|
-
top: 0;
|
|
1894
|
-
left: 0;
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
@supports ((-moz-appearance: none)) {
|
|
1898
|
-
[data-file-tree-virtualized-scroll="true"], [data-file-tree-scrollbar-measure="true"] {
|
|
1899
|
-
scrollbar-width: thin;
|
|
1900
|
-
scrollbar-color: var(--trees-scrollbar-thumb-current) transparent;
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
[data-file-tree-virtualized-scroll="true"] {
|
|
1905
|
-
min-height: 0;
|
|
1906
|
-
padding-inline: max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
1907
|
-
0px)
|
|
1908
|
-
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
1909
|
-
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
1910
|
-
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
1911
|
-
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
1912
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
1913
|
-
*/
|
|
1914
|
-
max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
1915
|
-
var(--trees-scrollbar-gutter-measured, var(--trees-scrollbar-gutter))),
|
|
1916
|
-
0px);
|
|
1917
|
-
flex: 1 1 0;
|
|
1918
|
-
position: relative;
|
|
1919
|
-
overflow-y: auto;
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
@supports ((-moz-appearance: none)) {
|
|
1923
|
-
[data-file-tree-virtualized-scroll="true"] {
|
|
1924
|
-
padding-inline: max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
1925
|
-
0px)
|
|
1926
|
-
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
1927
|
-
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
1928
|
-
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
1929
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
1930
|
-
*/
|
|
1931
|
-
max(calc(var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
1932
|
-
var(--trees-scrollbar-gutter-measured, 0px)),
|
|
1933
|
-
0px);
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
[data-file-tree-sticky-overlay="true"] {
|
|
1938
|
-
z-index: 4;
|
|
1939
|
-
pointer-events: none;
|
|
1940
|
-
height: 0;
|
|
1941
|
-
position: sticky;
|
|
1942
|
-
top: 0;
|
|
1943
|
-
overflow: visible;
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
[data-file-tree-virtualized-root="true"][data-scroll-at-top="true"]:not([data-overlay-reveal]) [data-file-tree-sticky-overlay="true"] {
|
|
1947
|
-
visibility: hidden;
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
[data-file-tree-sticky-overlay-content="true"] {
|
|
1951
|
-
background-color: var(--trees-bg);
|
|
1952
|
-
pointer-events: none;
|
|
1953
|
-
position: relative;
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
[data-file-tree-virtualized-list="true"] {
|
|
1957
|
-
background-color: var(--trees-bg);
|
|
1958
|
-
overflow-anchor: none;
|
|
1959
|
-
width: 100%;
|
|
1960
|
-
min-height: 100%;
|
|
1961
|
-
position: relative;
|
|
1962
|
-
|
|
1963
|
-
&[data-is-scrolling] {
|
|
1964
|
-
pointer-events: none;
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
[data-file-tree-virtualized-sticky-offset="true"] {
|
|
1969
|
-
contain: layout size;
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
[data-file-tree-virtualized-sticky="true"] {
|
|
1973
|
-
isolation: isolate;
|
|
1974
|
-
will-change: transform;
|
|
1975
|
-
flex-direction: column;
|
|
1976
|
-
width: 100%;
|
|
1977
|
-
display: flex;
|
|
1978
|
-
position: sticky;
|
|
1979
|
-
top: 0;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
[data-file-tree-search-container] {
|
|
1983
|
-
padding: 0;
|
|
1984
|
-
padding-inline: var(--trees-padding-inline);
|
|
1985
|
-
margin-bottom: var(--trees-item-row-gap);
|
|
1986
|
-
display: flex;
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
[data-file-tree-search-input] {
|
|
1990
|
-
--trees-focus-ring-width: 2px;
|
|
1991
|
-
font-family: var(--trees-font-family);
|
|
1992
|
-
font-size: var(--trees-font-size);
|
|
1993
|
-
height: var(--trees-row-height);
|
|
1994
|
-
padding-inline: var(--trees-item-padding-x);
|
|
1995
|
-
line-height: var(--trees-row-height);
|
|
1996
|
-
color: var(--trees-search-fg);
|
|
1997
|
-
background-color: var(--trees-search-bg);
|
|
1998
|
-
border: 1px solid var(--trees-border-color);
|
|
1999
|
-
border-radius: var(--trees-border-radius);
|
|
2000
|
-
outline: none;
|
|
2001
|
-
flex: 1;
|
|
2002
|
-
margin-block: 1px;
|
|
2003
|
-
|
|
2004
|
-
&::placeholder {
|
|
2005
|
-
color: color-mix(in lab,
|
|
2006
|
-
var(--trees-search-fg) 65%,
|
|
2007
|
-
var(--trees-search-bg));
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2010
|
-
&:focus-visible, &[data-file-tree-search-input-fake-focus="true"] {
|
|
2011
|
-
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
2012
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
2013
|
-
}
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
[role="tree"] {
|
|
2017
|
-
gap: var(--trees-gap-override, 0);
|
|
2018
|
-
flex-direction: column;
|
|
2019
|
-
display: flex;
|
|
2020
|
-
position: relative;
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
[data-type="item"] {
|
|
2024
|
-
color: inherit;
|
|
2025
|
-
font-family: var(--trees-font-family);
|
|
2026
|
-
font-size: var(--trees-font-size);
|
|
2027
|
-
text-align: start;
|
|
2028
|
-
background-color: var(--trees-bg);
|
|
2029
|
-
padding: 0 var(--trees-item-padding-x);
|
|
2030
|
-
margin: 0 var(--trees-item-margin-x);
|
|
2031
|
-
cursor: pointer;
|
|
2032
|
-
user-select: none;
|
|
2033
|
-
-webkit-touch-callout: none;
|
|
2034
|
-
touch-action: manipulation;
|
|
2035
|
-
flex: 0 0 var(--trees-row-height);
|
|
2036
|
-
height: var(--trees-row-height);
|
|
2037
|
-
line-height: var(--trees-row-height);
|
|
2038
|
-
align-items: center;
|
|
2039
|
-
gap: var(--trees-item-row-gap);
|
|
2040
|
-
border-radius: var(--trees-border-radius);
|
|
2041
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
2042
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
2043
|
-
--truncate-marker-block-inset: 0px;
|
|
2044
|
-
border: none;
|
|
2045
|
-
outline: none;
|
|
2046
|
-
display: flex;
|
|
2047
|
-
position: relative;
|
|
2048
|
-
|
|
2049
|
-
&:hover, &[data-item-context-hover="true"] {
|
|
2050
|
-
background-color: var(--trees-bg-muted);
|
|
2051
|
-
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
2052
|
-
}
|
|
2053
|
-
|
|
2054
|
-
&[data-item-focused="true"], &:focus-visible {
|
|
2055
|
-
z-index: 2;
|
|
2056
|
-
|
|
2057
|
-
& [data-item-flattened-subitems] {
|
|
2058
|
-
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
&:before {
|
|
2062
|
-
content: "";
|
|
2063
|
-
border-radius: var(--trees-border-radius);
|
|
2064
|
-
outline: var(--trees-focus-ring-width) solid
|
|
2065
|
-
var(--trees-focus-ring-color);
|
|
2066
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
2067
|
-
pointer-events: none;
|
|
2068
|
-
display: block;
|
|
2069
|
-
position: absolute;
|
|
2070
|
-
inset: 0;
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
&[data-item-selected="true"]:before {
|
|
2074
|
-
outline-color: var(--trees-selected-focused-border-color);
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
&[data-item-selected="true"] {
|
|
2079
|
-
color: var(--trees-selected-fg);
|
|
2080
|
-
background-color: var(--trees-selected-bg);
|
|
2081
|
-
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
2082
|
-
z-index: 3;
|
|
2083
|
-
|
|
2084
|
-
& [data-item-section="icon"] {
|
|
2085
|
-
color: var(--trees-selected-fg);
|
|
2086
|
-
}
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
&[data-item-search-match="true"] {
|
|
2090
|
-
font-weight: var(--trees-search-font-weight);
|
|
2091
|
-
}
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
[data-type="item"][data-file-tree-sticky-row="true"] {
|
|
2095
|
-
pointer-events: auto;
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
[data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"] {
|
|
2099
|
-
pointer-events: none;
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
|
-
[data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"]:hover:not([data-item-selected="true"]), [data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="item"][data-file-tree-sticky-row="true"][data-item-context-hover="true"]:not([data-item-selected="true"]) {
|
|
2103
|
-
background-color: var(--trees-bg);
|
|
2104
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
[data-item-selected="true"]:has( + [data-item-selected="true"]) {
|
|
2108
|
-
border-bottom-right-radius: 0;
|
|
2109
|
-
border-bottom-left-radius: 0;
|
|
2110
|
-
}
|
|
2111
|
-
|
|
2112
|
-
[data-item-selected="true"] + [data-item-selected="true"] {
|
|
2113
|
-
border-top-left-radius: 0;
|
|
2114
|
-
border-top-right-radius: 0;
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
[data-item-flattened-subitems] {
|
|
2118
|
-
align-items: center;
|
|
2119
|
-
gap: 2px;
|
|
2120
|
-
display: inline-flex;
|
|
2121
|
-
}
|
|
2122
|
-
|
|
2123
|
-
[data-item-flattened-subitem]:hover, [data-item-flattened-subitem-drag-target="true"] {
|
|
2124
|
-
text-decoration: underline;
|
|
2125
|
-
}
|
|
2126
|
-
|
|
2127
|
-
[data-item-section="icon"] {
|
|
2128
|
-
color: var(--trees-fg-muted);
|
|
2129
|
-
fill: currentColor;
|
|
2130
|
-
width: var(--trees-icon-width);
|
|
2131
|
-
flex-shrink: 0;
|
|
2132
|
-
justify-content: center;
|
|
2133
|
-
align-items: center;
|
|
2134
|
-
display: flex;
|
|
2135
|
-
}
|
|
2136
|
-
|
|
2137
|
-
:where([data-item-section="icon"] > [data-icon-token]) {
|
|
2138
|
-
color: var(--trees-fg-muted);
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
[data-file-tree-colored-icons="true"] {
|
|
2142
|
-
& [data-icon-token="astro"] {
|
|
2143
|
-
color: var(--trees-file-icon-color-astro);
|
|
2144
|
-
}
|
|
2145
|
-
|
|
2146
|
-
& [data-icon-token="babel"] {
|
|
2147
|
-
color: var(--trees-file-icon-color-babel);
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
|
-
& [data-icon-token="bash"] {
|
|
2151
|
-
color: var(--trees-file-icon-color-bash);
|
|
2152
|
-
}
|
|
2153
|
-
|
|
2154
|
-
& [data-icon-token="biome"] {
|
|
2155
|
-
color: var(--trees-file-icon-color-biome);
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
& [data-icon-token="bootstrap"] {
|
|
2159
|
-
color: var(--trees-file-icon-color-bootstrap);
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
& [data-icon-token="browserslist"] {
|
|
2163
|
-
color: var(--trees-file-icon-color-browserslist);
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
& [data-icon-token="bun"] {
|
|
2167
|
-
color: var(--trees-file-icon-color-bun);
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
& [data-icon-token="c"] {
|
|
2171
|
-
color: var(--trees-file-icon-color-c);
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2174
|
-
& [data-icon-token="cpp"] {
|
|
2175
|
-
color: var(--trees-file-icon-color-cpp);
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
& [data-icon-token="claude"] {
|
|
2179
|
-
color: var(--trees-file-icon-color-claude);
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
& [data-icon-token="css"] {
|
|
2183
|
-
color: var(--trees-file-icon-color-css);
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
& [data-icon-token="database"] {
|
|
2187
|
-
color: var(--trees-file-icon-color-database);
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
& [data-icon-token="default"] {
|
|
2191
|
-
color: var(--trees-file-icon-color-default);
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
& [data-icon-token="docker"] {
|
|
2195
|
-
color: var(--trees-file-icon-color-docker);
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
& [data-icon-token="eslint"] {
|
|
2199
|
-
color: var(--trees-file-icon-color-eslint);
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
& [data-icon-token="git"] {
|
|
2203
|
-
color: var(--trees-file-icon-color-git);
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
& [data-icon-token="go"] {
|
|
2207
|
-
color: var(--trees-file-icon-color-go);
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
& [data-icon-token="graphql"] {
|
|
2211
|
-
color: var(--trees-file-icon-color-graphql);
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
|
-
& [data-icon-token="html"] {
|
|
2215
|
-
color: var(--trees-file-icon-color-html);
|
|
2216
|
-
}
|
|
2217
|
-
|
|
2218
|
-
& [data-icon-token="image"] {
|
|
2219
|
-
color: var(--trees-file-icon-color-image);
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
& [data-icon-token="javascript"] {
|
|
2223
|
-
color: var(--trees-file-icon-color-javascript);
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
& [data-icon-token="json"] {
|
|
2227
|
-
color: var(--trees-file-icon-color-json);
|
|
2228
|
-
}
|
|
2229
|
-
|
|
2230
|
-
& [data-icon-token="markdown"] {
|
|
2231
|
-
color: var(--trees-file-icon-color-markdown);
|
|
2232
|
-
}
|
|
2233
|
-
|
|
2234
|
-
& [data-icon-token="mcp"] {
|
|
2235
|
-
color: var(--trees-file-icon-color-mcp);
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
& [data-icon-token="npm"] {
|
|
2239
|
-
color: var(--trees-file-icon-color-npm);
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
& [data-icon-token="oxc"] {
|
|
2243
|
-
color: var(--trees-file-icon-color-oxc);
|
|
2244
|
-
}
|
|
2245
|
-
|
|
2246
|
-
& [data-icon-token="postcss"] {
|
|
2247
|
-
color: var(--trees-file-icon-color-postcss);
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
& [data-icon-token="prettier"] {
|
|
2251
|
-
color: var(--trees-file-icon-color-prettier);
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
& [data-icon-token="python"] {
|
|
2255
|
-
color: var(--trees-file-icon-color-python);
|
|
2256
|
-
}
|
|
2257
|
-
|
|
2258
|
-
& [data-icon-token="react"] {
|
|
2259
|
-
color: var(--trees-file-icon-color-react);
|
|
2260
|
-
}
|
|
2261
|
-
|
|
2262
|
-
& [data-icon-token="ruby"] {
|
|
2263
|
-
color: var(--trees-file-icon-color-ruby);
|
|
2264
|
-
}
|
|
2265
|
-
|
|
2266
|
-
& [data-icon-token="rust"] {
|
|
2267
|
-
color: var(--trees-file-icon-color-rust);
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
& [data-icon-token="sass"] {
|
|
2271
|
-
color: var(--trees-file-icon-color-sass);
|
|
2272
|
-
}
|
|
2273
|
-
|
|
2274
|
-
& [data-icon-token="svg"] {
|
|
2275
|
-
color: var(--trees-file-icon-color-svg);
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
& [data-icon-token="svelte"] {
|
|
2279
|
-
color: var(--trees-file-icon-color-svelte);
|
|
2280
|
-
}
|
|
2281
|
-
|
|
2282
|
-
& [data-icon-token="svgo"] {
|
|
2283
|
-
color: var(--trees-file-icon-color-svgo);
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
& [data-icon-token="swift"] {
|
|
2287
|
-
color: var(--trees-file-icon-color-swift);
|
|
2288
|
-
}
|
|
2289
|
-
|
|
2290
|
-
& [data-icon-token="table"] {
|
|
2291
|
-
color: var(--trees-file-icon-color-table);
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
& [data-icon-token="text"] {
|
|
2295
|
-
color: var(--trees-file-icon-color-text);
|
|
2296
|
-
}
|
|
2297
|
-
|
|
2298
|
-
& [data-icon-token="tailwind"] {
|
|
2299
|
-
color: var(--trees-file-icon-color-tailwind);
|
|
2300
|
-
}
|
|
2301
|
-
|
|
2302
|
-
& [data-icon-token="terraform"] {
|
|
2303
|
-
color: var(--trees-file-icon-color-terraform);
|
|
2304
|
-
}
|
|
2305
|
-
|
|
2306
|
-
& [data-icon-token="typescript"] {
|
|
2307
|
-
color: var(--trees-file-icon-color-typescript);
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
& [data-icon-token="vite"] {
|
|
2311
|
-
color: var(--trees-file-icon-color-vite);
|
|
2312
|
-
}
|
|
2313
|
-
|
|
2314
|
-
& [data-icon-token="vscode"] {
|
|
2315
|
-
color: var(--trees-file-icon-color-vscode);
|
|
2316
|
-
}
|
|
2317
|
-
|
|
2318
|
-
& [data-icon-token="vue"] {
|
|
2319
|
-
color: var(--trees-file-icon-color-vue);
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
& [data-icon-token="wasm"] {
|
|
2323
|
-
color: var(--trees-file-icon-color-wasm);
|
|
2324
|
-
}
|
|
2325
|
-
|
|
2326
|
-
& [data-icon-token="webpack"] {
|
|
2327
|
-
color: var(--trees-file-icon-color-webpack);
|
|
2328
|
-
}
|
|
2329
|
-
|
|
2330
|
-
& [data-icon-token="yml"] {
|
|
2331
|
-
color: var(--trees-file-icon-color-yml);
|
|
2332
|
-
}
|
|
2333
|
-
|
|
2334
|
-
& [data-icon-token="zig"] {
|
|
2335
|
-
color: var(--trees-file-icon-color-zig);
|
|
2336
|
-
}
|
|
2337
|
-
|
|
2338
|
-
& [data-icon-token="zip"] {
|
|
2339
|
-
color: var(--trees-file-icon-color-zip);
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
[data-icon-name="file-tree-icon-chevron"] {
|
|
2344
|
-
&[data-align-capitals="false"] {
|
|
2345
|
-
transform: translate(0, var(--trees-icon-nudge));
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
|
-
&[data-align-capitals="true"] {
|
|
2349
|
-
transform: translate(0);
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
|
-
|
|
2353
|
-
[data-item-section="content"] {
|
|
2354
|
-
text-align: start;
|
|
2355
|
-
text-overflow: ellipsis;
|
|
2356
|
-
flex: 0 auto;
|
|
2357
|
-
min-width: 0;
|
|
2358
|
-
max-width: 100%;
|
|
2359
|
-
overflow: hidden;
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
[data-item-section="decoration"] {
|
|
2363
|
-
text-align: end;
|
|
2364
|
-
min-width: 0;
|
|
2365
|
-
color: var(--trees-fg-muted);
|
|
2366
|
-
flex: 1 1 0;
|
|
2367
|
-
justify-content: flex-end;
|
|
2368
|
-
display: flex;
|
|
2369
|
-
overflow: hidden;
|
|
2370
|
-
}
|
|
2371
|
-
|
|
2372
|
-
[data-item-section="decoration"] > span {
|
|
2373
|
-
text-overflow: ellipsis;
|
|
2374
|
-
white-space: nowrap;
|
|
2375
|
-
justify-content: flex-end;
|
|
2376
|
-
align-items: center;
|
|
2377
|
-
min-width: 0;
|
|
2378
|
-
max-width: 100%;
|
|
2379
|
-
display: inline-flex;
|
|
2380
|
-
overflow: hidden;
|
|
2381
|
-
}
|
|
2382
|
-
|
|
2383
|
-
[data-item-section="git"], [data-item-section="action"] {
|
|
2384
|
-
flex: none;
|
|
2385
|
-
justify-content: center;
|
|
2386
|
-
align-items: center;
|
|
2387
|
-
display: flex;
|
|
2388
|
-
}
|
|
2389
|
-
|
|
2390
|
-
[data-item-section="git"] {
|
|
2391
|
-
width: var(--trees-git-lane-width);
|
|
2392
|
-
}
|
|
2393
|
-
|
|
2394
|
-
[data-item-section="action"] {
|
|
2395
|
-
width: var(--trees-action-lane-width);
|
|
2396
|
-
color: var(--trees-fg-muted);
|
|
2397
|
-
fill: currentColor;
|
|
2398
|
-
pointer-events: none;
|
|
2399
|
-
}
|
|
2400
|
-
|
|
2401
|
-
[data-item-section="git"] > span, [data-item-section="action"] > span {
|
|
2402
|
-
justify-content: center;
|
|
2403
|
-
align-items: center;
|
|
2404
|
-
width: 100%;
|
|
2405
|
-
display: inline-flex;
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
[data-item-action-affordance="decorative"] {
|
|
2409
|
-
opacity: .85;
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2412
|
-
[data-item-rename-input] {
|
|
2413
|
-
appearance: none;
|
|
2414
|
-
width: 100%;
|
|
2415
|
-
min-width: 0;
|
|
2416
|
-
height: calc(var(--trees-row-height) - 4px);
|
|
2417
|
-
font-family: inherit;
|
|
2418
|
-
font-size: inherit;
|
|
2419
|
-
color: inherit;
|
|
2420
|
-
box-sizing: border-box;
|
|
2421
|
-
background-color: #0000;
|
|
2422
|
-
border: 0;
|
|
2423
|
-
outline: none;
|
|
2424
|
-
padding-inline: 6px;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
[data-item-section="content"]:has([data-item-rename-input]) ~ [data-item-section="action"], [data-item-section="content"]:has([data-item-rename-input]) ~ [data-item-section="decoration"] {
|
|
2428
|
-
display: none;
|
|
2429
|
-
}
|
|
2430
|
-
|
|
2431
|
-
[aria-expanded="false"][data-item-type="folder"] > [data-item-section="icon"] > [data-icon-name="file-tree-icon-chevron"] {
|
|
2432
|
-
&[data-align-capitals="true"] {
|
|
2433
|
-
transform: rotate(-90deg)
|
|
2434
|
-
translate(calc(var(--trees-icon-nudge) / 2),
|
|
2435
|
-
calc(var(--trees-icon-nudge) / 2));
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
&[data-align-capitals="false"] {
|
|
2439
|
-
transform: rotate(-90deg)
|
|
2440
|
-
translate(calc(var(--trees-icon-nudge) / 2 * -1),
|
|
2441
|
-
calc(var(--trees-icon-nudge) / 2));
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
[data-item-section="spacing"] {
|
|
2446
|
-
height: var(--trees-row-height);
|
|
2447
|
-
padding-left: calc(calc(var(--trees-icon-width) / 2) - .5px);
|
|
2448
|
-
flex-direction: row;
|
|
2449
|
-
justify-content: center;
|
|
2450
|
-
align-items: center;
|
|
2451
|
-
display: flex;
|
|
2452
|
-
|
|
2453
|
-
&:empty {
|
|
2454
|
-
padding-left: 0;
|
|
2455
|
-
}
|
|
2456
|
-
}
|
|
2457
|
-
|
|
2458
|
-
[data-item-section="spacing-item"] {
|
|
2459
|
-
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
2460
|
-
height: 100%;
|
|
2461
|
-
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
2462
|
-
opacity: 0;
|
|
2463
|
-
transition: opacity .15s;
|
|
2464
|
-
display: inline-block;
|
|
2465
|
-
transform: translateX(-.25px);
|
|
2466
|
-
|
|
2467
|
-
& + & {
|
|
2468
|
-
margin-left: calc(var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - .5px);
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
:host(:hover) [data-item-section="spacing-item"] {
|
|
2473
|
-
opacity: .75;
|
|
2474
|
-
}
|
|
2475
|
-
|
|
2476
|
-
[data-item-contains-git-change="true"] > [data-item-section="git"] {
|
|
2477
|
-
color: var(--trees-git-modified-color);
|
|
2478
|
-
opacity: .5;
|
|
2479
|
-
fill: currentColor;
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
[data-item-git-status] {
|
|
2483
|
-
& > :where([data-item-section="icon"]) > :where(:not([data-icon-name="file-tree-icon-chevron"])), & > [data-item-section="content"] {
|
|
2484
|
-
color: var(--trees-item-git-status-color);
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2487
|
-
& > [data-item-section="git"] {
|
|
2488
|
-
color: var(--trees-item-git-status-color);
|
|
2489
|
-
font-weight: var(--trees-font-weight-semibold);
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
|
-
[data-item-git-status="added"] {
|
|
2494
|
-
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
2495
|
-
}
|
|
2496
|
-
|
|
2497
|
-
[data-item-git-status="deleted"] {
|
|
2498
|
-
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
[data-item-git-status="ignored"] {
|
|
2502
|
-
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
2503
|
-
|
|
2504
|
-
& > [data-item-section="icon"] {
|
|
2505
|
-
opacity: .5;
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
|
|
2509
|
-
[data-item-section="git"] [data-icon-name="file-tree-icon-dot"] {
|
|
2510
|
-
transform: translateY(calc(.65ex - 50%));
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
[data-item-git-status="modified"] {
|
|
2514
|
-
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
2515
|
-
}
|
|
2516
|
-
|
|
2517
|
-
[data-item-git-status="renamed"] {
|
|
2518
|
-
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
[data-item-git-status="untracked"] {
|
|
2522
|
-
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
2523
|
-
}
|
|
2524
|
-
|
|
2525
|
-
[data-item-drag-target="true"] {
|
|
2526
|
-
background-color: var(--trees-selected-bg);
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
[data-item-dragging="true"] {
|
|
2530
|
-
opacity: .5;
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
[data-item-section="lock"] {
|
|
2534
|
-
color: var(--trees-fg-muted);
|
|
2535
|
-
flex: none;
|
|
2536
|
-
align-items: center;
|
|
2537
|
-
margin-left: auto;
|
|
2538
|
-
display: flex;
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
[data-item-section="lock"] svg {
|
|
2542
|
-
display: block;
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2545
|
-
[data-type="header-slot"] {
|
|
2546
|
-
flex: none;
|
|
2547
|
-
display: block;
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
[data-type="context-menu-wash"] {
|
|
2551
|
-
z-index: 3;
|
|
2552
|
-
touch-action: none;
|
|
2553
|
-
background-color: #0000;
|
|
2554
|
-
position: absolute;
|
|
2555
|
-
inset: 0;
|
|
2556
|
-
}
|
|
2557
|
-
|
|
2558
|
-
[data-type="context-menu-anchor"] {
|
|
2559
|
-
top: 0;
|
|
2560
|
-
right: var(--trees-context-menu-trigger-inline-offset);
|
|
2561
|
-
z-index: 4;
|
|
2562
|
-
align-items: center;
|
|
2563
|
-
display: none;
|
|
2564
|
-
position: absolute;
|
|
2565
|
-
|
|
2566
|
-
&[data-visible="true"] {
|
|
2567
|
-
display: flex;
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
|
|
2571
|
-
[data-file-tree-virtualized-root="true"][data-is-scrolling] [data-type="context-menu-anchor"] {
|
|
2572
|
-
display: none;
|
|
2573
|
-
}
|
|
2574
|
-
|
|
2575
|
-
[data-type="context-menu-anchor"] > slot[name="context-menu"] {
|
|
2576
|
-
flex: 0 0 0;
|
|
2577
|
-
width: 0;
|
|
2578
|
-
min-width: 0;
|
|
2579
|
-
display: block;
|
|
2580
|
-
overflow: visible;
|
|
2581
|
-
}
|
|
2582
|
-
|
|
2583
|
-
[data-type="context-menu-trigger"] {
|
|
2584
|
-
all: unset;
|
|
2585
|
-
width: var(--trees-action-lane-width);
|
|
2586
|
-
color: var(--trees-fg-muted);
|
|
2587
|
-
fill: currentColor;
|
|
2588
|
-
cursor: pointer;
|
|
2589
|
-
font-family: var(--trees-font-family);
|
|
2590
|
-
font-size: var(--trees-font-size);
|
|
2591
|
-
border-top-right-radius: var(--trees-border-radius);
|
|
2592
|
-
border-bottom-right-radius: var(--trees-border-radius);
|
|
2593
|
-
margin: var(--trees-focus-ring-width);
|
|
2594
|
-
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
2595
|
-
border-width: 0;
|
|
2596
|
-
justify-content: center;
|
|
2597
|
-
align-items: center;
|
|
2598
|
-
transition: color .12s;
|
|
2599
|
-
display: flex;
|
|
2600
|
-
}
|
|
2601
|
-
|
|
2602
|
-
[data-type="context-menu-trigger"]:hover, [data-type="context-menu-trigger"][aria-expanded="true"] {
|
|
2603
|
-
color: var(--trees-fg);
|
|
2604
|
-
}
|
|
2605
|
-
|
|
2606
|
-
[data-truncate-container] {
|
|
2607
|
-
--truncate-internal-marker-fade-width: var(--truncate-marker-fade-width, 2px);
|
|
2608
|
-
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
2609
|
-
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
2610
|
-
--truncate-internal-middle-marker-opacity: var(--truncate-middle-marker-opacity, 80%);
|
|
2611
|
-
--truncate-internal-marker-background-color: var(--truncate-marker-background-color, light-dark(#fff, #000));
|
|
2612
|
-
--truncate-internal-marker-background-overlay-color: var(--truncate-marker-background-overlay-color, transparent);
|
|
2613
|
-
--truncate-internal-marker-block-inset: var(--truncate-marker-block-inset, 0px);
|
|
2614
|
-
--truncate-internal-marker-fade-out-duration: var(--truncate-marker-fade-out-duration, 0s);
|
|
2615
|
-
--truncate-internal-marker-fade-in-duration: var(--truncate-marker-fade-in-duration, .1s);
|
|
2616
|
-
--truncate-internal-fade-marker-color: var(--truncate-fade-marker-color, #000);
|
|
2617
|
-
--truncate-internal-fade-marker-width: var(--truncate-fade-marker-width, .2lh);
|
|
2618
|
-
--truncate-internal-single-line-height: 1lh;
|
|
2619
|
-
height: var(--truncate-internal-single-line-height);
|
|
2620
|
-
min-width: 0;
|
|
2621
|
-
margin-top: -1px;
|
|
2622
|
-
margin-bottom: -1px;
|
|
2623
|
-
overflow: hidden;
|
|
2624
|
-
}
|
|
2625
|
-
|
|
2626
|
-
[data-truncate-marker] {
|
|
2627
|
-
height: var(--truncate-internal-single-line-height);
|
|
2628
|
-
padding-block: var(--truncate-internal-marker-block-inset);
|
|
2629
|
-
box-sizing: border-box;
|
|
2630
|
-
z-index: 2;
|
|
2631
|
-
color: color-mix(in srgb,
|
|
2632
|
-
currentColor var(--truncate-internal-marker-opacity),
|
|
2633
|
-
transparent);
|
|
2634
|
-
opacity: 0;
|
|
2635
|
-
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
2636
|
-
ease-in-out;
|
|
2637
|
-
background-clip: content-box;
|
|
2638
|
-
align-items: center;
|
|
2639
|
-
display: flex;
|
|
2640
|
-
position: absolute;
|
|
2641
|
-
}
|
|
2642
|
-
|
|
2643
|
-
@container measure (height > 1lh) {
|
|
2644
|
-
[data-truncate-marker] {
|
|
2645
|
-
opacity: 1;
|
|
2646
|
-
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
2647
|
-
ease-in-out;
|
|
2648
|
-
}
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
[data-truncate-grid] {
|
|
2652
|
-
display: grid;
|
|
2653
|
-
position: relative;
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
[data-truncate-content="visible"] {
|
|
2657
|
-
white-space: nowrap;
|
|
2658
|
-
}
|
|
2659
|
-
|
|
2660
|
-
[data-truncate-content="overflow"] {
|
|
2661
|
-
opacity: 0;
|
|
2662
|
-
pointer-events: none;
|
|
2663
|
-
user-select: none;
|
|
2664
|
-
word-break: break-all;
|
|
2665
|
-
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
[data-truncate-marker-cell] {
|
|
2669
|
-
user-select: none;
|
|
2670
|
-
pointer-events: none;
|
|
2671
|
-
overflow: visible;
|
|
2672
|
-
container: measure / size;
|
|
2673
|
-
}
|
|
2674
|
-
|
|
2675
|
-
[data-truncate-container="truncate"] {
|
|
2676
|
-
& [data-truncate-grid] {
|
|
2677
|
-
grid-template-columns: minmax(0, max-content) 0;
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
& [data-truncate-marker] {
|
|
2681
|
-
right: 0;
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
& [data-truncate-fade] {
|
|
2685
|
-
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
|
|
2689
|
-
[data-truncate-container="fruncate"] {
|
|
2690
|
-
& [data-truncate-grid] {
|
|
2691
|
-
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
2692
|
-
}
|
|
2693
|
-
|
|
2694
|
-
& [data-truncate-content] {
|
|
2695
|
-
direction: rtl;
|
|
2696
|
-
}
|
|
2697
|
-
|
|
2698
|
-
& [data-truncate-content] > span {
|
|
2699
|
-
unicode-bidi: plaintext;
|
|
2700
|
-
}
|
|
2701
|
-
|
|
2702
|
-
& [data-truncate-fade] {
|
|
2703
|
-
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
|
|
2707
|
-
[data-truncate-variant="default"] {
|
|
2708
|
-
& [data-truncate-marker] {
|
|
2709
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
2710
|
-
background-image: linear-gradient(var(--truncate-internal-marker-background-overlay-color),
|
|
2711
|
-
var(--truncate-internal-marker-background-overlay-color));
|
|
2712
|
-
}
|
|
2713
|
-
|
|
2714
|
-
& [data-truncate-marker]:after, & [data-truncate-marker]:before {
|
|
2715
|
-
content: "";
|
|
2716
|
-
width: calc(var(--truncate-internal-marker-fade-width) +
|
|
2717
|
-
var(--truncate-internal-marker-gap));
|
|
2718
|
-
height: max(0px,
|
|
2719
|
-
calc(var(--truncate-internal-single-line-height) -
|
|
2720
|
-
var(--truncate-internal-marker-block-inset) * 2));
|
|
2721
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
2722
|
-
background-image: linear-gradient(var(--truncate-internal-marker-background-overlay-color),
|
|
2723
|
-
var(--truncate-internal-marker-background-overlay-color));
|
|
2724
|
-
-webkit-mask-image: linear-gradient(var(--truncate-internal-fade-dir),
|
|
2725
|
-
#000 0%,
|
|
2726
|
-
#000 var(--truncate-internal-marker-gap),
|
|
2727
|
-
transparent 100%);
|
|
2728
|
-
mask-image: linear-gradient(var(--truncate-internal-fade-dir),
|
|
2729
|
-
#000 0%,
|
|
2730
|
-
#000 var(--truncate-internal-marker-gap),
|
|
2731
|
-
transparent 100%);
|
|
2732
|
-
position: absolute;
|
|
2733
|
-
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
2734
|
-
}
|
|
2735
|
-
|
|
2736
|
-
& [data-truncate-marker]:after {
|
|
2737
|
-
--truncate-internal-fade-dir: to right;
|
|
2738
|
-
right: calc(-1 *
|
|
2739
|
-
(
|
|
2740
|
-
var(--truncate-internal-marker-fade-width) +
|
|
2741
|
-
var(--truncate-internal-marker-gap)
|
|
2742
|
-
));
|
|
2743
|
-
}
|
|
2744
|
-
|
|
2745
|
-
& [data-truncate-marker]:before {
|
|
2746
|
-
--truncate-internal-fade-dir: to left;
|
|
2747
|
-
left: calc(-1 *
|
|
2748
|
-
(
|
|
2749
|
-
var(--truncate-internal-marker-fade-width) +
|
|
2750
|
-
var(--truncate-internal-marker-gap)
|
|
2751
|
-
));
|
|
2752
|
-
}
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
[data-truncate-variant="fade"] {
|
|
2756
|
-
& [data-truncate-marker] {
|
|
2757
|
-
background: none;
|
|
2758
|
-
}
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
[data-truncate-fade] {
|
|
2762
|
-
box-shadow: 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
2763
|
-
var(--truncate-internal-fade-marker-color),
|
|
2764
|
-
0 0 var(--truncate-internal-fade-marker-width)
|
|
2765
|
-
var(--truncate-internal-fade-marker-color);
|
|
2766
|
-
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
2767
|
-
height: calc(var(--truncate-internal-single-line-height) -
|
|
2768
|
-
(var(--truncate-internal-fade-marker-width) * 2));
|
|
2769
|
-
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
2770
|
-
}
|
|
2771
|
-
|
|
2772
|
-
[data-truncate-group-container="middle"] {
|
|
2773
|
-
& [data-truncate-container] {
|
|
2774
|
-
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
2775
|
-
}
|
|
2776
|
-
|
|
2777
|
-
min-width: 0;
|
|
2778
|
-
display: flex;
|
|
2779
|
-
|
|
2780
|
-
& > div {
|
|
2781
|
-
min-width: 0;
|
|
2782
|
-
}
|
|
2783
|
-
|
|
2784
|
-
& > div[data-truncate-segment-priority="1"] {
|
|
2785
|
-
flex: 0 1 max-content;
|
|
2786
|
-
}
|
|
2787
|
-
|
|
2788
|
-
& > div[data-truncate-segment-priority="2"] {
|
|
2789
|
-
flex: 0 999999 max-content;
|
|
2790
|
-
}
|
|
2791
|
-
}
|
|
2792
|
-
}
|
|
2793
|
-
|
|
2794
|
-
@layer theme, unsafe;
|
|
2795
|
-
`,aO=`@layer base, unsafe;`;function oO(e){return`${aO}
|
|
2796
|
-
@layer base {
|
|
2797
|
-
${e}
|
|
2798
|
-
}`}function sO(e){return`${aO}
|
|
2799
|
-
@layer unsafe {
|
|
2800
|
-
${e}
|
|
2801
|
-
}`}var cO=new WeakMap;function lO(e){let t=cO.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(uw,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),cO.set(e,i),i}function uO(e,t){if(!e.isConnected)return;let n=lO(t);if(n==null)return;let r=t.querySelector(`style[${dw}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(dw,``),t.appendChild(i)),i.textContent=`:host { ${fw}: ${n}px; }`}var dO;function fO(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){dO??(dO=new CSSStyleSheet,dO.replaceSync(oO(iO)));let t=!1;try{e.adoptedStyleSheets=[dO],t=!0}catch{}if(t){e.querySelector(`style[${cw}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(cw,``),t.textContent=oO(iO),e.prepend(t)}}function pO(e,t){mO(e,t),fO(t),uO(e,t)}function mO(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});pO(this,e)}}if(customElements.define(sw,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(sw)))e instanceof HTMLElement&&pO(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var hO=e=>e.startsWith(`f::`)?e.slice(3):e;function gO(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function _O(e,t){return e===``?t:`${e}/${t}`}function vO({files:e,path:t,isFolder:n,nextBasename:r}){let i=hO(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=gO(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=_O(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function yO(e){return e.endsWith(`/`)}function bO(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function xO(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function SO(e,t){return t.includes(e)?xO(t):[e]}function CO(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function wO(e,t){return{draggedPaths:e,target:t}}function TO(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(yO(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function EO(e,t){return t.kind===`root`||t.directoryPath==null?bO(e):t.directoryPath}function DO(e,t){let n=e.map(e=>{let n=EO(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function OO(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function kO(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!OO($D.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function AO(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function jO(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function MO(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function NO(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return MO(e,t.path)?n?e:null:e;case`move`:return jO(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=NO(r,e,n),r==null)return null;return r}}}function PO(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function FO(e){switch(e.operation){case`add`:return{...PO(e),operation:`add`,path:e.path};case`remove`:return{...PO(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...PO(e),from:e.from,operation:`move`,to:e.to}}}function IO(e){return{...PO(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>FO(e)),operation:`batch`}}function LO(e){switch(e.operation){case`add`:case`remove`:case`move`:return FO(e);case`batch`:return IO(e);default:return null}}function RO(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function zO(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function BO(e){return zO(e).at(-1)??null}function VO(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function HO(e){return e.endsWith(`/`)}var UO=e=>e.toLowerCase();function WO(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function GO(e){return e.endsWith(`/`)?e.slice(0,-1):e}function KO(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var qO=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},JO=Symbol(`FILE_TREE_RENAME_VIEW`),YO=512,XO=512;function ZO(e){return e===`top`||e===`center`?e:`nearest`}function QO(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=zO(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function $O(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:QO(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var ek=class e{static{Object.defineProperty(e.prototype,JO,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=kO({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=BO(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:ZO(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=XO){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t!=null&&this.#B.has(t)&&this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=SO(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=wO(t.draggedPaths,n);(TO(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}CO(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=wO(e.draggedPaths,t);if(TO(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=DO(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=HO(r),a=GO(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of zO(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=WO(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,HO(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,HO(e)?{recursive:!0}:void 0);return}let t=HO(e),n=vO({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:GO(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(KO(n.sourcePath,t),KO(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=kO({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!RO(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=BO(e),n=VO(e,t),r=null,i=null;for(let e of this.#be()){if(BO(e)!==t)continue;let a=VO(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=zO(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!RO(this.#B,r),a=this.#z!==t;(i||a)&&(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new $D({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of zO(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(UO),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(UO),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of zO(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:qO(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of zO(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of zO(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=$O(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,YO)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=NO(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=NO(this.#c,e,!0),r=[...this.#B].map(t=>NO(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=NO(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return RO(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&AO(e)&&(this.#i=null);let t=AO(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=LO(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},tk=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function nk(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function rk(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function ik(e,t){return t?`${e}/`:e}function ak(e,t=null){let n=tk(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=sk(t);e!=null&&uk({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function ok(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=ck(e);t!=null&&(c=lk({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=sk(e);t!=null&&(c=uk({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:pk(i),statusByPath:i}:e}function sk(e){return ck(e.path)}function ck(e){let t=nk(e);if(t!=null)return{canonicalPath:ik(t.path,t.isDirectory),isDirectory:t.isDirectory}}function lk({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),fk(t,n,e),!0)}function uk({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??dk(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function dk(e,t,n){for(let r of rk(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function fk(e,t,n){for(let r of rk(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function pk(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var X,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck={},wk=[],Tk=Array.isArray,Ek=wk.slice,Dk=Object.assign;function Ok(e){e&&e.parentNode&&e.remove()}function kk(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?Ek.call(arguments,2):n),Ak(e,o,r,i,null)}function Ak(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++mk,__i:-1,__u:0};return i==null&&X.vnode!=null&&X.vnode(a),a}function jk(e){return e.children}function Mk(e,t){this.props=e,this.context=t,this.__g=0}function Nk(e,t){if(t==null)return e.__?Nk(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?Nk(e):null}function Pk(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Pk(e)}}function Fk(e){(8&e.__g||!(e.__g|=8)||!hk.push(e)||_k++)&&gk==X.debounceRendering||((gk=X.debounceRendering)||queueMicrotask)(Ik)}function Ik(){for(var e,t,n,r,i,a,o,s,c=1;hk.length;)hk.length>c&&hk.sort(vk),e=hk.shift(),c=hk.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Dk({},r)).__v=r.__v+1,X.vnode&&X.vnode(n),Wk(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??Nk(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Kk(a,n,o),n.__e!=i&&Pk(n)));_k=0}function Lk(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||wk,b=t.length;for(c=Rk(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?Ck:y[m.__i]||Ck,m.__i=f,_=Wk(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Yk(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=zk(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Rk(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Ak(null,o,null,null,null):Tk(o)?Ak(jk,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ak(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Bk(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=Nk(s)),Xk(s,s));return r}function zk(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=zk(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=Nk(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Bk(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function Vk(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Hk(e,t,n,r,i){var a;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||Vk(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||Vk(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(yk,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=bk,e.addEventListener(t,a?Sk:xk,a)):e.removeEventListener(t,a?Sk:xk,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Uk(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=bk++;else if(t.u<n.l)return;return n(X.event?X.event(t):t)}}}function Wk(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,ee,j=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=X.__b)&&d(t);n:if(typeof j==`function`)try{if(v=t.props,y=`prototype`in j&&j.prototype.render,b=(d=j.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new j(v,x):(t.__c=f=new Mk(v,x),f.constructor=j,f.render=Zk),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&j.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Dk({},f.__s)),Dk(f.__s,j.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&j.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&j.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=X.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=Dk({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===jk&&d.key==null&&(E=qk(d.props.children)),s=Lk(e,Tk(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null){if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ee=a.length;ee--;)Ok(a[ee]);Gk(t)}}else t.__e=n.__e,t.__k=n.__k,e.then||Gk(t);X.__e(e,t,n)}else s=t.__e=Jk(n.__e,t,n,r,i,a,o,c,l,u);return(d=X.diffed)&&d(t),128&t.__u?void 0:s}function Gk(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Gk)}function Kk(e,t,n){for(var r=0;r<n.length;r++)Yk(n[r],n[++r],n[++r]);X.__c&&X.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){X.__e(e,t.__v)}})}function qk(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Tk(e)?e.map(qk):Dk({},e)}function Jk(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(X.__m&&X.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=Ek.call(e.childNodes),v=n.props||Ck,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Hk(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Hk(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Lk(b==`template`?e.content:e,Tk(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&Nk(n,0),s,c,l),a!=null)for(u=a.length;u--;)Ok(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Hk(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Hk(e,u,g,v[u],i))}return e}function Yk(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){X.__e(e,n)}}function Xk(e,t,n){var r,i;if(X.unmount&&X.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Yk(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){X.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Xk(r[i],t,n||typeof e.type!=`function`);n||Ok(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Zk(e,t,n){return this.constructor(e,n)}function Qk(e,t){var n,r,i,a;t==document&&(t=document.documentElement),X.__&&X.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=kk(jk,null,[e]),i=[],a=[],Wk(t,e,r||Ck,Ck,t.namespaceURI,r?null:t.firstChild?Ek.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Kk(i,e,a)}function $k(e,t){e.__u|=32,Qk(e,t)}X={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw _k=0,e}},mk=0,Mk.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Dk({},this.state);typeof e==`function`&&(e=e(Dk({},n),this.props)),e&&Dk(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Fk(this))},Mk.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Fk(this))},Mk.prototype.render=jk,hk=[],_k=0,vk=function(e,t){return e.__v.__b-t.__v.__b},yk=/(PointerCapture)$|Capture$/i,bk=0,xk=Uk(!1),Sk=Uk(!0);var eA=0;Array.isArray;function Z(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--eA,__i:-1,__u:0,__source:i,__self:a};return X.vnode&&X.vnode(l),l}var tA=16,nA=16,rA={};function iA({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=rA[e]??{width:tA,height:nA},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Z(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Z(`use`,{href:c})})}var aA=e=>e!==void 0&&/\s/.test(e),oA=(e,t)=>{let n=t=>aA(e[t-1])||aA(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},sA=e=>oA(e,Math.ceil(e.length/2)),cA=e=>{if(e.length<2)return[e,``];let t=sA(e);return[e.slice(0,t),e.slice(t)]},lA=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:sA(e);return[e.slice(0,r),e.slice(r)]},uA=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},dA=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},fA=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},pA=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function mA({children:e,marker:t,variant:n=`default`}){"use no memo";return Z(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Z(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Z(`span`,{"data-truncate-fade":!0}):t})})}function hA(e){"use no memo";let{mode:t,children:n}=e;return Z(`div`,{children:[Z(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Z(`span`,{children:n}):n}),Z(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Z(`span`,{children:n}):n})]})}function gA({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Z(hA,{mode:t,children:e},`content`),o=Z(mA,{marker:n,mode:t,variant:r},`marker`),s=Z(`div`,{"data-truncate-fill":!0},`fill`);return Z(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Z(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function _A({children:e,...t}){"use no memo";return Z(gA,{mode:`truncate`,...t,children:e})}function vA({children:e,...t}){"use no memo";return Z(gA,{mode:`fruncate`,...t,children:e})}function yA({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=Z(_A,{...s,children:t[0]}),l=Z(vA,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Z(`div`,{className:a,style:o});if(e.length<i)return Z(n===`end`?vA:_A,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=cA:r===`extension`?t=lA:r===`leaf-path`&&(t=uA);else if(typeof r==`number`)t=dA,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=fA:e===`first`&&(t=pA)}else typeof r==`function`&&(t=r);t??=cA;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=Z(_A,{...s,..._,children:f}),l=Z(vA,{...s,...v,children:p})}return Z(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Z(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Z(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var bA={endIndex:-1,startIndex:-1};function xA(e,t,n){return Math.min(Math.max(e,t),n)}function SA(e,t){return e<0||t<e?bA:{endIndex:t,startIndex:e}}function CA(e){return e.startIndex<0||e.endIndex<e.startIndex}function wA(e,t){return CA(e)?0:(e.endIndex-e.startIndex+1)*t}function TA(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function EA(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function DA(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function OA(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function kA(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function AA(e,t,n){if(e.length===0||t<=0)return[];let r=kA(e),i=DA(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=OA(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function jA(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=xA(t.scrollTop,0,o),c=t.stickyRows??AA(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=TA(s,n,t.itemHeight),m=TA(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?bA:SA(m,EA(u+d,n,t.itemHeight)),y=g+1,b=CA(v)?bA:SA(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=wA(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:CA(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var MA={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},NA={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},PA=`Contains git status items`;function FA(e){return e.current?!0:(e.current=!0,!1)}function IA(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function LA(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return IA({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function RA(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function zA(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function BA(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function VA(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function HA(e,t){return e!=null&&e>0?e:t}function UA(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function WA(e,t,n,r,i=0){let a=IA({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function GA(e,t,n,r,i,a,o=0){let s=LA({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function KA(e,t,n,r,i,a){let o=RA({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function qA(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function JA(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function YA({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Z(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function XA(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function ZA(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var QA,Q,$A,ej,tj=Object.is,nj=0,rj=[],ij=X,aj=ij.__b,oj=ij.__r,sj=ij.diffed,cj=ij.__c,lj=ij.unmount,uj=ij.__;function dj(e,t){ij.__h&&ij.__h(Q,e,nj||t),nj=0;var n=Q.__H||(Q.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function fj(e){return nj=1,pj(wj,e)}function pj(e,t,n){var r=dj(QA++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):wj(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);tj(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Q,!Q.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,tj(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Q.__f=!0;var a=Q.shouldComponentUpdate,o=Q.componentWillUpdate;Q.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Q.shouldComponentUpdate=i}return r.__N||r.__}function mj(e,t){var n=dj(QA++,3);!ij.__s&&Cj(n.__H,t)&&(n.__=e,n.u=t,Q.__H.__h.push(n))}function hj(e,t){var n=dj(QA++,4);!ij.__s&&Cj(n.__H,t)&&(n.__=e,n.u=t,Q.__h.push(n))}function $(e){return nj=5,gj(function(){return{current:e}},[])}function gj(e,t){var n=dj(QA++,7);return Cj(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function _j(e,t){return nj=8,gj(function(){return e},t)}function vj(){for(var e;e=rj.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(xj),e.__H.__h.forEach(Sj),e.__H.__h=[]}catch(t){e.__H.__h=[],ij.__e(t,e.__v)}}ij.__b=function(e){Q=null,aj&&aj(e)},ij.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),uj&&uj(e,t)},ij.__r=function(e){oj&&oj(e),QA=0;var t=(Q=e.__c).__H;t&&($A===Q?(t.__h=[],Q.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(xj),t.__h.forEach(Sj),t.__h=[],QA=0)),$A=Q},ij.diffed=function(e){sj&&sj(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(rj.push(t)!==1&&ej===ij.requestAnimationFrame||((ej=ij.requestAnimationFrame)||bj)(vj)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),$A=Q=null},ij.__c=function(e,t){t.some(function(e){try{e.__h.forEach(xj),e.__h=e.__h.filter(function(e){return!e.__||Sj(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],ij.__e(n,e.__v)}}),cj&&cj(e,t)},ij.unmount=function(e){lj&&lj(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{xj(e)}catch(e){t=e}}),n.__H=void 0,t&&ij.__e(t,n.__v))};var yj=typeof requestAnimationFrame==`function`;function bj(e){var t,n=function(){clearTimeout(r),yj&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);yj&&(t=requestAnimationFrame(n))}function xj(e){var t=Q,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Q=t}function Sj(e){var t=Q;e.__c=e.__(),Q=t}function Cj(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!tj(t,e[n])})}function wj(e,t){return typeof t==`function`?t(e):t}function Tj(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Z(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Z(jk,{children:[Z(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Z(_A,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Ej(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Dj(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function Oj(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function kj({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=jA(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:Oj(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?Oj(u,1,t,o):i&&r<=0&&c.length>0?AA(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var Aj=400,jj=40,Mj=18;function Nj(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?Pj(e,t,n):a instanceof HTMLElement?a:null}function Pj(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function Fj(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function Ij(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Lj(){return navigator.vendor!==`Apple Computer, Inc.`}function Rj(e,t){let n=e-t.top;if(n<jj)return-Math.ceil((jj-Math.max(0,n))/jj*Mj);let r=t.bottom-e;return r<jj?Math.ceil((jj-Math.max(0,r))/jj*Mj):0}function zj(e,t){if(e!=null){let t=MA[e];return t==null?null:{text:t,title:NA[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:PA}:null}function Bj(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function Vj(e){return e!=null&&`toggle`in e}function Hj(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function Uj(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Wj(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Gj(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Kj(e,t){return t&&Gj(e)||(e.ctrlKey||e.metaKey)&&Hj(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var qj=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Jj(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Yj(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Xj(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function Zj(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Qj(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function $j(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function eM(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function tM(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function nM(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=tM(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function rM(e,t){return{kind:e.kind,name:Dj(e),path:t}}function iM(e){return e==null?void 0:`${e}__tree`}function aM(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function oM(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function sM(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Z(`span`,{title:e.title,children:e.text}):Z(`span`,{title:e.title,children:e.parts.map((e,t)=>Z(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?oM(e.icon)?t(e.icon):{name:e.icon}:oM(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Z(`span`,{title:e.title,children:Z(iA,{...n})})}function cM(e){e!=null&&zA(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function lM(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Ej(e);return Z(jk,{children:[e.depth>0?Z(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Z(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Z(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Z(iA,{...t(`file-tree-icon-chevron`)}):Z(iA,{...t(`file-tree-icon-file`,u)})}),Z(`div`,{"data-item-section":`content`,children:e.isFlattened?Tj(e,c,a):c??Z(yA,{minimumLength:5,split:`extension`,children:e.name})}),i?Z(`div`,{"data-item-section":`decoration`,children:r==null?null:sM(r,t)}):null,s?Z(`div`,{"data-item-section":`git`,children:sM(o,t)}):null,n?Z(`div`,{"data-item-section":`action`,children:l?Z(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Z(iA,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function uM(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:ee,onRowClick:j,onKeyDown:te}=e,M=Ej(t),{isParked:ne=!1,mode:re=`flow`,style:ie}=r,ae=re===`sticky`,oe=_?.get(M)??null??Bj(t.ancestorPaths,v,y),se=t.kind===`directory`&&(b?.has(M)??!1),ce=A(t,M),le=zj(oe,se),ue=S&&w,de=ce!=null||x||ue,fe=ue&&T===`always`,pe=a.getPath()===M,me=pe?a.getValue():``,he=ae||!pe?null:Z(YA,{ref:D,ariaLabel:`Rename ${Dj(t)}`,isFlattened:t.isFlattened,value:me,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ge=lM(t,k,{actionLaneEnabled:ue,customDecoration:ce,decorationLaneEnabled:de,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:le,gitLaneActive:x,renameInput:he,showDecorativeActionAffordance:fe}),_e={...XA({ariaLabel:Dj(t),domId:t.isFocused?aM(h,M,ne):void 0,extraStyle:ie,features:{actionLaneEnabled:ue,contextMenuButtonVisibility:ue?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:ne,itemHeight:g,mode:re,row:t,state:{containsGitChange:se,effectiveGitStatus:oe,isContextHovered:s===M,isDragTarget:l?.kind===`directory`&&l.directoryPath===M,isDragging:c?.has(M)===!0,isFocusRinged:t.isFocused&&o===M},targetPath:M}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(M),ee(t,M,{anchorRect:Xj(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:ae?void 0:()=>{i.focusMountedPathFromInput(M)},onKeyDown:ae?void 0:te,ref:e=>{O(M,e)}};return!ae&&pe?Z(`div`,{..._e,children:ge}):Z(`button`,{..._e,type:`button`,draggable:u&&!ne,onDragEnd:u&&!ne?p:void 0,onDragStart:u&&!ne?e=>{f(e,t,M)}:void 0,onMouseDown:e=>{if(ae){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!ne?e=>{m(e,t,M)}:void 0,onClick:e=>{j(e,t,M,re)},children:ge})}function dM(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Ej(e))).map((n,r)=>uM(e,n,t.start+r))}function fM({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=rO,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=$(null),v=$(null),y=$(!1),b=$(null),x=$(null),S=$(null),C=$(null),w=$(null),T=$(new Map),E=$(new Map),D=$(()=>{}),O=$(null),k=$(0),A=$(!1),ee=$(null);ee.current!==t&&(A.current=!1,ee.current=t);let j=$(!1),te=$(null),M=$(null),ne=$(!1),re=$(null),ie=$(null),ae=$(null),oe=$(null),se=$(null),ce=$(null),le=$(null),ue=$(null),de=$(!1),fe=$(null),pe=$(null),me=$(null),he=$(null),ge=gj(()=>new Map,[]),[,_e]=fj(0),ve=$(!1),[ye,be]=fj(null),[xe,Se]=fj(null),[Ce,we]=fj(null),[Te,Ee]=fj(null),[De,Oe]=fj(0),[N,ke]=fj(null),Ae=$(N);Ae.current=N;let je=$(null),Me=$(null),Ne=$(null),Pe=$(null),Fe=$(null),Ie=$(!1),Le=()=>{Me.current=null,Ne.current=null,Pe.current=null},Re=(e,t)=>{Me.current=e,Ne.current=null,Pe.current=t==null?null:{path:e,scrollTop:t}},ze=(e,t)=>{Me.current=null,Ne.current={path:e,viewportOffset:t},Pe.current=null},Be=$(d===`retain`&&t.isSearchOpen()),[Ve,He]=fj(p);mj(()=>{p||He(!1)},[p]);let Ue=$(!1),We=_j(()=>{Ue.current=!0,He(e=>e&&!1)},[]),[Ge,Ke]=fj(()=>kj({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[qe,Je]=fj(!1);mj(()=>{Je(!0)},[]);let Ye=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Xe=e?.contextMenu?.triggerMode??(Ye?`right-click`:`both`),Ze=Xe===`both`||Xe===`button`,Qe=e?.contextMenu?.buttonVisibility??`when-needed`,$e=Xe===`both`||Xe===`right-click`;hj(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Fe.current=t,Se(t),Ee(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Ie.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let et=_j((e,t)=>{Qj(T.current,e,t)},[]),tt=_j((e,t)=>{Qj(E.current,e,t)},[]),nt=_j(e=>{x.current=e},[]),rt=_j(e=>$j(e,E.current,T.current),[]),it=n!=null||r!=null||i!=null,{resolveIcon:at}=gj(()=>Sw(a),[a]),ot=t[JO](),st=ot.getPath(),ct=st!=null,lt=t.isSearchOpen(),ut=t.getSearchValue(),P=t.getFocusedPath(),F=t.getFocusedIndex(),dt=t.getScrollRequest(),ft=t.isDragAndDropEnabled(),pt=t.getDragSession(),mt=gj(()=>pt==null?null:new Set(pt.draggedPaths),[pt]),ht=pt?.target??null,gt=pt?.primaryPath??null,_t=iM(o),{overlayHeight:vt,overlayRows:yt,snapshot:bt,visibleRows:xt}=Ge,St=bt.physical.viewportHeight,Ct=gj(()=>({end:bt.window.endIndex,start:bt.window.startIndex}),[bt.window.endIndex,bt.window.startIndex]),wt=yt,Tt=bt.sticky.rows,Et=bt.physical.totalHeight,Dt=bt.sticky.height,Ot=gj(()=>new Set(Tt.map(e=>Ej(e.row))),[Tt]),kt=F>=0&&F>=Ct.start&&F<=Ct.end,At=_j((e,t)=>u?.({item:rM(e,t),row:e})??null,[u]),jt=_j(e=>zA(e==null?null:T.current.get(e)??null)?!0:zA(S.current),[]),Mt=_j(e=>{jt(t.focusNearestPath(e))},[t,jt]),Nt=$(Mt);Nt.current=Mt;let Pt=$(!0),Ft=$(()=>{}),It=_j((t=!0)=>{let n=Ae.current;n!=null&&(Pt.current=Pt.current&&t,ke(null),e?.contextMenu?.onClose?.(),Pt.current&&Mt(n.path))},[e?.contextMenu,Mt]);Ft.current=It;let Lt=_j(e=>{let t=e==null?null:Zj(S.current,e);we(e=>e===t?e:t)},[]),Rt=_j((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=rt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Re(n,e?.scrollTop??null),j.current=!0,be(e=>e===n?e:n)}i.focus(),Lt(a),Pt.current=!0,ke({anchorRect:r?.anchorRect??null,item:rM(e,n),path:n,source:r?.source??`keyboard`})},[t,rt,Lt]),zt=_j(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=VA(e,St);re.current=F<0||e==null?null:Math.max(0,Math.min(F*s-e.scrollTop,Math.max(0,t-s))),ne.current=!0}t.startRenaming(e)!==!1&&(Ee(`focus`),_e(e=>e+1))}},[t,F,s,l,St]),Bt=_j((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=VA(i,St),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:kj({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return j.current=!0,KA(i,a,s,l,u,d),D.current(),je.current=n?e:null,!0},[t,s,c,St,h]),Vt=()=>y.current===!0||he.current!=null||de.current===!0,Ht=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Ut=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Wt=()=>{oe.current!=null&&(clearTimeout(oe.current),oe.current=null),ae.current=null},Gt=()=>{ce.current?.remove(),ce.current=null},Kt=()=>{Ut(ie.current),ie.current=null,se.current=null},qt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Jt=()=>{ue.current?.(),ue.current=null,he.current!=null&&(clearTimeout(he.current),he.current=null),de.current=!1,fe.current=null,me.current=null,pe.current!=null&&(pe.current.setAttribute(`draggable`,`true`),pe.current.style.removeProperty(`touch-action`),pe.current=null),Gt(),Wt(),Kt(),le.current=null},Yt=(e,n)=>{let r=S.current?.getRootNode(),i=Fj(Nj(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Xt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Wt();return}let r=t.getItem(e.directoryPath),i=Vj(r)?r:null;if(i==null||i.isExpanded()){Wt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;ae.current!==a&&(Wt(),ae.current=a,oe.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Zt=()=>{ie.current=null;let e=se.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Rj(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Xt(Yt(e.clientX,e.clientY)),ie.current=Ht(Zt)},I=(e,t)=>{se.current={clientX:e,clientY:t},ie.current??=Ht(Zt)},Qt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Jt(),Gt(),Wt(),Kt(),t.startDrag(r)===!1){e.preventDefault();return}if(le.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Lj())){let t=Ij(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),qt(t),ce.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},$t=()=>{Gt(),Wt(),Kt(),le.current=null,t.cancelDrag()},en=(e,n,r)=>{if(he.current!=null||de.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;me.current={clientX:i.clientX,clientY:i.clientY},pe.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!de.current;he.current!=null&&(clearTimeout(he.current),he.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),ue.current===o&&(ue.current=null),t&&(a.setAttribute(`draggable`,`true`),pe.current===a&&(pe.current=null),me.current=null)},s=e=>{let t=e.touches[0],n=me.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),ue.current=o,he.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),pe.current===a&&(pe.current=null),me.current=null;return}de.current=!0,pe.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),le.current=n;let e=a.getBoundingClientRect(),s=Ij(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),qt(s),ce.current=s,fe.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=fe.current;n!=null&&ce.current!=null&&(ce.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Xt(Yt(t.clientX,t.clientY)),I(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Yt(n.clientX,n.clientY),t.completeDrag(),Jt()},u=()=>{t.cancelDrag(),Jt()};ue.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},Aj)},tn=e=>{if(N!=null){if(e.key===`Escape`){It(),e.preventDefault(),e.stopPropagation();return}qj.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ot.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)ot.cancel();else if(e.key===`Enter`)ot.commit();else return;Ee(`focus`),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){zt(P??void 0),e.preventDefault(),e.stopPropagation();return}if(lt){if(e.key===`Escape`)ne.current=!1,re.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=VA(n,St);re.current=F<0||n==null?null:Math.max(0,Math.min(F*s-n.scrollTop,Math.max(0,r-s))),ne.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ee(`focus`),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&Uj(e)){t.openSearch(e.key),_e(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ye&&Gj(e),r=Kj(e,Ye),i=r&&S.current!=null?BA(S.current):null,a=r?new Set(eM(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==P&&a.has(o)){let e=C.current;Re(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Vj(p)?p:null,h=u!=null&&(Ot.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=$j(u,E.current,T.current);e==null||n==null?y=!1:Rt(e,u)}else if((e.ctrlKey||e.metaKey)&&Hj(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ee(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Ot.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Re(b,v?.scrollTop??null),j.current=!0,be(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(ze(b,nM(S.current,v,i,u,s,Dt,St)),j.current=!0,be(e=>e===b?e:b)):Le()}_e(e=>e+1),e.preventDefault(),e.stopPropagation()};hj(()=>{if(f&<){if(Be.current){Be.current=!1;return}zA(w.current)}},[lt,f]),hj(()=>{let e=x.current;switch(JA({hasRenderedInput:e!=null,previousRenamingPath:M.current,renamingPath:st})){case`reset`:M.current=null;return;case`reveal-canonical`:st!=null&&Bt(st,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(je.current=null,M.current=st,zA(e),e.select());return}},[Ct.end,Ct.start,st,Bt,Ot]),hj(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=BA(e)?.dataset.itemPath??null;be(e=>e===t?e:t)},i=()=>{n(),j.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,BA(e)!=null){r();return}j.current=!1,be(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),j.current=!1,be(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;be(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),hj(()=>{let e=S.current;e!=null&&(bt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[bt.physical.scrollTop]),hj(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=VA(n,g);let a=()=>{let e=t.getVisibleCount(),r=HA(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ke(kj({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=HA(O.current,g),i=t.getVisibleRows(e,e)[0]??null;WA(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=t.subscribe(()=>{FA(ve)&&_e(e=>e+1),a()}),l=()=>{Ie.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Oe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Ie.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ae.current!=null&&y.current&&Ft.current(),Ie.current===!0){y.current=!1;return}Se(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:UA(e[0]))??VA(n,g),a()}):null;return x?.observe(n),()=>{D.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,x?.disconnect()}},[t,g,s,c,h]),hj(()=>{Ye||N==null||It(!1)},[It,Ye,N]);let nn=gj(()=>N==null?null:`${N.path}::${N.source}`,[N]);hj(()=>{if(nn==null){m?.clearSlotContent(mw);return}let t=Ae.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Yj(n.getBoundingClientRect()),close:e=>{Ft.current(e?.restoreFocus??!0)},restoreFocus:()=>{Pt.current&&Nt.current(Ae.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(mw,i),e?.contextMenu?.onOpen?.(t.item,r),cM(i),queueMicrotask(()=>{i!=null&&i.isConnected&&document.activeElement===i&&cM(i)}),()=>{m?.clearSlotContent(mw)}},[nn,e?.contextMenu,m]),hj(()=>{N!=null&&t.getItem(N.path)==null&&It()},[It,N,t]),hj(()=>{if(N==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Jj(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&It())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),It())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[It,N]),hj(()=>{let e=C.current,n=S.current;if(e==null||n==null){te.current=P;return}let r=P==null?null:T.current.get(P)??null,i=BA(n),a=i?.dataset.itemPath??null,o=ct&&x.current===i,c=f&&w.current===i,l=ne.current&&!lt,u=re.current??0,d=je.current,p=Me.current,m=Ne.current,g=Pe.current,_=i!=null,v=j.current||_,y=te.current!==P,b=p!=null&&p===P&&P!=null,E=!1,O=!1;if(dt!=null&&dt.id!==k.current){k.current=dt.id;let n=dt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,St-s))):Dt;E=!0,O=GA(e,n,s,St,Et,dt.offset,t)}t.clearScrollRequest(dt.id)}let A=!E&&l&&KA(e,F,s,St,Et,u),ee=!E&&d!=null&&d===P&&KA(e,F,s,St,Et,Dt),M=!E&&m!=null&&m.path===P&&KA(e,F,s,St,Et,m.viewportOffset),ie=!E&&g!=null&&g.path===P&&e.scrollTop!==g.scrollTop;if(ie&&(e.scrollTop=g.scrollTop),(ie||O||ee||M||A||v&&y&&d!==P&&!b&&WA(e,F,s,St,Dt))&&D.current(),E){te.current=P;return}if(!v){te.current=P;return}if(o){te.current=P;return}if(c&&!l){te.current=P;return}if(r==null){l&&F>=0&&(KA(e,F,s,St,Et,u),D.current()),te.current=P;return}(y||l||d===P||p===P||m?.path===P||g?.path===P||a==null||a!==P)&&(zA(r),d===P&&(je.current=null),p===P&&(Me.current=null),m?.path===P&&(Ne.current=null),g?.path===P&&(Pe.current=null),ne.current=!1,re.current=null),te.current=P},[t,F,P,kt,s,ct,lt,Ct,St,f,dt,h,Dt,Et,xt]);let rn=F>=0&&F>=bt.visible.startIndex&&F<=bt.visible.endIndex,an=P!=null&&wt.some(e=>Ej(e.row)===P),on=rn||an,sn=Ze&&j.current===!0&&on?P:null,cn=Te===`pointer`?xe:null,ln=N?.path??Fe.current??cn??sn??xe,un=N?.source===`right-click`;hj(()=>{y.current&&N==null||Lt(rt(ln))},[N,rt,Ct,St,De,wt,ln,Lt,xt]);let dn=_j(e=>{if(y.current||Jj(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ee(e=>e===`pointer`?e:`pointer`),Se(e=>e===i?e:i)},[]),fn=_j(()=>{Se(null)},[]);hj(()=>{if(!ft)return;let e=()=>{Jt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Jt(),t.cancelDrag()}},[t,ft]);let pn=e=>{if(!ft||t.getDragSession()==null||de.current)return;let n=Fj(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Xt(t.getDragSession()?.target??null),I(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},mn=e=>{if(!ft||t.getDragSession()==null||de.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Wt(),Kt(),t.setDragTarget(null))},hn=e=>{ft&&t.getDragSession()!=null&&!de.current&&(e.preventDefault(),Yt(e.clientX,e.clientY),t.completeDrag(),Gt(),Wt(),Kt(),le.current=null)},gn=bt.window.height,_n=bt.window.offsetTop,vn=Math.min(0,St-gn),yn=Math.min(0,St-gn-Dt),L=ye===P||ne.current,bn=P!=null&&L&&!kt&&F>=0?xt[F]??t.getVisibleRows(F,F)[0]??null:null,xn=bn==null?null:qA(F,s,Ct,gn),Sn=le.current,Cn=gt!=null&&Sn!=null&&Sn.path===gt&&Sn.index>=Ct.start&&Sn.index<=Ct.end,wn=gt!=null&&Sn!=null&&Sn.path===gt&&!Cn&&Sn.path!==bn?.path?Sn:null,Tn=wn==null?null:qA(wn.index,s,Ct,gn),En=Wj((F>=0?xt[F]??t.getVisibleRows(F,F)[0]??null:null)?.ancestorPaths.at(-1)??null),Dn=lt&&P!=null?aM(o,P,!kt):void 0,On=N?.path??(lt?P:ye),kn=N?.path??xe,An=rt(ln),jn=Ye&&Ze&&!un&&!ct&&An!=null&&Ce!=null&&ln!=null,Mn=Ye&&(jn||N!=null),Nn=N?.anchorRect,Pn=Nn==null&&An!=null&&Ce!=null&&(N!=null||jn)?Ce:null,Fn=Nn==null?Pn==null?void 0:{top:`${Pn}px`}:{left:`${Nn.left}px`,position:`fixed`,right:`auto`,top:`${Nn.top}px`},In=un?{opacity:`0`}:void 0,Ln=_j((e,n,r,i)=>{let a=ZA({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:lt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=bt.visible.startIndex&&n.index<=bt.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(j.current=!0,be(e=>e===c?e:c),Ee(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Bt(c,{targetOffset:`sticky-parents`})},[t,lt,bt.visible.endIndex,bt.visible.startIndex,Bt]),Rn=()=>{if(y.current||!Ze||ln==null||An==null)return;let e=t.getItem(ln);e!=null&&(Lt(An),Pt.current=!0,ke({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:An.getAttribute(`aria-label`)??ln,path:e.getPath()},path:e.getPath(),source:`button`}))},zn={contextHoverPath:kn,contextMenuButtonTriggerEnabled:Ze,contextMenuButtonVisibility:Qe,contextMenuEnabled:Ye,contextMenuRightClickEnabled:$e,contextMenuTriggerMode:Xe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ft,draggedPathSet:mt,dragTarget:ht,gitLaneActive:it,gitStatusByPath:n,handleRowDragEnd:$t,handleRowDragStart:Qt,handleRowTouchStart:en,ignoredGitDirectories:r,ignoredInheritanceCache:ge,instanceId:o,itemHeight:s,onKeyDown:tn,onRowClick:Ln,openContextMenuForRow:Rt,registerButton:et,registerRenameInput:nt,renameView:ot,renderDecorationForRow:At,resolveIcon:at,shouldSuppressContextMenu:Vt,visualFocusPath:On},Bn={...zn,registerButton:tt};return Z(`div`,{ref:S,id:_t,"data-file-tree-context-menu-button-visibility":Ye&&Ze?Qe:void 0,"data-file-tree-context-menu-trigger-mode":Ye?Xe:void 0,"data-file-tree-has-context-menu-action-lane":Ye&&Ze?`true`:void 0,"data-file-tree-has-git-lane":it?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ft?mn:void 0,onDragOver:ft?pn:void 0,onDrop:ft?hn:void 0,onKeyDown:tn,onPointerLeave:Ye?fn:void 0,onPointerOver:Ye?dn:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Z(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:En}}),Z(`slot`,{name:pw,"data-type":`header-slot`}),f?Z(`div`,{"data-file-tree-search-container":!0,"data-open":lt?`true`:`false`,children:Z(`input`,{ref:w,"aria-activedescendant":Dn,"aria-controls":_t,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ve?`true`:void 0,value:ut,onBlur:()=>{(d!==`retain`||Ue.current)&&t.closeSearch()},onFocus:We,onPointerDown:We,onInput:e=>{We();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Z(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&qe&&wt.length>0?Z(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Z(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${vt}px`},children:wt.map((e,t)=>uM(Bn,e.row,`sticky:${Ej(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${wt.length-t}`}}))})}):null,Z(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Et}px`},children:[Z(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${_n}px`}}),Z(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${gn}px`,top:`${vn}px`,bottom:`${yn}px`},children:[dM(zn,Ct,Ot),bn!=null&&xn!=null?uM(zn,bn,`parked:${bn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:gt===bn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${xn}px`}}):null,wn!=null&&Tn!=null?uM(zn,wn,`parked-drag:${wn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${Tn}px`}}):null]})]})]}),Ye?Z(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Mn?`true`:`false`,style:Fn,children:[Z(`button`,{ref:v,type:`button`,"data-type":hw,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":N==null?`false`:`true`,"data-visible":jn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),N!=null){It();return}Rn()},tabIndex:-1,style:In,children:Z(iA,{...at(`file-tree-icon-ellipsis`)})}),N==null?null:Z(`slot`,{name:mw})]}):null,N==null?null:Z(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),It()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),It()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var pM={hydrateRoot:(e,t)=>{$k(kk(fM,t),e)},renderRoot:(e,t)=>{Qk(kk(fM,t),e)},unmountRoot:e=>{Qk(null,e)}};function mM(e,t){pM.renderRoot(e,t)}function hM(e,t){pM.hydrateRoot(e,t)}function gM(e){pM.unmountRoot(e)}var _M=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};function vM(e,t,n){if(!e.s){if(n instanceof yM){if(!n.s)return void(n.o=vM.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(vM.bind(null,e,t),vM.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var yM=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{vM(r,1,a(this.v))}catch(e){vM(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?vM(r,1,t?t(i):i):n?vM(r,1,n(i)):vM(r,2,i)}catch(e){vM(r,2,e)}},r},e}();Array.isArray;var bM=0;function xM(e){return e!=null&&e.length>0?e:(bM+=1,`pst_ft_${bM}`)}function SM({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??rO)}function CM(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function wM(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function TM(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var EM=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new _M;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=xM(a),this.#p=ak(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=nO(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new ek({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(gM(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=ok(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&mM(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),mM(t.wrapper,this.#w()))}setGitStatus(e){let t=ak(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&mM(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),mM(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),hM(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),mM(r,this.#w())}#C(){return{initialViewportHeight:SM({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(pw,e());return}this.#l.setSlotHtml(pw,this.#e?.header?.html??null)}#k(e){let t=TM(e).find(e=>wM(e)),n=CM(rw(_w(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=TM(e),n=t.find(e=>wM(e)),r=t.filter(e=>e!==n),i=_w(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=CM(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=_w(this.#m);t.colored&&aw(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${lw}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(lw,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=sO(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return pO(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}};function DM(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(OM(i))}return e=>!n.some(t=>t(e))&&t.every(t=>t(e))}function OM(e){if(!/[*?]/.test(e))return t=>He(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=>He(e,t)}}function kM(e){let t=new Set;for(let n of e)for(let e=n.indexOf(`/`);e!==-1;e=n.indexOf(`/`,e+1))t.add(n.slice(0,e+1));return t}function AM(e){let t=e.lastIndexOf(`/`,e.length-2);return t===-1?``:e.slice(0,t+1)}function jM(e,t){let n=new Set(e),r=new Set(t),i=kM(t),a=new Set([...kM(e)].filter(e=>!i.has(e))),o=[];for(let e of a)a.has(AM(e))||o.push({type:`remove`,path:e,recursive:!0});for(let t of e)!r.has(t)&&!a.has(AM(t))&&o.push({type:`remove`,path:t});for(let e of t)n.has(e)||o.push({type:`add`,path:e});return o}var MM=`_ma _o`,NM=j,PM=(e=>`/${e}&`)(A);function FM(e){k(e.a,M)}var IM=(e,t)=>he(e.a,t),LM=(e,t)=>ee(e.a,t),RM=(e=>`<label>${e}<input type=search placeholder="Filter files…" aria-label="Filter files"></label>`)(NM),zM=(e=>` D/${e}& l`)(PM),BM=s(21,e=>T(e,`c`,e.o,aN(e))),VM=E(14,BM),HM=s(13,e=>VM(e,(e.m??e.k)||``)),UM=E(20,BM),WM=s(19,e=>UM(e,oN(e))),GM=E(18,WM),KM=s(17,e=>GM(e,sN(e)),2),qM=p(10,e=>{HM(e),KM(e)}),JM=s(7,e=>qM(e,e.f,e.g)),YM=E(5,JM),XM=E(6,JM),ZM=d(12,e=>{HM(e),KM(e)}),QM=(e,t)=>tN(e,t.timer),$M=y(`t4`,e=>{S(e,`c`),O(e.c,`keydown`,function(t){t.key===`Enter`&&(e.s(),e.i?.()),t.key===`Escape`&&(e.o?(t.preventDefault(),e.u(``)):e.i&&(t.preventDefault(),e.i()))}),O(e.c,`blur`,function(){e.i&&(e.s(),e.i())})});function eN(e){b(e.a,[`_bl`,`_l_`]),FM(e.b),IM(e.b,14),LM(e.b,`_bm`),b(e.c,[`_bn`,MM]),ZM(e,null),QM(e,{timer:0}),$M(e)}var tN=E(16,e=>{KM(e),WM(e)}),nN=y(`t3`,e=>_(e,{onMount:function(){e.j&&e.c.focus()}})),rN=E(9,nN),iN=E(8),aN=e=>function(t){e.u(t)},oN=e=>t=>{if(e.q&&clearTimeout(e.q),!t){e.q=0,ZM(e,null),qM(e,``);return}ZM(e,t),e.q=setTimeout(e.s,150)},sN=e=>()=>{e.q&&=(clearTimeout(e.q),0);let t=e.m===null?e.k||``:e.m;ZM(e,null),qM(e,t)};u.t0=aN,u.t2=oN,u.t1=sN;var cN=new Set([`/`,`.`,`-`,`_`,` `]);function lN(e,t){if(t===0)return!0;let n=e[t-1];if(cN.has(n))return!0;let r=e[t];return r!==r.toLowerCase()&&n===n.toLowerCase()}function uN(e,t,n){let r=0;for(let i=0;i<t.length;i++){let a=t[i];r+=1,lN(e,a)&&(r+=8),i&&t[i-1]===a-1?r+=6:i&&(r-=Math.min(4,a-t[i-1]-1)),a>=n&&(r+=3),a===n&&(r+=6)}return r}function dN(e,t,n){let r=0,i=-1;for(let a=n;a<t.length;a++)if(t[a]===e[r]&&++r===e.length){i=a;break}if(i<0)return null;let a=[];r=e.length-1;for(let o=i;o>=n&&r>=0;o--)t[o]===e[r]&&(a.push(o),r--);return a.reverse()}function fN(e,t,n,r){let i=[],a=r;for(let r=0;r<e.length;r++){let o=i[i.length-1];if(o!=null&&n[o+1]===e[r]){i.push(o+1);continue}let s=a;for(;s<n.length&&!(n[s]===e[r]&&lN(t,s));)s++;if(s>=n.length)return null;i.push(s),a=s+1}return i}function pN(e,t,n,r,i){let a=dN(e,n,r);if(!a)return null;let o=fN(e,t,n,r),s=uN(t,a,i),c=o?uN(t,o,i):-1/0;return c>s?{score:c,hits:o}:{score:s,hits:a}}function mN(e,t,n,r){for(let i=t.indexOf(n,r);i!==-1;i=t.indexOf(n,i+1))if(lN(e,i))return!0;return!1}function hN(e,t){let n=e.split(/\s+/).filter(Boolean);if(!n.length)return{score:0,hits:[]};let r=t.toLowerCase(),i=t.lastIndexOf(`/`)+1,a=0,o=new Set;for(let e of n){let n=e.toLowerCase(),s=pN(n,t,r,i,i),c=s??pN(n,t,r,0,i);if(!c)return null;s&&mN(t,r,n,i)&&(a+=20),r.slice(i)===n&&(a+=30),a+=c.score;for(let e of c.hits)o.add(e)}return a-=t.length/100,{score:a,hits:[...o].sort((e,t)=>e-t)}}function gN(e){let t=e.match(/^(.*?):(\d+)(?::\d+)?\s*$/);return t?{query:t[1],line:Number(t[2])}:{query:e,line:0}}function _N(e,t,n,r){let i=[];for(let r of e){let e=hN(n,t(r));e&&i.push({item:r,match:e})}return i.sort((e,n)=>n.match.score-e.match.score||t(e.item).localeCompare(t(n.item))),i.slice(0,r)}var vN=`_lD _9 _M`,yN=Le,bN=(e=>`/${e}&`)(` b`),xN=60;function SN(e,t,n,r){let i=[],a=new Set(t);for(let t=n;t<r;t++){let n=a.has(t),r=i[i.length-1];r&&r.hit===n?r.text+=e[t]:i.push({text:e[t],hit:n})}return i}var CN=c(0,1,e=>l(e.a,e._.e)),wN=CN,TN=c(0,0,e=>l(e.b,e._.e)),EN=g(0,`<mark> </mark>`,` D `,e=>{TN._(e),b(e.a,`_lB`)},` `,` `,wN),DN=(e,t)=>EN(e,+!t),ON=(e,t)=>{DN(e,t[0]?.hit),kN(e,t[0]?.text)},kN=E(4,e=>{TN(e),CN(e)}),AN=c(0,1,e=>l(e.a,e._.e)),jN=AN,MN=c(0,0,e=>l(e.b,e._.e)),NN=g(0,`<mark> </mark>`,` D `,e=>{MN._(e),b(e.a,`_lB`)},` `,` `,jN),PN=(e,t)=>NN(e,+!t),FN=(e,t)=>{PN(e,t[0]?.hit),IN(e,t[0]?.text)},IN=E(4,e=>{MN(e),AN(e)}),LN=e=>b(e.a,o),RN=c(5,0,e=>l(e.b,e._.n)),zN=e=>{RN._(e),b(e.a,vN)},BN=x(34,e=>l(e.b,e._._._._.u),e=>e._._._._),VN=e=>{BN(e),b(e.a,`_lC`)},HN=s(2,e=>l(e.b,e._._._.l?`Loading files…`:e._._._.s?`No file matches “${f(e._._._.s)}”.`:`Type part of a file's name. Add :42 to open it at line 42.`)),UN=x(29,HN,e=>e._._._),WN=e=>{UN(e),GN(e),b(e.a,`_dA`)},GN=x(33,HN,e=>e._._._),KN=x(28,e=>l(e.b,e._._._._.k),e=>e._._._._),qN=g(0,`<li role=presentation>Recently opened</li>`,` `,LN,`<li role=presentation> </li>`,` D `,e=>{KN(e),b(e.a,o)}),JN=s(17,e=>qN(e,!e._._._.s&&e.o===0?0:e.j&&(e.o===0||!e._._._.v[e.o-1].more)?1:2),3),YN=x(33,JN,e=>e._._._),XN=y(`J4`,e=>{O(e.c,`mousemove`,function(){e._._._.p!==e.o&&LP(e._._._,e.o)}),O(e.c,`click`,function(){e._._._.a1(e.o)})}),ZN=e=>{YN(e),eP(e),tP(e),rP(e),b(e.d,`_lz`),b(e.e,`_lA`),XN(e)},QN=g(6,`<span>:<!></span>`,` Db%`,VN),$N=s(16,e=>QN(e,e._._._.u&&e.o===e._._._.y?0:1),2),eP=x(34,$N,e=>e._._._),tP=x(35,JN,e=>e._._._),nP=s(15,e=>{C(e.b,`aria-selected`,e.o===e._._._.y?`true`:`false`),b(e.c,[`_dv`,e.o===e._._._.y&&`_du`])}),rP=x(37,e=>{nP(e),$N(e)},e=>e._._._),iP=E(9,JN),aP=E(14,e=>{JN(e),nP(e),$N(e)}),oP=h(3,`<!><!><!>`,`b%`,0,FN),sP=h(4,`<!><!><!>`,`b%`,0,ON),cP=s(20,e=>{oP(e,[SN(e.s,e.m,e.t,e.s?.length)]),sP(e,[SN(e.s,e.m,0,Math.max(0,e.t-1))])},2),lP=E(19,cP),uP=E(18,e=>{C(e.c,`title`,e.s),lP(e,e.s.lastIndexOf(`/`)+1),cP(e)}),dP=E(12,cP),fP=g(5,`<span> </span>`,` D `,zN),pP=E(13,e=>{fP(e,+!e.n),RN(e)}),mP=(e,t)=>{iP(e,t[0]?.more),uP(e,t[0]?.item?.path),pP(e,t[0]?.item?.hint),dP(e,t[0]?.hits),aP(e,t[1])},hP=x(31,e=>T(e,`c`,e._._.o,iF(e)),e=>e._._),gP=y(`J6`,e=>{S(e,`c`),O(e.d,`click`,function(){e._._.z()})}),_P=e=>{hP(e),vP(e),bP(e),CP(e),b(e.a,`_dp`),de(e.b),ue(e.b,14),fe(e.b),b(e.c,a),b(e.d,[me,`_dr`]),ve(e.e),pe(e.e,16),ne(e.e),b(e.f,`_ds`),gP(e)},vP=x(32,e=>{C(e.c,`aria-controls`,e._._.q),C(e.f,`id`,e._._.q)},e=>e._._),yP=h(5,`<!><!><li role=option><button type=button><span></span><span></span><!><!></button></li>`,`b%b D D b b%b%`,ZN,mP),bP=x(35,e=>yP(e,[e._._.v,e=>`${e.more?`+`:``}${e.item.key}`]),e=>e._._),xP=g(6,`<p> </p>`,` D `,WN),SP=y(`J5`,e=>O(e.c,`keydown`,function(t){if(t.key===`ArrowDown`||t.key===`ArrowUp`){t.preventDefault();let n=e._._.w;n&&LP(e._._,(e._._.y+(t.key===`ArrowDown`?1:-1)+n)%n)}else t.key===`Enter`&&(t.preventDefault(),e._._.a1(e._._.y))})),CP=x(36,e=>{xP(e,+!!e._._.w),SP(e)},e=>e._._),wP=g(0,((e,t)=>`<div>${e}<input type=search autofocus autocomplete=off placeholder="Go to file (name:42 for a line)" aria-label="Go to file" role=combobox aria-expanded=true><button type=button title=Close aria-label=Close>${t}</button></div><ul role=listbox></ul><!><!>`)(le,ae),((e,t)=>` D/${e}& b D/${t}&m b%c`)(ie,_e),_P),TP=x(30,e=>wP(e,+!e._.m)),EP=v(`J7`,`<!><!><!>`,`b%`,TP),DP=D(TP),OP=p(12,e=>{Pe(e.a,e.m),DP(e)}),kP=s(5,e=>OP(e,e.d,e.e)),AP=E(3,kP),jP=E(4,kP),MP=(e,t)=>{qP(e,t?.query),YP(e,t?.line)},NP=D(hP),PP=d(14,e=>{MP(e,gN(e.o.trim())),NP(e)}),FP=E(24,D(rP)),IP=s(23,e=>FP(e,Math.min(e.p,Math.max(0,e.w-1)))),LP=d(15,IP),RP=E(16),zP=E(27),BP=s(26,e=>zP(e,aF(e)),3),VP=E(25,BP);function HP(e){Me(e.a),Be(e.a,EP(e)),je(e.a,`Go to file`),ke(e.a,[`_cO`,`_do`]),Ve(e.a,sF(e)),ze(e.a,!0),Ne(e.a),Ie(e.a),Ae(e.a),Fe(e.a),Re(e.a,{}),PP(e,``),LP(e,0),RP(e,m(e)),VP(e,oF(e))}var UP=D(bP,tP),WP=E(21,e=>{ZP(e,e.v?.length),BP(e),UP(e)}),GP=s(19,e=>WP(e,(()=>{let t=e.s;if(!t){let t=new Map(e.g.map(e=>[e.key,e]));return(e.h||[]).map(e=>t.get(e)).filter(e=>!!e).map(e=>({item:e,hits:[],more:!1}))}let n=_N(e.g,e=>e.path,t,xN).map(e=>({item:e.item,hits:e.match.hits,more:!1})),r=e.i?_N(e.i.items,e=>e.path,t,xN).map(e=>({item:e.item,hits:e.match.hits,more:!0})):[];return[...n,...r]})()),3),KP=D(YN,GN),qP=E(18,e=>{GP(e),KP(e)}),JP=D(eP,BN),YP=E(20,e=>{BP(e),JP(e)}),XP=D(CP),ZP=E(22,e=>{IP(e),XP(e)}),QP=E(6,GP),$P=E(7,GP),eF=E(8,e=>{nF(e,e.i?.label),GP(e)}),tF=E(9,BP),nF=E(10,D(KN)),rF=E(11,D(UN)),iF=e=>function(t){PP(e._._,t),LP(e._._,0)},aF=e=>t=>{let n=e.v[t];if(!n)return;let r=e.u;e.z(),e.j(n.item.key,r,n.more)},oF=e=>()=>{OP(e,!1),PP(e,``),LP(e,0)},sF=e=>t=>{OP(e,t)};u.J0=iF,u.J2=aF,u.J1=oF,u.J3=sF;export{Zb as $,BS as A,Yx as B,kM as C,US as D,EM as E,eS as F,Wx as G,qx as H,$x as I,Lx as J,Ux as K,Zx as L,nS as M,rS as N,GS as O,tS as P,ox as Q,Qx as R,PM as S,DM as T,Gx as U,Jx as V,Kx as W,px as X,tx as Y,fx as Z,zM as _,AP as a,Kb as at,FM as b,HP as c,Tb as ct,rN as d,ob as dt,Jb as et,iN as f,cg as ft,RM as g,eN as h,tF as i,Gb as it,MS as j,WS as k,yN as l,Nb as lt,XM as m,rF as n,Yb as nt,jP as o,Fb as ot,YM as p,Vx as q,eF as r,Qb as rt,$P as s,Ib as st,QP as t,Xb as tt,bN as u,Mb as ut,LM as v,jM as w,NM as x,IM as y,Xx as z};
|