@openchambery/web 1.19.6-beta.2 → 1.19.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-CecaXP3U.js → AgentAvatar-ziUs4sw3.js} +1 -1
- package/dist/assets/AssistantView-CqYrPnmi.js +1 -0
- package/dist/assets/{ChatContainer-Jtte7fDL.js → ChatContainer-B1oHLuxJ.js} +41 -41
- package/dist/assets/ContextPanel-Cv4ezsRZ.js +285 -0
- package/dist/assets/DiagramView-Cl70FKMi.js +1 -0
- package/dist/assets/FadeInOnReveal-BAlsRFJH.js +1 -0
- package/dist/assets/{Icon-Du1LX11Q.js → Icon-CLpn1mIz.js} +1 -1
- package/dist/assets/MarkdownRendererImpl-D1mBcZI0.js +7 -0
- package/dist/assets/MarkstreamRendererImpl-CR0fBG5w.css +1 -0
- package/dist/assets/MarkstreamRendererImpl-DKejWn8D.js +1 -0
- package/dist/assets/MobileDetailNavigation-1VCpYu63.js +1 -0
- package/dist/assets/MobileShareBridge-mHGdDmey.js +4 -0
- package/dist/assets/MobileSurface-BX3R193V.js +2 -0
- package/dist/assets/{MultiRunWindow-BLi408XV.js → MultiRunWindow-BErLmZWg.js} +1 -1
- package/dist/assets/OnboardingScreen-CJYyR54B.js +1 -0
- package/dist/assets/OverlayScrollbar-C-jZ8ITG.js +2 -0
- package/dist/assets/SettingsView-Cn1jP1mT.js +25 -0
- package/dist/assets/{SettingsWindow-Bwm99_EI.js → SettingsWindow-CBbZt7wX.js} +1 -1
- package/dist/assets/TerminalView-DX9E73SP.js +8 -0
- package/dist/assets/ToolOutputDialog-BZVb4Y-p.js +10 -0
- package/dist/assets/__vite-optional-peer-dep_mermaid_markstream-react-CQGbcmkI.js +1 -0
- package/dist/assets/appThemeRegistry-DtV6Rvrg.js +2 -0
- package/dist/assets/{button-p6vbd3r6.js → button-z0GOBtWi.js} +1 -1
- package/dist/assets/clipboard-Bz0Zm9VJ.js +1 -0
- package/dist/assets/{collapsible-Cimoz0kx.js → collapsible-D9zJRpeB.js} +1 -1
- package/dist/assets/d2_markstream-react-DtM9g53j.js +1 -0
- package/dist/assets/desktop-CfLlmafK.js +1 -0
- package/dist/assets/desktopHosts-C1Ns3DUu.js +1 -0
- package/dist/assets/desktopRelayRestore-LBt0CBOj.js +1 -0
- package/dist/assets/{diagram-DX_MPRs3.js → diagram-CoEqmReY.js} +1 -1
- package/dist/assets/{dialog-Bjnvo5pk.js → dialog-HCE4eLUW.js} +1 -1
- package/dist/assets/fileQueries-Dnn15WsA.js +1 -0
- package/dist/assets/{gitApi-BxmPop0H.js → gitApi-BG4voVWW.js} +1 -1
- package/dist/assets/infographic_markstream-react-C3vVus-4.js +1 -0
- package/dist/assets/{input-gaFVNq1P.js → input-BG3VWTIF.js} +1 -1
- package/dist/assets/insertionBoundaries-C0RVooi_.js +4 -0
- package/dist/assets/main-CfyFgSOx.js +2 -0
- package/dist/assets/main-DpSMLr9r.js +29 -0
- package/dist/assets/markdown-worker-y3ewaqAK.js +4 -0
- package/dist/assets/markdownHeightCache-CvUyZT4q.js +1 -0
- package/dist/assets/markdownTheme-TdhQOZSN.js +2 -0
- package/dist/assets/miniChat-C7rwl6yh.js +2 -0
- package/dist/assets/mobile-r2_QpF9U.js +2 -0
- package/dist/assets/multirun-Bzl1GRci.js +4 -0
- package/dist/assets/persistence-CmjKImz2.js +3 -0
- package/dist/assets/platform-skqcMARt.js +2 -0
- package/dist/assets/projectMeta-DreuW5QR.js +3 -0
- package/dist/assets/radio-BjFhpK38.js +1 -0
- package/dist/assets/renderElectronMiniChatApp-CWv8b6sX.js +2 -0
- package/dist/assets/renderMobileApp-DwU7nQCh.js +25 -0
- package/dist/assets/runtime-switch-BkpTTbEi.js +1 -0
- package/dist/assets/runtimeConfig-BCUCu-2N.js +2 -0
- package/dist/assets/runtimeEndpointReset-e8yYYEql.js +4 -0
- package/dist/assets/{shikiHighlight-eIaY2Kju.js → shikiHighlight-BZ2o-6R0.js} +1 -1
- package/dist/assets/sortable-tabs-strip-Bj8N0VWf.js +1 -0
- package/dist/assets/terminalApi-CNqqwjfG.js +1 -0
- package/dist/assets/{tooltip-D1a6rKLA.js → tooltip-CtH61mQh.js} +1 -1
- package/dist/assets/url-KeihbE0d.js +1 -0
- package/dist/assets/useAppFontEffects-BsUDFHEp.js +7 -0
- package/dist/assets/useAssistantUIStore-DaplPyb0.js +1 -0
- package/dist/assets/useDesktopWindowControlsLayout-D_OHz0jC.js +1 -0
- package/dist/assets/{useEffectiveDirectory-Crf7G7TX.js → useEffectiveDirectory-MPobUNu2.js} +1 -1
- package/dist/assets/useFontPreferences-D8emhcNv.js +1 -0
- package/dist/assets/useMobileNavigationStore-39gNpMJa.js +412 -0
- package/dist/assets/useSessionAutoCleanup-CJrCBgIe.js +1 -0
- package/dist/assets/useUIStore-B7KJS5G7.js +1 -0
- package/dist/assets/useWorkerHighlightedLines-Is3NbOjf.js +7 -0
- package/dist/assets/utils-CTL16t2f.js +1 -0
- package/dist/assets/vendor-floating-ui-core-Co1I1lFV.js +1 -0
- package/dist/assets/vendor-floating-ui-dom-BHhLtF5l.js +1 -0
- package/dist/assets/vendor-katex--B5dHUyk.js +257 -0
- package/dist/assets/vendor-markstream-core-Cm34iPLL.js +3 -0
- package/dist/assets/vendor-markstream-react-CGQrpq8a.css +1 -0
- package/dist/assets/vendor-markstream-react-CwvbEg9R.js +173 -0
- package/dist/assets/vendor-pierre-diffs-DX7XTPG3.js +2795 -0
- package/dist/assets/vendor-pierre-theme-D9JzKBPc.js +1 -0
- package/dist/assets/vendor-stream-diffs-DWy3xSmp.js +6 -0
- package/dist/index.html +10 -8
- package/dist/mini-chat.html +10 -8
- package/dist/mobile.html +10 -8
- package/package.json +1 -1
- package/dist/assets/AssistantView-BM7c04DP.js +0 -1
- package/dist/assets/ContextPanel-UeBnllm7.js +0 -285
- package/dist/assets/DiagramView-CSNqDPIX.js +0 -1
- package/dist/assets/FadeInOnReveal-Cj9ZC3Ab.js +0 -1
- package/dist/assets/MarkdownRendererImpl-CqoYV3gM.js +0 -7
- package/dist/assets/MobileDetailNavigation-xInJsFXY.js +0 -1
- package/dist/assets/MobileShareBridge-DgIb2q0F.js +0 -4
- package/dist/assets/MobileSurface-DU7wMCxP.js +0 -2
- package/dist/assets/OnboardingScreen-BkbprNa7.js +0 -1
- package/dist/assets/OverlayScrollbar-oOLMqq2s.js +0 -2
- package/dist/assets/SettingsView-BDbbuS5X.js +0 -25
- package/dist/assets/TerminalView-dV3xYXLn.js +0 -8
- package/dist/assets/ToolOutputDialog-C4ZGDFSf.js +0 -10
- package/dist/assets/appThemeRegistry-Dh0XRDtt.js +0 -2
- package/dist/assets/clipboard-C0bgPFn5.js +0 -1
- package/dist/assets/desktopHosts-DceeVBky.js +0 -1
- package/dist/assets/desktopRelayRestore-B0MRdR5y.js +0 -1
- package/dist/assets/fileQueries-BDld6h3B.js +0 -1
- package/dist/assets/insertionBoundaries-B9Ai1XSi.js +0 -4
- package/dist/assets/main-BY7YKenl.js +0 -29
- package/dist/assets/main-DLTKz97m.js +0 -2
- package/dist/assets/markdown-worker-CoO82KYF.js +0 -4
- package/dist/assets/markdownTheme-St8zxDvJ.js +0 -2
- package/dist/assets/miniChat-mvs2Sp_b.js +0 -2
- package/dist/assets/mobile-D3RhNnH4.js +0 -2
- package/dist/assets/multirun-BeRVEbVk.js +0 -4
- package/dist/assets/persistence-CLUawIlm.js +0 -3
- package/dist/assets/platform-BrncW9ab.js +0 -2
- package/dist/assets/projectMeta-DZyXz0Xw.js +0 -3
- package/dist/assets/radio-1JBzoeIY.js +0 -1
- package/dist/assets/renderElectronMiniChatApp-BKh4WnnX.js +0 -2
- package/dist/assets/renderMobileApp-DzvErHVJ.js +0 -25
- package/dist/assets/runtimeConfig-CSiXlqKC.js +0 -2
- package/dist/assets/runtimeEndpointReset-2mL6Jaq_.js +0 -4
- package/dist/assets/sortable-tabs-strip-oDpTDVoQ.js +0 -1
- package/dist/assets/terminalApi-D2OzR0I3.js +0 -1
- package/dist/assets/url-zwuNq3GS.js +0 -1
- package/dist/assets/useAppFontEffects-Khq9JCwr.js +0 -7
- package/dist/assets/useAssistantUIStore-D699Sbdb.js +0 -1
- package/dist/assets/useDesktopWindowControlsLayout-DoEucjOL.js +0 -1
- package/dist/assets/useFontPreferences-F2QPNE2V.js +0 -1
- package/dist/assets/useMobileNavigationStore-Bgj9KY7t.js +0 -412
- package/dist/assets/useSessionAutoCleanup-CL-VNm3p.js +0 -1
- package/dist/assets/useUIStore-BXjMQrel.js +0 -1
- package/dist/assets/useWorkerHighlightedLines-DW36Nv1v.js +0 -7
- package/dist/assets/utils-D94hxQYq.js +0 -1
- package/dist/assets/vendor-katex-CNGgSigB.js +0 -257
- package/dist/assets/vendor-pierre-diffs-BenIz2TM.js +0 -1418
- package/dist/assets/vendor-pierre-theme-F9vQJHIe.js +0 -1
|
@@ -1,1418 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-shikijs-langs-eloENL-7.js","assets/rolldown-runtime-C0FnF6B9.js","assets/vendor-shikijs-themes-C7F1vBnG.js","assets/vendor-shiki-DzFPeSWm.js","assets/vendor-pierre-theme-F9vQJHIe.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{nt as t,rt as n}from"./vendor-base-ui-CnHfUmDN.js";import{o as r}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";import{t as i}from"./vendor-hast-util-to-html-B0p1k5Xa.js";import{t as a}from"./vendor-oniguruma-to-es-CrHzjjSU.js";import{n as o,r as s,t as c}from"./vendor-diff-Dq7CZNim.js";import{t as l}from"./vendor-lru_map-DpDied8H.js";var u={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},d={display:`contents`};function f(){return null}var p=`diffs-container`,m=/(?=^From [a-f0-9]+ .+$)/m,h=/(?=^diff --git)/gm,g=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,_=/(?<=\n)/,v=/^(---|\+\+\+)\s+([^\t\r\n]+)/,y=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,b=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,x=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,S=`header-prefix`,C=`header-filename-suffix`,w=`header-metadata`,T=`header-custom`,E={dark:`pierre-dark`,light:`pierre-light`},D=`data-theme-css`,O=`data-unsafe-css`,k=`data-diffs-scrollbar-measure`,ee=`--diffs-scrollbar-gutter-measured`,A=1e5,j={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...j});var te=Object.freeze({fromStart:0,fromEnd:0}),ne={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},re={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function M(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}var N=e(n(),1),P=t();function ie({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function ae(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:oe(n,e.startContentIndex)}}function oe(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}function se({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:f,getInstance:p}){let m=n?.(e),h=r?.(e),g=i?.(e),_=a?.(e);return(0,P.jsxs)(P.Fragment,{children:[m==null?(0,P.jsxs)(P.Fragment,{children:[h!=null&&(0,P.jsx)(`div`,{slot:`header-prefix`,children:h}),g!=null&&(0,P.jsx)(`div`,{slot:`header-filename-suffix`,children:g}),_!=null&&(0,P.jsx)(`div`,{slot:`header-metadata`,children:_})]}):(0,P.jsx)(`div`,{slot:T,children:m}),o!=null&&l?.map((e,t)=>(0,P.jsx)(`div`,{slot:M(e),children:o(e)},t)),t!=null&&c!=null&&p!=null&&t.map(t=>{if(t==null)return;let n=ce(t,e);return(0,P.jsx)(`div`,{slot:n,style:d,children:c(t,p)},n)}),s!=null&&(0,P.jsx)(`div`,{slot:`gutter-utility-slot`,style:u,children:s(f)})]})}function ce(e,t){let n=ae(e,t);return n==null?void 0:ie({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function le({file:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,lineAnnotations:o,renderGutterUtility:s,getHoveredLine:c}){let l=t?.(e),d=n?.(e),f=r?.(e),p=i?.(e);return(0,P.jsxs)(P.Fragment,{children:[l==null?(0,P.jsxs)(P.Fragment,{children:[d!=null&&(0,P.jsx)(`div`,{slot:`header-prefix`,children:d}),f!=null&&(0,P.jsx)(`div`,{slot:`header-filename-suffix`,children:f}),p!=null&&(0,P.jsx)(`div`,{slot:`header-metadata`,children:p})]}):(0,P.jsx)(`div`,{slot:T,children:l}),a!=null&&o?.map((e,t)=>(0,P.jsx)(`div`,{slot:M(e),children:a(e)},t)),s!=null&&(0,P.jsx)(`div`,{slot:`gutter-utility-slot`,style:u,children:s(c)})]})}function ue(e){let t=(0,N.useRef)(e);return(0,N.useInsertionEffect)(()=>void(t.current=e)),(0,N.useCallback)((...e)=>t.current(...e),[])}function de(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function F(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var fe=new Set;function pe(e){let t=[],n=new Set;for(let r of me(e.themes)){let e=_e(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return pe({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return pe({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function me(e){return he(e)?[e]:e}function he(e){return _e(e)||ge(e)}function ge(e){return typeof e.name==`string`&&typeof e.load==`function`}function _e(e){return typeof e.getThemes==`function`}function ve(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var ye=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},be=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},xe=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Se(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new ye(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new be(i));let c=r,l=s().then(e=>{let a=ve(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new xe(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var I=Se();function Ce(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=I.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,I.getResolvedTheme(n)??I.seedResolvedTheme(n,e);fe.has(n)||(fe.add(n),t.loadThemeSync(e))}}var we=new Map,Te=new Map,Ee=new Map,De=new Set;function Oe(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(De.has(n.name))continue;let e=we.get(n.name);e??(e=n,we.set(n.name,e)),De.add(e.name),t.loadLanguageSync(e.data)}}function ke(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var L=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Ae(e){return je(e)}function je(e){return Array.isArray(e)?Me(e):e instanceof RegExp?e:typeof e==`object`?Ne(e):e}function Me(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=je(e[n]);return t}function Ne(e){let t={};for(let n in e)t[n]=je(e[n]);return t}function Pe(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Fe(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Fe(e.substring(0,e.length-1)):e.substr(~t+1)}var Ie=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Le=class{static hasCaptures(e){return e!==null&&(Ie.lastIndex=0,Ie.test(e))}static replaceCaptures(e,t,n){return e.replace(Ie,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Re(e,t){return e<t?-1:+(e>t)}function ze(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Re(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Be(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Ve(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var He=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Ue=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Je(e),t)}static createFromParsedTheme(e,t){return Xe(e,t)}_cachedMatchRoot=new He(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Ge(e.parent,t.parentScopes));return n?new qe(n.fontStyle,n.foreground,n.background):null}},We=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ge(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Ke(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Ke(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var qe=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Je(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&Be(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Be(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Ye(l,u,e,o,s,c)}}return n}var Ye=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},R=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(R||{});function Xe(e,t){e.sort((e,t)=>{let n=Re(e.scope,t.scope);return n!==0||(n=ze(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Ze(t),o=new qe(n,a.getId(r),a.getId(i)),s=new et(new $e(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Ue(a,o,s)}var Ze=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Qe=Object.freeze([]),$e=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Qe,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e||(this.scopeDepth=e),t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},et=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),$e.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(ze(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new $e(e,t,n,r,i))}},tt=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){e.getLanguageId(t),e.getTokenType(t),e.getFontStyle(t),e.getForeground(t),e.getBackground(t)}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=rt(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function nt(e){return e}function rt(e){return e}function it(e,t){let n=[],r=ot(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:`${i}`}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(at(i)){let e=[];do e.push(i),i=r.next();while(at(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function at(e){return!!e&&!!e.match(/[\w\.:]+/)}function ot(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function st(e){typeof e.dispose==`function`&&e.dispose()}var ct=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},lt=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ut=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},dt=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ct(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ut;for(let n of e)ft(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof ct){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function ft(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof ct?mt({baseGrammar:a,selfGrammar:i},r):pt(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new ct(e))}function pt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];ht([r],t,n)}}function mt(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ht(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ht(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ht(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Pe({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ht(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=xt(i);switch(a.kind){case 0:mt({...t,selfGrammar:t.baseGrammar},n);break;case 1:mt(t,n);break;case 2:pt(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?pt(a.ruleName,i,n):mt(i,n)}else a.kind===4?n.add(new lt(a.scopeName,a.ruleName)):n.add(new ct(a.scopeName))}}}var gt=class{kind=0},_t=class{kind=1},vt=class{constructor(e){this.ruleName=e}kind=2},yt=class{constructor(e){this.scopeName=e}kind=3},bt=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function xt(e){if(e===`$base`)return new gt;if(e===`$self`)return new _t;let t=e.indexOf(`#`);return t===-1?new yt(e):t===0?new vt(e.substring(1)):new bt(e.substring(0,t),e.substring(t+1))}var St=/\\(\d+)/,Ct=/\\(\d+)/g,wt=-1,Tt=-2;function Et(e){return e}function Dt(e){return e}var Ot=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Le.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Le.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Fe(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Le.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Le.replaceCaptures(this._contentName,e,t)}},kt=class extends Ot{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},At=class extends Ot{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ft(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},jt=class extends Ot{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new It,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mt=class extends Ot{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Ft(i,this.id),this.beginCaptures=a,this._end=new Ft(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Nt=class extends Ot{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Ft(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ft(o,Tt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new It;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new It,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},Pt=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new kt(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new At(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Pe({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new jt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Nt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Mt(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=xt(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l)if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof jt||e instanceof Mt||e instanceof Nt)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ft=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&St.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return Ct.lastIndex=0,this.source.replace(Ct,(e,t)=>Ve(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},It=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Lt(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Lt(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Lt=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
3
|
-
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Rt=class{constructor(e,t){this.languageId=e,this.tokenType=t}},zt=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Rt(e,8),this._embeddedLanguagesMatcher=new Bt(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Rt(0,0);_getBasicScopeAttributes=new He(e=>new Rt(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Bt=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Ve(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Vt=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Ht(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ut(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Vt(i,!0);f()}return new Vt(i,!1);function f(){let o=Wt(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===wt){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),Yt(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Mt){let r=o;Yt(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Nt){let r=o;Yt(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(Yt(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ut(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Nt&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Jt(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Tt){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),Yt(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Wt(e,t,n,r,i,a){let o=Gt(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Kt(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Gt(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=qt(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Kt(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=qt(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function qt(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Jt(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Yt(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Ht(e,p,n&&d.start===0,d.start,f,i,!1,0),st(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Xt(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Xt=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Zt(e,t,n,r,i,a,o,s){return new tn(e,t,n,r,i,a,o,s)}function Qt(e,t,n,r,i){let a=it(t,$t),o=Pt.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function $t(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(en(t[r],e))return n=r+1,!0;return!1})}function en(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var tn=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new zt(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=nn(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=it(e,$t);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Qt(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Qt(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Et(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Dt(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=nn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Pt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===an.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=tt.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?rn.createRootAndLookUpScopeName(a,r,this):rn.createRoot(`unknown`,r),t=new an(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
4
|
-
`;let a=this.createOnigString(e),o=a.content.length,s=new sn(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Ht(this,a,i,0,t,s,!0,r);return st(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function nn(e,t){return e=Ae(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var rn=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=We.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new We(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new We(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),tt.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},an=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?rn.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Dt(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=rn.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Et(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,rn.fromExtension(r,n.contentNameScopesList))}},on=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):it(e,$t).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>it(e,$t).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},sn=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=tt.set(n,0,nt(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=tt.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},cn=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Zt(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},ln=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new cn(Ue.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ue.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new on(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new dt(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},un=an.NULL;function dn(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function fn(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function pn(e){return Array.isArray(e)?e:[e]}async function mn(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function hn(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function gn(e){return e===`ansi`||hn(e)}function _n(e){return e===`none`}function vn(e){return _n(e)}function yn(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function bn(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function xn(e){let t=bn(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Sn(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var Cn=`light-dark()`,wn=[`color`,`background-color`];function Tn(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function En(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?Tn(e,t):e})):e}function Dn(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>On(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&wn.includes(a))if(r===Cn&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s;else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function On(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&R.Italic&&(t[`font-style`]=`italic`),e.fontStyle&R.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&R.Underline&&n.push(`underline`),e.fontStyle&R.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function kn(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var An=new WeakMap;function jn(e,t){An.set(e,t)}function Mn(e){return An.get(e)}var Nn=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(pn(n).map(e=>[e,un])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Pn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Pn(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Fn(e,t){if(!(e instanceof Nn))throw new L(`Invalid grammar state`);return e.getInternalStack(t)}function In(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new L(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{let t=r.lines[e.line];if(t===void 0)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=xn(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));Ln(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return En(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new L(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Rn(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new L(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new L(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&yn(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Ln(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new L(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new L(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Rn(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Rn).join(``):``}var zn=[In()];function Bn(e){let t=Vn(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...zn]}function Vn(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Hn=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Un={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Wn(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Gn(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Kn(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:`resetAll`});else if(r<=9)Un[r]&&t.push({type:`setDecoration`,value:Un[r]});else if(r<=29){let e=Un[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Hn[r-30]}});else if(r===38){let n=Gn(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Hn[r-40]}});else if(r===48){let n=Gn(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Hn[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Hn[r-100+8]}})}return t}function qn(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Wn(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Kn(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Jn={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Yn(e=Jn){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Hn.length;e++)r.push(t(Hn[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Xn={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function Zn(e,t,n){let r=dn(e,n),i=bn(t),a=Yn(Object.fromEntries(Hn.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Xn[t]]}))),o=qn();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=fn(i,r),o=fn(o,r),n.decorations.has(`dim`)&&(i=Qn(i));let s=R.None;return n.decorations.has(`bold`)&&(s|=R.Bold),n.decorations.has(`italic`)&&(s|=R.Italic),n.decorations.has(`underline`)&&(s|=R.Underline),n.decorations.has(`strikethrough`)&&(s|=R.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Qn(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function $n(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(hn(i)||_n(r))return bn(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return Zn(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return tr(t,s,a,o,n)}function er(...e){if(e.length===2)return Mn(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(hn(i)||_n(a))throw new L(`Plain language does not have grammar state`);if(i===`ansi`)throw new L(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Nn(nr(n,c,o,s,r).stateStack,c.name,o.name)}function tr(e,t,n,r,i){let a=nr(e,t,n,r,i),o=new Nn(a.stateStack,t.name,n.name);return jn(a.tokens,o),a.tokens}function nr(e,t,n,r,i){let a=dn(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=bn(e),l=i.grammarState?Fn(i.grammarState,n.name)??un:i.grammarContextCode==null?un:nr(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=fn(r[tt.getForeground(s)],a),l=tt.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?rr(t.scopes):ir(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function rr(e){return e.map(e=>({scopeName:e}))}function ir(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:sr(e,i,t.slice(0,r))}}return n}function ar(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function or(e,t,n){if(!ar(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ar(e[r],n[i])&&--r,--i;return r===-1}function sr(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(or(e,t,n)){r.push(a);break}return r}function cr(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=$n(e,t,{...n,theme:r.theme});return{tokens:i,state:Mn(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=lr(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new Nn(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&jn(o,s),o}function lr(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function ur(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new L("`themes` option must not be empty");let p=cr(e,t,n);if(c=Mn(p),l&&Cn!==l&&!f.find(e=>e.color===l))throw new L(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Dn(e,h,u,l,d))),c&&jn(a,c);let g=f.map(e=>dn(e.theme,n));i=dr(f,m,g,u,l,`fg`,d),r=dr(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=dn(n.theme,n);a=$n(e,t,n);let l=e.getTheme(n.theme);r=fn(l.bg,s),i=fn(l.fg,s),o=l.name,c=Mn(a)}else throw new L("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function dr(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=fn(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===Cn&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${fn(t[r][a],n[r])||`inherit`}, ${fn(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function fr(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>fr(e,t,n),codeToTokens:(t,n)=>ur(e,t,n)}){let i=t;for(let e of Bn(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=ur(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=mr(a):d===`never`&&(a=hr(a)),f&&(a=gr(a));let p={...r,get source(){return i}};for(let e of Bn(n))a=e.tokens?.call(p,a)||a;return pr(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function pr(e,t,n,r=Mn(e)){let i=Bn(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:yn,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
5
|
-
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=kn(a.htmlStyle||On(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&jn(m,r),m}function mr(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&R.Underline||i.fontStyle&R.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function hr(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function gr(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=kn(e.htmlStyle||On(e)),i=kn(n.htmlStyle||On(n)),a=e.fontStyle&&(e.fontStyle&R.Underline||e.fontStyle&R.Strikethrough),o=n.fontStyle&&(n.fontStyle&R.Underline||n.fontStyle&R.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var _r=i;function vr(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>fr(e,t,n),codeToTokens:(t,n)=>ur(e,t,n)},i=_r(fr(e,t,n,r));for(let e of Bn(n))i=e.postprocess?.call(r,i,n)||i;return i}var yr={light:`#333333`,dark:`#bbbbbb`},br={light:`#fffffe`,dark:`#1e1e1e`},xr=`__shiki_resolved`;function Sr(e){if(e?.[xr])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?yr.light:yr.dark,n||=t.type===`light`?br.light:br.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,xr,{enumerable:!1,writable:!1,value:!0}),t}async function Cr(e){return Array.from(new Set((await Promise.all(e.filter(e=>!gn(e)).map(async e=>await mn(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function wr(e){return(await Promise.all(e.map(async e=>vn(e)?null:Sr(await mn(e))))).filter(e=>!!e)}var Tr=3;function Er(e,t=3){Tr&&(typeof Tr==`number`&&t>Tr||`${e}`)}var Dr=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Or(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Dr(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var kr=class extends ln{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Sr(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ue.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Or(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Dr(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Ar=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},jr=0;function Mr(e){jr+=1,e.warnings!==!1&&jr>=10&&jr%10==0&&console.warn(`[Shiki] ${jr} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Dr("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Sr),i=new kr(new Ar(e.engine,n),r,n,e.langAlias),a;function o(t){return Or(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Dr(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Dr(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Cr(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await wr(e))}function g(){if(t)throw new Dr(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--jr)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function Nr(e){e.engine||Er("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([wr(e.themes||[]),Cr(e.langs||[]),e.engine]);return Mr({...e,themes:t,langs:n,engine:r})}async function Pr(e){let t=await Nr(e);return{getLastGrammarState:(...e)=>er(t,...e),codeToTokensBase:(e,n)=>$n(t,e,n),codeToTokensWithThemes:(e,n)=>cr(t,e,n),codeToTokens:(e,n)=>ur(t,e,n),codeToHast:(e,n)=>fr(t,e,n),codeToHtml:(e,n)=>vr(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Fr(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,gn(n))return[];let r=t[n];if(!r)throw new L(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(vn(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new L(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Pr({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ir(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Lr(e,t){let n=Ir(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Rr=[{id:`abap`,name:`ABAP`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.yi),__vite__mapDeps([0,1])))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.vi),__vite__mapDeps([0,1])))},{id:`ada`,name:`Ada`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e._i),__vite__mapDeps([0,1])))},{id:`angular-html`,name:`Angular HTML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.pi),__vite__mapDeps([0,1])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.di),__vite__mapDeps([0,1])))},{id:`apache`,name:`Apache Conf`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ui),__vite__mapDeps([0,1])))},{id:`apex`,name:`Apex`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.li),__vite__mapDeps([0,1])))},{id:`apl`,name:`APL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ai),__vite__mapDeps([0,1])))},{id:`applescript`,name:`AppleScript`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ii),__vite__mapDeps([0,1])))},{id:`ara`,name:`Ara`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ri),__vite__mapDeps([0,1])))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ni),__vite__mapDeps([0,1])))},{id:`asm`,name:`Assembly`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ti),__vite__mapDeps([0,1])))},{id:`astro`,name:`Astro`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Zr),__vite__mapDeps([0,1])))},{id:`awk`,name:`AWK`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Xr),__vite__mapDeps([0,1])))},{id:`ballerina`,name:`Ballerina`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Yr),__vite__mapDeps([0,1])))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Jr),__vite__mapDeps([0,1])))},{id:`beancount`,name:`Beancount`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.qr),__vite__mapDeps([0,1])))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Kr),__vite__mapDeps([0,1])))},{id:`bibtex`,name:`BibTeX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Gr),__vite__mapDeps([0,1])))},{id:`bicep`,name:`Bicep`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Wr),__vite__mapDeps([0,1])))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ur),__vite__mapDeps([0,1])))},{id:`blade`,name:`Blade`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Br),__vite__mapDeps([0,1])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Rr),__vite__mapDeps([0,1])))},{id:`c`,name:`C`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Lr),__vite__mapDeps([0,1])))},{id:`c3`,name:`C3`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ir),__vite__mapDeps([0,1])))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Fr),__vite__mapDeps([0,1])))},{id:`cairo`,name:`Cairo`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Nr),__vite__mapDeps([0,1])))},{id:`clarity`,name:`Clarity`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Mr),__vite__mapDeps([0,1])))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.jr),__vite__mapDeps([0,1])))},{id:`cmake`,name:`CMake`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ar),__vite__mapDeps([0,1])))},{id:`cobol`,name:`COBOL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.kr),__vite__mapDeps([0,1])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Or),__vite__mapDeps([0,1])))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Dr),__vite__mapDeps([0,1])))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Er),__vite__mapDeps([0,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Tr),__vite__mapDeps([0,1])))},{id:`coq`,name:`Coq`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.wr),__vite__mapDeps([0,1])))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.xr),__vite__mapDeps([0,1])))},{id:`crystal`,name:`Crystal`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.yr),__vite__mapDeps([0,1])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.vr),__vite__mapDeps([0,1])))},{id:`css`,name:`CSS`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.hi),__vite__mapDeps([0,1])))},{id:`csv`,name:`CSV`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e._r),__vite__mapDeps([0,1])))},{id:`cue`,name:`CUE`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.gr),__vite__mapDeps([0,1])))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.hr),__vite__mapDeps([0,1])))},{id:`d`,name:`D`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.mr),__vite__mapDeps([0,1])))},{id:`dart`,name:`Dart`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.pr),__vite__mapDeps([0,1])))},{id:`dax`,name:`DAX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.fr),__vite__mapDeps([0,1])))},{id:`desktop`,name:`Desktop`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.dr),__vite__mapDeps([0,1])))},{id:`diff`,name:`Diff`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ur),__vite__mapDeps([0,1])))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.lr),__vite__mapDeps([0,1])))},{id:`dotenv`,name:`dotEnv`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.cr),__vite__mapDeps([0,1])))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.sr),__vite__mapDeps([0,1])))},{id:`edge`,name:`Edge`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.or),__vite__mapDeps([0,1])))},{id:`elixir`,name:`Elixir`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ar),__vite__mapDeps([0,1])))},{id:`elm`,name:`Elm`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ir),__vite__mapDeps([0,1])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.rr),__vite__mapDeps([0,1])))},{id:`erb`,name:`ERB`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Xn),__vite__mapDeps([0,1])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Jn),__vite__mapDeps([0,1])))},{id:`fennel`,name:`Fennel`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.qn),__vite__mapDeps([0,1])))},{id:`fish`,name:`Fish`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Kn),__vite__mapDeps([0,1])))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Gn),__vite__mapDeps([0,1])))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Un),__vite__mapDeps([0,1])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Wn),__vite__mapDeps([0,1])))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Hn),__vite__mapDeps([0,1])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.zn),__vite__mapDeps([0,1])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Bn),__vite__mapDeps([0,1])))},{id:`gdshader`,name:`GDShader`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Vn),__vite__mapDeps([0,1])))},{id:`genie`,name:`Genie`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Rn),__vite__mapDeps([0,1])))},{id:`gherkin`,name:`Gherkin`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ln),__vite__mapDeps([0,1])))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.In),__vite__mapDeps([0,1])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Fn),__vite__mapDeps([0,1])))},{id:`gleam`,name:`Gleam`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Pn),__vite__mapDeps([0,1])))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Nn),__vite__mapDeps([0,1])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Mn),__vite__mapDeps([0,1])))},{id:`glsl`,name:`GLSL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Sr),__vite__mapDeps([0,1])))},{id:`gn`,name:`GN`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.jn),__vite__mapDeps([0,1])))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.An),__vite__mapDeps([0,1])))},{id:`go`,name:`Go`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.kn),__vite__mapDeps([0,1])))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.er),__vite__mapDeps([0,1])))},{id:`groovy`,name:`Groovy`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.On),__vite__mapDeps([0,1])))},{id:`hack`,name:`Hack`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Dn),__vite__mapDeps([0,1])))},{id:`haml`,name:`Ruby Haml`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.nr),__vite__mapDeps([0,1])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.En),__vite__mapDeps([0,1])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Tn),__vite__mapDeps([0,1])))},{id:`haxe`,name:`Haxe`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.wn),__vite__mapDeps([0,1])))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Cn),__vite__mapDeps([0,1])))},{id:`hjson`,name:`Hjson`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Sn),__vite__mapDeps([0,1])))},{id:`hlsl`,name:`HLSL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.xn),__vite__mapDeps([0,1])))},{id:`html`,name:`HTML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.mi),__vite__mapDeps([0,1])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Hr),__vite__mapDeps([0,1])))},{id:`http`,name:`HTTP`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.bn),__vite__mapDeps([0,1])))},{id:`hurl`,name:`Hurl`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.yn),__vite__mapDeps([0,1])))},{id:`hxml`,name:`HXML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.vn),__vite__mapDeps([0,1])))},{id:`hy`,name:`Hy`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e._n),__vite__mapDeps([0,1])))},{id:`imba`,name:`Imba`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.gn),__vite__mapDeps([0,1])))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.hn),__vite__mapDeps([0,1])))},{id:`java`,name:`Java`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ci),__vite__mapDeps([0,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.gi),__vite__mapDeps([0,1])))},{id:`jinja`,name:`Jinja`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.mn),__vite__mapDeps([0,1])))},{id:`jison`,name:`Jison`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.pn),__vite__mapDeps([0,1])))},{id:`json`,name:`JSON`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.oi),__vite__mapDeps([0,1])))},{id:`json5`,name:`JSON5`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.fn),__vite__mapDeps([0,1])))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.dn),__vite__mapDeps([0,1])))},{id:`jsonl`,name:`JSON Lines`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.un),__vite__mapDeps([0,1])))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ln),__vite__mapDeps([0,1])))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.cn),__vite__mapDeps([0,1])))},{id:`jsx`,name:`JSX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.tr),__vite__mapDeps([0,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.on),__vite__mapDeps([0,1])))},{id:`just`,name:`Just`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.in),__vite__mapDeps([0,1])))},{id:`kdl`,name:`KDL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.rn),__vite__mapDeps([0,1])))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.nn),__vite__mapDeps([0,1])))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.tn),__vite__mapDeps([0,1])))},{id:`latex`,name:`LaTeX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.$t),__vite__mapDeps([0,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Qt),__vite__mapDeps([0,1])))},{id:`less`,name:`Less`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Zt),__vite__mapDeps([0,1])))},{id:`liquid`,name:`Liquid`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Xt),__vite__mapDeps([0,1])))},{id:`llvm`,name:`LLVM IR`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Yt),__vite__mapDeps([0,1])))},{id:`log`,name:`Log file`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Jt),__vite__mapDeps([0,1])))},{id:`logo`,name:`Logo`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.qt),__vite__mapDeps([0,1])))},{id:`lua`,name:`Lua`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.$n),__vite__mapDeps([0,1])))},{id:`luau`,name:`Luau`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Kt),__vite__mapDeps([0,1])))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Gt),__vite__mapDeps([0,1])))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Yn),__vite__mapDeps([0,1])))},{id:`marko`,name:`Marko`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Wt),__vite__mapDeps([0,1])))},{id:`matlab`,name:`MATLAB`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ut),__vite__mapDeps([0,1])))},{id:`mdc`,name:`MDC`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ht),__vite__mapDeps([0,1])))},{id:`mdx`,name:`MDX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Vt),__vite__mapDeps([0,1])))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Bt),__vite__mapDeps([0,1])))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.zt),__vite__mapDeps([0,1])))},{id:`mojo`,name:`Mojo`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Rt),__vite__mapDeps([0,1])))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Lt),__vite__mapDeps([0,1])))},{id:`move`,name:`Move`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.It),__vite__mapDeps([0,1])))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ft),__vite__mapDeps([0,1])))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Nt),__vite__mapDeps([0,1])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Pt),__vite__mapDeps([0,1])))},{id:`nginx`,name:`Nginx`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Mt),__vite__mapDeps([0,1])))},{id:`nim`,name:`Nim`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.jt),__vite__mapDeps([0,1])))},{id:`nix`,name:`Nix`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.At),__vite__mapDeps([0,1])))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.kt),__vite__mapDeps([0,1])))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ot),__vite__mapDeps([0,1])))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Dt),__vite__mapDeps([0,1])))},{id:`ocaml`,name:`OCaml`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Et),__vite__mapDeps([0,1])))},{id:`odin`,name:`Odin`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Tt),__vite__mapDeps([0,1])))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.wt),__vite__mapDeps([0,1])))},{id:`pascal`,name:`Pascal`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Ct),__vite__mapDeps([0,1])))},{id:`perl`,name:`Perl`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.an),__vite__mapDeps([0,1])))},{id:`php`,name:`PHP`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.St),__vite__mapDeps([0,1])))},{id:`pkl`,name:`Pkl`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.xt),__vite__mapDeps([0,1])))},{id:`plsql`,name:`PL/SQL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.bt),__vite__mapDeps([0,1])))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.yt),__vite__mapDeps([0,1])))},{id:`polar`,name:`Polar`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.vt),__vite__mapDeps([0,1])))},{id:`postcss`,name:`PostCSS`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.$r),__vite__mapDeps([0,1])))},{id:`powerquery`,name:`PowerQuery`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e._t),__vite__mapDeps([0,1])))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.gt),__vite__mapDeps([0,1])))},{id:`prisma`,name:`Prisma`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ht),__vite__mapDeps([0,1])))},{id:`prolog`,name:`Prolog`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.mt),__vite__mapDeps([0,1])))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.pt),__vite__mapDeps([0,1])))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ft),__vite__mapDeps([0,1])))},{id:`puppet`,name:`Puppet`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.dt),__vite__mapDeps([0,1])))},{id:`purescript`,name:`PureScript`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ut),__vite__mapDeps([0,1])))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Pr),__vite__mapDeps([0,1])))},{id:`qml`,name:`QML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.lt),__vite__mapDeps([0,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ct),__vite__mapDeps([0,1])))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.st),__vite__mapDeps([0,1])))},{id:`r`,name:`R`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.sn),__vite__mapDeps([0,1])))},{id:`racket`,name:`Racket`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ot),__vite__mapDeps([0,1])))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.at),__vite__mapDeps([0,1])))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.it),__vite__mapDeps([0,1])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.rt),__vite__mapDeps([0,1])))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Cr),__vite__mapDeps([0,1])))},{id:`rel`,name:`Rel`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.nt),__vite__mapDeps([0,1])))},{id:`riscv`,name:`RISC-V`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.tt),__vite__mapDeps([0,1])))},{id:`ron`,name:`RON`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.et),__vite__mapDeps([0,1])))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.$),__vite__mapDeps([0,1])))},{id:`rst`,name:`reStructuredText`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Q),__vite__mapDeps([0,1])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Zn),__vite__mapDeps([0,1])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Z),__vite__mapDeps([0,1])))},{id:`sas`,name:`SAS`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.X),__vite__mapDeps([0,1])))},{id:`sass`,name:`Sass`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Y),__vite__mapDeps([0,1])))},{id:`scala`,name:`Scala`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.J),__vite__mapDeps([0,1])))},{id:`scheme`,name:`Scheme`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.q),__vite__mapDeps([0,1])))},{id:`scss`,name:`SCSS`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.fi),__vite__mapDeps([0,1])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.zr),__vite__mapDeps([0,1])))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.K),__vite__mapDeps([0,1])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.br),__vite__mapDeps([0,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.G),__vite__mapDeps([0,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.W),__vite__mapDeps([0,1])))},{id:`solidity`,name:`Solidity`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.U),__vite__mapDeps([0,1])))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.H),__vite__mapDeps([0,1])))},{id:`sparql`,name:`SPARQL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.B),__vite__mapDeps([0,1])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.z),__vite__mapDeps([0,1])))},{id:`sql`,name:`SQL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Vr),__vite__mapDeps([0,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.R),__vite__mapDeps([0,1])))},{id:`stata`,name:`Stata`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.L),__vite__mapDeps([0,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.I),__vite__mapDeps([0,1])))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.F),__vite__mapDeps([0,1])))},{id:`svelte`,name:`Svelte`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.P),__vite__mapDeps([0,1])))},{id:`swift`,name:`Swift`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.N),__vite__mapDeps([0,1])))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.M),__vite__mapDeps([0,1])))},{id:`systemd`,name:`Systemd Units`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.j),__vite__mapDeps([0,1])))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.A),__vite__mapDeps([0,1])))},{id:`tasl`,name:`Tasl`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.k),__vite__mapDeps([0,1])))},{id:`tcl`,name:`Tcl`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.O),__vite__mapDeps([0,1])))},{id:`templ`,name:`Templ`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.D),__vite__mapDeps([0,1])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.E),__vite__mapDeps([0,1])))},{id:`tex`,name:`TeX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.en),__vite__mapDeps([0,1])))},{id:`toml`,name:`TOML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.T),__vite__mapDeps([0,1])))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.w),__vite__mapDeps([0,1])))},{id:`tsv`,name:`TSV`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.C),__vite__mapDeps([0,1])))},{id:`tsx`,name:`TSX`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Qr),__vite__mapDeps([0,1])))},{id:`turtle`,name:`Turtle`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.V),__vite__mapDeps([0,1])))},{id:`twig`,name:`Twig`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.S),__vite__mapDeps([0,1])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.ei),__vite__mapDeps([0,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.x),__vite__mapDeps([0,1])))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.b),__vite__mapDeps([0,1])))},{id:`v`,name:`V`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.y),__vite__mapDeps([0,1])))},{id:`vala`,name:`Vala`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.v),__vite__mapDeps([0,1])))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e._),__vite__mapDeps([0,1])))},{id:`verilog`,name:`Verilog`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.g),__vite__mapDeps([0,1])))},{id:`vhdl`,name:`VHDL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.h),__vite__mapDeps([0,1])))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.m),__vite__mapDeps([0,1])))},{id:`vue`,name:`Vue`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.d),__vite__mapDeps([0,1])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.p),__vite__mapDeps([0,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.f),__vite__mapDeps([0,1])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.u),__vite__mapDeps([0,1])))},{id:`wasm`,name:`WebAssembly`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.l),__vite__mapDeps([0,1])))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.c),__vite__mapDeps([0,1])))},{id:`wgsl`,name:`WGSL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.s),__vite__mapDeps([0,1])))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.o),__vite__mapDeps([0,1])))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.a),__vite__mapDeps([0,1])))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.i),__vite__mapDeps([0,1])))},{id:`xml`,name:`XML`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.si),__vite__mapDeps([0,1])))},{id:`xsl`,name:`XSL`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.r),__vite__mapDeps([0,1])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.Qn),__vite__mapDeps([0,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.n),__vite__mapDeps([0,1])))},{id:`zig`,name:`Zig`,import:(()=>r(()=>import(`./vendor-shikijs-langs-eloENL-7.js`).then(e=>e.t),__vite__mapDeps([0,1])))}],zr=Object.fromEntries(Rr.map(e=>[e.id,e.import])),Br=Object.fromEntries(Rr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Vr={...zr,...Br},Hr=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.dt),__vite__mapDeps([2,1])))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ut),__vite__mapDeps([2,1])))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.lt),__vite__mapDeps([2,1])))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ct),__vite__mapDeps([2,1])))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.st),__vite__mapDeps([2,1])))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ot),__vite__mapDeps([2,1])))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.at),__vite__mapDeps([2,1])))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.it),__vite__mapDeps([2,1])))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.rt),__vite__mapDeps([2,1])))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.nt),__vite__mapDeps([2,1])))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.et),__vite__mapDeps([2,1])))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.tt),__vite__mapDeps([2,1])))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.$),__vite__mapDeps([2,1])))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Q),__vite__mapDeps([2,1])))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.J),__vite__mapDeps([2,1])))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Z),__vite__mapDeps([2,1])))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.X),__vite__mapDeps([2,1])))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Y),__vite__mapDeps([2,1])))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.G),__vite__mapDeps([2,1])))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.q),__vite__mapDeps([2,1])))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.K),__vite__mapDeps([2,1])))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.W),__vite__mapDeps([2,1])))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.U),__vite__mapDeps([2,1])))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.H),__vite__mapDeps([2,1])))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.V),__vite__mapDeps([2,1])))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.B),__vite__mapDeps([2,1])))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.z),__vite__mapDeps([2,1])))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.L),__vite__mapDeps([2,1])))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.R),__vite__mapDeps([2,1])))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.I),__vite__mapDeps([2,1])))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.F),__vite__mapDeps([2,1])))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.P),__vite__mapDeps([2,1])))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.N),__vite__mapDeps([2,1])))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.M),__vite__mapDeps([2,1])))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.j),__vite__mapDeps([2,1])))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.E),__vite__mapDeps([2,1])))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.A),__vite__mapDeps([2,1])))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.k),__vite__mapDeps([2,1])))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.O),__vite__mapDeps([2,1])))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.D),__vite__mapDeps([2,1])))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.T),__vite__mapDeps([2,1])))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.w),__vite__mapDeps([2,1])))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.C),__vite__mapDeps([2,1])))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.x),__vite__mapDeps([2,1])))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.S),__vite__mapDeps([2,1])))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.b),__vite__mapDeps([2,1])))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.y),__vite__mapDeps([2,1])))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.v),__vite__mapDeps([2,1])))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e._),__vite__mapDeps([2,1])))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.g),__vite__mapDeps([2,1])))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.h),__vite__mapDeps([2,1])))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.f),__vite__mapDeps([2,1])))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.m),__vite__mapDeps([2,1])))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.p),__vite__mapDeps([2,1])))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.d),__vite__mapDeps([2,1])))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.u),__vite__mapDeps([2,1])))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.l),__vite__mapDeps([2,1])))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.c),__vite__mapDeps([2,1])))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.s),__vite__mapDeps([2,1])))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.o),__vite__mapDeps([2,1])))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.a),__vite__mapDeps([2,1])))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.i),__vite__mapDeps([2,1])))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.r),__vite__mapDeps([2,1])))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.n),__vite__mapDeps([2,1])))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.t),__vite__mapDeps([2,1])))}].map(e=>[e.id,e.import])),Ur=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Wr(){return 2147483648}function Gr(){return typeof performance<`u`?performance.now():Date.now()}var Kr=(e,t)=>e+(t-e%t)%t;async function qr(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Wr();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Kr(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Gr,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Jr=Object.defineProperty,Yr=(e,t,n)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t,n)=>Yr(e,typeof t==`symbol`?t:t+``,n),B=null;function Xr(e){throw new Ur(e.UTF8ToString(e.getLastOnigError()))}var Zr=class e{constructor(t){z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16Value`),z(this,`utf8Value`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Qr=class e{constructor(t){if(z(this,`id`,++e.LAST_ID),z(this,`_onigBinding`),z(this,`content`),z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`),z(this,`ptr`),!B)throw new Ur(`Must invoke loadWasm first.`);this._onigBinding=B,this.content=t;let n=new Zr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=B.omalloc(1e4),e._sharedPtrInUse=!0,B.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(B)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};z(Qr,`LAST_ID`,0),z(Qr,`_sharedPtr`,0),z(Qr,`_sharedPtrInUse`,!1);var $r=Qr,ei=class{constructor(e){if(z(this,`_onigBinding`),z(this,`_ptr`),!B)throw new Ur(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Zr(e[r]);t[r]=i.createString(B),n[r]=i.utf8Length}let r=B.omalloc(4*e.length);B.HEAPU32.set(t,r/4);let i=B.omalloc(4*e.length);B.HEAPU32.set(n,i/4);let a=B.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)B.ofree(t[n]);B.ofree(i),B.ofree(r),a===0&&Xr(B),this._onigBinding=B,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new $r(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function ti(e){return typeof e.instantiator==`function`}function ni(e){return typeof e.default==`function`}function ri(e){return e.data!==void 0}function ii(e){return typeof Response<`u`&&e instanceof Response}function ai(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var oi;function si(e){if(oi)return oi;async function t(){B=await qr(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),ti(n)?n=await n.instantiator(t):ni(n)?n=await n.default(t):(ri(n)&&(n=n.data),ii(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await li(n)(t):await ui(n)(t):ai(n)||n instanceof WebAssembly.Module?n=await ci(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await ci(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oi=t(),oi}function ci(e){return t=>WebAssembly.instantiate(e,t)}function li(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ui(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function di(e){return e&&await si(e),{createScanner(e){return new ei(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $r(e)}}}var fi=Fr({langs:Vr,themes:Hr,engine:()=>di(r(()=>import(`./vendor-shiki-DzFPeSWm.js`).then(e=>e.t),__vite__mapDeps([3,1])))}),{codeToHtml:pi,codeToHast:mi,codeToTokens:hi,codeToTokensBase:gi,codeToTokensWithThemes:_i,getSingletonHighlighter:vi,getLastGrammarState:yi}=Lr(fi,{guessEmbeddedLanguages:Sn}),bi=4294967295,xi=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:bi,end:bi,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Si(e,t){return a(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Ci(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>Si(e,{target:t.target}),{createScanner(e){return new xi(e,t)},createString(e){return{content:e}}}}async function wi(e){if(ke())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Te.get(e);if(t!=null)return t;try{let t=Ee.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(Vr,e)&&(t=Vr[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return we.has(e)||we.set(e,n),n});return Te.set(e,n),await n}finally{Te.delete(e)}}function Ti(e){return we.get(e)??wi(e)}function Ei({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Di(t)}}function Di(e){return async()=>Sr(ve(await e()))}var Oi=`pierre`,ki=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Ai=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],ji=[...Ai,...ki],Mi=new Set(Ai);function Ni(e){return Mi.has(e)?`light`:`dark`}var Pi={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},Fi={"pierre-dark":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.o),__vite__mapDeps([4,1])),"pierre-dark-soft":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.l),__vite__mapDeps([4,1])),"pierre-dark-vibrant":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.s),__vite__mapDeps([4,1])),"pierre-dark-protanopia-deuteranopia":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.u),__vite__mapDeps([4,1])),"pierre-dark-tritanopia":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.c),__vite__mapDeps([4,1])),"pierre-light":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.t),__vite__mapDeps([4,1])),"pierre-light-soft":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.i),__vite__mapDeps([4,1])),"pierre-light-vibrant":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.n),__vite__mapDeps([4,1])),"pierre-light-protanopia-deuteranopia":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.a),__vite__mapDeps([4,1])),"pierre-light-tritanopia":()=>r(()=>import(`./vendor-pierre-theme-F9vQJHIe.js`).then(e=>e.r),__vite__mapDeps([4,1]))};function Ii(e){return Ei({name:e,collection:Oi,colorScheme:Ni(e),displayName:Pi[e],load:Fi[e]})}var Li=pe({themes:ji.map(e=>Ii(e))}),Ri=`shiki`,zi=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],Bi=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),Vi=new Set(zi);function Hi(e){return Vi.has(e)?`light`:`dark`}var Ui={andromeeda:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.dt),__vite__mapDeps([2,1])),"aurora-x":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ut),__vite__mapDeps([2,1])),"ayu-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.lt),__vite__mapDeps([2,1])),"ayu-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ct),__vite__mapDeps([2,1])),"ayu-mirage":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.st),__vite__mapDeps([2,1])),"catppuccin-frappe":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.ot),__vite__mapDeps([2,1])),"catppuccin-latte":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.at),__vite__mapDeps([2,1])),"catppuccin-macchiato":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.it),__vite__mapDeps([2,1])),"catppuccin-mocha":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.rt),__vite__mapDeps([2,1])),"dark-plus":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.nt),__vite__mapDeps([2,1])),dracula:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.et),__vite__mapDeps([2,1])),"dracula-soft":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.tt),__vite__mapDeps([2,1])),"everforest-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.$),__vite__mapDeps([2,1])),"everforest-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Q),__vite__mapDeps([2,1])),"github-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.J),__vite__mapDeps([2,1])),"github-dark-default":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Z),__vite__mapDeps([2,1])),"github-dark-dimmed":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.X),__vite__mapDeps([2,1])),"github-dark-high-contrast":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.Y),__vite__mapDeps([2,1])),"github-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.G),__vite__mapDeps([2,1])),"github-light-default":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.q),__vite__mapDeps([2,1])),"github-light-high-contrast":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.K),__vite__mapDeps([2,1])),"gruvbox-dark-hard":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.W),__vite__mapDeps([2,1])),"gruvbox-dark-medium":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.U),__vite__mapDeps([2,1])),"gruvbox-dark-soft":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.H),__vite__mapDeps([2,1])),"gruvbox-light-hard":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.V),__vite__mapDeps([2,1])),"gruvbox-light-medium":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.B),__vite__mapDeps([2,1])),"gruvbox-light-soft":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.z),__vite__mapDeps([2,1])),horizon:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.L),__vite__mapDeps([2,1])),"horizon-bright":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.R),__vite__mapDeps([2,1])),houston:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.I),__vite__mapDeps([2,1])),"kanagawa-dragon":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.F),__vite__mapDeps([2,1])),"kanagawa-lotus":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.P),__vite__mapDeps([2,1])),"kanagawa-wave":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.N),__vite__mapDeps([2,1])),laserwave:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.M),__vite__mapDeps([2,1])),"light-plus":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.j),__vite__mapDeps([2,1])),"material-theme":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.E),__vite__mapDeps([2,1])),"material-theme-darker":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.A),__vite__mapDeps([2,1])),"material-theme-lighter":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.k),__vite__mapDeps([2,1])),"material-theme-ocean":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.O),__vite__mapDeps([2,1])),"material-theme-palenight":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.D),__vite__mapDeps([2,1])),"min-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.T),__vite__mapDeps([2,1])),"min-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.w),__vite__mapDeps([2,1])),monokai:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.C),__vite__mapDeps([2,1])),"night-owl":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.x),__vite__mapDeps([2,1])),"night-owl-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.S),__vite__mapDeps([2,1])),nord:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.b),__vite__mapDeps([2,1])),"one-dark-pro":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.y),__vite__mapDeps([2,1])),"one-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.v),__vite__mapDeps([2,1])),plastic:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e._),__vite__mapDeps([2,1])),poimandres:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.g),__vite__mapDeps([2,1])),red:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.h),__vite__mapDeps([2,1])),"rose-pine":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.f),__vite__mapDeps([2,1])),"rose-pine-dawn":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.m),__vite__mapDeps([2,1])),"rose-pine-moon":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.p),__vite__mapDeps([2,1])),"slack-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.d),__vite__mapDeps([2,1])),"slack-ochin":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.u),__vite__mapDeps([2,1])),"snazzy-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.l),__vite__mapDeps([2,1])),"solarized-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.c),__vite__mapDeps([2,1])),"solarized-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.s),__vite__mapDeps([2,1])),"synthwave-84":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.o),__vite__mapDeps([2,1])),"tokyo-night":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.a),__vite__mapDeps([2,1])),vesper:()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.i),__vite__mapDeps([2,1])),"vitesse-black":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.r),__vite__mapDeps([2,1])),"vitesse-dark":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.n),__vite__mapDeps([2,1])),"vitesse-light":()=>r(()=>import(`./vendor-shikijs-themes-C7F1vBnG.js`).then(e=>e.t),__vite__mapDeps([2,1]))};function Wi(e){return Ei({name:e,collection:Ri,colorScheme:Hi(e),load:Ui[e]})}var Gi=pe({themes:Object.freeze([...zi.map(e=>Wi(e)),...Bi.map(e=>Wi(e))])});function Ki(e){if(ke())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(I.hasRegisteredTheme(e))return;let t=Gi.getTheme(e);if(t!=null){I.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function qi(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Ji(e){Ki(e);let t=await I.resolveTheme(e);return qi(e,t),t}function Yi(e){return I.getResolvedTheme(e)??Ji(e)}var V;async function Xi({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){V??=fi({themes:[],langs:[`text`],engine:n===`shiki-wasm`?di(r(()=>import(`./vendor-shiki-DzFPeSWm.js`).then(e=>e.t),__vite__mapDeps([3,1]))):Ci()});let i=Qi(V)?await V:V;V=i;let a=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Ti(e);`then`in t?a.push(t):Oe(t,i)}let o=[];for(let t of e){let e=Yi(t);`then`in e?o.push(e):Ce(e,V)}return(a.length>0||o.length>0)&&await Promise.all([Promise.all(a).then(e=>{Oe(e,i)}),Promise.all(o).then(e=>{Ce(e,i)})]),i}function Zi(){if(V!=null&&!(`then`in V))return V}function Qi(e=V){return e!=null&&`then`in e}for(let e of Li.getThemes())I.registerThemeIfAbsent(e.name,e.load);function $i(e=E){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function ea(e){return I.hasResolvedThemes(e)}function ta(e,t){return de(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}var na=new Map,ra=0,ia={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function H(e){if(na.has(e))return na.get(e)??`text`;if(ia[e]!=null)return ia[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(na.has(t[1]))return na.get(t[1])??`text`;if(ia[t[1]]!=null)return ia[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return na.has(n)?na.get(n)??`text`:ia[n]??`text`}function aa(){return ra}function oa(){return Object.fromEntries(na)}function sa(e){return(e.lang??H(e.name))===`text`}var ca=10,la=13;function ua(e){let t=[0];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===ca||r===la)&&(r===la&&n+1<e.length&&e.charCodeAt(n+1)===ca&&n++,t.push(n+1))}return t}function da(e){let t=ua(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}function U(e){return{type:`text`,value:e}}function W({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function fa({name:e,width:t=16,height:n=16,properties:r}){return W({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[W({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function pa(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function ma(e){return W({tagName:`div`,properties:{"data-gutter":``},children:e})}function ha(e,t,n,r={}){return W({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[W({tagName:`span`,properties:{"data-line-number-content":``},children:[U(`${t}`)]})]})}function G(e,t,n){return W({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function ga(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(U(`
|
|
6
|
-
`)),e}var _a=Symbol(`no-token`),va=Symbol(`multiple-tokens`);function ya(e){let t=ba(e);if(t!=null)return t;let n=_a,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Sa(e,a);for(let t of e.children)xa(t)}else xa(e);r.push(e),i=[],a=void 0;return}for(let e of i)xa(e);r.push(W({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==_a){if(e===va){n=va;return}if(n===_a){n=e;return}n!==e&&(n=va)}};for(let t of e.children){let e=t.type===`element`?ya(t):_a;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function ba(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function xa(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)xa(t)}}function Sa(e,t){e.properties[`data-char`]=t}function Ca(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+wa(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function wa(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Ta(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=pa(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&ya(a),i.push(ga(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Da,Ea),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Ea}}var Ea=Ca({classPrefix:`hl-`}),Da={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function K(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Oa=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,ka=/^0(?:\.0+)?%?$/;function Aa(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function ja(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Ma(e){if(e==null)return null;let t=ja(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Na(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Oa.test(t))return!0;let n=Aa(t);return n!=null&&ka.test(n)}function Pa(e,t,n){if(t==null||n==null)return!1;let r=Ma(e),i=Ma(t),a=Ma(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Fa=new WeakMap;function Ia(e){let t=Fa.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;q(r,`editor.background`,i),q(r,`editor.foreground`,a),q(r,`sideBar.background`,o),q(r,`sideBar.foreground`,s),q(r,`input.background`,n[`input.background`]??o),q(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),q(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),q(r,`gitDecoration.addedResourceForeground`,La(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),q(r,`gitDecoration.modifiedResourceForeground`,La(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),q(r,`gitDecoration.deletedResourceForeground`,La(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Na(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Na(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(Ra(l,o)||Pa(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Fa.set(e,u),u}function q(e,t,n){n!=null&&n!==``&&(e[t]=n)}function La(...e){for(let t of e)if(t!=null&&t!==``)return t}function Ra(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function za({theme:e=E,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=Ia(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${K(`global`)}fg:${a.fg};`,r+=`${K(`global`)}bg:${a.bg};`,r+=Ba(i,n)}else{let n=t.getTheme(e.dark),i=Ia(n);r+=`${K(`global`)}dark:${i.fg};`,r+=`${K(`global`)}dark-bg:${i.bg};`,r+=Ba(n,`dark`),n=t.getTheme(e.light),i=Ia(n),r+=`${K(`global`)}light:${i.fg};`,r+=`${K(`global`)}light-bg:${i.bg};`,r+=Ba(n,`light`)}return r}function Ba(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${K(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${K(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${K(`global`)}${t}modified-color:${a};`),n}function Va(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}var Ha={forcePlainText:!1};function Ua(e,t,{theme:n=E,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=Ha){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=Ta(i),f=a?`text`:e.lang??H(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=za({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:K(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:K(`token`),tokenizeMaxLineLength:r,tokenizeTimeLimit:0},g=Va(t.codeToHast(l?Wa(c??da(e.contents),o,s):e.contents,h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function Wa(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length);return e.slice(t,r).join(``)}function Ga(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function J(e,t){return de(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Ka(e){let t=e.lang??H(e.name),n=e.lang??(e.prevName==null?`text`:H(e.prevName));return t===`text`&&n===`text`}function qa(e){return{...j,...e}}function Y(e,t){let n=Ja(e,t);return t?n:e.diffHeaderHeight+n}function Ja(e,t){return e.paddingTop??(t?e.spacing:0)}function Ya(e){return e.paddingBottom??e.spacing}function Xa(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function Za({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function Qa(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),r=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);return n<=0&&r<=0?!1:n!==r}function $a({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function eo({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=$a({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function to({type:e,metrics:t}){return t.hunkSeparatorHeight??Xa(e)}function no({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function ro({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function io(e){return e!==`simple`&&e!==`metadata`}function ao({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!ro({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=to({type:e,metrics:t}),a=no({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function oo({type:e,metrics:t}){if(!io(e))return;let n=to({type:e,metrics:t}),r=no({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function so({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=co({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=c.unifiedCount+e<n,a=c.splitCount+r<n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=Za({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),s=n===c.finalHunkIndex?eo({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,l=o.fromStart+o.fromEnd;function u(e,n){return s==null||s.collapsedLines<=0||s.fromStart+s.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?s.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?s.collapsedLines:0}let d=o.collapsedLines===0;function f(){return d?0:(d=!0,o.collapsedLines)}if(c.shouldSkip(l,l))c.incrementCounts(l,l),f();else{let e=r.unifiedLineStart-o.rangeSize,i=r.splitLineStart-o.rangeSize,a=r.deletionLineIndex-o.rangeSize,s=r.additionLineIndex-o.rangeSize,l=r.deletionStart-o.rangeSize,u=r.additionStart-o.rangeSize;if(fo(c,o.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-o.fromEnd,i=r.splitLineStart-o.fromEnd,a=r.deletionLineIndex-o.fromEnd,s=r.additionLineIndex-o.fromEnd,l=r.deletionStart-o.fromEnd,u=r.additionStart-o.fromEnd,fo(c,o.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}),()=>{f()})))break hunkIterator}let p=r.unifiedLineStart,m=r.splitLineStart,h=r.deletionLineIndex,g=r.additionLineIndex,_=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===y;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),f();else if(fo(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=p+t,s=m+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:u(o,s),type:`context`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:g+t,lineNumber:v+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{f()}))break hunkIterator;p+=e.lines,m+=e.lines,h+=e.lines,g+=e.lines,_+=e.lines,v+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=po(c,e,t);(s[0]?.[0]??0)>0&&f();for(let[l,d]of s)for(let s=l;s<d;s++){let l=u(p+s,t===`unified`?m+(s<e.deletions?s:s-e.deletions):m+s);if(c.emit(mo({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:p,splitLineIndex:m,additionLineIndex:g,deletionLineIndex:h,additionLineNumber:v,deletionLineNumber:_,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}f(),c.incrementCounts(o,a),p+=o,m+=a,h+=e.deletions,g+=e.additions,_+=e.deletions,v+=e.additions}}if(s!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=s,a=r+i;if(fo(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:!1,unifiedLineIndex:p+t,splitLineIndex:m+t},additionLine:{unifiedLineIndex:p+t,splitLineIndex:m+t,lineIndex:g+t,lineNumber:v+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function co({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=lo({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function lo({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=Za({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?eo({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function uo(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function fo(e,t,n,r,i,a){let[o,s]=uo(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function po(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function mo({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}function X(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}function ho({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function go({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}var _o={forcePlainText:!1};function vo(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=_o){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=za({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??bo();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}so({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&yo({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=xo({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function yo({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:c,maxLineDiffLength:l}){if(e==null||t==null||c===`none`||(e=X(e),t=X(t),e.length>l||t.length>l))return;let u=c===`char`?s(e,t):o(e,t),d=[],f=[],p=c===`word-alt`,m=u.at(-1);for(let e of u){let t=e===m;!e.added&&!e.removed?(go({item:e,arr:d,enableJoin:p,isNeutral:!0,isLastItem:t}),go({item:e,arr:f,enableJoin:p,isNeutral:!0,isLastItem:t})):e.removed?go({item:e,arr:d,enableJoin:p,isLastItem:t}):go({item:e,arr:f,enableJoin:p,isLastItem:t})}let h=0;for(let e of d)e[0]===1&&i.push(ho({line:n,spanStart:h,spanLength:e[1].length})),h+=e[1].length;h=0;for(let e of f)e[0]===1&&a.push(ho({line:r,spanStart:h,spanLength:e[1].length})),h+=e[1].length}function bo(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function xo({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=E,...l}}){let u=s??H(e.name),d=s??H(t.name),{state:f,transformers:p}=Ta(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:K(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:K(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,Va(i.codeToHast(X(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,Va(i.codeToHast(X(t.contents),m)))}}function So(e){let t=[];for(let n of e){let e=we.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function Co(e){for(let t of Array.isArray(e)?e:[e])if(!we.has(t))return!1;return!0}async function wo(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=Ti(r)??wi(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function To(e){return I.getResolvedThemes(e)}async function Eo(e){for(let t of e)Ki(t);let t=await I.resolveThemes(e);for(let n=0;n<e.length;n++)qi(e[n],t[n]);return t}var Do=e(l(),1),Oo=Symbol(`IGNORE_RESPONSE`),ko=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},Ao=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=E,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new Do.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Do.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??E,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||J(a,this.renderOptions))return;let o=$i(e),c=[];if(de(a.theme,this.renderOptions.theme)||(c=ea(o)?To(o):await Eo(o)),!s())return;if(this.highlighter!=null)Ce(c,this.highlighter);else{let e=await Xi({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof ko||!s())return;throw e}}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);No(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=$i(this.renderOptions.theme),i=[];if(i=ea(r)?To(r):await Eo(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=Co(e)?So(e):await wo(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([Xi({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof ko||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=aa(),i=r>0?oa():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>console.error(`Worker error:`,e,o)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};this.activeTaskById.set(s,c),this.executeTask(o,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,this.initialized===!0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=Mo(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);sa(t)||n!=null&&ta(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||sa(e)||t!=null&&ta(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`file`,file:e},n):r.primeCache=!0}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return Ua(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);Ka(t)||n!=null&&J(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Ka(e)||t!=null&&J(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`diff`,diff:e},n):r.primeCache=!0}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:vo(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new ko;for(let t of this.activeTaskById.values())`reject`in t&&t.reject(e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r}}})();this.enqueueRenderTask(a)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(t=>!e.langs.has(t));if(r.length>0&&(Co(r)?t.request.resolvedLanguages=So(r):t.request.resolvedLanguages=await wo(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw Oo;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(No(n))this.notifyHighlightError(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!ta(i,this.getFileRenderOptions()))throw Oo;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.file.cacheKey!=null&&this.fileCache.set(a.file.cacheKey,{result:r,options:i}),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!J(i,this.getDiffRenderOptions()))throw Oo;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.diff.cacheKey!=null&&this.diffCache.set(a.diff.cacheKey,{result:r,options:i}),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==Oo&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,No(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(No(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){jo(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of Mo(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),No(t)?this.notifyHighlightError(t,n):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=aa();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=oa())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of Po(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))No(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of Po(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of Po(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of Po(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of Po(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&F(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Ga(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())No(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function jo(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function Mo(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??H(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??H(e.request.diff.name)),t.add(e.request.diff.lang??H(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function No(e){return e?.type===`file`||e?.type===`diff`}function Po(e){return e.instances}var Fo=(0,N.createContext)(void 0);function Io(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 Lo(e,t){let n=e?.theme??E,r=t?.theme??E,i=Ro(e),a=Ro(t);return de(n,r)&&Io(e,t,[`theme`,`parseDiffOptions`])&&Io(i,a)}function Ro(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var zo=new Set,Bo=null;function Z(e){zo.add(e),Bo??=requestAnimationFrame(Vo)}function Vo(e){let t=new Set(zo);zo.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}Bo=zo.size>0?requestAnimationFrame(Vo):null}function Ho(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Uo({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Wo(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}var Go=`-1,-1`;function Ko(e){return e?.some(e=>e.lineNumber===0)??!1}function qo(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Jo(e){return e.startingLine===0&&e.totalLines>0}function Yo(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Xo(){return W({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[fa({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}var Zo=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||Ho(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&&ms(e.composedPath())||(Q(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||(Q(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(Q(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){Q(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();Q(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Q(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=ns(i)&&this.hoveredLine?.lineElement===i.lineElement;ts(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),ts(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ns(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(is(i)&&p!=null){p(i);break}if(rs(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!ns(i))break;ts(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,Q(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})()),Q(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Q(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();ms(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;e.preventDefault();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(Yo(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=i(Xo());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);es(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(ss(t));if(es(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(es(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(es(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&&ms(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=ss(e);if(t&&ms(n))return;let r=cs(e);return r==null?this.pathFromAnnotationSlot(e):ss(r)}pathFromAnnotationSlot(e){let t=us(ls(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:ss(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=ds(t)?t:ds(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)}Ho(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);as(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=ps(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=ps(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:os(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:os(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:fs(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:fs(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 Qo({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:$o({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 $o({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 es(e){return e!=null&&`kind`in e&&e.kind===`line`}function ts(e){return e!=null&&`kind`in e&&e.kind===`token`}function ns(e){return es(e)||ts(e)}function rs(e){return`type`in e&&e.type===`line-info`}function is(e){return`kind`in e&&e.kind===`merge-conflict-action`}function as(e){return e===`current`||e===`incoming`||e===`both`}function os(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function ss(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function cs(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 ls(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 us(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 ds(e){return e!=null&&typeof e.elementFromPoint==`function`}function fs(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function ps(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 ms(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 Q(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}[...n]}var hs=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,t){let n=new Set,r=0,i=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(r===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;r++;let n=i.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 a=e.firstElementChild;a instanceof HTMLElement||(a=null),n==null?(n={type:`code`,codeElement:e,numberElement:a,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,n),this.observe(e),a!=null&&(this.observedNodes.set(a,n),this.observe(a))):(this.observedNodes.set(e,n),i.delete(e),n.numberElement===a?n.numberElement==null?n.numberWidth=0:(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),a!=null&&(this.observe(a),i.delete(a),this.observedNodes.set(a,n)),n.numberElement=a,n.numberWidth=0))}if(r>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),r=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 n=r.get(t);n??(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[r,a]=t,o=r.firstElementChild,s=a.firstElementChild;if(!(r instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=i.get(o);if(c!=null){this.observedNodes.set(o,c),this.observedNodes.set(s,c),i.delete(o),i.delete(s);continue}let l=o.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:r,child:o,childHeight:l},column2:{container:a,child:s,childHeight:u},currentHeight:`auto`},n.add({child1:o,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of n)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);n.clear()}for(let[e,t]of i)this.unobserve(e),t.type===`code`?vs(t):ys(t);i.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:gs(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:_s(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;if(!(!i&&!a)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e==`number`?`${e}px`:`auto`}`),a&&t.codeElement.style.setProperty(`--diffs-column-number-width`,`${r===0?`auto`:`${r}px`}`),i||a&&e!==`auto`)){let n=typeof e==`number`?Math.max(e-r,0):0;t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n>0?`${n}px`:`auto`}`)}}};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 gs(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function _s(e){return Math.max(Math.ceil(e),0)}function vs(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`))}function ys(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 bs(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 xs(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!De.has(t))return!1;return!0}function Ss(e){for(let t of $i(e))if(!fe.has(t))return!1;return!0}function Cs(e){return W({tagName:`div`,children:[W({tagName:`div`,children:e.annotations?.map(e=>W({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function ws(e,t){return W({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function Ts(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 Es({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 W({tagName:`div`,children:[t===`custom`?W({tagName:`slot`,properties:{name:T}}):Ds({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Os(r)]],properties:i})}function Ds({name:e,prevName:t,iconType:n}){let r=[W({tagName:`slot`,properties:{name:S}}),fa({name:Ts(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(W({tagName:`div`,children:[W({tagName:`bdi`,children:[U(t)]})],properties:{"data-prev-name":``}})),r.push(fa({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(W({tagName:`div`,children:[W({tagName:`bdi`,children:[U(e)]})],properties:{"data-title":``}})),r.push(W({tagName:`slot`,properties:{name:C}})),W({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Os(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(W({tagName:`span`,children:[U(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(W({tagName:`span`,children:[U(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(W({tagName:`slot`,properties:{name:w}})),W({tagName:`div`,children:t,properties:{"data-metadata":``}})}function ks(e){return W({tagName:`pre`,properties:As(e)})}function As({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,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function js(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:$i(t),preferredHighlighter:n}}function Ms(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}var Ns=-1,Ps=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++Ns}`;highlighter;renderCache;computedLang=`text`;lineAnnotations={};lineCache;textDoucmentCache=new WeakMap;constructor(e={theme:E},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ss(e.theme??E)?Zi():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null&&this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){let{options:t}=this.getRenderOptions(e),n=Fs(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!ta(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!sa(e),result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??H(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();let{theme:e=E,tokenizeMaxLineLength:t=1e3}=this.options;return{theme:e,useTokenTransformer:Ms(this.options),tokenizeMaxLineLength:t}})(),{renderCache:n}=this;return n?.result==null||!F(e,n.file)||!ta(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,da(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:da(e.contents)}),this.lineCache=t,t.lines}getLineCount(e){return this.textDoucmentCache.get(e)?.lineCount??this.getOrCreateLineCache(e).length}updateRenderCache(e,t){if(this.renderCache==null)return;let{result:n}=this.renderCache;if(n!=null){for(let[r,i]of e)n.code[r]={type:`element`,tagName:`div`,properties:{"data-line":r+1,"data-line-type":`context`,"data-line-index":r},children:i.map(([e,n,r])=>e===0&&n===``?r===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:r}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`--diffs-token-${t}:${n};`},children:[{type:`text`,value:r}]})};n.baseThemeType=t,this.renderCache.isDirty=!0}}applyDocumentChange(e){if(this.renderCache==null)return;let{file:t,result:n}=this.renderCache;if(n!=null&&n.code.length!==e.lineCount){n.code.length=Math.min(n.code.length,e.lineCount);for(let t=n.code.length;t<e.lineCount;t++)n.code.push({type:`element`,tagName:`div`,properties:{"data-line":t+1,"data-line-type":`context`,"data-line-index":t},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:e.getLineText(t)}]}]});this.renderCache.isDirty=!0}this.textDoucmentCache.set(t,e)}renderFile(e=this.renderCache?.file,t=ne){if(e==null)return;let{options:n,forceHighlight:r}=this.getRenderOptions(e),i=this.getMatchingWorkerResultCache(e,n);i!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...i},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let a=this.getOrCreateLineCache(e),o=e.contents.length>0,s=!o||sa(e)||Fs(a.length,this.getTokenizeMaxLength()),c=!F(e,this.renderCache.file),l=!bs(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(s||this.renderCache.result==null||!this.renderCache.highlighted&&(c||l))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||c||l||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??H(e.name);let t=this.highlighter!=null&&Ss(n.theme),i=this.highlighter!=null&&xs(this.computedLang),a=!s&&i;if(this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=ne){let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=Fs(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??H(e.name);let n=this.highlighter!=null&&ea($i(this.options.theme)),r=t||this.highlighter!=null&&xs(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:Ua(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let a=this.getLineCount(e),{disableFileHeader:o=!1}=this.options,s=[],c=ma(),l=Math.min(t.startingLine+t.totalLines,a),u=0,d=Jo(t)?qo(this.lineAnnotations):void 0;d!=null&&(c.children.push(G(`context`,`annotation`,1)),s.push(Cs({type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:d.map(e=>M(e))})),u++);for(let r=t.startingLine;r<l;r++){let t=r+1,i=n[r];if(i==null){let n=`FileRenderer.processFileResult: Line doesnt exist`;throw console.error(n,{name:e.name,lineIndex:r,lineNumber:t}),Error(n)}c.children.push(ha(`context`,t,`${r}`)),s.push(i),u++;let a=this.lineAnnotations[t];a!=null&&(c.children.push(G(`context`,`annotation`,1)),s.push(Cs({type:`annotation`,hunkIndex:0,lineIndex:t,annotations:a.map(e=>M(e))})),u++)}return c.properties.style=`grid-row: span ${u}`,{gutterAST:c.children??[],contentAST:s,preAST:this.createPreElement(a),headerAST:o?void 0:this.renderHeader(e),totalLines:a,rowCount:u,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return Es({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return i(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(W({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=ma();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,ws(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return i(t?W({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await Xi(js(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!F(e,this.renderCache.file)||!this.renderCache.highlighted||!ta(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getFileResultCache(e);if(!(n==null||!ta(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&F(e,n.file)&&ta(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return ks({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function Fs(e,t){return e>t}var Is=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
7
|
-
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
8
|
-
<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"/>
|
|
9
|
-
</symbol>
|
|
10
|
-
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
11
|
-
<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"/>
|
|
12
|
-
</symbol>
|
|
13
|
-
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
14
|
-
<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"/>
|
|
15
|
-
</symbol>
|
|
16
|
-
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
17
|
-
<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"/>
|
|
18
|
-
</symbol>
|
|
19
|
-
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
20
|
-
<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"/>
|
|
21
|
-
</symbol>
|
|
22
|
-
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
23
|
-
<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"/>
|
|
24
|
-
</symbol>
|
|
25
|
-
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
26
|
-
<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"/>
|
|
27
|
-
</symbol>
|
|
28
|
-
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
29
|
-
<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"/>
|
|
30
|
-
</symbol>
|
|
31
|
-
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
32
|
-
<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"/>
|
|
33
|
-
</symbol>
|
|
34
|
-
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
35
|
-
<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"/>
|
|
36
|
-
</symbol>
|
|
37
|
-
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
38
|
-
<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"/>
|
|
39
|
-
</symbol>
|
|
40
|
-
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
41
|
-
<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"/>
|
|
42
|
-
</symbol>
|
|
43
|
-
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
44
|
-
<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"/>
|
|
45
|
-
</symbol>
|
|
46
|
-
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
47
|
-
<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"/>
|
|
48
|
-
</symbol>
|
|
49
|
-
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
50
|
-
<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"/>
|
|
51
|
-
</symbol>
|
|
52
|
-
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
53
|
-
<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"/>
|
|
54
|
-
</symbol>
|
|
55
|
-
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
56
|
-
<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"/>
|
|
57
|
-
</symbol>
|
|
58
|
-
</svg>`;function Ls(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function Rs(e,t){return e==null||t==null?e===t:Bs(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 zs={};function Bs(e=zs,t=zs){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 Vs(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function Hs(){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 Us(){let e=document.createElement(`style`);return e.setAttribute(O,``),e}var Ws;function Gs(e){if(Ws!=null)return Ws;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(k,`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),Ws=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Ws}function Ks(e){return`${ee}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var qs=`@layer base {
|
|
59
|
-
:host {
|
|
60
|
-
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
61
|
-
"Courier New", monospace;
|
|
62
|
-
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
63
|
-
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
64
|
-
--diffs-mixer: light-dark(#000, #fff);
|
|
65
|
-
--diffs-gap-fallback: 8px;
|
|
66
|
-
--diffs-scrollbar-gutter-fallback: 6px;
|
|
67
|
-
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
68
|
-
--diffs-added-light: #0dbe4e;
|
|
69
|
-
--diffs-added-dark: #5ecc71;
|
|
70
|
-
--diffs-modified-light: #009fff;
|
|
71
|
-
--diffs-modified-dark: #69b1ff;
|
|
72
|
-
--diffs-deleted-light: #ff2e3f;
|
|
73
|
-
--diffs-deleted-dark: #ff6762;
|
|
74
|
-
--diffs-warning-light: #d5a910;
|
|
75
|
-
--diffs-warning-dark: #ffd452;
|
|
76
|
-
color-scheme: light dark;
|
|
77
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
78
|
-
font-size: var(--diffs-font-size, 13px);
|
|
79
|
-
line-height: var(--diffs-line-height, 20px);
|
|
80
|
-
font-feature-settings: var(--diffs-font-features);
|
|
81
|
-
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
82
|
-
--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))));
|
|
83
|
-
--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))));
|
|
84
|
-
--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))));
|
|
85
|
-
--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))));
|
|
86
|
-
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
87
|
-
--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))));
|
|
88
|
-
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
89
|
-
--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)))));
|
|
90
|
-
--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)))));
|
|
91
|
-
--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)))));
|
|
92
|
-
--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))));
|
|
93
|
-
--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)));
|
|
94
|
-
--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))));
|
|
95
|
-
--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)));
|
|
96
|
-
--diffs-selection-base: var(--diffs-modified-base);
|
|
97
|
-
--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)));
|
|
98
|
-
background-color: var(--diffs-bg);
|
|
99
|
-
color: var(--diffs-fg);
|
|
100
|
-
display: block;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
pre, code, [data-error-wrapper] {
|
|
104
|
-
isolation: isolate;
|
|
105
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
106
|
-
outline: none;
|
|
107
|
-
margin: 0;
|
|
108
|
-
padding: 0;
|
|
109
|
-
display: block;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
pre, code {
|
|
113
|
-
background-color: var(--diffs-bg);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
code {
|
|
117
|
-
contain: content;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
input, button {
|
|
121
|
-
font-family: inherit;
|
|
122
|
-
font-size: inherit;
|
|
123
|
-
line-height: inherit;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
*, :before, :after {
|
|
127
|
-
box-sizing: border-box;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
[data-icon-sprite] {
|
|
131
|
-
display: none;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
[data-diffs-header], [data-separator] {
|
|
135
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
[data-diffs-header][data-sticky] {
|
|
139
|
-
z-index: 1;
|
|
140
|
-
background-color: var(--diffs-bg);
|
|
141
|
-
position: sticky;
|
|
142
|
-
top: 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
[data-file-info] {
|
|
146
|
-
color: var(--fg);
|
|
147
|
-
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
148
|
-
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
149
|
-
padding: 10px;
|
|
150
|
-
font-weight: 700;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
[data-diff], [data-file] {
|
|
154
|
-
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
155
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
156
|
-
|
|
157
|
-
&[data-dehydrated] {
|
|
158
|
-
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
162
|
-
background-color: var(--diffs-bg-context);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
@supports (-webkit-touch-callout: none) {
|
|
167
|
-
:host {
|
|
168
|
-
--diffs-scrollbar-gutter-fallback: 0px;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
[data-line] span {
|
|
173
|
-
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
174
|
-
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
175
|
-
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
176
|
-
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
177
|
-
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
181
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
182
|
-
--diffs-computed-diff-line-bg: var(--diffs-bg);
|
|
183
|
-
--diffs-computed-selected-line-bg: var(--diffs-bg);
|
|
184
|
-
color: var(--diffs-fg);
|
|
185
|
-
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
186
|
-
|
|
187
|
-
@media (pointer: fine) {
|
|
188
|
-
&:where([data-hovered]) {
|
|
189
|
-
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
190
|
-
var(--diffs-computed-selected-line-bg) 97%,
|
|
191
|
-
var(--diffs-bg-hover-override, var(--diffs-mixer))), color-mix(in lab,
|
|
192
|
-
var(--diffs-computed-selected-line-bg) 91%,
|
|
193
|
-
var(--diffs-bg-hover-override, var(--diffs-mixer))));
|
|
194
|
-
--diffs-line-bg: var(--diffs-computed-hovered-line-bg, inherit);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
[data-line], [data-no-newline] {
|
|
200
|
-
&[data-decoration-bg] {
|
|
201
|
-
--mix-deco-light: 92%;
|
|
202
|
-
--mix-deco-dark: 85%;
|
|
203
|
-
|
|
204
|
-
&[data-decoration-bg-depth="2"] {
|
|
205
|
-
--mix-deco-light: 88%;
|
|
206
|
-
--mix-deco-dark: 80%;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
&[data-decoration-bg-depth="3"] {
|
|
210
|
-
--mix-deco-light: 85%;
|
|
211
|
-
--mix-deco-dark: 78%;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
@media (pointer: fine) {
|
|
215
|
-
&[data-hovered]:not([data-selected-line]) {
|
|
216
|
-
--mix-deco-light: 85%;
|
|
217
|
-
--mix-deco-dark: 85%;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
&[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="2"] {
|
|
221
|
-
--mix-deco-light: 83%;
|
|
222
|
-
--mix-deco-dark: 83%;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
&[data-hovered]:not([data-selected-line])[data-decoration-bg-depth="3"] {
|
|
226
|
-
--mix-deco-light: 81%;
|
|
227
|
-
--mix-deco-dark: 81%;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
232
|
-
var(--diffs-bg) var(--mix-deco-light),
|
|
233
|
-
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
234
|
-
var(--diffs-bg) var(--mix-deco-dark),
|
|
235
|
-
var(--diffs-decoration-bg)));
|
|
236
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
237
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
238
|
-
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
243
|
-
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
244
|
-
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
245
|
-
--diffs-computed-diff-line-bg: var(--diffs-annotation-bg);
|
|
246
|
-
--diffs-computed-selected-line-bg: var(--diffs-annotation-bg);
|
|
247
|
-
--diffs-line-bg: var(--diffs-annotation-bg);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
[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"] {
|
|
251
|
-
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
252
|
-
--diffs-computed-diff-line-bg: var(--diffs-bg-context);
|
|
253
|
-
--diffs-computed-selected-line-bg: var(--diffs-bg-context);
|
|
254
|
-
--diffs-line-bg: var(--diffs-bg-context);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
258
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
259
|
-
var(--diffs-bg) 78%,
|
|
260
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
261
|
-
var(--diffs-bg) 68%,
|
|
262
|
-
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
263
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
264
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
265
|
-
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
269
|
-
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
270
|
-
var(--diffs-bg) 78%,
|
|
271
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
272
|
-
var(--diffs-bg) 68%,
|
|
273
|
-
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
274
|
-
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
275
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-decoration-bg);
|
|
276
|
-
--diffs-line-bg: var(--diffs-computed-decoration-bg);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
280
|
-
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
281
|
-
--diffs-computed-diff-line-bg: var(--diffs-bg);
|
|
282
|
-
--diffs-computed-selected-line-bg: var(--diffs-bg);
|
|
283
|
-
--diffs-line-bg: var(--diffs-bg);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
:where([data-background]) {
|
|
287
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
288
|
-
--mix-light: 91%;
|
|
289
|
-
--mix-dark: 85%;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
& [data-line], & [data-no-newline] {
|
|
293
|
-
--mix-light: 88%;
|
|
294
|
-
--mix-dark: 80%;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
298
|
-
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
299
|
-
|
|
300
|
-
&[data-line-type="change-deletion"] {
|
|
301
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
302
|
-
|
|
303
|
-
@media (pointer: fine) {
|
|
304
|
-
&[data-hovered] {
|
|
305
|
-
--mix-light: 80%;
|
|
306
|
-
--mix-dark: 75%;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
311
|
-
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
312
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
316
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
317
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
318
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
319
|
-
var(--diffs-diff-line-mix-target)));
|
|
320
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
321
|
-
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
&[data-line-type="change-addition"] {
|
|
325
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
326
|
-
|
|
327
|
-
@media (pointer: fine) {
|
|
328
|
-
&[data-hovered] {
|
|
329
|
-
--mix-light: 80%;
|
|
330
|
-
--mix-dark: 70%;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
335
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
336
|
-
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
340
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
341
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
342
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
343
|
-
var(--diffs-diff-line-mix-target)));
|
|
344
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
345
|
-
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
&[data-merge-conflict="current"] {
|
|
349
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
350
|
-
|
|
351
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
352
|
-
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
353
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@media (pointer: fine) {
|
|
357
|
-
&[data-hovered] {
|
|
358
|
-
--mix-light: 80%;
|
|
359
|
-
--mix-dark: 70%;
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
364
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
365
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
366
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
367
|
-
var(--diffs-diff-line-mix-target)));
|
|
368
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
369
|
-
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
&[data-merge-conflict="incoming"] {
|
|
373
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
374
|
-
|
|
375
|
-
&:where([data-gutter-buffer], [data-column-number]) {
|
|
376
|
-
color: var(--diffs-modified-base);
|
|
377
|
-
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
@media (pointer: fine) {
|
|
381
|
-
&[data-hovered] {
|
|
382
|
-
--mix-light: 80%;
|
|
383
|
-
--mix-dark: 70%;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
388
|
-
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
389
|
-
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
390
|
-
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
391
|
-
var(--diffs-diff-line-mix-target)));
|
|
392
|
-
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
393
|
-
--diffs-line-bg: var(--diffs-computed-diff-line-bg, inherit);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
399
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
400
|
-
|
|
401
|
-
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
402
|
-
--mix-selection-light: 82%;
|
|
403
|
-
--mix-selection-dark: 75%;
|
|
404
|
-
|
|
405
|
-
@media (pointer: fine) {
|
|
406
|
-
&[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
407
|
-
--mix-selection-light: 75%;
|
|
408
|
-
--mix-selection-dark: 70%;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
&:where([data-gutter-buffer], [data-column-number])[data-selected-line] {
|
|
414
|
-
--mix-selection-light: 75%;
|
|
415
|
-
--mix-selection-dark: 60%;
|
|
416
|
-
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
417
|
-
|
|
418
|
-
@media (pointer: fine) {
|
|
419
|
-
&[data-hovered]:not([data-merge-conflict], [data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
420
|
-
--mix-selection-light: 70%;
|
|
421
|
-
--mix-selection-dark: 55%;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
427
|
-
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
428
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
429
|
-
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
430
|
-
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
431
|
-
var(--diffs-selection-mix-target)));
|
|
432
|
-
--diffs-line-bg: var(--diffs-computed-selected-line-bg, inherit);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
[data-gutter-buffer], [data-column-number] {
|
|
437
|
-
&[data-selected-line] {
|
|
438
|
-
color: var(--diffs-selection-number-fg);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
[data-no-newline] {
|
|
443
|
-
user-select: none;
|
|
444
|
-
|
|
445
|
-
& span {
|
|
446
|
-
opacity: .6;
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
[data-diff-type="split"][data-overflow="scroll"] {
|
|
451
|
-
grid-template-columns: 1fr 1fr;
|
|
452
|
-
display: grid;
|
|
453
|
-
|
|
454
|
-
& [data-additions] {
|
|
455
|
-
border-left: 1px solid var(--diffs-bg);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
& [data-deletions] {
|
|
459
|
-
border-right: 1px solid var(--diffs-bg);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
[data-code] {
|
|
464
|
-
grid-auto-flow: dense;
|
|
465
|
-
grid-template-columns: var(--diffs-code-grid);
|
|
466
|
-
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
467
|
-
overscroll-behavior-x: none;
|
|
468
|
-
tab-size: var(--diffs-tab-size, 2);
|
|
469
|
-
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
470
|
-
padding-bottom: max(0px,
|
|
471
|
-
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
472
|
-
var(--diffs-scrollbar-gutter)));
|
|
473
|
-
scrollbar-gutter: stable;
|
|
474
|
-
align-self: flex-start;
|
|
475
|
-
display: grid;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
[data-diffs-scrollbar-measure] {
|
|
479
|
-
opacity: 0;
|
|
480
|
-
pointer-events: none;
|
|
481
|
-
scrollbar-gutter: auto;
|
|
482
|
-
grid-template-columns: none;
|
|
483
|
-
width: 100px;
|
|
484
|
-
height: 100px;
|
|
485
|
-
padding: 0;
|
|
486
|
-
position: absolute;
|
|
487
|
-
top: -200px;
|
|
488
|
-
left: -200px;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
[data-container-size] {
|
|
492
|
-
container-type: inline-size;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
[data-code]::-webkit-scrollbar {
|
|
496
|
-
width: 0;
|
|
497
|
-
height: var(--diffs-scrollbar-gutter);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
[data-code]::-webkit-scrollbar-track {
|
|
501
|
-
background: none;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
[data-code]::-webkit-scrollbar-thumb {
|
|
505
|
-
background-color: #0000;
|
|
506
|
-
background-clip: content-box;
|
|
507
|
-
border: 1px solid #0000;
|
|
508
|
-
border-radius: 3px;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
[data-code]::-webkit-scrollbar-corner {
|
|
512
|
-
background-color: #0000;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
@supports ((-moz-appearance: none)) {
|
|
516
|
-
[data-code] {
|
|
517
|
-
scrollbar-width: thin;
|
|
518
|
-
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
519
|
-
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
524
|
-
& [data-code], &[data-overflow="wrap"] {
|
|
525
|
-
padding-top: 0;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
[data-gutter] {
|
|
530
|
-
grid-template-rows: subgrid;
|
|
531
|
-
grid-template-columns: subgrid;
|
|
532
|
-
z-index: 3;
|
|
533
|
-
background-color: var(--diffs-bg);
|
|
534
|
-
grid-column: 1;
|
|
535
|
-
display: grid;
|
|
536
|
-
position: relative;
|
|
537
|
-
|
|
538
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
539
|
-
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
[data-content] {
|
|
544
|
-
grid-template-rows: subgrid;
|
|
545
|
-
grid-template-columns: subgrid;
|
|
546
|
-
background-color: var(--diffs-bg);
|
|
547
|
-
grid-column: 2;
|
|
548
|
-
min-width: 0;
|
|
549
|
-
display: grid;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
[data-diff-type="split"][data-overflow="wrap"] {
|
|
553
|
-
grid-auto-flow: dense;
|
|
554
|
-
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
555
|
-
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
556
|
-
display: grid;
|
|
557
|
-
|
|
558
|
-
& [data-deletions] {
|
|
559
|
-
display: contents;
|
|
560
|
-
|
|
561
|
-
& [data-gutter] {
|
|
562
|
-
grid-column: 1;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
& [data-content] {
|
|
566
|
-
border-right: 1px solid var(--diffs-bg);
|
|
567
|
-
grid-column: 2;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
& [data-additions] {
|
|
572
|
-
display: contents;
|
|
573
|
-
|
|
574
|
-
& [data-gutter] {
|
|
575
|
-
border-left: 1px solid var(--diffs-bg);
|
|
576
|
-
grid-column: 3;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
& [data-content] {
|
|
580
|
-
grid-column: 4;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
[data-overflow="scroll"] [data-gutter] {
|
|
586
|
-
position: sticky;
|
|
587
|
-
left: 0;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
[data-interactive-lines] [data-line] {
|
|
591
|
-
cursor: pointer;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
[data-interactive-line-numbers] [data-column-number] {
|
|
595
|
-
cursor: pointer;
|
|
596
|
-
touch-action: none;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
[data-content-buffer], [data-gutter-buffer] {
|
|
600
|
-
user-select: none;
|
|
601
|
-
min-height: 1lh;
|
|
602
|
-
position: relative;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
[data-gutter-buffer] {
|
|
606
|
-
padding-left: 2ch;
|
|
607
|
-
padding-right: 1ch;
|
|
608
|
-
|
|
609
|
-
&:before {
|
|
610
|
-
content: "";
|
|
611
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
612
|
-
display: block;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
[data-gutter-buffer="annotation"] {
|
|
617
|
-
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
618
|
-
min-height: 0;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
[data-gutter-buffer="buffer"] {
|
|
622
|
-
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
[data-content-buffer] {
|
|
626
|
-
background-position: 5px 0;
|
|
627
|
-
background-size: 8px 8px;
|
|
628
|
-
background-origin: border-box;
|
|
629
|
-
background-image: repeating-linear-gradient(-45deg,
|
|
630
|
-
transparent,
|
|
631
|
-
transparent calc(3px * 1.414),
|
|
632
|
-
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
633
|
-
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
634
|
-
grid-column: 1;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
[data-separator] {
|
|
638
|
-
box-sizing: content-box;
|
|
639
|
-
background-color: var(--diffs-bg);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
[data-separator="simple"] {
|
|
643
|
-
min-height: 4px;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
647
|
-
background-color: var(--diffs-bg-separator);
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
651
|
-
height: 32px;
|
|
652
|
-
position: relative;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
[data-separator-wrapper] {
|
|
656
|
-
user-select: none;
|
|
657
|
-
fill: currentColor;
|
|
658
|
-
background-color: var(--diffs-bg);
|
|
659
|
-
align-items: center;
|
|
660
|
-
height: 100%;
|
|
661
|
-
display: flex;
|
|
662
|
-
position: absolute;
|
|
663
|
-
inset-inline: 0;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
[data-content] [data-separator-wrapper] {
|
|
667
|
-
display: none;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
[data-separator="metadata"] [data-separator-wrapper] {
|
|
671
|
-
background-color: var(--diffs-bg-separator);
|
|
672
|
-
height: 100%;
|
|
673
|
-
color: var(--diffs-fg-number);
|
|
674
|
-
white-space: nowrap;
|
|
675
|
-
text-overflow: ellipsis;
|
|
676
|
-
min-width: min-content;
|
|
677
|
-
padding-inline: 1ch;
|
|
678
|
-
inset-inline: 100% auto;
|
|
679
|
-
overflow: hidden;
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
[data-separator="line-info"] {
|
|
683
|
-
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
684
|
-
|
|
685
|
-
& [data-separator-wrapper] {
|
|
686
|
-
min-width: 16px;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
691
|
-
margin-block: 0;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
[data-separator="line-info"][data-separator-first] {
|
|
695
|
-
margin-top: 0;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
[data-separator="line-info"][data-separator-last] {
|
|
699
|
-
margin-bottom: 0;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
[data-expand-index] [data-separator-wrapper] {
|
|
703
|
-
grid-template-columns: 32px auto;
|
|
704
|
-
display: grid;
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
708
|
-
grid-template-columns: 32px 32px auto;
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
[data-expand-button], [data-separator-content] {
|
|
712
|
-
background-color: var(--diffs-bg-separator);
|
|
713
|
-
flex: none;
|
|
714
|
-
align-items: center;
|
|
715
|
-
display: flex;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
[data-expand-index] [data-separator-content]:hover {
|
|
719
|
-
cursor: pointer;
|
|
720
|
-
text-decoration: underline;
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
[data-expand-button] {
|
|
724
|
-
cursor: pointer;
|
|
725
|
-
min-width: 32px;
|
|
726
|
-
color: var(--diffs-fg-number);
|
|
727
|
-
border-right: 2px solid var(--diffs-bg);
|
|
728
|
-
flex-shrink: 0;
|
|
729
|
-
justify-content: center;
|
|
730
|
-
align-self: stretch;
|
|
731
|
-
|
|
732
|
-
&:hover {
|
|
733
|
-
color: var(--diffs-fg);
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
&[data-expand-all-button] {
|
|
737
|
-
display: none;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
[data-expand-down] [data-icon] {
|
|
742
|
-
transform: scaleY(-1);
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
[data-separator-content] {
|
|
746
|
-
height: 100%;
|
|
747
|
-
color: var(--diffs-fg-number);
|
|
748
|
-
flex: auto;
|
|
749
|
-
justify-content: flex-start;
|
|
750
|
-
padding: 0 1ch;
|
|
751
|
-
overflow: hidden;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
755
|
-
& [data-separator-content] {
|
|
756
|
-
user-select: none;
|
|
757
|
-
height: 100%;
|
|
758
|
-
overflow: clip;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
[data-unmodified-lines] {
|
|
763
|
-
text-overflow: ellipsis;
|
|
764
|
-
white-space: nowrap;
|
|
765
|
-
flex: 0 auto;
|
|
766
|
-
min-width: 0;
|
|
767
|
-
display: block;
|
|
768
|
-
overflow: hidden;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
@supports (width: 1cqi) {
|
|
772
|
-
[data-unified] {
|
|
773
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
774
|
-
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
775
|
-
width: 100cqi;
|
|
776
|
-
|
|
777
|
-
& [data-separator-content] {
|
|
778
|
-
border-radius: 6px;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
783
|
-
border-top-left-radius: unset;
|
|
784
|
-
border-bottom-left-radius: unset;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
[data-gutter] {
|
|
789
|
-
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
790
|
-
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
& [data-separator="line-info"] [data-separator-content] {
|
|
794
|
-
border-top-left-radius: 6px;
|
|
795
|
-
border-bottom-left-radius: 6px;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
799
|
-
border-top-left-radius: unset;
|
|
800
|
-
border-bottom-left-radius: unset;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
|
|
804
|
-
[data-additions] {
|
|
805
|
-
& [data-content] [data-separator="line-info"] {
|
|
806
|
-
background-color: var(--diffs-bg);
|
|
807
|
-
|
|
808
|
-
& [data-separator-wrapper] {
|
|
809
|
-
display: none;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
814
|
-
background-color: var(--diffs-bg-separator);
|
|
815
|
-
border-top-right-radius: 6px;
|
|
816
|
-
border-bottom-right-radius: 6px;
|
|
817
|
-
height: 100%;
|
|
818
|
-
display: block;
|
|
819
|
-
|
|
820
|
-
& [data-separator-content], & [data-expand-button] {
|
|
821
|
-
display: none;
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
827
|
-
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
831
|
-
background-color: var(--diffs-bg-separator);
|
|
832
|
-
height: 100%;
|
|
833
|
-
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
834
|
-
border-top-right-radius: 6px;
|
|
835
|
-
border-bottom-right-radius: 6px;
|
|
836
|
-
display: block;
|
|
837
|
-
|
|
838
|
-
& [data-separator-content], & [data-expand-button] {
|
|
839
|
-
display: none;
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
844
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
845
|
-
border-top-left-radius: 6px;
|
|
846
|
-
border-bottom-left-radius: 6px;
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
@media (pointer: fine) {
|
|
851
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
852
|
-
&[data-separator-multi-button] {
|
|
853
|
-
& [data-expand-up] {
|
|
854
|
-
border-top-left-radius: 6px;
|
|
855
|
-
border-bottom-left-radius: unset;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
& [data-expand-down] {
|
|
859
|
-
border-bottom-left-radius: 6px;
|
|
860
|
-
border-top-left-radius: unset;
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
@media (pointer: coarse) {
|
|
868
|
-
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
869
|
-
grid-template-columns: 34px 34px auto;
|
|
870
|
-
|
|
871
|
-
& [data-separator-content] {
|
|
872
|
-
grid-column: unset;
|
|
873
|
-
grid-row: unset;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
|
|
877
|
-
@supports (width: 1cqi) {
|
|
878
|
-
[data-separator="line-info"] [data-separator-wrapper] {
|
|
879
|
-
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
880
|
-
border-top-left-radius: 6px;
|
|
881
|
-
border-bottom-left-radius: 6px;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
&[data-separator-multi-button] {
|
|
885
|
-
& [data-expand-up] {
|
|
886
|
-
border-top-left-radius: 6px;
|
|
887
|
-
border-bottom-left-radius: 6px;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
& [data-expand-down] {
|
|
891
|
-
border-bottom-left-radius: unset;
|
|
892
|
-
border-top-left-radius: unset;
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
@media (pointer: fine) {
|
|
900
|
-
[data-separator-wrapper][data-separator-multi-button] {
|
|
901
|
-
grid-template-rows: 50% 50%;
|
|
902
|
-
display: grid;
|
|
903
|
-
|
|
904
|
-
& [data-separator-content] {
|
|
905
|
-
grid-area: 1 / 2 / -1;
|
|
906
|
-
min-width: min-content;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
& [data-expand-button] {
|
|
910
|
-
grid-column: 1;
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
915
|
-
grid-template-columns: 34px auto;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
919
|
-
grid-template-columns: 100% auto;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
923
|
-
& [data-separator-multi-button] {
|
|
924
|
-
& [data-expand-up] {
|
|
925
|
-
border-bottom: 1px solid var(--diffs-bg);
|
|
926
|
-
border-right: 2px solid var(--diffs-bg);
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
& [data-expand-down] {
|
|
930
|
-
border-top: 1px solid var(--diffs-bg);
|
|
931
|
-
border-right: 2px solid var(--diffs-bg);
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
938
|
-
display: none;
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
[data-line-annotation] {
|
|
942
|
-
min-height: var(--diffs-annotation-min-height, 0);
|
|
943
|
-
z-index: 2;
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
[data-merge-conflict-actions] {
|
|
947
|
-
z-index: 2;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
[data-separator="custom"] {
|
|
951
|
-
grid-template-columns: subgrid;
|
|
952
|
-
display: grid;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
[data-line], [data-column-number], [data-no-newline] {
|
|
956
|
-
padding-inline: 1ch;
|
|
957
|
-
position: relative;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
[data-indicators="classic"] [data-line] {
|
|
961
|
-
padding-inline-start: 2ch;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
[data-indicators="classic"] {
|
|
965
|
-
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
966
|
-
&[data-no-newline], &[data-line] {
|
|
967
|
-
&:before {
|
|
968
|
-
user-select: none;
|
|
969
|
-
width: 1ch;
|
|
970
|
-
height: 1lh;
|
|
971
|
-
display: inline-block;
|
|
972
|
-
position: absolute;
|
|
973
|
-
top: 0;
|
|
974
|
-
left: 0;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
& [data-line-type="change-addition"] {
|
|
980
|
-
&[data-line], &[data-no-newline] {
|
|
981
|
-
&:before {
|
|
982
|
-
content: "+";
|
|
983
|
-
color: var(--diffs-addition-base);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
& [data-line-type="change-deletion"] {
|
|
989
|
-
&[data-line], &[data-no-newline] {
|
|
990
|
-
&:before {
|
|
991
|
-
content: "-";
|
|
992
|
-
color: var(--diffs-deletion-base);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
[data-indicators="bars"] {
|
|
999
|
-
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1000
|
-
&[data-column-number] {
|
|
1001
|
-
&:before {
|
|
1002
|
-
content: "";
|
|
1003
|
-
user-select: none;
|
|
1004
|
-
contain: strict;
|
|
1005
|
-
width: 4px;
|
|
1006
|
-
height: 100%;
|
|
1007
|
-
display: block;
|
|
1008
|
-
position: absolute;
|
|
1009
|
-
top: 0;
|
|
1010
|
-
left: 0;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
& [data-line-type="change-deletion"] {
|
|
1016
|
-
&[data-column-number] {
|
|
1017
|
-
&:before {
|
|
1018
|
-
background-image: linear-gradient(0deg,
|
|
1019
|
-
var(--diffs-bg-deletion) 50%,
|
|
1020
|
-
var(--diffs-deletion-base) 50%);
|
|
1021
|
-
background-repeat: repeat;
|
|
1022
|
-
background-size: 2px 2px;
|
|
1023
|
-
background-size: calc(1lh / round(1lh / 2px))
|
|
1024
|
-
calc(1lh / round(1lh / 2px));
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
& [data-line-type="change-addition"] {
|
|
1030
|
-
&[data-column-number] {
|
|
1031
|
-
&:before {
|
|
1032
|
-
background-color: var(--diffs-addition-base);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
[data-overflow="wrap"] {
|
|
1039
|
-
& [data-line], & [data-annotation-content] {
|
|
1040
|
-
white-space: pre-wrap;
|
|
1041
|
-
word-break: break-word;
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
[data-overflow="scroll"] [data-line] {
|
|
1046
|
-
white-space: pre;
|
|
1047
|
-
min-height: 1lh;
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
[data-column-number] {
|
|
1051
|
-
box-sizing: content-box;
|
|
1052
|
-
text-align: right;
|
|
1053
|
-
user-select: none;
|
|
1054
|
-
color: var(--diffs-fg-number);
|
|
1055
|
-
padding-left: 2ch;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
[data-line-number-content] {
|
|
1059
|
-
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1060
|
-
z-index: 1;
|
|
1061
|
-
display: inline-block;
|
|
1062
|
-
position: relative;
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
[data-disable-line-numbers] {
|
|
1066
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1067
|
-
min-width: 4px;
|
|
1068
|
-
padding: 0;
|
|
1069
|
-
|
|
1070
|
-
&:before {
|
|
1071
|
-
min-width: 0;
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
& [data-line-number-content] {
|
|
1076
|
-
display: none;
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
& [data-gutter-utility-slot] {
|
|
1080
|
-
right: unset;
|
|
1081
|
-
justify-content: flex-start;
|
|
1082
|
-
left: 0;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1086
|
-
left: 6px;
|
|
1087
|
-
}
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
[data-file][data-disable-line-numbers] {
|
|
1091
|
-
& [data-gutter-buffer], & [data-column-number] {
|
|
1092
|
-
border-right: 0;
|
|
1093
|
-
min-width: 0;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
[data-diff-span] {
|
|
1098
|
-
box-decoration-break: clone;
|
|
1099
|
-
border-radius: 3px;
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
[data-line-type="change-addition"] [data-diff-span] {
|
|
1103
|
-
background-color: var(--diffs-bg-addition-emphasis);
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1107
|
-
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1111
|
-
color: var(--diffs-fg);
|
|
1112
|
-
padding-left: 1ch;
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1116
|
-
align-items: center;
|
|
1117
|
-
display: flex;
|
|
1118
|
-
|
|
1119
|
-
&:after {
|
|
1120
|
-
color: var(--diffs-fg-conflict-marker);
|
|
1121
|
-
font-size: .75rem;
|
|
1122
|
-
font-style: normal;
|
|
1123
|
-
line-height: 1.25rem;
|
|
1124
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1125
|
-
padding-left: 1ch;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
[data-merge-conflict="marker-start"]:after {
|
|
1130
|
-
content: "(Current Change)";
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
[data-merge-conflict="marker-end"]:after {
|
|
1134
|
-
content: "(Incoming Change)";
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
[data-merge-conflict-actions-content] {
|
|
1138
|
-
min-height: 1.75rem;
|
|
1139
|
-
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1140
|
-
color: var(--diffs-fg);
|
|
1141
|
-
align-items: center;
|
|
1142
|
-
gap: .25rem;
|
|
1143
|
-
padding-inline: .5rem;
|
|
1144
|
-
font-size: .75rem;
|
|
1145
|
-
line-height: 1.2;
|
|
1146
|
-
display: flex;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
[data-merge-conflict-action] {
|
|
1150
|
-
appearance: none;
|
|
1151
|
-
color: var(--diffs-fg-number);
|
|
1152
|
-
font: inherit;
|
|
1153
|
-
cursor: pointer;
|
|
1154
|
-
background: none;
|
|
1155
|
-
border: 0;
|
|
1156
|
-
padding: 0;
|
|
1157
|
-
font-style: normal;
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
[data-merge-conflict-action]:hover {
|
|
1161
|
-
color: var(--diffs-fg);
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
[data-merge-conflict-action="current"]:hover {
|
|
1165
|
-
color: var(--diffs-addition-base);
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
[data-merge-conflict-action="incoming"]:hover {
|
|
1169
|
-
color: var(--diffs-modified-base);
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
[data-merge-conflict-action-separator] {
|
|
1173
|
-
color: var(--diffs-fg-number);
|
|
1174
|
-
opacity: .6;
|
|
1175
|
-
user-select: none;
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
[data-diffs-header="default"] {
|
|
1179
|
-
background-color: var(--diffs-bg);
|
|
1180
|
-
justify-content: space-between;
|
|
1181
|
-
align-items: center;
|
|
1182
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1183
|
-
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1184
|
-
z-index: 2;
|
|
1185
|
-
flex-direction: row;
|
|
1186
|
-
padding-inline: 16px;
|
|
1187
|
-
display: flex;
|
|
1188
|
-
position: relative;
|
|
1189
|
-
top: 0;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
[data-header-content] {
|
|
1193
|
-
align-items: center;
|
|
1194
|
-
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1195
|
-
white-space: nowrap;
|
|
1196
|
-
flex-direction: row;
|
|
1197
|
-
min-width: 0;
|
|
1198
|
-
display: flex;
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1202
|
-
text-overflow: ellipsis;
|
|
1203
|
-
white-space: nowrap;
|
|
1204
|
-
direction: rtl;
|
|
1205
|
-
min-width: 0;
|
|
1206
|
-
overflow: hidden;
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
[data-prev-name] {
|
|
1210
|
-
opacity: .7;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
[data-rename-icon] {
|
|
1214
|
-
fill: currentColor;
|
|
1215
|
-
flex-grow: 0;
|
|
1216
|
-
flex-shrink: 0;
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
[data-diffs-header="default"] [data-metadata] {
|
|
1220
|
-
white-space: nowrap;
|
|
1221
|
-
align-items: center;
|
|
1222
|
-
gap: 1ch;
|
|
1223
|
-
display: flex;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
[data-diffs-header="default"] [data-additions-count] {
|
|
1227
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1228
|
-
color: var(--diffs-addition-base);
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
[data-diffs-header="default"] [data-deletions-count] {
|
|
1232
|
-
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1233
|
-
color: var(--diffs-deletion-base);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
[data-change-icon] {
|
|
1237
|
-
fill: currentColor;
|
|
1238
|
-
flex-shrink: 0;
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1242
|
-
color: var(--diffs-modified-base);
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
[data-change-icon="new"] {
|
|
1246
|
-
color: var(--diffs-addition-base);
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
[data-change-icon="deleted"] {
|
|
1250
|
-
color: var(--diffs-deletion-base);
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
[data-change-icon="file"] {
|
|
1254
|
-
opacity: .6;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
[data-annotation-content] {
|
|
1258
|
-
z-index: 2;
|
|
1259
|
-
isolation: isolate;
|
|
1260
|
-
align-self: flex-start;
|
|
1261
|
-
min-width: 0;
|
|
1262
|
-
display: flow-root;
|
|
1263
|
-
position: relative;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1267
|
-
width: var(--diffs-column-content-width, auto);
|
|
1268
|
-
left: var(--diffs-column-number-width, 0);
|
|
1269
|
-
position: sticky;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
[data-annotation-slot] {
|
|
1273
|
-
text-wrap-mode: wrap;
|
|
1274
|
-
word-break: normal;
|
|
1275
|
-
white-space-collapse: collapse;
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
[data-gutter-utility-slot] {
|
|
1279
|
-
touch-action: none;
|
|
1280
|
-
justify-content: flex-end;
|
|
1281
|
-
display: flex;
|
|
1282
|
-
position: absolute;
|
|
1283
|
-
top: 0;
|
|
1284
|
-
bottom: 0;
|
|
1285
|
-
right: 0;
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1288
|
-
[data-utility-button] {
|
|
1289
|
-
appearance: none;
|
|
1290
|
-
cursor: pointer;
|
|
1291
|
-
width: 1lh;
|
|
1292
|
-
height: 1lh;
|
|
1293
|
-
font-size: var(--diffs-font-size, 13px);
|
|
1294
|
-
line-height: var(--diffs-line-height, 20px);
|
|
1295
|
-
background-color: var(--diffs-modified-base);
|
|
1296
|
-
color: var(--diffs-bg);
|
|
1297
|
-
fill: currentColor;
|
|
1298
|
-
z-index: 4;
|
|
1299
|
-
touch-action: none;
|
|
1300
|
-
border: none;
|
|
1301
|
-
border-radius: 4px;
|
|
1302
|
-
justify-content: center;
|
|
1303
|
-
align-items: center;
|
|
1304
|
-
margin-right: calc(-1lh + 1ch);
|
|
1305
|
-
padding: 0;
|
|
1306
|
-
display: flex;
|
|
1307
|
-
position: relative;
|
|
1308
|
-
|
|
1309
|
-
&:before {
|
|
1310
|
-
content: "";
|
|
1311
|
-
display: block;
|
|
1312
|
-
position: absolute;
|
|
1313
|
-
inset: 0 0 0 -4px;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
[data-decoration-bar-stack] {
|
|
1318
|
-
pointer-events: none;
|
|
1319
|
-
isolation: isolate;
|
|
1320
|
-
z-index: 1;
|
|
1321
|
-
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1322
|
-
box-sizing: content-box;
|
|
1323
|
-
border-left: 2px solid var(--diffs-bg);
|
|
1324
|
-
border-right: 2px solid var(--diffs-bg);
|
|
1325
|
-
width: 6px;
|
|
1326
|
-
position: absolute;
|
|
1327
|
-
top: 0;
|
|
1328
|
-
bottom: 0;
|
|
1329
|
-
right: -2px;
|
|
1330
|
-
|
|
1331
|
-
[data-decoration-bar-depth="1"] & {
|
|
1332
|
-
background-color: color-mix(in lab,
|
|
1333
|
-
var(--diffs-bg) 20%,
|
|
1334
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1335
|
-
}
|
|
1336
|
-
|
|
1337
|
-
[data-decoration-bar-depth="2"] & {
|
|
1338
|
-
background-color: color-mix(in lab,
|
|
1339
|
-
var(--diffs-bg) 45%,
|
|
1340
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
[data-decoration-bar-depth="3"] & {
|
|
1344
|
-
background-color: color-mix(in lab,
|
|
1345
|
-
var(--diffs-bg) 65%,
|
|
1346
|
-
var(--diffs-decoration-bar-color, transparent));
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
[data-decoration-bar-start] & {
|
|
1350
|
-
border-top-left-radius: 5px;
|
|
1351
|
-
border-top-right-radius: 5px;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
[data-decoration-bar-end] & {
|
|
1355
|
-
z-index: 3;
|
|
1356
|
-
border-bottom-right-radius: 5px;
|
|
1357
|
-
border-bottom-left-radius: 5px;
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
|
-
[data-placeholder] {
|
|
1362
|
-
contain: strict;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
[data-error-wrapper] {
|
|
1366
|
-
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1367
|
-
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1368
|
-
scrollbar-width: none;
|
|
1369
|
-
max-height: 400px;
|
|
1370
|
-
overflow: auto;
|
|
1371
|
-
|
|
1372
|
-
& [data-error-message] {
|
|
1373
|
-
color: var(--diffs-deletion-base);
|
|
1374
|
-
font-size: 18px;
|
|
1375
|
-
font-weight: bold;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
& [data-error-stack] {
|
|
1379
|
-
color: var(--diffs-fg-number);
|
|
1380
|
-
}
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
@layer theme, rendered, unsafe;
|
|
1385
|
-
`,Js=`@layer base, theme, rendered, unsafe;`,Ys=RegExp(`${$s(ee)}\\s*:\\s*[^;]+;`);function Xs(e){return`${Js}
|
|
1386
|
-
@layer unsafe {
|
|
1387
|
-
${e}
|
|
1388
|
-
}`}function Zs(e,t=`system`,n){return`${Js}
|
|
1389
|
-
@layer rendered {
|
|
1390
|
-
:host {${t===`system`?``:`
|
|
1391
|
-
color-scheme: ${t};`}
|
|
1392
|
-
${Ks(n)}
|
|
1393
|
-
${e}
|
|
1394
|
-
}
|
|
1395
|
-
}`}function Qs(e,t){let n=Ks(t);return e.replace(Ys,n)}function $s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ec(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function tc({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 nc({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=rc(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function rc(){let e=document.createElement(`style`);return e.setAttribute(D,``),e}function ic(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function ac(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.tabIndex=0,e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),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(qs)),t.adoptedStyleSheets=[e]}connectedCallback(){Gs(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(p,t)}var oc=[``],sc=-1,cc=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++sc}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(e={theme:E},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new Ps(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new hs,this.interactionManager=new Zo(`file`,Qo(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Qo(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!de(this.appliedThemeCSS.theme,this.options.theme??E)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e===`wrap`),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.annotationCache.clear(),this.pre=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1,this.editor?.cleanUp(),this.editor=void 0}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;this.hydrateElements(t,n),lc(this.pre,i,this.options.collapsed)||uc(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ic(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(ec(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e==null?oc:this.fileRenderer.getOrCreateLineCache(e)}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.file;e!=null&&t!=null&&n!=null&&this.fileRenderer.initializeHighlighter().then(r=>{e.__syncRenderView(r,t,n,this.lineAnnotations,this.renderRange)})}attachEditor(e){return this.editor?.cleanUp(),this.editor=e,this.interactionManager.setEditorAttached(!0),this.syncRenderViewToEditor(),()=>{this.editor=void 0,this.interactionManager.setEditorAttached(!1)}}applyDocumentChange(e,t){this.fileRenderer.applyDocumentChange(e),t!=null&&t!==this.lineAnnotations&&this.file!=null&&(this.setLineAnnotations(t),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}updateRenderCache(e,t){this.fileRenderer.updateRenderCache(e,t)}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);this.editor?.__postponeBackgroundTokenizeToNextFrame();let{collapsed:c=!1,themeType:l=`system`}=this.options,u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations,m=!F(this.file,e);if(!c&&!n&&bs(u,this.renderRange)&&!m&&!p&&!f)return this.applyCachedThemeState(l);this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions(ec(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:h=!1,disableFileHeader:g=!1}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let n=this.fileRenderer.renderFile(e,re);n!=null&&this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n?.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.injectUnsafeCSS()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}try{let r=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f)||!this.applyPartialRender(d,u)){let n=this.fileRenderer.renderFile(e,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.applyFullRender(n,r)}this.applyBuffers(r,u),this.injectUnsafeCSS(),this.managersDirty=!0,a||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}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;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{file:e,workerManager:t}=this;e==null||e.cacheKey==null||t==null||sa(e)||this.fileRenderer.getOrCreateLineCache(e).length>(this.options.tokenizeMaxLength??1e5)||t.primeFileHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${M(r)}`,a=this.annotationCache.get(i);if(a==null||!Ls(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Vs(M(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=Hs();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=Us(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Xs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??E,s=typeof o==`string`?o:{...o},c=Gs(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=nc({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Zs(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=Qs(this.themeCSSStyle.textContent??``,Gs(e)))}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=tc({code:this.code});let n=this.fileRenderer.renderCodeAST(e);if(this.code.childElementCount>=2)for(let e=0;e<2;e++){let t=this.code.children[e],r=n[e];t.innerHTML=i(r.children),t.style.cssText=r.properties.style}else this.code.innerHTML=i(n);t.contains(this.code)||t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;let{file:n,code:r}=this,i=r==null?void 0:this.getColumns(r);if(n==null||r==null||i==null)return!1;let a=e.startingLine,o=t.startingLine,s=e.totalLines===1/0?1/0:a+e.totalLines,c=t.totalLines===1/0?1/0:o+t.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l||!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))return!1;let{length:d}=i.content.children,f=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},p=o<l?f(o,l-o):void 0;if(p===void 0&&o<l)return!1;let m=c===1/0?1/0:Math.max(0,c-u),h=c>u?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;a===0&&(r.set(0,0),i+=1,a=n[i]);for(let e=0;e<o.length;e+=1){let t=o[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(s!=null){for(;a!=null&&s>=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??i(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderCustomHeader:s,renderHeaderMetadata:c}=this.options;if(s!=null){let e=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,T,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let e=a?.(n)??void 0,r=o?.(n)??void 0,i=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,S,e),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,C,r),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,w,i),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return 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:Wo(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Wo(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=Is;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};Rs(i,this.appliedPreAttributes)||(ac(e,i),this.appliedPreAttributes=i)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function lc(e,t,n=!1){return!n&&e==null&&t!=null}function uc(e,t,n=!1){return e==null&&t!=null&&!n}var dc=5e3,fc=-1;function pc(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var mc=class extends cc{virtualizer;metrics;__id=`virtualized-file:${++fc}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=j,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&Io(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!Lo(t,e),r=pc(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;let{overflow:t=`scroll`}=this.options;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;let n=this.code.children[1];if(!(n instanceof HTMLElement))return e;let r=Ko(this.lineAnnotations);if(this.renderRange!=null&&r&&Jo(this.renderRange)){let t=hc(n)??0;t!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=t,e=!0)}else!r&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(let t of n.children){if(!(t instanceof HTMLElement))continue;let n=t.dataset.lineIndex;if(n==null)continue;let r=Number(n),i=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(a=!0),i+=t.nextElementSibling.getBoundingClientRect().height);let o=this.getLineHeight(r,a);i!==o&&(e=!0,i===this.metrics.lineHeight*(a?2:1)?this.cache.heights.delete(r):this.cache.heights.set(r,i))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,r){let i=this.syncLineAnnotations(r),a=n?.resetFileLayoutCache===!0||i;n?.metrics!=null&&(this.metrics=n.metrics,a=!0);let{collapsed:o=!1}=this.options;return this.currentCollapsed!==o&&(this.currentCollapsed=o,a=!0),a&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;let{disableFileHeader:t=!1,collapsed:n=!1}=this.options,r=this.fileRenderer.getLineCount(this.file)-1,i=Y(this.metrics,t);if(n||r<0)return{top:i,height:0};let a=Math.min(Math.max(e-1,0),r),{overflow:o=`scroll`}=this.options,{lineHeight:s}=this.metrics;if(i+=this.cache.fileAnnotationHeight,o===`scroll`&&!this.hasLineAnnotations())return{top:i+a*s,height:s};let c=this.getLayoutCheckpointBeforeLineIndex(a);i=c?.top??i;for(let e=c?.lineIndex??0;e<a;e++)i+=this.getLineHeight(e,!1);return{top:i,height:this.getLineHeight(a,!1)}}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;let{disableFileHeader:t=!1,collapsed:n=!1,overflow:r=`scroll`}=this.options;if(n||this.renderRange.totalLines<=0)return;let i=this.fileRenderer.getLineCount(this.file)-1;if(i<0)return;let a=Y(this.metrics,t),o=Math.min(this.renderRange.startingLine,i),s=Math.min(o+this.renderRange.totalLines-1,i);if(s<o)return;let{fileAnnotationHeight:c}=this.cache;if(r===`scroll`&&!this.hasLineAnnotations()){let{lineHeight:t}=this.metrics,n=a+(o===0?c:this.renderRange.bufferBefore),r=o+Math.max(Math.ceil((e-n)/t),0);return r>s?void 0:{lineNumber:r+1,top:a+c+r*t}}let l=a+(o===0?c:this.renderRange.bufferBefore);for(let t=o;t<=s;t++){if(l>=e)return{lineNumber:t+1,top:l};l+=this.getLineHeight(t)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.file,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(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.file==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1,overflow:a=`scroll`}=this.options,{lineHeight:o}=this.metrics,s=this.fileRenderer.getLineCount(this.file),c=Y(this.metrics,r),l=Ya(this.metrics);if(this.height+=c,i){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,a===`scroll`&&!this.hasLineAnnotations())this.height+=s*o;else for(let e=0;e<s;e++)this.addLayoutCheckpoint(e,this.height),this.height+=this.getLineHeight(e,!1);if(s>0&&(this.height+=l),this.fileContainer!=null&&t&&!n){let e=this.fileContainer.getBoundingClientRect();e.height!==this.height&&(this.file.name,e.height,this.height)}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{heights:r,checkpoints:i}=this.cache,a=this.renderRange;if(super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.layoutDirty=!0,r.size>0&&r.clear(),i.length>0&&(i.length=0),this.isSimpleMode()&&this.computeApproximateSize(),n&&a!==void 0&&this.file!==void 0){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(this.file,this.top??0,e);t.bufferAfter!==a.bufferAfter&&this.updateBuffers(t)}}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:r,...i}){let a=this.file==null||!F(this.file,t),{forceRenderOverride:o,isSetup:s}=this;this.forceRenderOverride=void 0;let c=this.syncLineAnnotations(r);if(c&&this.resetLayoutCache(),this.file=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error(`VirtualizedFile.render: attempting to virtually render when we dont have file`),!1;if(s)this.top??=this.getVirtualizedTop(),a&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!0));else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFile.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let l=this.virtualizer.getWindowSpecs(),u=this.top??0,d=this.computeRenderRangeFromWindow(this.file,u,l);return super.render({file:this.file,fileContainer:e,renderRange:d,lineAnnotations:r,forceRender:(o??n)||c,...i})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}addLayoutCheckpoint(e,t){e%dc===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFile: invalid checkpoint index`);if(n.lineIndex%t===0)return n}}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,overflow:a=`scroll`}=this.options,{hunkLineCount:o,lineHeight:s}=this.metrics,c=this.fileRenderer.getLineCount(e),l=this.height,u=Y(this.metrics,i),d=c>0?Ya(this.metrics):0,{fileAnnotationHeight:f}=this.cache,p=u+f,m=Math.max(0,l-u-f-d),h=Ko(this.lineAnnotations),g=t+u,_=f>0&&h&&g<r&&g+f>n;if(t<n-l||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};if(c<=o)return{startingLine:0,totalLines:o,bufferBefore:0,bufferAfter:0};let v=Math.ceil(Math.max(r-n,0)/s),y=Math.ceil(v/o)*o+o*2,b=y/o,x=(n+r)/2;if(a===`scroll`&&!this.hasLineAnnotations()){let e=t+p,i=e+m;if(!_&&!(e<r&&i>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};let a=Math.floor(_&&x<t+p?0:(x-(t+p))/s),h=Math.floor(a/o)-Math.floor(b/2),g=Math.ceil(c/o),v=Math.max(0,Math.min(h,g))*o,S=h<0?y+h*o:y,C=v===0?0:f+v*s,w=Math.min(S,c-v);return{startingLine:v,totalLines:S,bufferBefore:C,bufferAfter:Math.max(0,(c-v-w)*s)}}let S=b,C=[],w=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-y*s*2),o),T=t+(w?.top??p),E=w?.lineIndex??0,D,O,k,ee=w?.lineIndex??0;for(let e=ee;e<c;e++){let i=E%o===0,a=Math.floor(E/o);if(i&&(C[a]=T-(t+p),k!=null)){if(k<=0)break;k--}let s=this.getLineHeight(e,!1);T>n-s&&T<r&&(D??=a),T+s>x&&(O??=a),k==null&&T>=r&&i&&(k=S),E++,T+=s}if(D==null)if(_)D=0,O=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:l-u-d};O??=D;let A=Math.round(O-b/2),j=Math.max(0,Math.ceil(c/o)-b),te=Math.max(0,Math.min(A,j)),ne=te*o,re=A<0?y+A*o:y,M=C[te]??0,N=ne===0?0:f+M,P=te+re/o,ie=P<C.length?m-C[P]:m-(T-t-p);return{startingLine:ne,totalLines:re,bufferBefore:N,bufferAfter:Math.max(0,ie)}}};function hc(e){let t;for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===Go&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function gc({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o}){let s=Y(t,n),c=s,l=i?!0:a,u=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=Za({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:l,hunkIndex:n,collapsedContextThreshold:o}),d=(a.fromStart+a.fromEnd)*t.lineHeight;if(s+=d,c+=d,a.collapsedLines>0){let e=ao({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;s+=e,c+=e}s+=i.splitLineCount*t.lineHeight,c+=i.unifiedLineCount*t.lineHeight;let f=_c(i);s+=f.split*t.lineHeight,c+=f.unified*t.lineHeight;let p=n===u?eo({fileDiff:e,hunkIndex:n,expandedHunks:l,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(p!=null){let e=(p.fromStart+p.fromEnd)*t.lineHeight;if(s+=e,c+=e,p.collapsedLines>0){let e=oo({type:r,metrics:t})?.totalHeight??0;s+=e,c+=e}}}if(e.hunks.length>0){let e=Ya(t);s+=e,c+=e}return{splitHeight:s,unifiedHeight:c}}function _c(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 vc(e,t)}function vc(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 yc=new TextEncoder,bc=new TextDecoder(`utf-8`,{ignoreBOM:!0}),xc=/[\uD800-\uDFFF]/,Sc=1024,Cc=new Uint8Array(Sc);function wc(){Cc.length!==Sc&&(Cc=new Uint8Array(Sc))}function $(e){if(e.length===0)return e;if(xc.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;Cc.length<t&&(Cc=new Uint8Array(t));let{written:n}=yc.encodeInto(e,Cc);return bc.decode(Cc.subarray(0,n))}function Tc(e,t,n){try{return Ec(e,t,n)}finally{wc()}}function Ec(e,t,n=!1){let r=Wc(e),i=r?Nc(e):Pc(e),a,o=[];for(let e of i){if(r&&!h.test(e)){if(a==null)a=$(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!r&&!Fc(e)){if(a==null)a=$(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=Oc(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function Dc(e,t){try{return Oc(e,t)}finally{wc()}}function Oc(e,{cacheKey:t,isGitDiff:n=h.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=Gc(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=Mc(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=Vc(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?jc(i.contents):[],deletionLines:!l&&r!=null&&i!=null?jc(r.contents):[],cacheKey:qc(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(b),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=$(r.trim()),n!==r&&(c.prevName=$(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?y:v):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=$(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=$(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=$(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=$(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=$(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=$(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(x)??[];t!=null&&(c.prevObjectId=$(t)),n!=null&&(c.newObjectId=$(n)),r!=null&&(c.mode=$(r))}e.startsWith(`rename from `)&&(c.prevName=$(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=$(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
1396
|
-
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
1397
|
-
`||s[s.length-1]===``);)s.pop();let{additionStart:S,deletionStart:C}=p;u=l?u:C-1,d=l?d:S-1;let w={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:S,additionLines:m,deletionCount:p.deletionCount,deletionStart:C,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:qc(p.hunkContext),hunkSpecs:$(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},T=0,E=0;for(let e=1;e<s.length;e++){let t=s[e];if(T>=w.additionCount&&E>=w.deletionCount&&!t.startsWith(`\\`)){if(a&&zc(t)&&!Bc(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=Jc(n);if(r===`addition`){if(a&&T>=w.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=Yc(t);(g==null||g.type!==`change`)&&(g=Xc(`change`,u,d),w.hunkContent.push(g)),d++,T++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&E>=w.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=Yc(t);(g==null||g.type!==`change`)&&(g=Xc(`change`,u,d),w.hunkContent.push(g)),u++,E++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(E>=w.deletionCount||T>=w.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=Yc(t);(g==null||g.type!==`context`)&&(g=Xc(`context`,u,d),w.hunkContent.push(g)),d++,u++,T++,E++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(w.noEOFCRAdditions=!0,w.noEOFCRDeletions=!0):_===`deletion`?w.noEOFCRDeletions=!0:_===`addition`&&(w.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=X(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=X(c.deletionLines[e]))}}}if(a&&(T!==w.additionCount||E!==w.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);w.additionLines=m,w.deletionLines=h,w.collapsedBefore=Math.max(w.additionStart-1-o,0),c.hunks.push(w),o=w.additionStart+w.additionCount-1;for(let e of w.hunkContent)e.type===`context`?(w.splitLineCount+=e.lines,w.unifiedLineCount+=e.lines):(w.splitLineCount+=Math.max(e.additions,e.deletions),w.unifiedLineCount+=e.deletions+e.additions);w.splitLineStart=c.splitLineCount+w.collapsedBefore,w.unifiedLineStart=c.unifiedLineCount+w.collapsedBefore,c.splitLineCount+=w.collapsedBefore+w.splitLineCount,c.unifiedLineCount+=w.collapsedBefore+w.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function kc(e,t,n=!1){let r=[],i=Ac(e)?e.split(m):[e];for(let e of i)try{r.push(Tc(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function Ac(e){return e.startsWith(`From `)||e.includes(`
|
|
1398
|
-
From `)}function jc(e){let t=Mc(e);for(let e=0;e<t.length;e++)t[e]=$(t[e]);return t}function Mc(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
1399
|
-
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function Nc(e){return Gc(e,`diff --git`)}function Pc(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=Rc(e,r);if(i<=0&&a<=0){if(Ic(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=Rc(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=Vc(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function Fc(e){return Ic(e,0)}function Ic(e,t){let n=Rc(e,t);return Lc(e,t,`---`)&&Lc(e,n,`+++`)}function Lc(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
|
|
1400
|
-
`||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function Rc(e,t){let n=e.indexOf(`
|
|
1401
|
-
`,t);return n===-1?e.length:n+1}function zc(e){let t=e[0];return t===`+`||t===`-`||t===` `}function Bc(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
1402
|
-
`&&n!==`\r`)return!1}return!0}function Vc(e){if(!e.startsWith(`@@ -`))return;let t=4,n=Hc(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=Hc(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=Hc(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=Hc(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=Uc(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function Hc(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function Uc(e){return e.endsWith(`\r
|
|
1403
|
-
`)?e.slice(0,-2):e.endsWith(`
|
|
1404
|
-
`)?e.slice(0,-1):e}function Wc(e){return e.startsWith(`diff --git`)||e.includes(`
|
|
1405
|
-
diff --git`)}function Gc(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:Kc(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=Kc(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function Kc(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function qc(e){return e==null?e:$(e)}function Jc(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function Yc(e){let t=e.slice(1);return $(t===``?`
|
|
1406
|
-
`:t)}function Xc(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}function Zc(e,t,n,r=!1){let i=Dc(c(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var Qc=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 $c(e){return W({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function el(e){return W({tagName:`div`,children:[W({tagName:`span`,children:[U(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function tl(e){return W({tagName:`div`,children:[fa({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 nl({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(W({tagName:`div`,children:[U(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(tl(`up`)),s++),o||(e.push(tl(`down`)),s++)):(e.push(tl(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(W({tagName:`div`,children:[W({tagName:`span`,children:[U(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(W({tagName:`div`,children:[U(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(W({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(W({tagName:`slot`,properties:{name:i}})),W({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 rl(e,t){return`hunk-separator-${e}-${t}`}function il(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function al(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function ol(e){return e===``?[]:e.split(_)}function sl(e,t){let n=Zc({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 cl(e,t){let n=e.deletionLines.join(``),r=n===`
|
|
1407
|
-
`?`
|
|
1408
|
-
`:`
|
|
1409
|
-
`,i=Zc({name:e.prevName??e.name,contents:n},{name:e.name,contents:r,lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:[``],deletionLines:i.deletionLines,type:i.type}}function ll(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return ul(e,sl(e,n));let r=Array.from(t);if(r.length===0)return ul(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||X(r)===X(i))return ul(e,sl(e,n))}let i=dl(e,r);if(i.size===0)return ul(e,sl(e,n));for(let t of i)if(!pl(e,t,n))return ul(e,sl(e,n));return vl(e),Qa(e)?ul(e,sl(e,n)):ul(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function ul(e,t){return Object.assign(e,t),t}function dl(e,t){let n=new Set;for(let r of t){let t=fl(e,r);if(t==null)return new Set;n.add(t)}return n}function fl(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 pl(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=Zc({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:(hl(r,s),ml(e,t),!0)}function ml(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(`
|
|
1410
|
-
`),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
|
|
1411
|
-
`)}function hl(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>gl(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,_l(e)}function gl(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function _l(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 vl(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,_l(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}var yl=-1,bl=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++yl}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:E},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Ss(e.theme??E)?Zi():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)}getRenderDiff(){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)??te}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return;let{result:r,diff:i}=this.renderCache;if(r==null)return;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[];for(let[n,r]of e){let e=a[n]?.properties??{},s=r.map(e=>e[2]).join(``),c=n<i.additionLines.length,l=c?i.additionLines[n]??``:``,u=X(l);c&&(i.additionLines[n]=Al(l,s),u!==s&&o.push(n)),a[n]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??n+1,"data-line-index":e[`data-line-index`]??n,"data-line-type":e[`data-line-type`]??`context`},children:r.map(([e,n,r])=>e===0&&n===``?r===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:r}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`--diffs-token-${t}:${n};`},children:[{type:`text`,value:r}]})}}!n&&o.length>0&&Object.assign(i,ll(i,o,this.options.parseDiffOptions)),r.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;t.additionLines=ol(e.getText());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]??=kl(t,e);t.isPartial||(r===0?(Object.assign(t,cl(t,this.options.parseDiffOptions)),i[0]=kl(0,e)):Object.assign(t,sl(t,this.options.parseDiffOptions))),this.renderCache.isDirty=!0}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>Cs(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=E,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=A,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 Xi(js(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=jl(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!J(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Ka(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??H(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:Ms(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!Ga(e,n.diff)||!J(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=ne){if(e==null)return;let{expandUnchanged:n=!1,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||Ka(e)||jl(e,this.getTokenizeMaxLength()),l=!Ga(e,this.renderCache.diff),u=!bs(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,al(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??H(e.name);let t=this.highlighter!=null&&Ss(i.theme),n=this.highlighter!=null&&xs(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=ne){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 ks({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=jl(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??H(e.name);let n=this.highlighter!=null&&Ss(this.options.theme??E),r=t||this.highlighter!=null&&xs(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:vo(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||!J(this.renderCache.options,n)||!Ga(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||!J(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Ga(e,n.diff)&&J(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1;this.diff=e;let f=a===`unified`,p=[],m=[],h=[],g=[],{additionLines:_,deletionLines:v}=n,y={rowCount:0,hunkSeparators:u,additionsContentAST:p,deletionsContentAST:m,unifiedContentAST:h,unifiedGutterAST:ma(),deletionsGutterAST:ma(),additionsGutterAST:ma(),expansionLineCount:c,hunkData:g,incrementRowCount(e=1){y.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:y.unifiedGutterAST.children.push(t);break;case`deletions`:y.deletionsGutterAST.children.push(t);break;case`additions`:y.additionsGutterAST.children.push(t)}}},b=$a({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),x={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`?(y.pushToGutter(`additions`,G(void 0,`buffer`,this.size)),p?.push($c(this.size))):(y.pushToGutter(`deletions`,G(void 0,`buffer`,this.size)),m?.push($c(this.size))),this.size=0,this.side=void 0}}},S=(e,t,n,r,i)=>{y.pushToGutter(e,ha(t,n,r,i))};function C(e){x.flush(),a===`unified`?Dl(`unified`,e,y):(Dl(`deletions`,e,y),Dl(`additions`,e,y))}this.pushFileLevelAnnotations(e,a,t,y),so({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&x.flush(),r>0&&C({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let p=a===`unified`?f:l,m={type:c,hunkIndex:t,lineIndex:p,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(m);n?.before!=null&&wl(n.before,y);let r=s==null?void 0:v[s.lineIndex],i=o==null?void 0:_[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});S(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Ol(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Ol(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),El({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,p),createAnnotationElement:e=>this.createAnnotationElement(e),context:y}),n?.after!=null&&wl(n.after,y)}else{let n=this.getSplitInjectedRowsForLine?.(m);n?.before!=null&&Tl(n.before,y,x);let r=s==null?void 0:v[s.lineIndex],i=o==null?void 0:_[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(f!=null){if(x.side!=null&&x.side!==f)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);x.side=f,x.increment()}let h=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,p);if(h!=null&&x.size>0&&x.flush(),s!=null){let e=Ol(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);S(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Ol(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);S(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}El({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...h,createAnnotationElement:e=>this.createAnnotationElement(e),context:y}),n?.after!=null&&Tl(n.after,y,x)}let h=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,g=h?n.noEOFCRDeletions:!1,w=h?n.noEOFCRAdditions:!1,T=(s?.noEOFCR??!1)||g,E=(o?.noEOFCR??!1)||w;if(E||T){if(a===`split`&&x.flush(),T){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(y.unifiedContentAST.push(el(e)),y.pushToGutter(`unified`,G(e,`metadata`,1))):(y.deletionsContentAST.push(el(e)),y.pushToGutter(`deletions`,G(e,`metadata`,1)),E||(y.pushToGutter(`additions`,G(void 0,`buffer`,1)),y.additionsContentAST.push($c(1))))}if(E){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(y.unifiedContentAST.push(el(e)),y.pushToGutter(`unified`,G(e,`metadata`,1))):(y.additionsContentAST.push(el(e)),y.pushToGutter(`additions`,G(e,`metadata`,1)),T||(y.pushToGutter(`deletions`,G(void 0,`buffer`,1)),y.deletionsContentAST.push($c(1))))}y.incrementRowCount(1)}i>0&&u!==`simple`&&C({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:b,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),y.incrementRowCount(1)}}),a===`split`&&x.flush();let w=Math.max(il(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),T=t.bufferBefore>0||t.bufferAfter>0,E=!f&&e.type!==`deleted`,D=!f&&e.type!==`new`,O=y.rowCount>0||T;p=E&&O?p:void 0,m=D&&O?m:void 0,h=f&&O?h:void 0;let k=this.createPreElement(m!=null&&p!=null,w);return{unifiedGutterAST:f&&O?y.unifiedGutterAST.children:void 0,unifiedContentAST:h,deletionsGutterAST:D&&O?y.deletionsGutterAST.children:void 0,deletionsContentAST:m,additionsGutterAST:E&&O?y.additionsGutterAST.children:void 0,additionsContentAST:p,hunkData:g,preNode:k,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:w,rowCount:y.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=ma(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,ws(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(W({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(W({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(W({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return i(this.renderFullAST(e,t))}renderPartialHTML(e,t){return i(t==null?e:W({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(!Jo(n))return;let i=e.type===`new`?[]:xl(qo(this.deletionAnnotations)),a=e.type===`deleted`?[]:xl(qo(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){El({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}El({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(M(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(M(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 Es({fileOrDiff:e,mode:t,stickyHeader:n})}};function xl(e){return e?.map(e=>M(e))??[]}var Sl=new Intl.PluralRules(`en-US`);function Cl(e){return`${e} unmodified line${Sl.select(e)===`one`?``:`s`}`}function wl(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Tl(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 El({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`,G(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`,G(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`,G(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Dl(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,nl({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(nl({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,nl({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(nl({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=rl(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,nl({type:c.hunkSeparators,content:Cl(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(nl({type:c.hunkSeparators,content:Cl(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Ol(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function kl(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 Al(e,t){return e.endsWith(`\r
|
|
1412
|
-
`)?t+`\r
|
|
1413
|
-
`:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
|
|
1414
|
-
`)?t+`
|
|
1415
|
-
`:t}function jl(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Ml(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Nl(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function Pl(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,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}var Fl=-1,Il=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Fl}`;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;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;fastRefreshTimeout;constructor(e={theme:E},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new hs,this.scrollSyncManager=new Qc,this.interactionManager=new Zo(`diff`,Qo(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 Pl(e)}createHunksRenderer(e){return new bl(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.hunksRenderer.getRenderDiff()??this.fileDiff;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}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(Qo(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!de(this.appliedThemeCSS.theme,this.options.theme??E)}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.interactionManager.setSelection(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,t===`wrap`),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.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=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),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(),this.editor=void 0,this.fastRefreshTimeout!=null&&(clearTimeout(this.fastRefreshTimeout),this.fastRefreshTimeout=void 0)}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),zl(this.pre,Ll({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||Bl(this.headerElement,Rl({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),ic(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!=null&&n!=null?Zc(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.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:a=!1,lineAnnotations:o,fileContainer:s,containerWrapper:c,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);this.editor?.__postponeBackgroundTokenizeToNextFrame();let{collapsed:u=!1,themeType:d=`system`}=this.options,f=u?void 0:l,p=this.hasThemeChanged(),m=e!=null&&t!=null&&(!F(e,this.deletionFile)||!F(t,this.additionFile)),h=n!=null&&n!==this.fileDiff,g=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations;if(!u&&bs(f,this.renderRange)&&!i&&!g&&!p&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);let{renderRange:_}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&m&&(h=!0,this.fileDiff=Zc(e,t,this.options.parseDiffOptions)):this.fileDiff=n,h&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:v=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,c),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,re);e!=null&&this.applyThemeState(s,e.themeStyles,d,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(i,g,m||h||p)&&this.applyPartialRender({previousRenderRange:_,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,t.themeStyles,d,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,s),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,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||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)}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiff;e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(r=>{e.__syncRenderView(r,t,n,this.lineAnnotations,this.renderRange)})}attachEditor(e){return this.editor?.cleanUp(),this.editor=e,this.interactionManager.setEditorAttached(!0),this.syncRenderViewToEditor(),()=>{this.editor=void 0,this.interactionManager.setEditorAttached(!1)}}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.getRenderDiff();n!=null&&(this.fileDiff=n),this.rerender(),this.interactionManager.setSelectionDirty(),t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations())}rerenderFromDocument(e){this.hunksRenderer.applyDocumentChange(e);let t=this.hunksRenderer.getRenderDiff();t!=null&&(this.fileDiff=t),this.hunksRenderer.clearRenderCache(),this.rerender()}updateRenderCache(e,t,n,r){this.hunksRenderer.updateRenderCache(e,t,r),n===!0&&(this.options.diffStyle===`split`?(this.fastRefreshTimeout!=null&&clearTimeout(this.fastRefreshTimeout),this.fastRefreshTimeout=setTimeout(()=>{this.fastRefreshTimeout=void 0,this.fastRefreshDiffView()},100)):this.refreshDiffView())}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}primeHighlightCache(){let{fileDiff:e,workerManager:t}=this;if(e==null||t==null||Ka(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(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||!Nl(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}-${M(r)}`,a=this.annotationCache.get(i);if(a==null||!Ml(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:Vs(M(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=Hs();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:Wo(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):Wo(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=Is;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??i(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:a,renderHeaderPrefix:o,renderHeaderFilenameSuffix:s,renderHeaderMetadata:c}=this.options;if(a!=null){let e=a(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,T,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let l=o?.(n)??void 0,u=s?.(n)??void 0,d=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,S,l),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,C,u),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,w,d),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??=Us(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Xs(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??E,s=typeof o==`string`?o:{...o},c=Gs(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=nc({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:Zs(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=Qs(this.themeCSSStyle.textContent??``,Gs(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=tc({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=tc({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=tc({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`)}fastRefreshDiffView(){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=Vl(r?.[0]),a=Vl(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])}refreshDiffView(){let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(this.options.diffStyle??`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null)return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),a=Vl(r?.[0]),o=Vl(r?.[1]);for(let[e,t]of[[n.gutter,a],[n.content,o]])t!=null&&(e.innerHTML=i(t))};Array.isArray(t)?(n(`deletions`,t[0]),n(`additions`,t[1])):n(`unified`,t),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Vl(t[0]),i=Vl(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}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`&&t!=null&&n!=null,totalLines:r,customProperties:i};Rs(u,this.appliedPreAttributes)||(ac(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 Ll({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Rl({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function zl(e,t,n=!1){return!n&&e==null&&t}function Bl(e,t,n=!1){return e==null&&t&&!n}function Vl(e){if(e!=null&&e.type===`element`)return e.children??[]}var Hl=5e3,Ul=-1,Wl=class extends Il{__id=`little-virtualized-file-diff:${++Ul}`;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;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=qa(n)}setMetrics(e,t=!1){let n=qa(e);!t&&Io(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&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Ko(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!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=!Lo(t,e),r=n&&Ql(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:$l(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}={}){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.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}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&&Jo(this.renderRange)){let t=Gl(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=tu(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&&(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,r){let i=!Ga(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=qa(n.metrics),o=!0,s=!0);let{collapsed:c=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!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=Y(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return so({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=ao({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=oo({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}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??Y(this.metrics,t)+this.cache.fileAnnotationHeight,l;return so({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=ao({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=oo({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.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};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}),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){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1}=this.options,a=Y(this.metrics,r);if(this.height+=a,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();let e=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:i}=gc({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;let e=this.fileContainer.getBoundingClientRect();e.height!==this.height&&(this.fileDiff.name,e.height,this.height)}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:a,...o}={}){let{forceRenderOverride:s,isSetup:c}=this;this.forceRenderOverride=void 0;let l=this.syncLineAnnotations(a);if(l&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=r??(t!=null&&n!=null?Zc(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(c)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();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())return this.renderPlaceholder(this.height);let u=this.virtualizer.getWindowSpecs(),d=this.top??0,f=this.computeRenderRangeFromWindow(this.fileDiff,d,u);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:f,oldFile:t,newFile:n,lineAnnotations:a,forceRender:(s??i)||l,...o})}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 eu(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),a=this.getHunkSeparatorType(),o=t?!0:this.hunksRenderer.getExpandedHunksMap(),s=Kl(this.cache.heightDeltas),c=Y(this.metrics,e)+this.cache.fileAnnotationHeight,l=0,u=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=l,o=l+e,u=Yl(a);for(;u<o;){let e=u-a,r=c+(e>0?n:0)+e*this.metrics.lineHeight+Xl(i,e)*this.metrics.lineHeight+ql(s,t,t+e);this.cache.checkpoints.push({renderedLineIndex:u,lineIndex:t+e,top:r}),u+=Hl}c+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+ql(s,t,t+e)+r,l=o};for(let e=0;e<this.fileDiff.hunks.length;e++){let t=this.fileDiff.hunks[e];if(t==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let s=Za({isPartial:this.fileDiff.isPartial,rangeSize:t.collapsedBefore,expandedHunks:o,hunkIndex:e,collapsedContextThreshold:n}),c=s.collapsedLines>0?ao({type:a,metrics:this.metrics,hunkIndex:e,hunkSpecs:t.hunkSpecs})?.totalHeight??0:0;u({rowCount:s.fromStart,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.rangeSize});let l=c;u({rowCount:s.fromEnd,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.fromEnd,preSeparatorHeight:l}),s.fromEnd>0&&(l=0);let d=e===r?eo({fileDiff:this.fileDiff,hunkIndex:e,expandedHunks:o,collapsedContextThreshold:n,errorPrefix:`VirtualizedFileDiff`}):void 0,f=d!=null&&d.collapsedLines>0?oo({type:a,metrics:this.metrics})?.totalHeight??0:0,p=d==null?0:d.fromStart+d.fromEnd,m=i===`split`?t.splitLineCount:t.unifiedLineCount,h=i===`split`?t.splitLineStart:t.unifiedLineStart;u({rowCount:m,startLineIndex:h,preSeparatorHeight:l,postSeparatorHeight:p===0?f:0,metadataOffsets:Zl({diffStyle:i,hunk:t,rowCount:m})}),d!=null&&p>0&&u({rowCount:p,startLineIndex:h+m,postSeparatorHeight:f})}this.cache.totalLines=l}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}=Za({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=eo({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}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=this.height,f=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,l),p=Y(this.metrics,i),m=e.hunks.length>0?Ya(this.metrics):0,{fileAnnotationHeight:h}=this.cache,g=p+h,_=Math.max(0,d-p-h-m),v=this.hasFileAnnotations(e),y=t+p,b=h>0&&v&&y<r&&y+h>n;if(t<n-d||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};if(f<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),f=this.cache.totalLines>0?this.cache.totalLines:f;let x=Math.ceil(Math.max(r-n,0)/c),S=Math.ceil(x/s)*s+s,C=S/s,w=C,T=[],E=(n+r)/2,D=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-S*c*2),s),O=t+(D?.top??g),k=D?.renderedLineIndex??0,ee,A,j;if(so({diff:e,diffStyle:l,startingLine:D?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:i,collapsedBefore:a,collapsedAfter:o,deletionLine:c,additionLine:d})=>{let f=d==null?c.splitLineIndex:d.splitLineIndex,p=d==null?c.unifiedLineIndex:d.unifiedLineIndex,m=(d?.noEOFCR??!1)||(c?.noEOFCR??!1),h=(a>0?ao({type:u,metrics:this.metrics,hunkIndex:e,hunkSpecs:i?.hunkSpecs}):void 0)?.totalHeight??0;O+=h;let _=k%s===0,v=Math.floor(k/s);if(_&&(T[v]=O-(t+g+h),j!=null)){if(j<=0)return!0;j--}let y=this.getLineHeight(l===`split`?f:p,m);return O>n-y&&O<r&&(ee??=v),A==null&&O+y>E&&(A=v),j==null&&O>=r&&_&&(j=w),k++,O+=y,o>0&&(O+=oo({type:u,metrics:this.metrics})?.totalHeight??0),!1}}),ee==null)if(b)ee=0,A=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};A??=ee;let te=Math.round(A-C/2),ne=Math.max(0,Math.ceil(f/s)-C),re=Math.max(0,Math.min(te,ne)),M=re*s,N=te<0?S+te*s:S,P=T[re]??0,ie=M===0?0:h+P,ae=re+N/s,oe=ae<T.length?_-T[ae]:_-(O-t-g);return{startingLine:M,totalLines:N,bufferBefore:ie,bufferAfter:Math.max(0,oe)}}};function Gl(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===Go&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function Kl(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 ql({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=Jl(e,n);return(t[Jl(e,r)]??0)-(t[i]??0)}function Jl(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 Yl(e){return Math.ceil(e/Hl)*Hl}function Xl(e,t){let n=0;for(let r of e)r<t&&n++;return n}function Zl({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 Ql(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.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function $l(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function eu(e){return typeof e==`function`?`custom`:e??`line-info`}function tu(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}var nu=(0,N.createContext)(void 0);function ru(){return(0,N.useContext)(nu)}function iu(e,t){return typeof window>`u`&&t!=null?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,P.jsx)(P.Fragment,{children:e})}function au(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}var ou=1e3,su=ou*4,cu=[0,1e-6,.99999,1],lu={overscrollSize:ou,intersectionObserverMargin:su,resizeDebugging:!1},uu=0,du=-1,fu=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++du}`;config;type=`simple`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...lu,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:cu,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),Z(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),Z(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),Z(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=Uo({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(this.__id,e-uu,uu=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(this.__id,e-uu,uu=e))}t&&Z(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+pu(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),Z(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Z(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Z(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{e.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,Z(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Z(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;let n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){let e=Uo({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&au(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let r=this.getScrollAnchor(this.height),i=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&i.add(e);for(let e of this.instancesChanged)i.has(e)||e.onRender(t)&&i.add(e);this.scrollFix(r);for(let e of i)e.reconcileHeights();n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&Z(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=pu(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=pu(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=pu(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=pu(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);e!=null&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&Z(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function pu(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}var mu=(0,N.createContext)(void 0);function hu(){return(0,N.useContext)(mu)}var gu=typeof window>`u`?N.useEffect:N.useLayoutEffect;function _u({file:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c,contentEditable:l}){let u=hu(),d=r!==void 0,f=(0,N.useContext)(Fo),p=ru(),m=(0,N.useRef)(null),h=ue(r=>{if(r!=null){if(m.current!=null)throw Error(`File: An instance should not already exist when a node is created`);u==null?m.current=new cc(vu({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c?void 0:f,!0):m.current=new mc(vu({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),u,a,c?void 0:f,!0),m.current.hydrate({file:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(m.current==null)throw Error(`File: A File instance should exist when unmounting`);m.current.cleanUp(),m.current=null}});return gu(()=>{if(m.current==null)return;let i=vu({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),a=!Lo(m.current.options,i);m.current.setOptions(i),m.current.render({file:e,lineAnnotations:n,forceRender:a}),r!==void 0&&m.current.setSelectedLines(r)}),gu(()=>{if(l&&m.current!=null){if(p===void 0)throw Error(`File: Editor is not attached`);return p.edit(m.current)}},[l,p]),{ref:h,getHoveredLine:(0,N.useCallback)(()=>m.current?.getHoveredLine(),[])}}function vu({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:r,hasEditor:i,hasGutterRenderUtility:a}){let o=n&&i,s=t||a||r;if(!s&&!o)return e;let c={...e};return s&&(c={...c,controlledSelection:t,renderCustomHeader:r?f:e?.renderCustomHeader,renderGutterUtility:a?f:e?.renderGutterUtility}),o&&(c={...c,useTokenTransformer:!0,enableGutterUtility:!1,enableLineSelection:!1,lineHoverHighlight:`disabled`}),c}function yu({file:e,lineAnnotations:t,selectedLines:n,options:r,metrics:i,className:a,style:o,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,prerenderedHTML:f,renderGutterUtility:m,disableWorkerPool:h=!1,contentEditable:g=!1}){let{ref:_,getHoveredLine:v}=_u({file:e,options:r,metrics:i,lineAnnotations:t,selectedLines:n,prerenderedHTML:f,hasGutterRenderUtility:m!=null,hasCustomHeader:c!=null,disableWorkerPool:h,contentEditable:g});return(0,P.jsx)(p,{ref:_,className:a,style:o,children:iu(le({file:e,renderAnnotation:s,renderCustomHeader:c,renderHeaderPrefix:l,renderHeaderFilenameSuffix:u,renderHeaderMetadata:d,renderGutterUtility:m,lineAnnotations:t,getHoveredLine:v}),f)})}var bu=typeof window>`u`?N.useEffect:N.useLayoutEffect;function xu({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:a,hasGutterRenderUtility:o,hasCustomHeader:s,disableWorkerPool:c,contentEditable:l}){let u=hu(),d=r!==void 0,f=(0,N.useContext)(Fo),p=ru(),m=(0,N.useRef)(null),h=ue(r=>{if(r!=null){if(m.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);u==null?m.current=new Il(Su({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c?void 0:f,!0):m.current=new Wl(Su({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),u,a,c?void 0:f,!0),m.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(m.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);m.current.cleanUp(),m.current=null}});return bu(()=>{let{current:i}=m;if(i==null)return;let a=Su({controlledSelection:d,contentEditable:l,hasCustomHeader:s,hasEditor:p!==void 0,hasGutterRenderUtility:o,options:t}),c=!Lo(i.options,a);i.setOptions(a),i.render({forceRender:c,fileDiff:e,lineAnnotations:n}),r!==void 0&&i.setSelectedLines(r)}),bu(()=>{if(l&&m.current!=null){if(p===void 0)throw Error(`FileDiff: Editor is not attached`);return p.edit(m.current)}},[l,p]),{ref:h,getHoveredLine:(0,N.useCallback)(()=>m.current?.getHoveredLine(),[])}}function Su({options:e,controlledSelection:t,contentEditable:n,hasCustomHeader:r,hasEditor:i,hasGutterRenderUtility:a}){let o=n&&i,s=t||a||r;if(!s&&!o)return e;let c={...e};return s&&(c={...c,controlledSelection:t,renderCustomHeader:r?f:e?.renderCustomHeader,renderGutterUtility:a?f:e?.renderGutterUtility}),o&&(c={...c,useTokenTransformer:!0,enableGutterUtility:!1,enableLineSelection:!1,expandUnchanged:!0,lineHoverHighlight:`disabled`}),c}function Cu(e){let t=kc(e);if(t.length!==1)throw console.error(t),Error(`PatchDiff: Provided patch must include only 1 patch, with 1 diff`);let{files:n}=t[0];if(n.length!==1)throw console.error(n),Error(`FileDiff: Provided patch must contain exactly 1 file diff`);return n[0]}function wu({patch:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:a,style:o,prerenderedHTML:s,renderAnnotation:c,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f,renderGutterUtility:m,disableWorkerPool:h=!1,contentEditable:g=!1}){let _=Tu(e),{ref:v,getHoveredLine:y}=xu({fileDiff:_,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:m!=null,hasCustomHeader:l!=null,disableWorkerPool:h,contentEditable:g});return(0,P.jsx)(p,{ref:v,className:a,style:o,children:iu(se({fileDiff:_,renderCustomHeader:l,renderHeaderPrefix:u,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f,renderAnnotation:c,lineAnnotations:r,renderGutterUtility:m,getHoveredLine:y}),s)})}function Tu(e){return(0,N.useMemo)(()=>Cu(e),[e])}function Eu(e,t){try{let n=Ei({name:e,load:t});I.registerTheme(n.name,n.load)}catch(t){if(t instanceof ye){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}throw t}}function Du(e,t=10){let n=[],r;for(let i of e.split(`
|
|
1416
|
-
`)){let e=i.match(g);if(e!=null){r!=null&&(r.hunkLines.length>0&&(Ou(r,t,`trailing`),ku(r,n)),r=void 0);let a=parseInt(e[3]),o=parseInt(e[1]),s=parseInt(e[4]??`1`),c=parseInt(e[2]??`1`);isNaN(a)||isNaN(o)||isNaN(s)||isNaN(c)?n.push(i):r={additionStart:a,deletionStart:o,additionCount:0,deletionCount:0,hunkLines:[],contextLines:[]};continue}if(r==null){n.push(i);continue}if(i.startsWith(` `))r.contextLines.push(i);else if(i!==``){if(r.hunkLines.length>0&&r.contextLines.length>t*2){let e=r.contextLines.length-t*2,i=r.contextLines.slice(-t);Ou(r,t,`trailing`);let{additionCount:a,deletionCount:o}=r;ku(r,n),r={additionStart:r.additionStart+a+e,deletionStart:r.deletionStart+o+e,deletionCount:0,additionCount:0,contextLines:i,hunkLines:[]}}Ou(r,t,r.hunkLines.length===0?`leading`:`before-change`),r.hunkLines.push(i),i.startsWith(`+`)?r.additionCount+=1:i.startsWith(`-`)&&(r.deletionCount+=1)}}r!=null&&r.hunkLines.length>0&&(Ou(r,t,`trailing`),ku(r,n));let i=n.join(`
|
|
1417
|
-
`);return e.endsWith(`
|
|
1418
|
-
`)?`${i}\n`:i}function Ou(e,t,n){if(n===`leading`&&e.contextLines.length>t){let n=e.contextLines.length-t;e.contextLines.splice(0,n),e.additionStart+=n,e.deletionStart+=n}return n===`trailing`&&e.contextLines.length>t&&(e.contextLines.length=t),e.contextLines.length>0&&(e.hunkLines.push(...e.contextLines),e.additionCount+=e.contextLines.length,e.deletionCount+=e.contextLines.length,e.contextLines.length=0),e}function ku(e,t){t.push(`@@ -${Au(e.deletionStart,e.deletionCount)} +${Au(e.additionStart,e.additionCount)} @@`),t.push(...e.hunkLines)}function Au(e,t){return t===1?`${e}`:`${e},${t}`}var ju=`/assets/worker-D5gSN9Hw.js`;export{yu as a,Il as c,Dc as d,Lo as f,wu as i,Zc as l,F as m,Du as n,fu as o,Ao as p,Eu as r,Wl as s,ju as t,kc as u};
|