@fungi.computer/inkcap 0.18.0 → 0.18.2

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.
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-B8mrqUL5.js","./rolldown-runtime-hePW80VL.js","./html-XwrE-1r6.js","./javascript-obGGvMPs.js","./css-CNuuLpMC.js","./angular-ts-Bzix210W.js","./scss-YesllqfO.js","./apl-Dhin1L29.js","./xml-BlnrEAEy.js","./java-DdHNQ9hk.js","./json-DAgxKhMr.js","./astro-B-4NNgOP.js","./typescript-BydbNFcO.js","./postcss-BXeXVLqQ.js","./tsx-CUOciP0b.js","./blade-C6Gedziy.js","./html-derivative-i4STDFnl.js","./sql-DdD7vxS4.js","./bsl-_VjlB9mv.js","./sdbl-bTVj8UrX.js","./c-iCihek07.js","./cairo-DLTphjLi.js","./python-gzcpVVnB.js","./chapel-DmtgEXO_.js","./cobol-Cw2-KvLW.js","./coffee-CiiSLhB6.js","./cpp-71xkOQct.js","./regexp-DR20uMnK.js","./glsl-D5MA2a_X.js","./crystal-DGPAtLeY.js","./shellscript-Da78Ox-3.js","./edge-DCY0a-ow.js","./elixir-DP304Xio.js","./elm-o4NJxfws.js","./erb-C7MPl934.js","./ruby-B8JcIHv0.js","./haml-CwEpbK1d.js","./graphql-Ctjuxyvl.js","./jsx-gTgmArGx.js","./lua-FONpmTUP.js","./yaml-Du_6cdrH.js","./erlang-Cphh6RMH.js","./markdown-BYOwaDjH.js","./fortran-fixed-form-DEKoE2YW.js","./fortran-free-form-CYNrtFtB.js","./fsharp-D13ZGOAj.js","./gdresource-xMC7jr7x.js","./gdshader-CBce3t8t.js","./gdscript-DYvRD3hg.js","./git-commit-BSykSTBG.js","./diff-woXpYk--.js","./git-rebase-BDPpS8w6.js","./glimmer-js-BONyzAsu.js","./glimmer-ts-f9c0GCOe.js","./hack-Dh_ZLRbs.js","./handlebars-ryMP1rBR.js","./http-kmH8AyfE.js","./hurl-DCZHXKU4.js","./csv-Dx-8-gkx.js","./hxml-Dcm88srW.js","./haxe-C8oCnwJJ.js","./jinja-B-tLrNsM.js","./jison-CBjhYtSs.js","./julia-CXJVy74_.js","./r-BHcO8Vjq.js","./just-B9Xn_Dp4.js","./perl-DEgXgjuC.js","./latex-o9DRzaEe.js","./tex-BK-H2Wn4.js","./liquid-G0MH4h_m.js","./marko-DV5GrDmo.js","./less-DVTAwKKz.js","./mdc-BKfPFPZw.js","./nextflow-BJtWHP5T.js","./nextflow-groovy-DJMQeKeT.js","./nginx-BTMw9COX.js","./nim-B6yJ_yaC.js","./org-Ddi8Gs6E.js","./clojure-DqKBuwfJ.js","./csharp-oqKa8noW.js","./dart-CnvKMtbv.js","./docker-IyjqRm3v.js","./go-rLFTqkRN.js","./groovy-CacY0gHj.js","./ini-B5eOa1yu.js","./make-Dixweg8N.js","./objective-c-D1A_Heim.js","./ocaml-O90oeIOV.js","./php-B9UPq-vz.js","./vb-DOwzaHZ0.js","./raku-B3gFvitq.js","./rust-Cfkwpbl8.js","./scala-BiFt_7mu.js","./zig-CMLA9XwU.js","./xsl-BOPS8gLt.js","./pug-DkgDHZci.js","./qml-_a-QhfPD.js","./razor-BMJ0eI3p.js","./rst-BQCbfb9V.js","./cmake-Bj61d0ZC.js","./sas-CBpMWA2M.js","./shaderlab-TOUzSsQk.js","./hlsl-Cvrh5tZx.js","./shellsession-CVsQGYfZ.js","./soy-DEd-qcad.js","./sparql-D_iOobhT.js","./turtle-ByJddavk.js","./stata-CMv7m7Gi.js","./surrealql-BZoq2lXR.js","./svelte-Bj3Hmc9F.js","./templ-TjxbArHn.js","./ts-tags-Cc5do7zu.js","./twig-BVSnuTf-.js","./typst-C40W_gC6.js","./bat-qdxAdBWQ.js","./bibtex-Ci_nEsc7.js","./jsonc-CYpm1nAK.js","./log-BNLmms1o.js","./powershell-CCSX75yM.js","./swift-CyEgAFGc.js","./system-verilog-Dh5ihWbf.js","./verilog-B2gwz-sJ.js","./vue-BNQF7r6F.js","./vue-html-DkKkQnZL.js","./vue-vine-DFaKYU4X.js","./stylus-B6D30XZt.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,$n as r,$t as i,A as a,An as o,At as s,B as c,Bt as l,C as u,Ct as d,D as f,Dn as p,Dt as m,E as h,Et as g,F as _,Fn as v,Ft as y,G as b,Gn as x,Gt as S,H as C,Hn as ee,Ht as w,I as T,In as E,It as D,Ji as O,Jn as k,Jt as A,K as j,Kn as M,Kr as N,Kt as te,L as ne,Ln as re,Lt as P,M as ie,Mn as ae,Mt as F,N as oe,Nt as se,O as I,Ot as L,P as ce,Pn as R,Pt as le,Q as ue,Qn as z,Qt as de,Rn as fe,S as pe,St as me,T as he,Tn as ge,Tt as B,Un as _e,V as ve,Vt as ye,W as be,Wn as xe,Wt as Se,X as Ce,Xn as we,Xt as Te,Yi as Ee,Yn as V,Yt as De,Z as Oe,Zn as ke,Zt as Ae,_ as je,_n as Me,_t as Ne,an as Pe,ar as Fe,at as Ie,b as Le,bn as Re,bt as ze,cn as Be,cr as Ve,dt as He,en as Ue,er as We,et as Ge,fn as Ke,ft as qe,g as Je,gn as Ye,gt as Xe,h as Ze,hn as Qe,ht as $e,in as et,ir as tt,it as nt,j as rt,jn as it,jt as at,k as ot,kt as st,ln as ct,lt,m as ut,mn as dt,mt as ft,nn as H,nt as pt,on as mt,or as ht,ot as gt,p as _t,pi as vt,pn as yt,pt as bt,q as xt,qn as St,qr as Ct,qt as wt,rn as Tt,rr as Et,rt as Dt,sn as Ot,sr as kt,st as At,tn as jt,tr as Mt,tt as Nt,ut as Pt,vt as Ft,w as It,wn as Lt,wt as Rt,x as zt,xn as Bt,xt as Vt,y as Ht,yn as Ut,yt as Wt,z as Gt,zn as Kt,zt as qt}from"./tree-path-AxEg-Kjh.js";vt(`light.dark.latte.mocha.readout.readout-night.field-guide.field-guide-night.embed.embed-dark.phosphor.codec.paper.ember.tide.tape.sunrise.pirate-radio.pirate-radio-night.consulting.consulting-ink.consulting-night.consulting-night-ink.consulting-riso-latte.consulting-riso-latte-ink.consulting-riso-glomzy.consulting-riso-glomzy-ink.vishnu.coin.coin-night.chamfer`.split(`.`));var Jt=`data-theme`;function Yt(e){return e||(globalThis.document?.documentElement??null)}function Xt(e){let t=e.trim();if(t.length===0)throw TypeError(`Theme must be a non-empty string`);return t}function Zt(e,t){let n=Xt(e),r=Yt(t);r&&r.setAttribute(Jt,n)}function Qt(e){return Yt(e)?.getAttribute(Jt)??null}function $t(e,t){let n=Yt(t),r=globalThis,i=(n?.ownerDocument??null)?.defaultView?.MutationObserver??r.MutationObserver;if(!n||!i)return()=>void 0;let a=new i(t=>{if(!t.some(e=>e.type===`attributes`&&e.attributeName===Jt))return;let r=n.getAttribute(Jt);r&&e(r)});a.observe(n,{attributes:!0,attributeFilter:[Jt]});let o=!1;return()=>{o||(o=!0,a.disconnect())}}var U=O(),W=t(Ee(),1),en={neutral:`alert-neutral`,primary:`alert-primary`,secondary:`alert-secondary`,accent:`alert-accent`,success:`alert-success`,info:`alert-info`,warning:`alert-warning`,error:`alert-error`},tn=(0,W.forwardRef)(function({action:e,children:t,className:n,description:r,title:i,tone:a=`neutral`,...o},s){return(0,U.jsxs)(`div`,{...o,className:N(`alert caps-alert`,en[a],n),"data-tone":a,role:o.role??`alert`,ref:s,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i?(0,U.jsx)(`h3`,{className:`font-semibold`,children:i}):null,r?(0,U.jsx)(`p`,{className:`text-sm`,children:r}):null,t]}),e?(0,U.jsx)(`div`,{className:`shrink-0`,children:e}):null]})}),nn=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`],[`webp`,`image/webp`],[`svg`,`image/svg+xml`],[`avif`,`image/avif`]]),rn=new Map([[`mp4`,`video/mp4`],[`webm`,`video/webm`]]);function an(e){return nn.get(e.split(`.`).pop()?.toLowerCase()??``)}function on(e){return rn.get(e.split(`.`).pop()?.toLowerCase()??``)}function sn(e){let t=an(e);if(t)return{kind:`image`,mediaType:t};let n=on(e);if(n)return{kind:`video`,mediaType:n}}function cn(e){return e.toLowerCase().endsWith(`.md`)}async function ln(e,t){let n=t?.revision,r=await(await e()).arrayBuffer();if(t?.closed)return{kind:`closed`};if(t&&t.revision!==n)return{kind:`changed`};try{return{kind:`ready`,contents:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(r)}}catch{return{kind:`invalid-text`}}}async function un(e,t){let n=t?.revision,r=await e();return t?.closed?{kind:`closed`}:t&&t.revision!==n?{kind:`changed`}:{kind:`ready`,blob:r}}var dn=(0,W.createContext)(null),fn=(0,W.forwardRef)(function({children:e,defaultValue:t,onValueChange:n,value:r,...i},a){let[o,s]=(0,W.useState)(t),c=r??o,l=(0,W.useId)(),u=e=>{r===void 0&&s(e),n?.(e)},d=(e,t)=>`${l}-${e}-${encodeURIComponent(t)}`;return(0,U.jsx)(dn.Provider,{value:{onValueChange:u,panelId:e=>d(`panel`,e),selectedValue:c,tabId:e=>d(`tab`,e)},children:(0,U.jsx)(`div`,{...i,className:N(`w-full`,i.className),ref:a,children:e})})});function pn(){let e=(0,W.useContext)(dn);if(!e)throw Error(`Tabs parts must be used inside <Tabs>`);return e}var mn=(0,W.forwardRef)(function({className:e,variant:t=`bordered`,...n},r){return(0,U.jsx)(`div`,{...n,"aria-orientation":n[`aria-orientation`]??`horizontal`,className:N(t===`segmented`?`tabs caps-tabs-segmented w-full`:`tabs tabs-border flex w-full items-center gap-xs`,e),"data-variant":t,ref:r,role:`tablist`})}),hn=(0,W.forwardRef)(function({className:e,disabled:t,onClick:n,onKeyDown:r,value:i,...a},o){let s=pn(),c=s.selectedValue===i,l=e=>{let t=e.currentTarget.closest(`[role="tablist"]`);if(!(t instanceof HTMLElement))return;let n=Array.from(t.querySelectorAll(`[role="tab"]`)).filter(e=>!e.disabled&&e.getAttribute(`aria-disabled`)!==`true`),r=n.indexOf(e.currentTarget);if(r<0||n.length===0)return;let a;if(e.key===`ArrowRight`)a=(r+1)%n.length;else if(e.key===`ArrowLeft`)a=(r-1+n.length)%n.length;else if(e.key===`Home`)a=0;else if(e.key===`End`)a=n.length-1;else return;e.preventDefault();let o=n[a];o?.focus(),o&&s.onValueChange(o.dataset.tabValue??i)};return(0,U.jsx)(`button`,{...a,"aria-controls":s.panelId(i),"aria-disabled":t?!0:void 0,"aria-selected":c,className:N(`tab whitespace-nowrap text-base-content transition-colors focus-visible:outline-none focus-visible:ring-2 caps-focus-color`,c&&`tab-active`,e),"data-tab-value":i,disabled:t,id:s.tabId(i),onClick:e=>{n?.(e),!e.defaultPrevented&&!t&&s.onValueChange(i)},onKeyDown:e=>{r?.(e),e.defaultPrevented||l(e)},ref:o,role:`tab`,tabIndex:t?-1:c?0:-1,type:a.type??`button`})}),gn=(0,W.forwardRef)(function({children:e,className:t,forceMount:n=!1,value:r,...i},a){let o=pn(),s=o.selectedValue===r;return!s&&!n?null:(0,U.jsx)(`div`,{...i,"aria-labelledby":o.tabId(r),className:N(`mt-md focus-visible:outline-none`,t),hidden:!s,id:o.panelId(r),ref:a,role:`tabpanel`,tabIndex:0,children:e})});function _n(e){let t=(0,W.useRef)(e);return(0,W.useInsertionEffect)(()=>void(t.current=e)),(0,W.useCallback)((...e)=>t.current(...e),[])}var vn=(0,W.createContext)(void 0);function yn({children:e,createEditor:t}){let n=(0,W.useRef)(new WeakMap),r=_n(e=>{let r=n.current.get(e);if(r!=null)return r;let i=t(e);return n.current.set(e,i),i});return(0,U.jsx)(vn.Provider,{value:r,children:e})}function bn(){return(0,W.useContext)(vn)}var xn={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Sn={display:`contents`};function Cn(){return null}function wn(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Tn({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function En(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:Dn(n,e.startContentIndex)}}function Dn(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 On({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,U.jsxs)(U.Fragment,{children:[f==null?(0,U.jsxs)(U.Fragment,{children:[p!=null&&(0,U.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,U.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,U.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,U.jsx)(`div`,{slot:M,children:f}),o!=null&&l?.map((e,t)=>(0,U.jsx)(`div`,{slot:wn(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=kn(t,e);return(0,U.jsx)(`div`,{slot:n,style:Sn,children:c(t,d)},n)}),s!=null&&(0,U.jsx)(`div`,{slot:`gutter-utility-slot`,style:xn,children:s(u)})]})}function kn(e,t){let n=En(e,t);return n==null?void 0:Tn({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function An(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function jn(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Mn=new Set;function Nn(e){let t=[],n=new Set;for(let r of Pn(e.themes)){let e=Ln(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 Nn({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 Nn({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Pn(e){return Fn(e)?[e]:e}function Fn(e){return Ln(e)||In(e)}function In(e){return typeof e.name==`string`&&typeof e.load==`function`}function Ln(e){return typeof e.getThemes==`function`}function Rn(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var zn=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Bn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Vn=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Hn(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new zn(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 Bn(i));let c=r,l=s().then(e=>{let a=Rn(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 Vn(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 Un=Hn();function Wn(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Un.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Un.getResolvedTheme(n)??Un.seedResolvedTheme(n,e);Mn.has(n)||(Mn.add(n),t.loadThemeSync(e))}}var Gn=new Map,Kn=new Map,qn=new Map,Jn=new Set;function Yn(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Jn.has(n.name))continue;let e=Gn.get(n.name);e??(e=n,Gn.set(n.name,e)),Jn.add(e.name),t.loadLanguageSync(e.data)}}function Xn(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Zn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor,$n=Object.getOwnPropertyNames,er=Object.prototype.hasOwnProperty,tr=(e,t)=>{let n={};for(var r in e)Zn(n,r,{get:e[r],enumerable:!0});return t||Zn(n,Symbol.toStringTag,{value:`Module`}),n},nr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=$n(t),a=0,o=i.length,s;a<o;a++)s=i[a],!er.call(e,s)&&s!==n&&Zn(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Qn(t,s))||r.enumerable});return e},rr=(e,t,n)=>(nr(e,t,`default`),n&&nr(n,t,`default`)),ir=`modulepreload`,ar=function(e,t){return new URL(e,t).href},or={},G=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ar(t,n),t=s(t),t in or)return;or[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ir,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sr=[{id:`abap`,name:`ABAP`,import:(()=>G(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>G(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>G(()=>import(`./ada-C5qYipkI.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>G(()=>import(`./ahk-CA9gdOdF.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>G(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>G(()=>import(`./angular-html-B8mrqUL5.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>G(()=>import(`./angular-ts-Bzix210W.js`),__vite__mapDeps([5,0,1,2,3,4,6]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>G(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>G(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>G(()=>import(`./apl-Dhin1L29.js`),__vite__mapDeps([7,3,1,4,2,8,9,10]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>G(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>G(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>G(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>G(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>G(()=>import(`./astro-B-4NNgOP.js`),__vite__mapDeps([11,3,1,4,10,12,13,14]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>G(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>G(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>G(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>G(()=>import(`./beancount-D-usSTwE.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>G(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>G(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>G(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>G(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>G(()=>import(`./blade-C6Gedziy.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>G(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([18,19]),import.meta.url))},{id:`c`,name:`C`,import:(()=>G(()=>import(`./c-iCihek07.js`).then(e=>e.n),__vite__mapDeps([20,1]),import.meta.url))},{id:`c3`,name:`C3`,import:(()=>G(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>G(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>G(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>G(()=>import(`./chapel-DmtgEXO_.js`),__vite__mapDeps([23,20,1]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>G(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>G(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>G(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>G(()=>import(`./cobol-Cw2-KvLW.js`),__vite__mapDeps([24,2,1,3,4,9]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>G(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>G(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>G(()=>import(`./coffee-CiiSLhB6.js`),__vite__mapDeps([25,3,1]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>G(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>G(()=>import(`./coq-DuBRPxYg.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>G(()=>import(`./cpp-71xkOQct.js`).then(e=>e.n),__vite__mapDeps([26,1,27,28,20]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>G(()=>import(`./crystal-DGPAtLeY.js`),__vite__mapDeps([29,3,1,4,2,17,20,30]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>G(()=>import(`./csharp-oqKa8noW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>G(()=>import(`./css-CNuuLpMC.js`).then(e=>e.n),__vite__mapDeps([4,1]),import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>G(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>G(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>G(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>G(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>G(()=>import(`./dart-CnvKMtbv.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>G(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>G(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>G(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>G(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>G(()=>import(`./dotenv-_5a1GRtc.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>G(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>G(()=>import(`./edge-DCY0a-ow.js`),__vite__mapDeps([31,2,1,3,4,12,16]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>G(()=>import(`./elixir-DP304Xio.js`),__vite__mapDeps([32,2,1,3,4]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>G(()=>import(`./elm-o4NJxfws.js`),__vite__mapDeps([33,28,1,20]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>G(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>G(()=>import(`./erb-C7MPl934.js`),__vite__mapDeps([34,2,1,3,4,35,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>G(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([41,42]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>G(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>G(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>G(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>G(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([43,44]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>G(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>G(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([45,42]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>G(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([46,47,48]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>G(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>G(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>G(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>G(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>G(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([49,50]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>G(()=>import(`./git-rebase-BDPpS8w6.js`),__vite__mapDeps([51,30,1]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>G(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>G(()=>import(`./glimmer-js-BONyzAsu.js`),__vite__mapDeps([52,3,1,4,2,12]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>G(()=>import(`./glimmer-ts-f9c0GCOe.js`),__vite__mapDeps([53,3,1,4,2,12]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>G(()=>import(`./glsl-D5MA2a_X.js`).then(e=>e.n),__vite__mapDeps([28,1,20]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>G(()=>import(`./gn-ilITqXS6.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>G(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>G(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>G(()=>import(`./graphql-Ctjuxyvl.js`).then(e=>e.n),__vite__mapDeps([37,1,3,12,14,38]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>G(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>G(()=>import(`./hack-Dh_ZLRbs.js`),__vite__mapDeps([54,2,1,3,4,17]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>G(()=>import(`./haml-CwEpbK1d.js`).then(e=>e.n),__vite__mapDeps([36,1,3,4]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>G(()=>import(`./handlebars-ryMP1rBR.js`),__vite__mapDeps([55,3,1,4,2,40]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>G(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>G(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>G(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>G(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>G(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>G(()=>import(`./html-XwrE-1r6.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>G(()=>import(`./html-derivative-i4STDFnl.js`),__vite__mapDeps([16,2,1,3,4]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>G(()=>import(`./http-kmH8AyfE.js`),__vite__mapDeps([56,8,1,9,10,30,37,3,12,14,38]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>G(()=>import(`./hurl-DCZHXKU4.js`),__vite__mapDeps([57,8,1,9,58,37,3,12,14,38]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>G(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([59,60]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>G(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>G(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>G(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>G(()=>import(`./java-DdHNQ9hk.js`).then(e=>e.n),__vite__mapDeps([9,1]),import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>G(()=>import(`./javascript-obGGvMPs.js`).then(e=>e.n),__vite__mapDeps([3,1]),import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>G(()=>import(`./jinja-B-tLrNsM.js`),__vite__mapDeps([61,2,1,3,4]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>G(()=>import(`./jison-CBjhYtSs.js`),__vite__mapDeps([62,3,1]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>G(()=>import(`./json-DAgxKhMr.js`).then(e=>e.n),__vite__mapDeps([10,1]),import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>G(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>G(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>G(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>G(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>G(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>G(()=>import(`./jsx-gTgmArGx.js`).then(e=>e.n),__vite__mapDeps([38,1]),import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>G(()=>import(`./julia-CXJVy74_.js`),__vite__mapDeps([63,3,1,17,22,26,27,28,20,64]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>G(()=>import(`./just-B9Xn_Dp4.js`),__vite__mapDeps([65,3,1,12,22,30,35,4,2,8,9,17,20,26,27,28,36,37,14,38,39,40,66]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>G(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>G(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>G(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>G(()=>import(`./latex-o9DRzaEe.js`),__vite__mapDeps([67,68,1,64]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>G(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>G(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>G(()=>import(`./liquid-G0MH4h_m.js`),__vite__mapDeps([69,3,1,4,2,10]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>G(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>G(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>G(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>G(()=>import(`./lua-FONpmTUP.js`).then(e=>e.n),__vite__mapDeps([39,1,20]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>G(()=>import(`./luau-C2pBCSgt.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>G(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>G(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>G(()=>import(`./marko-DV5GrDmo.js`),__vite__mapDeps([70,4,1,6,12,71]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>G(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>G(()=>import(`./mdc-BKfPFPZw.js`),__vite__mapDeps([72,16,2,1,3,4,40,42]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>G(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>G(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>G(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>G(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>G(()=>import(`./moonbit-DgjMoLWr.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>G(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>G(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>G(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([73,74]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>G(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>G(()=>import(`./nginx-BTMw9COX.js`),__vite__mapDeps([75,39,1,20]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>G(()=>import(`./nim-B6yJ_yaC.js`),__vite__mapDeps([76,3,1,4,2,8,9,20,28,42]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>G(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>G(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>G(()=>import(`./nushell-DHYfO66s.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>G(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>G(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>G(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>G(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>G(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>G(()=>import(`./org-Ddi8Gs6E.js`),__vite__mapDeps([77,3,1,4,2,6,9,8,10,12,14,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,49,51,82,83,84,64,66,67,68,71,85,76,86,87,88,89,90,91,92,93,94]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>G(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>G(()=>import(`./perl-DEgXgjuC.js`),__vite__mapDeps([66,3,1,4,2,8,9,17]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>G(()=>import(`./php-B9UPq-vz.js`),__vite__mapDeps([88,3,1,4,2,8,9,10,17]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>G(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>G(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>G(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>G(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>G(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>G(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>G(()=>import(`./powershell-CCSX75yM.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>G(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>G(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>G(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>G(()=>import(`./pug-DkgDHZci.js`),__vite__mapDeps([95,3,1,4,2]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>G(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>G(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>G(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>G(()=>import(`./qml-_a-QhfPD.js`),__vite__mapDeps([96,3,1]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>G(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>G(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>G(()=>import(`./r-BHcO8Vjq.js`).then(e=>e.n),__vite__mapDeps([64,1]),import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>G(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>G(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>G(()=>import(`./razor-BMJ0eI3p.js`),__vite__mapDeps([97,2,1,3,4,79]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>G(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>G(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>G(()=>import(`./regexp-DR20uMnK.js`).then(e=>e.n),__vite__mapDeps([27,1]),import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>G(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>G(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>G(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>G(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>G(()=>import(`./rst-BQCbfb9V.js`),__vite__mapDeps([98,3,1,16,2,4,22,99,26,27,28,20,30,40,35,8,9,17,36,37,12,14,38,39]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>G(()=>import(`./ruby-B8JcIHv0.js`),__vite__mapDeps([35,3,1,4,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>G(()=>import(`./rust-Cfkwpbl8.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>G(()=>import(`./sas-CBpMWA2M.js`),__vite__mapDeps([100,17,1]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>G(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>G(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>G(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>G(()=>import(`./scss-YesllqfO.js`).then(e=>e.n),__vite__mapDeps([6,1,4]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>G(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>G(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([101,102]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>G(()=>import(`./shellscript-Da78Ox-3.js`).then(e=>e.n),__vite__mapDeps([30,1]),import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>G(()=>import(`./shellsession-CVsQGYfZ.js`),__vite__mapDeps([103,30,1]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>G(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>G(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>G(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>G(()=>import(`./soy-DEd-qcad.js`),__vite__mapDeps([104,2,1,3,4]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>G(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([105,106]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>G(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>G(()=>import(`./sql-DdD7vxS4.js`).then(e=>e.n),__vite__mapDeps([17,1]),import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>G(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>G(()=>import(`./stata-CMv7m7Gi.js`),__vite__mapDeps([107,17,1]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>G(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>G(()=>import(`./surrealql-BZoq2lXR.js`),__vite__mapDeps([108,3,1]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>G(()=>import(`./svelte-Bj3Hmc9F.js`),__vite__mapDeps([109,3,1,4,12,13]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>G(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>G(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>G(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>G(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>G(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>G(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>G(()=>import(`./templ-TjxbArHn.js`),__vite__mapDeps([110,3,1,4,82]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>G(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>G(()=>import(`./tex-BK-H2Wn4.js`).then(e=>e.n),__vite__mapDeps([68,1,64]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>G(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>G(()=>import(`./ts-tags-Cc5do7zu.js`),__vite__mapDeps([111,3,1,4,2,8,9,12,17,28,20]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>G(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>G(()=>import(`./tsx-CUOciP0b.js`).then(e=>e.n),__vite__mapDeps([14,1]),import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>G(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>G(()=>import(`./twig-BVSnuTf-.js`),__vite__mapDeps([112,3,1,4,6,22,35,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40,88,10]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>G(()=>import(`./typescript-BydbNFcO.js`).then(e=>e.n),__vite__mapDeps([12,1]),import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>G(()=>import(`./typespec-BRdr0IET.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>G(()=>import(`./typst-C40W_gC6.js`),__vite__mapDeps([113,3,1,4,2,6,9,8,10,12,14,114,115,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,45,49,51,82,83,55,84,116,64,63,66,67,68,71,117,85,86,88,89,90,91,92,94,118,95,119,120,112,121]),import.meta.url))},{id:`v`,name:`V`,import:(()=>G(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>G(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>G(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>G(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>G(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>G(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>G(()=>import(`./vue-BNQF7r6F.js`),__vite__mapDeps([122,3,1,4,2,10,12,16]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>G(()=>import(`./vue-html-DkKkQnZL.js`),__vite__mapDeps([123,3,1]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>G(()=>import(`./vue-vine-DFaKYU4X.js`),__vite__mapDeps([124,3,1,4,6,13,71,125]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>G(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>G(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>G(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>G(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>G(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>G(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>G(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>G(()=>import(`./xml-BlnrEAEy.js`).then(e=>e.n),__vite__mapDeps([8,1,9]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>G(()=>import(`./xsl-BOPS8gLt.js`),__vite__mapDeps([94,8,1,9]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>G(()=>import(`./yaml-Du_6cdrH.js`).then(e=>e.n),__vite__mapDeps([40,1]),import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>G(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>G(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],cr=Object.fromEntries(sr.map(e=>[e.id,e.import])),lr=Object.fromEntries(sr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),ur={...cr,...lr},dr=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>G(()=>import(`./andromeeda-WkhI09AS.js`),[],import.meta.url))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>G(()=>import(`./aurora-x-C7CFqhAd.js`),[],import.meta.url))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>G(()=>import(`./ayu-dark-CRu61w6_.js`),[],import.meta.url))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>G(()=>import(`./ayu-light-Dn6O_aYR.js`),[],import.meta.url))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>G(()=>import(`./ayu-mirage-CTjYAbs-.js`),[],import.meta.url))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>G(()=>import(`./catppuccin-frappe-cajlBOnJ.js`),[],import.meta.url))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>G(()=>import(`./catppuccin-latte--xESFuC4.js`),[],import.meta.url))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>G(()=>import(`./catppuccin-macchiato-BWwObfS9.js`),[],import.meta.url))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>G(()=>import(`./catppuccin-mocha-D73xC08V.js`),[],import.meta.url))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>G(()=>import(`./dark-plus-GAt2ZgX8.js`),[],import.meta.url))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>G(()=>import(`./dracula-C2uKkzgK.js`),[],import.meta.url))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>G(()=>import(`./dracula-soft-D1bVjxWZ.js`),[],import.meta.url))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>G(()=>import(`./everforest-dark-D-DlICQR.js`),[],import.meta.url))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>G(()=>import(`./everforest-light-CeVdGHYG.js`),[],import.meta.url))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>G(()=>import(`./github-dark-DwbbXv51.js`),[],import.meta.url))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>G(()=>import(`./github-dark-default-CxjRwzl6.js`),[],import.meta.url))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>G(()=>import(`./github-dark-dimmed-Cr1oaoul.js`),[],import.meta.url))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>G(()=>import(`./github-dark-high-contrast-B4qJZLZa.js`),[],import.meta.url))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>G(()=>import(`./github-light-CsVXhIlR.js`),[],import.meta.url))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>G(()=>import(`./github-light-default-DB_IwZa6.js`),[],import.meta.url))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>G(()=>import(`./github-light-high-contrast-DLgVeSB-.js`),[],import.meta.url))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>G(()=>import(`./gruvbox-dark-hard-DXm60lX3.js`),[],import.meta.url))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>G(()=>import(`./gruvbox-dark-medium-GE2thSmD.js`),[],import.meta.url))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>G(()=>import(`./gruvbox-dark-soft-04Cj-4VZ.js`),[],import.meta.url))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>G(()=>import(`./gruvbox-light-hard-K6wSn29D.js`),[],import.meta.url))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>G(()=>import(`./gruvbox-light-medium-CVy3aSlc.js`),[],import.meta.url))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>G(()=>import(`./gruvbox-light-soft-DNgJjaY0.js`),[],import.meta.url))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>G(()=>import(`./horizon-0-RkHfro.js`),[],import.meta.url))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>G(()=>import(`./horizon-bright-BgL2X9oq.js`),[],import.meta.url))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>G(()=>import(`./houston-KyjWKfuY.js`),[],import.meta.url))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>G(()=>import(`./kanagawa-dragon-DSre8v_Q.js`),[],import.meta.url))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>G(()=>import(`./kanagawa-lotus-Dm4hBNO9.js`),[],import.meta.url))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>G(()=>import(`./kanagawa-wave-CQy0MwzB.js`),[],import.meta.url))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>G(()=>import(`./laserwave-CQkdhozh.js`),[],import.meta.url))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>G(()=>import(`./light-plus-CNQ8_7Y0.js`),[],import.meta.url))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>G(()=>import(`./material-theme-CAtLaHa3.js`),[],import.meta.url))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>G(()=>import(`./material-theme-darker-k-s5Bc6K.js`),[],import.meta.url))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>G(()=>import(`./material-theme-lighter-CD6a-c4d.js`),[],import.meta.url))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>G(()=>import(`./material-theme-ocean-B3mraInd.js`),[],import.meta.url))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>G(()=>import(`./material-theme-palenight-DEhAARHw.js`),[],import.meta.url))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>G(()=>import(`./min-dark-BFqTAwCr.js`),[],import.meta.url))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>G(()=>import(`./min-light-O7UdaaxX.js`),[],import.meta.url))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>G(()=>import(`./monokai-B_bV9PQ9.js`),[],import.meta.url))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>G(()=>import(`./night-owl-BsnCLAKc.js`),[],import.meta.url))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>G(()=>import(`./night-owl-light-BODRhcTU.js`),[],import.meta.url))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>G(()=>import(`./nord-Cd-F4txO.js`),[],import.meta.url))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>G(()=>import(`./one-dark-pro-CLwyXe_n.js`),[],import.meta.url))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>G(()=>import(`./one-light-CVUd7yD5.js`),[],import.meta.url))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>G(()=>import(`./plastic-CF8VZTnn.js`),[],import.meta.url))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>G(()=>import(`./poimandres-BX2TyY6j.js`),[],import.meta.url))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>G(()=>import(`./red-DX1BQOs8.js`),[],import.meta.url))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>G(()=>import(`./rose-pine-DGV1HG6V.js`),[],import.meta.url))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>G(()=>import(`./rose-pine-dawn-B1XWDT40.js`),[],import.meta.url))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>G(()=>import(`./rose-pine-moon-BQK7uU5b.js`),[],import.meta.url))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>G(()=>import(`./slack-dark-DYvUXyrP.js`),[],import.meta.url))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>G(()=>import(`./slack-ochin-bqtMVDfH.js`),[],import.meta.url))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>G(()=>import(`./snazzy-light-D8dzFmq5.js`),[],import.meta.url))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>G(()=>import(`./solarized-dark-UdsmMDCL.js`),[],import.meta.url))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>G(()=>import(`./solarized-light-C1IUL_tW.js`),[],import.meta.url))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>G(()=>import(`./synthwave-84-CIknw8y7.js`),[],import.meta.url))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>G(()=>import(`./tokyo-night-iIspnLcq.js`),[],import.meta.url))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>G(()=>import(`./vesper-BIFK_oDq.js`),[],import.meta.url))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>G(()=>import(`./vitesse-black-D082JcaE.js`),[],import.meta.url))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>G(()=>import(`./vitesse-dark-z-nr_5O8.js`),[],import.meta.url))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>G(()=>import(`./vitesse-light-ojz42ZLy.js`),[],import.meta.url))}].map(e=>[e.id,e.import])),fr=e({createOnigurumaEngine:()=>Br,getDefaultWasmLoader:()=>zr,loadWasm:()=>Nr,setDefaultWasmLoader:()=>Rr}),pr=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function mr(){return 2147483648}function hr(){return typeof performance<`u`?performance.now():Date.now()}var gr=(e,t)=>e+(t-e%t)%t;async function _r(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=mr();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,gr(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:hr,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 vr=Object.defineProperty,yr=(e,t,n)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,br=(e,t,n)=>yr(e,typeof t==`symbol`?t:t+``,n),xr=null;function Sr(e){throw new pr(e.UTF8ToString(e.getLastOnigError()))}var Cr=class e{constructor(t){br(this,`utf16Length`),br(this,`utf8Length`),br(this,`utf16Value`),br(this,`utf8Value`),br(this,`utf16OffsetToUtf8`),br(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}},wr=class e{constructor(t){if(br(this,`id`,++e.LAST_ID),br(this,`_onigBinding`),br(this,`content`),br(this,`utf16Length`),br(this,`utf8Length`),br(this,`utf16OffsetToUtf8`),br(this,`utf8OffsetToUtf16`),br(this,`ptr`),!xr)throw new pr(`Must invoke loadWasm first.`);this._onigBinding=xr,this.content=t;let n=new Cr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=xr.omalloc(1e4),e._sharedPtrInUse=!0,xr.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(xr)}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)}};br(wr,`LAST_ID`,0),br(wr,`_sharedPtr`,0),br(wr,`_sharedPtrInUse`,!1);var Tr=wr,Er=class{constructor(e){if(br(this,`_onigBinding`),br(this,`_ptr`),!xr)throw new pr(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Cr(e[r]);t[r]=i.createString(xr),n[r]=i.utf8Length}let r=xr.omalloc(4*e.length);xr.HEAPU32.set(t,r/4);let i=xr.omalloc(4*e.length);xr.HEAPU32.set(n,i/4);let a=xr.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)xr.ofree(t[n]);xr.ofree(i),xr.ofree(r),a===0&&Sr(xr),this._onigBinding=xr,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 Tr(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 Dr(e){return typeof e.instantiator==`function`}function Or(e){return typeof e.default==`function`}function kr(e){return e.data!==void 0}function Ar(e){return typeof Response<`u`&&e instanceof Response}function jr(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 Mr;function Nr(e){if(Mr)return Mr;async function t(){xr=await _r(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Dr(n)?n=await n.instantiator(t):Or(n)?n=await n.default(t):(kr(n)&&(n=n.data),Ar(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Fr(n)(t):await Ir(n)(t):jr(n)||n instanceof WebAssembly.Module?n=await Pr(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Pr(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Mr=t(),Mr}function Pr(e){return t=>WebAssembly.instantiate(e,t)}function Fr(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ir(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Lr;function Rr(e){Lr=e}function zr(){return Lr}async function Br(e){return e&&await Nr(e),{createScanner(e){return new Er(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Tr(e)}}}var Vr=tr({});rr(Vr,fr);var K=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Hr(e){return Ur(e)}function Ur(e){return Array.isArray(e)?Wr(e):e instanceof RegExp?e:typeof e==`object`?Gr(e):e}function Wr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ur(e[n]);return t}function Gr(e){let t={};for(let n in e)t[n]=Ur(e[n]);return t}function Kr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function qr(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?qr(e.substring(0,e.length-1)):e.substr(~t+1)}var Jr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yr=class{static hasCaptures(e){return e!==null&&(Jr.lastIndex=0,Jr.test(e))}static replaceCaptures(e,t,n){return e.replace(Jr,(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 Xr(e,t){return e<t?-1:+(e>t)}function Zr(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=Xr(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Qr(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 $r(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ei=class{constructor(e){this.fn=e}fn;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}},ti=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}_colorMap;_defaults;_root;static createFromRawTheme(e,t){return this.createFromParsedTheme(oi(e),t)}static createFromParsedTheme(e,t){return li(e,t)}_cachedMatchRoot=new ei(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=>ri(e.parent,t.parentScopes));return n?new ai(n.fontStyle,n.foreground,n.background):null}},ni=class e{constructor(e,t){this.parent=e,this.scopeName=t}parent;scopeName;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 ri(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&&!ii(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ii(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ai=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function oi(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`&&Qr(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Qr(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 si(l,u,e,o,s,c)}}return n}var si=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}scope;parentScopes;index;fontStyle;foreground;background},ci=(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))(ci||{});function li(e,t){e.sort((e,t)=>{let n=Xr(e.scope,t.scope);return n!==0||(n=Zr(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 ui(t),o=new ai(n,a.getId(r),a.getId(i)),s=new pi(new fi(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 ti(a,o,s)}var ui=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)}},di=Object.freeze([]),fi=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||di,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},pi=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_mainRule;_children;_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(),fi.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(Zr(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 fi(e,t,n,r,i))}},mi=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=gi(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 hi(e){return e}function gi(e){return e}function _i(e,t){let n=[],r=yi(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(vi(i)){let e=[];do e.push(i),i=r.next();while(vi(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 vi(e){return!!e&&!!e.match(/[\w\.:]+/)}function yi(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 bi(e){typeof e.dispose==`function`&&e.dispose()}var xi=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},Si=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},Ci=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))}},wi=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xi(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Ci;for(let n of e)Ti(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof xi){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 Ti(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 xi?Di({baseGrammar:a,selfGrammar:i},r):Ei(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 xi(e))}function Ei(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Oi([r],t,n)}}function Di(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Oi(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Oi(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Oi(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Kr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Oi(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Pi(i);switch(a.kind){case 0:Di({...t,selfGrammar:t.baseGrammar},n);break;case 1:Di(t,n);break;case 2:Ei(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?Ei(a.ruleName,i,n):Di(i,n)}else a.kind===4?n.add(new Si(a.scopeName,a.ruleName)):n.add(new xi(a.scopeName))}}}var ki=class{kind=0},Ai=class{kind=1},ji=class{constructor(e){this.ruleName=e}ruleName;kind=2},Mi=class{constructor(e){this.scopeName=e}scopeName;kind=3},Ni=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function Pi(e){if(e===`$base`)return new ki;if(e===`$self`)return new Ai;let t=e.indexOf(`#`);return t===-1?new Mi(e):t===0?new ji(e.substring(1)):new Ni(e.substring(0,t),e.substring(t+1))}var Fi=/\\(\d+)/,Ii=/\\(\d+)/g,Li=-1,Ri=-2;function zi(e){return e}function Bi(e){return e}var Vi=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yr.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Yr.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${qr(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:Yr.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yr.replaceCaptures(this._contentName,e,t)}},Hi=class extends Vi{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!`)}},Ui=class extends Vi{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ji(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 Yi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Wi=class extends Vi{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 Yi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Gi=class extends Vi{_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 Ji(i,this.id),this.beginCaptures=a,this._end=new Ji(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 Yi;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}},Ki=class extends Vi{_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 Ji(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ji(o,Ri),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 Yi;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 Yi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},qi=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Hi(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ui(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Kr({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ki(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 Gi(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=Pi(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 Wi||e instanceof Gi||e instanceof Ki)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ji=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`&&Fi.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 Ii.lastIndex=0,this.source.replace(Ii,(e,t)=>$r(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}},Yi=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 Xi(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 Xi(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Xi=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;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(`
2
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,$n as r,$t as i,A as a,An as o,At as s,B as c,Bt as l,C as u,Ct as d,D as f,Dn as p,Dt as m,E as h,Et as g,F as _,Fn as v,Ft as y,G as b,Gn as x,Gt as S,H as C,Hn as ee,Ht as w,I as T,In as E,It as D,Jn as O,Jt as te,K as k,Kn as A,Kr as j,Kt as ne,L as re,Ln as ie,Lt as ae,M,Mn as oe,Mt as se,N,Nt as ce,O as le,Ot as P,P as F,Pn as ue,Pt as de,Q as I,Qn as fe,Qt as L,Rn as pe,S as me,St as he,T as ge,Tn as _e,Tt as ve,Un as R,V as ye,Vt as be,W as xe,Wn as z,Wt as Se,X as Ce,Xi as we,Xn as Te,Xt as Ee,Yn as B,Yt as De,Z as Oe,Zi as ke,Zn as Ae,Zt as je,_ as Me,_n as Ne,_t as Pe,an as Fe,ar as Ie,at as Le,b as Re,bn as ze,bt as Be,cn as Ve,cr as He,dt as Ue,en as We,er as Ge,et as Ke,fn as qe,ft as Je,g as Ye,gn as Xe,gt as Ze,h as Qe,hi as $e,hn as et,ht as tt,in as nt,ir as rt,it,j as at,jn as ot,jt as st,k as ct,kt as lt,ln as ut,lt as dt,m as ft,mn as pt,mt,nn as V,nt as ht,on as gt,or as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qn as Ct,qr as wt,qt as Tt,rn as Et,rr as Dt,rt as Ot,sn as kt,sr as At,st as jt,tn as Mt,tr as Nt,tt as Pt,ut as Ft,vt as It,w as Lt,wn as Rt,wt as zt,x as Bt,xn as Vt,xt as Ht,y as Ut,yn as Wt,yt as Gt,z as Kt,zn as qt,zt as Jt}from"./tree-path-u_q4dC9E.js";$e(`light.dark.latte.mocha.readout.readout-night.field-guide.field-guide-night.embed.embed-dark.phosphor.codec.paper.ember.tide.tape.sunrise.pirate-radio.pirate-radio-night.consulting.consulting-ink.consulting-night.consulting-night-ink.consulting-riso-latte.consulting-riso-latte-ink.consulting-riso-glomzy.consulting-riso-glomzy-ink.vishnu.coin.coin-night.chamfer`.split(`.`));var Yt=`data-theme`;function Xt(e){return e||(globalThis.document?.documentElement??null)}function Zt(e){let t=e.trim();if(t.length===0)throw TypeError(`Theme must be a non-empty string`);return t}function Qt(e,t){let n=Zt(e),r=Xt(t);r&&r.setAttribute(Yt,n)}function $t(e){return Xt(e)?.getAttribute(Yt)??null}function en(e,t){let n=Xt(t),r=globalThis,i=(n?.ownerDocument??null)?.defaultView?.MutationObserver??r.MutationObserver;if(!n||!i)return()=>void 0;let a=new i(t=>{if(!t.some(e=>e.type===`attributes`&&e.attributeName===Yt))return;let r=n.getAttribute(Yt);r&&e(r)});a.observe(n,{attributes:!0,attributeFilter:[Yt]});let o=!1;return()=>{o||(o=!0,a.disconnect())}}var H=we(),U=t(ke(),1),tn={neutral:`alert-neutral`,primary:`alert-primary`,secondary:`alert-secondary`,accent:`alert-accent`,success:`alert-success`,info:`alert-info`,warning:`alert-warning`,error:`alert-error`},nn=(0,U.forwardRef)(function({action:e,children:t,className:n,description:r,title:i,tone:a=`neutral`,...o},s){return(0,H.jsxs)(`div`,{...o,className:j(`alert caps-alert`,tn[a],n),"data-tone":a,role:o.role??`alert`,ref:s,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i?(0,H.jsx)(`h3`,{className:`font-semibold`,children:i}):null,r?(0,H.jsx)(`p`,{className:`text-sm`,children:r}):null,t]}),e?(0,H.jsx)(`div`,{className:`shrink-0`,children:e}):null]})}),rn=new Map([[`png`,`image/png`],[`jpg`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`gif`,`image/gif`],[`webp`,`image/webp`],[`svg`,`image/svg+xml`],[`avif`,`image/avif`]]),an=new Map([[`mp4`,`video/mp4`],[`webm`,`video/webm`]]);function on(e){return rn.get(e.split(`.`).pop()?.toLowerCase()??``)}function sn(e){return an.get(e.split(`.`).pop()?.toLowerCase()??``)}function cn(e){let t=on(e);if(t)return{kind:`image`,mediaType:t};let n=sn(e);if(n)return{kind:`video`,mediaType:n}}function ln(e){return e.toLowerCase().endsWith(`.md`)}async function un(e,t){let n=t?.revision,r=await(await e()).arrayBuffer();if(t?.closed)return{kind:`closed`};if(t&&t.revision!==n)return{kind:`changed`};try{return{kind:`ready`,contents:new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(r)}}catch{return{kind:`invalid-text`}}}async function dn(e,t){let n=t?.revision,r=await e();return t?.closed?{kind:`closed`}:t&&t.revision!==n?{kind:`changed`}:{kind:`ready`,blob:r}}var fn=(0,U.createContext)(null),pn=(0,U.forwardRef)(function({children:e,defaultValue:t,onValueChange:n,value:r,...i},a){let[o,s]=(0,U.useState)(t),c=r??o,l=(0,U.useId)(),u=e=>{r===void 0&&s(e),n?.(e)},d=(e,t)=>`${l}-${e}-${encodeURIComponent(t)}`;return(0,H.jsx)(fn.Provider,{value:{onValueChange:u,panelId:e=>d(`panel`,e),selectedValue:c,tabId:e=>d(`tab`,e)},children:(0,H.jsx)(`div`,{...i,className:j(`w-full`,i.className),ref:a,children:e})})});function mn(){let e=(0,U.useContext)(fn);if(!e)throw Error(`Tabs parts must be used inside <Tabs>`);return e}var hn=(0,U.forwardRef)(function({className:e,variant:t=`bordered`,...n},r){return(0,H.jsx)(`div`,{...n,"aria-orientation":n[`aria-orientation`]??`horizontal`,className:j(t===`segmented`?`tabs caps-tabs-segmented w-full`:`tabs tabs-border flex w-full items-center gap-xs`,e),"data-variant":t,ref:r,role:`tablist`})}),gn=(0,U.forwardRef)(function({className:e,disabled:t,onClick:n,onKeyDown:r,value:i,...a},o){let s=mn(),c=s.selectedValue===i,l=e=>{let t=e.currentTarget.closest(`[role="tablist"]`);if(!(t instanceof HTMLElement))return;let n=Array.from(t.querySelectorAll(`[role="tab"]`)).filter(e=>!e.disabled&&e.getAttribute(`aria-disabled`)!==`true`),r=n.indexOf(e.currentTarget);if(r<0||n.length===0)return;let a;if(e.key===`ArrowRight`)a=(r+1)%n.length;else if(e.key===`ArrowLeft`)a=(r-1+n.length)%n.length;else if(e.key===`Home`)a=0;else if(e.key===`End`)a=n.length-1;else return;e.preventDefault();let o=n[a];o?.focus(),o&&s.onValueChange(o.dataset.tabValue??i)};return(0,H.jsx)(`button`,{...a,"aria-controls":s.panelId(i),"aria-disabled":t?!0:void 0,"aria-selected":c,className:j(`tab whitespace-nowrap text-base-content transition-colors focus-visible:outline-none focus-visible:ring-2 caps-focus-color`,c&&`tab-active`,e),"data-tab-value":i,disabled:t,id:s.tabId(i),onClick:e=>{n?.(e),!e.defaultPrevented&&!t&&s.onValueChange(i)},onKeyDown:e=>{r?.(e),e.defaultPrevented||l(e)},ref:o,role:`tab`,tabIndex:t?-1:c?0:-1,type:a.type??`button`})}),_n=(0,U.forwardRef)(function({children:e,className:t,forceMount:n=!1,value:r,...i},a){let o=mn(),s=o.selectedValue===r;return!s&&!n?null:(0,H.jsx)(`div`,{...i,"aria-labelledby":o.tabId(r),className:j(`mt-md focus-visible:outline-none`,t),hidden:!s,id:o.panelId(r),ref:a,role:`tabpanel`,tabIndex:0,children:e})});function vn(e){let t=(0,U.useRef)(e);return(0,U.useInsertionEffect)(()=>void(t.current=e)),(0,U.useCallback)((...e)=>t.current(...e),[])}var yn=(0,U.createContext)(void 0);function bn({children:e,createEditor:t}){let n=(0,U.useRef)(new WeakMap),r=vn(e=>{let r=n.current.get(e);if(r!=null)return r;let i=t(e);return n.current.set(e,i),i});return(0,H.jsx)(yn.Provider,{value:r,children:e})}function xn(){return(0,U.useContext)(yn)}var Sn={position:`absolute`,top:0,bottom:0,textAlign:`center`,whiteSpace:`normal`,touchAction:`none`},Cn={display:`contents`};function wn(){return null}function Tn(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function En({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}function Dn(e,t){let n=t.hunks[e.hunkIndex];if(n!=null)return{hunkIndex:e.hunkIndex,lineIndex:On(n,e.startContentIndex)}}function On(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 kn({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderFilenameSuffix:i,renderHeaderMetadata:a,renderAnnotation:o,renderGutterUtility:s,renderMergeConflictUtility:c,lineAnnotations:l,getHoveredLine:u,getInstance:d}){let f=n?.(e),p=r?.(e),m=i?.(e),h=a?.(e);return(0,H.jsxs)(H.Fragment,{children:[f==null?(0,H.jsxs)(H.Fragment,{children:[p!=null&&(0,H.jsx)(`div`,{slot:`header-prefix`,children:p}),m!=null&&(0,H.jsx)(`div`,{slot:`header-filename-suffix`,children:m}),h!=null&&(0,H.jsx)(`div`,{slot:`header-metadata`,children:h})]}):(0,H.jsx)(`div`,{slot:A,children:f}),o!=null&&l?.map((e,t)=>(0,H.jsx)(`div`,{slot:Tn(e),children:o(e)},t)),t!=null&&c!=null&&d!=null&&t.map(t=>{if(t==null)return;let n=An(t,e);return(0,H.jsx)(`div`,{slot:n,style:Cn,children:c(t,d)},n)}),s!=null&&(0,H.jsx)(`div`,{slot:`gutter-utility-slot`,style:Sn,children:s(u)})]})}function An(e,t){let n=Dn(e,t);return n==null?void 0:En({hunkIndex:n.hunkIndex,lineIndex:n.lineIndex,conflictIndex:e.conflictIndex})}function jn(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Mn(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var Nn=new Set;function Pn(e){let t=[],n=new Set;for(let r of Fn(e.themes)){let e=Rn(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 Pn({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 Pn({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function Fn(e){return In(e)?[e]:e}function In(e){return Rn(e)||Ln(e)}function Ln(e){return typeof e.name==`string`&&typeof e.load==`function`}function Rn(e){return typeof e.getThemes==`function`}function zn(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Bn=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Vn=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Hn=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function Un(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new Bn(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 Vn(i));let c=r,l=s().then(e=>{let a=zn(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 Hn(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 Wn=Un();function Gn(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=Wn.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,Wn.getResolvedTheme(n)??Wn.seedResolvedTheme(n,e);Nn.has(n)||(Nn.add(n),t.loadThemeSync(e))}}var Kn=new Map,qn=new Map,Jn=new Map,Yn=new Set;function Xn(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Yn.has(n.name))continue;let e=Kn.get(n.name);e??(e=n,Kn.set(n.name,e)),Yn.add(e.name),t.loadLanguageSync(e.data)}}function Zn(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Qn=Object.defineProperty,$n=Object.getOwnPropertyDescriptor,er=Object.getOwnPropertyNames,tr=Object.prototype.hasOwnProperty,nr=(e,t)=>{let n={};for(var r in e)Qn(n,r,{get:e[r],enumerable:!0});return t||Qn(n,Symbol.toStringTag,{value:`Module`}),n},rr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=er(t),a=0,o=i.length,s;a<o;a++)s=i[a],!tr.call(e,s)&&s!==n&&Qn(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=$n(t,s))||r.enumerable});return e},ir=(e,t,n)=>(rr(e,t,`default`),n&&rr(n,t,`default`)),ar=`modulepreload`,or=function(e,t){return new URL(e,t).href},sr={},W=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=or(t,n),t=s(t),t in sr)return;sr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:ar,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},cr=[{id:`abap`,name:`ABAP`,import:(()=>W(()=>import(`./abap-CLvhMVsD.js`),[],import.meta.url))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>W(()=>import(`./actionscript-3-Cs6JJXT5.js`),[],import.meta.url))},{id:`ada`,name:`Ada`,import:(()=>W(()=>import(`./ada-C5qYipkI.js`),[],import.meta.url))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>W(()=>import(`./ahk-CA9gdOdF.js`),[],import.meta.url))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>W(()=>import(`./ahk2-_6rzW9BS.js`),[],import.meta.url))},{id:`angular-html`,name:`Angular HTML`,import:(()=>W(()=>import(`./angular-html-B8mrqUL5.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>W(()=>import(`./angular-ts-Bzix210W.js`),__vite__mapDeps([5,0,1,2,3,4,6]),import.meta.url))},{id:`apache`,name:`Apache Conf`,import:(()=>W(()=>import(`./apache-U0d_L8uA.js`),[],import.meta.url))},{id:`apex`,name:`Apex`,import:(()=>W(()=>import(`./apex-KFGFyKwG.js`),[],import.meta.url))},{id:`apl`,name:`APL`,import:(()=>W(()=>import(`./apl-Dhin1L29.js`),__vite__mapDeps([7,3,1,4,2,8,9,10]),import.meta.url))},{id:`applescript`,name:`AppleScript`,import:(()=>W(()=>import(`./applescript-CCn79oCD.js`),[],import.meta.url))},{id:`ara`,name:`Ara`,import:(()=>W(()=>import(`./ara-4CJ0cIlV.js`),[],import.meta.url))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>W(()=>import(`./asciidoc-SCjQUq34.js`),[],import.meta.url))},{id:`asm`,name:`Assembly`,import:(()=>W(()=>import(`./asm-Cmm7eHzH.js`),[],import.meta.url))},{id:`astro`,name:`Astro`,import:(()=>W(()=>import(`./astro-B-4NNgOP.js`),__vite__mapDeps([11,3,1,4,10,12,13,14]),import.meta.url))},{id:`awk`,name:`AWK`,import:(()=>W(()=>import(`./awk-BWXHIvNe.js`),[],import.meta.url))},{id:`ballerina`,name:`Ballerina`,import:(()=>W(()=>import(`./ballerina-B7ZEbQpA.js`),[],import.meta.url))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>W(()=>import(`./bat-qdxAdBWQ.js`),[],import.meta.url))},{id:`beancount`,name:`Beancount`,import:(()=>W(()=>import(`./beancount-D-usSTwE.js`),[],import.meta.url))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>W(()=>import(`./berry-DKpUyyne.js`),[],import.meta.url))},{id:`bibtex`,name:`BibTeX`,import:(()=>W(()=>import(`./bibtex-Ci_nEsc7.js`),[],import.meta.url))},{id:`bicep`,name:`Bicep`,import:(()=>W(()=>import(`./bicep-CUHmPFLl.js`),[],import.meta.url))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>W(()=>import(`./bird2-CYIUgYqB.js`),[],import.meta.url))},{id:`blade`,name:`Blade`,import:(()=>W(()=>import(`./blade-C6Gedziy.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17]),import.meta.url))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>W(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([18,19]),import.meta.url))},{id:`c`,name:`C`,import:(()=>W(()=>import(`./c-iCihek07.js`).then(e=>e.n),__vite__mapDeps([20,1]),import.meta.url))},{id:`c3`,name:`C3`,import:(()=>W(()=>import(`./c3-D0apG41V.js`),[],import.meta.url))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>W(()=>import(`./cadence-CQ2zXKGN.js`),[],import.meta.url))},{id:`cairo`,name:`Cairo`,import:(()=>W(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22]),import.meta.url))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>W(()=>import(`./chapel-DmtgEXO_.js`),__vite__mapDeps([23,20,1]),import.meta.url))},{id:`clarity`,name:`Clarity`,import:(()=>W(()=>import(`./clarity-CtfBBspg.js`),[],import.meta.url))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>W(()=>import(`./clojure-DqKBuwfJ.js`),[],import.meta.url))},{id:`cmake`,name:`CMake`,import:(()=>W(()=>import(`./cmake-Bj61d0ZC.js`),[],import.meta.url))},{id:`cobol`,name:`COBOL`,import:(()=>W(()=>import(`./cobol-Cw2-KvLW.js`),__vite__mapDeps([24,2,1,3,4,9]),import.meta.url))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>W(()=>import(`./codeowners-C8r90Shi.js`),[],import.meta.url))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>W(()=>import(`./codeql-oeQT6MSM.js`),[],import.meta.url))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>W(()=>import(`./coffee-CiiSLhB6.js`),__vite__mapDeps([25,3,1]),import.meta.url))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>W(()=>import(`./common-lisp-Cv5bFMCO.js`),[],import.meta.url))},{id:`coq`,name:`Rocq`,import:(()=>W(()=>import(`./coq-DuBRPxYg.js`),[],import.meta.url))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>W(()=>import(`./cpp-71xkOQct.js`).then(e=>e.n),__vite__mapDeps([26,1,27,28,20]),import.meta.url))},{id:`crystal`,name:`Crystal`,import:(()=>W(()=>import(`./crystal-DGPAtLeY.js`),__vite__mapDeps([29,3,1,4,2,17,20,30]),import.meta.url))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>W(()=>import(`./csharp-oqKa8noW.js`),[],import.meta.url))},{id:`css`,name:`CSS`,import:(()=>W(()=>import(`./css-CNuuLpMC.js`).then(e=>e.n),__vite__mapDeps([4,1]),import.meta.url))},{id:`csv`,name:`CSV`,import:(()=>W(()=>import(`./csv-Dx-8-gkx.js`),[],import.meta.url))},{id:`cue`,name:`CUE`,import:(()=>W(()=>import(`./cue-CE9AQfxI.js`),[],import.meta.url))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>W(()=>import(`./cypher-ClKdZ_lG.js`),[],import.meta.url))},{id:`d`,name:`D`,import:(()=>W(()=>import(`./d-qD-0Kul2.js`),[],import.meta.url))},{id:`dart`,name:`Dart`,import:(()=>W(()=>import(`./dart-CnvKMtbv.js`),[],import.meta.url))},{id:`dax`,name:`DAX`,import:(()=>W(()=>import(`./dax-BkyTk9wS.js`),[],import.meta.url))},{id:`desktop`,name:`Desktop`,import:(()=>W(()=>import(`./desktop-Dlh5hvp9.js`),[],import.meta.url))},{id:`diff`,name:`Diff`,import:(()=>W(()=>import(`./diff-woXpYk--.js`),[],import.meta.url))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>W(()=>import(`./docker-IyjqRm3v.js`),[],import.meta.url))},{id:`dotenv`,name:`dotEnv`,import:(()=>W(()=>import(`./dotenv-_5a1GRtc.js`),[],import.meta.url))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>W(()=>import(`./dream-maker-DW3nJb8Q.js`),[],import.meta.url))},{id:`edge`,name:`Edge`,import:(()=>W(()=>import(`./edge-DCY0a-ow.js`),__vite__mapDeps([31,2,1,3,4,12,16]),import.meta.url))},{id:`elixir`,name:`Elixir`,import:(()=>W(()=>import(`./elixir-DP304Xio.js`),__vite__mapDeps([32,2,1,3,4]),import.meta.url))},{id:`elm`,name:`Elm`,import:(()=>W(()=>import(`./elm-o4NJxfws.js`),__vite__mapDeps([33,28,1,20]),import.meta.url))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>W(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[],import.meta.url))},{id:`erb`,name:`ERB`,import:(()=>W(()=>import(`./erb-C7MPl934.js`),__vite__mapDeps([34,2,1,3,4,35,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40]),import.meta.url))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>W(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([41,42]),import.meta.url))},{id:`fennel`,name:`Fennel`,import:(()=>W(()=>import(`./fennel-DQxkIbk2.js`),[],import.meta.url))},{id:`fish`,name:`Fish`,import:(()=>W(()=>import(`./fish-BJitypiv.js`),[],import.meta.url))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>W(()=>import(`./fluent-C03EYrpw.js`),[],import.meta.url))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>W(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([43,44]),import.meta.url))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>W(()=>import(`./fortran-free-form-CYNrtFtB.js`),[],import.meta.url))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>W(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([45,42]),import.meta.url))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>W(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([46,47,48]),import.meta.url))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>W(()=>import(`./gdscript-DYvRD3hg.js`),[],import.meta.url))},{id:`gdshader`,name:`GDShader`,import:(()=>W(()=>import(`./gdshader-CBce3t8t.js`),[],import.meta.url))},{id:`genie`,name:`Genie`,import:(()=>W(()=>import(`./genie-CV2tkWYe.js`),[],import.meta.url))},{id:`gherkin`,name:`Gherkin`,import:(()=>W(()=>import(`./gherkin-DExj1W_8.js`),[],import.meta.url))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>W(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([49,50]),import.meta.url))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>W(()=>import(`./git-rebase-BDPpS8w6.js`),__vite__mapDeps([51,30,1]),import.meta.url))},{id:`gleam`,name:`Gleam`,import:(()=>W(()=>import(`./gleam-CSRkHgEL.js`),[],import.meta.url))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>W(()=>import(`./glimmer-js-BONyzAsu.js`),__vite__mapDeps([52,3,1,4,2,12]),import.meta.url))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>W(()=>import(`./glimmer-ts-f9c0GCOe.js`),__vite__mapDeps([53,3,1,4,2,12]),import.meta.url))},{id:`glsl`,name:`GLSL`,import:(()=>W(()=>import(`./glsl-D5MA2a_X.js`).then(e=>e.n),__vite__mapDeps([28,1,20]),import.meta.url))},{id:`gn`,name:`GN`,import:(()=>W(()=>import(`./gn-ilITqXS6.js`),[],import.meta.url))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>W(()=>import(`./gnuplot-7GGW24-e.js`),[],import.meta.url))},{id:`go`,name:`Go`,import:(()=>W(()=>import(`./go-rLFTqkRN.js`),[],import.meta.url))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>W(()=>import(`./graphql-Ctjuxyvl.js`).then(e=>e.n),__vite__mapDeps([37,1,3,12,14,38]),import.meta.url))},{id:`groovy`,name:`Groovy`,import:(()=>W(()=>import(`./groovy-CacY0gHj.js`),[],import.meta.url))},{id:`hack`,name:`Hack`,import:(()=>W(()=>import(`./hack-Dh_ZLRbs.js`),__vite__mapDeps([54,2,1,3,4,17]),import.meta.url))},{id:`haml`,name:`Ruby Haml`,import:(()=>W(()=>import(`./haml-CwEpbK1d.js`).then(e=>e.n),__vite__mapDeps([36,1,3,4]),import.meta.url))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>W(()=>import(`./handlebars-ryMP1rBR.js`),__vite__mapDeps([55,3,1,4,2,40]),import.meta.url))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>W(()=>import(`./haskell-D8IpX4py.js`),[],import.meta.url))},{id:`haxe`,name:`Haxe`,import:(()=>W(()=>import(`./haxe-C8oCnwJJ.js`),[],import.meta.url))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>W(()=>import(`./hcl-Dh228itO.js`),[],import.meta.url))},{id:`hjson`,name:`Hjson`,import:(()=>W(()=>import(`./hjson-CxZEssPk.js`),[],import.meta.url))},{id:`hlsl`,name:`HLSL`,import:(()=>W(()=>import(`./hlsl-Cvrh5tZx.js`),[],import.meta.url))},{id:`html`,name:`HTML`,import:(()=>W(()=>import(`./html-XwrE-1r6.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4]),import.meta.url))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>W(()=>import(`./html-derivative-i4STDFnl.js`),__vite__mapDeps([16,2,1,3,4]),import.meta.url))},{id:`http`,name:`HTTP`,import:(()=>W(()=>import(`./http-kmH8AyfE.js`),__vite__mapDeps([56,8,1,9,10,30,37,3,12,14,38]),import.meta.url))},{id:`hurl`,name:`Hurl`,import:(()=>W(()=>import(`./hurl-DCZHXKU4.js`),__vite__mapDeps([57,8,1,9,58,37,3,12,14,38]),import.meta.url))},{id:`hxml`,name:`HXML`,import:(()=>W(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([59,60]),import.meta.url))},{id:`hy`,name:`Hy`,import:(()=>W(()=>import(`./hy-CZbG8q4J.js`),[],import.meta.url))},{id:`imba`,name:`Imba`,import:(()=>W(()=>import(`./imba-DsUTQ-LC.js`),[],import.meta.url))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>W(()=>import(`./ini-B5eOa1yu.js`),[],import.meta.url))},{id:`java`,name:`Java`,import:(()=>W(()=>import(`./java-DdHNQ9hk.js`).then(e=>e.n),__vite__mapDeps([9,1]),import.meta.url))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>W(()=>import(`./javascript-obGGvMPs.js`).then(e=>e.n),__vite__mapDeps([3,1]),import.meta.url))},{id:`jinja`,name:`Jinja`,import:(()=>W(()=>import(`./jinja-B-tLrNsM.js`),__vite__mapDeps([61,2,1,3,4]),import.meta.url))},{id:`jison`,name:`Jison`,import:(()=>W(()=>import(`./jison-CBjhYtSs.js`),__vite__mapDeps([62,3,1]),import.meta.url))},{id:`json`,name:`JSON`,import:(()=>W(()=>import(`./json-DAgxKhMr.js`).then(e=>e.n),__vite__mapDeps([10,1]),import.meta.url))},{id:`json5`,name:`JSON5`,import:(()=>W(()=>import(`./json5-BR5RXkoi.js`),[],import.meta.url))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>W(()=>import(`./jsonc-CYpm1nAK.js`),[],import.meta.url))},{id:`jsonl`,name:`JSON Lines`,import:(()=>W(()=>import(`./jsonl-CmCQp5Yx.js`),[],import.meta.url))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>W(()=>import(`./jsonnet-CJTPZ8u_.js`),[],import.meta.url))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>W(()=>import(`./jssm-DXw9l8Rf.js`),[],import.meta.url))},{id:`jsx`,name:`JSX`,import:(()=>W(()=>import(`./jsx-gTgmArGx.js`).then(e=>e.n),__vite__mapDeps([38,1]),import.meta.url))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>W(()=>import(`./julia-CXJVy74_.js`),__vite__mapDeps([63,3,1,17,22,26,27,28,20,64]),import.meta.url))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>W(()=>import(`./just-B9Xn_Dp4.js`),__vite__mapDeps([65,3,1,12,22,30,35,4,2,8,9,17,20,26,27,28,36,37,14,38,39,40,66]),import.meta.url))},{id:`kdl`,name:`KDL`,import:(()=>W(()=>import(`./kdl-CsD5j6eV.js`),[],import.meta.url))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>W(()=>import(`./kotlin-DhhofPvG.js`),[],import.meta.url))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>W(()=>import(`./kusto-C7mF5XQf.js`),[],import.meta.url))},{id:`latex`,name:`LaTeX`,import:(()=>W(()=>import(`./latex-o9DRzaEe.js`),__vite__mapDeps([67,68,1,64]),import.meta.url))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>W(()=>import(`./lean-CewbzKMR.js`),[],import.meta.url))},{id:`less`,name:`Less`,import:(()=>W(()=>import(`./less-DVTAwKKz.js`),[],import.meta.url))},{id:`liquid`,name:`Liquid`,import:(()=>W(()=>import(`./liquid-G0MH4h_m.js`),__vite__mapDeps([69,3,1,4,2,10]),import.meta.url))},{id:`llvm`,name:`LLVM IR`,import:(()=>W(()=>import(`./llvm-DqHOMS-s.js`),[],import.meta.url))},{id:`log`,name:`Log file`,import:(()=>W(()=>import(`./log-BNLmms1o.js`),[],import.meta.url))},{id:`logo`,name:`Logo`,import:(()=>W(()=>import(`./logo-Cluzi2Zq.js`),[],import.meta.url))},{id:`lua`,name:`Lua`,import:(()=>W(()=>import(`./lua-FONpmTUP.js`).then(e=>e.n),__vite__mapDeps([39,1,20]),import.meta.url))},{id:`luau`,name:`Luau`,import:(()=>W(()=>import(`./luau-C2pBCSgt.js`),[],import.meta.url))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>W(()=>import(`./make-Dixweg8N.js`),[],import.meta.url))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>W(()=>import(`./markdown-BYOwaDjH.js`),[],import.meta.url))},{id:`marko`,name:`Marko`,import:(()=>W(()=>import(`./marko-DV5GrDmo.js`),__vite__mapDeps([70,4,1,6,12,71]),import.meta.url))},{id:`matlab`,name:`MATLAB`,import:(()=>W(()=>import(`./matlab-D7qyCx1q.js`),[],import.meta.url))},{id:`mdc`,name:`MDC`,import:(()=>W(()=>import(`./mdc-BKfPFPZw.js`),__vite__mapDeps([72,16,2,1,3,4,40,42]),import.meta.url))},{id:`mdx`,name:`MDX`,import:(()=>W(()=>import(`./mdx-DQZ5AkYe.js`),[],import.meta.url))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>W(()=>import(`./mermaid-BxpfTIzt.js`),[],import.meta.url))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>W(()=>import(`./mipsasm-BMqwQI7S.js`),[],import.meta.url))},{id:`mojo`,name:`Mojo`,import:(()=>W(()=>import(`./mojo-fg40_ntQ.js`),[],import.meta.url))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>W(()=>import(`./moonbit-DgjMoLWr.js`),[],import.meta.url))},{id:`move`,name:`Move`,import:(()=>W(()=>import(`./move-BYnGhZoM.js`),[],import.meta.url))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>W(()=>import(`./narrat-_X_XdTYD.js`),[],import.meta.url))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>W(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([73,74]),import.meta.url))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>W(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[],import.meta.url))},{id:`nginx`,name:`Nginx`,import:(()=>W(()=>import(`./nginx-BTMw9COX.js`),__vite__mapDeps([75,39,1,20]),import.meta.url))},{id:`nim`,name:`Nim`,import:(()=>W(()=>import(`./nim-B6yJ_yaC.js`),__vite__mapDeps([76,3,1,4,2,8,9,20,28,42]),import.meta.url))},{id:`nix`,name:`Nix`,import:(()=>W(()=>import(`./nix-IvuFDN5E.js`),[],import.meta.url))},{id:`nsis`,name:`NSIS`,import:(()=>W(()=>import(`./nsis-CjNLYCLg.js`),[],import.meta.url))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>W(()=>import(`./nushell-DHYfO66s.js`),[],import.meta.url))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>W(()=>import(`./objective-c-D1A_Heim.js`),[],import.meta.url))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>W(()=>import(`./objective-cpp-BsSzOQcm.js`),[],import.meta.url))},{id:`ocaml`,name:`OCaml`,import:(()=>W(()=>import(`./ocaml-O90oeIOV.js`),[],import.meta.url))},{id:`odin`,name:`Odin`,import:(()=>W(()=>import(`./odin-B1RWQWA5.js`),[],import.meta.url))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>W(()=>import(`./openscad-BUDT5pXO.js`),[],import.meta.url))},{id:`org`,name:`Org Markup`,import:(()=>W(()=>import(`./org-Ddi8Gs6E.js`),__vite__mapDeps([77,3,1,4,2,6,9,8,10,12,14,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,49,51,82,83,84,64,66,67,68,71,85,76,86,87,88,89,90,91,92,93,94]),import.meta.url))},{id:`pascal`,name:`Pascal`,import:(()=>W(()=>import(`./pascal-4ZHwLPI5.js`),[],import.meta.url))},{id:`perl`,name:`Perl`,import:(()=>W(()=>import(`./perl-DEgXgjuC.js`),__vite__mapDeps([66,3,1,4,2,8,9,17]),import.meta.url))},{id:`php`,name:`PHP`,import:(()=>W(()=>import(`./php-B9UPq-vz.js`),__vite__mapDeps([88,3,1,4,2,8,9,10,17]),import.meta.url))},{id:`pkl`,name:`Pkl`,import:(()=>W(()=>import(`./pkl-ot-7Btpt.js`),[],import.meta.url))},{id:`plsql`,name:`PL/SQL`,import:(()=>W(()=>import(`./plsql-DGHpHOYJ.js`),[],import.meta.url))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>W(()=>import(`./po-BiJDBrnU.js`),[],import.meta.url))},{id:`polar`,name:`Polar`,import:(()=>W(()=>import(`./polar-C7UOKdEL.js`),[],import.meta.url))},{id:`postcss`,name:`PostCSS`,import:(()=>W(()=>import(`./postcss-BXeXVLqQ.js`),[],import.meta.url))},{id:`powerquery`,name:`PowerQuery`,import:(()=>W(()=>import(`./powerquery-DNMTfnFr.js`),[],import.meta.url))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>W(()=>import(`./powershell-CCSX75yM.js`),[],import.meta.url))},{id:`prisma`,name:`Prisma`,import:(()=>W(()=>import(`./prisma-DMgNhnYS.js`),[],import.meta.url))},{id:`prolog`,name:`Prolog`,import:(()=>W(()=>import(`./prolog-iXnhIJG7.js`),[],import.meta.url))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>W(()=>import(`./proto-DB4EqR-F.js`),[],import.meta.url))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>W(()=>import(`./pug-DkgDHZci.js`),__vite__mapDeps([95,3,1,4,2]),import.meta.url))},{id:`puppet`,name:`Puppet`,import:(()=>W(()=>import(`./puppet-CDv2pdJW.js`),[],import.meta.url))},{id:`purescript`,name:`PureScript`,import:(()=>W(()=>import(`./purescript-9MfHhQsQ.js`),[],import.meta.url))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>W(()=>import(`./python-gzcpVVnB.js`),[],import.meta.url))},{id:`qml`,name:`QML`,import:(()=>W(()=>import(`./qml-_a-QhfPD.js`),__vite__mapDeps([96,3,1]),import.meta.url))},{id:`qmldir`,name:`QML Directory`,import:(()=>W(()=>import(`./qmldir-DCQb3MpD.js`),[],import.meta.url))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>W(()=>import(`./qss-Fe1Jh2GI.js`),[],import.meta.url))},{id:`r`,name:`R`,import:(()=>W(()=>import(`./r-BHcO8Vjq.js`).then(e=>e.n),__vite__mapDeps([64,1]),import.meta.url))},{id:`racket`,name:`Racket`,import:(()=>W(()=>import(`./racket-DcIDlBhZ.js`),[],import.meta.url))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>W(()=>import(`./raku-B3gFvitq.js`),[],import.meta.url))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>W(()=>import(`./razor-BMJ0eI3p.js`),__vite__mapDeps([97,2,1,3,4,79]),import.meta.url))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>W(()=>import(`./rbs-C0MpOrj4.js`),[],import.meta.url))},{id:`reg`,name:`Windows Registry Script`,import:(()=>W(()=>import(`./reg-CRGYupPL.js`),[],import.meta.url))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>W(()=>import(`./regexp-DR20uMnK.js`).then(e=>e.n),__vite__mapDeps([27,1]),import.meta.url))},{id:`rel`,name:`Rel`,import:(()=>W(()=>import(`./rel-BtDbiS_P.js`),[],import.meta.url))},{id:`riscv`,name:`RISC-V`,import:(()=>W(()=>import(`./riscv-Ckw8ddFX.js`),[],import.meta.url))},{id:`ron`,name:`RON`,import:(()=>W(()=>import(`./ron-VUp2lXgN.js`),[],import.meta.url))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>W(()=>import(`./rosmsg-CAekHB0j.js`),[],import.meta.url))},{id:`rst`,name:`reStructuredText`,import:(()=>W(()=>import(`./rst-BQCbfb9V.js`),__vite__mapDeps([98,3,1,16,2,4,22,99,26,27,28,20,30,40,35,8,9,17,36,37,12,14,38,39]),import.meta.url))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>W(()=>import(`./ruby-B8JcIHv0.js`),__vite__mapDeps([35,3,1,4,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40]),import.meta.url))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>W(()=>import(`./rust-Cfkwpbl8.js`),[],import.meta.url))},{id:`sas`,name:`SAS`,import:(()=>W(()=>import(`./sas-CBpMWA2M.js`),__vite__mapDeps([100,17,1]),import.meta.url))},{id:`sass`,name:`Sass`,import:(()=>W(()=>import(`./sass-DXrisJhu.js`),[],import.meta.url))},{id:`scala`,name:`Scala`,import:(()=>W(()=>import(`./scala-BiFt_7mu.js`),[],import.meta.url))},{id:`scheme`,name:`Scheme`,import:(()=>W(()=>import(`./scheme-DQCgrYNe.js`),[],import.meta.url))},{id:`scss`,name:`SCSS`,import:(()=>W(()=>import(`./scss-YesllqfO.js`).then(e=>e.n),__vite__mapDeps([6,1,4]),import.meta.url))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>W(()=>import(`./sdbl-bTVj8UrX.js`),[],import.meta.url))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>W(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([101,102]),import.meta.url))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>W(()=>import(`./shellscript-Da78Ox-3.js`).then(e=>e.n),__vite__mapDeps([30,1]),import.meta.url))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>W(()=>import(`./shellsession-CVsQGYfZ.js`),__vite__mapDeps([103,30,1]),import.meta.url))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>W(()=>import(`./smalltalk-BHpQb5nM.js`),[],import.meta.url))},{id:`smithy`,name:`Smithy`,import:(()=>W(()=>import(`./smithy-Dgaz7aur.js`),[],import.meta.url))},{id:`solidity`,name:`Solidity`,import:(()=>W(()=>import(`./solidity-Bj7E1mRn.js`),[],import.meta.url))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>W(()=>import(`./soy-DEd-qcad.js`),__vite__mapDeps([104,2,1,3,4]),import.meta.url))},{id:`sparql`,name:`SPARQL`,import:(()=>W(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([105,106]),import.meta.url))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>W(()=>import(`./splunk-BC2Px7Mm.js`),[],import.meta.url))},{id:`sql`,name:`SQL`,import:(()=>W(()=>import(`./sql-DdD7vxS4.js`).then(e=>e.n),__vite__mapDeps([17,1]),import.meta.url))},{id:`ssh-config`,name:`SSH Config`,import:(()=>W(()=>import(`./ssh-config-BgfXC-Er.js`),[],import.meta.url))},{id:`stata`,name:`Stata`,import:(()=>W(()=>import(`./stata-CMv7m7Gi.js`),__vite__mapDeps([107,17,1]),import.meta.url))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>W(()=>import(`./stylus-B6D30XZt.js`),[],import.meta.url))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>W(()=>import(`./surrealql-BZoq2lXR.js`),__vite__mapDeps([108,3,1]),import.meta.url))},{id:`svelte`,name:`Svelte`,import:(()=>W(()=>import(`./svelte-Bj3Hmc9F.js`),__vite__mapDeps([109,3,1,4,12,13]),import.meta.url))},{id:`swift`,name:`Swift`,import:(()=>W(()=>import(`./swift-CyEgAFGc.js`),[],import.meta.url))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>W(()=>import(`./system-verilog-Dh5ihWbf.js`),[],import.meta.url))},{id:`systemd`,name:`Systemd Units`,import:(()=>W(()=>import(`./systemd-BxMlprV5.js`),[],import.meta.url))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>W(()=>import(`./talonscript-CohzipZa.js`),[],import.meta.url))},{id:`tasl`,name:`Tasl`,import:(()=>W(()=>import(`./tasl-DMoTqEGO.js`),[],import.meta.url))},{id:`tcl`,name:`Tcl`,import:(()=>W(()=>import(`./tcl-CZd0xW_V.js`),[],import.meta.url))},{id:`templ`,name:`Templ`,import:(()=>W(()=>import(`./templ-TjxbArHn.js`),__vite__mapDeps([110,3,1,4,82]),import.meta.url))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>W(()=>import(`./terraform-DswuEJGm.js`),[],import.meta.url))},{id:`tex`,name:`TeX`,import:(()=>W(()=>import(`./tex-BK-H2Wn4.js`).then(e=>e.n),__vite__mapDeps([68,1,64]),import.meta.url))},{id:`toml`,name:`TOML`,import:(()=>W(()=>import(`./toml-CcmNWLt0.js`),[],import.meta.url))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>W(()=>import(`./ts-tags-Cc5do7zu.js`),__vite__mapDeps([111,3,1,4,2,8,9,12,17,28,20]),import.meta.url))},{id:`tsv`,name:`TSV`,import:(()=>W(()=>import(`./tsv-sltzmVWM.js`),[],import.meta.url))},{id:`tsx`,name:`TSX`,import:(()=>W(()=>import(`./tsx-CUOciP0b.js`).then(e=>e.n),__vite__mapDeps([14,1]),import.meta.url))},{id:`turtle`,name:`Turtle`,import:(()=>W(()=>import(`./turtle-ByJddavk.js`),[],import.meta.url))},{id:`twig`,name:`Twig`,import:(()=>W(()=>import(`./twig-BVSnuTf-.js`),__vite__mapDeps([112,3,1,4,6,22,35,2,8,9,17,20,26,27,28,30,36,37,12,14,38,39,40,88,10]),import.meta.url))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>W(()=>import(`./typescript-BydbNFcO.js`).then(e=>e.n),__vite__mapDeps([12,1]),import.meta.url))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>W(()=>import(`./typespec-BRdr0IET.js`),[],import.meta.url))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>W(()=>import(`./typst-C40W_gC6.js`),__vite__mapDeps([113,3,1,4,2,6,9,8,10,12,14,114,115,17,20,22,78,25,27,26,28,30,79,80,50,81,32,39,40,35,36,37,38,42,41,45,49,51,82,83,55,84,116,64,63,66,67,68,71,117,85,86,88,89,90,91,92,94,118,95,119,120,112,121]),import.meta.url))},{id:`v`,name:`V`,import:(()=>W(()=>import(`./v-DBj4K9d_.js`),[],import.meta.url))},{id:`vala`,name:`Vala`,import:(()=>W(()=>import(`./vala-zf12oZj6.js`),[],import.meta.url))},{id:`vb`,name:`Visual Basic`,import:(()=>W(()=>import(`./vb-DOwzaHZ0.js`),[],import.meta.url))},{id:`verilog`,name:`Verilog`,import:(()=>W(()=>import(`./verilog-B2gwz-sJ.js`),[],import.meta.url))},{id:`vhdl`,name:`VHDL`,import:(()=>W(()=>import(`./vhdl-BroJfC0k.js`),[],import.meta.url))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>W(()=>import(`./viml-DvXPmvsu.js`),[],import.meta.url))},{id:`vue`,name:`Vue`,import:(()=>W(()=>import(`./vue-BNQF7r6F.js`),__vite__mapDeps([122,3,1,4,2,10,12,16]),import.meta.url))},{id:`vue-html`,name:`Vue HTML`,import:(()=>W(()=>import(`./vue-html-DkKkQnZL.js`),__vite__mapDeps([123,3,1]),import.meta.url))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>W(()=>import(`./vue-vine-DFaKYU4X.js`),__vite__mapDeps([124,3,1,4,6,13,71,125]),import.meta.url))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>W(()=>import(`./vyper-CgoNMtux.js`),[],import.meta.url))},{id:`wasm`,name:`WebAssembly`,import:(()=>W(()=>import(`./wasm-ByWQv1Qj.js`),[],import.meta.url))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>W(()=>import(`./wenyan-C8pVoKbM.js`),[],import.meta.url))},{id:`wgsl`,name:`WGSL`,import:(()=>W(()=>import(`./wgsl-BsKzXJz4.js`),[],import.meta.url))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>W(()=>import(`./wikitext-ClFFjSW2.js`),[],import.meta.url))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>W(()=>import(`./wit-DdvCle-K.js`),[],import.meta.url))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>W(()=>import(`./wolfram-DLL8P-h_.js`),[],import.meta.url))},{id:`xml`,name:`XML`,import:(()=>W(()=>import(`./xml-BlnrEAEy.js`).then(e=>e.n),__vite__mapDeps([8,1,9]),import.meta.url))},{id:`xsl`,name:`XSL`,import:(()=>W(()=>import(`./xsl-BOPS8gLt.js`),__vite__mapDeps([94,8,1,9]),import.meta.url))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>W(()=>import(`./yaml-Du_6cdrH.js`).then(e=>e.n),__vite__mapDeps([40,1]),import.meta.url))},{id:`zenscript`,name:`ZenScript`,import:(()=>W(()=>import(`./zenscript-BnlCZFoB.js`),[],import.meta.url))},{id:`zig`,name:`Zig`,import:(()=>W(()=>import(`./zig-CMLA9XwU.js`),[],import.meta.url))}],lr=Object.fromEntries(cr.map(e=>[e.id,e.import])),ur=Object.fromEntries(cr.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),dr={...lr,...ur},fr=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>W(()=>import(`./andromeeda-WkhI09AS.js`),[],import.meta.url))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>W(()=>import(`./aurora-x-C7CFqhAd.js`),[],import.meta.url))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>W(()=>import(`./ayu-dark-CRu61w6_.js`),[],import.meta.url))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>W(()=>import(`./ayu-light-Dn6O_aYR.js`),[],import.meta.url))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>W(()=>import(`./ayu-mirage-CTjYAbs-.js`),[],import.meta.url))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>W(()=>import(`./catppuccin-frappe-cajlBOnJ.js`),[],import.meta.url))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>W(()=>import(`./catppuccin-latte--xESFuC4.js`),[],import.meta.url))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>W(()=>import(`./catppuccin-macchiato-BWwObfS9.js`),[],import.meta.url))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>W(()=>import(`./catppuccin-mocha-D73xC08V.js`),[],import.meta.url))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>W(()=>import(`./dark-plus-GAt2ZgX8.js`),[],import.meta.url))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>W(()=>import(`./dracula-C2uKkzgK.js`),[],import.meta.url))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>W(()=>import(`./dracula-soft-D1bVjxWZ.js`),[],import.meta.url))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>W(()=>import(`./everforest-dark-D-DlICQR.js`),[],import.meta.url))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>W(()=>import(`./everforest-light-CeVdGHYG.js`),[],import.meta.url))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>W(()=>import(`./github-dark-DwbbXv51.js`),[],import.meta.url))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>W(()=>import(`./github-dark-default-CxjRwzl6.js`),[],import.meta.url))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>W(()=>import(`./github-dark-dimmed-Cr1oaoul.js`),[],import.meta.url))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>W(()=>import(`./github-dark-high-contrast-B4qJZLZa.js`),[],import.meta.url))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>W(()=>import(`./github-light-CsVXhIlR.js`),[],import.meta.url))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>W(()=>import(`./github-light-default-DB_IwZa6.js`),[],import.meta.url))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>W(()=>import(`./github-light-high-contrast-DLgVeSB-.js`),[],import.meta.url))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>W(()=>import(`./gruvbox-dark-hard-DXm60lX3.js`),[],import.meta.url))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>W(()=>import(`./gruvbox-dark-medium-GE2thSmD.js`),[],import.meta.url))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>W(()=>import(`./gruvbox-dark-soft-04Cj-4VZ.js`),[],import.meta.url))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>W(()=>import(`./gruvbox-light-hard-K6wSn29D.js`),[],import.meta.url))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>W(()=>import(`./gruvbox-light-medium-CVy3aSlc.js`),[],import.meta.url))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>W(()=>import(`./gruvbox-light-soft-DNgJjaY0.js`),[],import.meta.url))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>W(()=>import(`./horizon-0-RkHfro.js`),[],import.meta.url))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>W(()=>import(`./horizon-bright-BgL2X9oq.js`),[],import.meta.url))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>W(()=>import(`./houston-KyjWKfuY.js`),[],import.meta.url))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>W(()=>import(`./kanagawa-dragon-DSre8v_Q.js`),[],import.meta.url))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>W(()=>import(`./kanagawa-lotus-Dm4hBNO9.js`),[],import.meta.url))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>W(()=>import(`./kanagawa-wave-CQy0MwzB.js`),[],import.meta.url))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>W(()=>import(`./laserwave-CQkdhozh.js`),[],import.meta.url))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>W(()=>import(`./light-plus-CNQ8_7Y0.js`),[],import.meta.url))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>W(()=>import(`./material-theme-CAtLaHa3.js`),[],import.meta.url))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>W(()=>import(`./material-theme-darker-k-s5Bc6K.js`),[],import.meta.url))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>W(()=>import(`./material-theme-lighter-CD6a-c4d.js`),[],import.meta.url))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>W(()=>import(`./material-theme-ocean-B3mraInd.js`),[],import.meta.url))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>W(()=>import(`./material-theme-palenight-DEhAARHw.js`),[],import.meta.url))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>W(()=>import(`./min-dark-BFqTAwCr.js`),[],import.meta.url))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>W(()=>import(`./min-light-O7UdaaxX.js`),[],import.meta.url))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>W(()=>import(`./monokai-B_bV9PQ9.js`),[],import.meta.url))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>W(()=>import(`./night-owl-BsnCLAKc.js`),[],import.meta.url))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>W(()=>import(`./night-owl-light-BODRhcTU.js`),[],import.meta.url))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>W(()=>import(`./nord-Cd-F4txO.js`),[],import.meta.url))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>W(()=>import(`./one-dark-pro-CLwyXe_n.js`),[],import.meta.url))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>W(()=>import(`./one-light-CVUd7yD5.js`),[],import.meta.url))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>W(()=>import(`./plastic-CF8VZTnn.js`),[],import.meta.url))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>W(()=>import(`./poimandres-BX2TyY6j.js`),[],import.meta.url))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>W(()=>import(`./red-DX1BQOs8.js`),[],import.meta.url))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>W(()=>import(`./rose-pine-DGV1HG6V.js`),[],import.meta.url))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>W(()=>import(`./rose-pine-dawn-B1XWDT40.js`),[],import.meta.url))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>W(()=>import(`./rose-pine-moon-BQK7uU5b.js`),[],import.meta.url))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>W(()=>import(`./slack-dark-DYvUXyrP.js`),[],import.meta.url))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>W(()=>import(`./slack-ochin-bqtMVDfH.js`),[],import.meta.url))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>W(()=>import(`./snazzy-light-D8dzFmq5.js`),[],import.meta.url))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>W(()=>import(`./solarized-dark-UdsmMDCL.js`),[],import.meta.url))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>W(()=>import(`./solarized-light-C1IUL_tW.js`),[],import.meta.url))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>W(()=>import(`./synthwave-84-CIknw8y7.js`),[],import.meta.url))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>W(()=>import(`./tokyo-night-iIspnLcq.js`),[],import.meta.url))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>W(()=>import(`./vesper-BIFK_oDq.js`),[],import.meta.url))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>W(()=>import(`./vitesse-black-D082JcaE.js`),[],import.meta.url))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>W(()=>import(`./vitesse-dark-z-nr_5O8.js`),[],import.meta.url))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>W(()=>import(`./vitesse-light-ojz42ZLy.js`),[],import.meta.url))}].map(e=>[e.id,e.import])),pr=e({createOnigurumaEngine:()=>Br,getDefaultWasmLoader:()=>zr,loadWasm:()=>Nr,setDefaultWasmLoader:()=>Rr}),mr=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function hr(){return 2147483648}function gr(){return typeof performance<`u`?performance.now():Date.now()}var _r=(e,t)=>e+(t-e%t)%t;async function vr(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=hr();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,_r(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 yr=Object.defineProperty,br=(e,t,n)=>t in e?yr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,G=(e,t,n)=>br(e,typeof t==`symbol`?t:t+``,n),xr=null;function Sr(e){throw new mr(e.UTF8ToString(e.getLastOnigError()))}var Cr=class e{constructor(t){G(this,`utf16Length`),G(this,`utf8Length`),G(this,`utf16Value`),G(this,`utf8Value`),G(this,`utf16OffsetToUtf8`),G(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}},wr=class e{constructor(t){if(G(this,`id`,++e.LAST_ID),G(this,`_onigBinding`),G(this,`content`),G(this,`utf16Length`),G(this,`utf8Length`),G(this,`utf16OffsetToUtf8`),G(this,`utf8OffsetToUtf16`),G(this,`ptr`),!xr)throw new mr(`Must invoke loadWasm first.`);this._onigBinding=xr,this.content=t;let n=new Cr(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=xr.omalloc(1e4),e._sharedPtrInUse=!0,xr.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(xr)}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)}};G(wr,`LAST_ID`,0),G(wr,`_sharedPtr`,0),G(wr,`_sharedPtrInUse`,!1);var Tr=wr,Er=class{constructor(e){if(G(this,`_onigBinding`),G(this,`_ptr`),!xr)throw new mr(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new Cr(e[r]);t[r]=i.createString(xr),n[r]=i.utf8Length}let r=xr.omalloc(4*e.length);xr.HEAPU32.set(t,r/4);let i=xr.omalloc(4*e.length);xr.HEAPU32.set(n,i/4);let a=xr.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)xr.ofree(t[n]);xr.ofree(i),xr.ofree(r),a===0&&Sr(xr),this._onigBinding=xr,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 Tr(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 Dr(e){return typeof e.instantiator==`function`}function Or(e){return typeof e.default==`function`}function kr(e){return e.data!==void 0}function Ar(e){return typeof Response<`u`&&e instanceof Response}function jr(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 Mr;function Nr(e){if(Mr)return Mr;async function t(){xr=await vr(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Dr(n)?n=await n.instantiator(t):Or(n)?n=await n.default(t):(kr(n)&&(n=n.data),Ar(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await Fr(n)(t):await Ir(n)(t):jr(n)||n instanceof WebAssembly.Module?n=await Pr(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await Pr(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return Mr=t(),Mr}function Pr(e){return t=>WebAssembly.instantiate(e,t)}function Fr(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Ir(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var Lr;function Rr(e){Lr=e}function zr(){return Lr}async function Br(e){return e&&await Nr(e),{createScanner(e){return new Er(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Tr(e)}}}var Vr=nr({});ir(Vr,pr);var K=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Hr(e){return Ur(e)}function Ur(e){return Array.isArray(e)?Wr(e):e instanceof RegExp?e:typeof e==`object`?Gr(e):e}function Wr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ur(e[n]);return t}function Gr(e){let t={};for(let n in e)t[n]=Ur(e[n]);return t}function Kr(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function qr(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?qr(e.substring(0,e.length-1)):e.substr(~t+1)}var Jr=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yr=class{static hasCaptures(e){return e!==null&&(Jr.lastIndex=0,Jr.test(e))}static replaceCaptures(e,t,n){return e.replace(Jr,(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 Xr(e,t){return e<t?-1:+(e>t)}function Zr(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=Xr(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Qr(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 $r(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ei=class{constructor(e){this.fn=e}fn;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}},ti=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}_colorMap;_defaults;_root;static createFromRawTheme(e,t){return this.createFromParsedTheme(oi(e),t)}static createFromParsedTheme(e,t){return li(e,t)}_cachedMatchRoot=new ei(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=>ri(e.parent,t.parentScopes));return n?new ai(n.fontStyle,n.foreground,n.background):null}},ni=class e{constructor(e,t){this.parent=e,this.scopeName=t}parent;scopeName;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 ri(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&&!ii(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ii(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ai=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function oi(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`&&Qr(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Qr(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 si(l,u,e,o,s,c)}}return n}var si=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}scope;parentScopes;index;fontStyle;foreground;background},ci=(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))(ci||{});function li(e,t){e.sort((e,t)=>{let n=Xr(e.scope,t.scope);return n!==0||(n=Zr(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 ui(t),o=new ai(n,a.getId(r),a.getId(i)),s=new pi(new fi(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 ti(a,o,s)}var ui=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)}},di=Object.freeze([]),fi=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||di,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},pi=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_mainRule;_children;_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(),fi.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(Zr(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 fi(e,t,n,r,i))}},mi=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=gi(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 hi(e){return e}function gi(e){return e}function _i(e,t){let n=[],r=yi(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(vi(i)){let e=[];do e.push(i),i=r.next();while(vi(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 vi(e){return!!e&&!!e.match(/[\w\.:]+/)}function yi(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 bi(e){typeof e.dispose==`function`&&e.dispose()}var xi=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},Si=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},Ci=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))}},wi=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xi(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Ci;for(let n of e)Ti(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof xi){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 Ti(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 xi?Di({baseGrammar:a,selfGrammar:i},r):Ei(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 xi(e))}function Ei(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Oi([r],t,n)}}function Di(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Oi(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Oi(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Oi(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Kr({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Oi(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Pi(i);switch(a.kind){case 0:Di({...t,selfGrammar:t.baseGrammar},n);break;case 1:Di(t,n);break;case 2:Ei(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?Ei(a.ruleName,i,n):Di(i,n)}else a.kind===4?n.add(new Si(a.scopeName,a.ruleName)):n.add(new xi(a.scopeName))}}}var ki=class{kind=0},Ai=class{kind=1},ji=class{constructor(e){this.ruleName=e}ruleName;kind=2},Mi=class{constructor(e){this.scopeName=e}scopeName;kind=3},Ni=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function Pi(e){if(e===`$base`)return new ki;if(e===`$self`)return new Ai;let t=e.indexOf(`#`);return t===-1?new Mi(e):t===0?new ji(e.substring(1)):new Ni(e.substring(0,t),e.substring(t+1))}var Fi=/\\(\d+)/,Ii=/\\(\d+)/g,Li=-1,Ri=-2;function zi(e){return e}function Bi(e){return e}var Vi=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yr.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Yr.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${qr(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:Yr.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yr.replaceCaptures(this._contentName,e,t)}},Hi=class extends Vi{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!`)}},Ui=class extends Vi{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Ji(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 Yi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Wi=class extends Vi{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 Yi,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Gi=class extends Vi{_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 Ji(i,this.id),this.beginCaptures=a,this._end=new Ji(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 Yi;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}},Ki=class extends Vi{_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 Ji(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Ji(o,Ri),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 Yi;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 Yi,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},qi=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Hi(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Ui(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Kr({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Wi(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Ki(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 Gi(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=Pi(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 Wi||e instanceof Gi||e instanceof Ki)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Ji=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`&&Fi.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 Ii.lastIndex=0,this.source.replace(Ii,(e,t)=>$r(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}},Yi=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 Xi(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 Xi(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Xi=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;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
3
  `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Zi=class{constructor(e,t){this.languageId=e,this.tokenType=t}languageId;tokenType},Qi=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Zi(e,8),this._embeddedLanguagesMatcher=new $i(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 Zi(0,0);_getBasicScopeAttributes=new ei(e=>new Zi(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/},$i=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])=>$r(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 ea=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}stack;stoppedEarly};function ta(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=na(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 ea(i,!0);f()}return new ea(i,!1);function f(){let o=ra(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===Li){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),ca(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 Gi){let r=o;ca(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 Ki){let r=o;ca(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(ca(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 na(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 Ki&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=sa(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Ri){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),ca(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 ra(e,t,n,r,i,a){let o=ia(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=aa(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 ia(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=oa(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 aa(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}=oa(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 oa(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function sa(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ca(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));ta(e,p,n&&d.start===0,d.start,f,i,!1,0),bi(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 la(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var la=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ua(e,t,n,r,i,a,o,s){return new ma(e,t,n,r,i,a,o,s)}function da(e,t,n,r,i){let a=_i(t,fa),o=qi.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 fa(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(pa(t[r],e))return n=r+1,!0;return!1})}function pa(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 ma=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Qi(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=ha(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=_i(e,fa);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_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)da(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&&da(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(zi(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Bi(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]=ha(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=qi.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===_a.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=mi.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?ga.createRootAndLookUpScopeName(a,r,this):ga.createRoot(`unknown`,r),t=new _a(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
4
4
  `;let a=this.createOnigString(e),o=a.content.length,s=new ya(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=ta(this,a,i,0,t,s,!0,r);return bi(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function ha(e,t){return e=Hr(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 ga=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}parent;scopePath;tokenAttributes;static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=ni.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new ni(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new ni(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),mi.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}},_a=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}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_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)?ga.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:Bi(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=ga.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,zi(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,ga.fromExtension(r,n.contentNameScopesList))}},va=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):_i(e,fa).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>_i(e,fa).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}},ya=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}balancedBracketSelectors;_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=mi.set(n,0,hi(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=mi.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}},ba=class{constructor(e,t){this._onigLib=t,this._theme=e}_onigLib;_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,ua(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},xa=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ba(ti.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(ti.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 va(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new wi(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)}},Sa=_a.NULL;function Ca(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 wa(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ta(e){return Array.isArray(e)?e:[e]}async function Ea(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Da(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Oa(e){return e===`ansi`||Da(e)}function ka(e){return e===`none`}function Aa(e){return ka(e)}var ja=/(\r?\n)/g;function Ma(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(ja),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Na={light:`#333333`,dark:`#bbbbbb`},Pa={light:`#fffffe`,dark:`#1e1e1e`},Fa=`__shiki_resolved`;function Ia(e){if(e?.[Fa])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`?Na.light:Na.dark,n||=t.type===`light`?Pa.light:Pa.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,Fa,{enumerable:!1,writable:!1,value:!0}),t}async function La(e){return[...new Set((await Promise.all(e.filter(e=>!Oa(e)).map(async e=>await Ea(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Ra(e){return(await Promise.all(e.map(async e=>Aa(e)?null:Ia(await Ea(e))))).filter(e=>!!e)}function za(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new K(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Ba=class extends xa{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=Ia(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=ti.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=za(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new K(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Va=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}},Ha=0;function Ua(e){Ha+=1,e.warnings!==!1&&Ha>=10&&Ha%10==0&&console.warn(`[Shiki] ${Ha} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new K("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Ia),i=new Ba(new Va(e.engine,n),r,n,e.langAlias),a;function o(t){return za(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new K(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new K(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await La(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Ra(e))}function g(){if(t)throw new K(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Ha)}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 Wa(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Ra(e.themes||[]),La(e.langs||[]),e.engine]);return Ua({...e,themes:t,langs:n,engine:r})}var Ga=new WeakMap;function Ka(e,t){Ga.set(e,t)}function qa(e){return Ga.get(e)}var Ja=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(Ta(n).map(e=>[e,Sa])),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 Ya(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ya(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 Xa(e,t){if(!(e instanceof Ja))throw new K(`Invalid grammar state`);return e.getInternalStack(t)}var Za=/,/,Qa=/ /;function $a(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Da(e.resolveLangAlias(n.lang||`text`))||ka(r))return Ma(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new K(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new K(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return to(t,o,i,a,n)}function eo(...e){if(e.length===2)return qa(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Da(i)||ka(a))throw new K(`Plain language does not have grammar state`);if(i===`ansi`)throw new K(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Ja(no(n,c,o,s,r).stateStack,c.name,o.name)}function to(e,t,n,r,i){let a=no(e,t,n,r,i),o=new Ja(a.stateStack,t.name,n.name);return Ka(a.tokens,o),a.tokens}function no(e,t,n,r,i){let a=Ca(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Ma(e),u=i.grammarState?Xa(i.grammarState,n.name)??Sa:i.grammarContextCode==null?Sa:no(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=wa(r[mi.getForeground(s)],a),u=mi.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=mi.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Za).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(Qa))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?ro(t.scopes):io(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function ro(e){return e.map(e=>({scopeName:e}))}function io(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:so(e,i,t.slice(0,r))}}return n}function ao(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function oo(e,t,n){if(!ao(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)ao(e[r],n[i])&&--r,--i;return r===-1}function so(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(oo(e,t,n)){r.push(a);break}return r}function co(e,t,n,r=$a){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:qa(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=lo(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Ja(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Ka(s,c),s}function lo(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var uo=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],fo=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};fo.prototype.normal={},fo.prototype.property={},fo.prototype.space=void 0;function po(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new fo(n,r,t)}function mo(e){return e.toLowerCase()}var ho=class{constructor(e,t){this.attribute=t,this.property=e}};ho.prototype.attribute=``,ho.prototype.booleanish=!1,ho.prototype.boolean=!1,ho.prototype.commaOrSpaceSeparated=!1,ho.prototype.commaSeparated=!1,ho.prototype.defined=!1,ho.prototype.mustUseProperty=!1,ho.prototype.number=!1,ho.prototype.overloadedBoolean=!1,ho.prototype.property=``,ho.prototype.spaceSeparated=!1,ho.prototype.space=void 0;var go=e({boolean:()=>q,booleanish:()=>J,commaOrSpaceSeparated:()=>bo,commaSeparated:()=>yo,number:()=>Y,overloadedBoolean:()=>vo,spaceSeparated:()=>X}),_o=0,q=xo(),J=xo(),vo=xo(),Y=xo(),X=xo(),yo=xo(),bo=xo();function xo(){return 2**++_o}var So=Object.keys(go),Co=class extends ho{constructor(e,t,n,r){let i=-1;if(super(e,t),wo(this,`space`,r),typeof n==`number`)for(;++i<So.length;){let e=So[i];wo(this,So[i],(n&go[e])===go[e])}}};Co.prototype.defined=!0;function wo(e,t,n){n&&(e[t]=n)}function To(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Co(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[mo(r)]=r,n[mo(a.attribute)]=r}return new fo(t,n,e.space)}var Eo=To({properties:{ariaActiveDescendant:null,ariaAtomic:J,ariaAutoComplete:null,ariaBusy:J,ariaChecked:J,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:J,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:J,ariaFlowTo:X,ariaGrabbed:J,ariaHasPopup:null,ariaHidden:J,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:Y,ariaLive:null,ariaModal:J,ariaMultiLine:J,ariaMultiSelectable:J,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:J,ariaReadOnly:J,ariaRelevant:null,ariaRequired:J,ariaRoleDescription:X,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:J,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Do(e,t){return t in e?e[t]:t}function Oo(e,t){return Do(e,t.toLowerCase())}var ko=To({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:yo,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:q,allowPaymentRequest:q,allowUserMedia:q,alpha:q,alt:null,as:null,async:q,autoCapitalize:null,autoComplete:X,autoFocus:q,autoPlay:q,blocking:X,capture:null,charSet:null,checked:q,cite:null,className:X,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:J,controls:q,controlsList:X,coords:Y|yo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:q,defer:q,dir:null,dirName:null,disabled:q,download:vo,draggable:J,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:q,formTarget:null,headers:X,height:Y,hidden:vo,high:Y,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:q,inputMode:null,integrity:null,is:null,isMap:q,itemId:null,itemProp:X,itemRef:X,itemScope:q,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:q,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:q,muted:q,name:null,nonce:null,noModule:q,noValidate:q,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:q,optimum:Y,pattern:null,ping:X,placeholder:null,playsInline:q,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:q,referrerPolicy:null,rel:X,required:q,reversed:q,rows:Y,rowSpan:Y,sandbox:X,scope:null,scoped:q,seamless:q,selected:q,shadowRootClonable:q,shadowRootCustomElementRegistry:q,shadowRootDelegatesFocus:q,shadowRootMode:null,shadowRootSerializable:q,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:J,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:q,useMap:null,value:J,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:q,declare:q,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:q,noHref:q,noShade:q,noWrap:q,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:J,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:q,disablePictureInPicture:q,disableRemotePlayback:q,exportParts:yo,part:X,prefix:null,property:null,results:Y,security:null,unselectable:null},space:`html`,transform:Oo}),Ao=To({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:bo,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:X,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:q,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yo,g2:yo,glyphName:yo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:bo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bo,rev:bo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bo,requiredFeatures:bo,requiredFonts:bo,requiredFormats:bo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:bo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bo,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Do}),jo=To({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Mo=To({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Oo}),No=To({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Po=/[A-Z]/g,Fo=/-[a-z]/g,Io=/^data[-\w.:]+$/i;function Lo(e,t){let n=mo(t),r=t,i=ho;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Io.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Fo,zo);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Fo.test(e)){let n=e.replace(Po,Ro);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Co}return new i(r,t)}function Ro(e){return`-`+e.toLowerCase()}function zo(e){return e.charAt(1).toUpperCase()}var Bo=po([Eo,ko,jo,Mo,No],`html`),Vo=po([Eo,Ao,jo,Mo,No],`svg`),Ho={}.hasOwnProperty;function Uo(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Ho.call(t,e)){let n=String(t[e]);i=Ho.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Wo=/["&'<>`]/g,Go=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,qo=/[|\\{}()[\]^$+*?.]/g,Jo=new WeakMap;function Yo(e,t){if(e=e.replace(t.subset?Xo(t.subset):Wo,r),t.subset||t.escapeOnly)return e;return e.replace(Go,n).replace(Ko,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Xo(e){let t=Jo.get(e);return t||(t=Zo(e),Jo.set(e,t)),t}function Zo(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(qo,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Qo=/[\dA-Fa-f]/;function $o(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Qo.test(String.fromCharCode(t))?r:r+`;`}var es=/\d/;function ts(e,t,n){let r=`&#`+String(e);return n&&t&&!es.test(String.fromCharCode(t))?r:r+`;`}var ns=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),rs={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},is=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],as={}.hasOwnProperty,os={},ss;for(ss in rs)as.call(rs,ss)&&(os[rs[ss]]=ss);var cs=/[^\dA-Za-z]/;function ls(e,t,n,r){let i=String.fromCharCode(e);if(as.call(os,i)){let e=os[i],a=`&`+e;return n&&ns.includes(e)&&!is.includes(e)&&(!r||t&&t!==61&&cs.test(String.fromCharCode(t)))?a:a+`;`}return``}function us(e,t,n){let r=$o(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ls(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ts(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ds(e,t){return Yo(e,Object.assign({format:us},t))}var fs=/^>|^->|<!--|-->|--!>|<!-$/g,ps=[`>`],ms=[`<`,`>`];function hs(e,t,n,r){return r.settings.bogusComments?`<?`+ds(e.value,Object.assign({},r.settings.characterReferences,{subset:ps}))+`>`:`<!--`+e.value.replace(fs,i)+`-->`;function i(e){return ds(e,Object.assign({},r.settings.characterReferences,{subset:ms}))}}function gs(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function _s(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function vs(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function ys(e){return e.join(` `).trim()}var bs=/[ \t\n\f\r]/g;function xs(e){return typeof e==`object`?e.type===`text`&&Ss(e.value):Ss(e)}function Ss(e){return e.replace(bs,``)===``}var Cs=Es(1),ws=Es(-1),Ts=[];function Es(e){return t;function t(t,n,r){let i=t?t.children:Ts,a=(n||0)+e,o=i[a];if(!r)for(;o&&xs(o);)a+=e,o=i[a];return o}}var Ds={}.hasOwnProperty;function Os(e){return t;function t(t,n,r){return Ds.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ks=Os({body:Ms,caption:As,colgroup:As,dd:Is,dt:Fs,head:As,html:js,li:Ps,optgroup:Rs,option:zs,p:Ns,rp:Ls,rt:Ls,tbody:Vs,td:Ws,tfoot:Hs,th:Ws,thead:Bs,tr:Us});function As(e,t,n){let r=Cs(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&xs(r.value.charAt(0)))}function js(e,t,n){let r=Cs(n,t);return!r||r.type!==`comment`}function Ms(e,t,n){let r=Cs(n,t);return!r||r.type!==`comment`}function Ns(e,t,n){let r=Cs(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Ps(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Fs(e,t,n){let r=Cs(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function Is(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function Ls(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function Rs(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function zs(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Bs(e,t,n){let r=Cs(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Vs(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Hs(e,t,n){return!Cs(n,t)}function Us(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ws(e,t,n){let r=Cs(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Gs=Os({body:Js,colgroup:Ys,head:qs,html:Ks,tbody:Xs});function Ks(e){let t=Cs(e,-1);return!t||t.type!==`comment`}function qs(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Js(e){let t=Cs(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&xs(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Ys(e,t,n){let r=ws(n,t),i=Cs(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ks(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Xs(e,t,n){let r=ws(n,t),i=Cs(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ks(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Zs={name:[[`
5
5
  \f\r &/=>`.split(``),`
@@ -10,7 +10,7 @@ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{$ as n,$n as r,
10
10
  \f\r "&'<=>\``.split(``)],[`\0
11
11
  \f\r "&'<=>\``.split(``),`\0
12
12
  \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Qs(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Vo);let l=$s(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Gs(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!ks(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function $s(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=ec(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function ec(e,t,n){let r=Lo(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=ds(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Zs.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?vs:ys)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=ds(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Zs.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&_s(n,o)>_s(n,e.alternative)&&(o=e.alternative),s=o+ds(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Zs.single:Zs.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var tc=[`<`,`&`];function nc(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:ds(e.value,Object.assign({},r.settings.characterReferences,{subset:tc}))}function rc(e,t,n,r){return r.settings.allowDangerousHtml?e.value:nc(e,t,n,r)}function ic(e,t,n,r){return r.all(e)}var ac=Uo(`type`,{invalid:oc,unknown:sc,handlers:{comment:hs,doctype:gs,element:Qs,raw:rc,root:ic,text:nc}});function oc(e){throw Error("Expected node, not `"+e+"`")}function sc(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var cc={},lc={},uc=[];function dc(e,t){let n=t||cc,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:fc,all:pc,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||uo,characterReferences:n.characterReferences||lc,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Vo:Bo,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function fc(e,t,n){return ac(e,t,n,this)}function pc(e){let t=[],n=e&&e.children||uc,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var mc=/\s+/g;function hc(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(mc)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(mc);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var gc=/:?lang=["']([^"']+)["']/g,_c=/(?:```|~~~)([\w-]+)/g,vc=/\\begin\{([\w-]+)\}/g,yc=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,bc=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function xc(e){let t=Ma(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Sc(e,t,n){let r=new Set;for(let t of e.matchAll(gc)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(_c)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(vc)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(yc)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(bc.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var Cc=[`color`,`background-color`];function wc(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 Tc(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Ec(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Tc(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return wc(e,a)})):e}function Dc(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>Oc(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&&Cc.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function Oc(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&ci.Italic&&(t[`font-style`]=`italic`),e.fontStyle&ci.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&ci.Underline&&n.push(`underline`),e.fontStyle&ci.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function kc(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Ac(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=xc(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new K(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new K(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));jc(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Ec(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new K(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Mc(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new K(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new K(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&hc(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 jc(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new K(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new K(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Mc(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Mc).join(``):``}var Nc=[Ac()];function Pc(e){let t=Fc(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Nc]}function Fc(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 Ic=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Lc={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Rc(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 zc(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 Bc(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)Lc[r]&&t.push({type:`setDecoration`,value:Lc[r]});else if(r<=29){let e=Lc[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:Ic[r-30]}});else if(r===38){let n=zc(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:Ic[r-40]}});else if(r===48){let n=zc(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:Ic[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Ic[r-100+8]}})}}return t}function Vc(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Rc(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=Bc(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 Hc={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 Uc(e=Hc){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<Ic.length;e++)r.push(t(Ic[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 Wc=/#([0-9a-f]{3,8})/i,Gc=/var\((--[\w-]+-ansi-[\w-]+)\)/,Kc={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 qc(e,t,n){let r=Ca(e,n),i=Ma(t),a=Uc(Object.fromEntries(Ic.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Kc[t]]}))),o=Vc();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=wa(i,r),o=wa(o,r),n.decorations.has(`dim`)&&(i=Jc(i));let s=ci.None;return n.decorations.has(`bold`)&&(s|=ci.Bold),n.decorations.has(`italic`)&&(s|=ci.Italic),n.decorations.has(`underline`)&&(s|=ci.Underline),n.decorations.has(`strikethrough`)&&(s|=ci.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Jc(e){let t=e.match(Wc);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(Gc);return n?`var(${n[1]}-dim)`:e}function Yc(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Da(r)&&!ka(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return qc(r,t,n)}return $a(e,t,n)}function Xc(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new K("`themes` option must not be empty");let p=co(e,t,n,Yc);if(c=qa(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new K(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Dc(e,h,u,l,d))),c&&Ka(a,c);let g=f.map(e=>Ca(e.theme,n));i=Zc(f,m,g,u,l,`fg`,d),r=Zc(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=Ca(n.theme,n);a=Yc(e,t,n);let l=e.getTheme(n.theme);r=wa(l.bg,s),i=wa(l.fg,s),o=l.name,c=qa(a)}else throw new K("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Zc(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=wa(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new K('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${wa(t[r][a],n[r])||`inherit`}, ${wa(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Qc=/^\s+$/,$c=/^(\s*)(.*?)(\s*)$/;function el(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>el(e,t,n),codeToTokens:(t,n)=>Xc(e,t,n)}){let i=t;for(let e of Pc(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Xc(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=nl(a):d===`never`&&(a=rl(a)),f&&(a=il(a));let p={...r,get source(){return i}};for(let e of Pc(n))a=e.tokens?.call(p,a)||a;return tl(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function tl(e,t,n,r=qa(e)){let i=Pc(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:hc,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
13
- `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=kc(a.htmlStyle||Oc(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&&Ka(m,r),m}function nl(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&ci.Underline||i.fontStyle&ci.Strikethrough));o&&Qc.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function rl(e){return e.map(e=>e.flatMap(e=>{if(Qc.test(e.content))return e;let t=e.content.match($c);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 il(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=kc(e.htmlStyle||Oc(e)),i=kc(n.htmlStyle||Oc(n)),a=e.fontStyle&&(e.fontStyle&ci.Underline||e.fontStyle&ci.Strikethrough),o=n.fontStyle&&(n.fontStyle&ci.Underline||n.fontStyle&ci.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var al=dc;function ol(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>el(e,t,n),codeToTokens:(t,n)=>Xc(e,t,n)},i=al(el(e,t,n,r));for(let e of Pc(n))i=e.postprocess?.call(r,i,n)||i;return i}async function sl(e){let t=await Wa(e);return{getLastGrammarState:(...e)=>eo(t,...e),codeToTokensBase:(e,n)=>Yc(t,e,n),codeToTokensWithThemes:(e,n)=>co(t,e,n),codeToTokens:(e,n)=>Xc(t,e,n),codeToHast:(e,n)=>el(t,e,n),codeToHtml:(e,n)=>ol(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cl(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,Oa(n))return[];let r=t[n];if(!r)throw new K(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Aa(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new K(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await sl({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 ll(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 ul(e,t){let n=ll(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 dl=cl({langs:ur,themes:dr,engine:()=>(0,Vr.createOnigurumaEngine)(G(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),{codeToHtml:fl,codeToHast:pl,codeToTokens:ml,codeToTokensBase:hl,codeToTokensWithThemes:gl,getSingletonHighlighter:_l,getLastGrammarState:vl}=ul(dl,{guessEmbeddedLanguages:Sc}),yl=4294967295,bl=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:yl,end:yl,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 xl(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Sl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Cl=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),wl=String.raw;function Tl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var El=wl`\[\^?`,Dl=`c.? | C(?:-.?)?|${wl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${wl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${wl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${wl`o\{[^\}]*\}?`}|${wl`\d{1,3}`}`,Ol=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,kl=new RegExp(wl`
13
+ `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=kc(a.htmlStyle||Oc(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&&Ka(m,r),m}function nl(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&ci.Underline||i.fontStyle&ci.Strikethrough));o&&Qc.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function rl(e){return e.map(e=>e.flatMap(e=>{if(Qc.test(e.content))return e;let t=e.content.match($c);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 il(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=kc(e.htmlStyle||Oc(e)),i=kc(n.htmlStyle||Oc(n)),a=e.fontStyle&&(e.fontStyle&ci.Underline||e.fontStyle&ci.Strikethrough),o=n.fontStyle&&(n.fontStyle&ci.Underline||n.fontStyle&ci.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var al=dc;function ol(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>el(e,t,n),codeToTokens:(t,n)=>Xc(e,t,n)},i=al(el(e,t,n,r));for(let e of Pc(n))i=e.postprocess?.call(r,i,n)||i;return i}async function sl(e){let t=await Wa(e);return{getLastGrammarState:(...e)=>eo(t,...e),codeToTokensBase:(e,n)=>Yc(t,e,n),codeToTokensWithThemes:(e,n)=>co(t,e,n),codeToTokens:(e,n)=>Xc(t,e,n),codeToHast:(e,n)=>el(t,e,n),codeToHtml:(e,n)=>ol(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function cl(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,Oa(n))return[];let r=t[n];if(!r)throw new K(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Aa(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new K(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await sl({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 ll(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 ul(e,t){let n=ll(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 dl=cl({langs:dr,themes:fr,engine:()=>(0,Vr.createOnigurumaEngine)(W(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url))}),{codeToHtml:fl,codeToHast:pl,codeToTokens:ml,codeToTokensBase:hl,codeToTokensWithThemes:gl,getSingletonHighlighter:_l,getLastGrammarState:vl}=ul(dl,{guessEmbeddedLanguages:Sc}),yl=4294967295,bl=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:yl,end:yl,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 xl(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Sl(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Cl=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),wl=String.raw;function Tl(e,t){if(e==null)throw Error(t??`Value expected`);return e}var El=wl`\[\^?`,Dl=`c.? | C(?:-.?)?|${wl`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${wl`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${wl`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${wl`o\{[^\}]*\}?`}|${wl`\d{1,3}`}`,Ol=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,kl=new RegExp(wl`
14
14
  \\ (?:
15
15
  ${Dl}
16
16
  | [gk]<[^>]*>?
@@ -150,8 +150,8 @@ XID_Continue XIDC
150
150
  XID_Start XIDS`.split(/\s/).map(e=>[Yu(e),e])),Hd=new Map([[`s`,Dd(383)],[Dd(383),`s`]]),Ud=new Map([[Dd(223),Dd(7838)],[Dd(107),Dd(8490)],[Dd(229),Dd(8491)],[Dd(969),Dd(8486)]]),Wd=new Map([qd(453),qd(456),qd(459),qd(498),...Jd(8072,8079),...Jd(8088,8095),...Jd(8104,8111),qd(8124),qd(8140),qd(8188)]),Gd=new Map([[`alnum`,Z`[\p{Alpha}\p{Nd}]`],[`alpha`,Z`\p{Alpha}`],[`ascii`,Z`\p{ASCII}`],[`blank`,Z`[\p{Zs}\t]`],[`cntrl`,Z`\p{Cc}`],[`digit`,Z`\p{Nd}`],[`graph`,Z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Z`\p{Lower}`],[`print`,Z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Z`[\p{P}\p{S}]`],[`space`,Z`\p{space}`],[`upper`,Z`\p{Upper}`],[`word`,Z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Z`\p{AHex}`]]);function Kd(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function qd(e){let t=Dd(e);return[t.toLowerCase(),t]}function Jd(e,t){return Kd(e,t).map(e=>qd(e))}var Yd=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Xd(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};ef(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Md(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Qu(e,Zd,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Qu(e,Qd,a),Qu(e,$d,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Zd={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Pu();e.body[0].body.push(Fu({negate:!0,body:r}),Vu(`Any`));let i=Pu();i.body[0].body.push(Ru(`greedy`,0,1/0,e)),n(Q(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];jd(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=cf(t.get(e));if(n){let t=Pu({flags:n});t.body[0].body=e.body,e.body=[Q(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(Q(Fu({body:[wu({body:[Tu(`string_end`)]}),wu({body:[Ou(10)]})]}),t));else if(c===`line_start`)o(Q(_f(Z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&mf(e))o(Q(Fu({negate:!0}),t));else if(d)throw Error(Z`Uses "\G" in a way that requires a subclass`);else o(yf(Tu(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(Q(_f(Z`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${zd})(?!${zd})|(?<!${zd})(?=${zd}))`,n=`(?:(?<=${zd})(?=${zd})|(?<!${zd})(?!${zd}))`;o(Q(_f(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!gf(n)&&(n=sf(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!gf(r)&&(r=sf(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(Q(ku({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(yf(ju(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(Q(vf(_f(Ld),l),t));return}if(s&&(c===`word`||u===`word`)){n(yf(ju(`word`,{negate:l}),t));return}if(c===`any`)n(yf(Vu(`Any`),t));else if(c===`digit`)n(yf(Vu(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Z`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Z`\p{RI}{2}|${e}(?:\u200D${e})*`;n(Q(_f(Z`(?>\r\n|${i?Z`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(yf(Vu(`AHex`,{negate:l}),t));else if(c===`newline`)n(Q(_f(l?`[^
151
151
  ]`:`(?>\r
152
152
  ?|[
153
- \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Dd(e.codePointAt(0)-1)}${Dd(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(_f(`[${e}]`),t))}else n(Q(vf(_f(Gd.get(u)),l),t))}else if(c===`property`)Vd.has(Yu(u))||(e.key=`sc`);else if(c===`space`)n(yf(Vu(`space`,{negate:l}),t));else if(c===`word`)n(Q(vf(_f(zd),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Pu({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&du(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=Fu({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(Fu({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Pu();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=df(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!gf(n)&&(n=sf(n,t),e.ref=n)}},Qd={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=yf(af(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&jd(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=jd(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Ad(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?af(0):rf(o,r.groupOriginByCopy,null),l=c;if(!s){let e=cf(of(o,e=>e.type===`Group`&&!!e.flags)),t=e?Ad(r.globalFlags,e):r.globalFlags;tf(t,r.currentFlags)||(l=Pu({flags:lf(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},$d={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>nf(t,e));i.length?i.length>1?n(Q(Pu({atomic:!0,body:i.reverse().map(e=>wu({body:[Eu(e.number)]}))}),t)):e.ref=i[0].number:n(Q(Fu({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Du();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ef(e){Qu(e,{"*"({node:e,parent:t}){e.parent=t}})}function tf(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function nf(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=uf(n.parent);for(let r of t){if(r===n)break;if(r===e||ff(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function rf(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=rf(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function af(e){let t=Bu(e);return t.isRecursive=!0,t}function of(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function sf(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function cf(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function lf({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function uf(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function df(e){let t=e.find(e=>e.kind===`search_start`||hf(e,{negate:!1})||!pf(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=df(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function ff(e,t){let n=uf(e)??[];for(let e of n)if(e===t||ff(e,t))return!0;return!1}function pf({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function mf(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function hf(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&du(e.body[0],{type:`Assertion`,kind:`search_start`})}function gf(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function _f(e,t){let n=mu(e,{...t,unicodePropertyMap:Vd}).body;return n.length>1||n[0].body.length>1?Pu({body:n}):n[0].body[0]}function vf(e,t){return e.negate=t,e}function yf(e,t){return e.parent=t,e}function Q(e,t){return ef(e),e.parent=t,e}function bf(e,t){let n=Id(t),r=Md(n.target,`ES2024`),i=Md(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Qu(e,xf,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Nd(Sf[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&jd(f._captureTransfers,e.transferTo,[]).push(t)}),f}var xf={"*":{enter({node:e},t){if(Pf(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Ad({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Pf(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Of(Dd(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),kf(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Yd.has(e.value)&&t.setHasCasedChar()}},Sf={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Dd(e),r=Af(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Of(n)){let e=Bd(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Od.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(If)&&(o=[Ou(45),...o.filter(e=>!If(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Od.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Pu(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=wu({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Od.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Af(n,i),o=Af(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&jf(kf(e)).forEach(e=>{s.add(Array.isArray(e)?`${Af(e[0],i)}-${Af(e[1],i)}`:Af(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Yd.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Ad(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Mf(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Nf(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},Cf=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),wf=new Set([`-`,`\\`,`]`,`^`,`[`]),Tf=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Ef=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),Df=/^\p{Cased}$/u;function Of(e){return Df.test(e)}function kf(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Dd(e);if(!Of(t))continue;let o=Bd(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Af(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Ef.has(e))return Ef.get(e);if(e<32||e>126&&e<160||e>262143||t&&Ff(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Tf:wf:Cf,a=Dd(e);return(i.has(a)?`\\`:``)+a}function jf(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Mf(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Nf({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Pf({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Ff(e){return e>47&&e<58}function If({type:e,value:t}){return e===`Character`&&t===45}var Lf=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=zf(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Rf(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Bf(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Rf(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function zf(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)jd(n,t,{}).transferTo=e;return n}function Bf(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Vf(e,t){let n=Hf(e,t);return n.options?new Lf(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Hf(e,t){let n=Id(t),r=Xd(mu(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Vd}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=bf(r,n),a=xd(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=dd(md(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Uf(e,t){return Vf(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Wf(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Uf(e,{target:t.target}),{createScanner(e){return new bl(e,t)},createString(e){return{content:e}}}}async function Gf(e){if(Xn())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=Kn.get(e);if(t!=null)return t;try{let t=qn.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(ur,e)&&(t=ur[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 Gn.has(e)||Gn.set(e,n),n});return Kn.set(e,n),await n}finally{Kn.delete(e)}}function Kf(e){return Gn.get(e)??Gf(e)}function qf({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Jf(t)}}function Jf(e){return async()=>Ia(Rn(await e()))}var Yf=`pierre`,Xf=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Zf=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Qf=[...Zf,...Xf],$f=new Set(Zf);function ep(e){return $f.has(e)?`light`:`dark`}var tp={"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`},np={"pierre-dark":()=>G(()=>import(`./pierre-dark-CpLgRqie.js`),[],import.meta.url),"pierre-dark-soft":()=>G(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[],import.meta.url),"pierre-dark-vibrant":()=>G(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>G(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[],import.meta.url),"pierre-dark-tritanopia":()=>G(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[],import.meta.url),"pierre-light":()=>G(()=>import(`./pierre-light-CoaEpmwp.js`),[],import.meta.url),"pierre-light-soft":()=>G(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[],import.meta.url),"pierre-light-vibrant":()=>G(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>G(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[],import.meta.url),"pierre-light-tritanopia":()=>G(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[],import.meta.url)};function rp(e){return qf({name:e,collection:Yf,colorScheme:ep(e),displayName:tp[e],load:np[e]})}var ip=Nn({themes:Qf.map(e=>rp(e))}),ap=`shiki`,op=[`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`],sp=`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(`.`),cp=new Set(op);function lp(e){return cp.has(e)?`light`:`dark`}var up={andromeeda:()=>G(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url),"aurora-x":()=>G(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url),"ayu-dark":()=>G(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url),"ayu-light":()=>G(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url),"ayu-mirage":()=>G(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url),"catppuccin-frappe":()=>G(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url),"catppuccin-latte":()=>G(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url),"catppuccin-macchiato":()=>G(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url),"catppuccin-mocha":()=>G(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url),"dark-plus":()=>G(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url),dracula:()=>G(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url),"dracula-soft":()=>G(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url),"everforest-dark":()=>G(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url),"everforest-light":()=>G(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url),"github-dark":()=>G(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url),"github-dark-default":()=>G(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url),"github-dark-dimmed":()=>G(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url),"github-dark-high-contrast":()=>G(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url),"github-light":()=>G(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url),"github-light-default":()=>G(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url),"github-light-high-contrast":()=>G(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url),"gruvbox-dark-hard":()=>G(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url),"gruvbox-dark-medium":()=>G(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url),"gruvbox-dark-soft":()=>G(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url),"gruvbox-light-hard":()=>G(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url),"gruvbox-light-medium":()=>G(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url),"gruvbox-light-soft":()=>G(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url),horizon:()=>G(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url),"horizon-bright":()=>G(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url),houston:()=>G(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url),"kanagawa-dragon":()=>G(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url),"kanagawa-lotus":()=>G(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url),"kanagawa-wave":()=>G(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url),laserwave:()=>G(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url),"light-plus":()=>G(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url),"material-theme":()=>G(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url),"material-theme-darker":()=>G(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url),"material-theme-lighter":()=>G(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url),"material-theme-ocean":()=>G(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url),"material-theme-palenight":()=>G(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url),"min-dark":()=>G(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url),"min-light":()=>G(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url),monokai:()=>G(()=>import(`./monokai-BscAjiQZ.js`),[],import.meta.url),"night-owl":()=>G(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url),"night-owl-light":()=>G(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url),nord:()=>G(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url),"one-dark-pro":()=>G(()=>import(`./one-dark-pro-C6YyR8OD.js`),[],import.meta.url),"one-light":()=>G(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url),plastic:()=>G(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url),poimandres:()=>G(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url),red:()=>G(()=>import(`./red-CYlAq2b0.js`),[],import.meta.url),"rose-pine":()=>G(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url),"rose-pine-dawn":()=>G(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url),"rose-pine-moon":()=>G(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url),"slack-dark":()=>G(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url),"slack-ochin":()=>G(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url),"snazzy-light":()=>G(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url),"solarized-dark":()=>G(()=>import(`./solarized-dark-b97czJOk.js`),[],import.meta.url),"solarized-light":()=>G(()=>import(`./solarized-light-DFPxpIYQ.js`),[],import.meta.url),"synthwave-84":()=>G(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url),"tokyo-night":()=>G(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url),vesper:()=>G(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url),"vitesse-black":()=>G(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url),"vitesse-dark":()=>G(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url),"vitesse-light":()=>G(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url)};function dp(e){return qf({name:e,collection:ap,colorScheme:lp(e),load:up[e]})}var fp=Nn({themes:Object.freeze([...op.map(e=>dp(e)),...sp.map(e=>dp(e))])});function pp(e){if(Xn())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(Un.hasRegisteredTheme(e))return;let t=fp.getTheme(e);if(t!=null){Un.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function mp(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function hp(e){pp(e);let t=await Un.resolveTheme(e);return mp(e,t),t}function gp(e){return Un.getResolvedTheme(e)??hp(e)}var _p;async function vp({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){_p??=dl({themes:[],langs:[`text`],engine:n===`shiki-wasm`?Br(G(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url)):Wf()});let r=bp(_p)?await _p:_p;_p=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Kf(e);`then`in t?i.push(t):Yn(t,r)}let a=[];for(let t of e){let e=gp(t);`then`in e?a.push(e):Wn(e,_p)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Yn(e,r)}),Promise.all(a).then(e=>{Wn(e,r)})]),r}function yp(){if(_p!=null&&!(`then`in _p))return _p}function bp(e=_p){return e!=null&&`then`in e}for(let e of ip.getThemes())Un.registerThemeIfAbsent(e.name,e.load);function xp(e=V){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Sp=new Map,Cp={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function wp(e){if(Sp.has(e))return Sp.get(e)??`text`;if(Cp[e]!=null)return Cp[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Sp.has(t[1]))return Sp.get(t[1])??`text`;if(Cp[t[1]]!=null)return Cp[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Sp.has(n)?Sp.get(n)??`text`:Cp[n]??`text`}function Tp(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Ep({name:e,width:t=16,height:n=16,properties:r}){return $({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[$({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Dp(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 Op(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function kp(e,t,n,r={}){return $({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[$({tagName:`span`,properties:{"data-line-number-content":``},children:[Tp(`${t}`)]})]})}function Ap(e,t,n){return $({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 jp(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(Tp(`
154
- `)),e}var Mp=Symbol(`no-token`),Np=Symbol(`multiple-tokens`);function Pp(e){let t=Fp(e);if(t!=null)return t;let n=Mp,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`){Lp(e,a);for(let t of e.children)Ip(t)}else Ip(e);r.push(e),i=[],a=void 0;return}for(let e of i)Ip(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Mp){if(e===Np){n=Np;return}if(n===Mp){n=e;return}n!==e&&(n=Np)}};for(let t of e.children){let e=t.type===`element`?Pp(t):Mp;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 Fp(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Ip(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Ip(t)}}function Lp(e,t){e.properties[`data-char`]=t}function Rp(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+zp(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 zp(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 Bp(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Dp(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Pp(a),i.push(jp(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(Hp,Vp),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:Vp}}var Vp=Rp({classPrefix:`hl-`}),Hp={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 Up(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Wp=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Gp=/^0(?:\.0+)?%?$/;function Kp(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 qp(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 Jp(e){if(e==null)return null;let t=qp(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 Yp(e,t){let[n,r]=e>t?[e,t]:[t,e];return(n+.05)/(r+.05)}function Xp(e,t){if(t==null)return;let n=qp(e),r=qp(t);if(n==null||r==null)return;let[i,a,o,s]=n,[c,l,u]=r;return`#`+[Math.round(i*s+c*(1-s)),Math.round(a*s+l*(1-s)),Math.round(o*s+u*(1-s))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Zp(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Wp.test(t))return!0;let n=Kp(t);return n!=null&&Gp.test(n)}function Qp(e,t){let n=Jp(e);if(n!=null)return n<.4;let r=Jp(t);return r!=null&&r>.6}function $p(e,t){if(e==null||t==null)return!1;if(e.trim().toLowerCase()===t.trim().toLowerCase())return!0;let n=Jp(e),r=Jp(t);return n==null||r==null?!1:Math.abs(n-r)<.06}function em(e,t,n){if(t==null||n==null)return!1;let r=Jp(e),i=Jp(t),a=Jp(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}function tm(e,t){let n=Jp(e),r=t.find(e=>e!=null&&e!==``);if(n==null)return r;let i,a=-1;for(let e of t){if(e==null||e===``)continue;let t=Jp(e);if(t==null)continue;let r=Yp(n,t);if(r>=3)return e;r>a&&(i=e,a=r)}return i??r}function nm(e,t){if(t==null)return e;let n=qp(e),r=qp(t),i=Jp(t);if(n==null||r==null||i==null)return`color-mix(in srgb, ${e} 70%, ${t})`;let[a,o,s]=n,[c,l,u]=r;for(let e of[.6,.7,.8,.9]){let t=`#`+[Math.round(a*e+c*(1-e)),Math.round(o*e+l*(1-e)),Math.round(s*e+u*(1-e))].map(e=>e.toString(16).padStart(2,`0`)).join(``),n=Jp(t);if(n!=null&&Yp(i,n)>=4.5)return t}return e}var rm=new WeakMap;function im(e){let t=rm.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;am(r,`editor.background`,i),am(r,`editor.foreground`,a),am(r,`sideBar.background`,o),am(r,`sideBar.foreground`,s),am(r,`input.background`,n[`input.background`]??o),am(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),am(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),am(r,`gitDecoration.addedResourceForeground`,om(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),am(r,`gitDecoration.modifiedResourceForeground`,om(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),am(r,`gitDecoration.deletedResourceForeground`,om(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Zp(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Zp(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(sm(l,o)||em(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return rm.set(e,u),u}function am(e,t,n){n!=null&&n!==``&&(e[t]=n)}function om(...e){for(let t of e)if(t!=null&&t!==``)return t}function sm(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function cm({theme:e=V,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=im(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Up(`global`)}fg:${a.fg};`,r+=`${Up(`global`)}bg:${a.bg};`,r+=lm(i,n)}else{let n=t.getTheme(e.dark),i=im(n);r+=`${Up(`global`)}dark:${i.fg};`,r+=`${Up(`global`)}dark-bg:${i.bg};`,r+=lm(n,`dark`),n=t.getTheme(e.light),i=im(n),r+=`${Up(`global`)}light:${i.fg};`,r+=`${Up(`global`)}light-bg:${i.bg};`,r+=lm(n,`light`)}return r}function lm(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Up(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Up(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Up(`global`)}${t}modified-color:${a};`),n}function um(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function dm(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function fm(e,t){return An(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function pm(e){let t=e.lang??wp(e.name),n=e.lang??(e.prevName==null?`text`:wp(e.prevName));return t===`text`&&n===`text`}function mm(e){return{...ke,...e}}function hm(e,t){let n=gm(e,t);return t?n:e.diffHeaderHeight+n}function gm(e,t){return e.paddingTop??(t?e.spacing:0)}function _m(e){return e.paddingBottom??e.spacing}function vm(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function ym(e){return[x(e.additionStart,e.additionCount)+1,xe(e.additionStart,e.additionCount)+1]}function bm({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 xm(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-xe(t.additionStart,t.additionCount),r=e.deletionLines.length-xe(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function Sm({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-xe(n.additionStart,n.additionCount),i=e.deletionLines.length-xe(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function Cm({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=Sm({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 wm({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=ym(a);if(t<o){let s=bm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=ym(a);return t<o+i.fromStart||t>=o+i.rangeSize}function Tm({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=ym(n),l=bm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function Em({type:e,metrics:t}){return t.hunkSeparatorHeight??vm(e)}function Dm({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function Om({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 km(e){return e!==`simple`&&e!==`metadata`}function Am({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!Om({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=Em({type:e,metrics:t}),a=Dm({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function jm({type:e,metrics:t}){if(!km(e))return;let n=Em({type:e,metrics:t}),r=Dm({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Mm({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=Nm({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=x(r.deletionStart,r.deletionCount),s=x(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=bm({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?Cm({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Im(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Im(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,S=o+1,C=s+1,ee=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===ee;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Im(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:S+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:C+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,S+=e.lines,C+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Lm(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(Rm({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:C,deletionLineNumber:S,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,S+=e.deletions,C+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Im(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:S+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:C+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function Nm({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Pm({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 Pm({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=bm({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?Cm({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 Fm(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 Im(e,t,n,r,i,a){let[o,s]=Fm(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 Lm(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 Rm({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,T=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&T!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:T};if(w!=null&&T==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||T==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:T}}var zm=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Bm=new class extends zm{};function Vm(e,t,n){return Bm.diff(e,t,n)}function Hm(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Um(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Wm(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Gm(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Km(e,t){return Wm(e,t,``)}function qm(e,t){return Gm(e,t,``)}function Jm(e,t){return t.slice(0,Ym(e,t))}function Ym(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Xm(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Zm(e,t){if(t)return $m(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Qm(e,t){if(t)return $m(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function $m(e,t){if(!t)return[Qm(e),Zm(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Xm(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var eh=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,th=RegExp(`[${eh}]+|\\s+|[^${eh}]`,`ug`);new class extends zm{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Xm(e,r)}else n=e.match(th)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&nh(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&nh(n,i,r,null,t.intlSegmenter),e}};function nh(e,t,n,r,i){if(t&&n){let[a,o]=$m(t.value,i),[s,c]=$m(n.value,i);if(e){let r=Hm(a,s);e.value=Gm(e.value,s,r),t.value=Km(t.value,r),n.value=Km(n.value,r)}if(r){let e=Um(o,c);r.value=Wm(r.value,c,e),t.value=qm(t.value,e),n.value=qm(n.value,e)}}else if(n){if(e){let e=Qm(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Qm(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Qm(r.value,i),[a,o]=$m(t.value,i),s=Hm(n,a);t.value=Km(t.value,s);let c=Um(Km(n,s),o);t.value=qm(t.value,c),r.value=Wm(r.value,n,c),e.value=Gm(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Qm(r.value,i),n=Jm(Zm(t.value,i),e);t.value=qm(t.value,n)}else if(e){let n=Jm(Zm(e.value,i),Qm(t.value,i));t.value=Km(t.value,n)}}var rh=new class extends zm{tokenize(e){let t=RegExp(`(\\r?\\n)|[${eh}]+|[^\\S\\n\\r]+|[^${eh}]`,`ug`);return e.match(t)||[]}};function ih(e,t,n){return rh.diff(e,t,n)}var ah=new class extends zm{constructor(){super(...arguments),this.tokenize=sh}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
153
+ \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Dd(e.codePointAt(0)-1)}${Dd(e.codePointAt(2)+1)}-\u{10FFFF}`),n(Q(_f(`[${e}]`),t))}else n(Q(vf(_f(Gd.get(u)),l),t))}else if(c===`property`)Vd.has(Yu(u))||(e.key=`sc`);else if(c===`space`)n(yf(Vu(`space`,{negate:l}),t));else if(c===`word`)n(Q(vf(_f(zd),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Pu({flags:c});e.body[0].body=o(),i(Q(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&du(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Z`Uses "\K" in a way that's unsupported`);let o=Fu({behind:!0});o.body[0].body=a(),i(Q(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(Q(Fu({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Pu();t.body[0].body.push(e.body),e.body=Q(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=df(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!gf(n)&&(n=sf(n,t),e.ref=n)}},Qd={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=yf(af(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&jd(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=jd(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Ad(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?af(0):rf(o,r.groupOriginByCopy,null),l=c;if(!s){let e=cf(of(o,e=>e.type===`Group`&&!!e.flags)),t=e?Ad(r.globalFlags,e):r.globalFlags;tf(t,r.currentFlags)||(l=Pu({flags:lf(t)}),l.body[0].body.push(c))}n(Q(l,t),{traverse:!s})}},$d={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>nf(t,e));i.length?i.length>1?n(Q(Pu({atomic:!0,body:i.reverse().map(e=>wu({body:[Eu(e.number)]}))}),t)):e.ref=i[0].number:n(Q(Fu({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Du();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ef(e){Qu(e,{"*"({node:e,parent:t}){e.parent=t}})}function tf(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function nf(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=uf(n.parent);for(let r of t){if(r===n)break;if(r===e||ff(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function rf(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=rf(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function af(e){let t=Bu(e);return t.isRecursive=!0,t}function of(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function sf(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function cf(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function lf({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function uf(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function df(e){let t=e.find(e=>e.kind===`search_start`||hf(e,{negate:!1})||!pf(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=df(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function ff(e,t){let n=uf(e)??[];for(let e of n)if(e===t||ff(e,t))return!0;return!1}function pf({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function mf(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function hf(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&du(e.body[0],{type:`Assertion`,kind:`search_start`})}function gf(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function _f(e,t){let n=mu(e,{...t,unicodePropertyMap:Vd}).body;return n.length>1||n[0].body.length>1?Pu({body:n}):n[0].body[0]}function vf(e,t){return e.negate=t,e}function yf(e,t){return e.parent=t,e}function Q(e,t){return ef(e),e.parent=t,e}function bf(e,t){let n=Id(t),r=Md(n.target,`ES2024`),i=Md(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Qu(e,xf,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Nd(Sf[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&jd(f._captureTransfers,e.transferTo,[]).push(t)}),f}var xf={"*":{enter({node:e},t){if(Pf(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Ad({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Pf(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Of(Dd(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),kf(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Yd.has(e.value)&&t.setHasCasedChar()}},Sf={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?Z`\B`:Z`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=Dd(e),r=Af(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Of(n)){let e=Bd(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Od.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(If)&&(o=[Ou(45),...o.filter(e=>!If(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Od.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Pu(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=wu({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Od.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Af(n,i),o=Af(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&jf(kf(e)).forEach(e=>{s.add(Array.isArray(e)?`${Af(e[0],i)}-${Af(e[1],i)}`:Af(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Z`[^\n]`;if(e===`digit`)return t?Z`\D`:Z`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Yd.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Z`\P`:Z`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Z`\W`:Z`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=Ad(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Mf(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Nf(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Z`\g<${t}&R=${r}>`}},Cf=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),wf=new Set([`-`,`\\`,`]`,`^`,`[`]),Tf=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Ef=new Map([[9,Z`\t`],[10,Z`\n`],[11,Z`\v`],[12,Z`\f`],[13,Z`\r`],[8232,Z`\u2028`],[8233,Z`\u2029`],[65279,Z`\uFEFF`]]),Df=/^\p{Cased}$/u;function Of(e){return Df.test(e)}function kf(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=Dd(e);if(!Of(t))continue;let o=Bd(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Af(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Ef.has(e))return Ef.get(e);if(e<32||e>126&&e<160||e>262143||t&&Ff(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Tf:wf:Cf,a=Dd(e);return(i.has(a)?`\\`:``)+a}function jf(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Mf(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Nf({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Pf({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Ff(e){return e>47&&e<58}function If({type:e,value:t}){return e===`Character`&&t===45}var Lf=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=zf(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(Rf(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Bf(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function Rf(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function zf(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)jd(n,t,{}).transferTo=e;return n}function Bf(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Vf(e,t){let n=Hf(e,t);return n.options?new Lf(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Hf(e,t){let n=Id(t),r=Xd(mu(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Vd}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=bf(r,n),a=xd(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=dd(md(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function Uf(e,t){return Vf(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Wf(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>Uf(e,{target:t.target}),{createScanner(e){return new bl(e,t)},createString(e){return{content:e}}}}async function Gf(e){if(Zn())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=qn.get(e);if(t!=null)return t;try{let t=Jn.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(dr,e)&&(t=dr[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 Kn.has(e)||Kn.set(e,n),n});return qn.set(e,n),await n}finally{qn.delete(e)}}function Kf(e){return Kn.get(e)??Gf(e)}function qf({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:Jf(t)}}function Jf(e){return async()=>Ia(zn(await e()))}var Yf=`pierre`,Xf=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],Zf=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],Qf=[...Zf,...Xf],$f=new Set(Zf);function ep(e){return $f.has(e)?`light`:`dark`}var tp={"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`},np={"pierre-dark":()=>W(()=>import(`./pierre-dark-CpLgRqie.js`),[],import.meta.url),"pierre-dark-soft":()=>W(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[],import.meta.url),"pierre-dark-vibrant":()=>W(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>W(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[],import.meta.url),"pierre-dark-tritanopia":()=>W(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[],import.meta.url),"pierre-light":()=>W(()=>import(`./pierre-light-CoaEpmwp.js`),[],import.meta.url),"pierre-light-soft":()=>W(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[],import.meta.url),"pierre-light-vibrant":()=>W(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>W(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[],import.meta.url),"pierre-light-tritanopia":()=>W(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[],import.meta.url)};function rp(e){return qf({name:e,collection:Yf,colorScheme:ep(e),displayName:tp[e],load:np[e]})}var ip=Pn({themes:Qf.map(e=>rp(e))}),ap=`shiki`,op=[`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`],sp=`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(`.`),cp=new Set(op);function lp(e){return cp.has(e)?`light`:`dark`}var up={andromeeda:()=>W(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url),"aurora-x":()=>W(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url),"ayu-dark":()=>W(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url),"ayu-light":()=>W(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url),"ayu-mirage":()=>W(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url),"catppuccin-frappe":()=>W(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url),"catppuccin-latte":()=>W(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url),"catppuccin-macchiato":()=>W(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url),"catppuccin-mocha":()=>W(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url),"dark-plus":()=>W(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url),dracula:()=>W(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url),"dracula-soft":()=>W(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url),"everforest-dark":()=>W(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url),"everforest-light":()=>W(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url),"github-dark":()=>W(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url),"github-dark-default":()=>W(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url),"github-dark-dimmed":()=>W(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url),"github-dark-high-contrast":()=>W(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url),"github-light":()=>W(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url),"github-light-default":()=>W(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url),"github-light-high-contrast":()=>W(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url),"gruvbox-dark-hard":()=>W(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url),"gruvbox-dark-medium":()=>W(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url),"gruvbox-dark-soft":()=>W(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url),"gruvbox-light-hard":()=>W(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url),"gruvbox-light-medium":()=>W(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url),"gruvbox-light-soft":()=>W(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url),horizon:()=>W(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url),"horizon-bright":()=>W(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url),houston:()=>W(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url),"kanagawa-dragon":()=>W(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url),"kanagawa-lotus":()=>W(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url),"kanagawa-wave":()=>W(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url),laserwave:()=>W(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url),"light-plus":()=>W(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url),"material-theme":()=>W(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url),"material-theme-darker":()=>W(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url),"material-theme-lighter":()=>W(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url),"material-theme-ocean":()=>W(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url),"material-theme-palenight":()=>W(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url),"min-dark":()=>W(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url),"min-light":()=>W(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url),monokai:()=>W(()=>import(`./monokai-BscAjiQZ.js`),[],import.meta.url),"night-owl":()=>W(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url),"night-owl-light":()=>W(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url),nord:()=>W(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url),"one-dark-pro":()=>W(()=>import(`./one-dark-pro-C6YyR8OD.js`),[],import.meta.url),"one-light":()=>W(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url),plastic:()=>W(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url),poimandres:()=>W(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url),red:()=>W(()=>import(`./red-CYlAq2b0.js`),[],import.meta.url),"rose-pine":()=>W(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url),"rose-pine-dawn":()=>W(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url),"rose-pine-moon":()=>W(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url),"slack-dark":()=>W(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url),"slack-ochin":()=>W(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url),"snazzy-light":()=>W(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url),"solarized-dark":()=>W(()=>import(`./solarized-dark-b97czJOk.js`),[],import.meta.url),"solarized-light":()=>W(()=>import(`./solarized-light-DFPxpIYQ.js`),[],import.meta.url),"synthwave-84":()=>W(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url),"tokyo-night":()=>W(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url),vesper:()=>W(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url),"vitesse-black":()=>W(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url),"vitesse-dark":()=>W(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url),"vitesse-light":()=>W(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url)};function dp(e){return qf({name:e,collection:ap,colorScheme:lp(e),load:up[e]})}var fp=Pn({themes:Object.freeze([...op.map(e=>dp(e)),...sp.map(e=>dp(e))])});function pp(e){if(Zn())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(Wn.hasRegisteredTheme(e))return;let t=fp.getTheme(e);if(t!=null){Wn.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function mp(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function hp(e){pp(e);let t=await Wn.resolveTheme(e);return mp(e,t),t}function gp(e){return Wn.getResolvedTheme(e)??hp(e)}var _p;async function vp({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){_p??=dl({themes:[],langs:[`text`],engine:n===`shiki-wasm`?Br(W(()=>import(`./wasm-BnjxR4X6.js`),[],import.meta.url)):Wf()});let r=bp(_p)?await _p:_p;_p=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=Kf(e);`then`in t?i.push(t):Xn(t,r)}let a=[];for(let t of e){let e=gp(t);`then`in e?a.push(e):Gn(e,_p)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Xn(e,r)}),Promise.all(a).then(e=>{Gn(e,r)})]),r}function yp(){if(_p!=null&&!(`then`in _p))return _p}function bp(e=_p){return e!=null&&`then`in e}for(let e of ip.getThemes())Wn.registerThemeIfAbsent(e.name,e.load);function xp(e=B){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var Sp=new Map,Cp={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function wp(e){if(Sp.has(e))return Sp.get(e)??`text`;if(Cp[e]!=null)return Cp[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Sp.has(t[1]))return Sp.get(t[1])??`text`;if(Cp[t[1]]!=null)return Cp[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Sp.has(n)?Sp.get(n)??`text`:Cp[n]??`text`}function Tp(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Ep({name:e,width:t=16,height:n=16,properties:r}){return $({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[$({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Dp(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 Op(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function kp(e,t,n,r={}){return $({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[$({tagName:`span`,properties:{"data-line-number-content":``},children:[Tp(`${t}`)]})]})}function Ap(e,t,n){return $({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 jp(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(Tp(`
154
+ `)),e}var Mp=Symbol(`no-token`),Np=Symbol(`multiple-tokens`);function Pp(e){let t=Fp(e);if(t!=null)return t;let n=Mp,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`){Lp(e,a);for(let t of e.children)Ip(t)}else Ip(e);r.push(e),i=[],a=void 0;return}for(let e of i)Ip(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Mp){if(e===Np){n=Np;return}if(n===Mp){n=e;return}n!==e&&(n=Np)}};for(let t of e.children){let e=t.type===`element`?Pp(t):Mp;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 Fp(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Ip(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Ip(t)}}function Lp(e,t){e.properties[`data-char`]=t}function Rp(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+zp(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 zp(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 Bp(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Dp(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Pp(a),i.push(jp(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(Hp,Vp),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:Vp}}var Vp=Rp({classPrefix:`hl-`}),Hp={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 Up(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Wp=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Gp=/^0(?:\.0+)?%?$/;function Kp(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 qp(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 Jp(e){if(e==null)return null;let t=qp(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 Yp(e,t){let[n,r]=e>t?[e,t]:[t,e];return(n+.05)/(r+.05)}function Xp(e,t){if(t==null)return;let n=qp(e),r=qp(t);if(n==null||r==null)return;let[i,a,o,s]=n,[c,l,u]=r;return`#`+[Math.round(i*s+c*(1-s)),Math.round(a*s+l*(1-s)),Math.round(o*s+u*(1-s))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Zp(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Wp.test(t))return!0;let n=Kp(t);return n!=null&&Gp.test(n)}function Qp(e,t){let n=Jp(e);if(n!=null)return n<.4;let r=Jp(t);return r!=null&&r>.6}function $p(e,t){if(e==null||t==null)return!1;if(e.trim().toLowerCase()===t.trim().toLowerCase())return!0;let n=Jp(e),r=Jp(t);return n==null||r==null?!1:Math.abs(n-r)<.06}function em(e,t,n){if(t==null||n==null)return!1;let r=Jp(e),i=Jp(t),a=Jp(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}function tm(e,t){let n=Jp(e),r=t.find(e=>e!=null&&e!==``);if(n==null)return r;let i,a=-1;for(let e of t){if(e==null||e===``)continue;let t=Jp(e);if(t==null)continue;let r=Yp(n,t);if(r>=3)return e;r>a&&(i=e,a=r)}return i??r}function nm(e,t){if(t==null)return e;let n=qp(e),r=qp(t),i=Jp(t);if(n==null||r==null||i==null)return`color-mix(in srgb, ${e} 70%, ${t})`;let[a,o,s]=n,[c,l,u]=r;for(let e of[.6,.7,.8,.9]){let t=`#`+[Math.round(a*e+c*(1-e)),Math.round(o*e+l*(1-e)),Math.round(s*e+u*(1-e))].map(e=>e.toString(16).padStart(2,`0`)).join(``),n=Jp(t);if(n!=null&&Yp(i,n)>=4.5)return t}return e}var rm=new WeakMap;function im(e){let t=rm.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;am(r,`editor.background`,i),am(r,`editor.foreground`,a),am(r,`sideBar.background`,o),am(r,`sideBar.foreground`,s),am(r,`input.background`,n[`input.background`]??o),am(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),am(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),am(r,`gitDecoration.addedResourceForeground`,om(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),am(r,`gitDecoration.modifiedResourceForeground`,om(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),am(r,`gitDecoration.deletedResourceForeground`,om(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Zp(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Zp(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(sm(l,o)||em(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return rm.set(e,u),u}function am(e,t,n){n!=null&&n!==``&&(e[t]=n)}function om(...e){for(let t of e)if(t!=null&&t!==``)return t}function sm(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function cm({theme:e=B,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=im(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Up(`global`)}fg:${a.fg};`,r+=`${Up(`global`)}bg:${a.bg};`,r+=lm(i,n)}else{let n=t.getTheme(e.dark),i=im(n);r+=`${Up(`global`)}dark:${i.fg};`,r+=`${Up(`global`)}dark-bg:${i.bg};`,r+=lm(n,`dark`),n=t.getTheme(e.light),i=im(n),r+=`${Up(`global`)}light:${i.fg};`,r+=`${Up(`global`)}light-bg:${i.bg};`,r+=lm(n,`light`)}return r}function lm(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Up(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Up(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Up(`global`)}${t}modified-color:${a};`),n}function um(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function dm(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function fm(e,t){return jn(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function pm(e){let t=e.lang??wp(e.name),n=e.lang??(e.prevName==null?`text`:wp(e.prevName));return t===`text`&&n===`text`}function mm(e){return{...Ae,...e}}function hm(e,t){let n=gm(e,t);return t?n:e.diffHeaderHeight+n}function gm(e,t){return e.paddingTop??(t?e.spacing:0)}function _m(e){return e.paddingBottom??e.spacing}function vm(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function ym(e){return[x(e.additionStart,e.additionCount)+1,z(e.additionStart,e.additionCount)+1]}function bm({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 xm(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-z(t.additionStart,t.additionCount),r=e.deletionLines.length-z(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function Sm({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-z(n.additionStart,n.additionCount),i=e.deletionLines.length-z(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function Cm({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=Sm({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 wm({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=ym(a);if(t<o){let s=bm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=ym(a);return t<o+i.fromStart||t>=o+i.rangeSize}function Tm({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=ym(n),l=bm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function Em({type:e,metrics:t}){return t.hunkSeparatorHeight??vm(e)}function Dm({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function Om({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 km(e){return e!==`simple`&&e!==`metadata`}function Am({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!Om({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=Em({type:e,metrics:t}),a=Dm({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function jm({type:e,metrics:t}){if(!km(e))return;let n=Em({type:e,metrics:t}),r=Dm({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Mm({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=Nm({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=x(r.deletionStart,r.deletionCount),s=x(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=bm({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?Cm({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(Im(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,Im(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,S=o+1,C=s+1,ee=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===ee;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(Im(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:S+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:C+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,S+=e.lines,C+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Lm(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(Rm({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:C,deletionLineNumber:S,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,S+=e.deletions,C+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(Im(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:S+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:C+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function Nm({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Pm({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 Pm({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=bm({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?Cm({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 Fm(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 Im(e,t,n,r,i,a){let[o,s]=Fm(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 Lm(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 Rm({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,ee=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,w=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,T=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:ee}:void 0;if(w==null&&T!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:T};if(w!=null&&T==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:void 0};if(w==null||T==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:w,additionLine:T}}var zm=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},Bm=new class extends zm{};function Vm(e,t,n){return Bm.diff(e,t,n)}function Hm(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Um(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Wm(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Gm(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Km(e,t){return Wm(e,t,``)}function qm(e,t){return Gm(e,t,``)}function Jm(e,t){return t.slice(0,Ym(e,t))}function Ym(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Xm(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Zm(e,t){if(t)return $m(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Qm(e,t){if(t)return $m(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function $m(e,t){if(!t)return[Qm(e),Zm(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Xm(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var eh=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,th=RegExp(`[${eh}]+|\\s+|[^${eh}]`,`ug`);new class extends zm{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Xm(e,r)}else n=e.match(th)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&nh(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&nh(n,i,r,null,t.intlSegmenter),e}};function nh(e,t,n,r,i){if(t&&n){let[a,o]=$m(t.value,i),[s,c]=$m(n.value,i);if(e){let r=Hm(a,s);e.value=Gm(e.value,s,r),t.value=Km(t.value,r),n.value=Km(n.value,r)}if(r){let e=Um(o,c);r.value=Wm(r.value,c,e),t.value=qm(t.value,e),n.value=qm(n.value,e)}}else if(n){if(e){let e=Qm(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Qm(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Qm(r.value,i),[a,o]=$m(t.value,i),s=Hm(n,a);t.value=Km(t.value,s);let c=Um(Km(n,s),o);t.value=qm(t.value,c),r.value=Wm(r.value,n,c),e.value=Gm(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Qm(r.value,i),n=Jm(Zm(t.value,i),e);t.value=qm(t.value,n)}else if(e){let n=Jm(Zm(e.value,i),Qm(t.value,i));t.value=Km(t.value,n)}}var rh=new class extends zm{tokenize(e){let t=RegExp(`(\\r?\\n)|[${eh}]+|[^\\S\\n\\r]+|[^${eh}]`,`ug`);return e.match(t)||[]}};function ih(e,t,n){return rh.diff(e,t,n)}var ah=new class extends zm{constructor(){super(...arguments),this.tokenize=sh}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
155
155
  `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
156
156
  `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
157
157
  `)&&(e=e.slice(0,-1)),t.endsWith(`
@@ -163,13 +163,13 @@ XID_Start XIDS`.split(/\s/).map(e=>[Yu(e),e])),Hd=new Map([[`s`,Dd(383)],[Dd(383
163
163
  `}function hh(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;ph(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?mh(e,o.headerOptions):void 0)}}))}else{let s=ph(e,t,n,r,i,a,o);return s?mh(s,o?.headerOptions):void 0}}function gh(e){let t=e.endsWith(`
164
164
  `),n=e.split(`
165
165
  `).map(e=>e+`
166
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function _h({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 vh({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 yh={forcePlainText:!1};function bh(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=yh){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=cm({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)??Sh();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)}Mm({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&&xh({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}=Ch({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 xh({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=_e(e),t=_e(t),e.length>s||t.length>s))return;let c=o===`char`?Vm(e,t):ih(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(vh({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),vh({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?vh({item:e,arr:l,enableJoin:d,isLastItem:t}):vh({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(_h({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(_h({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function Sh(){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 Ch({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=V,...l}}){let u=s??wp(e.name),d=s??wp(t.name),{state:f,transformers:p}=Bp(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Up(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Up(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,um(i.codeToHast(_e(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,um(i.codeToHast(_e(t.contents),m)))}}var wh=(0,W.createContext)(void 0);function Th(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 Eh(e,t){let n=e?.theme??V,r=t?.theme??V,i=Dh(e),a=Dh(t);return An(n,r)&&Th(e,t,[`theme`,`parseDiffOptions`])&&Th(i,a)}function Dh(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var Oh=new Set,kh=null;function Ah(e){Oh.add(e),kh??=requestAnimationFrame(Mh)}function jh(e){Oh.delete(e)&&Oh.size===0&&kh!=null&&(cancelAnimationFrame(kh),kh=null)}function Mh(e){let t=new Set(Oh);Oh.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}kh=Oh.size>0?requestAnimationFrame(Mh):null}function Nh(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var Ph=`/dev/null`;function Fh(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Ih(),a=t??Ih(),o=ee(hh(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Ih(){return{name:Ph,contents:``}}function Lh(e,t){let n=Fh({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 Rh(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function zh(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Bh(e,t){return t.length>0&&t.length<e.deletionLines.length&&zh(t)}function Vh(e,t,n){let r=e.deletionLines.join(``),i=Rh(t.length,r),a=Fh({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function Hh(e,t){return Vh(e,[``],t)}function Uh(e,t){if(e.additionLines.length===0)return Hh(e,t);if(Bh(e,e.additionLines))return Vh(e,e.additionLines,t);let n=e.additionLines,r=Lh(e,t);return Gh(r,n),r}function Wh(e){return e.length>1&&e.at(-1)===``}function Gh(e,t){if(!Wh(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&xe(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,tg(e);return}}}function Kh(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return qh(e,Lh(e,n));let r=Array.from(t);if(r.length===0)return qh(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||_e(r)===_e(i))return qh(e,Lh(e,n))}let i=Jh(e,r);if(i.size===0)return qh(e,Lh(e,n));for(let t of i)if(!Xh(e,t,n))return qh(e,Lh(e,n));return tg(e),xm(e)?qh(e,Lh(e,n)):qh(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function qh(e,t){return Object.assign(e,t),t}function Jh(e,t){let n=new Set;for(let r of t){let t=Yh(e,r);if(t==null)return new Set;n.add(t)}return n}function Yh(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 Xh(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=Fh({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:(Qh(r,s),Zh(e,t),!0)}function Zh(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(`
166
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function _h({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 vh({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 yh={forcePlainText:!1};function bh(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=yh){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=cm({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)??Sh();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)}Mm({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&&xh({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}=Ch({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 xh({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=R(e),t=R(t),e.length>s||t.length>s))return;let c=o===`char`?Vm(e,t):ih(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(vh({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),vh({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?vh({item:e,arr:l,enableJoin:d,isLastItem:t}):vh({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(_h({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(_h({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function Sh(){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 Ch({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=B,...l}}){let u=s??wp(e.name),d=s??wp(t.name),{state:f,transformers:p}=Bp(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Up(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Up(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,um(i.codeToHast(R(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,um(i.codeToHast(R(t.contents),m)))}}var wh=(0,U.createContext)(void 0);function Th(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 Eh(e,t){let n=e?.theme??B,r=t?.theme??B,i=Dh(e),a=Dh(t);return jn(n,r)&&Th(e,t,[`theme`,`parseDiffOptions`])&&Th(i,a)}function Dh(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}var Oh=new Set,kh=null;function Ah(e){Oh.add(e),kh??=requestAnimationFrame(Mh)}function jh(e){Oh.delete(e)&&Oh.size===0&&kh!=null&&(cancelAnimationFrame(kh),kh=null)}function Mh(e){let t=new Set(Oh);Oh.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}kh=Oh.size>0?requestAnimationFrame(Mh):null}function Nh(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}var Ph=`/dev/null`;function Fh(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??Ih(),a=t??Ih(),o=ee(hh(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey??e?.name,r=t?.cacheKey??t?.name;return n!=null&&r!=null?n+`:`+r:n??r})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function Ih(){return{name:Ph,contents:``}}function Lh(e,t){let n=Fh({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 Rh(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function zh(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Bh(e,t){return t.length>0&&t.length<e.deletionLines.length&&zh(t)}function Vh(e,t,n){let r=e.deletionLines.join(``),i=Rh(t.length,r),a=Fh({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function Hh(e,t){return Vh(e,[``],t)}function Uh(e,t){if(e.additionLines.length===0)return Hh(e,t);if(Bh(e,e.additionLines))return Vh(e,e.additionLines,t);let n=e.additionLines,r=Lh(e,t);return Gh(r,n),r}function Wh(e){return e.length>1&&e.at(-1)===``}function Gh(e,t){if(!Wh(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&z(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,tg(e);return}}}function Kh(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return qh(e,Lh(e,n));let r=Array.from(t);if(r.length===0)return qh(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||R(r)===R(i))return qh(e,Lh(e,n))}let i=Jh(e,r);if(i.size===0)return qh(e,Lh(e,n));for(let t of i)if(!Xh(e,t,n))return qh(e,Lh(e,n));return tg(e),xm(e)?qh(e,Lh(e,n)):qh(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function qh(e,t){return Object.assign(e,t),t}function Jh(e,t){let n=new Set;for(let r of t){let t=Yh(e,r);if(t==null)return new Set;n.add(t)}return n}function Yh(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 Xh(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=Fh({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:(Qh(r,s),Zh(e,t),!0)}function Zh(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(`
167
167
  `),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
168
- `)}function Qh(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>$h(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,eg(e)}function $h(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function eg(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 tg(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(x(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,eg(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=xe(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-xe(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var ng=new WeakMap;function rg(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function ig(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function ag(e,t){let n=e.hunks,r=e.additionLines,i=rg(r),a=i===r?e:{...e,additionLines:i},o=hg(n,mg(a,t),e.deletionLines.length),s=vg(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Og(e),Gh(e,r),xg(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function og(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<wg(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:wg(r);if(i==null||t<i||o!=null&&o!==s)return ag(e,n);o=s}if(o!=null){if(sg(e,i,o,r,n)){e.editSessionDirty=!0;return}return ag(e,n)}}function sg(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=cg(e),o=e.hunks[n];if(o.hunkContent.some(lg))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function cg(e){let t=ng.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return ng.set(e,{lines:e.deletionLines,set:n}),n}function lg(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function ug(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function dg(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=bm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=Tg(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=Tg(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function fg(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=Tg(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,Tg(i)+i.deletionCount,e.deletionLines.length),n}function pg(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Lh(e,t):Uh(e,t)),!0)}function mg(e,t){if(ig(e.deletionLines,e.additionLines)==null)return[];let n=Fh({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=$h(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function hg(e,t,n){let r=e.map((e,t)=>{let n=Tg(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&gg(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=_g(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function gg(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function _g(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function vg(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);bg(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);bg(s,c,i,r),r+=c,i+=c,n.push(yg(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function yg(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Eg(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Dg(t.additionStart,r),deletionStart:Eg(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Dg(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Eg(t.deletionStart,i)},${i} +${Eg(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return eg(s),s}function bg(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function xg(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Tg(r)!==Tg(i)||r.deletionCount!==i.deletionCount||wg(r)!==wg(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!Sg(r,i))return!0}return!1}function Sg(e,t){let n=Cg(e),r=Cg(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*Cg(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function wg(e){return x(e.additionStart,e.additionCount)}function Tg(e){return x(e.deletionStart,e.deletionCount)}function Eg(e,t){return t===0?e:e+1}function Dg(e,t){return t===0?e-1:e}function Og(e){tg(e);for(let t=0;t<e.hunks.length;t++)Zh(e,t)}function kg(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}var Ag=`-1,-1`;function jg(e){return e?.some(e=>e.lineNumber===0)??!1}function Mg(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Ng(e){return e.startingLine===0&&e.totalLines>0}function Pg(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Fg(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Ep({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Ig(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Lg=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),jh(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Nh(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Ig(e.composedPath())||(n_(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||(n_(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(n_(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){n_(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();n_(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);n_(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=Hg(i)&&this.hoveredLine?.lineElement===i.lineElement;Vg(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Vg(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Hg(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Wg(i)&&p!=null){p(i);break}if(Ug(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Hg(i))break;Vg(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,n_(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})()),n_(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),n_(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();Ig(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Pg(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=dc(Fg());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);Bg(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(qg(t));if(Bg(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(Bg(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(Bg(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&&Ig(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=qg(e);if(t&&Ig(n))return;let r=Jg(e);return r==null?this.pathFromAnnotationSlot(e):qg(r)}pathFromAnnotationSlot(e){let t=Xg(Yg(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:qg(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=Zg(t)?t:Zg(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)}Nh(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Ah(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{jh(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!$g(this.renderedSelectedLinesState,n),i=!$g(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Gg(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=t_(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=t_(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:Kg(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Kg(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:e_(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:e_(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 Rg({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:zg({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 zg({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 Bg(e){return e!=null&&`kind`in e&&e.kind===`line`}function Vg(e){return e!=null&&`kind`in e&&e.kind===`token`}function Hg(e){return Bg(e)||Vg(e)}function Ug(e){return`type`in e&&e.type===`line-info`}function Wg(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Gg(e){return e===`current`||e===`incoming`||e===`both`}function Kg(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function qg(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function Jg(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 Yg(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 Xg(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 Zg(e){return e!=null&&typeof e.elementFromPoint==`function`}function Qg(e,t){return e===t||Nh(e??void 0,t??void 0)}function $g(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Qg(e?.range??null,t.range)}function e_(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function t_(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 n_(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var r_=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),o_(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?l_(t):u_(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:i_(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:a_(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&s_(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function i_(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function a_(e){return Math.max(Math.ceil(e),0)}function o_(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?s_(e,{codeWidthChanged:!0,numberWidthChanged:!0}):c_(e))}function s_(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function c_(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function l_(e){e.codeElement.isConnected&&c_(e)}function u_(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 d_(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 f_(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Jn.has(t))return!1;return!0}function p_(e){for(let t of xp(e))if(!Mn.has(t))return!1;return!0}function m_(e,t){return e.endsWith(`\r
168
+ `)}function Qh(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>$h(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,eg(e)}function $h(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function eg(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 tg(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max(x(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,eg(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=z(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-z(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var ng=new WeakMap;function rg(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function ig(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function ag(e,t){let n=e.hunks,r=e.additionLines,i=rg(r),a=i===r?e:{...e,additionLines:i},o=hg(n,mg(a,t),e.deletionLines.length),s=vg(a,o);if(e.additionLines=i,e.hunks=s,e.editSessionDirty=!0,Og(e),Gh(e,r),xg(n,e.hunks))return{regions:o.map(e=>e.previousSpan)}}function og(e,t,n,r){let i=Array.from(new Set(t)).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(i.length===0)return;let{hunks:a}=e,o,s=0;for(let t of i){for(;s<a.length;){let e=a[s];if(t<wg(e)+e.additionCount)break;s++}let r=a[s],i=r==null?void 0:wg(r);if(i==null||t<i||o!=null&&o!==s)return ag(e,n);o=s}if(o!=null){if(sg(e,i,o,r,n)){e.editSessionDirty=!0;return}return ag(e,n)}}function sg(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=cg(e),o=e.hunks[n];if(o.hunkContent.some(lg))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function cg(e){let t=ng.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return ng.set(e,{lines:e.deletionLines,set:n}),n}function lg(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function ug(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function dg(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=bm({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=Tg(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=Tg(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function fg(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=Tg(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,Tg(i)+i.deletionCount,e.deletionLines.length),n}function pg(e,t){return e.editSessionDirty===!0&&(e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?Lh(e,t):Uh(e,t)),!0)}function mg(e,t){if(ig(e.deletionLines,e.additionLines)==null)return[];let n=Fh({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),r=[],i=0,a=0;for(let e of n.hunks){let t=e.additionCount>0?e.additionLineIndex-i:e.deletionLineIndex-a;i+=t,a+=t;for(let t of e.hunkContent){if(t.type===`context`){i+=t.lines,a+=t.lines;continue}let e=$h(t,0,0);e.additions===0&&(e.additionLineIndex=i),e.deletions===0&&(e.deletionLineIndex=a),r.push(e),i+=e.additions,a+=e.deletions}}return r}function hg(e,t,n){let r=e.map((e,t)=>{let n=Tg(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&gg(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=_g(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function gg(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function _g(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function vg(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);bg(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);bg(s,c,i,r),r+=c,i+=c,n.push(yg(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function yg(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:Eg(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:Dg(t.additionStart,r),deletionStart:Eg(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:Dg(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${Eg(t.deletionStart,i)},${i} +${Eg(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return eg(s),s}function bg(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function xg(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(Tg(r)!==Tg(i)||r.deletionCount!==i.deletionCount||wg(r)!==wg(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!Sg(r,i))return!0}return!1}function Sg(e,t){let n=Cg(e),r=Cg(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*Cg(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function wg(e){return x(e.additionStart,e.additionCount)}function Tg(e){return x(e.deletionStart,e.deletionCount)}function Eg(e,t){return t===0?e:e+1}function Dg(e,t){return t===0?e-1:e}function Og(e){tg(e);for(let t=0;t<e.hunks.length;t++)Zh(e,t)}function kg(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}var Ag=`-1,-1`;function jg(e){return e?.some(e=>e.lineNumber===0)??!1}function Mg(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function Ng(e){return e.startingLine===0&&e.totalLines>0}function Pg(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Fg(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Ep({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Ig(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var Lg=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),jh(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||Nh(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!n&&!i||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!r&&!i||(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&Ig(e.composedPath())||(n_(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||(n_(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(n_(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){n_(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();n_(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);n_(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=Hg(i)&&this.hoveredLine?.lineElement===i.lineElement;Vg(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Vg(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Hg(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Wg(i)&&p!=null){p(i);break}if(Ug(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Hg(i))break;Vg(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,n_(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})()),n_(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),n_(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();Ig(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Pg(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=dc(Fg());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);Bg(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(qg(t));if(Bg(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(Bg(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(Bg(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&&Ig(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=qg(e);if(t&&Ig(n))return;let r=Jg(e);return r==null?this.pathFromAnnotationSlot(e):qg(r)}pathFromAnnotationSlot(e){let t=Xg(Yg(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:qg(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=Zg(t)?t:Zg(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)}Nh(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Ah(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{jh(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!$g(this.renderedSelectedLinesState,n),i=!$g(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);Gg(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=t_(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=t_(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:Kg(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:Kg(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:e_(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:e_(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 Rg({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:zg({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 zg({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 Bg(e){return e!=null&&`kind`in e&&e.kind===`line`}function Vg(e){return e!=null&&`kind`in e&&e.kind===`token`}function Hg(e){return Bg(e)||Vg(e)}function Ug(e){return`type`in e&&e.type===`line-info`}function Wg(e){return`kind`in e&&e.kind===`merge-conflict-action`}function Gg(e){return e===`current`||e===`incoming`||e===`both`}function Kg(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function qg(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function Jg(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 Yg(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 Xg(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 Zg(e){return e!=null&&typeof e.elementFromPoint==`function`}function Qg(e,t){return e===t||Nh(e??void 0,t??void 0)}function $g(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Qg(e?.range??null,t.range)}function e_(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function t_(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 n_(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var r_=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),o_(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?l_(t):u_(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:i_(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:a_(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;!i&&!a||(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&s_(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function i_(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function a_(e){return Math.max(Math.ceil(e),0)}function o_(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?s_(e,{codeWidthChanged:!0,numberWidthChanged:!0}):c_(e))}function s_(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function c_(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function l_(e){e.codeElement.isConnected&&c_(e)}function u_(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 d_(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 f_(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Yn.has(t))return!1;return!0}function p_(e){for(let t of xp(e))if(!Nn.has(t))return!1;return!0}function m_(e,t){return e.endsWith(`\r
169
169
  `)?t+`\r
170
170
  `:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
171
171
  `)?t+`
172
- `:t}function h_(e){return $({tagName:`div`,children:[$({tagName:`div`,children:e.annotations?.map(e=>$({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function g_(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function __(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 v_({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 $({tagName:`div`,children:[t===`custom`?$({tagName:`slot`,properties:{name:M}}):y_({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[b_(r)]],properties:i})}function y_({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:Fe}}),Ep({name:__(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Tp(t)]})],properties:{"data-prev-name":``}})),r.push(Ep({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Tp(e)]})],properties:{"data-title":``}})),r.push($({tagName:`slot`,properties:{name:Et}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function b_(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($({tagName:`span`,children:[Tp(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[Tp(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:tt}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function x_(e){return $({tagName:`pre`,properties:S_(e)})}function S_({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function C_(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:xp(t),preferredHighlighter:n}}var w_=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
172
+ `:t}function h_(e){return $({tagName:`div`,children:[$({tagName:`div`,children:e.annotations?.map(e=>$({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function g_(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function __(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 v_({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 $({tagName:`div`,children:[t===`custom`?$({tagName:`slot`,properties:{name:A}}):y_({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[b_(r)]],properties:i})}function y_({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:Ie}}),Ep({name:__(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Tp(t)]})],properties:{"data-prev-name":``}})),r.push(Ep({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[Tp(e)]})],properties:{"data-title":``}})),r.push($({tagName:`slot`,properties:{name:Dt}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function b_(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($({tagName:`span`,children:[Tp(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[Tp(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:rt}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function x_(e){return $({tagName:`pre`,properties:S_(e)})}function S_({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}function C_(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:xp(t),preferredHighlighter:n}}var w_=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
173
173
  <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
174
174
  <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"/>
175
175
  </symbol>
@@ -221,7 +221,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Yu(e),e])),Hd=new Map([[`s`,Dd(383)],[Dd(383
221
221
  <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
222
222
  <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"/>
223
223
  </symbol>
224
- </svg>`;function T_(e,t){return e==null||t==null?e===t:D_(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 E_={};function D_(e=E_,t=E_){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 O_(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function k_(){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 A_(){let e=document.createElement(`style`);return e.setAttribute(Ve,``),e}var j_;function M_(e){if(j_!=null)return j_;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(r,`true`);let i=document.createElement(`div`);return i.style.position=`relative`,i.style.width=`200%`,i.style.height=`200%`,n.appendChild(i),e.appendChild(n),j_=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),j_}function N_(e){return`${z}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var P_=`@layer base {
224
+ </svg>`;function T_(e,t){return e==null||t==null?e===t:D_(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 E_={};function D_(e=E_,t=E_){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 O_(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function k_(){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 A_(){let e=document.createElement(`style`);return e.setAttribute(He,``),e}var j_;function M_(e){if(j_!=null)return j_;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(r,`true`);let i=document.createElement(`div`);return i.style.position=`relative`,i.style.width=`200%`,i.style.height=`200%`,n.appendChild(i),e.appendChild(n),j_=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),j_}function N_(e){return`${fe}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var P_=`@layer base {
225
225
  :host {
226
226
  --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
227
227
  "Courier New", monospace;
@@ -1499,7 +1499,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[Yu(e),e])),Hd=new Map([[`s`,Dd(383)],[Dd(383
1499
1499
  }
1500
1500
 
1501
1501
  @layer theme, rendered, unsafe;
1502
- `,F_=`@layer base, theme, rendered, unsafe;`,I_=RegExp(`${B_(z)}\\s*:\\s*[^;]+;`);function L_(e){return`${F_}
1502
+ `,F_=`@layer base, theme, rendered, unsafe;`,I_=RegExp(`${B_(fe)}\\s*:\\s*[^;]+;`);function L_(e){return`${F_}
1503
1503
  @layer unsafe {
1504
1504
  ${e}
1505
1505
  }`}function R_(e,t=`system`,n){return`${F_}
@@ -1509,10 +1509,10 @@ XID_Start XIDS`.split(/\s/).map(e=>[Yu(e),e])),Hd=new Map([[`s`,Dd(383)],[Dd(383
1509
1509
  ${N_(n)}
1510
1510
  ${e}
1511
1511
  }
1512
- }`}function z_(e,t){let n=N_(t);return e.replace(I_,n)}function B_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function V_(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function H_({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 U_(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function W_({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=G_(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function G_(){let e=document.createElement(`style`);return e.setAttribute(kt,``),e}var K_=void 0,q_=void 0;function J_(){return K_??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(X_())}function Y_(){return q_??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function X_(){let e=globalThis.navigator;return e?.platform??e?.userAgentData?.platform??`unknown`}function Z_(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Q_(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}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(P_)),t.adoptedStyleSheets=[e]}connectedCallback(){M_(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(We,t)}async function $_(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function ev({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=hm(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=bm({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=Am({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=tv(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?Cm({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=jm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=jm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=_m(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function tv(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 nv(e,t)}function nv(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}}function rv({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function iv(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function av(e){return e===``?[]:e.split(ht)}function ov(e,t,n){let r=e===`clone`?iv(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return sv(r,lv(r,n),uv(r,n));case`rename-pure`:{let e=uv(r,n);dv(r,n);let t=av(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,pv(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function sv(e,t,n){let r=av(t.contents),i=av(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=cv(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,pv(e,t,n),e}function cv(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(x(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=xe(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=xe(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function lv(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function uv(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function dv(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function fv(e,t,n){return e.cacheKey==null?mv(t,n):`${e.cacheKey}:hydrated`}function pv(e,t,n){let r=fv(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function mv(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var hv=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 gv(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function _v(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function vv(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[Tp(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function yv(e){return $({tagName:`div`,children:[Ep({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 bv({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($({tagName:`div`,children:[Tp(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(yv(`up`)),s++),o||(e.push(yv(`down`)),s++)):(e.push(yv(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[Tp(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[Tp(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push($({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push($({tagName:`slot`,properties:{name:i}})),$({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function xv(e,t){return`hunk-separator-${e}-${t}`}function Sv(e){let t=e.at(-1);return t==null?0:Math.max(xe(t.additionStart,t.additionCount),xe(t.deletionStart,t.deletionCount))}var Cv=-1,wv=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Cv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:V},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=p_(e.theme??V)?yp():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,Hh(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||pm(e.diff)||zv(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);fm(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??St}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=_e(l);c&&(i.additionLines[t]=m_(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,Hh(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(Bh(i,i.additionLines))Object.assign(i,Vh(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=og(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,Kh(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=ug(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=Iv(e,r),n.code.additionLines=Pv(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,Hh(t,this.options.parseDiffOptions)),n.code.additionLines[0]=Fv(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,Uh(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Bh(e,n)){Object.assign(e,Vh(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(ag(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>h_(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=V,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=we,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 vp(C_(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=zv(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!fm(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!pm(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??wp(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??V}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!dm(e,n.diff)||!fm(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=k){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||pm(e)||zv(e,this.getTokenizeMaxLength()),l=!dm(e,this.renderCache.diff),u=!d_(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&gv(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,gv(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??wp(e.name);let t=this.highlighter!=null&&p_(i.theme),n=this.highlighter!=null&&f_(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=k){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 x_({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=zv(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??wp(e.name);let n=this.highlighter!=null&&p_(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&f_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=bh(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(Mm({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=Fv(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!fm(this.renderCache.options,n)||!dm(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!fm(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&dm(e,n.diff)&&fm(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=Bv(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Op(),deletionsGutterAST:Op(),additionsGutterAST:Op(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=Sm({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,Ap(void 0,`buffer`,this.size)),h?.push(_v(this.size))):(x.pushToGutter(`deletions`,Ap(void 0,`buffer`,this.size)),g?.push(_v(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,kp(t,n,r,i))};function w(e){C.flush(),a===`unified`?jv(`unified`,e,x):(jv(`deletions`,e,x),jv(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),Mm({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&Ov(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Mv(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Mv(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Av({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Ov(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&kv(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Mv(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Mv(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Av({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&kv(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),T=_?n.noEOFCRDeletions:!1,E=_?n.noEOFCRAdditions:!1,D=(s?.noEOFCR??!1)||T,O=(o?.noEOFCR??!1)||E;if(O||D){if(a===`split`&&C.flush(),D){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(vv(e)),x.pushToGutter(`unified`,Ap(e,`metadata`,1))):(x.deletionsContentAST.push(vv(e)),x.pushToGutter(`deletions`,Ap(e,`metadata`,1)),O||(x.pushToGutter(`additions`,Ap(void 0,`buffer`,1)),x.additionsContentAST.push(_v(1))))}if(O){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(vv(e)),x.pushToGutter(`unified`,Ap(e,`metadata`,1))):(x.additionsContentAST.push(vv(e)),x.pushToGutter(`additions`,Ap(e,`metadata`,1)),D||(x.pushToGutter(`deletions`,Ap(void 0,`buffer`,1)),x.deletionsContentAST.push(_v(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let T=Math.max(Sv(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),E=t.bufferBefore>0||t.bufferAfter>0,D=!f&&e.type!==`deleted`,O=!f&&e.type!==`new`,k=x.rowCount>0||E;h=D&&k?h:void 0,g=O&&k?g:void 0,_=f&&k?_:void 0;let A=this.createPreElement(g!=null&&h!=null,T);return{unifiedGutterAST:f&&k?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:O&&k?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:D&&k?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:A,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:T,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Op(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,g_(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push($({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($({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($({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return dc(this.renderFullAST(e,t))}renderPartialHTML(e,t){return dc(t==null?e:$({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(!Ng(n))return;let i=e.type===`new`?[]:Tv(Mg(this.deletionAnnotations)),a=e.type===`deleted`?[]:Tv(Mg(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Av({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Av({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(wn(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(wn(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 v_({fileOrDiff:e,mode:t,stickyHeader:n})}};function Tv(e){return e?.map(e=>wn(e))??[]}var Ev=new Intl.PluralRules(`en-US`);function Dv(e){return`${e} unmodified line${Ev.select(e)===`one`?``:`s`}`}function Ov(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function kv(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 Av({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`,Ap(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`,Ap(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`,Ap(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function jv(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,bv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(bv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,bv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(bv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=xv(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Dv(n):`More unchanged context may be available`;c.pushToGutter(e,bv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(bv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Mv(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Nv(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Pv(e,t,n,r){let i=Nv(e),a=Nv(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=Fv(e,r.getLineText(e));return l}function Fv(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function Iv(e,t){let n=[],r=Rv(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!Lv(i)?i+r:i)}return n}function Lv(e){return e.endsWith(`
1512
+ }`}function z_(e,t){let n=N_(t);return e.replace(I_,n)}function B_(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function V_(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function H_({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 U_(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=``}}function W_({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=G_(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function G_(){let e=document.createElement(`style`);return e.setAttribute(At,``),e}var K_=void 0,q_=void 0;function J_(){return K_??=/macOS|MacIntel|iPhone|iPad|iPod/i.test(X_())}function Y_(){return q_??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function X_(){let e=globalThis.navigator;return e?.platform??e?.userAgentData?.platform??`unknown`}function Z_(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function Q_(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}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(P_)),t.adoptedStyleSheets=[e]}connectedCallback(){M_(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(Ge,t)}async function $_(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function ev({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=hm(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=bm({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=Am({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=tv(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?Cm({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=jm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=jm({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=_m(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function tv(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 nv(e,t)}function nv(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}}function rv({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return{oldFile:e,newFile:t}}}function iv(e){return{...e,hunks:e.hunks.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function av(e){return e===``?[]:e.split(_t)}function ov(e,t,n){let r=e===`clone`?iv(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return sv(r,lv(r,n),uv(r,n));case`rename-pure`:{let e=uv(r,n);dv(r,n);let t=av(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,pv(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function sv(e,t,n){let r=av(t.contents),i=av(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=cv(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,pv(e,t,n),e}function cv(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max(x(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=z(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=z(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function lv(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function uv(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function dv(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function fv(e,t,n){return e.cacheKey==null?mv(t,n):`${e.cacheKey}:hydrated`}function pv(e,t,n){let r=fv(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function mv(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0:e?.cacheKey??t?.cacheKey}var hv=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 gv(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function _v(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function vv(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[Tp(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function yv(e){return $({tagName:`div`,children:[Ep({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 bv({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($({tagName:`div`,children:[Tp(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(yv(`up`)),s++),o||(e.push(yv(`down`)),s++)):(e.push(yv(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[Tp(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[Tp(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push($({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push($({tagName:`slot`,properties:{name:i}})),$({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function xv(e,t){return`hunk-separator-${e}-${t}`}function Sv(e){let t=e.at(-1);return t==null?0:Math.max(z(t.additionStart,t.additionCount),z(t.deletionStart,t.deletionCount))}var Cv=-1,wv=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Cv}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;editSessionActive=!1;constructor(e={theme:B},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=p_(e.theme??B)?yp():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;e!=null&&!e.isPartial&&e.additionLines.length===0&&(Object.assign(e,Hh(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache())}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||pm(e.diff)||zv(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;return!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null?(n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(t).then(e=>this.applyRefreshedResult(t,e)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);fm(n,t.options)&&(this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null&&this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Ct}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:r,diff:i}=this.renderCache;if(r==null)return!1;if(i.isPartial)throw Error(`Could not update render cache for partial diff`);let a=r.code.additionLines,o=[],s=new Map;for(let[t,n]of e){let e=a[t]?.properties??{},r=n.map(e=>e[2]).join(``),c=t<i.additionLines.length,l=c?i.additionLines[t]??``:``,u=R(l);c&&(i.additionLines[t]=m_(l,r),u!==r&&(o.push(t),s.set(t,l))),a[t]={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})}}let c=!1;if(o.length>0){if(this.editSessionActive&&!i.isPartial){if(!n){if(i.additionLines.length<=1&&i.additionLines.join(``)===``)Object.assign(i,Hh(i,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else if(Bh(i,i.additionLines))Object.assign(i,Vh(i,i.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(i),c=!0;else{let e=og(i,o,this.options.parseDiffOptions,s);this.applyExpansionRemap(e),c=e!=null}}}else Object.assign(i,Kh(i,o,this.options.parseDiffOptions))}return r.baseThemeType=t,this.renderCache.isDirty=!0,c}applyExpansionRemap(e){e!=null&&(this.expandedHunks=ug(this.expandedHunks,e))}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:r}=t;t.additionLines=Iv(e,r),n.code.additionLines=Pv(r,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join(``)===``?(Object.assign(t,Hh(t,this.options.parseDiffOptions)),n.code.additionLines[0]=Fv(0,e.getLineText(0)),this.markEditSessionPass(t)):this.editSessionActive?this.applySessionDocumentChange(t):Object.assign(t,Uh(t,this.options.parseDiffOptions)),this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Bh(e,n)){Object.assign(e,Vh(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(ag(e,t))}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t===`change`?e===`deletions`?`change-deletion`:`change-addition`:t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=e=>h_(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=B,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=Te,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 vp(C_(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=zv(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!fm(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!pm(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??wp(e.name),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??B}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!dm(e,n.diff)||!fm(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=O){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||pm(e)||zv(e,this.getTokenizeMaxLength()),l=!dm(e,this.renderCache.diff),u=!d_(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!l&&gv(t);o&&(this.renderCache.highlightPending=!0),!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,gv(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??wp(e.name);let t=this.highlighter!=null&&p_(i.theme),n=this.highlighter!=null&&f_(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=O){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 x_({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=zv(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??wp(e.name);let n=this.highlighter!=null&&p_(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&f_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=bh(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(Mm({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=Fv(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){if(this.renderCache==null)return;let i=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!fm(this.renderCache.options,n)||!dm(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!fm(t,n.options)))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&dm(e,n.diff)&&fm(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=Bv(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:Op(),deletionsGutterAST:Op(),additionsGutterAST:Op(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=Sm({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,Ap(void 0,`buffer`,this.size)),h?.push(_v(this.size))):(x.pushToGutter(`deletions`,Ap(void 0,`buffer`,this.size)),g?.push(_v(this.size))),this.size=0,this.side=void 0}}},ee=(e,t,n,r,i)=>{x.pushToGutter(e,kp(t,n,r,i))};function w(e){C.flush(),a===`unified`?jv(`unified`,e,x):(jv(`deletions`,e,x),jv(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),Mm({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&w({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&Ov(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});ee(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=Mv(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=Mv(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),Av({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&Ov(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&kv(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=Mv(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);ee(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Mv(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);ee(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Av({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&kv(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),T=_?n.noEOFCRDeletions:!1,E=_?n.noEOFCRAdditions:!1,D=(s?.noEOFCR??!1)||T,O=(o?.noEOFCR??!1)||E;if(O||D){if(a===`split`&&C.flush(),D){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(vv(e)),x.pushToGutter(`unified`,Ap(e,`metadata`,1))):(x.deletionsContentAST.push(vv(e)),x.pushToGutter(`deletions`,Ap(e,`metadata`,1)),O||(x.pushToGutter(`additions`,Ap(void 0,`buffer`,1)),x.additionsContentAST.push(_v(1))))}if(O){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(vv(e)),x.pushToGutter(`unified`,Ap(e,`metadata`,1))):(x.additionsContentAST.push(vv(e)),x.pushToGutter(`additions`,Ap(e,`metadata`,1)),D||(x.pushToGutter(`deletions`,Ap(void 0,`buffer`,1)),x.deletionsContentAST.push(_v(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&w({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let T=Math.max(Sv(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),E=t.bufferBefore>0||t.bufferAfter>0,D=!f&&e.type!==`deleted`,O=!f&&e.type!==`new`,te=x.rowCount>0||E;h=D&&te?h:void 0,g=O&&te?g:void 0,_=f&&te?_:void 0;let k=this.createPreElement(g!=null&&h!=null,T);return{unifiedGutterAST:f&&te?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:O&&te?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:D&&te?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:k,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:T,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Op(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,g_(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push($({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($({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($({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return dc(this.renderFullAST(e,t))}renderPartialHTML(e,t){return dc(t==null?e:$({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(!Ng(n))return;let i=e.type===`new`?[]:Tv(Mg(this.deletionAnnotations)),a=e.type===`deleted`?[]:Tv(Mg(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){Av({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}Av({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(Tn(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(Tn(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 v_({fileOrDiff:e,mode:t,stickyHeader:n})}};function Tv(e){return e?.map(e=>Tn(e))??[]}var Ev=new Intl.PluralRules(`en-US`);function Dv(e){return`${e} unmodified line${Ev.select(e)===`one`?``:`s`}`}function Ov(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function kv(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 Av({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`,Ap(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`,Ap(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`,Ap(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function jv(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,bv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(bv({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,bv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(bv({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=xv(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?Dv(n):`More unchanged context may be available`;c.pushToGutter(e,bv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(bv({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Mv(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function Nv(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function Pv(e,t,n,r){let i=Nv(e),a=Nv(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let r=e.length;r<t.length;r++)l[r]??=n[r];for(let e=s;e<t.length;e++)l[e]??=Fv(e,r.getLineText(e));return l}function Fv(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function Iv(e,t){let n=[],r=Rv(t);for(let t=0;t<e.lineCount;t++){let i=e.getLineText(t,!0);n.push(t<e.lineCount-1&&!Lv(i)?i+r:i)}return n}function Lv(e){return e.endsWith(`
1513
1513
  `)||e.endsWith(`\r`)}function Rv(e){for(let t of e){if(t.endsWith(`\r
1514
1514
  `))return`\r
1515
1515
  `;if(t.endsWith(`
1516
1516
  `))return`
1517
1517
  `;if(t.endsWith(`\r`))return`\r`}return`
1518
- `}function zv(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Bv(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Vv(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Hv(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function Uv(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:V_(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Wv(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Gv=-1,Kv=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Gv}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:V},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new r_,this.scrollSyncManager=new hv,this.interactionManager=new Lg(`diff`,Rg(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 Uv(e)}createHunksRenderer(e){return new wv(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=x(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Rg(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&&!An(this.appliedThemeCSS.theme,this.options.theme??V)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){jh(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=rv(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Xv(this.pre,Jv({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Zv(this.headerElement,Yv({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Z_(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Fh(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Wv(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(ov(`merge`,e,t),this.setHydratedState(t),await $_(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=rv(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!qv(u,this.deletionFile)||!qv(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&d_(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Fh(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(pg(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,Mt);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||gv(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return Mm({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=dg(e,this.hunksRenderer.getExpandedHunksMap(),t);return pg(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(fg(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return wm({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return Tm({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=ym(o);if(e<s){let c=bm({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=Cm({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=ym(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Ah(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||pm(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Hv(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}-${wn(r)}`,a=this.annotationCache.get(i);if(a==null||!Vv(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:O_(wn(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=k_();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:kg(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):kg(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=w_;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??dc(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,M,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Fe,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Et,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,tt,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=A_(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=L_(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??V,s=typeof o==`string`?o:{...o},c=M_(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=W_({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:R_(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=z_(this.themeCSSStyle.textContent??``,M_(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Y_()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?U_(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Qv(t[0]),a=Qv(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=dc(i),r.content.innerHTML=dc(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=H_({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=H_({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=H_({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Qv(r?.[0]),a=Qv(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=Qv(n?.[0]),i=Qv(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=dc(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?U_(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Qv(t[0]),i=Qv(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};T_(u,this.appliedPreAttributes)||(Q_(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 qv(e,t){return e==null||t==null?e==null&&t==null:jn(e,t)}function Jv({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Yv({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Xv(e,t,n=!1){return!n&&e==null&&t}function Zv(e,t,n=!1){return e==null&&t&&!n}function Qv(e){if(e!=null&&e.type===`element`)return e.children??[]}var $v=3e3,ey=-1,ty=class extends Kv{__id=`little-virtualized-file-diff:${++ey}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=mm(n)}setMetrics(e,t=!1){let n=mm(e);!t&&Th(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||!jg(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=!Eh(t,e),r=n&&ly(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:uy(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&i&&Ng(this.renderRange)){let t=ny(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=my(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());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,r){let i=!dm(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=mm(n.metrics),o=!0,s=!0);let{collapsed:c=!1,expandUnchanged:l=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!0),this.currentExpandUnchanged!==l&&(this.currentExpandUnchanged=l,o=!0,s=!0),o&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null||e<1)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=hm(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return Mm({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=Am({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=jm({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}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}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??hm(this.metrics,t)+this.cache.fileAnnotationHeight,l;return Mm({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=Am({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=jm({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){let n=ov(`clone`,e,t);if(await $_(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(ov(`merge`,e,t),this.setHydratedState(t),await $_(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n,{pendingExpansions:r,pendingHydratedDiff:i}=this;if(r!=null){this.pendingExpansions=void 0;for(let e of r)this.hunksRenderer.expandHunk(e.hunkIndex,e.direction,e.expansionLineCountOverride),t=!0}return i!=null&&(this.pendingHydratedDiff=void 0,i.expectedDiff===e&&(this.setHydratedState(i.files),n=i.nextDiff)),n==null?t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)):(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return wm({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(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)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=hm(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=ev({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:dy(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=rv(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!py(s,this.deletionFile)||!py(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=Fh(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=this.syncLineAnnotations(r);p&&this.resetLayoutCache({includeEstimatedHeights:!1});let m=t!=null&&t!==this.fileDiff,h=u!=null&&!dm(this.fileDiff,u),g=m||l;if(h&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(f)this.top??=this.getVirtualizedTop(),h&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,u));else{this.computeApproximateSize(!1,u);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!g||!f))return this.fileDiff=u,a!=null&&(this.deletionFile=s,this.additionFile=c),h&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let _=this.virtualizer.getWindowSpecs(),v=this.top??0,y=this.computeRenderRangeFromWindow(u,v,_),b=super.render({fileDiff:u,fileContainer:e,renderRange:y,lineAnnotations:r,forceRender:(d??n)||p||h,...a,...i});return this.isSimpleMode()&&b&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),b}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return fy(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=dy(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=ry(this.cache.heightDeltas),u=hm(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=oy(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+sy(i,e)*this.metrics.lineHeight+iy(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=$v}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+iy(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=bm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?Am({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?Cm({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?jm({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:cy({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=bm({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=dy(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=hm(this.metrics,i),h=e.hunks.length>0?_m(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,ee=C/s,w=ee,T=[],E=(n+r)/2,D=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),O=t+(D?.top??_),k=D?.renderedLineIndex??0,A,j,M;if(Mm({diff:e,diffStyle:l,startingLine:D?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?Am({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;O+=y;let b=k%s===0,x=Math.floor(k/s);if(b&&(T[x]=O-(t+_+y),M!=null)){if(M<=0)return!0;M--}let S=this.getLineHeight(l===`split`?m:h,g);if(O>n-S&&O<r&&(A??=x),j==null&&O+S>E&&(j=x),M==null&&O>=r&&b&&(M=w),k++,O+=S,c>0||v&&d){let e=jm({type:u,metrics:this.metrics});e!=null&&(O<r&&O+e.totalHeight>n&&(A??=x),j==null&&O+e.totalHeight>E&&(j=x),O+=e.totalHeight)}return!1}}),A==null){if(x)A=0,j=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}j??=A;let N=Math.round(j-ee/2),te=Math.max(0,Math.ceil(p/s)-ee),ne=Math.max(0,Math.min(N,te)),re=ne*s,P=N<0?C+N*s:C,ie=T[ne]??0,ae=re===0?0:g+ie,F=ne+P/s,oe=F<T.length?v-T[F]:v-(O-t-_);return{startingLine:re,totalLines:P,bufferBefore:ae,bufferAfter:Math.max(0,oe)}}};function ny(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===Ag&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function ry(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 iy({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=ay(e,n);return(t[ay(e,r)]??0)-(t[i]??0)}function ay(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 oy(e){return Math.ceil(e/$v)*$v}function sy(e,t){let n=0;for(let r of e)r<t&&n++;return n}function cy({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 ly(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function uy(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function dy(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function fy(e){return typeof e==`function`?`custom`:e??`line-info`}function py(e,t){return e==null||t==null?e==null&&t==null:jn(e,t)}function my(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function hy(e,t){return typeof window>`u`&&t!=null?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,U.jsx)(U.Fragment,{children:e})}var gy=(0,W.createContext)(void 0);function _y(){return(0,W.useContext)(gy)}var vy=typeof window>`u`?W.useEffect:W.useLayoutEffect;function yy({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:a,metrics:o,hasGutterRenderUtility:s,hasCustomHeader:c,disableWorkerPool:l,edit:u}){let d=_y(),f=i!==void 0,p=(0,W.useContext)(wh),m=bn(),h=(0,W.useRef)(null),g=_n(n=>{if(n!=null){if(h.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);d==null?h.current=new Kv(by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),l?void 0:p,!0):h.current=new ty(by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),d,o,l?void 0:p,!0),h.current.hydrate({fileDiff:e,fileContainer:n,lineAnnotations:r,prerenderedHTML:a})}else{if(h.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);h.current.cleanUp(),h.current=null}});return vy(()=>{let{current:n}=h;if(n==null)return;let a=by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),o=a!==void 0&&!Eh(n.options,a);n.setOptions(a),n.render({forceRender:o,fileDiff:e,lineAnnotations:r}),i!==void 0&&n.setSelectedLines(i)}),vy(()=>{if(u&&h.current!=null){if(m===void 0)throw Error(`FileDiff: EditContext is not attached`);let e=m(n??{});if(e==null)throw Error(`FileDiff: EditProvider.createEditor must return an editor instance`);try{return e.edit(h.current)}catch(t){throw e.cleanUp(),t}}},[u]),{ref:g,getHoveredLine:(0,W.useCallback)(()=>h.current?.getHoveredLine(),[])}}function by({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?Cn:e?.renderCustomHeader,renderGutterUtility:r?Cn:e?.renderGutterUtility}:e}var xy=W.createContext(void 0);function Sy(e){let t=W.useContext(xy);if(t===void 0&&!e)throw Error(Kt(33));return t}var Cy=W.createContext(void 0);function wy(e){let t=W.useContext(Cy);if(t===void 0&&!e)throw Error(Kt(36));return t}var Ty=W.createContext(void 0);function Ey(e=!0){let t=W.useContext(Ty);if(t===void 0&&!e)throw Error(Kt(25));return t}var Dy=W.createContext(null);function Oy(e=`root`){let t=W.useContext(Dy),n=W.useContext(Cy);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var ky={visible:!0,ref:null};function Ay(){return ky}function jy(e,t,n=`root`){let r=Oy(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ay)({label:e.label,children:e.children,render:e.render}),a=re(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var My=W.createContext(void 0);function Ny(){let e=W.useContext(My);if(e===void 0)throw Error(Kt(30));return e}function Py(e){e.preventDefault()}function Fy(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=wy(),u=Ey(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return W.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Py:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:dt})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Te&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&de(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Iy={type:`regular-item`};function Ly(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=W.useRef(null),{getButtonProps:d,buttonRef:f}=Ae({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Fy({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=W.useCallback(e=>ae(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=re(u,f);return W.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ry=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function zy(){return W.useContext(Ry)}function By(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=zy(),u=W.useRef(-1),[d,f]=W.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=W.useRef(null),h=W.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return jt(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Vy=`data-checked`,Hy=`data-unchecked`,Uy={checked(e){return e?{[Vy]:``}:{[Hy]:``}},...p},Wy=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=wy(),m=By({guess:!0,label:a}),h=wt(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:C}=Ly({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:Iy}),ee=W.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=S(dt,e.nativeEvent,void 0,{preventUnmountOnClose:E});u?.(!l,t)}let T=it(`div`,e,{state:ee,stateAttributesMapping:Uy,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[C,t,m.ref]});return(0,U.jsx)(My.Provider,{value:ee,children:T})}),Gy=W.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=Be({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=jy(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,U.jsx)(Wy,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),Ky=W.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Ny(),c=W.useRef(null),{transitionStatus:u,mounted:d,setMounted:f}=w(s.checked);l({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||f(!1)}});let p={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:u};return it(`span`,e,{state:p,ref:[t,c],stateAttributesMapping:Uy,props:{"aria-hidden":!0,...o},enabled:a||d})}),qy=W.createContext(void 0);function Jy(){let e=W.useContext(qy);if(e===void 0)throw Error(Kt(31));return e}var Yy=W.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=wt(a),c=Jy();return jt(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),it(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Xy=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=wy(),f=By({guess:!0,label:a}),p=wt(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Ly({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Iy});return it(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Zy=W.forwardRef(function(e,t){let n=jy(e,t);return n.visible?(0,U.jsx)(Xy,{...e,ref:n.ref}):null}),Qy=Te&&De;function $y(e,t={}){let{enabled:n=!0,delay:r}=t,{events:a,dataRef:o}=e.context,s=W.useRef(!1),c=W.useRef(null),l=W.useRef(!0),u=qt();W.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=et(t);function a(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&mt(t)&&t===F(i(t))&&(s.current=!0,c.current=t)}function o(){l.current=!0}function u(){l.current=!1}return Vt(me(r,`blur`,a),Qy&&me(r,`keydown`,o,!0),Qy&&me(r,`pointerdown`,u,!0))},[e,n]),W.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Pe(t)&&(c.current=t,s.current=!0)}}return a.on(`openchange`,t),()=>{a.off(`openchange`,t)}},[a,n,e]);let d=W.useMemo(()=>{function t(){s.current=!1,c.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(s.current){if(c.current===i)return;t()}let a=le(n.nativeEvent);if(Pe(a)){if(Qy&&!n.relatedTarget){if(!l.current&&!g(a))return}else if(!m(a))return}let o=Rt(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;if(e.select(`open`)&&o||!r){e.setOpen(!0,S(Bt,d,f));return}u.start(r,()=>{s.current||e.setOpen(!0,S(Bt,d,f))})},onBlur(n){t();let r=n.relatedTarget,a=n.nativeEvent,s=Pe(r)&&r.hasAttribute(qe(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let t=e.select(`domReferenceElement`),n=F(i(t));!r&&n===t||se(o.current.floatingContext?.refs.floating.current,n)||se(t,n)||s||Rt(r??n,e.context.triggerElements)||e.setOpen(!1,S(Bt,a))})}}},[o,r,e,u]);return W.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}function eb(e){return De&&e.movementX===0&&e.movementY===0}function tb(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function nb(e,t){return tb(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function rb(e,t,n){return tb(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function ib(e,t,n){return tb(t,n?e===st:e===s,e===L)}function ab(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:tb(t,n?e===s:e===st,e===at)}function ob(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:_=!0,disabledIndices:v=void 0,orientation:b=`vertical`,triggerOrientation:x=b,parentOrientation:C,id:ee,resetOnPointerLeave:w=!0,externalTree:T,nestedReturnFocusRef:E,grid:O}=t,k=O!=null,A=e.useState(`open`),j=e.useState(`floatingElement`),M=e.useState(`domReferenceElement`),N=e.context.dataRef,te=d(j),ne=B(M),re=ze(te),ie=nt(),ae=Ie(T),oe=W.useRef(m),I=W.useRef(s??-1),L=W.useRef(null),ce=W.useRef(!0),R=H(e=>{a(I.current===-1?null:I.current,e)}),ue=W.useRef(!!j),z=W.useRef(A),de=W.useRef(!1),fe=W.useRef(!1),pe=W.useRef(null),me=ze(v),he=ze(A),ge=ze(s),_e=ze(w),ve=Se(),ye=Se(),be=H(()=>{ve.cancel();function e(e){p||(pe.current=He(e,{sync:de.current,preventScroll:!0}))}let t=n.current[I.current],r=fe.current;t&&e(t),(de.current?e=>e():e=>ve.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),V&&(r||!ce.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});jt(()=>{N.current.orientation=b},[N,b]),jt(()=>{A||(L.current=null),(!A||m!==`auto`)&&(oe.current=m)},[A,m]),jt(()=>{o&&(A&&j?(I.current=s??-1,oe.current&&s!=null&&(fe.current=!0,R())):ue.current&&(I.current=-1,R()))},[o,A,j,s,R]),jt(()=>{if(o){if(!A){de.current=!1;return}if(j){if(r==null){if(de.current=!1,ge.current!=null)return;if(ue.current&&(I.current=-1,be()),(!z.current||!ue.current)&&oe.current&&(L.current!=null||oe.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ye.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||rb(L.current,x,f)||u?ft(n):bt(n),L.current=null,R())};t()}}else Ne(n.current,r)||(I.current=r,be(),fe.current=!1)}}},[o,A,j,r,ge,u,n,x,f,R,be,ye]),jt(()=>{if(!o||j||!ae||p||!ue.current)return;let e=ae.nodesRef.current,t=e.find(e=>e.id===ie)?.context?.elements.floating,n=F(i(M??t??null)),r=e.some(e=>e.context&&se(e.context.elements.floating,n));t&&!r&&ce.current&&t.focus({preventScroll:!0})},[o,j,M,ae,ie,p]),jt(()=>{z.current=A,ue.current=!!j});let xe=r!=null,Ce=H(e=>{if(!he.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,R(e))}),we=H(()=>C??ae?.nodesRef.current.find(e=>e.id===ie)?.context?.dataRef?.current.orientation),Te=H(()=>ft(n,me.current)),Ee=H(t=>{if(ce.current=!1,de.current=!0,t.which===229||!he.current&&t.currentTarget===re.current)return;if(u&&ab(t.key,b,f,k)){nb(t.key,we())||P(t),e.setOpen(!1,S(Ye,t.nativeEvent));let n=E?.current??M;mt(n)&&n.focus();return}r!=null&&r!==I.current&&!Ne(n.current,r)&&(I.current=r);let i=I.current,a=ft(n,v),o=bt(n,v);if(ne||(t.key===`Home`&&(P(t),I.current=a,R(t)),t.key===`End`&&(P(t),I.current=o,R(t))),O!=null){let e=O(t,I.current,n,b,l,f,v,a,o);if(e!=null&&e!==I.current&&(I.current=e,R(t)),b===`both`)return}if(nb(t.key,b)){P(t);let e=F(t.currentTarget.ownerDocument);if(A&&!p&&se(t.currentTarget,e)&&!n.current.some(t=>t!=null&&se(t,e))){I.current=rb(t.key,b,f)?a:o,R(t),r===I.current&&be();return}let{index:s,wrapped:u}=$e(n.current,i,{decrement:!rb(t.key,b,f),loopFocus:l,allowEscape:c,disabledIndices:v,minIndex:a,maxIndex:o});u&&(de.current=!1),I.current=s,R(t)}}),V=W.useMemo(()=>({onFocus(e){de.current=!0,Ce(e)},onClick({currentTarget:e}){p||e.focus({preventScroll:!0})},onMouseMove(e){eb(e)||(de.current=!0,fe.current=!1,h&&Ce(e))},onPointerLeave(e){if(!he.current||!ce.current||e.pointerType===`touch`)return;de.current=!0;let t=e.relatedTarget;if(!(!h||n.current.includes(t))&&_e.current&&(pe.current?.(),pe.current=null,I.current=-1,R(e),!p)){let e=re.current,t=F(i(e));e&&se(e,t)&&e.focus({preventScroll:!0})}}}),[Ce,he,re,h,n,R,_e,p]),De=W.useMemo(()=>p&&A&&xe&&{"aria-activedescendant":`${ee}-${r}`},[p,A,xe,ee,r]),Oe=W.useMemo(()=>({...ne?{}:De,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&A&&!p){let n=le(t.nativeEvent);if(n&&!se(re.current,n))return;P(t);let r=S(Ke,t.nativeEvent);e.setOpen(!1,r);let i=E?.current??M;!r.isCanceled&&mt(i)&&i.focus();return}Ee(t)},onPointerMove(e){eb(e)||(ce.current=!0)}}),[De,Ee,re,ne,e,A,p,M,E]),ke=W.useMemo(()=>{function t(t){e.setOpen(!0,S(Ye,t.nativeEvent,t.currentTarget))}function n(e){m===`auto`&&y(e.nativeEvent)&&(oe.current=!p)}function r(e){oe.current=m,m===`auto`&&D(e.nativeEvent)&&(oe.current=!0)}return{onKeyDown(n){let r=e.select(`open`);ce.current=!1;let i=n.key.startsWith(`Arrow`),a=ib(n.key,we(),f),o=nb(n.key,r?b:x),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(p&&r&&(!u||g(n.currentTarget)))return Ee(n);if(!(!r&&!_&&i)){if(s){let e=nb(n.key,we());L.current=u&&e?null:n.key}if(u){a&&(P(n),r?(I.current=Te(),R(n),p&&re.current?.focus()):t(n));return}o&&(ge.current!=null&&(I.current=ge.current),P(n),!r&&_?t(n):Ee(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!p&&(I.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[Ee,m,Te,u,R,e,_,b,x,we,f,ge,p,re]),Ae=W.useMemo(()=>({...De,...ke}),[De,ke]);return W.useMemo(()=>o?{reference:Ae,floating:Oe,item:V,trigger:ke}:{},[o,Ae,Oe,ke,V])}function sb(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=H(s),f=e.useState(`open`),p=qt(),m=W.useRef(``),h=W.useRef(u??i??-1),g=W.useRef(null),_=H(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Xe(n)||n?.matches(`:disabled`)?!1:o==null||!Ft(R,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!s(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(P(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(P(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=H(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);se(r,n)||se(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});jt(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=W.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return W.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var cb=W.createContext(void 0);function lb(){return W.useContext(cb)}function ub(e,t){let n=o(e.render);if(W.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function db(e,t,n){let r=ub(e,t),i=r===t?void 0:r;return[r,W.useCallback(e=>n?.(e?i:void 0),[i,n])]}function fb(e,t,n){let r=o(e.render),i=W.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],s=e[`aria-labelledby`]??i?.[`aria-labelledby`];return s==null&&!a&&(s=t?t.id||void 0:n||void 0),s}var pb=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:u,defaultFloatingId:d,setRenderedFloatingId:p,virtualFocus:m,orientation:g}=wy(),_=lb(),{side:v,align:y}=Sy(),b=I(!0)!=null,x=u.useState(`open`),C=u.useState(`transitionStatus`),ee=u.useState(`popupProps`),w=u.useState(`mounted`),T=u.useState(`instantType`),E=u.useState(`activeTriggerElement`),D=u.useState(`parent`),O=u.useState(`lastOpenChangeReason`),k=u.useState(`rootId`),A=u.useState(`floatingRootContext`),j=u.useState(`floatingTreeRoot`),M=u.useState(`closeDelay`),N=u.useState(`hoverEnabled`),te=u.useState(`disabled`),ne=u.useState(`openMethod`),re=u.useState(`activeTriggerId`),P=u.useState(`listElement`),[ie,ae]=db(e,d,p),F=fb(e,E,re),oe=D.type===`menu`?_:void 0,se=D.type===`context-menu`,L=s??D.type!==`menu`;s===void 0&&P&&D.type!==`menu`&&(L=()=>u.state.activeIndex===null&&P),l({open:x,ref:u.context.popupRef,onComplete(){x&&u.context.onOpenChangeComplete?.(!0)}}),W.useEffect(()=>{function e(e){u.setOpen(!1,S(e.reason,e.domEvent))}return j.events.on(`close`,e),()=>{j.events.off(`close`,e)}},[j.events,u]),rt(A,{enabled:N&&!te&&!se&&D.type!==`menubar`,closeDelay:M});let ce=u.useStateSetter(`popupElement`),{parentVirtualFocusRef:R,handleFocus:le}=(W.useContext(Dy)?.useParentHandoff??hb)(u,D,x,m),ue={transitionStatus:C,side:v,align:y,open:x,nested:D.type===`menu`,instant:T},z=it(`div`,e,{state:ue,ref:[t,u.context.popupRef,ce,ae],stateAttributesMapping:Lt,props:[ee,{id:ie,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":g===`horizontal`?`horizontal`:void 0,"aria-labelledby":F},onKeyDown(e){oe?.onPopupKeyDown?.(e),b&&f.has(e.key)&&e.stopPropagation()},onFocus:le},h(C),c,{"data-rootownerid":k}]}),de=D.type===void 0||se;(E||D.type===`menubar`&&O!==`outside-press`)&&(de=!0);let fe=oe?.getReturnElement??R;return(0,U.jsx)(Ge,{context:A,openInteractionType:ne,modal:se,disabled:!w,returnFocus:a??fe??de,explicitReturnFocus:a===void 0&&fe?!1:void 0,initialFocus:L,restoreFocus:!0,getInsideElements:D.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:D.type===`menubar`?void 0:j,previousFocusableElement:E,nextFocusableElement:D.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:z})}),mb={parentVirtualFocusRef:void 0,handleFocus:void 0};function hb(){return mb}var gb=W.forwardRef(function(e,t){let n=Oy()?.Popup??pb;return(0,U.jsx)(n,{...e,ref:t})}),_b=W.createContext(void 0);function vb(){let e=W.useContext(_b);if(e===void 0)throw Error(Kt(32));return e}var yb=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=wy();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,U.jsx)(_b.Provider,{value:n,children:(0,U.jsx)(At,{ref:t,...r,portalOwnerRole:o})})});function bb(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=H(i),[,o]=W.useState(0),s=fe(Sb).current,c=fe(xb).current,l=W.useRef(0),u=W.useRef(!0),d=W.useRef(null),f=W.useRef(null),p=H(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=H((e,t)=>{c.set(e,t),p()}),h=H(e=>{c.delete(e),p()}),g=H(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Tb(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Eb(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=wb(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=H(()=>{let[e,t]=Cb(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});jt(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),jt(()=>{u.current&&v()}),jt(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=H(e=>(s.add(e),()=>{s.delete(e)})),b=W.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,U.jsx)(Ry.Provider,{value:b,children:t})}function xb(){return new Map}function Sb(){return new Set}function Cb(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Eb(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function wb(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Tb(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Eb(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Db=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=lt,style:_,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=wy(),C=vb(),ee=Ey(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),k=y.useState(`modal`),A=y.useState(`openMethod`),j=y.useState(`activeTriggerElement`),M=y.useState(`transitionStatus`),N=y.useState(`positionerElement`),te=y.useState(`instantType`),ne=y.useState(`adaptiveOrigin`),re=y.useState(`lastOpenChangeReason`),P=y.useState(`floatingNodeId`),ie=y.useState(`floatingParentNodeId`),ae=T.useState(`domReferenceElement`),F=n,oe=c,se=l,I=s,L=g;w.type===`context-menu`&&(F=n??w.context?.anchor,I??=`start`,!o&&I!==`center`&&(se=e.alignOffset??2,oe=e.sideOffset??-5));let ce=o,R=I;w.type===`menu`?(ce??=`inline-end`,R??=`start`,L=e.collisionAvoidance??Pt):w.type===`menubar`&&(ce??=w.context.orientation===`vertical`?`inline-end`:`bottom`,R??=`start`);let le=w.type===`context-menu`,ue=u({anchor:F,floatingRootContext:T,positionMethod:ee?`fixed`:r,mounted:D,side:ce,sideOffset:oe,align:R,alignOffset:se,arrowPadding:le?0:p,collisionBoundary:d,collisionPadding:f,sticky:m,nodeId:P,keepMounted:C,disableAnchorTracking:h,collisionAvoidance:L,shift:le?{crossAxis:!(`side`in L&&L.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:ne,lazyFlip:b?`placement`:!1});W.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===P&&y.set(`hoverEnabled`,!1),e.nodeId!==P&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,S(Re)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,P]),W.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,S(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let z=qt();W.useEffect(()=>{O||z.clear()},[O,z]),W.useEffect(()=>{function e(e){if(!(!O||e.nodeId!==y.select(`floatingParentNodeId`))){if(e.target&&j&&j!==e.target){let e=y.select(`closeDelay`);e>0?z.isStarted()||z.start(e,()=>{y.setOpen(!1,S(Re))}):y.setOpen(!1,S(Re))}else z.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,j,y,z]),W.useEffect(()=>{let e={open:O,nodeId:P,parentNodeId:ie,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,P,ie]),zt({store:y,domReference:ae,positionerElement:N,open:O});let de={open:O,side:ue.side,align:ue.align,anchorHidden:ue.anchorHidden,nested:w.type===`menu`,instant:te},fe=w.type===`menubar`&&w.context.modal;Ht(O&&(fe||k&&re!==`trigger-hover`),A===`touch`,N,j);let me=Le(e,de,{styles:ue.positionerStyles,transitionStatus:M,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ge=D&&w.type!==`menu`&&(w.type!==`menubar`&&k&&re!==`trigger-hover`||w.type===`menubar`&&w.context.modal),B=null;return w.type===`menubar`?B=w.context.contentElement:w.type===void 0&&(B=j),(0,U.jsxs)(xy.Provider,{value:ue,children:[ge&&(0,U.jsx)(pe,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:he(!O),cutout:B}),(0,U.jsx)(Nt,{id:P,children:(0,U.jsx)(bb,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:me})})]})}),Ob=W.createContext(null);function kb(e){let t=W.useContext(Ob);if(t===null&&!e)throw Error(Kt(5));return t}function Ab(e){return e==null?Me:e.type.startsWith(`key`)?Qe:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Ut:Me}var jb={...ce,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=ce.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>De&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!ce.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Mb=class extends _{constructor(e,t,n=!1){let r=new Gt,i=Pb(r,t,n,e);super(i,Nb(r),jb),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Nb(e){return{positionerRef:W.createRef(),popupRef:W.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Pb(e,t,n=!1,r){return{...oe(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:v,inputProps:v,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new gt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:v,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Fb=W.createContext(null);function Ib(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Lb(e,t){return e===`list-navigation`||Ib(e,t)}var Rb=T(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:l,loopFocus:u=!0,orientation:d=`vertical`,actionsRef:f,closeParentOnEsc:p=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:_=!0,isSubmenu:y=!1,virtualFocus:x=!1,virtualFocusRef:ee,allowEscape:w=!0,resetOnPointerLeave:T=!0}=e,E=Ey(!0),D=wy(!0),O=kb(!0),k=D?.store,A=D?.virtualFocus??!1,M=W.useMemo(()=>y&&k?{type:`menu`,store:k}:O?{type:`menubar`,context:O}:E&&!k?{type:`context-menu`,context:E}:{type:void 0},[E,k,O,y]),N=wt(),ne=wt(),[re,P]=W.useState(void 0),ie=(re??ne)||void 0,F=nt(),oe=M.type===`menu`?M.store:void 0,se=(n??o)&&oe?.state.transitionStatus===`starting`,I=fe(()=>se?oe?.state.instantType:void 0).current,L=fe(()=>{let e=new Mb({open:o,openProp:n,activeTriggerId:g,triggerIdProp:h,parent:M,disabled:s,highlightItemOnHover:_,modal:M.type===void 0?l:void 0,rootId:N,instantType:I},ie,F!=null);return e.context.virtualFocusRef=ee,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,h),L.useContextCallback(`onOpenChangeComplete`,i);let ce=L.useState(`floatingTreeRoot`),le=Dt(ce),z=L.useState(`open`),de=L.useState(`activeTriggerElement`),pe=L.useState(`positionerElement`),me=L.useState(`hoverEnabled`),he=L.useState(`disabled`),ge=L.useState(`lastOpenChangeReason`),B=L.useState(`parent`),_e=L.useState(`activeIndex`),xe=L.useState(`keyboardOpen`),Se=L.useState(`payload`),Ce=L.useState(`floatingParentNodeId`),we=W.useRef(null),Te=W.useRef(B.type!==`context-menu`),Ee=qt(),V=W.useRef(!0),De=qt(),ke=Ce!=null,{openMethod:Ae,triggerProps:Ne}=je(z);L.useSyncedValues({disabled:s,highlightItemOnHover:_,modal:B.type===void 0?l:void 0,openMethod:Ae,rootId:N}),b(L);let{forceUnmount:Pe,transitionStatus:Fe}=j(z,L,()=>{L.set(`allowMouseEnter`,!1)},se),Ie=ye(L.context.popupRef);W.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!z){e();return}if(Fe!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return Ie(e,t.signal),()=>{t.abort()}},[I,z,Fe,Ie,L]),jt(()=>{E&&!D?L.update({parent:{type:`context-menu`,context:E},floatingNodeId:le,floatingParentNodeId:F}):(D||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:le,floatingParentNodeId:F})},[E,D,le,F,de,L]),W.useEffect(()=>{if(z||(we.current=null),B.type===`context-menu`){if(!z){Ee.clear(),Te.current=!1;return}Ee.start(500,()=>{Te.current=!0})}},[Ee,z,B.type]),jt(()=>{!z&&!me&&L.set(`hoverEnabled`,!0)},[z,me,L]);let Le=H((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||z===e&&t.trigger===de&&ge===n)return;let i=C(t);if(!e&&t.trigger==null&&(t.trigger=de??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!V.current)return;e&&n===`trigger-focus`?(V.current=!1,De.start(300,()=>{V.current=!0})):(V.current=!0,De.clear());let o=!e&&(n===`escape-key`||n==null);we.current=t.event;let s=be(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Lb(n,a),s.instantType=B.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Ib(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),Re=Oe({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:ie,nested:F!=null,onOpenChange:Le}),ze=Re.context.events;jt(()=>{let e=({open:e,eventDetails:t})=>Le(e,t);return ze.on(`setOpen`,e),()=>{ze?.off(`setOpen`,e)}},[ze,Le]),jt(()=>L.subscribeToParentMenu(),[L]);let Be=W.useCallback(()=>{L.setOpen(!1,S(yt))},[L]);W.useImperativeHandle(f,()=>({unmount:Pe,close:Be}),[Pe,Be]);let Ve;B.type===`context-menu`&&(Ve=B.context),W.useImperativeHandle(Ve?.positionerRef,()=>pe,[pe]),W.useImperativeHandle(Ve?.actionsRef,()=>({setOpen:Le}),[Le]);let He=ue(Re,{enabled:!he,bubbles:{escapeKey:p&&B.type===`menu`},outsidePress(){return B.type!==`context-menu`||we.current?.type===`contextmenu`||Te.current},externalTree:ke?ce:void 0}),Ue=It(),We=ob(Re,{enabled:!he,listRef:L.context.itemDomElements,activeIndex:_e,virtual:x,nested:B.type===`menubar`||!x&&B.type!==void 0,parentOrientation:B.type===`menubar`?B.context.orientation:void 0,loopFocus:u,focusItemOnOpen:x?xe:void 0,allowEscape:x&&u&&w,orientation:d,triggerOrientation:x?`vertical`:d,rtl:Ue===`rtl`,disabledIndices:R,onNavigate(e,t){L.setActiveIndex(e,Ab(t),t?.nativeEvent)},openOnArrowKeyDown:B.type!==`context-menu`&&!(x&&y),externalTree:!x&&ke?ce:void 0,nestedReturnFocusRef:oe?.context.virtualFocusRef,focusItemOnHover:_,resetOnPointerLeave:T}),Ge=W.useCallback(e=>{L.context.typingRef.current=e},[L]),Ke=sb(Re,{enabled:!he&&!x,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:_e,resetMs:500,onMatch:(e,t)=>{z&&e!==_e&&L.setActiveIndex(e,Qe,t.nativeEvent)},onTyping:Ge}),qe=H(a),Je=W.useRef(-1),Ye=H(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Je.current===n&&L.context.reportedItem===t)return;Je.current=n,L.context.reportedItem=t,x&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=Me,L.context.highlightEvent=void 0,a&&qe(t,te(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});jt(()=>{Ye()},[_e,Ye]);let Xe=W.useMemo(()=>{if(!x)return We.reference;if(!We.trigger)return v;let{onFocus:e,...t}=We.trigger;return t},[x,We.reference,We.trigger]);L.useSyncedValue(`inputProps`,x?We.reference??v:v);let Ze=W.useMemo(()=>{let e=ae(Ke.reference,Xe,He.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},Ne);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=z,e},[L,Ke.reference,Xe,He.reference,Ne,z]),$e=W.useMemo(()=>{let e=ae(We.trigger,He.trigger,Ne);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[We.trigger,He.trigger,Ne]);fe(()=>(L.update({inactiveTriggerProps:$e}),null));let et=W.useMemo(()=>ae(c,{onMouseMove(){L.set(`allowMouseEnter`,!0),B.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ke.floating,We.floating,He.floating),[B.type,L,Ke.floating,We.floating,He.floating]),tt=We.item??v;xt(L,{floatingRootContext:Re,activeTriggerProps:Ze,inactiveTriggerProps:$e,popupProps:et,itemProps:tt});let rt=W.useMemo(()=>({store:L,parent:M,orientation:d,loopFocus:u,allowEscape:w,defaultFloatingId:ne,setRenderedFloatingId:P,virtualFocus:x,parentVirtualFocus:A,syncHighlightedItem:Ye}),[L,M,d,u,w,ne,x,A,Ye]),it=typeof t==`function`?t({payload:Se}):t,at=(0,U.jsxs)(Cy.Provider,{value:rt,children:[m&&(0,U.jsx)(ve,{handle:m,store:L}),it]});return(B.type===void 0||B.type===`context-menu`)&&(at=(0,U.jsx)(pt,{externalTree:ce,children:at})),at});function zb(e){let t=W.useContext(Fb);if(t===null)return(0,U.jsx)(Rb,{...e});let n=t.Root;return(0,U.jsx)(Fb.Provider,{value:null,children:(0,U.jsx)(n,{...t.options,...e})})}var Bb=5;function Vb(e,t){let n=Hb(t);return e.clientX>=n.left-Bb&&e.clientX<=n.right+Bb&&e.clientY>=n.top-Bb&&e.clientY<=n.bottom+Bb}function Hb(e){let t=e.getBoundingClientRect(),n=et(e);if(A)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Ub(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ue(),{ref:i,index:a}=By(e),o=n===a,s=W.useRef(null),c=re(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Wb(e){let{render:t,className:n,style:r,state:i=v,props:a=R,refs:o=R,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Ub({metadata:s});return it(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Gb(e){if(mt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Ot(e))return Gb(Tt(e))}function Kb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,a=W.useRef(!1);return W.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(a.current=!0,i(e.currentTarget).addEventListener(`click`,()=>{a.current=!1},{once:!0}))},onClick:e=>{a.current&&(a.current=!1,e.preventBaseUIHandler())}}:v,[t,n,r])}var qb=ne(function(e,t){let{render:r,className:o,style:s,disabled:c=!1,nativeButton:l=!0,id:u,openOnHover:d,delay:f=100,closeDelay:p=0,handle:m,payload:h,...g}=e,_=wy(!0),y=ie(m)??_?.store;if(!y)throw Error(Kt(85));let b=wt(u),x=y.useState(`isTriggerActive`,b),S=y.useState(`floatingRootContext`),C=y.useState(`isOpenedByTrigger`,b),ee=y.useState(`triggerControlsId`,b),w=W.useRef(null),T=Yb(),E=Ue(!0),D=Ie(),O=W.useMemo(()=>D??new gt,[D]),k=Dt(O),A=nt(),{registerTrigger:j,isMountedByThisTrigger:M}=Ce(b,w,y,{payload:h,closeDelay:p,parent:T,floatingTreeRoot:O,floatingNodeId:k,floatingParentNodeId:A,keyboardEventRelay:E?.relayKeyboardEvent}),N=T.type===`menubar`,te=y.useState(`disabled`),ne=c||te||N&&T.context.disabled,{getButtonProps:re,buttonRef:P}=Ae({disabled:ne,native:l});W.useEffect(()=>{!C&&T.type===void 0&&(y.context.allowMouseUpTriggerRef.current=!1)},[y,C,T.type]);let F=W.useRef(null),oe=qt(),I=H(e=>{if(!F.current)return;oe.clear(),y.context.allowMouseUpTriggerRef.current=!1;let t=e.target;se(F.current,t)||se(y.select(`positionerElement`),t)||t===F.current||(t==null||Gb(t)!==y.select(`rootId`))&&(Vb(e,F.current)||O.events.emit(`close`,{domEvent:e,reason:ct}))});W.useEffect(()=>{let e=i(F.current);if(C&&y.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,I,{once:!0}),()=>{e.removeEventListener(`mouseup`,I)}},[C,I,y]);let L=N&&T.context.hasSubmenuOpen,ce=a(S,{enabled:(d??L)&&!ne&&(!N||L&&!M),handleClose:ot({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:T.type===void 0?f:void 0,delay:{close:p},triggerElementRef:w,externalTree:O,isActiveTrigger:x,isClosing:()=>y.select(`transitionStatus`)===`ending`}),R=Jb(C,y.select(`lastOpenChangeReason`)),le=n(S,{enabled:!ne,event:C&&N?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0&&R}),ue=$y(S,{enabled:!ne&&L}),z=Kb({open:C,enabled:N,mouseDownAction:`open`}),de=W.useMemo(()=>ae(ue.reference,le.reference),[ue.reference,le.reference]),fe=y.useState(`triggerProps`,M),pe=y.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:me,handleFocusTargetFocus:he}=Je(y,w),B={disabled:ne,open:C},_e=[F,t,P,j,w],ve=[de,ce??v,fe,{"aria-haspopup":`menu`,"aria-controls":ee,id:b,onMouseDown:e=>{y.select(`open`)||(oe.start(200,()=>{y.context.allowMouseUpTriggerRef.current=!0}),i(e.currentTarget).addEventListener(`mouseup`,I,{once:!0}))}},pe,N?{role:`menuitem`}:{},z,g,re],ye=it(`button`,e,{enabled:!N,stateAttributesMapping:ge,state:B,ref:_e,props:ve});return N?(0,U.jsx)(Wb,{tag:`button`,render:r,className:o,style:s,state:B,refs:_e,props:ve,stateAttributesMapping:ge}):C?(0,U.jsxs)(W.Fragment,{children:[(0,U.jsx)(Wt,{ref:y.context.beforeTriggerFocusGuardRef,onFocus:me},`${b}-pre-focus-guard`),(0,U.jsx)(W.Fragment,{children:ye},b),(0,U.jsx)(Wt,{ref:y.context.triggerFocusTargetRef,onFocus:he},`${b}-post-focus-guard`)]}):(0,U.jsx)(W.Fragment,{children:ye},b)});function Jb(e,t){let n=qt(),[r,i]=W.useState(!1);return jt(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Yb(){let e=kb(!0);return W.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var Xb=W.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return it(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Zb=(0,W.createContext)(null);function Qb({actionsRef:e,children:t,interactionOwner:n=`local`,onOpenChange:r,...i}){let a=(0,W.useRef)(null),o=e??a;return _t(()=>o.current?.close()),(0,U.jsx)(Zb.Provider,{value:{actionsRef:o,interactionOwner:n},children:(0,U.jsx)(zb,{...i,actionsRef:o,onOpenChange:(e,t)=>{if(n===`host`&&!e&&t.reason===`escape-key`){t.cancel(),t.allowPropagation();return}r?.(e,t)},children:t})})}function $b(){let e=(0,W.useContext)(Zb);if(!e)throw Error(`DropdownMenu parts must be used inside <DropdownMenu>`);return e}var ex=(0,W.forwardRef)(function({className:e,render:t,type:n=`button`,...r},i){return(0,U.jsx)(qb,{...r,className:t=>N(`btn caps-dropdown-trigger`,Ct(e,t)),ref:i,render:t,type:n})}),tx=(0,W.forwardRef)(function({container:e,...t},n){let r=ut(`popover`);return e==null&&r===null?null:(0,U.jsx)(yb,{...t,container:e??r,ref:n})}),nx=(0,W.forwardRef)(function({className:e,collisionBoundary:t,...n},r){let i=ut(`popover`);return(0,U.jsx)(Db,{...n,className:t=>N(`z-(--stipe-layer-popover)`,Ct(e,t)),collisionBoundary:t??(i&&i!==document.body?i:void 0),ref:r})}),rx=(0,W.forwardRef)(function({className:e,finalFocus:t,...n},r){let{interactionOwner:i}=$b(),a=(0,W.useRef)(null);(0,W.useImperativeHandle)(r,()=>a.current);let o=Ze(`.caps-dropdown-item[data-highlighted]`),s=(0,W.useCallback)(e=>{a.current=e,o(e)},[o]);return(0,U.jsx)(gb,{...n,className:t=>N(`caps-dropdown-popup min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none`,Ct(e,t)),finalFocus:i===`host`?!1:t??!0,ref:s})}),ix=(0,W.forwardRef)(function({align:e=`end`,alignOffset:t,children:n,container:r,keepMounted:i,side:a=`bottom`,sideOffset:o=4,...s},c){return(0,U.jsx)(tx,{container:r,keepMounted:i,children:(0,U.jsx)(nx,{align:e,alignOffset:t,side:a,sideOffset:o,children:(0,U.jsx)(rx,{...s,ref:c,children:n})})})}),ax=`caps-dropdown-item flex min-h-2xl w-full items-center gap-sm rounded-field px-md py-xs text-left text-sm outline-none transition-colors hover:bg-base-200 focus-visible:bg-base-200 aria-[current=page]:bg-base-200 aria-[current=page]:font-semibold disabled:cursor-not-allowed disabled:text-base-content/40 data-disabled:cursor-not-allowed data-disabled:text-base-content/40`,ox=(0,W.forwardRef)(function({className:e,onClick:t,onSelect:n,variant:r=`default`,...i},a){return(0,U.jsx)(Zy,{...i,className:t=>N(ax,r===`destructive`&&`text-error hover:bg-error hover:text-error-content focus-visible:bg-error focus-visible:text-error-content`,Ct(e,t)),onClick:e=>{t?.(e),e.defaultPrevented||n?.(e)},ref:a})}),sx=(0,W.forwardRef)(function({children:e,className:t,onClick:n,onSelect:r,...i},a){return(0,U.jsxs)(Gy,{...i,className:e=>N(ax,Ct(t,e)),onClick:e=>{n?.(e),e.defaultPrevented||r?.(e)},ref:a,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,U.jsx)(Ky,{"aria-hidden":`true`,className:`shrink-0`,children:`✓`})]})}),cx=(0,W.forwardRef)(function({className:e,...t},n){return(0,U.jsx)(Xb,{...t,className:t=>N(`my-xs h-px bg-base-300`,Ct(e,t)),ref:n})});(0,W.forwardRef)(function({className:e,...t},n){return(0,U.jsx)(Yy,{...t,className:t=>N(`px-md pb-xs pt-sm text-xs font-semibold text-base-content/60`,Ct(e,t)),ref:n})});export{_m as $,g_ as A,xn as At,Ag as B,an as Bt,k_ as C,Sa as Ct,C_ as D,An as Dt,w_ as E,jn as Et,d_ as F,fn as Ft,Fh as G,Zt as Gt,jg as H,un as Ht,r_ as I,gn as It,Eh as J,jh as K,Qt as Kt,Lg as L,mn as Lt,m_ as M,yn as Mt,p_ as N,bn as Nt,x_ as O,On as Ot,f_ as P,_n as Pt,hm as Q,Rg as R,hn as Rt,A_ as S,mi as St,T_ as T,Un as Tt,Ng as U,ln as Ut,Mg as V,cn as Vt,kg as W,tn as Wt,wh as X,Th as Y,mm as Z,V_ as _,wp as _t,cx as a,em as at,L_ as b,vp as bt,_y as c,tm as ct,Z_ as d,Up as dt,um as et,J_ as f,Bp as ft,H_ as g,$ as gt,U_ as h,Op as ht,ox as i,nm as it,h_ as j,Cn as jt,v_ as k,wn as kt,hy as l,Jp as lt,W_ as m,kp as mt,sx as n,Xp as nt,ex as o,Qp as ot,Y_ as p,Ap as pt,Ah as q,$t as qt,ix as r,Yp as rt,yy as s,Zp as st,Qb as t,cm as tt,Q_ as u,$p as ut,z_ as v,xp as vt,O_ as w,G as wt,M_ as x,dc as xt,R_ as y,yp as yt,Ig as z,sn as zt};
1518
+ `}function zv(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Bv(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Vv(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Hv(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function Uv(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:V_(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function Wv(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}var Gv=-1,Kv=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Gv}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:B},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new r_,this.scrollSyncManager=new hv,this.interactionManager=new Lg(`diff`,Rg(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 Uv(e)}createHunksRenderer(e){return new wv(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{let n=this.fileDiffCache;if(n==null)return;let r=n.hunks.at(-1),i,a;hunkIterator:for(let o of n.hunks){let n=t===`deletions`?o.deletionStart:o.additionStart,s=t===`deletions`?o.deletionCount:o.additionCount,c=x(n,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(e<c){let t=c-e;i=Math.max(u-t,0),a=Math.max(l-t,0);break hunkIterator}if(e>=c+s){if(o===r){let t=e-(c+s);i=u+o.unifiedLineCount+t,a=l+o.splitLineCount+t;break hunkIterator}continue}for(let n of o.hunkContent)if(n.type===`context`){if(e<c+n.lines){let t=e-c;a=l+t,i=u+t;break hunkIterator}c+=n.lines,l+=n.lines,u+=n.lines}else{let r=t===`deletions`?n.deletions:n.additions;if(e<c+r){let r=e-c;i=u+(t===`additions`?n.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(n.deletions,n.additions),u+=n.deletions+n.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Rg(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&&!jn(this.appliedThemeCSS.theme,this.options.theme??B)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t===`wrap`,columnVariables:this.shouldApplyColumnVariables(t)?`apply`:`measure`}),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.lineAnnotations.length>0||this.pre?.hasAttribute(`data-has-merge-conflict`)===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){jh(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:r,fileDiff:i,...a}){if(!this.enabled)throw Error(`FileDiff.hydrate: attempting to call hydrate after cleaned up`);if(this.fileContainer!=null)throw Error(`FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated`);let o=rv(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t),Xv(this.pre,Jv({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Zv(this.headerElement,Yv({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Z_(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)!(e instanceof HTMLElement)||e.tagName.toLowerCase()!==`code`||(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Fh(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!Wv(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(ov(`merge`,e,t),this.setHydratedState(t),await $_(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){let l=rv(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName==null?e.name:e.prevName+`:`+e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!qv(u,this.deletionFile)||!qv(d,this.additionFile)),y=e!=null&&e!==this.fileDiff,b=i!=null&&(i.length>0||this.lineAnnotations.length>0)&&i!==this.lineAnnotations;if(!f&&d_(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&e===this.fileDiff||e==null&&!v))return this.applyCachedThemeState(p);let x;e==null&&_&&(v||this.fileDiff==null)&&(x=Fh(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;if(this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e==null?x!=null&&(y=!0,this.fileDiff=x):this.fileDiff=e,y&&(this.cachedHeaderHTML=void 0),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(pg(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:C=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,Nt);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g)&&this.applyPartialRender({previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(C)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,r=this.lineAnnotations,i=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(a=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(a,t,n,r,i)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||gv(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return Mm({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),e=>{this.editor=void 0,e!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=dg(e,this.hunksRenderer.getExpandedHunksMap(),t);return pg(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(fg(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let e=this.fileDiff?.cacheKey;e!=null&&n.cacheKey==null&&(n.cacheKey=e),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:r,lineCountChangeInFlight:i}=n;if(this.hunksRenderer.updateRenderCache(e,t,i)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return wm({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return Tm({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=ym(o);if(e<s){let c=bm({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=Cm({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=ym(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Ah(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||pm(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Hv(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}-${Tn(r)}`,a=this.annotationCache.get(i);if(a==null||!Vv(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:O_(Tn(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=k_();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:kg(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):kg(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=w_;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??dc(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderFilenameSuffix:o,renderHeaderMetadata:s}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,A,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let c=a?.(n)??void 0,l=o?.(n)??void 0,u=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Ie,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Dt,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,rt,u),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=A_(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=L_(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??B,s=typeof o==`string`?o:{...o},c=M_(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=W_({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:R_(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=z_(this.themeCSSStyle.textContent??``,M_(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Y_()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?U_(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Qv(t[0]),a=Qv(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=dc(i),r.content.innerHTML=dc(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=H_({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=H_({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=H_({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){if(this.options.diffStyle!==`split`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(t,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(t,e),i=Qv(r?.[0]),a=Qv(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};n(`deletions`,t[0]),n(`additions`,t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!==`unified`)return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST(`unified`,e),r=Qv(n?.[0]),i=Qv(n?.[1]),a=()=>{for(let[e,n]of[[t.gutter,r],[t.content,i]])n!=null&&(e.innerHTML=dc(n));e.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?U_(this.pre,a):a(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Qv(t[0]),i=Qv(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};T_(u,this.appliedPreAttributes)||(Q_(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 qv(e,t){return e==null||t==null?e==null&&t==null:Mn(e,t)}function Jv({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Yv({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Xv(e,t,n=!1){return!n&&e==null&&t}function Zv(e,t,n=!1){return e==null&&t&&!n}function Qv(e){if(e!=null&&e.type===`element`)return e.children??[]}var $v=3e3,ey=-1,ty=class extends Kv{__id=`little-virtualized-file-diff:${++ey}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=mm(n)}setMetrics(e,t=!1){let n=mm(e);!t&&Th(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||!jg(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=!Eh(t,e),r=n&&ly(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:uy(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&i&&Ng(this.renderRange)){let t=ny(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=my(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());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,r){let i=!dm(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=mm(n.metrics),o=!0,s=!0);let{collapsed:c=!1,expandUnchanged:l=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,o=!0),this.currentExpandUnchanged!==l&&(this.currentExpandUnchanged=l,o=!0,s=!0),o&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null||e<1)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=hm(this.metrics,r),d=this.getLayoutCheckpointBeforeLineIndex(l),f=d?.top??u+this.cache.fileAnnotationHeight;if(a)return{top:u,height:0};let p;return Mm({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=Am({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=jm({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}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}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??hm(this.metrics,t)+this.cache.fileAnnotationHeight,l;return Mm({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=Am({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=jm({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){let n=ov(`clone`,e,t);if(await $_(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(ov(`merge`,e,t),this.setHydratedState(t),await $_(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(e){let t=!1,n,{pendingExpansions:r,pendingHydratedDiff:i}=this;if(r!=null){this.pendingExpansions=void 0;for(let e of r)this.hunksRenderer.expandHunk(e.hunkIndex,e.direction,e.expansionLineCountOverride),t=!0}return i!=null&&(this.pendingHydratedDiff=void 0,i.expectedDiff===e&&(this.setHydratedState(i.files),n=i.nextDiff)),n==null?t&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)):(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})),n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return wm({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(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)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=hm(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=ev({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:dy(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=rv(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!py(s,this.deletionFile)||!py(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=Fh(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=this.syncLineAnnotations(r);p&&this.resetLayoutCache({includeEstimatedHeights:!1});let m=t!=null&&t!==this.fileDiff,h=u!=null&&!dm(this.fileDiff,u),g=m||l;if(h&&this.resetLayoutCache({includeEstimatedHeights:!0}),e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(f)this.top??=this.getVirtualizedTop(),h&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,u));else{this.computeApproximateSize(!1,u);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!g||!f))return this.fileDiff=u,a!=null&&(this.deletionFile=s,this.additionFile=c),h&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let _=this.virtualizer.getWindowSpecs(),v=this.top??0,y=this.computeRenderRangeFromWindow(u,v,_),b=super.render({fileDiff:u,fileContainer:e,renderRange:y,lineAnnotations:r,forceRender:(d??n)||p||h,...a,...i});return this.isSimpleMode()&&b&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),b}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type===`advanced`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return fy(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=dy(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=ry(this.cache.heightDeltas),u=hm(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=oy(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+sy(i,e)*this.metrics.lineHeight+iy(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=$v}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+iy(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=bm({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?Am({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?Cm({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?jm({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:cy({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=bm({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=Cm({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=dy(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=hm(this.metrics,i),h=e.hunks.length>0?_m(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,ee=C/s,w=ee,T=[],E=(n+r)/2,D=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),O=t+(D?.top??_),te=D?.renderedLineIndex??0,k,A,j;if(Mm({diff:e,diffStyle:l,startingLine:D?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?Am({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;O+=y;let b=te%s===0,x=Math.floor(te/s);if(b&&(T[x]=O-(t+_+y),j!=null)){if(j<=0)return!0;j--}let S=this.getLineHeight(l===`split`?m:h,g);if(O>n-S&&O<r&&(k??=x),A==null&&O+S>E&&(A=x),j==null&&O>=r&&b&&(j=w),te++,O+=S,c>0||v&&d){let e=jm({type:u,metrics:this.metrics});e!=null&&(O<r&&O+e.totalHeight>n&&(k??=x),A==null&&O+e.totalHeight>E&&(A=x),O+=e.totalHeight)}return!1}}),k==null){if(x)k=0,A=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}A??=k;let ne=Math.round(A-ee/2),re=Math.max(0,Math.ceil(p/s)-ee),ie=Math.max(0,Math.min(ne,re)),ae=ie*s,M=ne<0?C+ne*s:C,oe=T[ie]??0,se=ae===0?0:g+oe,N=ie+M/s,ce=N<T.length?v-T[N]:v-(O-t-_);return{startingLine:ae,totalLines:M,bufferBefore:se,bufferAfter:Math.max(0,ce)}}};function ny(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===Ag&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function ry(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 iy({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=ay(e,n);return(t[ay(e,r)]??0)-(t[i]??0)}function ay(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 oy(e){return Math.ceil(e/$v)*$v}function sy(e,t){let n=0;for(let r of e)r<t&&n++;return n}function cy({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 ly(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function uy(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function dy(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function fy(e){return typeof e==`function`?`custom`:e??`line-info`}function py(e,t){return e==null||t==null?e==null&&t==null:Mn(e,t)}function my(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function hy(e,t){return typeof window>`u`&&t!=null?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t}}),e]}):(0,H.jsx)(H.Fragment,{children:e})}var gy=(0,U.createContext)(void 0);function _y(){return(0,U.useContext)(gy)}var vy=typeof window>`u`?U.useEffect:U.useLayoutEffect;function yy({fileDiff:e,options:t,editorOptions:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:a,metrics:o,hasGutterRenderUtility:s,hasCustomHeader:c,disableWorkerPool:l,edit:u}){let d=_y(),f=i!==void 0,p=(0,U.useContext)(wh),m=xn(),h=(0,U.useRef)(null),g=vn(n=>{if(n!=null){if(h.current!=null)throw Error(`useFileDiffInstance: An instance should not already exist when a node is created`);d==null?h.current=new Kv(by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),l?void 0:p,!0):h.current=new ty(by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),d,o,l?void 0:p,!0),h.current.hydrate({fileDiff:e,fileContainer:n,lineAnnotations:r,prerenderedHTML:a})}else{if(h.current==null)throw Error(`useFileDiffInstance: A FileDiff instance should exist when unmounting`);h.current.cleanUp(),h.current=null}});return vy(()=>{let{current:n}=h;if(n==null)return;let a=by({controlledSelection:f,hasCustomHeader:c,hasGutterRenderUtility:s,options:t}),o=a!==void 0&&!Eh(n.options,a);n.setOptions(a),n.render({forceRender:o,fileDiff:e,lineAnnotations:r}),i!==void 0&&n.setSelectedLines(i)}),vy(()=>{if(u&&h.current!=null){if(m===void 0)throw Error(`FileDiff: EditContext is not attached`);let e=m(n??{});if(e==null)throw Error(`FileDiff: EditProvider.createEditor must return an editor instance`);try{return e.edit(h.current)}catch(t){throw e.cleanUp(),t}}},[u]),{ref:g,getHoveredLine:(0,U.useCallback)(()=>h.current?.getHoveredLine(),[])}}function by({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?wn:e?.renderCustomHeader,renderGutterUtility:r?wn:e?.renderGutterUtility}:e}var xy=U.createContext(void 0);function Sy(e){let t=U.useContext(xy);if(t===void 0&&!e)throw Error(qt(33));return t}var Cy=U.createContext(void 0);function wy(e){let t=U.useContext(Cy);if(t===void 0&&!e)throw Error(qt(36));return t}var Ty=U.createContext(void 0);function Ey(e=!0){let t=U.useContext(Ty);if(t===void 0&&!e)throw Error(qt(25));return t}var Dy=U.createContext(null);function Oy(e=`root`){let t=U.useContext(Dy),n=U.useContext(Cy);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var ky={visible:!0,ref:null};function Ay(){return ky}function jy(e,t,n=`root`){let r=Oy(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ay)({label:e.label,children:e.children,render:e.render}),a=ie(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var My=U.createContext(void 0);function Ny(){let e=U.useContext(My);if(e===void 0)throw Error(qt(30));return e}function Py(e){e.preventDefault()}function Fy(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=wy(),u=Ey(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return U.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Py:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:pt})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Ee&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&L(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Iy={type:`regular-item`};function Ly(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=U.useRef(null),{getButtonProps:d,buttonRef:f}=je({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Fy({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=U.useCallback(e=>oe(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=ie(u,f);return U.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ry=U.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function zy(){return U.useContext(Ry)}function By(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=zy(),u=U.useRef(-1),[d,f]=U.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=U.useRef(null),h=U.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Mt(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Vy=`data-checked`,Hy=`data-unchecked`,Uy={checked(e){return e?{[Vy]:``}:{[Hy]:``}},...p},Wy=U.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=wy(),m=By({guess:!0,label:a}),h=Tt(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:C}=Ly({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:Iy}),ee=U.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=S(pt,e.nativeEvent,void 0,{preventUnmountOnClose:E});u?.(!l,t)}let T=ot(`div`,e,{state:ee,stateAttributesMapping:Uy,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[C,t,m.ref]});return(0,H.jsx)(My.Provider,{value:ee,children:T})}),Gy=U.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=Ve({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=jy(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,H.jsx)(Wy,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),Ky=U.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Ny(),c=U.useRef(null),{transitionStatus:u,mounted:d,setMounted:f}=w(s.checked);l({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||f(!1)}});let p={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:u};return ot(`span`,e,{state:p,ref:[t,c],stateAttributesMapping:Uy,props:{"aria-hidden":!0,...o},enabled:a||d})}),qy=U.createContext(void 0);function Jy(){let e=U.useContext(qy);if(e===void 0)throw Error(qt(31));return e}var Yy=U.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Tt(a),c=Jy();return Mt(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),ot(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Xy=U.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=wy(),f=By({guess:!0,label:a}),p=Tt(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=Ly({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Iy});return ot(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Zy=U.forwardRef(function(e,t){let n=jy(e,t);return n.visible?(0,H.jsx)(Xy,{...e,ref:n.ref}):null}),Qy=Ee&&De;function $y(e,t={}){let{enabled:n=!0,delay:r}=t,{events:a,dataRef:o}=e.context,s=U.useRef(!1),c=U.useRef(null),l=U.useRef(!0),u=Jt();U.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=nt(t);function a(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&gt(t)&&t===se(i(t))&&(s.current=!0,c.current=t)}function o(){l.current=!0}function u(){l.current=!1}return Ht(he(r,`blur`,a),Qy&&he(r,`keydown`,o,!0),Qy&&he(r,`pointerdown`,u,!0))},[e,n]),U.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Fe(t)&&(c.current=t,s.current=!0)}}return a.on(`openchange`,t),()=>{a.off(`openchange`,t)}},[a,n,e]);let d=U.useMemo(()=>{function t(){s.current=!1,c.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(s.current){if(c.current===i)return;t()}let a=de(n.nativeEvent);if(Fe(a)){if(Qy&&!n.relatedTarget){if(!l.current&&!g(a))return}else if(!m(a))return}let o=zt(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;if(e.select(`open`)&&o||!r){e.setOpen(!0,S(Vt,d,f));return}u.start(r,()=>{s.current||e.setOpen(!0,S(Vt,d,f))})},onBlur(n){t();let r=n.relatedTarget,a=n.nativeEvent,s=Fe(r)&&r.hasAttribute(Je(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let t=e.select(`domReferenceElement`),n=se(i(t));!r&&n===t||ce(o.current.floatingContext?.refs.floating.current,n)||ce(t,n)||s||zt(r??n,e.context.triggerElements)||e.setOpen(!1,S(Vt,a))})}}},[o,r,e,u]);return U.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}function eb(e){return De&&e.movementX===0&&e.movementY===0}function tb(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function nb(e,t){return tb(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function rb(e,t,n){return tb(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function ib(e,t,n){return tb(t,n?e===lt:e===s,e===P)}function ab(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:tb(t,n?e===s:e===lt,e===st)}function ob(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:f=!1,virtual:p=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:_=!0,disabledIndices:v=void 0,orientation:b=`vertical`,triggerOrientation:x=b,parentOrientation:C,id:ee,resetOnPointerLeave:w=!0,externalTree:T,nestedReturnFocusRef:E,grid:O}=t,te=O!=null,k=e.useState(`open`),A=e.useState(`floatingElement`),j=e.useState(`domReferenceElement`),ne=e.context.dataRef,re=d(A),ie=ve(j),M=Be(re),oe=it(),N=Le(T),le=U.useRef(m),P=U.useRef(s??-1),F=U.useRef(null),ue=U.useRef(!0),I=V(e=>{a(P.current===-1?null:P.current,e)}),fe=U.useRef(!!A),L=U.useRef(k),pe=U.useRef(!1),me=U.useRef(!1),he=U.useRef(null),ge=Be(v),_e=Be(k),R=Be(s),ye=Be(w),be=Se(),xe=Se(),z=V(()=>{be.cancel();function e(e){p||(he.current=Ue(e,{sync:pe.current,preventScroll:!0}))}let t=n.current[P.current],r=me.current;t&&e(t),(pe.current?e=>e():e=>be.request(e))(()=>{let i=n.current[P.current]||t;i&&(t||e(i),De&&(r||!ue.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Mt(()=>{ne.current.orientation=b},[ne,b]),Mt(()=>{k||(F.current=null),(!k||m!==`auto`)&&(le.current=m)},[k,m]),Mt(()=>{o&&(k&&A?(P.current=s??-1,le.current&&s!=null&&(me.current=!0,I())):fe.current&&(P.current=-1,I()))},[o,k,A,s,I]),Mt(()=>{if(o){if(!k){pe.current=!1;return}if(A){if(r==null){if(pe.current=!1,R.current!=null)return;if(fe.current&&(P.current=-1,z()),(!L.current||!fe.current)&&le.current&&(F.current!=null||le.current===!0&&F.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>xe.request(e):queueMicrotask)(t),e+=1):(P.current=F.current==null||rb(F.current,x,f)||u?mt(n):xt(n),F.current=null,I())};t()}}else Pe(n.current,r)||(P.current=r,z(),me.current=!1)}}},[o,k,A,r,R,u,n,x,f,I,z,xe]),Mt(()=>{if(!o||A||!N||p||!fe.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===oe)?.context?.elements.floating,n=se(i(j??t??null)),r=e.some(e=>e.context&&ce(e.context.elements.floating,n));t&&!r&&ue.current&&t.focus({preventScroll:!0})},[o,A,j,N,oe,p]),Mt(()=>{L.current=k,fe.current=!!A});let Ce=r!=null,we=V(e=>{if(!_e.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(P.current!==t||r!==t)&&(P.current=t,I(e))}),Te=V(()=>C??N?.nodesRef.current.find(e=>e.id===oe)?.context?.dataRef?.current.orientation),Ee=V(()=>mt(n,ge.current)),B=V(t=>{if(ue.current=!1,pe.current=!0,t.which===229||!_e.current&&t.currentTarget===M.current)return;if(u&&ab(t.key,b,f,te)){nb(t.key,Te())||ae(t),e.setOpen(!1,S(Xe,t.nativeEvent));let n=E?.current??j;gt(n)&&n.focus();return}r!=null&&r!==P.current&&!Pe(n.current,r)&&(P.current=r);let i=P.current,a=mt(n,v),o=xt(n,v);if(ie||(t.key===`Home`&&(ae(t),P.current=a,I(t)),t.key===`End`&&(ae(t),P.current=o,I(t))),O!=null){let e=O(t,P.current,n,b,l,f,v,a,o);if(e!=null&&e!==P.current&&(P.current=e,I(t)),b===`both`)return}if(nb(t.key,b)){ae(t);let e=se(t.currentTarget.ownerDocument);if(k&&!p&&ce(t.currentTarget,e)&&!n.current.some(t=>t!=null&&ce(t,e))){P.current=rb(t.key,b,f)?a:o,I(t),r===P.current&&z();return}let{index:s,wrapped:u}=tt(n.current,i,{decrement:!rb(t.key,b,f),loopFocus:l,allowEscape:c,disabledIndices:v,minIndex:a,maxIndex:o});u&&(pe.current=!1),P.current=s,I(t)}}),De=U.useMemo(()=>({onFocus(e){pe.current=!0,we(e)},onClick({currentTarget:e}){p||e.focus({preventScroll:!0})},onMouseMove(e){eb(e)||(pe.current=!0,me.current=!1,h&&we(e))},onPointerLeave(e){if(!_e.current||!ue.current||e.pointerType===`touch`)return;pe.current=!0;let t=e.relatedTarget;if(!(!h||n.current.includes(t))&&ye.current&&(he.current?.(),he.current=null,P.current=-1,I(e),!p)){let e=M.current,t=se(i(e));e&&ce(e,t)&&e.focus({preventScroll:!0})}}}),[we,_e,M,h,n,I,ye,p]),Oe=U.useMemo(()=>p&&k&&Ce&&{"aria-activedescendant":`${ee}-${r}`},[p,k,Ce,ee,r]),ke=U.useMemo(()=>({...ie?{}:Oe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&k&&!p){let n=de(t.nativeEvent);if(n&&!ce(M.current,n))return;ae(t);let r=S(qe,t.nativeEvent);e.setOpen(!1,r);let i=E?.current??j;!r.isCanceled&&gt(i)&&i.focus();return}B(t)},onPointerMove(e){eb(e)||(ue.current=!0)}}),[Oe,B,M,ie,e,k,p,j,E]),Ae=U.useMemo(()=>{function t(t){e.setOpen(!0,S(Xe,t.nativeEvent,t.currentTarget))}function n(e){m===`auto`&&y(e.nativeEvent)&&(le.current=!p)}function r(e){le.current=m,m===`auto`&&D(e.nativeEvent)&&(le.current=!0)}return{onKeyDown(n){let r=e.select(`open`);ue.current=!1;let i=n.key.startsWith(`Arrow`),a=ib(n.key,Te(),f),o=nb(n.key,r?b:x),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(p&&r&&(!u||g(n.currentTarget)))return B(n);if(!(!r&&!_&&i)){if(s){let e=nb(n.key,Te());F.current=u&&e?null:n.key}if(u){a&&(ae(n),r?(P.current=Ee(),I(n),p&&M.current?.focus()):t(n));return}o&&(R.current!=null&&(P.current=R.current),ae(n),!r&&_?t(n):B(n),r&&I(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!p&&(P.current=-1,I(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[B,m,Ee,u,I,e,_,b,x,Te,f,R,p,M]),je=U.useMemo(()=>({...Oe,...Ae}),[Oe,Ae]);return U.useMemo(()=>o?{reference:je,floating:ke,item:De,trigger:Ae}:{},[o,je,ke,Ae,De])}function sb(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=V(s),f=e.useState(`open`),p=Jt(),m=U.useRef(``),h=U.useRef(u??i??-1),g=U.useRef(null),_=V(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Ze(n)||n?.matches(`:disabled`)?!1:o==null||!It(ue,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!s(n)))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(ae(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(ae(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=V(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);ce(r,n)||ce(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Mt(()=>{!f&&u!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=U.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return U.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var cb=U.createContext(void 0);function lb(){return U.useContext(cb)}function ub(e,t){let n=o(e.render);if(U.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function db(e,t,n){let r=ub(e,t),i=r===t?void 0:r;return[r,U.useCallback(e=>n?.(e?i:void 0),[i,n])]}function fb(e,t,n){let r=o(e.render),i=U.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],s=e[`aria-labelledby`]??i?.[`aria-labelledby`];return s==null&&!a&&(s=t?t.id||void 0:n||void 0),s}var pb=U.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:u,defaultFloatingId:d,setRenderedFloatingId:p,virtualFocus:m,orientation:g}=wy(),_=lb(),{side:v,align:y}=Sy(),b=le(!0)!=null,x=u.useState(`open`),C=u.useState(`transitionStatus`),ee=u.useState(`popupProps`),w=u.useState(`mounted`),T=u.useState(`instantType`),E=u.useState(`activeTriggerElement`),D=u.useState(`parent`),O=u.useState(`lastOpenChangeReason`),te=u.useState(`rootId`),k=u.useState(`floatingRootContext`),A=u.useState(`floatingTreeRoot`),j=u.useState(`closeDelay`),ne=u.useState(`hoverEnabled`),re=u.useState(`disabled`),ie=u.useState(`openMethod`),ae=u.useState(`activeTriggerId`),M=u.useState(`listElement`),[oe,se]=db(e,d,p),N=fb(e,E,ae),ce=D.type===`menu`?_:void 0,P=D.type===`context-menu`,F=s??D.type!==`menu`;s===void 0&&M&&D.type!==`menu`&&(F=()=>u.state.activeIndex===null&&M),l({open:x,ref:u.context.popupRef,onComplete(){x&&u.context.onOpenChangeComplete?.(!0)}}),U.useEffect(()=>{function e(e){u.setOpen(!1,S(e.reason,e.domEvent))}return A.events.on(`close`,e),()=>{A.events.off(`close`,e)}},[A.events,u]),at(k,{enabled:ne&&!re&&!P&&D.type!==`menubar`,closeDelay:j});let ue=u.useStateSetter(`popupElement`),{parentVirtualFocusRef:de,handleFocus:I}=(U.useContext(Dy)?.useParentHandoff??hb)(u,D,x,m),fe={transitionStatus:C,side:v,align:y,open:x,nested:D.type===`menu`,instant:T},L=ot(`div`,e,{state:fe,ref:[t,u.context.popupRef,ue,se],stateAttributesMapping:Rt,props:[ee,{id:oe,...M?{role:`presentation`}:{role:`menu`,"aria-orientation":g===`horizontal`?`horizontal`:void 0,"aria-labelledby":N},onKeyDown(e){ce?.onPopupKeyDown?.(e),b&&f.has(e.key)&&e.stopPropagation()},onFocus:I},h(C),c,{"data-rootownerid":te}]}),pe=D.type===void 0||P;(E||D.type===`menubar`&&O!==`outside-press`)&&(pe=!0);let me=ce?.getReturnElement??de;return(0,H.jsx)(Ke,{context:k,openInteractionType:ie,modal:P,disabled:!w,returnFocus:a??me??pe,explicitReturnFocus:a===void 0&&me?!1:void 0,initialFocus:F,restoreFocus:!0,getInsideElements:D.type===void 0?()=>[u.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:D.type===`menubar`?void 0:A,previousFocusableElement:E,nextFocusableElement:D.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:L})}),mb={parentVirtualFocusRef:void 0,handleFocus:void 0};function hb(){return mb}var gb=U.forwardRef(function(e,t){let n=Oy()?.Popup??pb;return(0,H.jsx)(n,{...e,ref:t})}),_b=U.createContext(void 0);function vb(){let e=U.useContext(_b);if(e===void 0)throw Error(qt(32));return e}var yb=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=wy();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,H.jsx)(_b.Provider,{value:n,children:(0,H.jsx)(jt,{ref:t,...r,portalOwnerRole:o})})});function bb(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=V(i),[,o]=U.useState(0),s=pe(Sb).current,c=pe(xb).current,l=U.useRef(0),u=U.useRef(!0),d=U.useRef(null),f=U.useRef(null),p=V(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=V((e,t)=>{c.set(e,t),p()}),h=V(e=>{c.delete(e),p()}),g=V(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!Tb(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Eb(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=wb(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=V(()=>{let[e,t]=Cb(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Mt(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Mt(()=>{u.current&&v()}),Mt(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=V(e=>(s.add(e),()=>{s.delete(e)})),b=U.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,H.jsx)(Ry.Provider,{value:b,children:t})}function xb(){return new Map}function Sb(){return new Set}function Cb(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Eb(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function wb(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function Tb(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Eb(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Db=U.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=dt,style:_,...v}=e,{store:y,virtualFocus:b,syncHighlightedItem:x}=wy(),C=vb(),ee=Ey(!0),w=y.useState(`parent`),T=y.useState(`floatingRootContext`),E=y.useState(`floatingTreeRoot`),D=y.useState(`mounted`),O=y.useState(`open`),te=y.useState(`modal`),k=y.useState(`openMethod`),A=y.useState(`activeTriggerElement`),j=y.useState(`transitionStatus`),ne=y.useState(`positionerElement`),re=y.useState(`instantType`),ie=y.useState(`adaptiveOrigin`),ae=y.useState(`lastOpenChangeReason`),M=y.useState(`floatingNodeId`),oe=y.useState(`floatingParentNodeId`),se=T.useState(`domReferenceElement`),N=n,ce=c,le=l,P=s,F=g;w.type===`context-menu`&&(N=n??w.context?.anchor,P??=`start`,!o&&P!==`center`&&(le=e.alignOffset??2,ce=e.sideOffset??-5));let ue=o,de=P;w.type===`menu`?(ue??=`inline-end`,de??=`start`,F=e.collisionAvoidance??Ft):w.type===`menubar`&&(ue??=w.context.orientation===`vertical`?`inline-end`:`bottom`,de??=`start`);let I=w.type===`context-menu`,fe=u({anchor:N,floatingRootContext:T,positionMethod:ee?`fixed`:r,mounted:D,side:ue,sideOffset:ce,align:de,alignOffset:le,arrowPadding:I?0:p,collisionBoundary:d,collisionPadding:f,sticky:m,nodeId:M,keepMounted:C,disableAnchorTracking:h,collisionAvoidance:F,shift:I?{crossAxis:!(`side`in F&&F.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:E,adaptiveOrigin:ie,lazyFlip:b?`placement`:!1});U.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===M&&y.set(`hoverEnabled`,!1),e.nodeId!==M&&e.parentNodeId===y.select(`floatingParentNodeId`)&&y.setOpen(!1,S(ze)))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[y,E.events,M]),U.useEffect(()=>{if(y.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==y.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;y.setOpen(!1,S(t))}return E.events.on(`menuopenchange`,e),()=>{E.events.off(`menuopenchange`,e)}},[E.events,y]);let L=Jt();U.useEffect(()=>{O||L.clear()},[O,L]),U.useEffect(()=>{function e(e){if(!(!O||e.nodeId!==y.select(`floatingParentNodeId`))){if(e.target&&A&&A!==e.target){let e=y.select(`closeDelay`);e>0?L.isStarted()||L.start(e,()=>{y.setOpen(!1,S(ze))}):y.setOpen(!1,S(ze))}else L.clear()}}return E.events.on(`itemhover`,e),()=>{E.events.off(`itemhover`,e)}},[E.events,O,A,y,L]),U.useEffect(()=>{let e={open:O,nodeId:M,parentNodeId:oe,reason:y.select(`lastOpenChangeReason`)};E.events.emit(`menuopenchange`,e)},[E.events,O,y,M,oe]),Bt({store:y,domReference:se,positionerElement:ne,open:O});let pe={open:O,side:fe.side,align:fe.align,anchorHidden:fe.anchorHidden,nested:w.type===`menu`,instant:re},he=w.type===`menubar`&&w.context.modal;Ut(O&&(he||te&&ae!==`trigger-hover`),k===`touch`,ne,A);let _e=Re(e,pe,{styles:fe.positionerStyles,transitionStatus:j,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!D,inert:!O}),ve=D&&w.type!==`menu`&&(w.type!==`menubar`&&te&&ae!==`trigger-hover`||w.type===`menubar`&&w.context.modal),R=null;return w.type===`menubar`?R=w.context.contentElement:w.type===void 0&&(R=A),(0,H.jsxs)(xy.Provider,{value:fe,children:[ve&&(0,H.jsx)(me,{ref:w.type===`context-menu`||w.type===`nested-context-menu`?w.context.internalBackdropRef:null,inert:ge(!O),cutout:R}),(0,H.jsx)(Pt,{id:M,children:(0,H.jsx)(bb,{elementsRef:y.context.itemDomElements,labelsRef:y.context.itemLabels,onMapChange:x,children:_e})})]})}),Ob=U.createContext(null);function kb(e){let t=U.useContext(Ob);if(t===null&&!e)throw Error(qt(5));return t}function Ab(e){return e==null?Ne:e.type.startsWith(`key`)?et:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?Wt:Ne}var jb={...F,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=F.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>De&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!F.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Mb=class extends _{constructor(e,t,n=!1){let r=new Kt,i=Pb(r,t,n,e);super(i,Nb(r),jb),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Nb(e){return{positionerRef:U.createRef(),popupRef:U.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:U.createRef(),beforeTriggerFocusGuardRef:U.createRef(),beforeContentFocusGuardRef:U.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Pb(e,t,n=!1,r){return{...N(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:v,inputProps:v,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new vt,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:v,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var Fb=U.createContext(null);function Ib(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Lb(e,t){return e===`list-navigation`||Ib(e,t)}var Rb=T(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:l,loopFocus:u=!0,orientation:d=`vertical`,actionsRef:f,closeParentOnEsc:p=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:_=!0,isSubmenu:y=!1,virtualFocus:x=!1,virtualFocusRef:ee,allowEscape:w=!0,resetOnPointerLeave:T=!0}=e,E=Ey(!0),D=wy(!0),O=kb(!0),te=D?.store,A=D?.virtualFocus??!1,j=U.useMemo(()=>y&&te?{type:`menu`,store:te}:O?{type:`menubar`,context:O}:E&&!te?{type:`context-menu`,context:E}:{type:void 0},[E,te,O,y]),re=Tt(),ie=Tt(),[ae,M]=U.useState(void 0),se=(ae??ie)||void 0,N=it(),ce=j.type===`menu`?j.store:void 0,le=(n??o)&&ce?.state.transitionStatus===`starting`,P=pe(()=>le?ce?.state.instantType:void 0).current,F=pe(()=>{let e=new Mb({open:o,openProp:n,activeTriggerId:g,triggerIdProp:h,parent:j,disabled:s,highlightItemOnHover:_,modal:j.type===void 0?l:void 0,rootId:re,instantType:P},se,N!=null);return e.context.virtualFocusRef=ee,e}).current;F.useControlledProp(`openProp`,n),F.useControlledProp(`triggerIdProp`,h),F.useContextCallback(`onOpenChangeComplete`,i);let de=F.useState(`floatingTreeRoot`),fe=Ot(de),L=F.useState(`open`),me=F.useState(`activeTriggerElement`),he=F.useState(`positionerElement`),ge=F.useState(`hoverEnabled`),_e=F.useState(`disabled`),ve=F.useState(`lastOpenChangeReason`),R=F.useState(`parent`),z=F.useState(`activeIndex`),Se=F.useState(`keyboardOpen`),Ce=F.useState(`payload`),we=F.useState(`floatingParentNodeId`),Te=U.useRef(null),Ee=U.useRef(R.type!==`context-menu`),B=Jt(),De=U.useRef(!0),ke=Jt(),Ae=we!=null,{openMethod:je,triggerProps:Pe}=Me(L);F.useSyncedValues({disabled:s,highlightItemOnHover:_,modal:R.type===void 0?l:void 0,openMethod:je,rootId:re}),b(F);let{forceUnmount:Fe,transitionStatus:Ie}=k(L,F,()=>{F.set(`allowMouseEnter`,!1)},le),Le=be(F.context.popupRef);U.useEffect(()=>{if(P===void 0)return;let e=()=>{F.state.instantType===P&&F.set(`instantType`,void 0)};if(!L){e();return}if(Ie!==void 0)return;if(F.context.popupRef.current==null){e();return}let t=new AbortController;return Le(e,t.signal),()=>{t.abort()}},[P,L,Ie,Le,F]),Mt(()=>{E&&!D?F.update({parent:{type:`context-menu`,context:E},floatingNodeId:fe,floatingParentNodeId:N}):(D||!F.select(`activeTriggerElement`))&&F.update({floatingNodeId:fe,floatingParentNodeId:N})},[E,D,fe,N,me,F]),U.useEffect(()=>{if(L||(Te.current=null),R.type===`context-menu`){if(!L){B.clear(),Ee.current=!1;return}B.start(500,()=>{Ee.current=!0})}},[B,L,R.type]),Mt(()=>{!L&&!ge&&F.set(`hoverEnabled`,!0)},[L,ge,F]);let Re=V((e,t)=>{let n=t.reason;if(!e&&!F.select(`open`)||L===e&&t.trigger===me&&ve===n)return;let i=C(t);if(!e&&t.trigger==null&&(t.trigger=me??void 0),r?.(e,t),t.isCanceled)return;F.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!De.current)return;e&&n===`trigger-focus`?(De.current=!1,ke.start(300,()=>{De.current=!0})):(De.current=!0,ke.clear());let o=!e&&(n===`escape-key`||n==null);Te.current=t.event;let s=xe(F.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Lb(n,a),s.instantType=R.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Ib(n,a)?`click`:o?`dismiss`:void 0,F.update(s)}),ze=Oe({popupStore:F,floatingRootContext:F.state.floatingRootContext,floatingId:se,nested:N!=null,onOpenChange:Re}),Be=ze.context.events;Mt(()=>{let e=({open:e,eventDetails:t})=>Re(e,t);return Be.on(`setOpen`,e),()=>{Be?.off(`setOpen`,e)}},[Be,Re]),Mt(()=>F.subscribeToParentMenu(),[F]);let Ve=U.useCallback(()=>{F.setOpen(!1,S(bt))},[F]);U.useImperativeHandle(f,()=>({unmount:Fe,close:Ve}),[Fe,Ve]);let He;R.type===`context-menu`&&(He=R.context),U.useImperativeHandle(He?.positionerRef,()=>he,[he]),U.useImperativeHandle(He?.actionsRef,()=>({setOpen:Re}),[Re]);let Ue=I(ze,{enabled:!_e,bubbles:{escapeKey:p&&R.type===`menu`},outsidePress(){return R.type!==`context-menu`||Te.current?.type===`contextmenu`||Ee.current},externalTree:Ae?de:void 0}),We=Lt(),Ge=ob(ze,{enabled:!_e,listRef:F.context.itemDomElements,activeIndex:z,virtual:x,nested:R.type===`menubar`||!x&&R.type!==void 0,parentOrientation:R.type===`menubar`?R.context.orientation:void 0,loopFocus:u,focusItemOnOpen:x?Se:void 0,allowEscape:x&&u&&w,orientation:d,triggerOrientation:x?`vertical`:d,rtl:We===`rtl`,disabledIndices:ue,onNavigate(e,t){F.setActiveIndex(e,Ab(t),t?.nativeEvent)},openOnArrowKeyDown:R.type!==`context-menu`&&!(x&&y),externalTree:!x&&Ae?de:void 0,nestedReturnFocusRef:ce?.context.virtualFocusRef,focusItemOnHover:_,resetOnPointerLeave:T}),Ke=U.useCallback(e=>{F.context.typingRef.current=e},[F]),qe=sb(ze,{enabled:!_e&&!x,listRef:F.context.itemLabels,elementsRef:F.context.itemDomElements,activeIndex:z,resetMs:500,onMatch:(e,t)=>{L&&e!==z&&F.setActiveIndex(e,et,t.nativeEvent)},onTyping:Ke}),Je=V(a),Ye=U.useRef(-1),Xe=V(()=>{let e=F.state.activeIndex,t=e===null?void 0:F.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ye.current===n&&F.context.reportedItem===t)return;Ye.current=n,F.context.reportedItem=t,x&&F.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=F.context;F.context.highlightReason=Ne,F.context.highlightEvent=void 0,a&&Je(t,ne(r,i,{label:t===void 0?void 0:F.context.itemLabels.current[n]??void 0}))});Mt(()=>{Xe()},[z,Xe]);let Ze=U.useMemo(()=>{if(!x)return Ge.reference;if(!Ge.trigger)return v;let{onFocus:e,...t}=Ge.trigger;return t},[x,Ge.reference,Ge.trigger]);F.useSyncedValue(`inputProps`,x?Ge.reference??v:v);let Qe=U.useMemo(()=>{let e=oe(qe.reference,Ze,Ue.reference,{onMouseMove(){F.set(`allowMouseEnter`,!0)}},Pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=L,e},[F,qe.reference,Ze,Ue.reference,Pe,L]),$e=U.useMemo(()=>{let e=oe(Ge.trigger,Ue.trigger,Pe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ge.trigger,Ue.trigger,Pe]);pe(()=>(F.update({inactiveTriggerProps:$e}),null));let tt=U.useMemo(()=>oe(c,{onMouseMove(){F.set(`allowMouseEnter`,!0),R.type===`menu`&&F.set(`hoverEnabled`,!1)},onClick(){F.select(`hoverEnabled`)&&F.set(`hoverEnabled`,!1)},onKeyDown(e){let t=F.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},qe.floating,Ge.floating,Ue.floating),[R.type,F,qe.floating,Ge.floating,Ue.floating]),nt=Ge.item??v;St(F,{floatingRootContext:ze,activeTriggerProps:Qe,inactiveTriggerProps:$e,popupProps:tt,itemProps:nt});let rt=U.useMemo(()=>({store:F,parent:j,orientation:d,loopFocus:u,allowEscape:w,defaultFloatingId:ie,setRenderedFloatingId:M,virtualFocus:x,parentVirtualFocus:A,syncHighlightedItem:Xe}),[F,j,d,u,w,ie,x,A,Xe]),at=typeof t==`function`?t({payload:Ce}):t,ot=(0,H.jsxs)(Cy.Provider,{value:rt,children:[m&&(0,H.jsx)(ye,{handle:m,store:F}),at]});return(R.type===void 0||R.type===`context-menu`)&&(ot=(0,H.jsx)(ht,{externalTree:de,children:ot})),ot});function zb(e){let t=U.useContext(Fb);if(t===null)return(0,H.jsx)(Rb,{...e});let n=t.Root;return(0,H.jsx)(Fb.Provider,{value:null,children:(0,H.jsx)(n,{...t.options,...e})})}var Bb=5;function Vb(e,t){let n=Hb(t);return e.clientX>=n.left-Bb&&e.clientX<=n.right+Bb&&e.clientY>=n.top-Bb&&e.clientY<=n.bottom+Bb}function Hb(e){let t=e.getBoundingClientRect(),n=nt(e);if(te)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Ub(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=We(),{ref:i,index:a}=By(e),o=n===a,s=U.useRef(null),c=ie(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function Wb(e){let{render:t,className:n,style:r,state:i=v,props:a=ue,refs:o=ue,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Ub({metadata:s});return ot(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function Gb(e){if(gt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!kt(e))return Gb(Et(e))}function Kb(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,a=U.useRef(!1);return U.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(a.current=!0,i(e.currentTarget).addEventListener(`click`,()=>{a.current=!1},{once:!0}))},onClick:e=>{a.current&&(a.current=!1,e.preventBaseUIHandler())}}:v,[t,n,r])}var qb=re(function(e,t){let{render:r,className:o,style:s,disabled:c=!1,nativeButton:l=!0,id:u,openOnHover:d,delay:f=100,closeDelay:p=0,handle:m,payload:h,...g}=e,_=wy(!0),y=M(m)??_?.store;if(!y)throw Error(qt(85));let b=Tt(u),x=y.useState(`isTriggerActive`,b),S=y.useState(`floatingRootContext`),C=y.useState(`isOpenedByTrigger`,b),ee=y.useState(`triggerControlsId`,b),w=U.useRef(null),T=Yb(),E=We(!0),D=Le(),O=U.useMemo(()=>D??new vt,[D]),te=Ot(O),k=it(),{registerTrigger:A,isMountedByThisTrigger:j}=Ce(b,w,y,{payload:h,closeDelay:p,parent:T,floatingTreeRoot:O,floatingNodeId:te,floatingParentNodeId:k,keyboardEventRelay:E?.relayKeyboardEvent}),ne=T.type===`menubar`,re=y.useState(`disabled`),ie=c||re||ne&&T.context.disabled,{getButtonProps:ae,buttonRef:se}=je({disabled:ie,native:l});U.useEffect(()=>{!C&&T.type===void 0&&(y.context.allowMouseUpTriggerRef.current=!1)},[y,C,T.type]);let N=U.useRef(null),le=Jt(),P=V(e=>{if(!N.current)return;le.clear(),y.context.allowMouseUpTriggerRef.current=!1;let t=e.target;ce(N.current,t)||ce(y.select(`positionerElement`),t)||t===N.current||(t==null||Gb(t)!==y.select(`rootId`))&&(Vb(e,N.current)||O.events.emit(`close`,{domEvent:e,reason:ut}))});U.useEffect(()=>{let e=i(N.current);if(C&&y.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,P,{once:!0}),()=>{e.removeEventListener(`mouseup`,P)}},[C,P,y]);let F=ne&&T.context.hasSubmenuOpen,ue=a(S,{enabled:(d??F)&&!ie&&(!ne||F&&!j),handleClose:ct({blockPointerEvents:!ne}),mouseOnly:!0,move:!1,restMs:T.type===void 0?f:void 0,delay:{close:p},triggerElementRef:w,externalTree:O,isActiveTrigger:x,isClosing:()=>y.select(`transitionStatus`)===`ending`}),de=Jb(C,y.select(`lastOpenChangeReason`)),I=n(S,{enabled:!ie,event:C&&ne?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:T.type===void 0&&de}),fe=$y(S,{enabled:!ie&&F}),L=Kb({open:C,enabled:ne,mouseDownAction:`open`}),pe=U.useMemo(()=>oe(fe.reference,I.reference),[fe.reference,I.reference]),me=y.useState(`triggerProps`,j),he=y.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ge,handleFocusTargetFocus:ve}=Ye(y,w),R={disabled:ie,open:C},ye=[N,t,se,A,w],be=[pe,ue??v,me,{"aria-haspopup":`menu`,"aria-controls":ee,id:b,onMouseDown:e=>{y.select(`open`)||(le.start(200,()=>{y.context.allowMouseUpTriggerRef.current=!0}),i(e.currentTarget).addEventListener(`mouseup`,P,{once:!0}))}},he,ne?{role:`menuitem`}:{},L,g,ae],xe=ot(`button`,e,{enabled:!ne,stateAttributesMapping:_e,state:R,ref:ye,props:be});return ne?(0,H.jsx)(Wb,{tag:`button`,render:r,className:o,style:s,state:R,refs:ye,props:be,stateAttributesMapping:_e}):C?(0,H.jsxs)(U.Fragment,{children:[(0,H.jsx)(Gt,{ref:y.context.beforeTriggerFocusGuardRef,onFocus:ge},`${b}-pre-focus-guard`),(0,H.jsx)(U.Fragment,{children:xe},b),(0,H.jsx)(Gt,{ref:y.context.triggerFocusTargetRef,onFocus:ve},`${b}-post-focus-guard`)]}):(0,H.jsx)(U.Fragment,{children:xe},b)});function Jb(e,t){let n=Jt(),[r,i]=U.useState(!1);return Mt(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Yb(){let e=kb(!0);return U.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var Xb=U.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return ot(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),Zb=(0,U.createContext)(null);function Qb({actionsRef:e,children:t,interactionOwner:n=`local`,onOpenChange:r,...i}){let a=(0,U.useRef)(null),o=e??a;return yt(()=>o.current?.close()),(0,H.jsx)(Zb.Provider,{value:{actionsRef:o,interactionOwner:n},children:(0,H.jsx)(zb,{...i,actionsRef:o,onOpenChange:(e,t)=>{if(n===`host`&&!e&&t.reason===`escape-key`){t.cancel(),t.allowPropagation();return}r?.(e,t)},children:t})})}function $b(){let e=(0,U.useContext)(Zb);if(!e)throw Error(`DropdownMenu parts must be used inside <DropdownMenu>`);return e}var ex=(0,U.forwardRef)(function({className:e,render:t,type:n=`button`,...r},i){return(0,H.jsx)(qb,{...r,className:t=>j(`btn caps-dropdown-trigger`,wt(e,t)),ref:i,render:t,type:n})}),tx=(0,U.forwardRef)(function({container:e,...t},n){let r=ft(`popover`);return e==null&&r===null?null:(0,H.jsx)(yb,{...t,container:e??r,ref:n})}),nx=(0,U.forwardRef)(function({className:e,collisionBoundary:t,...n},r){let i=ft(`popover`);return(0,H.jsx)(Db,{...n,className:t=>j(`z-(--stipe-layer-popover)`,wt(e,t)),collisionBoundary:t??(i&&i!==document.body?i:void 0),ref:r})}),rx=(0,U.forwardRef)(function({className:e,finalFocus:t,...n},r){let{interactionOwner:i}=$b(),a=(0,U.useRef)(null);(0,U.useImperativeHandle)(r,()=>a.current);let o=Qe(`.caps-dropdown-item[data-highlighted]`),s=(0,U.useCallback)(e=>{a.current=e,o(e)},[o]);return(0,H.jsx)(gb,{...n,className:t=>j(`caps-dropdown-popup min-w-40 rounded-box border border-base-300 bg-base-100 p-xs shadow-lg outline-none`,wt(e,t)),finalFocus:i===`host`?!1:t??!0,ref:s})}),ix=(0,U.forwardRef)(function({align:e=`end`,alignOffset:t,children:n,container:r,keepMounted:i,side:a=`bottom`,sideOffset:o=4,...s},c){return(0,H.jsx)(tx,{container:r,keepMounted:i,children:(0,H.jsx)(nx,{align:e,alignOffset:t,side:a,sideOffset:o,children:(0,H.jsx)(rx,{...s,ref:c,children:n})})})}),ax=`caps-dropdown-item flex min-h-2xl w-full items-center gap-sm rounded-field px-md py-xs text-left text-sm outline-none transition-colors hover:bg-base-200 focus-visible:bg-base-200 aria-[current=page]:bg-base-200 aria-[current=page]:font-semibold disabled:cursor-not-allowed disabled:text-base-content/40 data-disabled:cursor-not-allowed data-disabled:text-base-content/40`,ox=(0,U.forwardRef)(function({className:e,onClick:t,onSelect:n,variant:r=`default`,...i},a){return(0,H.jsx)(Zy,{...i,className:t=>j(ax,r===`destructive`&&`text-error hover:bg-error hover:text-error-content focus-visible:bg-error focus-visible:text-error-content`,wt(e,t)),onClick:e=>{t?.(e),e.defaultPrevented||n?.(e)},ref:a})}),sx=(0,U.forwardRef)(function({children:e,className:t,onClick:n,onSelect:r,...i},a){return(0,H.jsxs)(Gy,{...i,className:e=>j(ax,wt(t,e)),onClick:e=>{n?.(e),e.defaultPrevented||r?.(e)},ref:a,children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,H.jsx)(Ky,{"aria-hidden":`true`,className:`shrink-0`,children:`✓`})]})}),cx=(0,U.forwardRef)(function({className:e,...t},n){return(0,H.jsx)(Xb,{...t,className:t=>j(`my-xs h-px bg-base-300`,wt(e,t)),ref:n})});(0,U.forwardRef)(function({className:e,...t},n){return(0,H.jsx)(Yy,{...t,className:t=>j(`px-md pb-xs pt-sm text-xs font-semibold text-base-content/60`,wt(e,t)),ref:n})});export{_m as $,g_ as A,Sn as At,Ag as B,on as Bt,k_ as C,Sa as Ct,C_ as D,jn as Dt,w_ as E,Mn as Et,d_ as F,pn as Ft,Fh as G,Qt as Gt,jg as H,dn as Ht,r_ as I,_n as It,Eh as J,jh as K,$t as Kt,Lg as L,hn as Lt,m_ as M,bn as Mt,p_ as N,xn as Nt,x_ as O,kn as Ot,f_ as P,vn as Pt,hm as Q,Rg as R,gn as Rt,A_ as S,mi as St,T_ as T,Wn as Tt,Ng as U,un as Ut,Mg as V,ln as Vt,kg as W,nn as Wt,wh as X,Th as Y,mm as Z,V_ as _,wp as _t,cx as a,em as at,L_ as b,vp as bt,_y as c,tm as ct,Z_ as d,Up as dt,um as et,J_ as f,Bp as ft,H_ as g,$ as gt,U_ as h,Op as ht,ox as i,nm as it,h_ as j,wn as jt,v_ as k,Tn as kt,hy as l,Jp as lt,W_ as m,kp as mt,sx as n,Xp as nt,ex as o,Qp as ot,Y_ as p,Ap as pt,Ah as q,en as qt,ix as r,Yp as rt,yy as s,Zp as st,Qb as t,cm as tt,Q_ as u,$p as ut,z_ as v,xp as vt,O_ as w,W as wt,M_ as x,dc as xt,R_ as y,yp as yt,Ig as z,cn as zt};