t3 0.0.0-alpha.16 → 0.0.0-alpha.19
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/client/assets/DiffPanel-Bc1OLiPP.js +1467 -0
- package/dist/client/assets/{angular-html-Dx6GCecs.js → angular-html-CRjrfS04.js} +1 -1
- package/dist/client/assets/{angular-ts-Drw5i5pT.js → angular-ts-BGir_rwD.js} +1 -1
- package/dist/client/assets/{apl-Cex2k_zS.js → apl-5DDqv_Oo.js} +1 -1
- package/dist/client/assets/asciidoc-BIk44EBQ.js +1 -0
- package/dist/client/assets/{astro-CJDX9Ra2.js → astro-Dj01mIak.js} +1 -1
- package/dist/client/assets/ayu-dark-cnu7RpeM.js +1 -0
- package/dist/client/assets/ayu-light-fT-k4EEA.js +1 -0
- package/dist/client/assets/ayu-mirage-DZXsmI8I.js +1 -0
- package/dist/client/assets/{blade-C8obLj7o.js → blade-gr3X876m.js} +1 -1
- package/dist/client/assets/{bsl-B1qbqNES.js → bsl-w_5qk-KK.js} +1 -1
- package/dist/client/assets/{c-Drl2UFFV.js → c-ukqYSIuV.js} +1 -1
- package/dist/client/assets/c3-By3mlKPS.js +1 -0
- package/dist/client/assets/{cairo-BDj8wWhy.js → cairo-Dwqgrkm6.js} +1 -1
- package/dist/client/assets/{cobol-Btg9Sc1J.js → cobol-D-LW7mEK.js} +1 -1
- package/dist/client/assets/{coffee-BP9e7YBr.js → coffee-BtOiMwvf.js} +1 -1
- package/dist/client/assets/{cpp-CmtwZp0U.js → cpp-DdhpR3Xz.js} +1 -1
- package/dist/client/assets/{crystal-CI61C0cn.js → crystal-BIZwHTrP.js} +1 -1
- package/dist/client/assets/{css-DriOgFlV.js → css--rVQ7YVz.js} +1 -1
- package/dist/client/assets/{edge-BreIALQv.js → edge-BqBSxWBs.js} +1 -1
- package/dist/client/assets/{elixir-a3A4Yfla.js → elixir-BCxeIuRr.js} +1 -1
- package/dist/client/assets/{elm-SeJX54HW.js → elm-Br0Ps4DN.js} +1 -1
- package/dist/client/assets/{erb-ICln_oP8.js → erb-DI5DcsWO.js} +1 -1
- package/dist/client/assets/{erlang-Bc4hQuqa.js → erlang-CiFIqHy7.js} +1 -1
- package/dist/client/assets/{fortran-fixed-form-B02FOYI-.js → fortran-fixed-form-Zrjf__wl.js} +1 -1
- package/dist/client/assets/{fsharp-DhdR18vN.js → fsharp-DzA60O5L.js} +1 -1
- package/dist/client/assets/{gdresource-DgnrMPIx.js → gdresource-BkZL9Kop.js} +1 -1
- package/dist/client/assets/{git-commit-DGJi7qBD.js → git-commit-BiZza_8I.js} +1 -1
- package/dist/client/assets/{git-rebase-j3E1sO1_.js → git-rebase-M-t077u7.js} +1 -1
- package/dist/client/assets/{glimmer-js-CyJzEX2w.js → glimmer-js-BxIJl1p-.js} +1 -1
- package/dist/client/assets/{glimmer-ts-F4jU-l3L.js → glimmer-ts-C6BWznIz.js} +1 -1
- package/dist/client/assets/{glsl-CEWMJrXN.js → glsl-BNL0PbqG.js} +1 -1
- package/dist/client/assets/{graphql-DPE7Ob6O.js → graphql-Cwh0hNz7.js} +1 -1
- package/dist/client/assets/{hack-BK0HIomi.js → hack-CGsdxQl7.js} +1 -1
- package/dist/client/assets/{haml-beYE1CUa.js → haml-DKQbVBrQ.js} +1 -1
- package/dist/client/assets/{handlebars-D0L4aRQa.js → handlebars-DJUTV2Bd.js} +1 -1
- package/dist/client/assets/{html-CTRidf6p.js → html-Dq2tQ5cT.js} +1 -1
- package/dist/client/assets/{html-derivative-CkTwvk8J.js → html-derivative-BHw55ltK.js} +1 -1
- package/dist/client/assets/{http-B8S01uTs.js → http-DHYaWiuY.js} +1 -1
- package/dist/client/assets/{hurl-kqvQ-nah.js → hurl-CBOFMB1n.js} +1 -1
- package/dist/client/assets/{hxml-adC65L_J.js → hxml-CZ0s3AQV.js} +1 -1
- package/dist/client/assets/index-BVEkkLN1.css +1 -0
- package/dist/client/assets/index-XENPR9M4.js +285 -0
- package/dist/client/assets/{java-hzquh5ZM.js → java-Bkw9w1Kj.js} +1 -1
- package/dist/client/assets/{javascript-I389oYyZ.js → javascript-3p0gOkx9.js} +1 -1
- package/dist/client/assets/{jinja-Dqg1kXsF.js → jinja-BrH57TTL.js} +1 -1
- package/dist/client/assets/{jison-BVtxQjvf.js → jison-nfLCKLpF.js} +1 -1
- package/dist/client/assets/{json-D_so_X_n.js → json-DVcKLnVO.js} +1 -1
- package/dist/client/assets/{jsx-9S9x-6jD.js → jsx-BN3u6ocj.js} +1 -1
- package/dist/client/assets/{julia-DXf_rA95.js → julia-DrkOG3u9.js} +1 -1
- package/dist/client/assets/latex-DJ1TFIZI.js +1 -0
- package/dist/client/assets/{liquid-D7YlQvVN.js → liquid-D_wIcjBo.js} +1 -1
- package/dist/client/assets/{llvm-Dy3qORTl.js → llvm-DvcEHvRz.js} +1 -1
- package/dist/client/assets/{lua-DSuQC7CQ.js → lua-CY6wjnMh.js} +1 -1
- package/dist/client/assets/marko-C5g-itwz.js +1 -0
- package/dist/client/assets/{mdc-DQfSZFsE.js → mdc-Nazlt0Nx.js} +1 -1
- package/dist/client/assets/mojo-KNFwB0KA.js +1 -0
- package/dist/client/assets/moonbit-d7SMTL5u.js +1 -0
- package/dist/client/assets/nextflow-C-Yfm6rp.js +1 -0
- package/dist/client/assets/{nginx-CQGkNn0r.js → nginx-BUMTJPV_.js} +1 -1
- package/dist/client/assets/{nim-lfXUUtwz.js → nim-DtKYGNYb.js} +1 -1
- package/dist/client/assets/nushell-CFIIXPrv.js +1 -0
- package/dist/client/assets/{perl-B7wU5ROp.js → perl-CyjT5Sei.js} +1 -1
- package/dist/client/assets/{php-vjR9RwpQ.js → php-DAgEMv29.js} +1 -1
- package/dist/client/assets/pierre-dark-OpLWNq1f.js +1 -0
- package/dist/client/assets/pierre-light-BRmWerDN.js +1 -0
- package/dist/client/assets/{pug-BaNZ4Kv2.js → pug-00AZHPeY.js} +1 -1
- package/dist/client/assets/{qml-CFPmEdy1.js → qml-BpxdA4n1.js} +1 -1
- package/dist/client/assets/{r-BIAfgPV1.js → r-DL8yUest.js} +1 -1
- package/dist/client/assets/{razor-Lf0Kb1U6.js → razor-CeIHKSSV.js} +1 -1
- package/dist/client/assets/{regexp-DDsFHwEC.js → regexp-C9rwDX3c.js} +1 -1
- package/dist/client/assets/ron-DdPfl6h5.js +1 -0
- package/dist/client/assets/{rst-VWMQCfsb.js → rst-BqCGy89b.js} +1 -1
- package/dist/client/assets/ruby-BNUbX397.js +1 -0
- package/dist/client/assets/{sas-BHmuBXO7.js → sas-ChR2HvHn.js} +1 -1
- package/dist/client/assets/{scss-C8m3XWhx.js → scss-G3HdI6Do.js} +1 -1
- package/dist/client/assets/{shaderlab-DZ3Lsiak.js → shaderlab-CbzjbEvk.js} +1 -1
- package/dist/client/assets/{shellscript-B3cb3xbK.js → shellscript-Cr900R6t.js} +1 -1
- package/dist/client/assets/{shellsession-CqMFv_hR.js → shellsession-Zhbrj7H8.js} +1 -1
- package/dist/client/assets/{soy-3nfPvPWc.js → soy-2rSc87-m.js} +1 -1
- package/dist/client/assets/{sparql-B9c85a_o.js → sparql-y7RYfVC1.js} +1 -1
- package/dist/client/assets/{sql-BP6VNLoV.js → sql-LybXCoD_.js} +1 -1
- package/dist/client/assets/{stata-BOK-BH4I.js → stata-Cu6wmu-A.js} +1 -1
- package/dist/client/assets/{surrealql-BvPYpgCW.js → surrealql-CksTdaGB.js} +1 -1
- package/dist/client/assets/svelte-DJhiqzcz.js +1 -0
- package/dist/client/assets/{swift-C72NbAtg.js → swift-D0-2Zecd.js} +1 -1
- package/dist/client/assets/{templ-Z-SiVCft.js → templ-q5bDY6Go.js} +1 -1
- package/dist/client/assets/tex-DGn-1ixE.js +1 -0
- package/dist/client/assets/{ts-tags-CZV8dFbv.js → ts-tags-BjxVDKqw.js} +1 -1
- package/dist/client/assets/{tsx-Biy7lyeo.js → tsx-CbCYKwP6.js} +1 -1
- package/dist/client/assets/{twig-BMM3W0np.js → twig-Djv0sXYh.js} +1 -1
- package/dist/client/assets/{typescript-w1yzhFOx.js → typescript-aDgn_wpV.js} +1 -1
- package/dist/client/assets/{vue-CvVlh4Bc.js → vue-0agY6UI2.js} +1 -1
- package/dist/client/assets/{vue-html-BV-g2ahc.js → vue-html-CxSbOcNP.js} +1 -1
- package/dist/client/assets/{vue-vine-0M_2eLWQ.js → vue-vine-DYARpsH-.js} +1 -1
- package/dist/client/assets/{xml-BZU1uFJV.js → xml-7Yawd7Do.js} +1 -1
- package/dist/client/assets/{xsl-CUXd8h7T.js → xsl-COcuSGq0.js} +1 -1
- package/dist/client/assets/{yaml-CLIciX_Z.js → yaml-Ba5yu-B2.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/client/assets/DiffPanel-C5AvO09T.js +0 -1491
- package/dist/client/assets/asciidoc-BH2sf2K4.js +0 -1
- package/dist/client/assets/ayu-dark-on7xzq_B.js +0 -1
- package/dist/client/assets/ayu-light-DnGeGGc2.js +0 -1
- package/dist/client/assets/ayu-mirage-DG3LlYC_.js +0 -1
- package/dist/client/assets/bird2-BRyaEJd0.js +0 -1
- package/dist/client/assets/c3-DTTbp5N2.js +0 -1
- package/dist/client/assets/horizon-bright-pEOice34.js +0 -1
- package/dist/client/assets/index-DQlT121C.js +0 -285
- package/dist/client/assets/index-egb3fmcf.css +0 -1
- package/dist/client/assets/just-BJNE0JU6.js +0 -1
- package/dist/client/assets/latex-CmYvP6Tr.js +0 -1
- package/dist/client/assets/marko-DC8XnDo-.js +0 -1
- package/dist/client/assets/mojo-1Omp2pIo.js +0 -1
- package/dist/client/assets/moonbit-DZzq699o.js +0 -1
- package/dist/client/assets/nextflow-JEyYUlIq.js +0 -1
- package/dist/client/assets/nextflow-groovy-wvmJO4hi.js +0 -1
- package/dist/client/assets/nushell-BQ_rO0AM.js +0 -1
- package/dist/client/assets/pierre-dark-Os0_Ccr_.js +0 -1
- package/dist/client/assets/pierre-light-BrTpOEi0.js +0 -1
- package/dist/client/assets/ron-DiDyR9oa.js +0 -1
- package/dist/client/assets/ruby-Bht9D7e0.js +0 -1
- package/dist/client/assets/svelte-BYo7loCR.js +0 -1
- package/dist/client/assets/tex-CkrVTDdg.js +0 -1
- /package/dist/client/assets/{abap-smLpETzL.js → abap-BdvmRIgS.js} +0 -0
- /package/dist/client/assets/{actionscript-3-o-aRvjY5.js → actionscript-3-CGv72Q9E.js} +0 -0
- /package/dist/client/assets/{ada-D5RRX1i4.js → ada-DccgTE5d.js} +0 -0
- /package/dist/client/assets/{andromeeda-N4z3YzmR.js → andromeeda-Db4Ungye.js} +0 -0
- /package/dist/client/assets/{apache-DttKlSqg.js → apache-BIH3t0yU.js} +0 -0
- /package/dist/client/assets/{apex-DL7j-a2n.js → apex-DDEdz31p.js} +0 -0
- /package/dist/client/assets/{applescript-DCbL_2FX.js → applescript-D83o2tzk.js} +0 -0
- /package/dist/client/assets/{ara-DqheWJCe.js → ara-aMYTwTUq.js} +0 -0
- /package/dist/client/assets/{asm-rfjOMz3U.js → asm-DV1bto6h.js} +0 -0
- /package/dist/client/assets/{aurora-x-CND-FqEb.js → aurora-x-Bh93n5xO.js} +0 -0
- /package/dist/client/assets/{awk-CMV5n9Z7.js → awk-FFWx9ZrE.js} +0 -0
- /package/dist/client/assets/{ballerina-BjMqJjlr.js → ballerina-BCARR-zK.js} +0 -0
- /package/dist/client/assets/{bat-BaVbo_qw.js → bat-DCRdiK45.js} +0 -0
- /package/dist/client/assets/{beancount-DBt5Mbc_.js → beancount-f8f3BBqB.js} +0 -0
- /package/dist/client/assets/{berry-Cyjuxiss.js → berry-K2BKJgA1.js} +0 -0
- /package/dist/client/assets/{bibtex-BV_0nsPq.js → bibtex-DkakgDlR.js} +0 -0
- /package/dist/client/assets/{bicep-C2gEwu4J.js → bicep-CEma4qZD.js} +0 -0
- /package/dist/client/assets/{cadence-CPz83cmI.js → cadence-CtYAr_VT.js} +0 -0
- /package/dist/client/assets/{catppuccin-frappe-Dr22sraq.js → catppuccin-frappe-DfuRPOsa.js} +0 -0
- /package/dist/client/assets/{catppuccin-latte-C57EeX8c.js → catppuccin-latte-BsQ4DjM-.js} +0 -0
- /package/dist/client/assets/{catppuccin-macchiato-CpheI4uD.js → catppuccin-macchiato-CDfGeQlU.js} +0 -0
- /package/dist/client/assets/{catppuccin-mocha-D8Lmdks_.js → catppuccin-mocha-l8I-Acgd.js} +0 -0
- /package/dist/client/assets/{clarity-CFJ2Yc3q.js → clarity-DApjatNb.js} +0 -0
- /package/dist/client/assets/{clojure-6R01QgJC.js → clojure-BykelabX.js} +0 -0
- /package/dist/client/assets/{cmake-D5rSbMir.js → cmake-Y7DIjNrP.js} +0 -0
- /package/dist/client/assets/{codeowners-_3A-ClkN.js → codeowners-BG0ZtVWx.js} +0 -0
- /package/dist/client/assets/{codeql-DlIhJTR7.js → codeql-DFHUycm6.js} +0 -0
- /package/dist/client/assets/{common-lisp-BvQzz173.js → common-lisp-B-vtBh5k.js} +0 -0
- /package/dist/client/assets/{coq-DTNXReIC.js → coq-CYI6Fu0p.js} +0 -0
- /package/dist/client/assets/{csharp-BDKQY1K9.js → csharp-SyZLz5MX.js} +0 -0
- /package/dist/client/assets/{csv-DNUpVBxl.js → csv-DHZZZm7X.js} +0 -0
- /package/dist/client/assets/{cue-DDdBc2s3.js → cue-CoG3mg2I.js} +0 -0
- /package/dist/client/assets/{cypher-CguaznO2.js → cypher-DXMjTNW2.js} +0 -0
- /package/dist/client/assets/{d-CHcoyjv3.js → d-CgG1_yzd.js} +0 -0
- /package/dist/client/assets/{dark-plus-CqeW_0kH.js → dark-plus-CXSzaZwK.js} +0 -0
- /package/dist/client/assets/{dart-RM3aRphk.js → dart-CBBhoFBf.js} +0 -0
- /package/dist/client/assets/{dax-nbnY1d79.js → dax-CmHFymtn.js} +0 -0
- /package/dist/client/assets/{desktop-BD76cvxT.js → desktop-Db8-IVJE.js} +0 -0
- /package/dist/client/assets/{diff-CdkWtnkL.js → diff-CcKimul9.js} +0 -0
- /package/dist/client/assets/{docker-ZyPHc6zB.js → docker-DerYNWsG.js} +0 -0
- /package/dist/client/assets/{dotenv-BdJZEwA6.js → dotenv-B7nhh57a.js} +0 -0
- /package/dist/client/assets/{dracula-CtqCPLGa.js → dracula-B3WeBJmc.js} +0 -0
- /package/dist/client/assets/{dracula-soft-DmBpwRAy.js → dracula-soft-znwpR7J7.js} +0 -0
- /package/dist/client/assets/{dream-maker-BJL4qlg3.js → dream-maker-lggPVUUF.js} +0 -0
- /package/dist/client/assets/{emacs-lisp-_LyYa2Ky.js → emacs-lisp-CCHFxp4J.js} +0 -0
- /package/dist/client/assets/{everforest-dark-CrbyKk4n.js → everforest-dark-Buuww5F8.js} +0 -0
- /package/dist/client/assets/{everforest-light-DRbSh8Tm.js → everforest-light-8IVF-uNj.js} +0 -0
- /package/dist/client/assets/{fennel-CC2BkRsS.js → fennel-CFfxI1rI.js} +0 -0
- /package/dist/client/assets/{fish-D2ZCzqcE.js → fish-71LcOjp4.js} +0 -0
- /package/dist/client/assets/{fluent-DKAm3m7q.js → fluent-BU_Ao1YA.js} +0 -0
- /package/dist/client/assets/{fortran-free-form-BPTf0lbT.js → fortran-free-form-BY6kp7zD.js} +0 -0
- /package/dist/client/assets/{gdscript-CsadCSaZ.js → gdscript-loFXiTc4.js} +0 -0
- /package/dist/client/assets/{gdshader-PfnN_8tR.js → gdshader-DnGwCtth.js} +0 -0
- /package/dist/client/assets/{genie-Bj-orPAV.js → genie-Dv3uEwT1.js} +0 -0
- /package/dist/client/assets/{gherkin-COVWpJ-Q.js → gherkin-CW7GXiVM.js} +0 -0
- /package/dist/client/assets/{github-dark-ipGuFGYC.js → github-dark-Bt0UJmYQ.js} +0 -0
- /package/dist/client/assets/{github-dark-default-DX3IG_X0.js → github-dark-default-CBjy4IHc.js} +0 -0
- /package/dist/client/assets/{github-dark-dimmed-CH6p_7ez.js → github-dark-dimmed-D_HhJpFE.js} +0 -0
- /package/dist/client/assets/{github-dark-high-contrast-Bg2sSao5.js → github-dark-high-contrast-DVKQxfrK.js} +0 -0
- /package/dist/client/assets/{github-light-BxjqOQl0.js → github-light-CmXEz0Dj.js} +0 -0
- /package/dist/client/assets/{github-light-default-DwpDd1IQ.js → github-light-default-C7iwGnqT.js} +0 -0
- /package/dist/client/assets/{github-light-high-contrast-C0QeixPf.js → github-light-high-contrast-by6loxrx.js} +0 -0
- /package/dist/client/assets/{gleam-BF2NigGj.js → gleam-DC353_2f.js} +0 -0
- /package/dist/client/assets/{gn-CMIt9roj.js → gn-BT6NjD2b.js} +0 -0
- /package/dist/client/assets/{gnuplot-DgWlRTEj.js → gnuplot-CAlYZy39.js} +0 -0
- /package/dist/client/assets/{go-DLnOLj8q.js → go-CVxNRO9n.js} +0 -0
- /package/dist/client/assets/{groovy-B9qLWIkE.js → groovy-BkFseOo9.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-hard-BIMX9ePb.js → gruvbox-dark-hard-DN6fydWj.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-medium-DxuwyVzM.js → gruvbox-dark-medium-CQ8zX8bx.js} +0 -0
- /package/dist/client/assets/{gruvbox-dark-soft-ba2fjht0.js → gruvbox-dark-soft-B7TFWNuO.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-hard-DAJK2PqC.js → gruvbox-light-hard-4IkLHmts.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-medium-WRifDAJD.js → gruvbox-light-medium-GXeiXGL9.js} +0 -0
- /package/dist/client/assets/{gruvbox-light-soft-B0dBOoVB.js → gruvbox-light-soft-C_VV_bLN.js} +0 -0
- /package/dist/client/assets/{haskell-BaGpmm_c.js → haskell-CgBdys-g.js} +0 -0
- /package/dist/client/assets/{haxe-DfXTCEOz.js → haxe-Q_5-Us4F.js} +0 -0
- /package/dist/client/assets/{hcl-CbCtpSbi.js → hcl-D1Y6h8Ni.js} +0 -0
- /package/dist/client/assets/{hjson-_4-w-pHU.js → hjson-DpJrqEh-.js} +0 -0
- /package/dist/client/assets/{hlsl-DpuYn7pp.js → hlsl-DWw1Hwsc.js} +0 -0
- /package/dist/client/assets/{horizon-C5RtD1fY.js → horizon-zJHXC0J5.js} +0 -0
- /package/dist/client/assets/{houston-A0zg9vNP.js → houston-B3ogBwnz.js} +0 -0
- /package/dist/client/assets/{hy-t9zDXBje.js → hy-DcElotMq.js} +0 -0
- /package/dist/client/assets/{imba-Bxu-TDfw.js → imba-DYyLfx22.js} +0 -0
- /package/dist/client/assets/{ini-D-v34c8N.js → ini-csMV2D7T.js} +0 -0
- /package/dist/client/assets/{json5-D0XL1D5m.js → json5-D6bd72oE.js} +0 -0
- /package/dist/client/assets/{jsonc-BBgf3TX3.js → jsonc-CqkYFrbt.js} +0 -0
- /package/dist/client/assets/{jsonl-KrKLbtB7.js → jsonl-RCf29gRP.js} +0 -0
- /package/dist/client/assets/{jsonnet-B2ZwWMOt.js → jsonnet-CSrvooJ7.js} +0 -0
- /package/dist/client/assets/{jssm-ByRpI9-B.js → jssm-yiNjymqf.js} +0 -0
- /package/dist/client/assets/{kanagawa-dragon-CtPmcCMp.js → kanagawa-dragon-CMFikbd6.js} +0 -0
- /package/dist/client/assets/{kanagawa-lotus-DpOXEGCa.js → kanagawa-lotus-C5UXF7Bs.js} +0 -0
- /package/dist/client/assets/{kanagawa-wave-CLVCyc-n.js → kanagawa-wave-DyduAgCZ.js} +0 -0
- /package/dist/client/assets/{kdl-6FPPEH4H.js → kdl-ChNQ32U5.js} +0 -0
- /package/dist/client/assets/{kotlin-D4L3Nd2D.js → kotlin-CDf0F8oF.js} +0 -0
- /package/dist/client/assets/{kusto-D-mmc07O.js → kusto-DMjUl49Y.js} +0 -0
- /package/dist/client/assets/{laserwave-7fEj4XGb.js → laserwave-mA8Yjqfo.js} +0 -0
- /package/dist/client/assets/{lean-BMVMuP2E.js → lean-nKgJ_hld.js} +0 -0
- /package/dist/client/assets/{less-C95PyOu0.js → less-Zf4u8fOP.js} +0 -0
- /package/dist/client/assets/{light-plus-DHI2dh3p.js → light-plus-CxokWp27.js} +0 -0
- /package/dist/client/assets/{log-BQop7fzg.js → log-B3gbyM7r.js} +0 -0
- /package/dist/client/assets/{logo-DKtnYmrp.js → logo-DygXKddr.js} +0 -0
- /package/dist/client/assets/{luau-Dha4KG0q.js → luau-CRvZZ_JL.js} +0 -0
- /package/dist/client/assets/{make-DfmS6buu.js → make-Dym-awm2.js} +0 -0
- /package/dist/client/assets/{markdown-BaI9LyM4.js → markdown-C10XOqho.js} +0 -0
- /package/dist/client/assets/{material-theme-Dm6ETY8i.js → material-theme-Dh0Hfgc9.js} +0 -0
- /package/dist/client/assets/{material-theme-darker-BeyjmM5Z.js → material-theme-darker-r-dcYt7X.js} +0 -0
- /package/dist/client/assets/{material-theme-lighter-CCOYYzKL.js → material-theme-lighter-gQ3JnqxW.js} +0 -0
- /package/dist/client/assets/{material-theme-ocean-CUtPiiX3.js → material-theme-ocean-DY41XWl2.js} +0 -0
- /package/dist/client/assets/{material-theme-palenight-2L4zMwIM.js → material-theme-palenight-BLbfB6xN.js} +0 -0
- /package/dist/client/assets/{matlab-BT79Cq_j.js → matlab-BuhzjafA.js} +0 -0
- /package/dist/client/assets/{mdx-CxGBwLNt.js → mdx-CqHRnH2I.js} +0 -0
- /package/dist/client/assets/{mermaid-DLf3axBN.js → mermaid-DkDwVNHp.js} +0 -0
- /package/dist/client/assets/{min-dark-B8TUPGHg.js → min-dark-CS_cyN1u.js} +0 -0
- /package/dist/client/assets/{min-light-BDOoBxcA.js → min-light-AiCLxuDN.js} +0 -0
- /package/dist/client/assets/{mipsasm-DXuU_0cI.js → mipsasm-Dj4w76C6.js} +0 -0
- /package/dist/client/assets/{monokai-E_VBmXGZ.js → monokai-m_uBTyxm.js} +0 -0
- /package/dist/client/assets/{move-DxDAOJVd.js → move-BRqqSG_z.js} +0 -0
- /package/dist/client/assets/{narrat-CxDcPPb9.js → narrat-fDFgzhET.js} +0 -0
- /package/dist/client/assets/{night-owl-DefhalNX.js → night-owl-D9h5Ndkj.js} +0 -0
- /package/dist/client/assets/{night-owl-light-byb3AbEn.js → night-owl-light-B1H1b6pL.js} +0 -0
- /package/dist/client/assets/{nix-DsFTDHWT.js → nix-2Q7B4-qB.js} +0 -0
- /package/dist/client/assets/{nord-D5rQzHT-.js → nord-CtcF76NW.js} +0 -0
- /package/dist/client/assets/{objective-c-BMq6JT_m.js → objective-c-JwFKDEEO.js} +0 -0
- /package/dist/client/assets/{objective-cpp-DRwojuGv.js → objective-cpp-DIJvv15W.js} +0 -0
- /package/dist/client/assets/{ocaml-e4_gKO6E.js → ocaml-BdBESWBU.js} +0 -0
- /package/dist/client/assets/{odin-mdTPwYOg.js → odin-C6PSgTW1.js} +0 -0
- /package/dist/client/assets/{one-dark-pro-DxXww9jg.js → one-dark-pro-BL6Mm10K.js} +0 -0
- /package/dist/client/assets/{one-light-D9c03w7t.js → one-light-DIxQsRCk.js} +0 -0
- /package/dist/client/assets/{openscad-D2aTdNfr.js → openscad-DKkBtw-B.js} +0 -0
- /package/dist/client/assets/{pascal-D4n_G8vj.js → pascal-BAwp_qsa.js} +0 -0
- /package/dist/client/assets/{pkl-DcjhAp0L.js → pkl-BEivFQY2.js} +0 -0
- /package/dist/client/assets/{plastic-uOsw7z1x.js → plastic-CdMFXOP4.js} +0 -0
- /package/dist/client/assets/{plsql-BSy3Ag0J.js → plsql-B4tIQQvp.js} +0 -0
- /package/dist/client/assets/{po-Be96RYkA.js → po-f6FM1fIA.js} +0 -0
- /package/dist/client/assets/{poimandres-CyO4HORD.js → poimandres-BeQo4lfK.js} +0 -0
- /package/dist/client/assets/{polar-BmhMKWum.js → polar-CpfoMG8j.js} +0 -0
- /package/dist/client/assets/{postcss-BTQso3H9.js → postcss-9eGaqiLc.js} +0 -0
- /package/dist/client/assets/{powerquery-DVyQv3M2.js → powerquery-Dx5UuWwk.js} +0 -0
- /package/dist/client/assets/{powershell-BmtCGJVD.js → powershell-C7z4Qkvz.js} +0 -0
- /package/dist/client/assets/{prisma-CCFA9rEj.js → prisma-BcnqMjD1.js} +0 -0
- /package/dist/client/assets/{prolog-DWGEEo78.js → prolog-D0L_wBl0.js} +0 -0
- /package/dist/client/assets/{proto-C3eop1kM.js → proto-DfrN0jZ_.js} +0 -0
- /package/dist/client/assets/{puppet-C0_7Nv5A.js → puppet-D-veBXwP.js} +0 -0
- /package/dist/client/assets/{purescript-Bv-B8yRw.js → purescript-CCH5mmkO.js} +0 -0
- /package/dist/client/assets/{python-CKg5r0C3.js → python-DV-HoFeK.js} +0 -0
- /package/dist/client/assets/{qmldir-Cqfb4Lox.js → qmldir-CMfFJMYf.js} +0 -0
- /package/dist/client/assets/{qss-Csho9BH8.js → qss-dr-gRVUL.js} +0 -0
- /package/dist/client/assets/{racket-D8-uWeQH.js → racket-kW2n0Hud.js} +0 -0
- /package/dist/client/assets/{raku-Cj4JSa8p.js → raku-CIdRFxAz.js} +0 -0
- /package/dist/client/assets/{red-z4H4llUY.js → red-D6D3HEMy.js} +0 -0
- /package/dist/client/assets/{reg-DXGFiJSl.js → reg-DOtUpIZh.js} +0 -0
- /package/dist/client/assets/{rel-CunnVTBK.js → rel-stkFJ73W.js} +0 -0
- /package/dist/client/assets/{riscv-C8BcOCkS.js → riscv-DlRusncW.js} +0 -0
- /package/dist/client/assets/{rose-pine-BADquuIH.js → rose-pine-BKM4KvAg.js} +0 -0
- /package/dist/client/assets/{rose-pine-dawn-BLcEeBoh.js → rose-pine-dawn-BJh4BDOk.js} +0 -0
- /package/dist/client/assets/{rose-pine-moon-BK_tLY1Y.js → rose-pine-moon-CAQpRBI5.js} +0 -0
- /package/dist/client/assets/{rosmsg-CHmL1Uyj.js → rosmsg-B9A7ZmfK.js} +0 -0
- /package/dist/client/assets/{rust-DjJFInu3.js → rust-Cck_7SxM.js} +0 -0
- /package/dist/client/assets/{sass-D3xZ5o-v.js → sass-qpeWvYRh.js} +0 -0
- /package/dist/client/assets/{scala-B0IRml5w.js → scala-D41TovP3.js} +0 -0
- /package/dist/client/assets/{scheme-BhwcV3Av.js → scheme-BlD3mUkI.js} +0 -0
- /package/dist/client/assets/{sdbl-BmWYR-pI.js → sdbl-BIGj5Rrw.js} +0 -0
- /package/dist/client/assets/{slack-dark-DOnVms5P.js → slack-dark-CB_uZ8EH.js} +0 -0
- /package/dist/client/assets/{slack-ochin-DcRTft4q.js → slack-ochin-B9Cn306E.js} +0 -0
- /package/dist/client/assets/{smalltalk-DVQuUMII.js → smalltalk-CN6ty7MI.js} +0 -0
- /package/dist/client/assets/{snazzy-light-x9CLJ1W9.js → snazzy-light-rfyCCEIi.js} +0 -0
- /package/dist/client/assets/{solarized-dark-BB1sh-pe.js → solarized-dark-DbzG1qZn.js} +0 -0
- /package/dist/client/assets/{solarized-light-9-RPS998.js → solarized-light-wTbgnQ9X.js} +0 -0
- /package/dist/client/assets/{solidity-gQ4WXILB.js → solidity-CiPHtV-S.js} +0 -0
- /package/dist/client/assets/{splunk-OB48_RcD.js → splunk-qg6RMVBh.js} +0 -0
- /package/dist/client/assets/{ssh-config-DA9YMRGV.js → ssh-config-Bv05t-vj.js} +0 -0
- /package/dist/client/assets/{stylus-sKwvsUaC.js → stylus-Dcn1iI3o.js} +0 -0
- /package/dist/client/assets/{synthwave-84-eJ9uRN_S.js → synthwave-84-2ka-NWz-.js} +0 -0
- /package/dist/client/assets/{system-verilog-CnWMF7Nq.js → system-verilog-Bi2P60my.js} +0 -0
- /package/dist/client/assets/{systemd-DMzItW5N.js → systemd-B-Uf9E5B.js} +0 -0
- /package/dist/client/assets/{talonscript-DopQCWDL.js → talonscript-78H25QY_.js} +0 -0
- /package/dist/client/assets/{tasl-C28SYKbq.js → tasl-U22XnM7f.js} +0 -0
- /package/dist/client/assets/{tcl-DHq7zmoF.js → tcl-COq4pcak.js} +0 -0
- /package/dist/client/assets/{terraform-CogS1YKX.js → terraform-CN0y-ELc.js} +0 -0
- /package/dist/client/assets/{tokyo-night-B9N7LyrF.js → tokyo-night-sc29NHmq.js} +0 -0
- /package/dist/client/assets/{toml-BH_iPsgK.js → toml-DewJUUba.js} +0 -0
- /package/dist/client/assets/{tsv-BIkdBZX1.js → tsv-BxMH_xdg.js} +0 -0
- /package/dist/client/assets/{turtle-CqNXyJWZ.js → turtle-Ckif9282.js} +0 -0
- /package/dist/client/assets/{typespec-CQ9LYD_e.js → typespec-B4M3EpQn.js} +0 -0
- /package/dist/client/assets/{typst-T-Fsk-Sv.js → typst-Bz2n9x1G.js} +0 -0
- /package/dist/client/assets/{v-BhMEOw9x.js → v-UeLXtqZY.js} +0 -0
- /package/dist/client/assets/{vala-DzajMnwt.js → vala-Bp2nfBOB.js} +0 -0
- /package/dist/client/assets/{vb-7Xr8dEYW.js → vb-BNrt2LXf.js} +0 -0
- /package/dist/client/assets/{verilog-AvXtwZir.js → verilog-DUvgRMGv.js} +0 -0
- /package/dist/client/assets/{vesper-CtgQQ2sf.js → vesper-Bnk9mq_Q.js} +0 -0
- /package/dist/client/assets/{vhdl-BHu0zg1P.js → vhdl-Rn0_vJR-.js} +0 -0
- /package/dist/client/assets/{viml-Di0QpLfC.js → viml-1SBtGOaC.js} +0 -0
- /package/dist/client/assets/{vitesse-black-jXdfyqgD.js → vitesse-black-PGXhEtSI.js} +0 -0
- /package/dist/client/assets/{vitesse-dark-B88PxG1r.js → vitesse-dark-Ckw6u4sV.js} +0 -0
- /package/dist/client/assets/{vitesse-light-BXxZh2iV.js → vitesse-light-B41llZUS.js} +0 -0
- /package/dist/client/assets/{vyper-C3R5yXgx.js → vyper-Dk8xbVIz.js} +0 -0
- /package/dist/client/assets/{wasm-CEUrWlVz.js → wasm-Bv0dEfnC.js} +0 -0
- /package/dist/client/assets/{wasm-Chsuwt1A.js → wasm-CRsU_VQz.js} +0 -0
- /package/dist/client/assets/{wenyan-BonVcr2i.js → wenyan-BfC3Ct4H.js} +0 -0
- /package/dist/client/assets/{wgsl-D59WYmNq.js → wgsl-C2dHZDEF.js} +0 -0
- /package/dist/client/assets/{wikitext-ariTI2Wk.js → wikitext-BbmA1MpW.js} +0 -0
- /package/dist/client/assets/{wit-EA4fa3Dt.js → wit-CyF_c9_v.js} +0 -0
- /package/dist/client/assets/{wolfram-DDp7LhyU.js → wolfram-CkBk1rx1.js} +0 -0
- /package/dist/client/assets/{zenscript-4WaROUyc.js → zenscript-B3xqRiFZ.js} +0 -0
- /package/dist/client/assets/{zig-CJoLJGwV.js → zig-E_NO4z39.js} +0 -0
|
@@ -0,0 +1,1467 @@
|
|
|
1
|
+
import{$ as e,A as t,At as n,B as r,Bt as i,C as a,Ct as o,D as s,Dt as c,E as l,Et as u,F as d,Ft as f,G as p,Gt as m,H as h,Ht as g,I as _,It as v,J as y,K as b,L as x,Lt as S,M as C,Mt as w,N as T,Nt as E,O as D,Ot as O,P as k,Pt as A,Q as j,R as M,Rt as N,S as P,St as F,T as ee,Tt as I,U as te,Ut as ne,V as re,Vt as ie,W as L,X as R,Y as ae,Z as z,_ as oe,_t as se,a as ce,at as le,b as ue,bt as B,c as de,ct as fe,d as V,dt as pe,et as me,f as H,ft as he,g as ge,gt as _e,h as ve,ht as ye,i as be,it as xe,j as Se,jt as Ce,k as we,kt as U,l as Te,lt as Ee,m as De,mt as Oe,n as ke,nt as Ae,o as je,ot as Me,p as Ne,pt as Pe,q as Fe,r as Ie,rt as W,s as Le,st as Re,t as ze,tt as Be,u as Ve,ut as He,v as Ue,vt as We,w as Ge,wt as Ke,x as qe,xt as Je,y as Ye,yt as Xe,z as Ze,zt as Qe}from"./index-XENPR9M4.js";var $e=_e(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),et=_e(`rows-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),tt={position:`absolute`,top:0,bottom:0,textAlign:`center`};function G(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var K=g();function nt(e,t){return typeof window>`u`&&t!=null?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,K.jsx)(K.Fragment,{children:e})}var q=new Set,rt=new Set,it=null,at=!1;function J(e){if(at){q.add(e);return}rt.add(e),it??=requestAnimationFrame(ot)}function ot(e){at=!0;for(let t of rt)try{t(e)}catch(e){console.error(e)}rt.clear(),q.size>0?(rt=new Set(q),q.clear(),it=requestAnimationFrame(ot)):it=null,at=!1}function st(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}function ct({scrollTop:e,scrollHeight:t,height:n,containerOffset:r=0,fitPerfectly:i,overscrollSize:a}){let o=n+a*2,s=i?n:o;if(t=Math.max(t,s),o>=t||i){let n=Math.max(e-r,0),i=Math.min(e+s,t)-r;return{top:n,bottom:Math.max(i,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-r,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t)-r,c))}}var lt=1e3,ut=lt*4,dt=[0,1e-6,.99999,1],ft={overscrollSize:lt,intersectionObserverMargin:ut,resizeDebugging:!1},pt=0,mt=-1,ht=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++mt}`;config;type=`basic`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...ft,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:dt,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),J(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),J(this.computeRenderRangeAndEmit)}}instanceChanged(e){this.instancesChanged.add(e),J(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=ct({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-pt,newSize:e}),pt=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-pt,newSize:e}),pt=e))}t&&J(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+Y(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),J(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),J(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,J(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{e.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,J(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,J(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;if(this.instancesChanged.size===0){let e=ct({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(st(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let n=this.getScrollAnchor(this.height),r=new Set;for(let e of this.visibleInstances.values())e.onRender(t)&&r.add(e);for(let e of this.instancesChanged)r.has(e)||e.onRender(t)&&r.add(e);this.scrollFix(n),this.instancesChanged.size>0&&this.markDOMDirty();for(let e of r)e.reconcileHeights();(this.instancesChanged.size>0||t)&&J(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=Y(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=Y(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=Y(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=Y(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);if(e==null)throw Error(`Virtualizer.handleIntersectionChange: no instance for target`);n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0)}this.visibleInstancesDirty&&J(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function Y(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}var X=m(ne(),1),gt=(0,X.createContext)(void 0);function _t({children:e,config:t,className:n,style:r,contentClassName:i,contentStyle:a}){let[o]=(0,X.useState)(()=>typeof window<`u`?new ht(t):void 0),s=(0,X.useCallback)(e=>{e==null?o?.cleanUp():o?.setup(e)},[o]);return(0,K.jsx)(gt.Provider,{value:o,children:(0,K.jsx)(`div`,{className:n,style:r,ref:s,children:(0,K.jsx)(`div`,{className:i,style:a,children:e})})})}function vt(){return(0,X.useContext)(gt)}function yt(e){let t=(0,X.useRef)(e);return(0,X.useInsertionEffect)(()=>void(t.current=e)),(0,X.useCallback)((...e)=>t.current(...e),[])}function bt(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var xt=class{pre;selectedRange=null;renderedSelectionRange;anchor;_queuedRender;constructor(e={}){this.options=e}setOptions(e){this.options={...this.options,...e},this.removeEventListeners(),this.options.enableLineSelection===!0&&this.attachEventListeners()}cleanUp(){this.removeEventListeners(),this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0}setup(e){if(this.setDirty(),this.pre!==e){this.cleanUp(),this.pre=e;let{enableLineSelection:t=!1}=this.options;t?this.attachEventListeners():this.removeEventListeners()}this.setSelection(this.selectedRange)}setDirty(){this.renderedSelectionRange=void 0}isDirty(){return this.renderedSelectionRange===void 0}setSelection(e){let t=!(e===this.selectedRange||bt(e??void 0,this.selectedRange??void 0));!this.isDirty()&&!t||(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionChange())}getSelection(){return this.selectedRange}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}attachEventListeners(){this.pre!=null&&(this.removeEventListeners(),this.pre.setAttribute(`data-interactive-line-numbers`,``),this.pre.addEventListener(`pointerdown`,this.handleMouseDown))}removeEventListeners(){this.pre!=null&&(this.pre.removeEventListener(`pointerdown`,this.handleMouseDown),document.removeEventListener(`pointermove`,this.handleMouseMove),document.removeEventListener(`pointerup`,this.handleMouseUp),this.pre.removeAttribute(`data-interactive-line-numbers`))}handleMouseDown=e=>{let t=e.button===0?this.getMouseEventDataForPath(e.composedPath(),`click`):void 0;if(t==null||this.pre==null)return;e.preventDefault();let{lineNumber:n,eventSide:r,lineIndex:i}=t;if(e.shiftKey&&this.selectedRange!=null){let e=this.getIndexesFromSelection(this.selectedRange,this.pre.getAttribute(`data-diff-type`)===`split`);if(e==null)return;let t=e.start<=e.end?i>=e.start:i<=e.end;this.anchor={line:t?this.selectedRange.start:this.selectedRange.end,side:(t?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side)??`additions`},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}else{if(this.selectedRange?.start===n&&this.selectedRange?.end===n){this.updateSelection(null),this.notifySelectionEnd(null),this.notifySelectionChange();return}this.selectedRange=null,this.anchor={line:n,side:r},this.updateSelection(n,r),this.notifySelectionStart(this.selectedRange)}document.addEventListener(`pointermove`,this.handleMouseMove),document.addEventListener(`pointerup`,this.handleMouseUp)};handleMouseMove=e=>{let t=this.getMouseEventDataForPath(e.composedPath(),`move`);if(t==null||this.anchor==null)return;let{lineNumber:n,eventSide:r}=t;this.updateSelection(n,r)};handleMouseUp=()=>{this.anchor=void 0,document.removeEventListener(`pointermove`,this.handleMouseMove),document.removeEventListener(`pointerup`,this.handleMouseUp),this.notifySelectionEnd(this.selectedRange),this.notifySelectionChange()};updateSelection(e,t){if(e==null)this.selectedRange=null;else{let n=this.anchor?.side??t;this.selectedRange={start:this.anchor?.line??e,end:e,side:n,endSide:n===t?void 0:t}}this._queuedRender??=requestAnimationFrame(this.renderSelection)}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}renderSelection=()=>{if(this._queuedRender!=null&&(cancelAnimationFrame(this._queuedRender),this._queuedRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`LineSelectionManager.applySelectionToDOM: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`LineSelectionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`LineSelectionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&s.nextSibling.hasAttribute(`data-line-annotation`)&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionChange(){let{onLineSelected:e}=this.options;e?.(this.selectedRange??null)}notifySelectionStart(e){let{onLineSelectionStart:t}=this.options;t?.(e)}notifySelectionEnd(e){let{onLineSelectionEnd:t}=this.options;t?.(e)}getMouseEventDataForPath(e,t){if(this.pre==null)return;let n,r,i=!1,a;for(let t of e){if(n!=null&&r!=null&&a!=null)break;if(t instanceof HTMLElement){if(t.hasAttribute(`data-line-index`)){i=t.hasAttribute(`data-column-number`),n=this.getLineNumber(t),r=this.parseLineIndex(t,this.pre.getAttribute(`data-diff-type`)===`split`);let e=t.getAttribute(`data-line-type`);e===`change-deletion`?a=`deletions`:e===`change-additions`&&(a=`additions`);continue}if(a==null&&t.hasAttribute(`data-code`)){a=t.hasAttribute(`data-deletions`)?`deletions`:t.hasAttribute(`data-additions`)?`additions`:void 0;break}}}if(!(t===`click`&&!i||r==null||n==null))return{lineIndex:r,lineNumber:n,eventSide:a??`additions`}}getLineNumber(e){let t=parseInt(e.getAttribute(`data-column-number`)??e.getAttribute(`data-line`)??``,10);return Number.isNaN(t)?void 0:t}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>parseInt(e)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function St({enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r},i){return{enableLineSelection:e,onLineSelected:t,onLineSelectionStart:n,onLineSelectionEnd:r,getLineIndex:i}}function Ct(e,t){return e==null?!1:t===`file`?e.type===`line`:e.type===`diff-line`}function wt(e){return e?.type===`line-info`}var Tt=class{hoveredLine;pre;hoverSlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasEventListeners=!1;constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handleMouseClick),this.pre?.removeEventListener(`pointermove`,this.handleMouseMove),this.pre?.removeEventListener(`pointerleave`,this.handleMouseLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.clearHoveredLine(),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasEventListeners=!1,this.pre=void 0}setup(e){let{__debugMouseEvents:t,onLineClick:n,onLineNumberClick:r,onLineEnter:i,onLineLeave:a,onHunkExpand:o,enableHoverUtility:s=!1,lineHoverHighlight:c=`disabled`}=this.options,l=this.pre!==e;if(l&&(this.cleanUp(),this.pre=e,this.hasEventListeners=!1),s&&this.hoverSlot==null){this.hoverSlot=document.createElement(`div`),this.hoverSlot.setAttribute(`data-hover-slot`,``);let e=document.createElement(`slot`);e.name=`hover-slot`,this.hoverSlot.appendChild(e)}else !s&&this.hoverSlot!=null&&(this.hoverSlot.parentNode?.removeChild(this.hoverSlot),this.hoverSlot=void 0);let u=c!==`disabled`||n!=null||r!=null||o!=null||i!=null||a!=null||s;(l||!this.hasEventListeners)&&u?(this.hasEventListeners=!0,e.addEventListener(`click`,this.handleMouseClick),n==null?r!=null&&(e.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!0):(e.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0,this.interactiveLineNumbersAttr=!1),Z(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(n!=null&&e.push(`onLineClick`),r!=null&&e.push(`onLineNumberClick`),o!=null&&e.push(`expandable hunk separators`)),e})()),e.addEventListener(`pointermove`,this.handleMouseMove),Z(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),e.addEventListener(`pointerleave`,this.handleMouseLeave),Z(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!u&&this.hasEventListeners&&(this.pre?.removeEventListener(`click`,this.handleMouseClick),this.pre?.removeEventListener(`pointermove`,this.handleMouseMove),this.pre?.removeEventListener(`pointerleave`,this.handleMouseLeave),this.hasEventListeners=!1),l||(n==null?r==null?(this.interactiveLinesAttr&&=(e.removeAttribute(`data-interactive-lines`),!1),this.interactiveLineNumbersAttr&&=(e.removeAttribute(`data-interactive-line-numbers`),!1)):(this.interactiveLinesAttr&&=(e.removeAttribute(`data-interactive-lines`),!1),this.interactiveLineNumbersAttr||=(e.setAttribute(`data-interactive-line-numbers`,``),!0)):(this.interactiveLineNumbersAttr&&=(e.removeAttribute(`data-interactive-line-numbers`),!1),this.interactiveLinesAttr||=(e.setAttribute(`data-interactive-lines`,``),!0)))}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode===`diff`&&this.hoveredLine.type===`diff-line`)return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode===`file`&&this.hoveredLine.type===`line`)return{lineNumber:this.hoveredLine.lineNumber}}};handleMouseClick=e=>{let{onLineClick:t,onLineNumberClick:n,onHunkExpand:r}=this.options;t==null&&n==null&&r==null||(Z(this.options.__debugMouseEvents,`click`,`FileDiff.DEBUG.handleMouseClick:`,e),this.handleMouseEvent({eventType:`click`,event:e}))};handleMouseMove=e=>{let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,enableHoverUtility:i=!1}=this.options;t===`disabled`&&!i&&n==null&&r==null||(Z(this.options.__debugMouseEvents,`move`,`FileDiff.DEBUG.handleMouseMove:`,e),this.handleMouseEvent({eventType:`move`,event:e}))};handleMouseLeave=e=>{let{__debugMouseEvents:t}=this.options;if(Z(t,`move`,`FileDiff.DEBUG.handleMouseLeave: no event`),this.hoveredLine==null){Z(t,`move`,`FileDiff.DEBUG.handleMouseLeave: returned early, no .hoveredLine`);return}this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()};handleMouseEvent({eventType:e,event:t}){let{__debugMouseEvents:n}=this.options,r=t.composedPath();Z(n,e,`FileDiff.DEBUG.handleMouseEvent:`,{eventType:e,composedPath:r});let i=this.getLineData(r);Z(n,e,`FileDiff.DEBUG.handleMouseEvent: getLineData result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onHunkExpand:l}=this.options;switch(e){case`move`:if(Ct(i,this.mode)&&this.hoveredLine?.lineElement===i.lineElement){Z(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', returned early because same line`);break}this.hoveredLine!=null&&(Z(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', clearing an existing hovered line and firing onLineLeave`),this.hoverSlot?.parentElement?.removeChild(this.hoverSlot),c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Ct(i,this.mode)&&(Z(n,`move`,`FileDiff.DEBUG.handleMouseEvent: switch, 'move', setting up a new hoveredLine and firing onLineEnter`),this.setHoveredLine(i),this.hoverSlot!=null&&i.numberElement?.appendChild(this.hoverSlot),s?.({...this.hoveredLine,event:t}));break;case`click`:if(Z(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', with data:`,i),i==null)break;if(wt(i)&&l!=null){Z(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', expanding a hunk`),l(i.hunkIndex,i.direction);break}Ct(i,this.mode)&&(o!=null&&i.numberColumn?(Z(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineNumberClick'`),o({...i,event:t})):a==null?Z(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', fell through, no event to fire`):(Z(n,`click`,`FileDiff.DEBUG.handleMouseEvent: switch, 'click', firing 'onLineClick'`),a({...i,event:t})));break}}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`,``))}getLineData(e){let t=!1,n,r,i,a,o,s,c;for(let l of e){if(!(l instanceof HTMLElement))continue;let e=o==null?l.getAttribute(`data-column-number`)??void 0:void 0;if(e){o=l,c=Number.parseInt(e,10),t=!0,n=Ot(l),a=l.getAttribute(`data-line-index`)??void 0;continue}let u=i==null?l.getAttribute(`data-line`)??void 0:void 0;if(u){i=l,c=Number.parseInt(u,10),n=Ot(l),a=l.getAttribute(`data-line-index`)??void 0;continue}if(s==null&&l.hasAttribute(`data-expand-button`)){s={hunkIndex:void 0,direction:l.hasAttribute(`data-expand-up`)?`up`:l.hasAttribute(`data-expand-down`)?`down`:`both`};continue}let d=s==null?void 0:l.getAttribute(`data-expand-index`)??void 0;if(s!=null&&d!=null){let e=Number.parseInt(d,10);Number.isNaN(e)||(s.hunkIndex=e);continue}if(r==null&&l.hasAttribute(`data-code`)){r=l;break}}if(s?.hunkIndex!=null){let{hunkIndex:e,direction:t}=s;return{type:`line-info`,hunkIndex:e,direction:t}}if(i??=a==null?void 0:Dt(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Dt(r,`[data-column-number][data-line-index="${a}"]`),!(r==null||i==null||o==null||n==null))return this.mode===`file`?{type:`line`,lineElement:i,lineNumber:c,numberElement:o,numberColumn:t}:{type:`diff-line`,annotationSide:(()=>{switch(n){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return r.hasAttribute(`data-deletions`)?`deletions`:`additions`}})(),lineType:n,lineElement:i,numberElement:o,lineNumber:c,numberColumn:t}}};function Z(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;break}console.log(...n)}function Et({lineHoverHighlight:e,onLineClick:t,onLineNumberClick:n,onLineEnter:r,onLineLeave:i,enableHoverUtility:a,__debugMouseEvents:o},s){return{lineHoverHighlight:e,onLineClick:t,onLineNumberClick:n,onLineEnter:r,onLineLeave:i,enableHoverUtility:a,__debugMouseEvents:o,onHunkExpand:s}}function Dt(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Ot(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}}var kt=class{observedNodes=new Map;timeoutID;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.timeoutID!=null&&clearTimeout(this.timeoutID)}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);let n=e.querySelectorAll(`code`),r=new Map(this.observedNodes);this.observedNodes.clear();for(let e of n){let t=r.get(e);if(t!=null){this.observedNodes.set(e,t),r.delete(e);continue}let n=e.querySelector(`[data-gutter]`);n instanceof HTMLElement||(n=null),t={type:`code`,codeElement:e,numberElement:n,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,t),this.resizeObserver.observe(e),n!=null&&(this.observedNodes.set(n,t),this.resizeObserver.observe(n))}if(n.length>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let{lineAnnotation:t=``}=e.dataset;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,o=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement))continue;let s=r.get(a);if(s!=null){this.observedNodes.set(a,s),this.observedNodes.set(o,s),r.delete(a),r.delete(o);continue}s={type:`annotations`,column1:{container:n,child:a,childHeight:a.getBoundingClientRect().height},column2:{container:i,child:o,childHeight:o.getBoundingClientRect().height},currentHeight:`auto`};let c=Math.max(s.column1.childHeight,s.column2.childHeight);this.applyNewHeight(s,c),this.observedNodes.set(a,s),this.observedNodes.set(o,s),this.resizeObserver.observe(a),this.resizeObserver.observe(o)}}for(let e of r.keys())e.isConnected&&(e.style.removeProperty(`--diffs-column-content-width`),e.style.removeProperty(`--diffs-column-number-width`),e.style.removeProperty(`--diffs-column-width`),e.parentElement instanceof HTMLElement&&e.parentElement.style.removeProperty(`--diffs-annotation-min-height`)),this.resizeObserver.unobserve(e);r.clear()}handleResizeObserver=e=>{for(let t of e){let{target:e,borderBoxSize:n}=t;if(!(e instanceof HTMLElement)){console.error(`FileDiff.handleResizeObserver: Invalid element for ResizeObserver`,t);continue}let r=this.observedNodes.get(e);if(r==null){console.error(`FileDiff.handleResizeObserver: Not a valid observed node`,t);continue}let i=n[0];if(r.type===`annotations`){let t=(()=>{if(e===r.column1.child)return r.column1;if(e===r.column2.child)return r.column2})();if(t==null){console.error(`FileDiff.handleResizeObserver: Couldn't find a column for`,{item:r,target:e});continue}t.childHeight=i.blockSize;let n=Math.max(r.column1.childHeight,r.column2.childHeight);this.applyNewHeight(r,n)}else r.type===`code`&&(this.queuedUpdates.set(e,[r,i]),this.queueColumnUpdate())}};queueColumnUpdate(){this.timeoutID!=null&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(this.handleColumnChange,1e3/30)}handleColumnChange=()=>{this.timeoutID=void 0;for(let[e,[t,n]]of this.queuedUpdates)if(e===t.codeElement){let e=Math.max(Math.floor(n.inlineSize),0);if(e!==t.codeWidth){t.codeWidth=e;let n=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n===0?`auto`:`${n}px`}`),t.codeElement.style.setProperty(`--diffs-column-width`,`${t.codeWidth===0?`auto`:`${t.codeWidth}px`}`)}}else if(e===t.numberElement){let e=Math.max(Math.ceil(n.inlineSize),0);if(e!==t.numberWidth&&(t.numberWidth=e,t.codeElement.style.setProperty(`--diffs-column-number-width`,`${t.numberWidth===0?`auto`:`${t.numberWidth}px`}`),t.codeWidth!==`auto`)){let e=Math.max(t.codeWidth-t.numberWidth,0);t.codeElement.style.setProperty(`--diffs-column-content-width`,`${e===0?`auto`:`${e}px`}`)}}this.queuedUpdates.clear()};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 At(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 jt(e){for(let t of Array.isArray(e)?e:[e])if(!p.has(t))return!1;return!0}function Mt(e){for(let t of re(e))if(!b.has(t))return!1;return!0}function Nt(e){return d({tagName:`div`,children:[d({tagName:`div`,children:e.annotations?.map(e=>d({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Pt(e,t){return d({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function Ft(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 It({fileOrDiff:e,themeStyles:t,themeType:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":``,"data-change-type":r?.type,"data-theme-type":n===`system`?void 0:n,style:t};return d({tagName:`div`,children:[Lt({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),Rt(r)],properties:i})}function Lt({name:e,prevName:t,iconType:n}){let r=[_({name:Ft(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(d({tagName:`div`,children:[x(t)],properties:{"data-prev-name":``}})),r.push(_({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(d({tagName:`div`,children:[x(e)],properties:{"data-title":``}})),d({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Rt(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(d({tagName:`span`,children:[x(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(d({tagName:`span`,children:[x(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(d({tagName:`slot`,properties:{name:xe}})),d({tagName:`div`,children:t,properties:{"data-metadata":``}})}function zt(e){return d({tagName:`pre`,properties:Bt(e)})}function Bt({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,themeType:a,themeStyles:o,totalLines:s,type:c}){let l={"data-diff":c===`diff`?``:void 0,"data-file":c===`file`?``:void 0,"data-diff-type":c===`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,"data-theme-type":a===`system`?void 0:a,style:o,tabIndex:0};return l.style+=`--diffs-min-number-column-width-default:${`${s}`.length}ch;`,l}function Vt(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:re(t),preferredHighlighter:n}}var Ht=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
2
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
3
|
+
<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"/>
|
|
4
|
+
</symbol>
|
|
5
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
6
|
+
<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"/>
|
|
7
|
+
</symbol>
|
|
8
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
9
|
+
<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"/>
|
|
10
|
+
</symbol>
|
|
11
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
12
|
+
<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"/>
|
|
13
|
+
</symbol>
|
|
14
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
15
|
+
<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"/>
|
|
16
|
+
</symbol>
|
|
17
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
18
|
+
<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"/>
|
|
19
|
+
</symbol>
|
|
20
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
21
|
+
<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"/>
|
|
22
|
+
</symbol>
|
|
23
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
24
|
+
<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"/>
|
|
25
|
+
</symbol>
|
|
26
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
27
|
+
<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"/>
|
|
28
|
+
</symbol>
|
|
29
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
30
|
+
<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"/>
|
|
31
|
+
</symbol>
|
|
32
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
33
|
+
<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"/>
|
|
34
|
+
</symbol>
|
|
35
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
36
|
+
<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"/>
|
|
37
|
+
</symbol>
|
|
38
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
39
|
+
<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"/>
|
|
40
|
+
</symbol>
|
|
41
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
42
|
+
<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"/>
|
|
43
|
+
</symbol>
|
|
44
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
45
|
+
<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"/>
|
|
46
|
+
</symbol>
|
|
47
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
48
|
+
<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"/>
|
|
49
|
+
</symbol>
|
|
50
|
+
</svg>`;function Ut(e,t){return e==null||t==null?e===t: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.themeStyles===t.themeStyles&&e.themeType===t.themeType&&e.totalLines===t.totalLines}function Wt(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Gt(){let e=document.createElement(`div`);return e.slot=`hover-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e}function Kt(){let e=document.createElement(`style`);return e.setAttribute(Ee,``),e}var qt=`@layer base, theme, unsafe;
|
|
51
|
+
|
|
52
|
+
@layer base {
|
|
53
|
+
:host {
|
|
54
|
+
--diffs-bg: #fff;
|
|
55
|
+
--diffs-fg: #000;
|
|
56
|
+
--diffs-font-fallback:
|
|
57
|
+
'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono',
|
|
58
|
+
'Courier New', monospace;
|
|
59
|
+
--diffs-header-font-fallback:
|
|
60
|
+
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
61
|
+
'Noto Sans', 'Liberation Sans', Arial, sans-serif;
|
|
62
|
+
|
|
63
|
+
--diffs-mixer: light-dark(black, white);
|
|
64
|
+
--diffs-gap-fallback: 8px;
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
// Available CSS Color Overrides
|
|
68
|
+
--diffs-bg-buffer-override
|
|
69
|
+
--diffs-bg-hover-override
|
|
70
|
+
--diffs-bg-context-override
|
|
71
|
+
--diffs-bg-separator-override
|
|
72
|
+
|
|
73
|
+
--diffs-fg-number-override
|
|
74
|
+
--diffs-fg-number-addition-override
|
|
75
|
+
--diffs-fg-number-deletion-override
|
|
76
|
+
|
|
77
|
+
--diffs-deletion-color-override
|
|
78
|
+
--diffs-addition-color-override
|
|
79
|
+
--diffs-modified-color-override
|
|
80
|
+
|
|
81
|
+
--diffs-bg-deletion-override
|
|
82
|
+
--diffs-bg-deletion-number-override
|
|
83
|
+
--diffs-bg-deletion-hover-override
|
|
84
|
+
--diffs-bg-deletion-emphasis-override
|
|
85
|
+
|
|
86
|
+
--diffs-bg-addition-override
|
|
87
|
+
--diffs-bg-addition-number-override
|
|
88
|
+
--diffs-bg-addition-hover-override
|
|
89
|
+
--diffs-bg-addition-emphasis-override
|
|
90
|
+
|
|
91
|
+
// Line Selection Color Overrides (for enableLineSelection)
|
|
92
|
+
--diffs-selection-color-override
|
|
93
|
+
--diffs-bg-selection-override
|
|
94
|
+
--diffs-bg-selection-number-override
|
|
95
|
+
--diffs-bg-selection-background-override
|
|
96
|
+
--diffs-bg-selection-number-background-override
|
|
97
|
+
|
|
98
|
+
// Available CSS Layout Overrides
|
|
99
|
+
--diffs-gap-inline
|
|
100
|
+
--diffs-gap-block
|
|
101
|
+
--diffs-gap-style
|
|
102
|
+
--diffs-tab-size
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
color-scheme: light dark;
|
|
106
|
+
display: block;
|
|
107
|
+
font-family: var(
|
|
108
|
+
--diffs-header-font-family,
|
|
109
|
+
var(--diffs-header-font-fallback)
|
|
110
|
+
);
|
|
111
|
+
font-size: var(--diffs-font-size, 13px);
|
|
112
|
+
line-height: var(--diffs-line-height, 20px);
|
|
113
|
+
font-feature-settings: var(--diffs-font-features);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* NOTE(mdo): Some semantic HTML elements (e.g. \`pre\`, \`code\`) have default
|
|
117
|
+
* user-agent styles. These must be overridden to use our custom styles. */
|
|
118
|
+
pre,
|
|
119
|
+
code,
|
|
120
|
+
[data-error-wrapper] {
|
|
121
|
+
isolation: isolate;
|
|
122
|
+
margin: 0;
|
|
123
|
+
padding: 0;
|
|
124
|
+
display: block;
|
|
125
|
+
outline: none;
|
|
126
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
pre,
|
|
130
|
+
code {
|
|
131
|
+
background-color: var(--diffs-bg);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
code {
|
|
135
|
+
contain: content;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
*,
|
|
139
|
+
*::before,
|
|
140
|
+
*::after {
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[data-icon-sprite] {
|
|
145
|
+
display: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* NOTE(mdo): Headers and separators are within pre/code, so we need to reset
|
|
149
|
+
* their font-family explicitly. */
|
|
150
|
+
[data-diffs-header],
|
|
151
|
+
[data-separator] {
|
|
152
|
+
font-family: var(
|
|
153
|
+
--diffs-header-font-family,
|
|
154
|
+
var(--diffs-header-font-fallback)
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
[data-file-info] {
|
|
159
|
+
padding: 10px;
|
|
160
|
+
font-weight: 700;
|
|
161
|
+
color: var(--fg);
|
|
162
|
+
/* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
|
|
163
|
+
* and vscode use an older build of chrome that appears to have a bug with
|
|
164
|
+
* color-mix and 'in oklch', so use 'in lab' instead */
|
|
165
|
+
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
166
|
+
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
[data-diffs-header],
|
|
170
|
+
[data-diff],
|
|
171
|
+
[data-file],
|
|
172
|
+
[data-error-wrapper],
|
|
173
|
+
[data-virtualizer-buffer] {
|
|
174
|
+
--diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
|
|
175
|
+
/* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
|
|
176
|
+
* and vscode use an older build of chrome that appears to have a bug with
|
|
177
|
+
* color-mix and 'in oklch', so use 'in lab' instead */
|
|
178
|
+
--diffs-bg-buffer: var(
|
|
179
|
+
--diffs-bg-buffer-override,
|
|
180
|
+
light-dark(
|
|
181
|
+
color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),
|
|
182
|
+
color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))
|
|
183
|
+
)
|
|
184
|
+
);
|
|
185
|
+
--diffs-bg-hover: var(
|
|
186
|
+
--diffs-bg-hover-override,
|
|
187
|
+
light-dark(
|
|
188
|
+
color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)),
|
|
189
|
+
color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))
|
|
190
|
+
)
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
--diffs-bg-context: var(
|
|
194
|
+
--diffs-bg-context-override,
|
|
195
|
+
light-dark(
|
|
196
|
+
color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),
|
|
197
|
+
color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))
|
|
198
|
+
)
|
|
199
|
+
);
|
|
200
|
+
--diffs-bg-context-number: var(
|
|
201
|
+
--diffs-bg-context-number-override,
|
|
202
|
+
light-dark(
|
|
203
|
+
color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)),
|
|
204
|
+
color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg))
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
--diffs-bg-separator: var(
|
|
209
|
+
--diffs-bg-separator-override,
|
|
210
|
+
light-dark(
|
|
211
|
+
color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),
|
|
212
|
+
color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))
|
|
213
|
+
)
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
--diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark));
|
|
217
|
+
--diffs-fg-number: var(
|
|
218
|
+
--diffs-fg-number-override,
|
|
219
|
+
light-dark(
|
|
220
|
+
color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),
|
|
221
|
+
color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))
|
|
222
|
+
)
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
--diffs-deletion-base: var(
|
|
226
|
+
--diffs-deletion-color-override,
|
|
227
|
+
light-dark(
|
|
228
|
+
var(
|
|
229
|
+
--diffs-light-deletion-color,
|
|
230
|
+
var(--diffs-deletion-color, rgb(255, 0, 0))
|
|
231
|
+
),
|
|
232
|
+
var(
|
|
233
|
+
--diffs-dark-deletion-color,
|
|
234
|
+
var(--diffs-deletion-color, rgb(255, 0, 0))
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
);
|
|
238
|
+
--diffs-addition-base: var(
|
|
239
|
+
--diffs-addition-color-override,
|
|
240
|
+
light-dark(
|
|
241
|
+
var(
|
|
242
|
+
--diffs-light-addition-color,
|
|
243
|
+
var(--diffs-addition-color, rgb(0, 255, 0))
|
|
244
|
+
),
|
|
245
|
+
var(
|
|
246
|
+
--diffs-dark-addition-color,
|
|
247
|
+
var(--diffs-addition-color, rgb(0, 255, 0))
|
|
248
|
+
)
|
|
249
|
+
)
|
|
250
|
+
);
|
|
251
|
+
--diffs-modified-base: var(
|
|
252
|
+
--diffs-modified-color-override,
|
|
253
|
+
light-dark(
|
|
254
|
+
var(
|
|
255
|
+
--diffs-light-modified-color,
|
|
256
|
+
var(--diffs-modified-color, rgb(0, 0, 255))
|
|
257
|
+
),
|
|
258
|
+
var(
|
|
259
|
+
--diffs-dark-modified-color,
|
|
260
|
+
var(--diffs-modified-color, rgb(0, 0, 255))
|
|
261
|
+
)
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
/* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor
|
|
266
|
+
* and vscode use an older build of chrome that appears to have a bug with
|
|
267
|
+
* color-mix and 'in oklch', so use 'in lab' instead */
|
|
268
|
+
--diffs-bg-deletion: var(
|
|
269
|
+
--diffs-bg-deletion-override,
|
|
270
|
+
light-dark(
|
|
271
|
+
color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),
|
|
272
|
+
color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))
|
|
273
|
+
)
|
|
274
|
+
);
|
|
275
|
+
--diffs-bg-deletion-number: var(
|
|
276
|
+
--diffs-bg-deletion-number-override,
|
|
277
|
+
light-dark(
|
|
278
|
+
color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)),
|
|
279
|
+
color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))
|
|
280
|
+
)
|
|
281
|
+
);
|
|
282
|
+
--diffs-bg-deletion-hover: var(
|
|
283
|
+
--diffs-bg-deletion-hover-override,
|
|
284
|
+
light-dark(
|
|
285
|
+
color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)),
|
|
286
|
+
color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))
|
|
287
|
+
)
|
|
288
|
+
);
|
|
289
|
+
--diffs-bg-deletion-emphasis: var(
|
|
290
|
+
--diffs-bg-deletion-emphasis-override,
|
|
291
|
+
light-dark(
|
|
292
|
+
rgb(from var(--diffs-deletion-base) r g b / 0.15),
|
|
293
|
+
rgb(from var(--diffs-deletion-base) r g b / 0.2)
|
|
294
|
+
)
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
--diffs-bg-addition: var(
|
|
298
|
+
--diffs-bg-addition-override,
|
|
299
|
+
light-dark(
|
|
300
|
+
color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),
|
|
301
|
+
color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
--diffs-bg-addition-number: var(
|
|
305
|
+
--diffs-bg-addition-number-override,
|
|
306
|
+
light-dark(
|
|
307
|
+
color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)),
|
|
308
|
+
color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))
|
|
309
|
+
)
|
|
310
|
+
);
|
|
311
|
+
--diffs-bg-addition-hover: var(
|
|
312
|
+
--diffs-bg-addition-hover-override,
|
|
313
|
+
light-dark(
|
|
314
|
+
color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)),
|
|
315
|
+
color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))
|
|
316
|
+
)
|
|
317
|
+
);
|
|
318
|
+
--diffs-bg-addition-emphasis: var(
|
|
319
|
+
--diffs-bg-addition-emphasis-override,
|
|
320
|
+
light-dark(
|
|
321
|
+
rgb(from var(--diffs-addition-base) r g b / 0.15),
|
|
322
|
+
rgb(from var(--diffs-addition-base) r g b / 0.2)
|
|
323
|
+
)
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
--diffs-selection-base: var(--diffs-modified-base);
|
|
327
|
+
--diffs-selection-number-fg: light-dark(
|
|
328
|
+
color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),
|
|
329
|
+
color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))
|
|
330
|
+
);
|
|
331
|
+
--diffs-bg-selection: var(
|
|
332
|
+
--diffs-bg-selection-override,
|
|
333
|
+
light-dark(
|
|
334
|
+
color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)),
|
|
335
|
+
color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base))
|
|
336
|
+
)
|
|
337
|
+
);
|
|
338
|
+
--diffs-bg-selection-number: var(
|
|
339
|
+
--diffs-bg-selection-number-override,
|
|
340
|
+
light-dark(
|
|
341
|
+
color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)),
|
|
342
|
+
color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base))
|
|
343
|
+
)
|
|
344
|
+
);
|
|
345
|
+
|
|
346
|
+
background-color: var(--diffs-bg);
|
|
347
|
+
color: var(--diffs-fg);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
[data-diff],
|
|
351
|
+
[data-file] {
|
|
352
|
+
/* This feels a bit crazy to me... so I need to think about it a bit more... */
|
|
353
|
+
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
354
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
355
|
+
|
|
356
|
+
&[data-dehydrated] {
|
|
357
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
&[data-theme-type='light'],
|
|
361
|
+
& {
|
|
362
|
+
[data-line] span {
|
|
363
|
+
color: light-dark(
|
|
364
|
+
var(--diffs-token-light, var(--diffs-light)),
|
|
365
|
+
var(--diffs-token-dark, var(--diffs-dark))
|
|
366
|
+
);
|
|
367
|
+
font-weight: var(--diffs-token-light-font-weight, inherit);
|
|
368
|
+
font-style: var(--diffs-token-light-font-style, inherit);
|
|
369
|
+
-webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit);
|
|
370
|
+
text-decoration: var(--diffs-token-light-text-decoration, inherit);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
&[data-theme-type='dark'] [data-line] span {
|
|
375
|
+
font-weight: var(--diffs-token-dark-font-weight, inherit);
|
|
376
|
+
font-style: var(--diffs-token-dark-font-style, inherit);
|
|
377
|
+
-webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
|
|
378
|
+
text-decoration: var(--diffs-token-dark-text-decoration, inherit);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
382
|
+
background-color: var(--diffs-bg-context);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
[data-line] span {
|
|
387
|
+
background-color: light-dark(
|
|
388
|
+
var(--diffs-token-light-bg, inherit),
|
|
389
|
+
var(--diffs-token-dark-bg, inherit)
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
[data-line],
|
|
394
|
+
[data-gutter-buffer],
|
|
395
|
+
[data-line-annotation],
|
|
396
|
+
[data-no-newline] {
|
|
397
|
+
color: var(--diffs-fg);
|
|
398
|
+
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
[data-no-newline] {
|
|
402
|
+
-webkit-user-select: none;
|
|
403
|
+
user-select: none;
|
|
404
|
+
|
|
405
|
+
span {
|
|
406
|
+
opacity: 0.6;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@media (prefers-color-scheme: dark) {
|
|
411
|
+
[data-diffs-header],
|
|
412
|
+
[data-error-wrapper],
|
|
413
|
+
[data-diff],
|
|
414
|
+
[data-file] {
|
|
415
|
+
color-scheme: dark;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
[data-content] [data-line] span {
|
|
419
|
+
font-weight: var(--diffs-token-dark-font-weight, inherit);
|
|
420
|
+
font-style: var(--diffs-token-dark-font-style, inherit);
|
|
421
|
+
-webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit);
|
|
422
|
+
text-decoration: var(--diffs-token-dark-text-decoration, inherit);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
[data-diffs-header],
|
|
427
|
+
[data-diff],
|
|
428
|
+
[data-file] {
|
|
429
|
+
&[data-theme-type='light'] {
|
|
430
|
+
color-scheme: light;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
&[data-theme-type='dark'] {
|
|
434
|
+
color-scheme: dark;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
[data-diff-type='split'][data-overflow='scroll'] {
|
|
439
|
+
display: grid;
|
|
440
|
+
grid-template-columns: 1fr 1fr;
|
|
441
|
+
|
|
442
|
+
[data-additions] {
|
|
443
|
+
border-left: 1px solid var(--diffs-bg);
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
[data-deletions] {
|
|
447
|
+
border-right: 1px solid var(--diffs-bg);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
[data-code] {
|
|
452
|
+
display: grid;
|
|
453
|
+
grid-auto-flow: dense;
|
|
454
|
+
grid-template-columns: var(--diffs-code-grid);
|
|
455
|
+
overflow: scroll clip;
|
|
456
|
+
overscroll-behavior-x: none;
|
|
457
|
+
tab-size: var(--diffs-tab-size, 2);
|
|
458
|
+
align-self: flex-start;
|
|
459
|
+
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
460
|
+
padding-bottom: max(
|
|
461
|
+
0px,
|
|
462
|
+
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px)
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
[data-container-size] {
|
|
467
|
+
container-type: inline-size;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
[data-code]::-webkit-scrollbar {
|
|
471
|
+
width: 0;
|
|
472
|
+
height: 6px;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
[data-code]::-webkit-scrollbar-track {
|
|
476
|
+
background: transparent;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
[data-code]::-webkit-scrollbar-thumb {
|
|
480
|
+
background-color: transparent;
|
|
481
|
+
border: 1px solid transparent;
|
|
482
|
+
background-clip: content-box;
|
|
483
|
+
border-radius: 3px;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
[data-code]::-webkit-scrollbar-corner {
|
|
487
|
+
background-color: transparent;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/*
|
|
491
|
+
* If we apply these rules globally it will mean that webkit will opt into the
|
|
492
|
+
* standards compliant version of custom css scrollbars, which we do not want
|
|
493
|
+
* because the custom stuff will look better
|
|
494
|
+
*/
|
|
495
|
+
@supports (-moz-appearance: none) {
|
|
496
|
+
[data-code] {
|
|
497
|
+
scrollbar-width: thin;
|
|
498
|
+
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
499
|
+
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
[data-diffs-header] ~ [data-diff],
|
|
504
|
+
[data-diffs-header] ~ [data-file] {
|
|
505
|
+
[data-code],
|
|
506
|
+
&[data-overflow='wrap'] {
|
|
507
|
+
padding-top: 0;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
[data-gutter] {
|
|
512
|
+
display: grid;
|
|
513
|
+
grid-template-rows: subgrid;
|
|
514
|
+
grid-template-columns: subgrid;
|
|
515
|
+
grid-column: 1;
|
|
516
|
+
z-index: 3;
|
|
517
|
+
position: relative;
|
|
518
|
+
background-color: var(--diffs-bg);
|
|
519
|
+
|
|
520
|
+
[data-gutter-buffer],
|
|
521
|
+
[data-column-number] {
|
|
522
|
+
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
[data-content] {
|
|
527
|
+
display: grid;
|
|
528
|
+
grid-template-rows: subgrid;
|
|
529
|
+
grid-template-columns: subgrid;
|
|
530
|
+
grid-column: 2;
|
|
531
|
+
min-width: 0;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
[data-diff-type='split'][data-overflow='wrap'] {
|
|
535
|
+
display: grid;
|
|
536
|
+
grid-auto-flow: dense;
|
|
537
|
+
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
538
|
+
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
539
|
+
|
|
540
|
+
[data-deletions] {
|
|
541
|
+
display: contents;
|
|
542
|
+
|
|
543
|
+
[data-gutter] {
|
|
544
|
+
grid-column: 1;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
[data-content] {
|
|
548
|
+
grid-column: 2;
|
|
549
|
+
border-right: 1px solid var(--diffs-bg);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
[data-additions] {
|
|
554
|
+
display: contents;
|
|
555
|
+
|
|
556
|
+
[data-gutter] {
|
|
557
|
+
grid-column: 3;
|
|
558
|
+
border-left: 1px solid var(--diffs-bg);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
[data-content] {
|
|
562
|
+
grid-column: 4;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
[data-overflow='scroll'] [data-gutter] {
|
|
568
|
+
position: sticky;
|
|
569
|
+
left: 0;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
[data-line-annotation][data-selected-line] {
|
|
573
|
+
background-color: unset;
|
|
574
|
+
|
|
575
|
+
&::before {
|
|
576
|
+
content: '';
|
|
577
|
+
/* FIXME(amadeus): This needs to be audited ... */
|
|
578
|
+
position: sticky;
|
|
579
|
+
top: 0;
|
|
580
|
+
left: 0;
|
|
581
|
+
display: block;
|
|
582
|
+
border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));
|
|
583
|
+
background-color: var(--diffs-bg-selection-number);
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
[data-annotation-content] {
|
|
587
|
+
background-color: var(--diffs-bg-selection);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
[data-interactive-lines] [data-line] {
|
|
592
|
+
cursor: pointer;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
[data-content-buffer],
|
|
596
|
+
[data-gutter-buffer] {
|
|
597
|
+
position: relative;
|
|
598
|
+
-webkit-user-select: none;
|
|
599
|
+
user-select: none;
|
|
600
|
+
min-height: 1lh;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
[data-gutter-buffer='annotation'] {
|
|
604
|
+
min-height: 0;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
[data-gutter-buffer='buffer'] {
|
|
608
|
+
background-size: 8px 8px;
|
|
609
|
+
background-position: 0 0;
|
|
610
|
+
background-origin: border-box;
|
|
611
|
+
background-color: var(--diffs-bg);
|
|
612
|
+
/* This is incredibley expensive... */
|
|
613
|
+
background-image: repeating-linear-gradient(
|
|
614
|
+
-45deg,
|
|
615
|
+
transparent,
|
|
616
|
+
transparent calc(3px * 1.414),
|
|
617
|
+
rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414),
|
|
618
|
+
rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414)
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
[data-content-buffer] {
|
|
623
|
+
grid-column: 1;
|
|
624
|
+
/* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */
|
|
625
|
+
background-size: 8px 8px;
|
|
626
|
+
background-position: 5px 0;
|
|
627
|
+
background-origin: border-box;
|
|
628
|
+
background-color: var(--diffs-bg);
|
|
629
|
+
/* This is incredibley expensive... */
|
|
630
|
+
background-image: repeating-linear-gradient(
|
|
631
|
+
-45deg,
|
|
632
|
+
transparent,
|
|
633
|
+
transparent calc(3px * 1.414),
|
|
634
|
+
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
635
|
+
var(--diffs-bg-buffer) calc(4px * 1.414)
|
|
636
|
+
);
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
[data-separator] {
|
|
640
|
+
box-sizing: content-box;
|
|
641
|
+
background-color: var(--diffs-bg);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
[data-separator='simple'] {
|
|
645
|
+
min-height: 4px;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
[data-separator='line-info'],
|
|
649
|
+
[data-separator='line-info-basic'],
|
|
650
|
+
[data-separator='metadata'],
|
|
651
|
+
[data-separator='simple'] {
|
|
652
|
+
background-color: var(--diffs-bg-separator);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
[data-separator='line-info'],
|
|
656
|
+
[data-separator='line-info-basic'],
|
|
657
|
+
[data-separator='metadata'] {
|
|
658
|
+
height: 32px;
|
|
659
|
+
position: relative;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[data-separator-wrapper] {
|
|
663
|
+
-webkit-user-select: none;
|
|
664
|
+
user-select: none;
|
|
665
|
+
fill: currentColor;
|
|
666
|
+
position: absolute;
|
|
667
|
+
inset-inline: 0;
|
|
668
|
+
display: flex;
|
|
669
|
+
align-items: center;
|
|
670
|
+
background-color: var(--diffs-bg);
|
|
671
|
+
height: 100%;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
[data-content] [data-separator-wrapper] {
|
|
675
|
+
display: none;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
[data-separator='metadata'] [data-separator-wrapper] {
|
|
679
|
+
inset-inline: 100% auto;
|
|
680
|
+
padding-inline: 1ch;
|
|
681
|
+
height: 100%;
|
|
682
|
+
background-color: var(--diffs-bg-separator);
|
|
683
|
+
color: var(--diffs-fg-number);
|
|
684
|
+
white-space: nowrap;
|
|
685
|
+
overflow: hidden;
|
|
686
|
+
text-overflow: ellipsis;
|
|
687
|
+
min-width: min-content;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
[data-separator='line-info'] {
|
|
691
|
+
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
[data-separator='line-info-basic'],
|
|
695
|
+
[data-separator='metadata'] {
|
|
696
|
+
margin-block: 0;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
[data-separator='line-info'][data-separator-first] {
|
|
700
|
+
margin-top: 0;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
[data-separator='line-info'][data-separator-last] {
|
|
704
|
+
margin-bottom: 0;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
[data-expand-index] [data-separator-wrapper] {
|
|
708
|
+
display: grid;
|
|
709
|
+
grid-template-columns: 32px auto;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
713
|
+
grid-template-columns: 32px 32px auto;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
[data-expand-button],
|
|
717
|
+
[data-separator-content] {
|
|
718
|
+
display: flex;
|
|
719
|
+
flex: 0 0 auto;
|
|
720
|
+
align-items: center;
|
|
721
|
+
background-color: var(--diffs-bg-separator);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
[data-expand-button] {
|
|
725
|
+
justify-content: center;
|
|
726
|
+
flex-shrink: 0;
|
|
727
|
+
cursor: pointer;
|
|
728
|
+
min-width: 32px;
|
|
729
|
+
align-self: stretch;
|
|
730
|
+
color: var(--diffs-fg-number);
|
|
731
|
+
border-right: 2px solid var(--diffs-bg);
|
|
732
|
+
|
|
733
|
+
&:hover {
|
|
734
|
+
color: var(--diffs-fg);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
[data-expand-down] [data-icon] {
|
|
739
|
+
transform: scaleY(-1);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
[data-separator-content] {
|
|
743
|
+
flex: 1 1 auto;
|
|
744
|
+
padding: 0 1ch;
|
|
745
|
+
height: 100%;
|
|
746
|
+
color: var(--diffs-fg-number);
|
|
747
|
+
|
|
748
|
+
overflow: hidden;
|
|
749
|
+
justify-content: flex-start;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
[data-separator='line-info'],
|
|
753
|
+
[data-separator='line-info-basic'] {
|
|
754
|
+
[data-separator-content] {
|
|
755
|
+
height: 100%;
|
|
756
|
+
-webkit-user-select: none;
|
|
757
|
+
user-select: none;
|
|
758
|
+
overflow: clip;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
@supports (width: 1cqi) {
|
|
763
|
+
[data-unified] {
|
|
764
|
+
[data-separator='line-info'] [data-separator-wrapper] {
|
|
765
|
+
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
766
|
+
width: 100cqi;
|
|
767
|
+
|
|
768
|
+
[data-separator-content] {
|
|
769
|
+
border-radius: 6px;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
[data-separator='line-info'][data-expand-index]
|
|
774
|
+
[data-separator-wrapper]
|
|
775
|
+
[data-separator-content] {
|
|
776
|
+
border-top-left-radius: unset;
|
|
777
|
+
border-bottom-left-radius: unset;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
[data-gutter] {
|
|
782
|
+
[data-separator='line-info'] [data-separator-wrapper] {
|
|
783
|
+
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
[data-separator='line-info'] [data-separator-content] {
|
|
787
|
+
border-top-left-radius: 6px;
|
|
788
|
+
border-bottom-left-radius: 6px;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
[data-separator='line-info'][data-expand-index] [data-separator-content] {
|
|
792
|
+
border-top-left-radius: unset;
|
|
793
|
+
border-bottom-left-radius: unset;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
[data-additions] {
|
|
798
|
+
[data-content] [data-separator='line-info'] {
|
|
799
|
+
background-color: var(--diffs-bg);
|
|
800
|
+
|
|
801
|
+
[data-separator-wrapper] {
|
|
802
|
+
display: none;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
[data-gutter] [data-separator='line-info'] [data-separator-wrapper] {
|
|
807
|
+
display: block;
|
|
808
|
+
height: 100%;
|
|
809
|
+
background-color: var(--diffs-bg-separator);
|
|
810
|
+
border-top-right-radius: 6px;
|
|
811
|
+
border-bottom-right-radius: 6px;
|
|
812
|
+
|
|
813
|
+
[data-separator-content],
|
|
814
|
+
[data-expand-button] {
|
|
815
|
+
display: none;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
[data-overflow='scroll']
|
|
821
|
+
[data-additions]
|
|
822
|
+
[data-gutter]
|
|
823
|
+
[data-separator='line-info']
|
|
824
|
+
[data-separator-wrapper] {
|
|
825
|
+
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
[data-overflow='wrap']
|
|
829
|
+
[data-additions]
|
|
830
|
+
[data-content]
|
|
831
|
+
[data-separator='line-info']
|
|
832
|
+
[data-separator-wrapper] {
|
|
833
|
+
background-color: var(--diffs-bg-separator);
|
|
834
|
+
display: block;
|
|
835
|
+
height: 100%;
|
|
836
|
+
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
837
|
+
border-top-right-radius: 6px;
|
|
838
|
+
border-bottom-right-radius: 6px;
|
|
839
|
+
|
|
840
|
+
[data-separator-content],
|
|
841
|
+
[data-expand-button] {
|
|
842
|
+
display: none;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
[data-separator='line-info'] [data-separator-wrapper] {
|
|
847
|
+
[data-expand-both],
|
|
848
|
+
[data-expand-down],
|
|
849
|
+
[data-expand-up] {
|
|
850
|
+
border-top-left-radius: 6px;
|
|
851
|
+
border-bottom-left-radius: 6px;
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
@media (pointer: fine) {
|
|
856
|
+
[data-separator='line-info'] [data-separator-wrapper] {
|
|
857
|
+
&[data-separator-multi-button] {
|
|
858
|
+
[data-expand-up] {
|
|
859
|
+
border-top-left-radius: 6px;
|
|
860
|
+
border-bottom-left-radius: unset;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
[data-expand-down] {
|
|
864
|
+
border-bottom-left-radius: 6px;
|
|
865
|
+
border-top-left-radius: unset;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
@media (pointer: coarse) {
|
|
873
|
+
[data-separator='line-info-basic']
|
|
874
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
875
|
+
grid-template-columns: 34px 34px auto;
|
|
876
|
+
|
|
877
|
+
[data-separator-content] {
|
|
878
|
+
grid-column: unset;
|
|
879
|
+
grid-row: unset;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
@supports (width: 1cqi) {
|
|
884
|
+
[data-separator='line-info'] [data-separator-wrapper] {
|
|
885
|
+
[data-expand-both],
|
|
886
|
+
[data-expand-down],
|
|
887
|
+
[data-expand-up] {
|
|
888
|
+
border-top-left-radius: 6px;
|
|
889
|
+
border-bottom-left-radius: 6px;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
&[data-separator-multi-button] {
|
|
893
|
+
[data-expand-up] {
|
|
894
|
+
border-top-left-radius: 6px;
|
|
895
|
+
border-bottom-left-radius: 6px;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
[data-expand-down] {
|
|
899
|
+
border-bottom-left-radius: unset;
|
|
900
|
+
border-top-left-radius: unset;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
@media (pointer: fine) {
|
|
908
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
909
|
+
display: grid;
|
|
910
|
+
grid-template-rows: 50% 50%;
|
|
911
|
+
|
|
912
|
+
[data-separator-content] {
|
|
913
|
+
grid-column: 2;
|
|
914
|
+
grid-row: 1 / -1;
|
|
915
|
+
min-width: min-content;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
[data-expand-button] {
|
|
919
|
+
grid-column: 1;
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
[data-separator='line-info'] [data-separator-wrapper],
|
|
924
|
+
[data-separator='line-info']
|
|
925
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
926
|
+
grid-template-columns: 34px auto;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
[data-separator='line-info-basic'][data-expand-index]
|
|
930
|
+
[data-separator-wrapper] {
|
|
931
|
+
grid-template-columns: 100% auto;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
[data-separator='line-info'],
|
|
935
|
+
[data-separator='line-info-basic'] {
|
|
936
|
+
[data-separator-multi-button] {
|
|
937
|
+
[data-expand-up] {
|
|
938
|
+
border-bottom: 1px solid var(--diffs-bg);
|
|
939
|
+
border-right: 2px solid var(--diffs-bg);
|
|
940
|
+
}
|
|
941
|
+
[data-expand-down] {
|
|
942
|
+
border-top: 1px solid var(--diffs-bg);
|
|
943
|
+
border-right: 2px solid var(--diffs-bg);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
[data-additions] [data-gutter] [data-separator-wrapper],
|
|
950
|
+
[data-additions] [data-separator='line-info-basic'] [data-separator-wrapper],
|
|
951
|
+
[data-content] [data-separator-wrapper] {
|
|
952
|
+
display: none;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
[data-line-annotation],
|
|
956
|
+
[data-gutter-buffer='annotation'] {
|
|
957
|
+
--diffs-line-bg: var(--diffs-bg-context);
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
[data-line-annotation] {
|
|
961
|
+
min-height: var(--diffs-annotation-min-height, 0);
|
|
962
|
+
z-index: 2;
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
[data-separator='custom'] {
|
|
966
|
+
display: grid;
|
|
967
|
+
grid-template-columns: subgrid;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
[data-line],
|
|
971
|
+
[data-column-number],
|
|
972
|
+
[data-no-newline] {
|
|
973
|
+
position: relative;
|
|
974
|
+
padding-inline: 1ch;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
[data-indicators='classic'] [data-line] {
|
|
978
|
+
padding-inline-start: 2ch;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
[data-indicators='classic'] {
|
|
982
|
+
[data-line-type='change-addition'],
|
|
983
|
+
[data-line-type='change-deletion'] {
|
|
984
|
+
&[data-no-newline],
|
|
985
|
+
&[data-line] {
|
|
986
|
+
&::before {
|
|
987
|
+
display: inline-block;
|
|
988
|
+
width: 1ch;
|
|
989
|
+
height: 1lh;
|
|
990
|
+
position: absolute;
|
|
991
|
+
top: 0;
|
|
992
|
+
left: 0;
|
|
993
|
+
-webkit-user-select: none;
|
|
994
|
+
user-select: none;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
[data-line-type='change-addition'] {
|
|
1000
|
+
&[data-line],
|
|
1001
|
+
&[data-no-newline] {
|
|
1002
|
+
&::before {
|
|
1003
|
+
content: '+';
|
|
1004
|
+
color: var(--diffs-addition-base);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
[data-line-type='change-deletion'] {
|
|
1010
|
+
&[data-line],
|
|
1011
|
+
&[data-no-newline] {
|
|
1012
|
+
&::before {
|
|
1013
|
+
content: '-';
|
|
1014
|
+
color: var(--diffs-deletion-base);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
[data-indicators='bars'] {
|
|
1021
|
+
[data-line-type='change-deletion'],
|
|
1022
|
+
[data-line-type='change-addition'] {
|
|
1023
|
+
&[data-column-number] {
|
|
1024
|
+
&::before {
|
|
1025
|
+
content: '';
|
|
1026
|
+
display: block;
|
|
1027
|
+
width: 4px;
|
|
1028
|
+
height: 100%;
|
|
1029
|
+
position: absolute;
|
|
1030
|
+
top: 0;
|
|
1031
|
+
left: 0;
|
|
1032
|
+
-webkit-user-select: none;
|
|
1033
|
+
user-select: none;
|
|
1034
|
+
contain: strict;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
[data-line-type='change-deletion'] {
|
|
1040
|
+
&[data-column-number] {
|
|
1041
|
+
&::before {
|
|
1042
|
+
background-image: linear-gradient(
|
|
1043
|
+
0deg,
|
|
1044
|
+
var(--diffs-bg-deletion) 50%,
|
|
1045
|
+
var(--diffs-deletion-base) 50%
|
|
1046
|
+
);
|
|
1047
|
+
background-repeat: repeat;
|
|
1048
|
+
background-size: 2px 2px;
|
|
1049
|
+
background-size: calc(1lh / round(1lh / 2px))
|
|
1050
|
+
calc(1lh / round(1lh / 2px));
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
[data-line-type='change-addition'] {
|
|
1056
|
+
&[data-column-number] {
|
|
1057
|
+
&::before {
|
|
1058
|
+
background-color: var(--diffs-addition-base);
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
[data-overflow='wrap'] {
|
|
1065
|
+
[data-line],
|
|
1066
|
+
[data-annotation-content] {
|
|
1067
|
+
white-space: pre-wrap;
|
|
1068
|
+
word-break: break-word;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
[data-overflow='scroll'] [data-line] {
|
|
1073
|
+
white-space: pre;
|
|
1074
|
+
min-height: 1lh;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
[data-column-number] {
|
|
1078
|
+
box-sizing: content-box;
|
|
1079
|
+
text-align: right;
|
|
1080
|
+
-webkit-user-select: none;
|
|
1081
|
+
user-select: none;
|
|
1082
|
+
background-color: var(--diffs-bg);
|
|
1083
|
+
color: var(--diffs-fg-number);
|
|
1084
|
+
padding-left: 2ch;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
[data-line-number-content] {
|
|
1088
|
+
display: inline-block;
|
|
1089
|
+
min-width: var(
|
|
1090
|
+
--diffs-min-number-column-width,
|
|
1091
|
+
var(--diffs-min-number-column-width-default, 3ch)
|
|
1092
|
+
);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
[data-disable-line-numbers] {
|
|
1096
|
+
[data-column-number] {
|
|
1097
|
+
min-width: 4px;
|
|
1098
|
+
padding: 0;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
[data-line-number-content] {
|
|
1102
|
+
display: none;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
[data-hover-slot] {
|
|
1106
|
+
right: unset;
|
|
1107
|
+
left: 0;
|
|
1108
|
+
justify-content: flex-start;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
&[data-indicators='bars'] [data-hover-slot] {
|
|
1112
|
+
/* Using 5px here because theres a 1px separator after the bar */
|
|
1113
|
+
left: 5px;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
[data-file][data-disable-line-numbers] {
|
|
1118
|
+
[data-gutter-buffer],
|
|
1119
|
+
[data-column-number] {
|
|
1120
|
+
min-width: 0;
|
|
1121
|
+
border-right: 0;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
[data-interactive-line-numbers] [data-column-number] {
|
|
1126
|
+
cursor: pointer;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
[data-diff-span] {
|
|
1130
|
+
border-radius: 3px;
|
|
1131
|
+
-webkit-box-decoration-break: clone;
|
|
1132
|
+
box-decoration-break: clone;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
[data-line-type='change-addition'] {
|
|
1136
|
+
&[data-column-number] {
|
|
1137
|
+
color: var(
|
|
1138
|
+
--diffs-fg-number-addition-override,
|
|
1139
|
+
var(--diffs-addition-base)
|
|
1140
|
+
);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
> [data-diff-span] {
|
|
1144
|
+
background-color: var(--diffs-bg-addition-emphasis);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
[data-line-type='change-deletion'] {
|
|
1149
|
+
&[data-column-number] {
|
|
1150
|
+
color: var(
|
|
1151
|
+
--diffs-fg-number-deletion-override,
|
|
1152
|
+
var(--diffs-deletion-base)
|
|
1153
|
+
);
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
[data-diff-span] {
|
|
1157
|
+
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
[data-background] [data-line-type='change-addition'] {
|
|
1162
|
+
--diffs-line-bg: var(--diffs-bg-addition);
|
|
1163
|
+
|
|
1164
|
+
&[data-column-number] {
|
|
1165
|
+
background-color: var(--diffs-bg-addition-number);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
[data-background] [data-line-type='change-deletion'] {
|
|
1170
|
+
--diffs-line-bg: var(--diffs-bg-deletion);
|
|
1171
|
+
|
|
1172
|
+
&[data-column-number] {
|
|
1173
|
+
background-color: var(--diffs-bg-deletion-number);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
@media (pointer: fine) {
|
|
1178
|
+
[data-column-number],
|
|
1179
|
+
[data-line] {
|
|
1180
|
+
&[data-hovered] {
|
|
1181
|
+
background-color: var(--diffs-bg-hover);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
[data-background] {
|
|
1186
|
+
[data-column-number],
|
|
1187
|
+
[data-line] {
|
|
1188
|
+
&[data-hovered] {
|
|
1189
|
+
&[data-line-type='change-deletion'] {
|
|
1190
|
+
background-color: var(--diffs-bg-deletion-hover);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
&[data-line-type='change-addition'] {
|
|
1194
|
+
background-color: var(--diffs-bg-addition-hover);
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
[data-diffs-header] {
|
|
1202
|
+
position: relative;
|
|
1203
|
+
display: flex;
|
|
1204
|
+
flex-direction: row;
|
|
1205
|
+
justify-content: space-between;
|
|
1206
|
+
align-items: center;
|
|
1207
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1208
|
+
min-height: calc(
|
|
1209
|
+
1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)
|
|
1210
|
+
);
|
|
1211
|
+
padding-inline: 16px;
|
|
1212
|
+
top: 0;
|
|
1213
|
+
z-index: 2;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
[data-header-content] {
|
|
1217
|
+
display: flex;
|
|
1218
|
+
flex-direction: row;
|
|
1219
|
+
align-items: center;
|
|
1220
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1221
|
+
min-width: 0;
|
|
1222
|
+
white-space: nowrap;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
[data-header-content] [data-prev-name],
|
|
1226
|
+
[data-header-content] [data-title] {
|
|
1227
|
+
direction: rtl;
|
|
1228
|
+
overflow: hidden;
|
|
1229
|
+
text-overflow: ellipsis;
|
|
1230
|
+
min-width: 0;
|
|
1231
|
+
white-space: nowrap;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
[data-prev-name] {
|
|
1235
|
+
opacity: 0.7;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
[data-rename-icon] {
|
|
1239
|
+
fill: currentColor;
|
|
1240
|
+
flex-shrink: 0;
|
|
1241
|
+
flex-grow: 0;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
[data-diffs-header] [data-metadata] {
|
|
1245
|
+
display: flex;
|
|
1246
|
+
align-items: center;
|
|
1247
|
+
gap: 1ch;
|
|
1248
|
+
white-space: nowrap;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
[data-diffs-header] [data-additions-count] {
|
|
1252
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1253
|
+
color: var(--diffs-addition-base);
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
[data-diffs-header] [data-deletions-count] {
|
|
1257
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1258
|
+
color: var(--diffs-deletion-base);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
[data-annotation-content] {
|
|
1262
|
+
position: relative;
|
|
1263
|
+
display: flow-root;
|
|
1264
|
+
align-self: flex-start;
|
|
1265
|
+
z-index: 2;
|
|
1266
|
+
min-width: 0;
|
|
1267
|
+
isolation: isolate;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/* Sticky positioning has a composite costs, so we should _only_ pay it if we
|
|
1271
|
+
* need to */
|
|
1272
|
+
[data-overflow='scroll'] [data-annotation-content] {
|
|
1273
|
+
position: sticky;
|
|
1274
|
+
width: var(--diffs-column-content-width, auto);
|
|
1275
|
+
left: var(--diffs-column-number-width, 0);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/* Undo some of the stuff that the 'pre' tag does */
|
|
1279
|
+
[data-annotation-slot] {
|
|
1280
|
+
text-wrap-mode: wrap;
|
|
1281
|
+
word-break: normal;
|
|
1282
|
+
white-space-collapse: collapse;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
[data-change-icon] {
|
|
1286
|
+
fill: currentColor;
|
|
1287
|
+
flex-shrink: 0;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
[data-change-icon='change'],
|
|
1291
|
+
[data-change-icon='rename-pure'],
|
|
1292
|
+
[data-change-icon='rename-changed'] {
|
|
1293
|
+
color: var(--diffs-modified-base);
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
[data-change-icon='new'] {
|
|
1297
|
+
color: var(--diffs-addition-base);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
[data-change-icon='deleted'] {
|
|
1301
|
+
color: var(--diffs-deletion-base);
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
[data-change-icon='file'] {
|
|
1305
|
+
opacity: 0.6;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
/* Line selection highlighting */
|
|
1309
|
+
[data-selected-line] {
|
|
1310
|
+
&[data-gutter-buffer='annotation'],
|
|
1311
|
+
&[data-column-number] {
|
|
1312
|
+
color: var(--diffs-selection-number-fg);
|
|
1313
|
+
background-color: var(--diffs-bg-selection-number);
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
&[data-line] {
|
|
1317
|
+
background-color: var(--diffs-bg-selection);
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
[data-line-type='change-addition'],
|
|
1322
|
+
[data-line-type='change-deletion'] {
|
|
1323
|
+
&[data-selected-line] {
|
|
1324
|
+
&[data-line],
|
|
1325
|
+
&[data-line][data-hovered] {
|
|
1326
|
+
background-color: light-dark(
|
|
1327
|
+
color-mix(
|
|
1328
|
+
in lab,
|
|
1329
|
+
var(--diffs-line-bg, var(--diffs-bg)) 82%,
|
|
1330
|
+
var(--diffs-selection-base)
|
|
1331
|
+
),
|
|
1332
|
+
color-mix(
|
|
1333
|
+
in lab,
|
|
1334
|
+
var(--diffs-line-bg, var(--diffs-bg)) 75%,
|
|
1335
|
+
var(--diffs-selection-base)
|
|
1336
|
+
)
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
&[data-column-number],
|
|
1341
|
+
&[data-column-number][data-hovered] {
|
|
1342
|
+
color: var(--diffs-selection-number-fg);
|
|
1343
|
+
background-color: light-dark(
|
|
1344
|
+
color-mix(
|
|
1345
|
+
in lab,
|
|
1346
|
+
var(--diffs-line-bg, var(--diffs-bg)) 75%,
|
|
1347
|
+
var(--diffs-selection-base)
|
|
1348
|
+
),
|
|
1349
|
+
color-mix(
|
|
1350
|
+
in lab,
|
|
1351
|
+
var(--diffs-line-bg, var(--diffs-bg)) 60%,
|
|
1352
|
+
var(--diffs-selection-base)
|
|
1353
|
+
)
|
|
1354
|
+
);
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
[data-hover-slot] {
|
|
1360
|
+
position: absolute;
|
|
1361
|
+
top: 0;
|
|
1362
|
+
bottom: 0;
|
|
1363
|
+
right: 0;
|
|
1364
|
+
display: flex;
|
|
1365
|
+
justify-content: flex-end;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
[data-unmodified-lines] {
|
|
1369
|
+
display: block;
|
|
1370
|
+
overflow: hidden;
|
|
1371
|
+
min-width: 0;
|
|
1372
|
+
text-overflow: ellipsis;
|
|
1373
|
+
white-space: nowrap;
|
|
1374
|
+
flex: 0 1 auto;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
[data-error-wrapper] {
|
|
1378
|
+
overflow: auto;
|
|
1379
|
+
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1380
|
+
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1381
|
+
max-height: 400px;
|
|
1382
|
+
scrollbar-width: none;
|
|
1383
|
+
|
|
1384
|
+
[data-error-message] {
|
|
1385
|
+
font-weight: bold;
|
|
1386
|
+
font-size: 18px;
|
|
1387
|
+
color: var(--diffs-deletion-base);
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
[data-error-stack] {
|
|
1391
|
+
color: var(--diffs-fg-number);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
[data-placeholder] {
|
|
1396
|
+
contain: strict;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
`,Jt=`@layer base, theme, unsafe;`;function Yt(e){return`${Jt}
|
|
1400
|
+
@layer unsafe {
|
|
1401
|
+
${e}
|
|
1402
|
+
}`}function Xt({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 Zt(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Qt(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,themeStyles:s,themeType:c,totalLines:l}){switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),c===`system`?e.removeAttribute(`data-theme-type`):e.setAttribute(`data-theme-type`,c),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`);break}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.tabIndex=0,e.style=s,e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${l}`.length}ch`),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let t;class n extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let e=this.attachShadow({mode:`open`});t??(t=new CSSStyleSheet,t.replaceSync(qt)),e.adoptedStyleSheets=[t]}}customElements.define(e,n)}function $t(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 en(e,t){return r(e?.theme??z,t?.theme??z)&&$t(e,t,[`theme`])}function tn({fileDiff:e,deletionFile:t,additionFile:n,renderHeaderMetadata:r,renderAnnotation:i,renderHoverUtility:a,lineAnnotations:o,getHoveredLine:s}){let c=r?.({fileDiff:e,deletionFile:t,additionFile:n});return(0,K.jsxs)(K.Fragment,{children:[c!=null&&(0,K.jsx)(`div`,{slot:`header-metadata`,children:c}),i!=null&&o?.map((e,t)=>(0,K.jsx)(`div`,{slot:G(e),children:i(e)},t)),a!=null&&(0,K.jsx)(`div`,{slot:`hover-slot`,style:tt,children:a(s)})]})}var nn=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 rn(e){return d({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Q(e){return d({tagName:`div`,children:[d({tagName:`span`,children:[x(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function an(e){return d({tagName:`div`,children:[_({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{"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 $({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=[];if(e===`metadata`&&t!=null&&s.push(d({tagName:`div`,children:[x(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||e.push(an(`up`)),o||e.push(an(`down`))):e.push(an(!a&&!o?`both`:a?`down`:`up`))),e.push(d({tagName:`div`,children:[d({tagName:`span`,children:[x(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),s.push(d({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":e.length>2?``:void 0}}))}return e===`custom`&&i!=null&&s.push(d({tagName:`slot`,properties:{name:i}})),d({tagName:`div`,children:s,properties:{"data-separator":s.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function on(e,t){return`hunk-separator-${e}-${t}`}function sn(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function cn(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}var ln=-1,un=class{__id=`diff-hunks-renderer:${++ln}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:z},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Mt(e.theme??z)?h():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){this.getOptionsWithDefaults().themeType!==e&&this.mergeOptions({themeType:e})}expandHunk(e,t){let{expansionLineCount:n}=this.getOptionsWithDefaults(),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.renderCache=void 0),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??ae}getExpandedHunksMap(){return this.expandedHunks}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)}}getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1,expansionLineCount:c=100,hunkSeparators:l=`line-info`,lineDiffType:u=`word-alt`,maxLineDiffLength:d=1e3,overflow:f=`scroll`,theme:p=z,themeType:m=`system`,tokenizeMaxLineLength:h=1e3,useCSSClasses:g=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,expandUnchanged:o,collapsedContextThreshold:s,expansionLineCount:c,hunkSeparators:l,lineDiffType:u,maxLineDiffLength:d,overflow:f,theme:this.workerManager?.getDiffRenderOptions().theme??p,themeType:m,tokenizeMaxLineLength:h,useCSSClasses:g}}async initializeHighlighter(){return this.highlighter=await te(Vt(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getDiffResultCache(e);n!=null&&!dn(t,n.options)&&(n=void 0),this.renderCache??={diff:e,highlighted:!0,options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n}=this.getOptionsWithDefaults();return{theme:e,tokenizeMaxLineLength:t,lineDiffType:n}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||e!==n.diff||!dn(t,n.options)?{options:t,forceRender:!0}:{options:t,forceRender:!1}}renderDiff(e=this.renderCache?.diff,t=R){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),i=this.workerManager?.getDiffResultCache(e);i!=null&&this.renderCache==null&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...i});let{options:a,forceRender:o}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!At(this.renderCache.renderRange,t))&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,cn(t)||n?!0:this.expandedHunks,r),this.renderCache.renderRange=t),t.totalLines>0&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??Ze(e.name);let t=this.highlighter!=null&&Mt(a.theme),n=this.highlighter!=null&&jt(this.computedLang);if(this.highlighter!=null&&t&&(o||!this.renderCache.highlighted&&n||this.renderCache.result==null)){let{result:t,options:r}=this.renderDiffWithHighlighter(e,this.highlighter,!n);this.renderCache={diff:e,options:r,highlighted:n,result:t,renderRange:void 0}}(!t||!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.onHighlightSuccess(e,t,n)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=R){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n,r){let{diffIndicators:i,disableBackground:a,disableLineNumbers:o,overflow:s,themeType:c}=this.getOptionsWithDefaults();return zt({type:`diff`,diffIndicators:i,disableBackground:a,disableLineNumbers:o,overflow:s,themeStyles:n,split:e,themeType:r??c,totalLines:t})}async asyncHighlight(e){this.computedLang=e.lang??Ze(e.name);let t=this.highlighter!=null&&Mt(this.options.theme??z),n=this.highlighter!=null&&jt(this.computedLang);return(this.highlighter==null||!t||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:D(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n){if(this.renderCache==null)return;let r=this.renderCache.diff!==e||!this.renderCache.highlighted||!dn(this.renderCache.options,n);this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,n,{code:r,themeStyles:i,baseThemeType:a}){let{diffStyle:o,disableFileHeader:s,expandUnchanged:c,expansionLineCount:l,collapsedContextThreshold:u,hunkSeparators:d}=this.getOptionsWithDefaults();this.diff=e;let f=o===`unified`,p=[],m=[],h=[],g=[],{additionLines:_,deletionLines:v}=r,y={rowCount:0,hunkSeparators:d,additionsContentAST:p,deletionsContentAST:m,unifiedContentAST:h,unifiedGutterAST:k(),deletionsGutterAST:k(),additionsGutterAST:k(),expansionLineCount:l,hunkData:g,incrementRowCount(e=1){y.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:y.unifiedGutterAST.children.push(t);break;case`deletions`:y.deletionsGutterAST.children.push(t);break;case`additions`:y.additionsGutterAST.children.push(t);break}}},b=hn(e),x=0,S;function w(e,t,n,r){y.pushToGutter(e,T(t,n,r))}function E(){if(o!==`unified`){if(x<=0||S==null){x=0,S=void 0;return}S===`additions`?(y.pushToGutter(`additions`,C(void 0,`buffer`,x)),p?.push(rn(x))):(y.pushToGutter(`deletions`,C(void 0,`buffer`,x)),m?.push(rn(x))),x=0,S=void 0}}function D(e){E(),o===`unified`?mn(`unified`,e,y):(mn(`deletions`,e,y),mn(`additions`,e,y))}t({diff:e,diffStyle:o,startingLine:n.startingLine,totalLines:n.totalLines,expandedHunks:c?!0:this.expandedHunks,collapsedContextThreshold:u,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:a,deletionLine:s,type:c})=>{let l=s==null?a.splitLineIndex:s.splitLineIndex,u=a==null?s.unifiedLineIndex:a.unifiedLineIndex;o===`split`&&c!==`change`&&E(),r>0&&D({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=o===`unified`?u:l;if(o===`unified`){let n=s==null?void 0:v[s.lineIndex],r=a==null?void 0:_[a.lineIndex];if(n==null&&r==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}w(`unified`,c===`change`?a==null?`change-deletion`:`change-addition`:c,a==null?s.lineNumber:a.lineNumber,`${u},${l}`),pn({diffStyle:`unified`,type:c,deletionLine:n,additionLine:r,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,a?.lineNumber,t,f),context:y})}else{let n=s==null?void 0:v[s.lineIndex],r=a==null?void 0:_[a.lineIndex];if(n==null&&r==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let i=(()=>{if(c===`change`){if(r==null)return`additions`;if(n==null)return`deletions`}})();if(i!=null){if(S!=null&&S!==i)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);S=i,x++}let o=this.getAnnotations(`split`,s?.lineNumber,a?.lineNumber,t,f);o!=null&&x>0&&E(),s!=null&&w(`deletions`,c===`change`?`change-deletion`:c,s.lineNumber,`${s.unifiedLineIndex},${l}`),a!=null&&w(`additions`,c===`change`?`change-addition`:c,a.lineNumber,`${a.unifiedLineIndex},${l}`),pn({diffStyle:`split`,type:c,additionLine:r,deletionLine:n,...o,context:y})}let p=s?.noEOFCR??!1,m=a?.noEOFCR??!1;if(m||p){if(p){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;o===`unified`?(y.unifiedContentAST.push(Q(e)),y.pushToGutter(`unified`,C(e,`metadata`,1))):(y.deletionsContentAST.push(Q(e)),y.pushToGutter(`deletions`,C(e,`metadata`,1)),m||(y.pushToGutter(`additions`,C(void 0,`buffer`,1)),y.additionsContentAST.push(rn(1))))}if(m){let e=c===`context`||c===`context-expanded`?c:`change-addition`;o===`unified`?(y.unifiedContentAST.push(Q(e)),y.pushToGutter(`unified`,C(e,`metadata`,1))):(y.additionsContentAST.push(Q(e)),y.pushToGutter(`additions`,C(e,`metadata`,1)),p||(y.pushToGutter(`deletions`,C(void 0,`buffer`,1)),y.deletionsContentAST.push(rn(1))))}y.incrementRowCount(1)}i>0&&d!==`simple`&&D({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:b,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),y.incrementRowCount(1)}}),o===`split`&&E();let O=Math.max(sn(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),A=n.bufferBefore>0||n.bufferAfter>0,j=!f&&e.type!==`deleted`,M=!f&&e.type!==`new`,N=y.rowCount>0||A;p=j&&N?p:void 0,m=M&&N?m:void 0,h=f&&N?h:void 0;let P=this.createPreElement(m!=null&&p!=null,O,i,a);return{unifiedGutterAST:f&&N?y.unifiedGutterAST.children:void 0,unifiedContentAST:h,deletionsGutterAST:M&&N?y.deletionsGutterAST.children:void 0,deletionsContentAST:m,additionsGutterAST:j&&N?y.additionsGutterAST.children:void 0,additionsContentAST:p,hunkData:g,preNode:P,themeStyles:i,baseThemeType:a,headerElement:s?void 0:this.renderHeader(this.diff,i,a),totalLines:O,rowCount:y.rowCount,bufferBefore:n.bufferBefore,bufferAfter:n.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=k(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,Pt(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(d({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(d({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(d({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return L(this.renderFullAST(e,t))}renderPartialHTML(e,t){return L(t==null?e:d({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}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(G(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(G(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e,t,n){let{themeType:r}=this.getOptionsWithDefaults();return It({fileOrDiff:e,themeStyles:t,themeType:n??r})}};function dn(e,t){return r(e.theme,t.theme)&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType}function fn(e){return`${e} unmodified line${e>1?`s`:``}`}function pn({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,context:s}){let c=!1;if(e===`unified`){if(r==null?n!=null&&s.unifiedContentAST.push(n):s.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;s.unifiedContentAST.push(Nt(i)),s.pushToGutter(`unified`,C(e,`annotation`,1)),c=!0}}else if(e===`split`){if(n!=null&&s.deletionsContentAST.push(n),r!=null&&s.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;s.deletionsContentAST.push(Nt(a)),s.pushToGutter(`deletions`,C(e,`annotation`,1)),c=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;s.additionsContentAST.push(Nt(o)),s.pushToGutter(`additions`,C(e,`annotation`,1)),c=!0}}c&&s.incrementRowCount(1)}function mn(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,$({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push($({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,$({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push($({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=on(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,$({type:c.hunkSeparators,content:fn(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push($({type:c.hunkSeparators,content:fn(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function hn(e){let t=e.hunks.at(-1);if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),r=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==r)throw Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${r}) for ${e.name}`);return Math.min(n,r)}function gn(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function _n(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function vn(e){let t=e[0];if(t!==`+`&&t!==`-`&&t!==` `&&t!==`\\`){console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);return}let n=e.substring(1);return{line:n===``?`
|
|
1403
|
+
`:n,type:t===` `?`context`:t===`\\`?`metadata`:t===`+`?`addition`:`deletion`}}function yn(e,t,n=!1){let r=W.test(e),i=e.split(r?W:fe),a,o=[];for(let e of i){if(r&&!W.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}else if(!r&&!fe.test(e)){if(a==null)a=e;else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=bn(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function bn(e,{cacheKey:t,isGitDiff:n=W.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=e.split(Ae),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=e.split(Re),f=s.shift();if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=f.match(le),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?i.contents.split(Re):[],deletionLines:!l&&r!=null&&i!=null?r.contents.split(Re):[],cacheKey:t},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0),s.unshift(f);for(let e of s){let t=e.match(n?Be:me);if(e.startsWith(`diff --git`)){let[,,t,,n]=e.trim().match(Fe)??[];c.name=n.trim(),t!==n&&(c.prevName=t.trim())}else if(t!=null){let[,e,n]=t;e===`---`&&n!==`/dev/null`?(c.prevName=n.trim(),c.name=n.trim()):e===`+++`&&n!==`/dev/null`&&(c.name=n.trim())}else if(n){if(e.startsWith(`new mode `)&&(c.mode=e.replace(`new mode`,``).trim()),e.startsWith(`old mode `)&&(c.prevMode=e.replace(`old mode`,``).trim()),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=e.replace(`new file mode`,``).trim()),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=e.replace(`deleted file mode`,``).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(Me)??[];t!=null&&(c.prevObjectId=t),n!=null&&(c.newObjectId=n),r!=null&&(c.mode=r)}e.startsWith(`rename from `)&&(c.prevName=e.replace(`rename from `,``)),e.startsWith(`rename to `)&&(c.name=e.replace(`rename to `,``).trim())}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
1404
|
+
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
1405
|
+
`||s[s.length-1]===``);)s.pop();let v=parseInt(p[3]),y=parseInt(p[1]);u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(p[4]??`1`),additionStart:v,additionLines:m,deletionCount:parseInt(p[2]??`1`),deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:p[5],hunkSpecs:f,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(b.additionCount)||isNaN(b.deletionCount)||isNaN(b.additionStart)||isNaN(b.deletionStart)){if(a)throw Error(`parsePatchContent: invalid hunk metadata`);console.error(`parsePatchContent: invalid hunk metadata`,b);continue}for(let e of s){let t=vn(e);if(t==null){console.error(`processFile: invalid rawLine:`,e);continue}let{type:n,line:r}=t;if(n===`addition`)(g==null||g.type!==`change`)&&(g=Sn(`change`,u,d),b.hunkContent.push(g)),d++,l&&c.additionLines.push(r),g.additions++,m++,_=`addition`;else if(n===`deletion`)(g==null||g.type!==`change`)&&(g=Sn(`change`,u,d),b.hunkContent.push(g)),u++,l&&c.deletionLines.push(r),g.deletions++,h++,_=`deletion`;else if(n===`context`)(g==null||g.type!==`context`)&&(g=Sn(`context`,u,d),b.hunkContent.push(g)),d++,u++,l&&(c.deletionLines.push(r),c.additionLines.push(r)),g.lines++,_=`context`;else if(n===`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]=M(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=M(c.deletionLines[e]))}}}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;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(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,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`:i!=null&&i.contents===``?c.type=`deleted`:r!=null&&r.contents===``&&(c.type=`new`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function xn(e,t,n=!1){let r=[];for(let i of e.split(y))try{r.push(yn(i,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function Sn(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function Cn(e,t,n,r=!1){let i=bn(we(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return i}var wn=-1,Tn=class{static LoadedCustomComponent=!0;__id=`file-diff:${++wn}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;unsafeCSSStyle;hoverContent;headerElement;headerMetadata;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;mouseEventManager;lineSelectionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:z},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=new un({...e,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new kt,this.scrollSyncManager=new nn,this.mouseEventManager=new Tt(`diff`,Et(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0)),this.lineSelectionManager=new xt(St(e,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`)if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}else o+=n.lines,c+=n.lines,l+=n.lines;else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}else o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(!(r==null||i==null))return[r,i]};setOptions(e){e!=null&&(this.options=e,this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof e.hunkSeparators==`function`?`custom`:e.hunkSeparators}),this.mouseEventManager.setOptions(Et(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0)),this.lineSelectionManager.setOptions(St(e,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.hunksRenderer.setThemeType(e),this.headerElement!=null&&(e===`system`?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case`system`:delete this.pre.dataset.themeType;break;case`light`:case`dark`:this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.mouseEventManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e){this.lineSelectionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.mouseEventManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=``),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML=``,this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{overflow:t=`scroll`,diffStyle:n=`split`}=this.options,{fileContainer:r,prerenderedHTML:i}=e;Zt(r,i);for(let e of r.shadowRoot?.children??[]){if(e instanceof SVGElement){this.spriteSVG=e;continue}if(e instanceof HTMLElement){if(e instanceof HTMLPreElement){this.pre=e;for(let t of e.children)!(t instanceof HTMLElement)||t.tagName.toLowerCase()!==`code`||(`deletions`in t.dataset&&(this.codeDeletions=t),`additions`in t.dataset&&(this.codeAdditions=t),`unified`in t.dataset&&(this.codeUnified=t));continue}if(`diffsHeader`in e.dataset){this.headerElement=e;continue}if(e instanceof HTMLStyleElement&&e.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=e;continue}}}if(this.pre!=null&&this.syncCodeNodesFromPre(this.pre),this.pre==null)this.render(e);else{let{lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.fileContainer=r,delete this.pre.dataset.dehydrated,this.lineAnnotations=i??this.lineAnnotations,this.additionFile=o,this.deletionFile=a,this.fileDiff=s??(a!=null&&o!=null?Cn(a,o):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderHoverUtility(),this.injectUnsafeCSS(),this.mouseEventManager.setup(this.pre),this.lineSelectionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&n===`split`&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions)}}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({oldFile:this.deletionFile,newFile:this.additionFile,fileDiff:this.fileDiff,forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t)=>{this.expandHunk(e,t)};expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.rerender()}render({oldFile:e,newFile:t,fileDiff:n,forceRender:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let c=e!=null&&t!=null&&(!Se(e,this.deletionFile)||!Se(t,this.additionFile)),l=n!=null&&n!==this.fileDiff,u=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(At(s,this.renderRange)&&!r&&!u&&(n!=null&&n===this.fileDiff||n==null&&!c))return!1;let{renderRange:d}=this;if(this.renderRange=s,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&c&&(l=!0,this.fileDiff=Cn(e,t)):this.fileDiff=n,i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators==`function`?`custom`:this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:f=`split`,disableErrorHandling:p=!1,disableFileHeader:m=!1,overflow:h=`scroll`}=this.options;m&&this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),a=this.getOrCreateFileContainer(a,o);try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(r,u,c||l)&&this.applyPartialRender({previousRenderRange:d,renderRange:s}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,s);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.parentNode?.removeChild(this.pre),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,s),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderHoverUtility(),this.mouseEventManager.setup(e),this.lineSelectionManager.setup(e),this.resizeManager.setup(e,h===`wrap`),h===`scroll`&&f===`split`?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(p)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return!0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.mouseEventManager.cleanUp(),this.lineSelectionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.hoverContent?.remove(),this.pre?.remove(),this.spriteSVG?.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.hoverContent=void 0,this.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}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.parentNode?.removeChild(e);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||!_n(r,i.hunkData)){i?.element.parentNode?.removeChild(i.element);let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName,n.appendChild(t(r,this)),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.parentNode?.removeChild(t)}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.parentNode?.removeChild(e);this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${G(r)}`,a=this.annotationCache.get(i);if(a==null||!gn(r,a.annotation)){a?.element.parentElement?.removeChild(a.element);let e=t(r);if(e==null)continue;a={element:Wt(G(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.parentNode?.removeChild(n)}renderHoverUtility(){let{renderHoverUtility:e}=this.options;if(this.fileContainer==null||e==null)return;let t=e(this.mouseEventManager.getHoveredLine);if(!(t!=null&&this.hoverContent!=null)){if(t==null){this.hoverContent?.parentNode?.removeChild(this.hoverContent),this.hoverContent=void 0;return}this.hoverContent=Gt(),this.hoverContent.appendChild(t),this.fileContainer.appendChild(this.hoverContent)}}getOrCreateFileContainer(e,t){let n=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(`diffs-container`),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Ht;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}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&&(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&&(`unified`in t.dataset?this.codeUnified=t:`deletions`in t.dataset?this.codeDeletions=t:`additions`in t.dataset&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let n=L(e);if(n!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=n;let r=e.firstElementChild;if(!(r instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(r):t.shadowRoot?.replaceChild(r,this.headerElement),this.headerElement=r,this.lastRenderedHeaderHTML=n}if(this.isContainerManaged)return;let{renderHeaderMetadata:r}=this.options;this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);let i=r?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0;i!=null&&(this.headerMetadata=document.createElement(`div`),this.headerMetadata.slot=xe,i instanceof Element?this.headerMetadata.appendChild(i):this.headerMetadata.innerText=`${i}`,t.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;let{unsafeCSS:e}=this.options;e==null||e===``||(this.unsafeCSSStyle??(this.unsafeCSSStyle=Kt(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Yt(e))}applyHunksToDOM(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);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=Xt({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),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=Xt({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),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=Xt({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=En(t[0]),i=En(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}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}else 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)`)}getCodeColumns(e,t,n,r){function i(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}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||t==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),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.parentNode?.removeChild(this.bufferBefore),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.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{themeStyles:t,baseThemeType:n,additionsContentAST:r,deletionsContentAST:i,totalLines:a}){let{diffIndicators:o=`bars`,disableBackground:s=!1,disableLineNumbers:c=!1,overflow:l=`scroll`,themeType:u=`system`,diffStyle:d=`split`}=this.options,f={type:`diff`,diffIndicators:o,disableBackground:s,disableLineNumbers:c,overflow:l,split:d===`unified`?!1:r!=null&&i!=null,themeStyles:t,themeType:n??u,totalLines:a};Ut(f,this.appliedPreAttributes)||(Qt(e,f),this.appliedPreAttributes=f)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML=``,n.parentNode?.removeChild(n),this.pre=void 0,this.appliedPreAttributes=void 0;let r=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.innerHTML=``,r.appendChild(this.errorWrapper);let i=document.createElement(`div`);i.dataset.errorMessage=``,i.innerText=e.message,this.errorWrapper.appendChild(i);let a=document.createElement(`pre`);a.dataset.errorStack=``,a.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function En(e){if(!(e==null||e.type!==`element`))return e.children??[]}function Dn(e,t){let n={...j,...t};return n.hunkSeparatorHeight=On(e,t?.hunkSeparatorHeight),n}function On(e,t){if(t!=null)return t;switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var kn=-1,An=class extends Tn{__id=`little-virtualized-file-diff:${++kn}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;virtualizer;constructor(e,t,n,r,i=!1){super(e,r,i);let{hunkSeparators:a=`line-info`}=this.options;this.virtualizer=t,this.metrics=Dn(typeof a==`function`?`custom`:a,n)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(e==null)return;let t=this.options.diffStyle,n=this.options.overflow;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e=`scroll`}=this.options;if(this.fileContainer!=null&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.fileContainer==null||this.fileDiff==null){this.height=0;return}if(e===`scroll`&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1,r=t===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(let e of r){if(e==null)continue;let r=e.children[1];if(r instanceof HTMLElement)for(let e of r.children){if(!(e instanceof HTMLElement))continue;let r=e.dataset.lineIndex;if(r==null)continue;let i=Mn(r,t),a=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in e.nextElementSibling.dataset||`noNewline`in e.nextElementSibling.dataset)&&(`noNewline`in e.nextElementSibling.dataset&&(o=!0),a+=e.nextElementSibling.getBoundingClientRect().height);let s=this.getLineHeight(i,o);a!==s&&(n=!0,a===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,a))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk(e,t){this.hunksRenderer.expandHunk(e,t),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}setVisibility(e){this.fileContainer!=null&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=this.height===0;if(this.height=0,this.fileDiff==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsedContextThreshold:i=1,hunkSeparators:a=`line-info`}=this.options,{diffHeaderHeight:o,fileGap:s,hunkSeparatorHeight:c}=this.metrics,l=this.getDiffStyle(),u=a!==`simple`&&a!==`metadata`&&a!==`line-info-basic`?s:0;if(n?a!==`simple`&&a!==`metadata`&&(this.height+=s):this.height+=o,t({diff:this.fileDiff,diffStyle:l,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:r,additionLine:i})=>{let o=i==null?r.splitLineIndex:i.splitLineIndex,s=i==null?r.unifiedLineIndex:i.unifiedLineIndex,d=(i?.noEOFCR??!1)||(r?.noEOFCR??!1);t>0&&(e>0&&(this.height+=u),this.height+=c+u),this.height+=this.getLineHeight(l===`split`?o:s,d),n>0&&a!==`simple`&&(this.height+=u+c)}}),this.fileDiff.hunks.length>0&&(this.height+=s),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!e){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...i}={}){let a=this.fileContainer==null;if(this.fileDiff??=r??(t!=null&&n!=null?Cn(t,n):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(a?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.fileDiff,this.top,o);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:s,oldFile:t,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??`split`}getExpandedRegion(e,t,n){if(n<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(t),o=Math.min(Math.max(a.fromStart,0),n),s=Math.min(Math.max(a.fromEnd,0),n),c=o+s,l=c>=n;return{fromStart:o,fromEnd:s,collapsedLines:Math.max(n-c,0),renderAll:l}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}for(let[r,i]of e.hunks.entries()){let a=t===`split`?i.splitLineCount:i.unifiedLineCount;n+=a;let o=Math.max(i.collapsedBefore,0),{fromStart:s,fromEnd:c,renderAll:l}=this.getExpandedRegion(e.isPartial,r,o);o>0&&(n+=l?o:s+c)}let r=e.hunks.at(-1);if(r!=null&&jn(e)){let t=e.additionLines.length-(r.additionLineIndex+r.additionCount),i=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&t!==i)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${i}) for ${e.name}`);let a=Math.min(t,i);if(r!=null&&a>0){let{fromStart:t,renderAll:r}=this.getExpandedRegion(e.isPartial,e.hunks.length,a);n+=r?a:t}}return n}computeRenderRangeFromWindow(e,n,{top:r,bottom:i}){let{disableFileHeader:a=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1,hunkSeparators:c=`line-info`}=this.options,{diffHeaderHeight:l,fileGap:u,hunkLineCount:d,hunkSeparatorHeight:f,lineHeight:p}=this.metrics,m=this.getDiffStyle(),h=this.height,g=this.getExpandedLineCount(e,m),_=a?u:l;if(n<r-h||n>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-_-u};if(g<=d||e.hunks.length===0)return{startingLine:0,totalLines:d,bufferBefore:0,bufferAfter:0};let v=Math.ceil(Math.max(i-r,0)/p),y=Math.ceil(v/d)*d+d,b=y/d,x=b,S=[],C=(r+i)/2,w=c===`simple`||c===`metadata`||c===`line-info-basic`?0:u,T=n+_,E=0,D,O,k;if(t({diff:e,diffStyle:m,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:a,deletionLine:o,additionLine:s})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,u=s==null?o.unifiedLineIndex:s.unifiedLineIndex,p=(s?.noEOFCR??!1)||(o?.noEOFCR??!1),h=t>0?f+w+(e>0?w:0):0;e===0&&c===`simple`&&(h=0),T+=h;let g=E%d===0;if(g&&(S.push(T-(n+_+h)),k!=null)){if(k<=0)return!0;k--}let v=this.getLineHeight(m===`split`?l:u,p),y=Math.floor(E/d);return T>r-v&&T<i&&(D??=y),O==null&&T+v>C&&(O=y),k==null&&T>=i&&g&&(k=x),E++,T+=v,a>0&&c!==`simple`&&(T+=f+w),!1}}),D==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-_-u};let A=S.length;O??=D;let j=Math.round(O-b/2),M=Math.max(0,A-b),N=Math.max(0,Math.min(j,M)),P=N*d,F=j<0?y+j*d:y,ee=S[N]??0,I=N+F/d;return{startingLine:P,totalLines:F,bufferBefore:ee,bufferAfter:I<S.length?h-_-S[I]-u:h-(T-n)-u}}};function jn(e){let t=e.hunks.at(-1);return t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0?!1:t.additionLineIndex+t.additionCount<e.additionLines.length||t.deletionLineIndex+t.deletionCount<e.deletionLines.length}function Mn(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}var Nn=typeof window>`u`?X.useEffect:X.useLayoutEffect;function Pn({oldFile:e,newFile:t,fileDiff:n,options:r,lineAnnotations:i,selectedLines:a,prerenderedHTML:o,metrics:c}){let l=vt(),u=(0,X.useContext)(s),d=(0,X.useRef)(null),f=yt(a=>{if(a!=null){if(d.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);l==null?d.current=new Tn(r,u,!0):d.current=new An(r,l,c,u,!0),d.current.hydrate({fileDiff:n,oldFile:e,newFile:t,fileContainer:a,lineAnnotations:i,prerenderedHTML:o})}else{if(d.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);d.current.cleanUp(),d.current=null}});return Nn(()=>{if(d.current==null)return;let o=d.current,s=!en(o.options,r);o.setOptions(r),o.render({forceRender:s,fileDiff:n,oldFile:e,newFile:t,lineAnnotations:i}),a!==void 0&&o.setSelectedLines(a)}),{ref:f,getHoveredLine:(0,X.useCallback)(()=>d.current?.getHoveredLine(),[])}}function Fn({fileDiff:t,options:n,metrics:r,lineAnnotations:i,selectedLines:a,className:o,style:s,prerenderedHTML:c,renderAnnotation:l,renderHeaderMetadata:u,renderHoverUtility:d}){let{ref:f,getHoveredLine:p}=Pn({fileDiff:t,options:n,metrics:r,lineAnnotations:i,selectedLines:a,prerenderedHTML:c});return(0,K.jsx)(e,{ref:f,className:o,style:s,children:nt(tn({fileDiff:t,renderHeaderMetadata:u,renderAnnotation:l,lineAnnotations:i,renderHoverUtility:d,getHoveredLine:p}),c)})}function In(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var Ln=[];function Rn(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:s,highlightedIndex:l,onHighlightedIndexChange:d,rootRef:f,enableHomeAndEndKeys:p=!1,stopEventPropagation:m=!1,disabledIndices:h,modifierKeys:g=Ln}=e,[_,v]=X.useState(0),y=n>1,b=X.useRef(null),x=E(b,f),S=X.useRef([]),C=X.useRef(!1),w=l??_,T=O((e,t=!1)=>{if((d??v)(e),t){let t=S.current[e];qe(b.current,t,s,a)}}),D=O(e=>{if(e.size===0||C.current)return;C.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&T(r),qe(b.current,n,s,a)}),k=X.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:x,onFocus(e){!b.current||!ue(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let l=p?de:Ve;if(!l.has(e.key)||zn(e,g)||!b.current)return;let d=s===`rtl`,f=d?V:H,_={horizontal:f,vertical:Te,both:f}[a],v=d?H:V,x={horizontal:v,vertical:Ne,both:v}[a];if(ue(e.target)&&!In(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==x&&t<r.length||e.key!==_&&t>0)return}let C=w,E=I(S,h),D=Ke(S,h);if(y){let s=t||Array.from({length:S.current.length},()=>({width:1,height:1})),l=Xe(s,n,i),u=l.findIndex(e=>e!=null&&!c(S,e,h)),f=l.reduce((e,t,n)=>t!=null&&!c(S,t,h)?n:e,-1);C=l[o({current:l.map(e=>e?S.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:F([...h||S.current.map((e,t)=>c(S,t)?t:void 0),void 0],l),minIndex:u,maxIndex:f,prevIndex:Je(w>D?E:w,s,l,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:d})]}let O={horizontal:[f],vertical:[Te],both:[f,Te]}[a],k={horizontal:[v],vertical:[Ne],both:[v,Ne]}[a],A=y?l:{horizontal:p?ge:ve,vertical:p?Ye:Ue,both:l}[a];p&&(e.key===`Home`?C=E:e.key===`End`&&(C=D)),C===w&&(O.includes(e.key)||k.includes(e.key))&&(C=r&&C===D&&O.includes(e.key)?E:r&&C===E&&k.includes(e.key)?D:B(S,{startingIndex:C,decrement:k.includes(e.key),disabledIndices:h})),C!==w&&!u(S,C)&&(m&&e.stopPropagation(),A.has(e.key)&&e.preventDefault(),T(C,!0),queueMicrotask(()=>{S.current[C]?.focus()}))}}),[n,i,s,h,S,p,w,y,t,r,x,g,T,a,m]);return X.useMemo(()=>({props:k,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:S,disabledIndices:h,onMapChange:D,relayKeyboardEvent:k.onKeyDown}),[k,w,T,S,h,D])}function zn(e,t){for(let n of oe.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function Bn(e){let{render:t,className:r,refs:i=Ce,props:a=Ce,state:o=w,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,dense:d,itemSizes:f,loopFocus:p,cols:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:_=!0,rootRef:v,disabledIndices:y,modifierKeys:b,highlightItemOnHover:x=!1,tag:S=`div`,...C}=e,{props:T,highlightedIndex:E,onHighlightedIndexChange:D,elementsRef:O,onMapChange:k,relayKeyboardEvent:A}=Rn({itemSizes:f,cols:m,loopFocus:p,dense:d,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:v,stopEventPropagation:_,enableHomeAndEndKeys:h,direction:se(),disabledIndices:y,modifierKeys:b}),j=n(S,e,{state:o,ref:i,props:[T,...a,C],stateAttributesMapping:s}),M=X.useMemo(()=>({highlightedIndex:E,onHighlightedIndexChange:D,highlightItemOnHover:x,relayKeyboardEvent:A}),[E,D,x,A]);return(0,K.jsx)(We.Provider,{value:M,children:(0,K.jsx)(be,{elementsRef:O,onMapChange:e=>{g?.(e),k(e)},children:j})})}let Vn=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({});var Hn={multiple(e){return e?{[Vn.multiple]:``}:null}};const Un=X.forwardRef(function(e,t){let{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:o,orientation:s=`horizontal`,multiple:c=!1,value:l,className:u,render:d,...f}=e,p=Ie(!0),m=X.useMemo(()=>{if(l===void 0)return r??[]},[l,r]),h=X.useMemo(()=>l!==void 0||r!==void 0,[l,r]),g=(p?.disabled??!1)||i,[_,v]=P({controlled:l,default:m,name:`ToggleGroup`,state:`value`}),y=O((e,t,n)=>{let r;if(c?(r=_.slice(),t?r.push(e):r.splice(_.indexOf(e),1)):r=t?[e]:[],Array.isArray(r)){if(o?.(r,n),n.isCanceled)return;v(r)}}),b={disabled:g,multiple:c,orientation:s},x=X.useMemo(()=>({disabled:g,orientation:s,setGroupValue:y,value:_,isValueInitialized:h}),[g,s,y,_,h]),S={role:`group`},C=n(`div`,e,{enabled:!!p,state:b,ref:t,props:[S,f],stateAttributesMapping:Hn});return(0,K.jsx)(ke.Provider,{value:x,children:p?C:(0,K.jsx)(Bn,{render:d,className:u,state:b,refs:[t],props:[S,f],stateAttributesMapping:Hn,loopFocus:a,enableHomeAndEndKeys:!0})})});var Wn=S(),Gn=X.createContext({size:`default`,variant:`default`});function Kn(e){let t=(0,Wn.c)(24),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,variant:a,size:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`default`:a,l=o===void 0?`default`:o,u=s===void 0?`horizontal`:s,d,f;t[7]!==l||t[8]!==c?(f={size:l,variant:c},t[7]=l,t[8]=c,t[9]=f):f=t[9],d=f;let p=d,m=u===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=c===`default`?`gap-0.5`:u===`horizontal`?`*:not-first:not-data-[slot=separator]:before:-start-[0.5px] *:not-last:not-data-[slot=separator]:before:-end-[0.5px] *:not-first:rounded-s-none *:not-last:rounded-e-none *:not-first:border-s-0 *:not-last:border-e-0 *:not-first:before:rounded-s-none *:not-last:before:rounded-e-none`:`*:not-first:not-data-[slot=separator]:before:-top-[0.5px] *:not-last:not-data-[slot=separator]:before:-bottom-[0.5px] flex-col *:not-first:rounded-t-none *:not-last:rounded-b-none *:not-first:border-t-0 *:not-last:border-b-0 *:not-first:before:rounded-t-none *:not-last:before:rounded-b-none *:data-[slot=toggle]:not-last:before:hidden dark:*:last:before:hidden dark:*:first:before:block`,g;t[10]!==r||t[11]!==m||t[12]!==h?(g=U(`flex w-fit *:focus-visible:z-10 dark:*:[[data-slot=separator]:has(+[data-slot=toggle]:hover)]:before:bg-input/64 dark:*:[[data-slot=separator]:has(+[data-slot=toggle][data-pressed])]:before:bg-input dark:*:[[data-slot=toggle]:hover+[data-slot=separator]]:before:bg-input/64 dark:*:[[data-slot=toggle][data-pressed]+[data-slot=separator]]:before:bg-input`,m,h,r),t[10]=r,t[11]=m,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==n||t[15]!==p?(_=(0,K.jsx)(Gn.Provider,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=_):_=t[16];let v;return t[17]!==u||t[18]!==i||t[19]!==l||t[20]!==g||t[21]!==_||t[22]!==c?(v=(0,K.jsx)(Un,{className:g,"data-size":l,"data-slot":`toggle-group`,"data-variant":c,orientation:u,...i,children:_}),t[17]=u,t[18]=i,t[19]=l,t[20]=g,t[21]=_,t[22]=c,t[23]=v):v=t[23],v}function qn(e){let t=(0,Wn.c)(12),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:o,size:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=X.useContext(Gn),c=o??s.variant,l=a??s.size,u;return t[6]!==n||t[7]!==r||t[8]!==i||t[9]!==l||t[10]!==c?(u=(0,K.jsx)(ze,{className:r,"data-size":l,"data-variant":c,size:l,variant:c,...i,children:n}),t[6]=n,t[7]=r,t[8]=i,t[9]=l,t[10]=c,t[11]=u):u=t[11],u}var Jn=`
|
|
1406
|
+
[data-diffs-header],
|
|
1407
|
+
[data-diff],
|
|
1408
|
+
[data-file],
|
|
1409
|
+
[data-error-wrapper],
|
|
1410
|
+
[data-virtualizer-buffer] {
|
|
1411
|
+
--diffs-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
1412
|
+
--diffs-light-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
1413
|
+
--diffs-dark-bg: color-mix(in srgb, var(--card) 90%, var(--background)) !important;
|
|
1414
|
+
--diffs-token-light-bg: transparent;
|
|
1415
|
+
--diffs-token-dark-bg: transparent;
|
|
1416
|
+
|
|
1417
|
+
--diffs-bg-context-override: color-mix(in srgb, var(--background) 97%, var(--foreground));
|
|
1418
|
+
--diffs-bg-hover-override: color-mix(in srgb, var(--background) 94%, var(--foreground));
|
|
1419
|
+
--diffs-bg-separator-override: color-mix(in srgb, var(--background) 95%, var(--foreground));
|
|
1420
|
+
--diffs-bg-buffer-override: color-mix(in srgb, var(--background) 90%, var(--foreground));
|
|
1421
|
+
|
|
1422
|
+
--diffs-bg-addition-override: color-mix(in srgb, var(--background) 92%, var(--success));
|
|
1423
|
+
--diffs-bg-addition-number-override: color-mix(in srgb, var(--background) 88%, var(--success));
|
|
1424
|
+
--diffs-bg-addition-hover-override: color-mix(in srgb, var(--background) 85%, var(--success));
|
|
1425
|
+
--diffs-bg-addition-emphasis-override: color-mix(in srgb, var(--background) 80%, var(--success));
|
|
1426
|
+
|
|
1427
|
+
--diffs-bg-deletion-override: color-mix(in srgb, var(--background) 92%, var(--destructive));
|
|
1428
|
+
--diffs-bg-deletion-number-override: color-mix(in srgb, var(--background) 88%, var(--destructive));
|
|
1429
|
+
--diffs-bg-deletion-hover-override: color-mix(in srgb, var(--background) 85%, var(--destructive));
|
|
1430
|
+
--diffs-bg-deletion-emphasis-override: color-mix(
|
|
1431
|
+
in srgb,
|
|
1432
|
+
var(--background) 80%,
|
|
1433
|
+
var(--destructive)
|
|
1434
|
+
);
|
|
1435
|
+
|
|
1436
|
+
background-color: var(--diffs-bg) !important;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
[data-file-info] {
|
|
1440
|
+
background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
|
|
1441
|
+
border-block-color: var(--border) !important;
|
|
1442
|
+
color: var(--foreground) !important;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
[data-diffs-header] {
|
|
1446
|
+
position: sticky !important;
|
|
1447
|
+
top: 0;
|
|
1448
|
+
z-index: 4;
|
|
1449
|
+
background-color: color-mix(in srgb, var(--card) 94%, var(--foreground)) !important;
|
|
1450
|
+
border-bottom: 1px solid var(--border) !important;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
[data-title] {
|
|
1454
|
+
cursor: pointer;
|
|
1455
|
+
transition:
|
|
1456
|
+
color 120ms ease,
|
|
1457
|
+
text-decoration-color 120ms ease;
|
|
1458
|
+
text-decoration: underline;
|
|
1459
|
+
text-decoration-color: transparent;
|
|
1460
|
+
text-underline-offset: 2px;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
[data-title]:hover {
|
|
1464
|
+
color: color-mix(in srgb, var(--foreground) 84%, var(--primary)) !important;
|
|
1465
|
+
text-decoration-color: currentColor;
|
|
1466
|
+
}
|
|
1467
|
+
`;function Yn(e,t=`diff-panel`){if(!e)return null;let n=e.trim();if(n.length===0)return null;try{let e=xn(n,Ge(n,t)).flatMap(e=>e.files);return e.length>0?{kind:`files`,files:e}:{kind:`raw`,text:n,reason:`Unsupported diff format. Showing raw patch.`}}catch{return{kind:`raw`,text:n,reason:`Failed to parse patch. Showing raw patch.`}}}function Xn(e){let t=e.name??e.prevName??``;return t.startsWith(`a/`)||t.startsWith(`b/`)?t.slice(2):t}function Zn(e){return e.cacheKey??`${e.prevName??`none`}:${e.name}`}function Qn(e){return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(e))}function $n({mode:e=`inline`}){let t=N(),{resolvedTheme:n}=l(),[r,a]=(0,X.useState)(`stacked`),o=(0,X.useRef)(null),s=(0,X.useRef)(null),[c,u]=(0,X.useState)(!1),[d,p]=(0,X.useState)(!1),m=i({strict:!1,select:e=>e.threadId?v.makeUnsafe(e.threadId):null}),h=Qe({strict:!1,select:e=>je(e)}),g=m,_=f(e=>g?e.threads.find(e=>e.id===g):void 0),y=_?.projectId??null,b=f(e=>y?e.projects.find(e=>e.id===y):void 0),x=_?.worktreePath??b?.cwd,{turnDiffSummaries:S,inferredCheckpointTurnCountByTurnId:C}=ce(_),w=(0,X.useMemo)(()=>[...S].toSorted((e,t)=>{let n=e.checkpointTurnCount??C[e.turnId]??0,r=t.checkpointTurnCount??C[t.turnId]??0;return n===r?t.completedAt.localeCompare(e.completedAt):r-n}),[C,S]),T=h.diffTurnId??null,E=T===null?null:h.diffFilePath??null,D=T===null?void 0:w.find(e=>e.turnId===T)??w[0],O=D&&(D.checkpointTurnCount??C[D.turnId]),k=(0,X.useMemo)(()=>typeof O==`number`?{fromTurnCount:Math.max(0,O-1),toTurnCount:O}:null,[O]),j=(0,X.useMemo)(()=>{let e=w.map(e=>e.checkpointTurnCount??C[e.turnId]).filter(e=>typeof e==`number`);if(e.length===0)return;let t=Math.max(...e);return t>0?t:void 0},[C,w]),M=(0,X.useMemo)(()=>!D&&typeof j==`number`?{fromTurnCount:0,toTurnCount:j}:null,[j,D]),P=D?k:M,F=(0,X.useMemo)(()=>D||w.length===0?null:`conversation:${w.map(e=>e.turnId).join(`,`)}`,[w,D]),I=ie(He({threadId:g,fromTurnCount:P?.fromTurnCount??null,toTurnCount:P?.toTurnCount??null,cacheScope:D?`turn:${D.turnId}`:F})),te=D?I.data?.diff:void 0,ne=D?void 0:I.data?.diff,re=I.isLoading,L=I.error instanceof Error?I.error.message:I.error?`Failed to load checkpoint diff.`:null,R=D?te:ne,ae=typeof R==`string`&&R.trim().length===0,z=(0,X.useMemo)(()=>Yn(R,`diff-panel:${n}`),[n,R]),oe=(0,X.useMemo)(()=>!z||z.kind!==`files`?[]:z.files.toSorted((e,t)=>Xn(e).localeCompare(Xn(t),void 0,{numeric:!0,sensitivity:`base`})),[z]);(0,X.useEffect)(()=>{!E||!o.current||Array.from(o.current.querySelectorAll(`[data-diff-file-path]`)).find(e=>e.dataset.diffFilePath===E)?.scrollIntoView({block:`nearest`})},[E,oe]);let se=(0,X.useCallback)(e=>{let t=Pe();if(!t)return;let n=x?he(e,x):e;t.shell.openInEditor(n,pe()).catch(e=>{console.warn(`Failed to open diff file in editor.`,e)})},[x]),le=e=>{_&&t({to:`/$threadId`,params:{threadId:_.id},search:t=>({...Le(t),diff:`1`,diffTurnId:e})})},ue=()=>{_&&t({to:`/$threadId`,params:{threadId:_.id},search:e=>({...Le(e),diff:`1`})})},B=(0,X.useCallback)(()=>{let e=s.current;if(!e){u(!1),p(!1);return}let t=Math.max(0,e.scrollWidth-e.clientWidth);u(e.scrollLeft>4),p(e.scrollLeft<t-4)},[]),de=(0,X.useCallback)(e=>{let t=s.current;t&&t.scrollBy({left:e,behavior:`smooth`})},[]),fe=(0,X.useCallback)(e=>{let t=s.current;t&&(t.scrollWidth<=t.clientWidth+1||Math.abs(e.deltaY)<=Math.abs(e.deltaX)||(e.preventDefault(),t.scrollBy({left:e.deltaY,behavior:`auto`})))},[]);(0,X.useEffect)(()=>{let e=s.current;if(!e)return;let t=window.requestAnimationFrame(()=>B()),n=()=>B();e.addEventListener(`scroll`,n,{passive:!0});let r=new ResizeObserver(()=>B());return r.observe(e),()=>{window.cancelAnimationFrame(t),e.removeEventListener(`scroll`,n),r.disconnect()}},[B]),(0,X.useEffect)(()=>{let e=window.requestAnimationFrame(()=>B());return()=>{window.cancelAnimationFrame(e)}},[w,T,B]),(0,X.useEffect)(()=>{let e=s.current;e&&e.querySelector(`[data-turn-chip-selected='true']`)?.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`smooth`})},[D?.turnId,T]);let V=A&&e!==`sheet`,me=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`relative min-w-0 flex-1 [-webkit-app-region:no-drag]`,children:[c&&(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 left-8 z-10 w-7 bg-linear-to-r from-card to-transparent`}),d&&(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 right-8 z-10 w-7 bg-linear-to-l from-card to-transparent`}),(0,K.jsx)(`button`,{type:`button`,className:U(`absolute left-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,c?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>de(-180),disabled:!c,"aria-label":`Scroll turn list left`,children:(0,K.jsx)(ye,{className:`size-3.5`})}),(0,K.jsx)(`button`,{type:`button`,className:U(`absolute right-0 top-1/2 z-20 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md border bg-background/90 text-muted-foreground transition-colors`,d?`border-border/70 hover:border-border hover:text-foreground`:`cursor-not-allowed border-border/40 text-muted-foreground/40`),onClick:()=>de(180),disabled:!d,"aria-label":`Scroll turn list right`,children:(0,K.jsx)(Oe,{className:`size-3.5`})}),(0,K.jsxs)(`div`,{ref:s,className:`turn-chip-strip flex gap-1 overflow-x-auto px-8 py-0.5`,onWheel:fe,children:[(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:ue,"data-turn-chip-selected":T===null,children:(0,K.jsx)(`div`,{className:U(`rounded-md border px-2 py-1 text-left transition-colors`,T===null?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,K.jsx)(`div`,{className:`text-[10px] leading-tight font-medium`,children:`All turns`})})}),w.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`shrink-0 rounded-md`,onClick:()=>le(e.turnId),title:e.turnId,"data-turn-chip-selected":e.turnId===D?.turnId,children:(0,K.jsx)(`div`,{className:U(`rounded-md border px-2 py-1 text-left transition-colors`,e.turnId===D?.turnId?`border-border bg-accent text-accent-foreground`:`border-border/70 bg-background/70 text-muted-foreground/80 hover:border-border hover:text-foreground/80`),children:(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsxs)(`span`,{className:`text-[10px] leading-tight font-medium`,children:[`Turn`,` `,e.checkpointTurnCount??C[e.turnId]??`?`]}),(0,K.jsx)(`span`,{className:`text-[9px] leading-tight opacity-70`,children:Qn(e.completedAt)})]})})},e.turnId))]})]}),(0,K.jsxs)(Kn,{className:`shrink-0 [-webkit-app-region:no-drag]`,variant:`outline`,size:`xs`,value:[r],onValueChange:e=>{let t=e[0];(t===`stacked`||t===`split`)&&a(t)},children:[(0,K.jsx)(qn,{"aria-label":`Stacked diff view`,value:`stacked`,children:(0,K.jsx)(et,{className:`size-3`})}),(0,K.jsx)(qn,{"aria-label":`Split diff view`,value:`split`,children:(0,K.jsx)($e,{className:`size-3`})})]})]}),H=U(`flex items-center justify-between gap-2 px-4`,V?`drag-region h-[52px] border-b border-border`:`h-12`);return(0,K.jsxs)(`div`,{className:U(`flex h-full min-w-0 flex-col bg-background`,e===`inline`?`w-[42vw] min-w-[360px] max-w-[560px] shrink-0 border-l border-border`:`w-full`),children:[V?(0,K.jsx)(`div`,{className:H,children:me}):(0,K.jsx)(`div`,{className:`border-b border-border`,children:(0,K.jsx)(`div`,{className:H,children:me})}),_?w.length===0?(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`No completed turns yet.`}):(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(`div`,{ref:o,className:`diff-panel-viewport min-h-0 min-w-0 flex-1 overflow-hidden`,children:[L&&!z&&(0,K.jsx)(`div`,{className:`px-3`,children:(0,K.jsx)(`p`,{className:`mb-2 text-[11px] text-red-500/80`,children:L})}),z?z.kind===`files`?(0,K.jsx)(_t,{className:`diff-render-surface h-full min-h-0 overflow-auto px-2 pb-2`,config:{overscrollSize:600,intersectionObserverMargin:1200},children:oe.map(e=>{let t=Xn(e),i=`${Zn(e)}:${n}`;return(0,K.jsx)(`div`,{"data-diff-file-path":t,className:`diff-render-file mb-2 rounded-md first:mt-2 last:mb-0`,onClickCapture:e=>{(e.nativeEvent.composedPath?.()??[]).some(e=>e instanceof Element?e.hasAttribute(`data-title`):!1)&&se(t)},children:(0,K.jsx)(Fn,{fileDiff:e,options:{diffStyle:r===`split`?`split`:`unified`,lineDiffType:`none`,theme:ee(n),themeType:n,unsafeCSS:Jn}})},i)})}):(0,K.jsx)(`div`,{className:`h-full overflow-auto p-2`,children:(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:z.reason}),(0,K.jsx)(`pre`,{className:`max-h-[72vh] overflow-auto rounded-md border border-border/70 bg-background/70 p-3 font-mono text-[11px] leading-relaxed text-muted-foreground/90`,children:z.text})]})}):(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center px-3 py-2 text-xs text-muted-foreground/70`,children:(0,K.jsx)(`p`,{children:re?`Loading checkpoint diff...`:ae?`No net changes in this selection.`:`No patch available for this selection.`})})]})}):(0,K.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-5 text-center text-xs text-muted-foreground/70`,children:`Select a thread to inspect turn diffs.`})]})}export{a as DiffWorkerPoolProvider,$n as default};
|