@das-org/dascode 0.0.31
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/BunHttpServer-YBQwrNiq.mjs +407 -0
- package/dist/BunPtyAdapter--Swo7U5P.mjs +120 -0
- package/dist/BunServices-RIDbItx-.mjs +115 -0
- package/dist/Cache-DyGeujxI.mjs +605 -0
- package/dist/Config-DcF-IZjO.mjs +1274 -0
- package/dist/FetchHttpClient-BmjpVs1I.mjs +5976 -0
- package/dist/NodePtyAdapter-H8kyf9St.mjs +115 -0
- package/dist/NodeServices-D8d9bE2V.mjs +152 -0
- package/dist/NodeSqliteClient-CmuXRT3w.mjs +178 -0
- package/dist/NodeTerminal-C6yhrF1E.mjs +1813 -0
- package/dist/Path-BB53LP8h.mjs +9050 -0
- package/dist/PtyAdapter-mAqTlv3d.mjs +60 -0
- package/dist/Schema-DuQUv9rO.mjs +33744 -0
- package/dist/SqlClient-Dp5XVCmr.mjs +922 -0
- package/dist/SqlError-D49f1UD-.mjs +409 -0
- package/dist/SqliteClient-DEcJdONi.mjs +147 -0
- package/dist/bin.mjs +201961 -0
- package/dist/client/assets/ChatView-HZc6-lKr.js +60 -0
- package/dist/client/assets/ClientOnly-FoswohdZ.js +2 -0
- package/dist/client/assets/CompositeRoot-Yff66Zmm.js +2 -0
- package/dist/client/assets/ConnectCliAuthSurface-BLD0XNSi.js +2 -0
- package/dist/client/assets/DiffDisplayControls-DsQS9IDw.js +1403 -0
- package/dist/client/assets/DiffPanel-DnIRg_Qy.js +98 -0
- package/dist/client/assets/DiffWorkerPoolProvider-DZJfC5kN.js +2 -0
- package/dist/client/assets/FieldControl-CuSMRkbi.js +2 -0
- package/dist/client/assets/FieldItemContext-Ba7ZZoDN.js +2 -0
- package/dist/client/assets/FilePreviewPanel-D3bq1Own.js +2220 -0
- package/dist/client/assets/KeybindingsSettings.logic-BQBQ8pFk.js +2 -0
- package/dist/client/assets/LocalAnnotatableCodeView-BS3qlDRM.js +2 -0
- package/dist/client/assets/PreviewPanel-C41OCDV3.js +2 -0
- package/dist/client/assets/ProviderModelPicker-BcQ3CMKb.js +2 -0
- package/dist/client/assets/PullRequestMarkdown-D5bDuXWN.js +2 -0
- package/dist/client/assets/RedactedSensitiveText-C3lDjv-5.js +2 -0
- package/dist/client/assets/ReviewActionsPanel-7rqPggzL.js +2 -0
- package/dist/client/assets/ReviewDiffWorkerPoolBoundary-CpqNaHWe.js +2 -0
- package/dist/client/assets/ReviewDiffWorkerSurface-fGPW1-P9.js +2 -0
- package/dist/client/assets/ReviewPatchView-Dt3GW4pP.js +4 -0
- package/dist/client/assets/Schema-DzLI5hMK.js +16 -0
- package/dist/client/assets/ServerUpdateAction-N9rNsTaN.js +2 -0
- package/dist/client/assets/SettingsPanels-DgK9Gy4R.js +3 -0
- package/dist/client/assets/SymbolsNerdFontMono-Regular-aK5vsLov.woff2 +0 -0
- package/dist/client/assets/WorkerPoolContext-BG9CEDyi.js +15 -0
- package/dist/client/assets/_chat-CDYErsvF.js +2 -0
- package/dist/client/assets/_chat._environmentId._threadId-Dn7yzuy5.js +2 -0
- package/dist/client/assets/_chat.draft._draftId-CKnp5OeX.js +2 -0
- package/dist/client/assets/_chat.index-CSOaDOiG.js +2 -0
- package/dist/client/assets/abap-CLvhMVsD.js +2 -0
- package/dist/client/assets/actionscript-3--17pq3dv.js +2 -0
- package/dist/client/assets/ada-C5qYipkI.js +2 -0
- package/dist/client/assets/alert-dialog-0GbcUK1u.js +2 -0
- package/dist/client/assets/andromeeda-WkhI09AS.js +2 -0
- package/dist/client/assets/andromeeda-vGVdxbeo.js +2 -0
- package/dist/client/assets/angular-html-BmcYSFCP.js +2 -0
- package/dist/client/assets/angular-ts-Ab3z1XOh.js +2 -0
- package/dist/client/assets/apache-U0d_L8uA.js +2 -0
- package/dist/client/assets/apex-VAyPSnFM.js +2 -0
- package/dist/client/assets/apl-DdAjc1Is.js +2 -0
- package/dist/client/assets/applescript-CCn79oCD.js +2 -0
- package/dist/client/assets/ara-4CJ0cIlV.js +2 -0
- package/dist/client/assets/asciidoc-DE70LPWp.js +2 -0
- package/dist/client/assets/asm-Cmm7eHzH.js +2 -0
- package/dist/client/assets/astro-jyGOnYUN.js +2 -0
- package/dist/client/assets/aurora-x-C7CFqhAd.js +2 -0
- package/dist/client/assets/aurora-x-CDeNXAV0.js +2 -0
- package/dist/client/assets/awk-BWXHIvNe.js +2 -0
- package/dist/client/assets/ayu-dark-CRu61w6_.js +2 -0
- package/dist/client/assets/ayu-dark-DluEY0Gj.js +2 -0
- package/dist/client/assets/ayu-light-C3h-C4tm.js +2 -0
- package/dist/client/assets/ayu-light-Dn6O_aYR.js +2 -0
- package/dist/client/assets/ayu-mirage-Bqwy1Gya.js +2 -0
- package/dist/client/assets/ayu-mirage-CTjYAbs-.js +2 -0
- package/dist/client/assets/ballerina-B7ZEbQpA.js +2 -0
- package/dist/client/assets/bat-Bo4NYOV-.js +2 -0
- package/dist/client/assets/beancount-D-usSTwE.js +2 -0
- package/dist/client/assets/berry-DKpUyyne.js +2 -0
- package/dist/client/assets/bibtex-Ci_nEsc7.js +2 -0
- package/dist/client/assets/bicep-CUHmPFLl.js +2 -0
- package/dist/client/assets/bird2-C6vDhewU.js +2 -0
- package/dist/client/assets/blade-C4dPlbVG.js +2 -0
- package/dist/client/assets/branding-DWKqECp7.js +2 -0
- package/dist/client/assets/bsl-BkkzgIyY.js +2 -0
- package/dist/client/assets/c-DtlEA5ZX.js +2 -0
- package/dist/client/assets/c3-BFHwR3_K.js +2 -0
- package/dist/client/assets/cadence-CQ2zXKGN.js +2 -0
- package/dist/client/assets/cairo-DLTphjLi.js +2 -0
- package/dist/client/assets/catppuccin-frappe-3VR1Za6u.js +2 -0
- package/dist/client/assets/catppuccin-frappe-DFlFW5gh.js +2 -0
- package/dist/client/assets/catppuccin-latte-CpxdcXpJ.js +2 -0
- package/dist/client/assets/catppuccin-latte-DwIHMF0Q.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-DIdIQ04K.js +2 -0
- package/dist/client/assets/catppuccin-macchiato-DYnBP6_5.js +2 -0
- package/dist/client/assets/catppuccin-mocha-Co3Xjl64.js +2 -0
- package/dist/client/assets/catppuccin-mocha-DYhrFGRu.js +2 -0
- package/dist/client/assets/checkbox-Cuif7tF0.js +2 -0
- package/dist/client/assets/circle-x-F0441fqg.js +2 -0
- package/dist/client/assets/clarity-SemFz856.js +2 -0
- package/dist/client/assets/clojure-DqKBuwfJ.js +2 -0
- package/dist/client/assets/cmake-Bj61d0ZC.js +2 -0
- package/dist/client/assets/cobol-X9aU3UsG.js +2 -0
- package/dist/client/assets/codeowners-C8r90Shi.js +2 -0
- package/dist/client/assets/codeql-oeQT6MSM.js +2 -0
- package/dist/client/assets/coffee-BluyIHgc.js +2 -0
- package/dist/client/assets/combobox-D0sqVdtm.js +2 -0
- package/dist/client/assets/common-lisp-Cv5bFMCO.js +2 -0
- package/dist/client/assets/compiler-runtime-CUwoe8mk.js +2 -0
- package/dist/client/assets/connect-CshPrK5J.js +2 -0
- package/dist/client/assets/connect_.callback-1fxfJdnn.js +2 -0
- package/dist/client/assets/coq-BrsZFFmf.js +2 -0
- package/dist/client/assets/cpp-BAWTDsD2.js +2 -0
- package/dist/client/assets/crystal-DEAezpUc.js +2 -0
- package/dist/client/assets/csharp-oqKa8noW.js +2 -0
- package/dist/client/assets/css-ZG5tpaE7.js +2 -0
- package/dist/client/assets/csv-Dx-8-gkx.js +2 -0
- package/dist/client/assets/cue-CE9AQfxI.js +2 -0
- package/dist/client/assets/cypher-ClKdZ_lG.js +2 -0
- package/dist/client/assets/d-qD-0Kul2.js +2 -0
- package/dist/client/assets/dark-plus-Cs2F2srj.js +2 -0
- package/dist/client/assets/dark-plus-GAt2ZgX8.js +2 -0
- package/dist/client/assets/dart-CnvKMtbv.js +2 -0
- package/dist/client/assets/dax-BkyTk9wS.js +2 -0
- package/dist/client/assets/desktop-Dlh5hvp9.js +2 -0
- package/dist/client/assets/diff-woXpYk--.js +2 -0
- package/dist/client/assets/dm-sans-latin-ext-wght-normal-BOFOeGcA.woff2 +0 -0
- package/dist/client/assets/dm-sans-latin-wght-normal-Xz1IZZA0.woff2 +0 -0
- package/dist/client/assets/docker-IyjqRm3v.js +2 -0
- package/dist/client/assets/dotenv-_5a1GRtc.js +2 -0
- package/dist/client/assets/dracula-BHWKrbxM.js +2 -0
- package/dist/client/assets/dracula-C2uKkzgK.js +2 -0
- package/dist/client/assets/dracula-soft-5eyTD99u.js +2 -0
- package/dist/client/assets/dracula-soft-D1bVjxWZ.js +2 -0
- package/dist/client/assets/dream-maker-DW3nJb8Q.js +2 -0
- package/dist/client/assets/edge-BUUilOUR.js +2 -0
- package/dist/client/assets/elixir-amUSnRCT.js +2 -0
- package/dist/client/assets/elm-BjxEHjzr.js +2 -0
- package/dist/client/assets/emacs-lisp-B4R74twV.js +2 -0
- package/dist/client/assets/entities-EGZcO-rg.js +2 -0
- package/dist/client/assets/environments-DPUVdQJp.js +2 -0
- package/dist/client/assets/erb-t1kck8M-.js +2 -0
- package/dist/client/assets/erlang-Cphh6RMH.js +2 -0
- package/dist/client/assets/everforest-dark-D-DlICQR.js +2 -0
- package/dist/client/assets/everforest-dark-sB-x3p7T.js +2 -0
- package/dist/client/assets/everforest-light-CeVdGHYG.js +2 -0
- package/dist/client/assets/everforest-light-Df2xbC6M.js +2 -0
- package/dist/client/assets/eye-TogxKhHZ.js +2 -0
- package/dist/client/assets/fennel-DQxkIbk2.js +2 -0
- package/dist/client/assets/fileCommentAnnotations-uFcaPOph.js +2 -0
- package/dist/client/assets/fish-BJitypiv.js +2 -0
- package/dist/client/assets/fluent-C03EYrpw.js +2 -0
- package/dist/client/assets/fortran-fixed-form-DEKoE2YW.js +2 -0
- package/dist/client/assets/fortran-free-form-CYNrtFtB.js +2 -0
- package/dist/client/assets/fsharp-D13ZGOAj.js +2 -0
- package/dist/client/assets/gauge-DXknpyA8.js +2 -0
- package/dist/client/assets/gdresource-C0sCabJj.js +2 -0
- package/dist/client/assets/gdscript-Cp2uCuqX.js +2 -0
- package/dist/client/assets/gdshader-CBce3t8t.js +2 -0
- package/dist/client/assets/genie-CV2tkWYe.js +2 -0
- package/dist/client/assets/gherkin-DExj1W_8.js +2 -0
- package/dist/client/assets/ghostty-vt-DdA0Zryv.wasm +0 -0
- package/dist/client/assets/ghostty-write-pty-hgyAvVbe.wasm +0 -0
- package/dist/client/assets/git-commit-BSykSTBG.js +2 -0
- package/dist/client/assets/git-rebase-Cq4_6JTl.js +2 -0
- package/dist/client/assets/github-dark-C-LZuMrd.js +2 -0
- package/dist/client/assets/github-dark-DwbbXv51.js +2 -0
- package/dist/client/assets/github-dark-default-CxjRwzl6.js +2 -0
- package/dist/client/assets/github-dark-default-DXG-b-1a.js +2 -0
- package/dist/client/assets/github-dark-dimmed-Bx1FflLF.js +2 -0
- package/dist/client/assets/github-dark-dimmed-Cr1oaoul.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-B4qJZLZa.js +2 -0
- package/dist/client/assets/github-dark-high-contrast-B_tTalzw.js +2 -0
- package/dist/client/assets/github-light-CsVXhIlR.js +2 -0
- package/dist/client/assets/github-light-EUqPIrTm.js +2 -0
- package/dist/client/assets/github-light-default-BXViO-2h.js +2 -0
- package/dist/client/assets/github-light-default-DB_IwZa6.js +2 -0
- package/dist/client/assets/github-light-high-contrast-B68TUdTA.js +2 -0
- package/dist/client/assets/github-light-high-contrast-DLgVeSB-.js +2 -0
- package/dist/client/assets/gleam-CSRkHgEL.js +2 -0
- package/dist/client/assets/glimmer-js-u4EGJ0zO.js +2 -0
- package/dist/client/assets/glimmer-ts-Gurbt52H.js +2 -0
- package/dist/client/assets/glsl-30pqDoZO.js +2 -0
- package/dist/client/assets/gn-ilITqXS6.js +2 -0
- package/dist/client/assets/gnuplot-7GGW24-e.js +2 -0
- package/dist/client/assets/go-rLFTqkRN.js +2 -0
- package/dist/client/assets/graphql-Bs5G1kBK.js +2 -0
- package/dist/client/assets/groovy-CacY0gHj.js +2 -0
- package/dist/client/assets/group-BUXx2pDS.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-C820rvS2.js +2 -0
- package/dist/client/assets/gruvbox-dark-hard-DXm60lX3.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-BPjhmG05.js +2 -0
- package/dist/client/assets/gruvbox-dark-medium-GE2thSmD.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-04Cj-4VZ.js +2 -0
- package/dist/client/assets/gruvbox-dark-soft-MrdJrrXF.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-BC_s9l72.js +2 -0
- package/dist/client/assets/gruvbox-light-hard-K6wSn29D.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-BAWPOn9u.js +2 -0
- package/dist/client/assets/gruvbox-light-medium-CVy3aSlc.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-BSMLrYjP.js +2 -0
- package/dist/client/assets/gruvbox-light-soft-DNgJjaY0.js +2 -0
- package/dist/client/assets/hack-Cko6MX06.js +2 -0
- package/dist/client/assets/haml-Doizmjk4.js +2 -0
- package/dist/client/assets/handlebars-b-YSlzII.js +2 -0
- package/dist/client/assets/haskell-D8IpX4py.js +2 -0
- package/dist/client/assets/haxe-OTjmBuCE.js +2 -0
- package/dist/client/assets/hcl-Dh228itO.js +2 -0
- package/dist/client/assets/hex-color-picker-DfLvGsRa.js +2 -0
- package/dist/client/assets/history-D05vcMtj.js +2 -0
- package/dist/client/assets/hjson-CxZEssPk.js +2 -0
- package/dist/client/assets/hlsl-Cvrh5tZx.js +2 -0
- package/dist/client/assets/horizon-0-RkHfro.js +2 -0
- package/dist/client/assets/horizon-CE9ld1lL.js +2 -0
- package/dist/client/assets/horizon-bright-BgL2X9oq.js +2 -0
- package/dist/client/assets/horizon-bright-DSNQnXHK.js +2 -0
- package/dist/client/assets/hostedPairing-nVVe5x4p.js +2 -0
- package/dist/client/assets/houston-CsvMBhTu.js +2 -0
- package/dist/client/assets/houston-KyjWKfuY.js +2 -0
- package/dist/client/assets/html-FzejeGn1.js +2 -0
- package/dist/client/assets/html-derivative-CnAooqTz.js +2 -0
- package/dist/client/assets/http-BxFImlHF.js +2 -0
- package/dist/client/assets/hurl-qINZb_eJ.js +2 -0
- package/dist/client/assets/hxml-B0Qn7Nwc.js +2 -0
- package/dist/client/assets/hy-CZbG8q4J.js +2 -0
- package/dist/client/assets/imba-DsUTQ-LC.js +2 -0
- package/dist/client/assets/index-DCOpJfCm.js +475 -0
- package/dist/client/assets/index-zJhfLl9C.css +1 -0
- package/dist/client/assets/ini-B5eOa1yu.js +2 -0
- package/dist/client/assets/input-group-DTqnJGXS.js +2 -0
- package/dist/client/assets/java-dMRc_cVD.js +2 -0
- package/dist/client/assets/javascript-BWMpBhVQ.js +2 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/client/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/client/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/client/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/client/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/client/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/client/assets/jinja-VDH3C9Ij.js +2 -0
- package/dist/client/assets/jison-BB0XuJyA.js +2 -0
- package/dist/client/assets/json-BjGzD-SE.js +2 -0
- package/dist/client/assets/json5-BR5RXkoi.js +2 -0
- package/dist/client/assets/jsonc-CYpm1nAK.js +2 -0
- package/dist/client/assets/jsonl-CmCQp5Yx.js +2 -0
- package/dist/client/assets/jsonnet-CJTPZ8u_.js +2 -0
- package/dist/client/assets/jssm-DXw9l8Rf.js +2 -0
- package/dist/client/assets/jsx-DzJWGKks.js +2 -0
- package/dist/client/assets/julia-BgCkjxqD.js +2 -0
- package/dist/client/assets/just-CVxSIAWS.js +2 -0
- package/dist/client/assets/kanagawa-dragon-7TqgsUPC.js +2 -0
- package/dist/client/assets/kanagawa-dragon-CXtmUGW6.js +2 -0
- package/dist/client/assets/kanagawa-lotus-BN08jTvb.js +2 -0
- package/dist/client/assets/kanagawa-lotus-CqxMQulh.js +2 -0
- package/dist/client/assets/kanagawa-wave-CTweb8Dz.js +2 -0
- package/dist/client/assets/kanagawa-wave-D8CNn6T_.js +2 -0
- package/dist/client/assets/kdl-CsD5j6eV.js +2 -0
- package/dist/client/assets/kotlin-DhhofPvG.js +2 -0
- package/dist/client/assets/kusto-C7mF5XQf.js +2 -0
- package/dist/client/assets/laserwave-CQkdhozh.js +2 -0
- package/dist/client/assets/laserwave-C_8bwKvT.js +2 -0
- package/dist/client/assets/latex-D7_rfK40.js +2 -0
- package/dist/client/assets/lean-CewbzKMR.js +2 -0
- package/dist/client/assets/less-DVTAwKKz.js +2 -0
- package/dist/client/assets/lib-b9zyleUn.js +30 -0
- package/dist/client/assets/light-plus-CNQ8_7Y0.js +2 -0
- package/dist/client/assets/light-plus-DVQuIRkW.js +2 -0
- package/dist/client/assets/link-BL3GZ_rH.js +2 -0
- package/dist/client/assets/liquid-C5PsA06M.js +2 -0
- package/dist/client/assets/llvm-Cm23YOpf.js +2 -0
- package/dist/client/assets/localApi-5K0gg1WP.js +3 -0
- package/dist/client/assets/log-BNLmms1o.js +2 -0
- package/dist/client/assets/logo-Cluzi2Zq.js +2 -0
- package/dist/client/assets/lua-Bq1DnbZG.js +2 -0
- package/dist/client/assets/luau-FMPmPwt6.js +2 -0
- package/dist/client/assets/make-Dixweg8N.js +2 -0
- package/dist/client/assets/markdown-BYOwaDjH.js +2 -0
- package/dist/client/assets/marko-C7zk2YT1.js +2 -0
- package/dist/client/assets/matchContext-C4X6O3hW.js +2 -0
- package/dist/client/assets/material-theme-Bm3Qr25_.js +2 -0
- package/dist/client/assets/material-theme-CAtLaHa3.js +2 -0
- package/dist/client/assets/material-theme-darker-2IIEA8gg.js +2 -0
- package/dist/client/assets/material-theme-darker-k-s5Bc6K.js +2 -0
- package/dist/client/assets/material-theme-lighter-CD6a-c4d.js +2 -0
- package/dist/client/assets/material-theme-lighter-uhdI0v04.js +2 -0
- package/dist/client/assets/material-theme-ocean-B3mraInd.js +2 -0
- package/dist/client/assets/material-theme-ocean-CHQ94UKr.js +2 -0
- package/dist/client/assets/material-theme-palenight-B5W6OYN7.js +2 -0
- package/dist/client/assets/material-theme-palenight-DEhAARHw.js +2 -0
- package/dist/client/assets/matlab-D7qyCx1q.js +2 -0
- package/dist/client/assets/mdc-JKnKthIF.js +2 -0
- package/dist/client/assets/mdx-DQZ5AkYe.js +2 -0
- package/dist/client/assets/mermaid-Bk4SNUv9.js +2 -0
- package/dist/client/assets/min-dark-BFqTAwCr.js +2 -0
- package/dist/client/assets/min-dark-BSWPekZh.js +2 -0
- package/dist/client/assets/min-light-DDpmG2fV.js +2 -0
- package/dist/client/assets/min-light-O7UdaaxX.js +2 -0
- package/dist/client/assets/mipsasm-BMqwQI7S.js +2 -0
- package/dist/client/assets/mojo-BgCJLMeH.js +2 -0
- package/dist/client/assets/monokai-C0p7Qecz.js +2 -0
- package/dist/client/assets/monokai-CdkpiU2Y.js +2 -0
- package/dist/client/assets/moonbit-CaWjb8XO.js +2 -0
- package/dist/client/assets/move-B1IS1UjX.js +2 -0
- package/dist/client/assets/narrat-_X_XdTYD.js +2 -0
- package/dist/client/assets/nextflow-BJtWHP5T.js +2 -0
- package/dist/client/assets/nextflow-groovy-DJMQeKeT.js +2 -0
- package/dist/client/assets/nginx-DXZZx9Fe.js +2 -0
- package/dist/client/assets/night-owl-BsnCLAKc.js +2 -0
- package/dist/client/assets/night-owl-DhmEMT88.js +2 -0
- package/dist/client/assets/night-owl-light-BODRhcTU.js +2 -0
- package/dist/client/assets/night-owl-light-eJ-hLW7d.js +2 -0
- package/dist/client/assets/nim-CkvLrvYM.js +2 -0
- package/dist/client/assets/nix-IvuFDN5E.js +2 -0
- package/dist/client/assets/nord-Cb4Vim4T.js +2 -0
- package/dist/client/assets/nord-Cd-F4txO.js +2 -0
- package/dist/client/assets/nushell-DcLAeLz5.js +2 -0
- package/dist/client/assets/objective-c-D1A_Heim.js +2 -0
- package/dist/client/assets/objective-cpp-BsSzOQcm.js +2 -0
- package/dist/client/assets/ocaml-O90oeIOV.js +2 -0
- package/dist/client/assets/odin-B1RWQWA5.js +2 -0
- package/dist/client/assets/one-dark-pro-CLwyXe_n.js +2 -0
- package/dist/client/assets/one-dark-pro-DUS_IGRK.js +2 -0
- package/dist/client/assets/one-light-CVUd7yD5.js +2 -0
- package/dist/client/assets/one-light-D7Lr4KcI.js +2 -0
- package/dist/client/assets/openscad-BUDT5pXO.js +2 -0
- package/dist/client/assets/pair-D_sKBvJj.js +2 -0
- package/dist/client/assets/pascal-4ZHwLPI5.js +2 -0
- package/dist/client/assets/perl-DKUKw9CE.js +2 -0
- package/dist/client/assets/php-GHQk7Jua.js +2 -0
- package/dist/client/assets/pierre-dark-CpLgRqie.js +2 -0
- package/dist/client/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +2 -0
- package/dist/client/assets/pierre-dark-soft-kZQmAZld.js +2 -0
- package/dist/client/assets/pierre-dark-tritanopia-CpjhbsIL.js +2 -0
- package/dist/client/assets/pierre-dark-vibrant-CpQYzh95.js +2 -0
- package/dist/client/assets/pierre-light-CoaEpmwp.js +2 -0
- package/dist/client/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +2 -0
- package/dist/client/assets/pierre-light-soft-lWLdNTOI.js +2 -0
- package/dist/client/assets/pierre-light-tritanopia-CEbqgOJL.js +2 -0
- package/dist/client/assets/pierre-light-vibrant-D80Fkn33.js +2 -0
- package/dist/client/assets/pkl-ot-7Btpt.js +2 -0
- package/dist/client/assets/plastic-CF8VZTnn.js +2 -0
- package/dist/client/assets/plastic-DQwYfKfQ.js +2 -0
- package/dist/client/assets/plsql-DGHpHOYJ.js +2 -0
- package/dist/client/assets/po-BiJDBrnU.js +2 -0
- package/dist/client/assets/poimandres-BX2TyY6j.js +2 -0
- package/dist/client/assets/poimandres-DRFjx7u4.js +2 -0
- package/dist/client/assets/polar-C7UOKdEL.js +2 -0
- package/dist/client/assets/postcss-BXeXVLqQ.js +2 -0
- package/dist/client/assets/powerquery-DNMTfnFr.js +2 -0
- package/dist/client/assets/powershell-DshXNtvi.js +2 -0
- package/dist/client/assets/preload-helper-D2XUqLHy.js +1 -0
- package/dist/client/assets/previewActionBus-B2LYye0P.js +2 -0
- package/dist/client/assets/prisma-BsRQq5mF.js +2 -0
- package/dist/client/assets/projects-D9v9VLJo.js +2 -0
- package/dist/client/assets/prolog-iXnhIJG7.js +2 -0
- package/dist/client/assets/proto-DB4EqR-F.js +2 -0
- package/dist/client/assets/pug-DxCMAzbD.js +2 -0
- package/dist/client/assets/puppet-CDv2pdJW.js +2 -0
- package/dist/client/assets/purescript-9MfHhQsQ.js +2 -0
- package/dist/client/assets/python-gzcpVVnB.js +2 -0
- package/dist/client/assets/qml-D3IL06-0.js +2 -0
- package/dist/client/assets/qmldir-DCQb3MpD.js +2 -0
- package/dist/client/assets/qss-Fe1Jh2GI.js +2 -0
- package/dist/client/assets/query-BTlH8ppa.js +2 -0
- package/dist/client/assets/r-D2Zb3-aq.js +2 -0
- package/dist/client/assets/racket-DcIDlBhZ.js +2 -0
- package/dist/client/assets/radio-group-VXzWvOzu.js +2 -0
- package/dist/client/assets/raku-B3gFvitq.js +2 -0
- package/dist/client/assets/razor-BfPqrQiz.js +2 -0
- package/dist/client/assets/red-7ga_dcKu.js +2 -0
- package/dist/client/assets/red-CJ3rzSJv.js +2 -0
- package/dist/client/assets/redirect-CTDpd8-N.js +2 -0
- package/dist/client/assets/reg-CRGYupPL.js +2 -0
- package/dist/client/assets/regexp-BtCnpNi-.js +2 -0
- package/dist/client/assets/rel-BtDbiS_P.js +2 -0
- package/dist/client/assets/reviewPatchParser.worker-Bx0aLcXI.js +13 -0
- package/dist/client/assets/reviews-DqcOSrtz.js +2 -0
- package/dist/client/assets/reviews._environmentId._host._owner._repository._pullRequestNumber-QICycRVU.js +11 -0
- package/dist/client/assets/reviews.index-Dw9KYVnt.js +2 -0
- package/dist/client/assets/riscv-Ckw8ddFX.js +2 -0
- package/dist/client/assets/ron-VUp2lXgN.js +2 -0
- package/dist/client/assets/rose-pine-BthvhNj6.js +2 -0
- package/dist/client/assets/rose-pine-dawn-DSuRaP6u.js +2 -0
- package/dist/client/assets/rose-pine-dawn-Dg85fqjY.js +2 -0
- package/dist/client/assets/rose-pine-moon-DdHjCvFQ.js +2 -0
- package/dist/client/assets/rose-pine-moon-hon4tzzS.js +2 -0
- package/dist/client/assets/rose-pine-rh6ipraJ.js +2 -0
- package/dist/client/assets/rosmsg-CAekHB0j.js +2 -0
- package/dist/client/assets/rotate-ccw-BuHf9qmb.js +2 -0
- package/dist/client/assets/rst-DgVsEgbv.js +2 -0
- package/dist/client/assets/ruby-DM9zEDxk.js +2 -0
- package/dist/client/assets/rust-Cfkwpbl8.js +2 -0
- package/dist/client/assets/safeLog-NeXgoMPF.js +3 -0
- package/dist/client/assets/sas-DlL3ue79.js +2 -0
- package/dist/client/assets/sass-DXrisJhu.js +2 -0
- package/dist/client/assets/scala-DKOlJaKm.js +2 -0
- package/dist/client/assets/scheduler-8SgDf5Nb.js +2 -0
- package/dist/client/assets/scheme-DQCgrYNe.js +2 -0
- package/dist/client/assets/scss-LGD8fUVB.js +2 -0
- package/dist/client/assets/sdbl-bTVj8UrX.js +2 -0
- package/dist/client/assets/settings-D4XOj85b.js +2 -0
- package/dist/client/assets/settings.appearance-CZvAeZCN.js +42 -0
- package/dist/client/assets/settings.archived-Y06GoG0S.js +2 -0
- package/dist/client/assets/settings.beta-Bd5UrFtG.js +2 -0
- package/dist/client/assets/settings.connections-YjuBg0cD.js +2 -0
- package/dist/client/assets/settings.diagnostics-DujS7DMW.js +3 -0
- package/dist/client/assets/settings.general-sQSJC3Rq.js +2 -0
- package/dist/client/assets/settings.keybindings-C6b2im1-.js +2 -0
- package/dist/client/assets/settings.providers-CzhQRSvU.js +2 -0
- package/dist/client/assets/settings.source-control-Ocoxm1T5.js +2 -0
- package/dist/client/assets/shaderlab-TOUzSsQk.js +2 -0
- package/dist/client/assets/shell-BfrxrAzH.js +2 -0
- package/dist/client/assets/shellscript-CYVg9JP5.js +2 -0
- package/dist/client/assets/shellsession-Cn2QQjIy.js +2 -0
- package/dist/client/assets/slack-dark-DYvUXyrP.js +2 -0
- package/dist/client/assets/slack-dark-DnToyrRv.js +2 -0
- package/dist/client/assets/slack-ochin-B2OO5cIa.js +2 -0
- package/dist/client/assets/slack-ochin-bqtMVDfH.js +2 -0
- package/dist/client/assets/smalltalk-B16xEiuN.js +2 -0
- package/dist/client/assets/snazzy-light-4G7pJPwS.js +2 -0
- package/dist/client/assets/snazzy-light-D8dzFmq5.js +2 -0
- package/dist/client/assets/solarized-dark-BQwPDzxK.js +2 -0
- package/dist/client/assets/solarized-dark-DV17i1UV.js +2 -0
- package/dist/client/assets/solarized-light-BLaijb3X.js +2 -0
- package/dist/client/assets/solarized-light-DSh2HLQt.js +2 -0
- package/dist/client/assets/solidity-CKzVLygQ.js +2 -0
- package/dist/client/assets/soy-BNUH7AWp.js +2 -0
- package/dist/client/assets/sparql-D_iOobhT.js +2 -0
- package/dist/client/assets/splunk-BC2Px7Mm.js +2 -0
- package/dist/client/assets/sql-BLrhh1Yv.js +2 -0
- package/dist/client/assets/ssh-config-BgfXC-Er.js +2 -0
- package/dist/client/assets/stata-CbTJOr_m.js +2 -0
- package/dist/client/assets/stylus-B6D30XZt.js +2 -0
- package/dist/client/assets/surrealql-Bp6i6018.js +2 -0
- package/dist/client/assets/svelte-CuQ8bF4c.js +2 -0
- package/dist/client/assets/swift-DonLKvLd.js +2 -0
- package/dist/client/assets/switch-rJ-jJPhK.js +2 -0
- package/dist/client/assets/synthwave-84-CIknw8y7.js +2 -0
- package/dist/client/assets/synthwave-84-nFMaYfgc.js +2 -0
- package/dist/client/assets/system-verilog-DJ5XKQeo.js +2 -0
- package/dist/client/assets/systemd-BxMlprV5.js +2 -0
- package/dist/client/assets/talonscript-CohzipZa.js +2 -0
- package/dist/client/assets/tasl-DMoTqEGO.js +2 -0
- package/dist/client/assets/tcl-CZd0xW_V.js +2 -0
- package/dist/client/assets/templ-Bo-nf_t1.js +2 -0
- package/dist/client/assets/terminalAppearance-BqQ_2bv1.js +2 -0
- package/dist/client/assets/terraform-DswuEJGm.js +2 -0
- package/dist/client/assets/tex-BgvSMBks.js +2 -0
- package/dist/client/assets/textarea-XNVgJSPU.js +2 -0
- package/dist/client/assets/toggle-QDWstdFN.js +2 -0
- package/dist/client/assets/tokyo-night-iIspnLcq.js +2 -0
- package/dist/client/assets/tokyo-night-oM2G3aXe.js +2 -0
- package/dist/client/assets/toml-CcmNWLt0.js +2 -0
- package/dist/client/assets/ts-tags-Bm95_vpn.js +2 -0
- package/dist/client/assets/tsv-sltzmVWM.js +2 -0
- package/dist/client/assets/tsx-ToB8-PkG.js +2 -0
- package/dist/client/assets/turtle-ByJddavk.js +2 -0
- package/dist/client/assets/twig-D5eIhwLo.js +2 -0
- package/dist/client/assets/typescript-55S1t3b3.js +2 -0
- package/dist/client/assets/typespec-BRdr0IET.js +2 -0
- package/dist/client/assets/typst-DI99ib-x.js +2 -0
- package/dist/client/assets/uiStateStore-DKTfup26.js +2 -0
- package/dist/client/assets/use-atom-command-CbJ8L7ju.js +4 -0
- package/dist/client/assets/useAriaLabelledBy-DcnsWgtX.js +2 -0
- package/dist/client/assets/useParams-Iww6IHUG.js +2 -0
- package/dist/client/assets/useReviewMergeAction-BgjVNuJP.js +2 -0
- package/dist/client/assets/useSettings-CGh4Xw67.js +2 -0
- package/dist/client/assets/useStore-Bv9Rrp6F.js +2 -0
- package/dist/client/assets/utils-SYwD9hoF.js +2 -0
- package/dist/client/assets/utils-Yidpy5tB.js +30 -0
- package/dist/client/assets/v-DETTlOr0.js +2 -0
- package/dist/client/assets/vala-zf12oZj6.js +2 -0
- package/dist/client/assets/vb-Djn5o6TS.js +2 -0
- package/dist/client/assets/vcsRefInvalidation-CMdkUDtM.js +2 -0
- package/dist/client/assets/verilog-CiiDBU1e.js +2 -0
- package/dist/client/assets/vesper-BIFK_oDq.js +2 -0
- package/dist/client/assets/vesper-DdrHHSXu.js +2 -0
- package/dist/client/assets/vhdl-BroJfC0k.js +2 -0
- package/dist/client/assets/viml-DvXPmvsu.js +2 -0
- package/dist/client/assets/vitesse-black-D082JcaE.js +2 -0
- package/dist/client/assets/vitesse-black-fwtXNY1n.js +2 -0
- package/dist/client/assets/vitesse-dark-BZCL-v6S.js +2 -0
- package/dist/client/assets/vitesse-dark-z-nr_5O8.js +2 -0
- package/dist/client/assets/vitesse-light-VbXTXTou.js +2 -0
- package/dist/client/assets/vitesse-light-ojz42ZLy.js +2 -0
- package/dist/client/assets/vue-BWR1mbne.js +2 -0
- package/dist/client/assets/vue-html-DGrJOwF8.js +2 -0
- package/dist/client/assets/vue-vine-SedHajQj.js +2 -0
- package/dist/client/assets/vyper-CgoNMtux.js +2 -0
- package/dist/client/assets/wasm-BnjxR4X6.js +2 -0
- package/dist/client/assets/wasm-ByWQv1Qj.js +2 -0
- package/dist/client/assets/wenyan-C8pVoKbM.js +2 -0
- package/dist/client/assets/wgsl-BsKzXJz4.js +2 -0
- package/dist/client/assets/wikitext-ClFFjSW2.js +2 -0
- package/dist/client/assets/wit-DdvCle-K.js +2 -0
- package/dist/client/assets/with-selector-C3poe37J.js +2 -0
- package/dist/client/assets/wolfram-DLL8P-h_.js +2 -0
- package/dist/client/assets/worker-CIcqvLjo.js +159 -0
- package/dist/client/assets/workspaceTitlebar-CrNTdVrF.js +2 -0
- package/dist/client/assets/xml-BB6ezbMQ.js +2 -0
- package/dist/client/assets/xsl-DygAj9pT.js +2 -0
- package/dist/client/assets/yaml-CIJj2T9S.js +2 -0
- package/dist/client/assets/zenscript-BnlCZFoB.js +2 -0
- package/dist/client/assets/zig-CMLA9XwU.js +2 -0
- package/dist/client/index.html +327 -0
- package/dist/client/mockServiceWorker.js +349 -0
- package/dist/service-launcher.mjs +461 -0
- package/package.json +54 -0
|
@@ -0,0 +1,1403 @@
|
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./compiler-runtime-CUwoe8mk.js";import{Ma as i,Ri as a,Sa as o,Ui as s,or as c,t as l,ya as u}from"./utils-Yidpy5tB.js";import{A as d,D as f,F as p,I as m,M as h,N as g,O as _,P as v,_ as y,a as b,c as x,d as S,f as C,g as w,h as T,i as E,j as D,k as O,l as k,m as A,o as j,p as M,s as N,u as P,v as F,y as ee}from"./WorkerPoolContext-BG9CEDyi.js";import{An as I,Bn as L,Gn as te,In as ne,Jn as R,Kn as re,Ln as ie,Nn as ae,On as oe,Qn as se,Un as ce,Wn as le,Xn as ue,Yn as de,Zn as fe,en as pe,fn as me,kn as he,ls as ge,mn as z,nn as _e,os as ve,qn as ye,sn as be,ss as xe,tn as Se,zn as B}from"./index-DCOpJfCm.js";import{t as Ce}from"./CompositeRoot-Yff66Zmm.js";import{n as we,t as Te}from"./toggle-QDWstdFN.js";var Ee=i(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),De=i(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Oe=i(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),ke=i(`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`}]]),Ae=i(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),V=new Set,H=null;function je(e){V.add(e),H??=requestAnimationFrame(Ne)}function Me(e){V.delete(e),V.size===0&&H!=null&&(cancelAnimationFrame(H),H=null)}function Ne(e){let t=new Set(V);V.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}H=V.size>0?requestAnimationFrame(Ne):null}function Pe(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 Fe(e,t){let n=e?.theme??B,r=t?.theme??B,i=Ie(e),a=Ie(t);return m(n,r)&&Pe(e,t,[`theme`,`parseDiffOptions`])&&Pe(i,a)}function Ie(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Le(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Re({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}var ze=`/dev/null`;function U(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Be(),a=t??Be(),o=oe(p(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Be(){return{name:ze,contents:``}}function Ve(){return D({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[h({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function He(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var Ue=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;activeLineHighlightSide;activeLineNumberOnly=!1;editorAttached=!1;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}setEditorAttached(e){this.editorAttached!==e&&(this.editorAttached=e,this.setSelectionDirty(),this.renderSelection())}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){let n=!(e===this.selectedRange||Le(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.activeLineHighlightSide=t?.activeLineSide,this.activeLineNumberOnly=t?.lineNumberOnly??!1,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&at(e.composedPath())||(G(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;t===`disabled`&&!o&&n==null&&r==null&&i==null&&a==null||(G(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(G(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){G(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();G(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);G(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=qe(i)&&this.hoveredLine?.lineElement===i.lineElement;Ke(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Ke(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),qe(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Ye(i)&&p!=null){p(i);break}if(Je(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!qe(i))break;Ke(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,G(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),G(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),G(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();at(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),a=r?.top??i;i==null||a==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:a,current:i},t&&(this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(He(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=z(Ve());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);W(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(!(r==null||i==null))return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(Qe(t));if(W(n)&&!(this.mode===`diff`&&e.side!=null&&n.side!==e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(W(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(W(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&at(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=Qe(e);if(t&&at(n))return;let r=$e(e);return r==null?this.pathFromAnnotationSlot(e):Qe(r)}pathFromAnnotationSlot(e){let t=tt(et(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:Qe(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=nt(t)?t:nt(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Le(r??void 0,i??void 0)||(this.activeLineHighlightSide=void 0,this.activeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}highlightLineNumberOnly(){return this.activeLineHighlightSide==null?this.activeLineNumberOnly||this.editorAttached:this.activeLineNumberOnly}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=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(`InteractionManager.renderSelection: 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(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end),s=this.highlightLineNumberOnly();for(let e of t){let t=this.activeLineHighlightSide;if(t!=null&&(t===`additions`&&e.hasAttribute(`data-deletions`)||t===`deletions`&&e.hasAttribute(`data-additions`)))continue;let[r,c]=e.children,l=c.children.length;if(l!==r.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<l;e++){let t=c.children[e],l=r.children[e];if(!(t instanceof HTMLElement)||!(l instanceof HTMLElement))continue;let u=this.parseLineIndex(t,n);if((u??0)>o)break;if(u==null||u<a)continue;let d=i?`single`:u===a?`first`:u===o?`last`:``;l.setAttribute(`data-selected-line`,d),!s&&(t.setAttribute(`data-selected-line`,d),l.nextSibling instanceof HTMLElement&&t.nextSibling instanceof HTMLElement&&(t.nextSibling.hasAttribute(`data-line-annotation`)||t.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(d=`last`,t.setAttribute(`data-selected-line`,`first`)):u===a?d=``:u===o&&t.setAttribute(`data-selected-line`,``),t.nextSibling.setAttribute(`data-selected-line`,d),l.nextSibling.setAttribute(`data-selected-line`,d)))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Xe(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=it(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=it(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:Ze(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Ze(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:rt(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:rt(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function We({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Ge({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function Ge({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function W(e){return e!=null&&`kind`in e&&e.kind===`line`}function Ke(e){return e!=null&&`kind`in e&&e.kind===`token`}function qe(e){return W(e)||Ke(e)}function Je(e){return`type`in e&&e.type===`line-info`}function Ye(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Xe(e){return e===`current`||e===`incoming`||e===`both`}function Ze(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function Qe(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function $e(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function et(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function tt(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function nt(e){return e!=null&&typeof e.elementFromPoint==`function`}function rt(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function it(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function at(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}function G(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)}var ot=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),lt(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?ft(t):pt(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:st(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:ct(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&ut(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function st(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function ct(e){return Math.max(Math.ceil(e),0)}function lt(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?ut(e,{codeWidthChanged:!0,numberWidthChanged:!0}):dt(e))}function ut(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function dt(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function ft(e){e.codeElement.isConnected&&dt(e)}function pt(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function mt(e){for(let t of Array.isArray(e)?e:[e])if(!(t===`text`||t===`ansi`)&&!me.has(t))return!1;return!0}function ht(e){for(let t of f(e))if(!be.has(t))return!1;return!0}function gt(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 _t(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 vt(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 yt({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return D({tagName:`div`,children:[t===`custom`?D({tagName:`slot`,properties:{name:ae}}):bt({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[xt(r)]],properties:i})}function bt({name:e,prevName:t,iconType:n}){let r=[D({tagName:`slot`,properties:{name:de}}),h({name:vt(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(D({tagName:`div`,children:[D({tagName:`bdi`,children:[g(t)]})],properties:{"data-prev-name":``}})),r.push(h({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(D({tagName:`div`,children:[D({tagName:`bdi`,children:[g(e)]})],properties:{"data-title":``}})),r.push(D({tagName:`slot`,properties:{name:ye}})),D({tagName:`div`,children:r,properties:{"data-header-content":``}})}function xt(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:[g(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(D({tagName:`span`,children:[g(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(D({tagName:`slot`,properties:{name:R}})),D({tagName:`div`,children:t,properties:{"data-metadata":``}})}function St(e){return D({tagName:`pre`,properties:Ct(e)})}function Ct({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function wt(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:f(t),preferredHighlighter:n}}function K(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var Tt=`-1,-1`;function Et(e){return e?.some(e=>e.lineNumber===0)??!1}function Dt(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Ot(e){return e.startingLine===0&&e.totalLines>0}function kt(e,t){return e.endsWith(`\r
|
|
2
|
+
`)?t+`\r
|
|
3
|
+
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
4
|
+
`)?t+`
|
|
5
|
+
`:t}function At(e,t){return D({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function jt(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}var Mt=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
6
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
7
|
+
<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"/>
|
|
8
|
+
</symbol>
|
|
9
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
10
|
+
<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"/>
|
|
11
|
+
</symbol>
|
|
12
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
13
|
+
<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"/>
|
|
14
|
+
</symbol>
|
|
15
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
16
|
+
<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"/>
|
|
17
|
+
</symbol>
|
|
18
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
19
|
+
<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"/>
|
|
20
|
+
</symbol>
|
|
21
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
22
|
+
<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"/>
|
|
23
|
+
</symbol>
|
|
24
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
25
|
+
<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"/>
|
|
26
|
+
</symbol>
|
|
27
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
28
|
+
<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"/>
|
|
29
|
+
</symbol>
|
|
30
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
31
|
+
<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"/>
|
|
32
|
+
</symbol>
|
|
33
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
34
|
+
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
35
|
+
</symbol>
|
|
36
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
37
|
+
<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"/>
|
|
38
|
+
</symbol>
|
|
39
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
40
|
+
<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"/>
|
|
41
|
+
</symbol>
|
|
42
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
43
|
+
<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"/>
|
|
44
|
+
</symbol>
|
|
45
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
46
|
+
<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"/>
|
|
47
|
+
</symbol>
|
|
48
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
49
|
+
<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"/>
|
|
50
|
+
</symbol>
|
|
51
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
52
|
+
<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"/>
|
|
53
|
+
</symbol>
|
|
54
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
55
|
+
<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"/>
|
|
56
|
+
</symbol>
|
|
57
|
+
</svg>`;function Nt(e,t){return e==null||t==null?e===t:Ft(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var Pt={};function Ft(e=Pt,t=Pt){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function It(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Lt(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function Rt(){let e=document.createElement(`style`);return e.setAttribute(se,``),e}var zt=`@layer base {
|
|
58
|
+
:host {
|
|
59
|
+
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
60
|
+
"Courier New", monospace;
|
|
61
|
+
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
62
|
+
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
63
|
+
--diffs-mixer: light-dark(#000, #fff);
|
|
64
|
+
--diffs-gap-fallback: 8px;
|
|
65
|
+
--diffs-scrollbar-gutter-fallback: 6px;
|
|
66
|
+
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
67
|
+
--diffs-added-light: #0dbe4e;
|
|
68
|
+
--diffs-added-dark: #5ecc71;
|
|
69
|
+
--diffs-modified-light: #009fff;
|
|
70
|
+
--diffs-modified-dark: #69b1ff;
|
|
71
|
+
--diffs-deleted-light: #ff2e3f;
|
|
72
|
+
--diffs-deleted-dark: #ff6762;
|
|
73
|
+
--diffs-warning-light: #d5a910;
|
|
74
|
+
--diffs-warning-dark: #ffd452;
|
|
75
|
+
color-scheme: light dark;
|
|
76
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
77
|
+
font-size: var(--diffs-font-size, 13px);
|
|
78
|
+
line-height: var(--diffs-line-height, 20px);
|
|
79
|
+
font-feature-settings: var(--diffs-font-features);
|
|
80
|
+
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
81
|
+
--diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
|
|
82
|
+
--diffs-bg-context: var(--diffs-bg-context-override, light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
|
|
83
|
+
--diffs-bg-context-gutter: var(--diffs-bg-context-gutter-override, light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));
|
|
84
|
+
--diffs-bg-separator: var(--diffs-bg-separator-override, light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
|
|
85
|
+
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
86
|
+
--diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
|
|
87
|
+
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
88
|
+
--diffs-deletion-base: var(--diffs-deletion-color-override, light-dark(var(--diffs-light-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-light))), var(--diffs-dark-deletion-color, var(--diffs-deletion-color, var(--diffs-deleted-dark)))));
|
|
89
|
+
--diffs-addition-base: var(--diffs-addition-color-override, light-dark(var(--diffs-light-addition-color, var(--diffs-addition-color, var(--diffs-added-light))), var(--diffs-dark-addition-color, var(--diffs-addition-color, var(--diffs-added-dark)))));
|
|
90
|
+
--diffs-modified-base: var(--diffs-modified-color-override, light-dark(var(--diffs-light-modified-color, var(--diffs-modified-color, var(--diffs-modified-light))), var(--diffs-dark-modified-color, var(--diffs-modified-color, var(--diffs-modified-dark)))));
|
|
91
|
+
--diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));
|
|
92
|
+
--diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / .15), rgb(from var(--diffs-deletion-base) r g b / .2)));
|
|
93
|
+
--diffs-bg-addition: var(--diffs-bg-addition-override, light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));
|
|
94
|
+
--diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / .15), rgb(from var(--diffs-addition-base) r g b / .2)));
|
|
95
|
+
--diffs-selection-base: var(--diffs-modified-base);
|
|
96
|
+
--diffs-selection-number-fg: light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));
|
|
97
|
+
background-color: var(--diffs-bg);
|
|
98
|
+
color: var(--diffs-fg);
|
|
99
|
+
display: block;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
pre, code, [data-error-wrapper] {
|
|
103
|
+
isolation: isolate;
|
|
104
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
105
|
+
outline: none;
|
|
106
|
+
margin: 0;
|
|
107
|
+
padding: 0;
|
|
108
|
+
display: block;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
pre, code {
|
|
112
|
+
background-color: var(--diffs-bg);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
code {
|
|
116
|
+
contain: content;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
input, button {
|
|
120
|
+
font-family: inherit;
|
|
121
|
+
font-size: inherit;
|
|
122
|
+
line-height: inherit;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
*, :before, :after {
|
|
126
|
+
box-sizing: border-box;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
[data-icon-sprite] {
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
[data-diffs-header], [data-separator] {
|
|
134
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[data-diffs-header][data-sticky] {
|
|
138
|
+
z-index: 1;
|
|
139
|
+
background-color: var(--diffs-bg);
|
|
140
|
+
position: sticky;
|
|
141
|
+
top: 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
[data-file-info] {
|
|
145
|
+
color: var(--fg);
|
|
146
|
+
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
147
|
+
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
148
|
+
padding: 10px;
|
|
149
|
+
font-weight: 700;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
[data-diff], [data-file] {
|
|
153
|
+
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
154
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
155
|
+
|
|
156
|
+
&[data-dehydrated] {
|
|
157
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
161
|
+
background-color: var(--diffs-bg-context);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@supports (-webkit-touch-callout: none) {
|
|
166
|
+
:host {
|
|
167
|
+
--diffs-scrollbar-gutter-fallback: 0px;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
[data-line] span {
|
|
172
|
+
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
173
|
+
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
174
|
+
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
175
|
+
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
176
|
+
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
180
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
181
|
+
--diffs-computed-diff-line-bg: var(--diffs-bg);
|
|
182
|
+
--diffs-computed-selected-line-bg: var(--diffs-bg);
|
|
183
|
+
color: var(--diffs-fg);
|
|
184
|
+
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
185
|
+
|
|
186
|
+
@media (pointer: fine) {
|
|
187
|
+
&:where([data-hovered]) {
|
|
188
|
+
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
189
|
+
var(--diffs-computed-selected-line-bg) 97%,
|
|
190
|
+
var(--diffs-bg-hover-override, var(--diffs-mixer))), color-mix(in lab,
|
|
191
|
+
var(--diffs-computed-selected-line-bg) 91%,
|
|
192
|
+
var(--diffs-bg-hover-override, var(--diffs-mixer))));
|
|
193
|
+
--diffs-line-bg: var(--diffs-computed-hovered-line-bg, inherit);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
[data-line], [data-no-newline] {
|
|
199
|
+
&[data-decoration-bg] {
|
|
200
|
+
--mix-deco-light: 92%;
|
|
201
|
+
--mix-deco-dark: 85%;
|
|
202
|
+
|
|
203
|
+
&[data-decoration-bg-depth="2"] {
|
|
204
|
+
--mix-deco-light: 88%;
|
|
205
|
+
--mix-deco-dark: 80%;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&[data-decoration-bg-depth="3"] {
|
|
209
|
+
--mix-deco-light: 85%;
|
|
210
|
+
--mix-deco-dark: 78%;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
@media (pointer: fine) {
|
|
214
|
+
&[data-hovered]:not([data-selected-line]) {
|
|
215
|
+
--mix-deco-light: 85%;
|
|
216
|
+
--mix-deco-dark: 85%;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
&[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="2"] {
|
|
220
|
+
--mix-deco-light: 83%;
|
|
221
|
+
--mix-deco-dark: 83%;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="3"] {
|
|
225
|
+
--mix-deco-light: 81%;
|
|
226
|
+
--mix-deco-dark: 81%;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
231
|
+
var(--diffs-bg) var(--mix-deco-light),
|
|
232
|
+
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
233
|
+
var(--diffs-bg) var(--mix-deco-dark),
|
|
234
|
+
var(--diffs-decoration-bg)));
|
|
235
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
236
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
237
|
+
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
242
|
+
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
243
|
+
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
244
|
+
--diffs-computed-diff-line-bg: var(--diffs-annotation-bg);
|
|
245
|
+
--diffs-computed-selected-line-bg: var(--diffs-annotation-bg);
|
|
246
|
+
--diffs-line-bg: var(--diffs-annotation-bg);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
[data-merge-conflict-actions], [data-gutter-buffer="merge-conflict-action"], [data-gutter-buffer="merge-conflict-marker-base"], [data-gutter-buffer="merge-conflict-marker-separator"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"] {
|
|
250
|
+
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
251
|
+
--diffs-computed-diff-line-bg: var(--diffs-bg-context);
|
|
252
|
+
--diffs-computed-selected-line-bg: var(--diffs-bg-context);
|
|
253
|
+
--diffs-line-bg: var(--diffs-bg-context);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
257
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
258
|
+
var(--diffs-bg) 78%,
|
|
259
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
260
|
+
var(--diffs-bg) 68%,
|
|
261
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
262
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
263
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
264
|
+
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
268
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
269
|
+
var(--diffs-bg) 78%,
|
|
270
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
271
|
+
var(--diffs-bg) 68%,
|
|
272
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
273
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
274
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
275
|
+
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
279
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
280
|
+
--diffs-computed-diff-line-bg: var(--diffs-bg);
|
|
281
|
+
--diffs-computed-selected-line-bg: var(--diffs-bg);
|
|
282
|
+
--diffs-line-bg: var(--diffs-bg);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
:where([data-background]) {
|
|
286
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
287
|
+
--mix-light: 91%;
|
|
288
|
+
--mix-dark: 85%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
& [data-line], & [data-no-newline] {
|
|
292
|
+
--mix-light: 88%;
|
|
293
|
+
--mix-dark: 80%;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
297
|
+
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
298
|
+
|
|
299
|
+
&[data-line-type="change-deletion"] {
|
|
300
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
301
|
+
|
|
302
|
+
@media (pointer: fine) {
|
|
303
|
+
&[data-hovered] {
|
|
304
|
+
--mix-light: 80%;
|
|
305
|
+
--mix-dark: 75%;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
310
|
+
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
311
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
315
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
316
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
317
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
318
|
+
var(--diffs-diff-line-mix-target)));
|
|
319
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
320
|
+
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&[data-line-type="change-addition"] {
|
|
324
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
325
|
+
|
|
326
|
+
@media (pointer: fine) {
|
|
327
|
+
&[data-hovered] {
|
|
328
|
+
--mix-light: 80%;
|
|
329
|
+
--mix-dark: 70%;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
334
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
335
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
339
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
340
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
341
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
342
|
+
var(--diffs-diff-line-mix-target)));
|
|
343
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
344
|
+
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
&[data-merge-conflict="current"] {
|
|
348
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
349
|
+
|
|
350
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
351
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
352
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
@media (pointer: fine) {
|
|
356
|
+
&[data-hovered] {
|
|
357
|
+
--mix-light: 80%;
|
|
358
|
+
--mix-dark: 70%;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
363
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
364
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
365
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
366
|
+
var(--diffs-diff-line-mix-target)));
|
|
367
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
368
|
+
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
&[data-merge-conflict="incoming"] {
|
|
372
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
373
|
+
|
|
374
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
375
|
+
color: var(--diffs-modified-base);
|
|
376
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
@media (pointer: fine) {
|
|
380
|
+
&[data-hovered] {
|
|
381
|
+
--mix-light: 80%;
|
|
382
|
+
--mix-dark: 70%;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
387
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
388
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
389
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
390
|
+
var(--diffs-diff-line-mix-target)));
|
|
391
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
392
|
+
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
398
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
399
|
+
|
|
400
|
+
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
401
|
+
--mix-selection-light: 82%;
|
|
402
|
+
--mix-selection-dark: 75%;
|
|
403
|
+
|
|
404
|
+
@media (pointer: fine) {
|
|
405
|
+
&[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
406
|
+
--mix-selection-light: 75%;
|
|
407
|
+
--mix-selection-dark: 70%;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
&:where([data-gutter-buffer], [data-column-number])[data-selected-line] {
|
|
413
|
+
--mix-selection-light: 75%;
|
|
414
|
+
--mix-selection-dark: 60%;
|
|
415
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
416
|
+
|
|
417
|
+
@media (pointer: fine) {
|
|
418
|
+
&[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
419
|
+
--mix-selection-light: 70%;
|
|
420
|
+
--mix-selection-dark: 55%;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
426
|
+
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
427
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
428
|
+
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
429
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
430
|
+
var(--diffs-selection-mix-target)));
|
|
431
|
+
--diffs-line-bg: var(--diffs-computed-selected-line-bg, inherit);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
[data-gutter-buffer], [data-column-number] {
|
|
436
|
+
&[data-selected-line] {
|
|
437
|
+
color: var(--diffs-selection-number-fg);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
[data-no-newline] {
|
|
442
|
+
user-select: none;
|
|
443
|
+
|
|
444
|
+
& span {
|
|
445
|
+
opacity: .6;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
450
|
+
grid-template-columns: 1fr 1fr;
|
|
451
|
+
display: grid;
|
|
452
|
+
|
|
453
|
+
& [data-additions] {
|
|
454
|
+
border-left: 1px solid var(--diffs-bg);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
& [data-deletions] {
|
|
458
|
+
border-right: 1px solid var(--diffs-bg);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
[data-code] {
|
|
463
|
+
grid-auto-flow: dense;
|
|
464
|
+
grid-template-columns: var(--diffs-code-grid);
|
|
465
|
+
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
466
|
+
overscroll-behavior-x: none;
|
|
467
|
+
tab-size: var(--diffs-tab-size, 2);
|
|
468
|
+
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
469
|
+
padding-bottom: max(0px,
|
|
470
|
+
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
471
|
+
var(--diffs-scrollbar-gutter)));
|
|
472
|
+
scrollbar-gutter: stable;
|
|
473
|
+
align-self: flex-start;
|
|
474
|
+
display: grid;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
[data-diffs-scrollbar-measure] {
|
|
478
|
+
opacity: 0;
|
|
479
|
+
pointer-events: none;
|
|
480
|
+
scrollbar-gutter: auto;
|
|
481
|
+
grid-template-columns: none;
|
|
482
|
+
width: 100px;
|
|
483
|
+
height: 100px;
|
|
484
|
+
padding: 0;
|
|
485
|
+
position: absolute;
|
|
486
|
+
top: -200px;
|
|
487
|
+
left: -200px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
[data-container-size] {
|
|
491
|
+
container-type: inline-size;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
[data-code]::-webkit-scrollbar {
|
|
495
|
+
width: 0;
|
|
496
|
+
height: var(--diffs-scrollbar-gutter);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
[data-code]::-webkit-scrollbar-track {
|
|
500
|
+
background: none;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
[data-code]::-webkit-scrollbar-thumb {
|
|
504
|
+
background-color: #0000;
|
|
505
|
+
background-clip: content-box;
|
|
506
|
+
border: 1px solid #0000;
|
|
507
|
+
border-radius: 3px;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
[data-code]::-webkit-scrollbar-corner {
|
|
511
|
+
background-color: #0000;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
@supports ((-moz-appearance: none)) {
|
|
515
|
+
[data-code] {
|
|
516
|
+
scrollbar-width: thin;
|
|
517
|
+
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
518
|
+
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
523
|
+
& [data-code], &[data-overflow="wrap"] {
|
|
524
|
+
padding-top: 0;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
[data-gutter] {
|
|
529
|
+
grid-template-rows: subgrid;
|
|
530
|
+
grid-template-columns: subgrid;
|
|
531
|
+
z-index: 3;
|
|
532
|
+
background-color: var(--diffs-bg);
|
|
533
|
+
grid-column: 1;
|
|
534
|
+
display: grid;
|
|
535
|
+
position: relative;
|
|
536
|
+
|
|
537
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
538
|
+
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
[data-content] {
|
|
543
|
+
grid-template-rows: subgrid;
|
|
544
|
+
grid-template-columns: subgrid;
|
|
545
|
+
background-color: var(--diffs-bg);
|
|
546
|
+
grid-column: 2;
|
|
547
|
+
min-width: 0;
|
|
548
|
+
display: grid;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
[data-diff-type="split"][data-overflow="wrap"] {
|
|
552
|
+
grid-auto-flow: dense;
|
|
553
|
+
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
554
|
+
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
555
|
+
display: grid;
|
|
556
|
+
|
|
557
|
+
& [data-deletions] {
|
|
558
|
+
display: contents;
|
|
559
|
+
|
|
560
|
+
& [data-gutter] {
|
|
561
|
+
grid-column: 1;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
& [data-content] {
|
|
565
|
+
border-right: 1px solid var(--diffs-bg);
|
|
566
|
+
grid-column: 2;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
& [data-additions] {
|
|
571
|
+
display: contents;
|
|
572
|
+
|
|
573
|
+
& [data-gutter] {
|
|
574
|
+
border-left: 1px solid var(--diffs-bg);
|
|
575
|
+
grid-column: 3;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
& [data-content] {
|
|
579
|
+
grid-column: 4;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
[data-overflow="scroll"] [data-gutter] {
|
|
585
|
+
position: sticky;
|
|
586
|
+
left: 0;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
[data-interactive-lines] [data-line] {
|
|
590
|
+
cursor: pointer;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
[data-interactive-line-numbers] [data-column-number] {
|
|
594
|
+
cursor: pointer;
|
|
595
|
+
touch-action: none;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
[data-content-buffer], [data-gutter-buffer] {
|
|
599
|
+
user-select: none;
|
|
600
|
+
min-height: 1lh;
|
|
601
|
+
position: relative;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
[data-gutter-buffer] {
|
|
605
|
+
padding-left: 2ch;
|
|
606
|
+
padding-right: 1ch;
|
|
607
|
+
|
|
608
|
+
&:before {
|
|
609
|
+
content: "";
|
|
610
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
611
|
+
display: block;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
[data-gutter-buffer="annotation"] {
|
|
616
|
+
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
617
|
+
min-height: 0;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
[data-gutter-buffer="buffer"] {
|
|
621
|
+
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
[data-content-buffer] {
|
|
625
|
+
background-position: 5px 0;
|
|
626
|
+
background-size: 8px 8px;
|
|
627
|
+
background-origin: border-box;
|
|
628
|
+
background-image: repeating-linear-gradient(-45deg,
|
|
629
|
+
transparent,
|
|
630
|
+
transparent calc(3px * 1.414),
|
|
631
|
+
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
632
|
+
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
633
|
+
grid-column: 1;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
[data-separator] {
|
|
637
|
+
box-sizing: content-box;
|
|
638
|
+
background-color: var(--diffs-bg);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
[data-separator="simple"] {
|
|
642
|
+
min-height: 4px;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
646
|
+
background-color: var(--diffs-bg-separator);
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
650
|
+
height: 32px;
|
|
651
|
+
position: relative;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
[data-separator-wrapper] {
|
|
655
|
+
user-select: none;
|
|
656
|
+
fill: currentColor;
|
|
657
|
+
background-color: var(--diffs-bg);
|
|
658
|
+
align-items: center;
|
|
659
|
+
height: 100%;
|
|
660
|
+
display: flex;
|
|
661
|
+
position: absolute;
|
|
662
|
+
inset-inline: 0;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
[data-content] [data-separator-wrapper] {
|
|
666
|
+
display: none;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
[data-separator="metadata"] [data-separator-wrapper] {
|
|
670
|
+
background-color: var(--diffs-bg-separator);
|
|
671
|
+
height: 100%;
|
|
672
|
+
color: var(--diffs-fg-number);
|
|
673
|
+
white-space: nowrap;
|
|
674
|
+
text-overflow: ellipsis;
|
|
675
|
+
min-width: min-content;
|
|
676
|
+
padding-inline: 1ch;
|
|
677
|
+
inset-inline: 100% auto;
|
|
678
|
+
overflow: hidden;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
[data-separator="line-info"] {
|
|
682
|
+
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
683
|
+
|
|
684
|
+
& [data-separator-wrapper] {
|
|
685
|
+
min-width: 16px;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
690
|
+
margin-block: 0;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
[data-separator="line-info"][data-separator-first] {
|
|
694
|
+
margin-top: 0;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
[data-separator="line-info"][data-separator-last] {
|
|
698
|
+
margin-bottom: 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
[data-expand-index] [data-separator-wrapper] {
|
|
702
|
+
grid-template-columns: 32px auto;
|
|
703
|
+
display: grid;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
707
|
+
grid-template-columns: 32px 32px auto;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
[data-expand-button], [data-separator-content] {
|
|
711
|
+
background-color: var(--diffs-bg-separator);
|
|
712
|
+
flex: none;
|
|
713
|
+
align-items: center;
|
|
714
|
+
display: flex;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
[data-expand-index] [data-separator-content]:hover {
|
|
718
|
+
cursor: pointer;
|
|
719
|
+
text-decoration: underline;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
[data-expand-button] {
|
|
723
|
+
cursor: pointer;
|
|
724
|
+
min-width: 32px;
|
|
725
|
+
color: var(--diffs-fg-number);
|
|
726
|
+
border-right: 2px solid var(--diffs-bg);
|
|
727
|
+
flex-shrink: 0;
|
|
728
|
+
justify-content: center;
|
|
729
|
+
align-self: stretch;
|
|
730
|
+
|
|
731
|
+
&:hover {
|
|
732
|
+
color: var(--diffs-fg);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
&[data-expand-all-button] {
|
|
736
|
+
display: none;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
[data-expand-down] [data-icon] {
|
|
741
|
+
transform: scaleY(-1);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
[data-separator-content] {
|
|
745
|
+
height: 100%;
|
|
746
|
+
color: var(--diffs-fg-number);
|
|
747
|
+
flex: auto;
|
|
748
|
+
justify-content: flex-start;
|
|
749
|
+
padding: 0 1ch;
|
|
750
|
+
overflow: hidden;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
754
|
+
& [data-separator-content] {
|
|
755
|
+
user-select: none;
|
|
756
|
+
height: 100%;
|
|
757
|
+
overflow: clip;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
[data-unmodified-lines] {
|
|
762
|
+
text-overflow: ellipsis;
|
|
763
|
+
white-space: nowrap;
|
|
764
|
+
flex: 0 auto;
|
|
765
|
+
min-width: 0;
|
|
766
|
+
display: block;
|
|
767
|
+
overflow: hidden;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
@supports (width: 1cqi) {
|
|
771
|
+
[data-unified] {
|
|
772
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
773
|
+
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
774
|
+
width: 100cqi;
|
|
775
|
+
|
|
776
|
+
& [data-separator-content] {
|
|
777
|
+
border-radius: 6px;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
782
|
+
border-top-left-radius: unset;
|
|
783
|
+
border-bottom-left-radius: unset;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
[data-gutter] {
|
|
788
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
789
|
+
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
& [data-separator="line-info"] [data-separator-content] {
|
|
793
|
+
border-top-left-radius: 6px;
|
|
794
|
+
border-bottom-left-radius: 6px;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
798
|
+
border-top-left-radius: unset;
|
|
799
|
+
border-bottom-left-radius: unset;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
[data-additions] {
|
|
804
|
+
& [data-content] [data-separator="line-info"] {
|
|
805
|
+
background-color: var(--diffs-bg);
|
|
806
|
+
|
|
807
|
+
& [data-separator-wrapper] {
|
|
808
|
+
display: none;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
813
|
+
background-color: var(--diffs-bg-separator);
|
|
814
|
+
border-top-right-radius: 6px;
|
|
815
|
+
border-bottom-right-radius: 6px;
|
|
816
|
+
height: 100%;
|
|
817
|
+
display: block;
|
|
818
|
+
|
|
819
|
+
& [data-separator-content], & [data-expand-button] {
|
|
820
|
+
display: none;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
826
|
+
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
830
|
+
background-color: var(--diffs-bg-separator);
|
|
831
|
+
height: 100%;
|
|
832
|
+
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
833
|
+
border-top-right-radius: 6px;
|
|
834
|
+
border-bottom-right-radius: 6px;
|
|
835
|
+
display: block;
|
|
836
|
+
|
|
837
|
+
& [data-separator-content], & [data-expand-button] {
|
|
838
|
+
display: none;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
843
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
844
|
+
border-top-left-radius: 6px;
|
|
845
|
+
border-bottom-left-radius: 6px;
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
@media (pointer: fine) {
|
|
850
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
851
|
+
&[data-separator-multi-button] {
|
|
852
|
+
& [data-expand-up] {
|
|
853
|
+
border-top-left-radius: 6px;
|
|
854
|
+
border-bottom-left-radius: unset;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
& [data-expand-down] {
|
|
858
|
+
border-bottom-left-radius: 6px;
|
|
859
|
+
border-top-left-radius: unset;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
@media (pointer: coarse) {
|
|
867
|
+
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
868
|
+
grid-template-columns: 34px 34px auto;
|
|
869
|
+
|
|
870
|
+
& [data-separator-content] {
|
|
871
|
+
grid-column: unset;
|
|
872
|
+
grid-row: unset;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
@supports (width: 1cqi) {
|
|
877
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
878
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
879
|
+
border-top-left-radius: 6px;
|
|
880
|
+
border-bottom-left-radius: 6px;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
&[data-separator-multi-button] {
|
|
884
|
+
& [data-expand-up] {
|
|
885
|
+
border-top-left-radius: 6px;
|
|
886
|
+
border-bottom-left-radius: 6px;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
& [data-expand-down] {
|
|
890
|
+
border-bottom-left-radius: unset;
|
|
891
|
+
border-top-left-radius: unset;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
@media (pointer: fine) {
|
|
899
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
900
|
+
grid-template-rows: 50% 50%;
|
|
901
|
+
display: grid;
|
|
902
|
+
|
|
903
|
+
& [data-separator-content] {
|
|
904
|
+
grid-area: 1 / 2 / -1;
|
|
905
|
+
min-width: min-content;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
& [data-expand-button] {
|
|
909
|
+
grid-column: 1;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
914
|
+
grid-template-columns: 34px auto;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
918
|
+
grid-template-columns: 100% auto;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
922
|
+
& [data-separator-multi-button] {
|
|
923
|
+
& [data-expand-up] {
|
|
924
|
+
border-bottom: 1px solid var(--diffs-bg);
|
|
925
|
+
border-right: 2px solid var(--diffs-bg);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
& [data-expand-down] {
|
|
929
|
+
border-top: 1px solid var(--diffs-bg);
|
|
930
|
+
border-right: 2px solid var(--diffs-bg);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
937
|
+
display: none;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
[data-line-annotation] {
|
|
941
|
+
min-height: var(--diffs-annotation-min-height, 0);
|
|
942
|
+
z-index: 2;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
[data-merge-conflict-actions] {
|
|
946
|
+
z-index: 2;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
[data-separator="custom"] {
|
|
950
|
+
grid-template-columns: subgrid;
|
|
951
|
+
display: grid;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
[data-line], [data-column-number], [data-no-newline] {
|
|
955
|
+
padding-inline: 1ch;
|
|
956
|
+
position: relative;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
[data-indicators="classic"] [data-line] {
|
|
960
|
+
padding-inline-start: 2ch;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
[data-indicators="classic"] {
|
|
964
|
+
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
965
|
+
&[data-no-newline], &[data-line] {
|
|
966
|
+
&:before {
|
|
967
|
+
user-select: none;
|
|
968
|
+
width: 1ch;
|
|
969
|
+
height: 1lh;
|
|
970
|
+
display: inline-block;
|
|
971
|
+
position: absolute;
|
|
972
|
+
top: 0;
|
|
973
|
+
left: 0;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
& [data-line-type="change-addition"] {
|
|
979
|
+
&[data-line], &[data-no-newline] {
|
|
980
|
+
&:before {
|
|
981
|
+
content: "+";
|
|
982
|
+
color: var(--diffs-addition-base);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
& [data-line-type="change-deletion"] {
|
|
988
|
+
&[data-line], &[data-no-newline] {
|
|
989
|
+
&:before {
|
|
990
|
+
content: "-";
|
|
991
|
+
color: var(--diffs-deletion-base);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
[data-indicators="bars"] {
|
|
998
|
+
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
999
|
+
&[data-column-number] {
|
|
1000
|
+
&:before {
|
|
1001
|
+
content: "";
|
|
1002
|
+
user-select: none;
|
|
1003
|
+
contain: strict;
|
|
1004
|
+
width: 4px;
|
|
1005
|
+
height: 100%;
|
|
1006
|
+
display: block;
|
|
1007
|
+
position: absolute;
|
|
1008
|
+
top: 0;
|
|
1009
|
+
left: 0;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
& [data-line-type="change-deletion"] {
|
|
1015
|
+
&[data-column-number] {
|
|
1016
|
+
&:before {
|
|
1017
|
+
background-image: linear-gradient(0deg,
|
|
1018
|
+
var(--diffs-bg-deletion) 50%,
|
|
1019
|
+
var(--diffs-deletion-base) 50%);
|
|
1020
|
+
background-repeat: repeat;
|
|
1021
|
+
background-size: 2px 2px;
|
|
1022
|
+
background-size: calc(1lh / round(1lh / 2px))
|
|
1023
|
+
calc(1lh / round(1lh / 2px));
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
& [data-line-type="change-addition"] {
|
|
1029
|
+
&[data-column-number] {
|
|
1030
|
+
&:before {
|
|
1031
|
+
background-color: var(--diffs-addition-base);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
[data-overflow="wrap"] {
|
|
1038
|
+
& [data-line], & [data-annotation-content] {
|
|
1039
|
+
white-space: pre-wrap;
|
|
1040
|
+
word-break: break-word;
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
[data-overflow="scroll"] [data-line] {
|
|
1045
|
+
white-space: pre;
|
|
1046
|
+
min-height: 1lh;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
[data-column-number] {
|
|
1050
|
+
box-sizing: content-box;
|
|
1051
|
+
text-align: right;
|
|
1052
|
+
user-select: none;
|
|
1053
|
+
color: var(--diffs-fg-number);
|
|
1054
|
+
padding-left: 2ch;
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
[data-line-number-content] {
|
|
1058
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1059
|
+
z-index: 1;
|
|
1060
|
+
display: inline-block;
|
|
1061
|
+
position: relative;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
[data-disable-line-numbers] {
|
|
1065
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1066
|
+
min-width: 4px;
|
|
1067
|
+
padding: 0;
|
|
1068
|
+
|
|
1069
|
+
&:before {
|
|
1070
|
+
min-width: 0;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
& [data-line-number-content] {
|
|
1075
|
+
display: none;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
& [data-gutter-utility-slot] {
|
|
1079
|
+
right: unset;
|
|
1080
|
+
justify-content: flex-start;
|
|
1081
|
+
left: 0;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1085
|
+
left: 6px;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
[data-file][data-disable-line-numbers] {
|
|
1090
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1091
|
+
border-right: 0;
|
|
1092
|
+
min-width: 0;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
[data-diff-span] {
|
|
1097
|
+
box-decoration-break: clone;
|
|
1098
|
+
border-radius: 3px;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
[data-line-type="change-addition"] [data-diff-span] {
|
|
1102
|
+
background-color: var(--diffs-bg-addition-emphasis);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1106
|
+
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1110
|
+
color: var(--diffs-fg);
|
|
1111
|
+
padding-left: 1ch;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1115
|
+
align-items: center;
|
|
1116
|
+
display: flex;
|
|
1117
|
+
|
|
1118
|
+
&:after {
|
|
1119
|
+
color: var(--diffs-fg-conflict-marker);
|
|
1120
|
+
font-size: .75rem;
|
|
1121
|
+
font-style: normal;
|
|
1122
|
+
line-height: 1.25rem;
|
|
1123
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1124
|
+
padding-left: 1ch;
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
[data-merge-conflict="marker-start"]:after {
|
|
1129
|
+
content: "(Current Change)";
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
[data-merge-conflict="marker-end"]:after {
|
|
1133
|
+
content: "(Incoming Change)";
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
[data-merge-conflict-actions-content] {
|
|
1137
|
+
min-height: 1.75rem;
|
|
1138
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1139
|
+
color: var(--diffs-fg);
|
|
1140
|
+
align-items: center;
|
|
1141
|
+
gap: .25rem;
|
|
1142
|
+
padding-inline: .5rem;
|
|
1143
|
+
font-size: .75rem;
|
|
1144
|
+
line-height: 1.2;
|
|
1145
|
+
display: flex;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
[data-merge-conflict-action] {
|
|
1149
|
+
appearance: none;
|
|
1150
|
+
color: var(--diffs-fg-number);
|
|
1151
|
+
font: inherit;
|
|
1152
|
+
cursor: pointer;
|
|
1153
|
+
background: none;
|
|
1154
|
+
border: 0;
|
|
1155
|
+
padding: 0;
|
|
1156
|
+
font-style: normal;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
[data-merge-conflict-action]:hover {
|
|
1160
|
+
color: var(--diffs-fg);
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
[data-merge-conflict-action="current"]:hover {
|
|
1164
|
+
color: var(--diffs-addition-base);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
[data-merge-conflict-action="incoming"]:hover {
|
|
1168
|
+
color: var(--diffs-modified-base);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
[data-merge-conflict-action-separator] {
|
|
1172
|
+
color: var(--diffs-fg-number);
|
|
1173
|
+
opacity: .6;
|
|
1174
|
+
user-select: none;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
[data-diffs-header="default"] {
|
|
1178
|
+
background-color: var(--diffs-bg);
|
|
1179
|
+
justify-content: space-between;
|
|
1180
|
+
align-items: center;
|
|
1181
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1182
|
+
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1183
|
+
z-index: 2;
|
|
1184
|
+
flex-direction: row;
|
|
1185
|
+
padding-inline: 16px;
|
|
1186
|
+
display: flex;
|
|
1187
|
+
position: relative;
|
|
1188
|
+
top: 0;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
[data-header-content] {
|
|
1192
|
+
align-items: center;
|
|
1193
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1194
|
+
white-space: nowrap;
|
|
1195
|
+
flex-direction: row;
|
|
1196
|
+
min-width: 0;
|
|
1197
|
+
display: flex;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1201
|
+
text-overflow: ellipsis;
|
|
1202
|
+
white-space: nowrap;
|
|
1203
|
+
direction: rtl;
|
|
1204
|
+
min-width: 0;
|
|
1205
|
+
overflow: hidden;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
[data-prev-name] {
|
|
1209
|
+
opacity: .7;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
[data-rename-icon] {
|
|
1213
|
+
fill: currentColor;
|
|
1214
|
+
flex-grow: 0;
|
|
1215
|
+
flex-shrink: 0;
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
[data-diffs-header="default"] [data-metadata] {
|
|
1219
|
+
white-space: nowrap;
|
|
1220
|
+
align-items: center;
|
|
1221
|
+
gap: 1ch;
|
|
1222
|
+
display: flex;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
[data-diffs-header="default"] [data-additions-count] {
|
|
1226
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1227
|
+
color: var(--diffs-addition-base);
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
[data-diffs-header="default"] [data-deletions-count] {
|
|
1231
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1232
|
+
color: var(--diffs-deletion-base);
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
[data-change-icon] {
|
|
1236
|
+
fill: currentColor;
|
|
1237
|
+
flex-shrink: 0;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1241
|
+
color: var(--diffs-modified-base);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
[data-change-icon="new"] {
|
|
1245
|
+
color: var(--diffs-addition-base);
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
[data-change-icon="deleted"] {
|
|
1249
|
+
color: var(--diffs-deletion-base);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
[data-change-icon="file"] {
|
|
1253
|
+
opacity: .6;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
[data-annotation-content] {
|
|
1257
|
+
z-index: 2;
|
|
1258
|
+
isolation: isolate;
|
|
1259
|
+
align-self: flex-start;
|
|
1260
|
+
min-width: 0;
|
|
1261
|
+
display: flow-root;
|
|
1262
|
+
position: relative;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1266
|
+
width: var(--diffs-column-content-width, auto);
|
|
1267
|
+
left: var(--diffs-column-number-width, 0);
|
|
1268
|
+
position: sticky;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
[data-annotation-slot] {
|
|
1272
|
+
text-wrap-mode: wrap;
|
|
1273
|
+
word-break: normal;
|
|
1274
|
+
white-space-collapse: collapse;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
[data-gutter-utility-slot] {
|
|
1278
|
+
touch-action: none;
|
|
1279
|
+
justify-content: flex-end;
|
|
1280
|
+
display: flex;
|
|
1281
|
+
position: absolute;
|
|
1282
|
+
top: 0;
|
|
1283
|
+
bottom: 0;
|
|
1284
|
+
right: 0;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
[data-utility-button] {
|
|
1288
|
+
appearance: none;
|
|
1289
|
+
cursor: pointer;
|
|
1290
|
+
width: 1lh;
|
|
1291
|
+
height: 1lh;
|
|
1292
|
+
font-size: var(--diffs-font-size, 13px);
|
|
1293
|
+
line-height: var(--diffs-line-height, 20px);
|
|
1294
|
+
background-color: var(--diffs-modified-base);
|
|
1295
|
+
color: var(--diffs-bg);
|
|
1296
|
+
fill: currentColor;
|
|
1297
|
+
z-index: 4;
|
|
1298
|
+
touch-action: none;
|
|
1299
|
+
border: none;
|
|
1300
|
+
border-radius: 4px;
|
|
1301
|
+
justify-content: center;
|
|
1302
|
+
align-items: center;
|
|
1303
|
+
margin-right: calc(-1lh + 1ch);
|
|
1304
|
+
padding: 0;
|
|
1305
|
+
display: flex;
|
|
1306
|
+
position: relative;
|
|
1307
|
+
|
|
1308
|
+
&:before {
|
|
1309
|
+
content: "";
|
|
1310
|
+
display: block;
|
|
1311
|
+
position: absolute;
|
|
1312
|
+
inset: 0 0 0 -4px;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
[data-decoration-bar-stack] {
|
|
1317
|
+
pointer-events: none;
|
|
1318
|
+
isolation: isolate;
|
|
1319
|
+
z-index: 1;
|
|
1320
|
+
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1321
|
+
box-sizing: content-box;
|
|
1322
|
+
border-left: 2px solid var(--diffs-bg);
|
|
1323
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1324
|
+
width: 6px;
|
|
1325
|
+
position: absolute;
|
|
1326
|
+
top: 0;
|
|
1327
|
+
bottom: 0;
|
|
1328
|
+
right: -2px;
|
|
1329
|
+
|
|
1330
|
+
[data-decoration-bar-depth="1"] & {
|
|
1331
|
+
background-color: color-mix(in lab,
|
|
1332
|
+
var(--diffs-bg) 20%,
|
|
1333
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
[data-decoration-bar-depth="2"] & {
|
|
1337
|
+
background-color: color-mix(in lab,
|
|
1338
|
+
var(--diffs-bg) 45%,
|
|
1339
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
[data-decoration-bar-depth="3"] & {
|
|
1343
|
+
background-color: color-mix(in lab,
|
|
1344
|
+
var(--diffs-bg) 65%,
|
|
1345
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
[data-decoration-bar-start] & {
|
|
1349
|
+
border-top-left-radius: 5px;
|
|
1350
|
+
border-top-right-radius: 5px;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
[data-decoration-bar-end] & {
|
|
1354
|
+
z-index: 3;
|
|
1355
|
+
border-bottom-right-radius: 5px;
|
|
1356
|
+
border-bottom-left-radius: 5px;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
[data-placeholder] {
|
|
1361
|
+
contain: strict;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
[data-error-wrapper] {
|
|
1365
|
+
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1366
|
+
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1367
|
+
scrollbar-width: none;
|
|
1368
|
+
max-height: 400px;
|
|
1369
|
+
overflow: auto;
|
|
1370
|
+
|
|
1371
|
+
& [data-error-message] {
|
|
1372
|
+
color: var(--diffs-deletion-base);
|
|
1373
|
+
font-size: 18px;
|
|
1374
|
+
font-weight: bold;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
& [data-error-stack] {
|
|
1378
|
+
color: var(--diffs-fg-number);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
@layer theme, rendered, unsafe;
|
|
1384
|
+
`,Bt;function Vt(e){if(Bt!=null)return Bt;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(le,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),Bt=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Bt}function Ht(e){return`${ce}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var Ut=`@layer base, theme, rendered, unsafe;`,Wt=RegExp(`${Jt(ce)}\\s*:\\s*[^;]+;`);function Gt(e){return`${Ut}
|
|
1385
|
+
@layer unsafe {
|
|
1386
|
+
${e}
|
|
1387
|
+
}`}function Kt(e,t=`system`,n){return`${Ut}
|
|
1388
|
+
@layer rendered {
|
|
1389
|
+
:host {${t===`system`?``:`
|
|
1390
|
+
color-scheme: ${t};`}
|
|
1391
|
+
${Ht(n)}
|
|
1392
|
+
${e}
|
|
1393
|
+
}
|
|
1394
|
+
}`}function qt(e,t){let n=Ht(t);return e.replace(Wt,n)}function Jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Yt({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 Xt(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Zt(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`);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.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function Qt(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function $t({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=en(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function en(){let e=document.createElement(`style`);return e.setAttribute(fe,``),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(zt)),t.adoptedStyleSheets=[e]}connectedCallback(){Vt(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(te,t)}function tn(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function nn(e){return e===``?[]:e.split(ue)}function rn(e,t,n){let r=e===`clone`?tn(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return an(r,sn(r,n),cn(r,n));case`rename-pure`:{let e=cn(r,n);ln(r,n);let t=nn(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,dn(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function an(e,t,n){let r=nn(t.contents),i=nn(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=on(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,dn(e,t,n),e}function on(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(t.additionStart-1-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=t.additionStart+t.additionCount-1}if(a.length>0){let e=a[a.length-1],i=Math.max(e.additionStart+e.additionCount-1,0),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function sn(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function cn(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function ln(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function un(e,t,n){return e.cacheKey==null?fn(t,n):`${e.cacheKey}:hydrated`}function dn(e,t,n){let r=un(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function fn(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var pn=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 mn(e){return D({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function hn(e){return D({tagName:`div`,children:[D({tagName:`span`,children:[g(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function gn(e){return D({tagName:`div`,children:[h({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function q({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(D({tagName:`div`,children:[g(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(gn(`up`)),s++),o||(e.push(gn(`down`)),s++)):(e.push(gn(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(D({tagName:`div`,children:[D({tagName:`span`,children:[g(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(D({tagName:`div`,children:[g(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(D({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(D({tagName:`slot`,properties:{name:i}})),D({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function _n(e,t){return`hunk-separator-${e}-${t}`}function vn(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function yn(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function J(e,t){let n=U({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function bn(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function xn(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Sn(e,t){return t.length>0&&t.length<e.deletionLines.length&&xn(t)}function Cn(e,t,n){let r=e.deletionLines.join(``),i=bn(t.length,r),a=U({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function wn(e,t){return Cn(e,[``],t)}function Tn(e,t){if(e.additionLines.length===0)return wn(e,t);if(Sn(e,e.additionLines))return Cn(e,e.additionLines,t);let n=e.additionLines,r=J(e,t);return Dn(r,n),r}function En(e){return e.length>1&&e.at(-1)===``}function Dn(e,t){if(!En(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&i.additionLineIndex+i.additionCount===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,In(e);return}}}function On(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return Y(e,J(e,n));let r=Array.from(t);if(r.length===0)return Y(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||I(r)===I(i))return Y(e,J(e,n))}let i=kn(e,r);if(i.size===0)return Y(e,J(e,n));for(let t of i)if(!jn(e,t,n))return Y(e,J(e,n));return In(e),M(e)?Y(e,J(e,n)):Y(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function Y(e,t){return Object.assign(e,t),t}function kn(e,t){let n=new Set;for(let r of t){let t=An(e,r);if(t==null)return new Set;n.add(t)}return n}function An(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function jn(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=U({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(Nn(r,s),Mn(e,t),!0)}function Mn(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
|
|
1395
|
+
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1396
|
+
`)}function Nn(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>Pn(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Fn(e)}function Pn(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Fn(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function In(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(i.additionStart-1-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,Fn(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=i.additionStart+i.additionCount-1;if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-(r.additionLineIndex+r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}function Ln(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function Rn(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(!(r===i&&r===a))return{start:r,prevEnd:i,nextEnd:a}}function zn(e,t,n){let{hunks:r}=e,i=t.nextEnd-t.prevEnd;if(e.editSessionDirty=!0,r.length===0){let t={additionStart:0,additionEnd:e.additionLines.length,deletionStart:0,deletionEnd:e.deletionLines.length};return r.push(Kn(e,t,n)),Jn(e,0),{type:`insert`,index:0,previousHunkCount:0}}let a=-1,o=-1;for(let e=0;e<r.length;e++){let n=r[e],i=n.additionLineIndex,s=i+n.additionCount;if(i>t.prevEnd)break;t.start<=s&&(a===-1&&(a=e),o=e)}if(a===-1)return Gn(e,t,i,n);let s=r[a],c=r[o],l=c.additionLineIndex+c.additionCount,u=Math.min(s.additionLineIndex,t.start),d=Math.max(l,t.prevEnd),f=Kn(e,{additionStart:u,additionEnd:d+i,deletionStart:s.deletionLineIndex-(s.additionLineIndex-u),deletionEnd:c.deletionLineIndex+c.deletionCount+(d-l)},n);if(i!==0)for(let e=o+1;e<r.length;e++)qn(r[e],i);let p=r.length;r.splice(a,o-a+1,f),Jn(e,a);let m=u<s.additionLineIndex||d>l;if(!(a===o&&!m))return{type:`merge`,firstIndex:a,lastIndex:o,previousHunkCount:p}}function Bn(e,t,n){let r=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(r.length===0)return[];let{hunks:i}=e,a=new Set,o=[],s=0,c=-1;for(let e of r){for(;s<i.length&&e>=i[s].additionLineIndex+i[s].additionCount;)s++;let t=i[s];if(t!=null&&e>=t.additionLineIndex){a.add(s);continue}let n=o[o.length-1];c===s&&n!=null?n[1]=e+1:(c=s,o.push([e,e+1]))}for(let t of a){let r=i[t];i[t]=Kn(e,{additionStart:r.additionLineIndex,additionEnd:r.additionLineIndex+r.additionCount,deletionStart:r.deletionLineIndex,deletionEnd:r.deletionLineIndex+r.deletionCount},n),Mn(e,t),e.editSessionDirty=!0}a.size>0&&In(e);let l=[];for(let t=o.length-1;t>=0;t--){let[r,i]=o[t],a=zn(e,{start:r,prevEnd:i,nextEnd:i},n);a!=null&&l.push(a)}return l}function Vn(e,t){let n=new Map;if(t.type===`merge`){let r=t.lastIndex-t.firstIndex;for(let[i,a]of e)i<=t.firstIndex?n.set(i,a):i>t.lastIndex&&n.set(i-r,a);return n}for(let[r,i]of e)r<t.index?n.set(r,i):r>t.index?n.set(r+1,i):(i.fromStart>0&&n.set(r,{fromStart:i.fromStart,fromEnd:0}),i.fromEnd>0&&n.set(r+1,{fromStart:0,fromEnd:i.fromEnd}));return n}function Hn(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=N({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=a.deletionLineIndex,c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=S({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=t.deletionLineIndex+t.deletionCount;r.push([n,n+i.fromStart])}return r}function Un(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries())r(t,n.deletionLineIndex-Math.max(n.collapsedBefore,0),n.deletionLineIndex);let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,i.deletionLineIndex+i.deletionCount,e.deletionLines.length),n}function Wn(e,t){return e.editSessionDirty===!0?(e.editSessionDirty=void 0,Object.assign(e,Tn(e,t)),!0):!1}function Gn(e,t,n,r){let{hunks:i}=e,a=0;for(;a<i.length&&i[a].additionLineIndex<t.start;)a++;let o=a<i.length?i[a].deletionLineIndex-i[a].additionLineIndex:i[a-1].deletionLineIndex+i[a-1].deletionCount-(i[a-1].additionLineIndex+i[a-1].additionCount),{start:s,prevEnd:c,nextEnd:l}=t;(s===c||s===l)&&(s>0?s--:l<e.additionLines.length&&(c++,l++));let u=Kn(e,{additionStart:s,additionEnd:l,deletionStart:s+o,deletionEnd:c+o},r);if(n!==0)for(let e=a;e<i.length;e++)qn(i[e],n);let d=i.length;return i.splice(a,0,u),Jn(e,a),{type:`insert`,index:a,previousHunkCount:d}}function Kn(e,t,n){let r=e.deletionLines.slice(t.deletionStart,t.deletionEnd),i=e.additionLines.slice(t.additionStart,t.additionEnd),a=i.length,o=r.length,s=[],c=0,l=0,u=(e,t,n)=>{e>0&&s.push({type:`context`,lines:e,additionLineIndex:t,deletionLineIndex:n})};if(r.join(``)===i.join(``))u(a,t.additionStart,t.deletionStart);else{let o=U({name:e.prevName??e.name,contents:r.join(``)},{name:e.name,contents:i.join(``),lang:e.lang},{...n,context:0}),d=0,f=0;for(let e of o.hunks){let n=e.additionCount>0?e.additionLineIndex-d:e.deletionLineIndex-f;u(n,t.additionStart+d,t.deletionStart+f),d+=n,f+=n;for(let n of e.hunkContent){let e=Pn(n,t.additionStart,t.deletionStart);e.type===`change`&&(e.additions===0&&(e.additionLineIndex=t.additionStart+d),e.deletions===0&&(e.deletionLineIndex=t.deletionStart+f)),s.push(e)}c+=e.additionLines,l+=e.deletionLines,d+=e.additionCount,f+=e.deletionCount}u(a-d,t.additionStart+d,t.deletionStart+f)}let d={collapsedBefore:0,additionStart:t.additionStart+1,additionCount:a,additionLines:c,additionLineIndex:t.additionStart,deletionStart:t.deletionStart+1,deletionCount:o,deletionLines:l,deletionLineIndex:t.deletionStart,hunkContent:s,hunkSpecs:`@@ -${t.deletionStart+1},${o} +${t.additionStart+1},${a} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return he(d,e),Fn(d),d}function qn(e,t){e.additionLineIndex+=t,e.additionStart+=t;for(let n of e.hunkContent)n.additionLineIndex+=t}function Jn(e,t){In(e),Mn(e,t)}var Yn=-1,Xn=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Yn}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;editSessionLines;constructor(e={theme:B},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=ht(e.theme??B)?Se():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(e){this.editSessionActive=!0,this.editSessionLines=e==null?void 0:Ln(e.additionLines).slice()}endEditSession(){this.editSessionActive=!1,this.editSessionLines=void 0}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??ne}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[];for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),s=t<i.additionLines.length,c=s?i.additionLines[t]??``:``,l=I(c);s&&(i.additionLines[t]=kt(c,r),l!==r&&o.push(t)),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let s=!1;if(o.length>0)if(this.editSessionActive&&!i.isPartial){if(!n){let e=Bn(i,o,this.options.parseDiffOptions);this.applyExpansionRemaps(e),s=e.length>0,this.editSessionLines=Ln(i.additionLines).slice()}}else Object.assign(i,On(i,o,this.options.parseDiffOptions));return r.baseThemeType=t,this.renderCache.isDirty=!0,s}applyExpansionRemaps(e){for(let t of e)this.expandedHunks=Vn(this.expandedHunks,t)}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;t.additionLines=or(e,t.additionLines);let r=t.additionLines.length,i=n.code.additionLines,a=i.length;r<a&&(i.length=r);for(let t=a;t<r;t++)i[t]??=ar(t,e);t.isPartial||(t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,wn(t,this.options.parseDiffOptions)),i[0]=ar(0,e),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,Tn(t,this.options.parseDiffOptions))),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Sn(e,n)){Object.assign(e,Cn(e,n,t)),this.markEditSessionPass(e);return}let r=this.editSessionLines,i=Ln(n);if(r==null){Object.assign(e,Tn(e,t)),this.markEditSessionPass(e);return}e.additionLines=i;let a=Rn(r,i);if(a!=null){let n=zn(e,a,t);n!=null&&this.applyExpansionRemaps([n])}Dn(e,n),this.editSessionLines=i.slice()}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0,this.editSessionLines=Ln(e.additionLines).slice())}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>_t(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=B,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=L,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await _e(wt(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=lr(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!T(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!E(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??pe(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:jt(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!w(e,n.diff)||!T(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=ie){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||E(e)||lr(e,this.getTokenizeMaxLength()),l=!w(e,this.renderCache.diff),u=!gt(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,yn(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??pe(e.name);let t=this.highlighter!=null&&ht(i.theme),n=this.highlighter!=null&&mt(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=ie){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return St({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=lr(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??pe(e.name);let n=this.highlighter!=null&&ht(this.options.theme??B),r=t||this.highlighter!=null&&mt(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:b(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!this.renderCache.highlighted||!T(this.renderCache.options,n)||!w(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!T(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&w(e,n.diff)&&T(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),f=this.renderCache?.isDirty??!1;this.diff=e;let p=a===`unified`,m=ur(e,this.options.loadDiffFiles!=null),h=!e.isPartial||m,g=[],v=[],y=[],b=[],{additionLines:x,deletionLines:S}=n,C={rowCount:0,hunkSeparators:u,additionsContentAST:g,deletionsContentAST:v,unifiedContentAST:y,unifiedGutterAST:d(),deletionsGutterAST:d(),additionsGutterAST:d(),expansionLineCount:c,hunkData:b,incrementRowCount(e=1){C.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:C.unifiedGutterAST.children.push(t);break;case`deletions`:C.deletionsGutterAST.children.push(t);break;case`additions`:C.additionsGutterAST.children.push(t);break}}},w=P({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),T={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(C.pushToGutter(`additions`,_(void 0,`buffer`,this.size)),g?.push(mn(this.size))):(C.pushToGutter(`deletions`,_(void 0,`buffer`,this.size)),v?.push(mn(this.size))),this.size=0,this.side=void 0}}},E=(e,t,n,r,i)=>{C.pushToGutter(e,O(t,n,r,i))};function D(e){T.flush(),a===`unified`?rr(`unified`,e,C):(rr(`deletions`,e,C),rr(`additions`,e,C))}this.pushFileLevelAnnotations(e,a,t,C),j({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&T.flush(),r>0&&D({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:h});let p=a===`unified`?d:l,g={type:c,hunkIndex:t,lineIndex:p,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&er(n.before,C);let r=s==null?void 0:S[s.lineIndex],i=o==null?void 0:x[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});E(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=ir(r,u.contentProperties,f&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${d},${l}`}:void 0)):i=ir(i,u.contentProperties,f&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${d},${l}`}:void 0),nr({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,p),createAnnotationElement:e=>this.createAnnotationElement(e),context:C}),n?.after!=null&&er(n.after,C)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&tr(n.before,C,T);let r=s==null?void 0:S[s.lineIndex],i=o==null?void 0:x[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();d==null?c===`change`&&T.flush():(T.side!=null&&T.side!==d&&T.flush(),T.side=d,T.increment());let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,p);if(m!=null&&T.size>0&&T.flush(),s!=null){let e=ir(r,a.contentProperties,f?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);E(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=ir(i,u.contentProperties,f?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);E(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}nr({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:C}),n?.after!=null&&tr(n.after,C,T)}let v=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,y=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:d===n.unifiedLineStart+n.unifiedLineCount-1),b=v?n.noEOFCRDeletions:!1,O=v?n.noEOFCRAdditions:!1,k=(s?.noEOFCR??!1)||b,A=(o?.noEOFCR??!1)||O;if(A||k){if(a===`split`&&T.flush(),k){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(C.unifiedContentAST.push(hn(e)),C.pushToGutter(`unified`,_(e,`metadata`,1))):(C.deletionsContentAST.push(hn(e)),C.pushToGutter(`deletions`,_(e,`metadata`,1)),A||(C.pushToGutter(`additions`,_(void 0,`buffer`,1)),C.additionsContentAST.push(mn(1))))}if(A){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(C.unifiedContentAST.push(hn(e)),C.pushToGutter(`unified`,_(e,`metadata`,1))):(C.additionsContentAST.push(hn(e)),C.pushToGutter(`additions`,_(e,`metadata`,1)),k||(C.pushToGutter(`deletions`,_(void 0,`buffer`,1)),C.deletionsContentAST.push(mn(1))))}C.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||y&&m)&&D({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:y&&m?`unknown`:i,rangeSize:w,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:h}),C.incrementRowCount(1)}}),a===`split`&&T.flush();let k=Math.max(vn(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),A=t.bufferBefore>0||t.bufferAfter>0,M=!p&&e.type!==`deleted`,N=!p&&e.type!==`new`,F=C.rowCount>0||A;g=M&&F?g:void 0,v=N&&F?v:void 0,y=p&&F?y:void 0;let ee=this.createPreElement(v!=null&&g!=null,k);return{unifiedGutterAST:p&&F?C.unifiedGutterAST.children:void 0,unifiedContentAST:y,deletionsGutterAST:N&&F?C.deletionsGutterAST.children:void 0,deletionsContentAST:v,additionsGutterAST:M&&F?C.additionsGutterAST.children:void 0,additionsContentAST:g,hunkData:b,preNode:ee,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:k,rowCount:C.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=d(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,At(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 z(this.renderFullAST(e,t))}renderPartialHTML(e,t){return z(t==null?e:D({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!Ot(n))return;let i=e.type===`new`?[]:Zn(Dt(this.deletionAnnotations)),a=e.type===`deleted`?[]:Zn(Dt(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){nr({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}nr({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(K(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(K(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(!(o.annotations.length===0&&a.annotations.length===0))return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return yt({fileOrDiff:e,mode:t,stickyHeader:n})}};function Zn(e){return e?.map(e=>K(e))??[]}var Qn=new Intl.PluralRules(`en-US`);function $n(e){return`${e} unmodified line${Qn.select(e)===`one`?``:`s`}`}function er(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function tr(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function nr({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,_(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,_(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,_(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function rr(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,q({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(q({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,q({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(q({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=_n(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?$n(n):`More unchanged context may be available`;c.pushToGutter(e,q({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(q({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function ir(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function ar(e,t){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${e},${e}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t.getLineText(e)}]}]}}function or(e,t){let n=[],r=cr(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!sr(i)?i+r:i)}return n}function sr(e){return e.endsWith(`
|
|
1397
|
+
`)||e.endsWith(`\r`)}function cr(e){for(let t of e){if(t.endsWith(`\r
|
|
1398
|
+
`))return`\r
|
|
1399
|
+
`;if(t.endsWith(`
|
|
1400
|
+
`))return`
|
|
1401
|
+
`;if(t.endsWith(`\r`))return`\r`}return`
|
|
1402
|
+
`}function lr(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function ur(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function dr(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function fr(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}async function pr(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function mr({oldFile:e,newFile:t},n){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function hr(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function gr(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var _r=-1,vr=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++_r}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;deferSetSelection;constructor(e={theme:B},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new ot,this.scrollSyncManager=new pn,this.interactionManager=new Ue(`diff`,We(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return hr(e)}createHunksRenderer(e){return new Xn(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=o.splitLineStart,l=o.unifiedLineStart;if(e<n){let t=n-e;i=Math.max(l-t,0),a=Math.max(c-t,0);break hunkIterator}if(e>=n+s){if(o===r){let t=e-(n+s);i=l+o.unifiedLineCount+t,a=c+o.splitLineCount+t;break hunkIterator}continue}for(let r of o.hunkContent)if(r.type===`context`)if(e<n+r.lines){let t=e-n;a=c+t,i=l+t;break hunkIterator}else n+=r.lines,c+=r.lines,l+=r.lines;else{let o=t===`deletions`?r.deletions:r.additions;if(e<n+o){let o=e-n;i=l+(t===`additions`?r.deletions:0)+o,a=c+o;break hunkIterator}else n+=o,c+=Math.max(r.deletions,r.additions),l+=r.deletions+r.additions}break hunkIterator}if(!(i==null||a==null))return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(We(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!m(this.appliedThemeCSS.theme,this.options.theme??B)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.refreshViewTimeout==null?this.interactionManager.setSelection(e,t):this.deferSetSelection=[e,t]}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`?!0:e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}cleanUp(e=!1){Me(this.handleEditSessionRender),this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1,this.editor?.cleanUp(e),this.editor=void 0,this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0)}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=mr(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Sr(this.pre,br({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Cr(this.headerElement,xr({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Xt(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?U(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!gr(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(rn(`merge`,e,t),this.setHydratedState(t),await pr(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=mr(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!yr(u,this.deletionFile)||!yr(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!f&>(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=U(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,this.deletionFile=u,this.additionFile=d,e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&Wn(this.fileDiff,this.options.parseDiffOptions),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:w=!1}=this.options;if(w&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,re);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||yn(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return j({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){return this.editor?.cleanUp(),this.editor=e,this.interactionManager.setEditorAttached(!0),this.type===`file-diff`&&this.hunksRenderer.beginEditSession(this.fileDiffCache),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.syncRenderViewToEditor(),e=>{this.editor=void 0,this.interactionManager.setEditorAttached(!1),e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Hn(e,this.hunksRenderer.getExpandedHunksMap(),t);return Wn(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Un(e,n)),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n,r=!1){if(this.hunksRenderer.updateRenderCache(e,t,r)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.escalateEditSessionRender();return}n&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.deferSetSelection!=null&&(this.interactionManager.setSelection(...this.deferSetSelection),this.deferSetSelection=void 0)},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return A({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return k({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){if(e<o.additionStart){let s=N({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),c=o.additionStart-s.rangeSize;if(s.renderAll||e<c+s.fromStart||e>=o.additionStart-s.fromEnd)return!1;let l=e-(c+s.fromStart)+1,u=o.additionStart-s.fromEnd-e;return l<=u?this.expandHunk(n,`up`,l+i):this.expandHunk(n,`down`,u+i),!0}if(e<o.additionStart+o.additionCount)return!1}let o=S({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],c=s.additionStart+s.additionCount;return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){je(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||E(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!fr(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${K(r)}`,a=this.annotationCache.get(i);if(a==null||!dr(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:It(K(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=Lt();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:Qt(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Qt(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=Mt;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??z(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,ae,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,de,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,ye,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,R,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=Rt(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Gt(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??B,s=typeof o==`string`?o:{...o},c=Vt(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=$t({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Kt(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=qt(this.themeCSSStyle.textContent??``,Vt(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=Yt({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=Yt({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=Yt({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`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=X(r?.[0]),a=X(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=X(n?.[0]),i=X(n?.[1]);for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=z(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=X(t[0]),i=X(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}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}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l===`unified`?!1:t!=null&&n!=null,totalLines:r,customProperties:i};Nt(u,this.appliedPreAttributes)||(Zt(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function yr(e,t){return e==null||t==null?e==null&&t==null:v(e,t)}function br({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function xr({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Sr(e,t,n=!1){return!n&&e==null&&t}function Cr(e,t,n=!1){return e==null&&t&&!n}function X(e){if(!(e==null||e.type!==`element`))return e.children??[]}function wr({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=F(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=N({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=x({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=Tr(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?S({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=C({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=C({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=ee(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function Tr(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return Er(e,t)}function Er(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var Dr=3e3,Or=-1,kr=class extends vr{__id=`little-virtualized-file-diff:${++Or}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=y(n)}setMetrics(e,t=!1){let n=y(e);!t&&Pe(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Et(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type===`deleted`?t.side===`deletions`:!0:!1)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!Fe(t,e),r=n&&Lr(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Rr(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&i&&Ot(this.renderRange)){let t=Ar(r)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!i&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of r){if(t==null)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let i=Hr(r,n),a=t.getBoundingClientRect().height,o=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(o=!0),a+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(o),c=this.cache.heightDeltas.get(i)??0,l=a-s;l!==c&&(e=!0,this.cache.measuredHeightDeltaTotal+=l-c,l===0?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,l))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,r){let i=!w(this.fileDiff,e),a=this.syncLineAnnotations(r),o=n?.resetDiffLayoutCache===!0||i||a,s=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=y(n.metrics),o=!0,s=!0);let{collapsed:c=!1,expandUnchanged:l=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!0),this.currentExpandUnchanged!==l&&(this.currentExpandUnchanged=l,o=!0,s=!0),o&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null||e<1)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=F(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return j({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=s===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=x({type:c,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(f+=r.gapBefore,l>=o-n&&l<o)return p={top:f,height:r.height},!0;f+=r.height+r.gapAfter}}let u=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===l)return p={top:f,height:u},!0;if(f+=u,r>0){let e=C({type:c,metrics:this.metrics});if(e!=null){if(l>o&&l<=o+r)return p={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),p}getScrollContainer(){let e=this.getSimpleVirtualizer()?.getRoot();return e instanceof HTMLElement?e:e?.documentElement}getNumericScrollAnchor(e){if(this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1}=this.options;if(r)return;let a=this.getDiffStyle(),o=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(e),c=s?.top??F(this.metrics,t)+this.cache.fileAnnotationHeight,l;return j({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:s,additionLine:u})=>{let d=a===`split`?u?.splitLineIndex??s?.splitLineIndex:u?.unifiedLineIndex??s?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=x({type:o,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(c+=e.totalHeight)}if(c>=e&&(s==null?u!=null&&(l={lineNumber:u.lineNumber,side:`additions`,top:c}):l={lineNumber:s.lineNumber,side:`deletions`,top:c},l!=null))return!0;let f=this.getLineHeight(d,(u?.noEOFCR??!1)||(s?.noEOFCR??!1));if(c+=f,i>0){let e=C({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){let n=rn(`clone`,e,t);if(await pr(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(rn(`merge`,e,t),this.setHydratedState(t),await pr(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n,{pendingExpansions:r,pendingHydratedDiff:i}=this;if(r!=null){this.pendingExpansions=void 0;for(let e of r)this.hunksRenderer.expandHunk(e.hunkIndex,e.direction,e.expansionLineCountOverride),t=!0}return i!=null&&(this.pendingHydratedDiff=void 0,i.expectedDiff===e&&(this.setHydratedState(i.files),n=i.nextDiff)),n==null?t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)):(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return A({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let r=this.renderRange;if(super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),n&&r!==void 0&&this.fileDiff!==void 0){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=F(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=wr({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:zr(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=mr(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!Vr(s,this.deletionFile)||!Vr(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=U(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=this.syncLineAnnotations(r);p&&this.resetLayoutCache({includeEstimatedHeights:!1});let m=t!=null&&t!==this.fileDiff,h=u!=null&&!w(this.fileDiff,u),g=m||l;if(h&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(f)this.top??=this.getVirtualizedTop(),h&&this.computeApproximateSize(!1,u);else{this.computeApproximateSize(!1,u);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!g||!f))return this.fileDiff=u,a!=null&&(this.deletionFile=s,this.additionFile=c),h&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let _=this.virtualizer.getWindowSpecs(),v=this.top??0,y=this.computeRenderRangeFromWindow(u,v,_),b=super.render({fileDiff:u,fileContainer:e,renderRange:y,lineAnnotations:r,forceRender:(d??n)||p||h,...a,...i});return this.isSimpleMode()&&b&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),b}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return Br(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=zr(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=jr(this.cache.heightDeltas),u=F(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=Pr(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+Fr(i,e)*this.metrics.lineHeight+Mr(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=Dr}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+Mr(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=N({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?x({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?S({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?C({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:Ir({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=N({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=S({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=zr(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=F(this.metrics,i),h=e.hunks.length>0?ee(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,S=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let w=Math.ceil(Math.max(r-n,0)/c),T=Math.ceil(w/s)*s+s,E=T/s,D=E,O=[],k=(n+r)/2,A=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-T*c*2),s),M=t+(A?.top??_),N=A?.renderedLineIndex??0,P,I,L;if(j({diff:e,diffStyle:l,startingLine:A?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?x({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;M+=y;let b=N%s===0,S=Math.floor(N/s);if(b&&(O[S]=M-(t+_+y),L!=null)){if(L<=0)return!0;L--}let w=this.getLineHeight(l===`split`?m:h,g);if(M>n-w&&M<r&&(P??=S),I==null&&M+w>k&&(I=S),L==null&&M>=r&&b&&(L=D),N++,M+=w,c>0||v&&d){let e=C({type:u,metrics:this.metrics});e!=null&&(M<r&&M+e.totalHeight>n&&(P??=S),I==null&&M+e.totalHeight>k&&(I=S),M+=e.totalHeight)}return!1}}),P==null)if(S)P=0,I=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};I??=P;let te=Math.round(I-E/2),ne=Math.max(0,Math.ceil(p/s)-E),R=Math.max(0,Math.min(te,ne)),re=R*s,ie=te<0?T+te*s:T,ae=O[R]??0,oe=re===0?0:g+ae,se=R+ie/s,ce=se<O.length?v-O[se]:v-(M-t-_);return{startingLine:re,totalLines:ie,bufferBefore:oe,bufferAfter:Math.max(0,ce)}}};function Ar(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===Tt&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function jr(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function Mr({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=Nr(e,n);return(t[Nr(e,r)]??0)-(t[i]??0)}function Nr(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function Pr(e){return Math.ceil(e/Dr)*Dr}function Fr(e,t){let n=0;for(let r of e)r<t&&n++;return n}function Ir({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function Lr(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function Rr(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function zr(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Br(e){return typeof e==`function`?`custom`:e??`line-info`}function Vr(e,t){return e==null||t==null?e==null&&t==null:v(e,t)}function Hr(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function Ur({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function Wr(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Gr(n,e.startContentIndex)}}function Gr(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+=t.type===`context`?t.lines:t.deletions+t.additions}return n}var Kr={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},qr={display:`contents`};function Jr(){return null}var Z=t(e(),1);function Yr({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,Z.jsxs)(Z.Fragment,{children:[f==null?(0,Z.jsxs)(Z.Fragment,{children:[p!=null&&(0,Z.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,Z.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,Z.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,Z.jsx)(`div`,{slot:ae,children:f}),o!=null&&l?.map((e,t)=>(0,Z.jsx)(`div`,{slot:K(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=Xr(t,e);return(0,Z.jsx)(`div`,{slot:n,style:qr,children:c(t,d)},n)}),s!=null&&(0,Z.jsx)(`div`,{slot:`gutter-utility-slot`,style:Kr,children:s(u)})]})}function Xr(e,t){let n=Wr(e,t);return n==null?void 0:Ur({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}var Q=t(n(),1);function Zr(e){let t=(0,Q.useRef)(e);return(0,Q.useInsertionEffect)(()=>void(t.current=e)),(0,Q.useCallback)((...e)=>t.current(...e),[])}var Qr=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),$r={multiple(e){return e?{[Qr.multiple]:``}:null}},ei=Q.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:l,orientation:d=`horizontal`,multiple:f=!1,value:p,className:m,render:h,style:g,..._}=e,v=c(!0),y=Q.useMemo(()=>p!==void 0||n!==void 0,[p,n]),b=(v?.disabled??!1)||r,[x,S]=s({controlled:p,default:p===void 0?n??o:void 0,name:`ToggleGroup`,state:`value`}),C=a((e,t,n)=>{let r;f?(r=x.slice(),t?r.push(e):r.splice(x.indexOf(e),1)):r=t?[e]:[],l?.(r,n),!n.isCanceled&&S(r)}),w={disabled:b,multiple:f,orientation:d},T=Q.useMemo(()=>({disabled:b,orientation:d,setGroupValue:C,value:x,isValueInitialized:y}),[b,d,C,x,y]),E={role:`group`},D=u(`div`,e,{enabled:!!v,state:w,ref:t,props:[E,_],stateAttributesMapping:$r});return(0,Z.jsx)(we.Provider,{value:T,children:v?D:(0,Z.jsx)(Ce,{render:h,className:m,style:g,state:w,refs:[t],props:[E,_],stateAttributesMapping:$r,loopFocus:i,enableHomeAndEndKeys:!0,orientation:d})})}),ti=r(),ni=Q.createContext({size:`default`,variant:`default`});function ri(e){let t=(0,ti.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,u=o===void 0?`default`:o,d=s===void 0?`horizontal`:s,f;t[7]!==u||t[8]!==c?(f={size:u,variant:c},t[7]=u,t[8]=c,t[9]=f):f=t[9];let p=f,m=d===`horizontal`?`*:pointer-coarse:after:min-w-auto`:`*:pointer-coarse:after:min-h-auto`,h=c===`inset`?`gap-0.5 rounded-lg border bg-input/40 p-0.5`:c==="default"?`gap-0.5`:d===`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=l(`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,Z.jsx)(ni,{value:p,children:n}),t[14]=n,t[15]=p,t[16]=_):_=t[16];let v;return t[17]!==d||t[18]!==i||t[19]!==u||t[20]!==g||t[21]!==_||t[22]!==c?(v=(0,Z.jsx)(ei,{className:g,"data-size":u,"data-slot":`toggle-group`,"data-variant":c,orientation:d,...i,children:_}),t[17]=d,t[18]=i,t[19]=u,t[20]=g,t[21]=_,t[22]=c,t[23]=v):v=t[23],v}function $(e){let t=(0,ti.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=Q.use(ni),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,Z.jsx)(Te,{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}function ii(e){let t=(0,ti.c)(33),{mode:n,wordWrap:r,ignoreWhitespace:i,className:a,onModeChange:o,onWordWrapChange:s,onIgnoreWhitespaceChange:c}=e,u;t[0]===a?u=t[1]:(u=l(`flex shrink-0 items-center gap-1`,a),t[0]=a,t[1]=u);let d;t[2]===n?d=t[3]:(d=[n],t[2]=n,t[3]=d);let f;t[4]===o?f=t[5]:(f=e=>{let t=e[0];(t===`unified`||t===`split`)&&o(t)},t[4]=o,t[5]=f);let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(ge,{render:(0,Z.jsx)($,{"aria-label":`Unified diff view`,value:`unified`}),children:(0,Z.jsx)(ke,{className:`size-3`})}),(0,Z.jsx)(xe,{side:`top`,children:`Unified diff view`})]}),t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(ge,{render:(0,Z.jsx)($,{"aria-label":`Split diff view`,value:`split`}),children:(0,Z.jsx)(Ee,{className:`size-3`})}),(0,Z.jsx)(xe,{side:`top`,children:`Split diff view`})]}),t[7]=m):m=t[7];let h;t[8]!==d||t[9]!==f?(h=(0,Z.jsxs)(ri,{className:`shrink-0`,variant:`outline`,size:`xs`,value:d,onValueChange:f,children:[p,m]}),t[8]=d,t[9]=f,t[10]=h):h=t[10];let g=r?`Disable diff line wrapping`:`Enable diff line wrapping`,_;t[11]===s?_=t[12]:(_=e=>s(!!e),t[11]=s,t[12]=_);let v;t[13]!==g||t[14]!==_||t[15]!==r?(v=(0,Z.jsx)($,{"aria-label":g,variant:`outline`,size:`xs`,pressed:r,onPressedChange:_}),t[13]=g,t[14]=_,t[15]=r,t[16]=v):v=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Ae,{className:`size-3`}),t[17]=y):y=t[17];let b;t[18]===v?b=t[19]:(b=(0,Z.jsx)(ge,{render:v,children:y}),t[18]=v,t[19]=b);let x=r?`Disable line wrapping`:`Enable line wrapping`,S;t[20]===x?S=t[21]:(S=(0,Z.jsx)(xe,{side:`top`,children:x}),t[20]=x,t[21]=S);let C;t[22]!==b||t[23]!==S?(C=(0,Z.jsxs)(ve,{children:[b,S]}),t[22]=b,t[23]=S,t[24]=C):C=t[24];let w;t[25]!==i||t[26]!==c?(w=i!==void 0&&c!==void 0?(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(ge,{render:(0,Z.jsx)($,{"aria-label":i?`Show whitespace changes`:`Hide whitespace changes`,variant:`outline`,size:`xs`,pressed:i,onPressedChange:e=>c(!!e)}),children:(0,Z.jsx)(Oe,{className:`size-3`})}),(0,Z.jsx)(xe,{side:`top`,children:i?`Show whitespace changes`:`Hide whitespace changes`})]}):null,t[25]=i,t[26]=c,t[27]=w):w=t[27];let T;return t[28]!==u||t[29]!==C||t[30]!==w||t[31]!==h?(T=(0,Z.jsxs)(`div`,{className:u,children:[h,C,w]}),t[28]=u,t[29]=C,t[30]=w,t[31]=h,t[32]=T):T=t[32],T}export{Et as A,ot as B,Nt as C,kt as D,At as E,yt as F,Le as G,We as H,_t as I,Me as J,Fe as K,gt as L,K as M,wt as N,Tt as O,St as P,De as Q,ht as R,It as S,jt as T,U,Ue as V,Re as W,Ae as X,je as Y,ke as Z,Kt as _,Yr as a,Rt as b,kr as c,$t as d,Qt as f,qt as g,Yt as h,Zr as i,Ot as j,Dt as k,vr as l,Xt as m,$ as n,Kr as o,Zt as p,Pe as q,ri as r,Jr as s,ii as t,Wn as u,Gt as v,Mt as w,Lt as x,Vt as y,mt as z};
|
|
1403
|
+
//# sourceMappingURL=DiffDisplayControls-DsQS9IDw.js.map
|