diffs-pane 0.1.0 → 0.2.0

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.
@@ -15,9 +15,9 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuF
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Ay;function Ix(){if(Ay)return Me;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,A={};function k(M,q,re){this.props=M,this.context=q,this.refs=A,this.updater=re||S}k.prototype.isReactComponent={},k.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=k.prototype;function T(M,q,re){this.props=M,this.context=q,this.refs=A,this.updater=re||S}var L=T.prototype=new E;L.constructor=T,w(L,k.prototype),L.isPureReactComponent=!0;var O=Array.isArray;function D(){}var N={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function G(M,q,re){var ae=re.ref;return{$$typeof:e,type:M,key:q,ref:ae!==void 0?ae:null,props:re}}function se(M,q){return G(M.type,q,M.props)}function ie(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function ee(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(re){return q[re]})}var te=/\/+/g;function le(M,q){return typeof M=="object"&&M!==null&&M.key!=null?ee(""+M.key):q.toString(36)}function me(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(D,D):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function H(M,q,re,ae,he){var Se=typeof M;(Se==="undefined"||Se==="boolean")&&(M=null);var be=!1;if(M===null)be=!0;else switch(Se){case"bigint":case"string":case"number":be=!0;break;case"object":switch(M.$$typeof){case e:case t:be=!0;break;case m:return be=M._init,H(be(M._payload),q,re,ae,he)}}if(be)return he=he(M),be=ae===""?"."+le(M,0):ae,O(he)?(re="",be!=null&&(re=be.replace(te,"$&/")+"/"),H(he,q,re,"",function(He){return He})):he!=null&&(ie(he)&&(he=se(he,re+(he.key==null||M&&M.key===he.key?"":(""+he.key).replace(te,"$&/")+"/")+be)),q.push(he)),1;be=0;var Ue=ae===""?".":ae+":";if(O(M))for(var Ce=0;Ce<M.length;Ce++)ae=M[Ce],Se=Ue+le(ae,Ce),be+=H(ae,q,re,Se,he);else if(Ce=b(M),typeof Ce=="function")for(M=Ce.call(M),Ce=0;!(ae=M.next()).done;)ae=ae.value,Se=Ue+le(ae,Ce++),be+=H(ae,q,re,Se,he);else if(Se==="object"){if(typeof M.then=="function")return H(me(M),q,re,ae,he);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return be}function z(M,q,re){if(M==null)return M;var ae=[],he=0;return H(M,ae,"","",function(Se){return q.call(re,Se,he++)}),ae}function Q(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(re){(M._status===0||M._status===-1)&&(M._status=1,M._result=re)},function(re){(M._status===0||M._status===-1)&&(M._status=2,M._result=re)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ce=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},_e={map:z,forEach:function(M,q,re){z(M,function(){q.apply(this,arguments)},re)},count:function(M){var q=0;return z(M,function(){q++}),q},toArray:function(M){return z(M,function(q){return q})||[]},only:function(M){if(!ie(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Me.Activity=g,Me.Children=_e,Me.Component=k,Me.Fragment=n,Me.Profiler=a,Me.PureComponent=T,Me.StrictMode=i,Me.Suspense=f,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Me.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},Me.cache=function(M){return function(){return M.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(M,q,re){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ae=w({},M.props),he=M.key;if(q!=null)for(Se in q.key!==void 0&&(he=""+q.key),q)!W.call(q,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&q.ref===void 0||(ae[Se]=q[Se]);var Se=arguments.length-2;if(Se===1)ae.children=re;else if(1<Se){for(var be=Array(Se),Ue=0;Ue<Se;Ue++)be[Ue]=arguments[Ue+2];ae.children=be}return G(M.type,he,ae)},Me.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},Me.createElement=function(M,q,re){var ae,he={},Se=null;if(q!=null)for(ae in q.key!==void 0&&(Se=""+q.key),q)W.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(he[ae]=q[ae]);var be=arguments.length-2;if(be===1)he.children=re;else if(1<be){for(var Ue=Array(be),Ce=0;Ce<be;Ce++)Ue[Ce]=arguments[Ce+2];he.children=Ue}if(M&&M.defaultProps)for(ae in be=M.defaultProps,be)he[ae]===void 0&&(he[ae]=be[ae]);return G(M,Se,he)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(M){return{$$typeof:d,render:M}},Me.isValidElement=ie,Me.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Q}},Me.memo=function(M,q){return{$$typeof:h,type:M,compare:q===void 0?null:q}},Me.startTransition=function(M){var q=N.T,re={};N.T=re;try{var ae=M(),he=N.S;he!==null&&he(re,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(D,ce)}catch(Se){ce(Se)}finally{q!==null&&re.types!==null&&(q.types=re.types),N.T=q}},Me.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Me.use=function(M){return N.H.use(M)},Me.useActionState=function(M,q,re){return N.H.useActionState(M,q,re)},Me.useCallback=function(M,q){return N.H.useCallback(M,q)},Me.useContext=function(M){return N.H.useContext(M)},Me.useDebugValue=function(){},Me.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},Me.useEffect=function(M,q){return N.H.useEffect(M,q)},Me.useEffectEvent=function(M){return N.H.useEffectEvent(M)},Me.useId=function(){return N.H.useId()},Me.useImperativeHandle=function(M,q,re){return N.H.useImperativeHandle(M,q,re)},Me.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},Me.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},Me.useMemo=function(M,q){return N.H.useMemo(M,q)},Me.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},Me.useReducer=function(M,q,re){return N.H.useReducer(M,q,re)},Me.useRef=function(M){return N.H.useRef(M)},Me.useState=function(M){return N.H.useState(M)},Me.useSyncExternalStore=function(M,q,re){return N.H.useSyncExternalStore(M,q,re)},Me.useTransition=function(){return N.H.useTransition()},Me.version="19.2.8",Me}var Ly;function Cg(){return Ly||(Ly=1,Lp.exports=Ix()),Lp.exports}var Y=Cg();function dn(e){const t=Y.useRef(e);return Y.useInsertionEffect(()=>void(t.current=e)),Y.useCallback((...n)=>t.current(...n),[])}function ua(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}const ym=new Set;function tc(e){const t=[],n=new Set;for(const g of Rx(e.themes)){const y=Q_(g)?g.getThemes():[g];for(const b of y){if(n.has(b.name))throw new Error(`Theme collection already contains theme "${b.name}"`);n.add(b.name),t.push(b)}}const i=Object.freeze([...t]),a=Object.freeze(i.filter(g=>g.colorScheme==="light")),s=Object.freeze(i.filter(g=>g.colorScheme==="dark")),c=new Map(i.map(g=>[g.name,g])),d=Object.freeze(i.map(g=>g.name)),f=Object.freeze(a.map(g=>g.name)),h=Object.freeze(s.map(g=>g.name));function m(g){if(g==null)return i;const{colorScheme:y,collection:b}=g;return b==null?y==="light"?a:y==="dark"?s:i:i.filter(S=>S.collection!==b?!1:y==null||S.colorScheme===y)}return{getTheme(g){return c.get(g)},getThemes(g){return m(g)},getThemeNames(g){return g?.collection==null?g?.colorScheme==="light"?f:g?.colorScheme==="dark"?h:d:m(g).map(y=>y.name)},hasTheme(g){return c.has(g)},orderBy(g){return tc({themes:i.map((y,b)=>({descriptor:y,index:b})).sort((y,b)=>{const S=g(y.descriptor,b.descriptor);return S!==0?S:y.index-b.index}).map(y=>y.descriptor)})},pick(g){const y=[],b=new Set;for(const S of g){if(b.has(S))throw new Error(`Theme collection pick already includes theme "${S}"`);b.add(S);const w=c.get(S);if(w==null)throw new Error(`Theme collection does not contain theme "${S}"`);y.push(w)}return tc({themes:y})},registerInto(g){for(const y of i)g.registerThemeIfAbsent(y.name,y.load)}}}function Rx(e){return Dx(e)?[e]:e}function Dx(e){return Q_(e)||Mx(e)}function Mx(e){return typeof e.name=="string"&&typeof e.load=="function"}function Q_(e){return typeof e.getThemes=="function"}function Z_(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Ox=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Px=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Nx=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Hx(){const e=new Map,t=new Map,n=new Map;let i=0;function a(k,E){if(e.has(k))throw new Ox(k);e.set(k,E)}function s(k,E){return e.has(k)?!1:(e.set(k,E),!0)}function c(k){return e.has(k)}function d(k){const E=t.get(k);if(E!==void 0)return Promise.resolve(E);const T=n.get(k);if(T!==void 0)return T;const L=e.get(k);if(L===void 0)return Promise.reject(new Px(k));const O=i,D=L().then(N=>{const W=Z_(N);return O===i&&t.set(k,W),n.get(k)===D&&n.delete(k),W}).catch(N=>{throw n.get(k)===D&&n.delete(k),N});return n.set(k,D),D}function f(k){return Promise.all(k.map(E=>d(E)))}function h(k,E){t.set(k,E)}function m(k){for(const[E,T]of k)h(E,T)}function g(k){return t.get(k)}function y(k){const E=[];for(const T of k){const L=t.get(T);if(L===void 0)throw new Nx(T);E.push(L)}return E}function b(k){return t.has(k)}function S(k){for(const E of k)if(!t.has(E))return!1;return!0}function w(k){const E=t.get(k);return E!==void 0?E:d(k)}function A(){i++,t.clear(),n.clear()}return{clearResolvedThemes:A,getResolvedOrResolveTheme:w,getResolvedTheme:g,getResolvedThemes:y,hasRegisteredTheme:c,hasResolvedTheme:b,hasResolvedThemes:S,registerTheme:a,registerThemeIfAbsent:s,resolveTheme:d,resolveThemes:f,seedResolvedTheme:h,seedResolvedThemes:m}}const xi=Hx();function bm(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=xi.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,xi.getResolvedTheme(n)==null&&xi.seedResolvedTheme(n,i);ym.has(n)||(ym.add(n),t.loadThemeSync(i))}}const zx="modulepreload",Vx=function(e,t){return new URL(e,t).href},Iy={},C=function(t,n,i){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");a=c(n.map(m=>{if(m=Vx(m,i),m in Iy)return;Iy[m]=!0;const g=m.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let w=d.length-1;w>=0;w--){const A=d[w];if(A.href===m&&(!g||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${y}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":zx,g||(S.as="script"),S.crossOrigin="",S.href=m,h&&S.setAttribute("nonce",h),document.head.appendChild(S),g)return new Promise((w,A)=>{S.addEventListener("load",w),S.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})},oa=new Map,Ip=new Map,Bx=new Map,Sm=new Set;function Ry(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Sm.has(n.name))continue;let i=oa.get(n.name);i==null&&(i=n,oa.set(n.name,i)),Sm.add(i.name),t.loadLanguageSync(i.data)}}function J_(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var _m=Object.defineProperty,Ux=Object.getOwnPropertyDescriptor,Fx=Object.getOwnPropertyNames,jx=Object.prototype.hasOwnProperty,Eg=(e,t)=>{let n={};for(var i in e)_m(n,i,{get:e[i],enumerable:!0});return _m(n,Symbol.toStringTag,{value:"Module"}),n},$x=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Fx(t),s=0,c=a.length,d;s<c;s++)d=a[s],!jx.call(e,d)&&d!==n&&_m(e,d,{get:(f=>t[f]).bind(null,d),enumerable:!(i=Ux(t,d))||i.enumerable});return e},e2=(e,t,n)=>($x(e,t,"default"),n);const Jd=[{id:"abap",name:"ABAP",import:(()=>C(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>C(()=>import("./actionscript-3-CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>C(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>C(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>C(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>C(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>C(()=>import("./apex-Dqspr-GT.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>C(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>C(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>C(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>C(()=>import("./asciidoc-Ve4PFQV2.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>C(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>C(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>C(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>C(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>C(()=>import("./bat-BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>C(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>C(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>C(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>C(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>C(()=>import("./bird2-BIv1doCn.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>C(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>C(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>C(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>C(()=>import("./c3-MRO5bC_T.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>C(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>C(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>C(()=>import("./clarity-D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>C(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>C(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>C(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>C(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>C(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>C(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>C(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>C(()=>import("./coq-DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>C(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>C(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>C(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>C(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>C(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>C(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>C(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>C(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>C(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>C(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>C(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>C(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>C(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>C(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>C(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>C(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>C(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>C(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>C(()=>import("./emacs-lisp-CXvaQtF9.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>C(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>C(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>C(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>C(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>C(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>C(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>C(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>C(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>C(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>C(()=>import("./gdscript-C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>C(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>C(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>C(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>C(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>C(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>C(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>C(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>C(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>C(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26]),import.meta.url))},{id:"gn",name:"GN",import:(()=>C(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>C(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>C(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>C(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>C(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>C(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>C(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>C(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>C(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>C(()=>import("./haxe-CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>C(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>C(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>C(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>C(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>C(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>C(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>C(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>C(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>C(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>C(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>C(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>C(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>C(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>C(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>C(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>C(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>C(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>C(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>C(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>C(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>C(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>C(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>C(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62]),import.meta.url))},{id:"just",name:"Just",import:(()=>C(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>C(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>C(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>C(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>C(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>C(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>C(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>C(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>C(()=>import("./llvm-DjAJT7YJ.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>C(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>C(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>C(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>C(()=>import("./luau-KW6xsasC.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>C(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>C(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>C(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>C(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>C(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>C(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>C(()=>import("./mermaid-mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>C(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>C(()=>import("./mojo-rZm6bMo-.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>C(()=>import("./moonbit-_H4v1dQx.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>C(()=>import("./move-IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>C(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>C(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>C(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>C(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>C(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>C(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>C(()=>import("./nushell-Cz2AlsmD.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>C(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>C(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>C(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>C(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>C(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>C(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>C(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>C(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>C(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>C(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>C(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>C(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>C(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>C(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>C(()=>import("./powershell-Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>C(()=>import("./prisma-Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>C(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>C(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>C(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>C(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>C(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>C(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>C(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>C(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>C(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>C(()=>import("./r-Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>C(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>C(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>C(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79]),import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>C(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>C(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>C(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>C(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>C(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>C(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>C(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>C(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>C(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>C(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>C(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>C(()=>import("./scala-C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>C(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>C(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>C(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>C(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>C(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>C(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28]),import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>C(()=>import("./smalltalk-BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>C(()=>import("./solidity-rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>C(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>C(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>C(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>C(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>C(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>C(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>C(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>C(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>C(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>C(()=>import("./swift-D82vCrfD.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>C(()=>import("./system-verilog-CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>C(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>C(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>C(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>C(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>C(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>C(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>C(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>C(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>C(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>C(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>C(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>C(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>C(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>C(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>C(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>C(()=>import("./typst-DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>C(()=>import("./v-BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>C(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>C(()=>import("./vb-D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>C(()=>import("./verilog-BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>C(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>C(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>C(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>C(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>C(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>C(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>C(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>C(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>C(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>C(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>C(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>C(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>C(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>C(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>C(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>C(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>C(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],wg=Object.fromEntries(Jd.map(e=>[e.id,e.import])),xg=Object.fromEntries(Jd.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),nc={...wg,...xg},Tg=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>C(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>C(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>C(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>C(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>C(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>C(()=>import("./catppuccin-frappe-DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>C(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>C(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>C(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>C(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>C(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>C(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>C(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>C(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>C(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>C(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>C(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>C(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>C(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>C(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>C(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>C(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>C(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>C(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>C(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>C(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>C(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>C(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>C(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>C(()=>import("./kanagawa-wave-DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>C(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>C(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>C(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>C(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>C(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>C(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>C(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>C(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>C(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>C(()=>import("./monokai-D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>C(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>C(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>C(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>C(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>C(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>C(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>C(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>C(()=>import("./red-bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>C(()=>import("./rose-pine-qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>C(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>C(()=>import("./rose-pine-moon-D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>C(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>C(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>C(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>C(()=>import("./solarized-dark-DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>C(()=>import("./solarized-light-L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>C(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>C(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>C(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>C(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>C(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>C(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],kg=Object.fromEntries(Tg.map(e=>[e.id,e.import]));var Ag=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qx(){return 2147483648}function Gx(){return typeof performance<"u"?performance.now():Date.now()}const Wx=(e,t)=>e+(t-e%t)%t;async function Kx(e){let t,n;const i={};function a(b){n=b,i.HEAPU8=new Uint8Array(b),i.HEAPU32=new Uint32Array(b)}function s(b,S,w){i.HEAPU8.copyWithin(b,S,S+w)}function c(b){try{return t.grow(b-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function d(b){const S=i.HEAPU8.length;b=b>>>0;const w=qx();if(b>w)return!1;for(let A=1;A<=4;A*=2){let k=S*(1+.2/A);k=Math.min(k,b+100663296);const E=Math.min(w,Wx(Math.max(b,k),65536));if(c(E))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,S,w=1024){const A=S+w;let k=S;for(;b[k]&&!(k>=A);)++k;if(k-S>16&&b.buffer&&f)return f.decode(b.subarray(S,k));let E="";for(;S<k;){let T=b[S++];if(!(T&128)){E+=String.fromCharCode(T);continue}const L=b[S++]&63;if((T&224)===192){E+=String.fromCharCode((T&31)<<6|L);continue}const O=b[S++]&63;if((T&240)===224?T=(T&15)<<12|L<<6|O:T=(T&7)<<18|L<<12|O<<6|b[S++]&63,T<65536)E+=String.fromCharCode(T);else{const D=T-65536;E+=String.fromCharCode(55296|D>>10,56320|D&1023)}}return E}function m(b,S){return b?h(i.HEAPU8,b,S):""}const g={emscripten_get_now:Gx,emscripten_memcpy_big:s,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const S=await e({env:g,wasi_snapshot_preview1:g});t=S.memory,a(t.buffer),Object.assign(i,S),i.UTF8ToString=m}return await y(),i}var Yx=Object.defineProperty,Xx=(e,t,n)=>t in e?Yx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t,n)=>Xx(e,typeof t!="symbol"?t+"":t,n);let Jt=null;function Qx(e){throw new Ag(e.UTF8ToString(e.getLastOnigError()))}class ef{constructor(t){$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16Value"),$t(this,"utf8Value"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16");const n=t.length,i=ef._utf8ByteLength(t),a=i!==n,s=a?new Uint32Array(n+1):null;a&&(s[n]=i);const c=a?new Uint32Array(i+1):null;a&&(c[i]=n);const d=new Uint8Array(i);let f=0;for(let h=0;h<n;h++){const m=t.charCodeAt(h);let g=m,y=!1;if(m>=55296&&m<=56319&&h+1<n){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(g=(m-55296<<10)+65536|b-56320,y=!0)}a&&(s[h]=f,y&&(s[h+1]=f),g<=127?c[f+0]=h:g<=2047?(c[f+0]=h,c[f+1]=h):g<=65535?(c[f+0]=h,c[f+1]=h,c[f+2]=h):(c[f+0]=h,c[f+1]=h,c[f+2]=h,c[f+3]=h)),g<=127?d[f++]=g:g<=2047?(d[f++]=192|(g&1984)>>>6,d[f++]=128|(g&63)>>>0):g<=65535?(d[f++]=224|(g&61440)>>>12,d[f++]=128|(g&4032)>>>6,d[f++]=128|(g&63)>>>0):(d[f++]=240|(g&1835008)>>>18,d[f++]=128|(g&258048)>>>12,d[f++]=128|(g&4032)>>>6,d[f++]=128|(g&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=c}static _utf8ByteLength(t){let n=0;for(let i=0,a=t.length;i<a;i++){const s=t.charCodeAt(i);let c=s,d=!1;if(s>=55296&&s<=56319&&i+1<a){const f=t.charCodeAt(i+1);f>=56320&&f<=57343&&(c=(s-55296<<10)+65536|f-56320,d=!0)}c<=127?n+=1:c<=2047?n+=2:c<=65535?n+=3:n+=4,d&&i++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const tf=class Bi{constructor(t){if($t(this,"id",++Bi.LAST_ID),$t(this,"_onigBinding"),$t(this,"content"),$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16"),$t(this,"ptr"),!Jt)throw new Ag("Must invoke loadWasm first.");this._onigBinding=Jt,this.content=t;const n=new ef(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Bi._sharedPtrInUse?(Bi._sharedPtr||(Bi._sharedPtr=Jt.omalloc(1e4)),Bi._sharedPtrInUse=!0,Jt.HEAPU8.set(n.utf8Value,Bi._sharedPtr),this.ptr=Bi._sharedPtr):this.ptr=n.createString(Jt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Bi._sharedPtr?Bi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};$t(tf,"LAST_ID",0);$t(tf,"_sharedPtr",0);$t(tf,"_sharedPtrInUse",!1);let t2=tf;class Zx{constructor(t){if($t(this,"_onigBinding"),$t(this,"_ptr"),!Jt)throw new Ag("Must invoke loadWasm first.");const n=[],i=[];for(let d=0,f=t.length;d<f;d++){const h=new ef(t[d]);n[d]=h.createString(Jt),i[d]=h.utf8Length}const a=Jt.omalloc(4*t.length);Jt.HEAPU32.set(n,a/4);const s=Jt.omalloc(4*t.length);Jt.HEAPU32.set(i,s/4);const c=Jt.createOnigScanner(a,s,t.length);for(let d=0,f=t.length;d<f;d++)Jt.ofree(n[d]);Jt.ofree(s),Jt.ofree(a),c===0&&Qx(Jt),this._onigBinding=Jt,this._ptr=c}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,i){let a=0;if(typeof i=="number"&&(a=i),typeof t=="string"){t=new t2(t);const s=this._findNextMatchSync(t,n,!1,a);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,i,a){const s=this._onigBinding,c=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(c===0)return null;const d=s.HEAPU32;let f=c/4;const h=d[f++],m=d[f++],g=[];for(let y=0;y<m;y++){const b=t.convertUtf8OffsetToUtf16(d[f++]),S=t.convertUtf8OffsetToUtf16(d[f++]);g[y]={start:b,end:S,length:S-b}}return{index:h,captureIndices:g}}}function Jx(e){return typeof e.instantiator=="function"}function eT(e){return typeof e.default=="function"}function tT(e){return typeof e.data<"u"}function nT(e){return typeof Response<"u"&&e instanceof Response}function iT(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}let qu;function Lg(e){if(qu)return qu;async function t(){Jt=await Kx(async n=>{let i=e;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),Jx(i)?i=await i.instantiator(n):eT(i)?i=await i.default(n):(tT(i)&&(i=i.data),nT(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await rT(i)(n):i=await oT(i)(n):iT(i)?i=await Rp(i)(n):i instanceof WebAssembly.Module?i=await Rp(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await Rp(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return qu=t(),qu}function Rp(e){return t=>WebAssembly.instantiate(e,t)}function rT(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oT(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let n2;function aT(e){n2=e}function sT(){return n2}async function Ig(e){return e&&await Lg(e),{createScanner(t){return new Zx(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new t2(t)}}}const lT=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:Ig,getDefaultWasmLoader:sT,loadWasm:Lg,setDefaultWasmLoader:aT},Symbol.toStringTag,{value:"Module"}));var i2=Eg({});e2(i2,lT);var gt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function cT(e){return Rg(e)}function Rg(e){return Array.isArray(e)?uT(e):e instanceof RegExp?e:typeof e=="object"?dT(e):e}function uT(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Rg(e[n]);return t}function dT(e){let t={};for(let n in e)t[n]=Rg(e[n]);return t}function r2(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function o2(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?o2(e.substring(0,e.length-1)):e.substr(~t+1)}var Dp=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Gu=class{static hasCaptures(e){return e===null?!1:(Dp.lastIndex=0,Dp.test(e))}static replaceCaptures(e,t,n){return e.replace(Dp,(i,a,s,c)=>{let d=n[parseInt(a||s,10)];if(d){let f=t.substring(d.start,d.end);for(;f[0]===".";)f=f.substring(1);switch(c){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return i})}};function a2(e,t){return e<t?-1:e>t?1:0}function s2(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let a=0;a<n;a++){let s=a2(e[a],t[a]);if(s!==0)return s}return 0}return n-i}function Dy(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 l2(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var c2=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Id=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(pT(e),t)}static createFromParsedTheme(e,t){return gT(e,t)}_cachedMatchRoot=new c2(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(a=>fT(e.parent,a.parentScopes));return i?new u2(i.fontStyle,i.foreground,i.background):null}},Mp=class md{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new md(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new md(n,t[i]);return n}push(t){return new md(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function fT(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],a=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],a=!0}for(;e&&!hT(e.scopeName,i);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function hT(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var u2=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function pT(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let a=0,s=t.length;a<s;a++){let c=t[a];if(!c.settings)continue;let d;if(typeof c.scope=="string"){let g=c.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),d=g.split(",")}else Array.isArray(c.scope)?d=c.scope:d=[""];let f=-1;if(typeof c.settings.fontStyle=="string"){f=0;let g=c.settings.fontStyle.split(" ");for(let y=0,b=g.length;y<b;y++)switch(g[y]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let h=null;typeof c.settings.foreground=="string"&&Dy(c.settings.foreground)&&(h=c.settings.foreground);let m=null;typeof c.settings.background=="string"&&Dy(c.settings.background)&&(m=c.settings.background);for(let g=0,y=d.length;g<y;g++){let S=d[g].trim().split(" "),w=S[S.length-1],A=null;S.length>1&&(A=S.slice(0,S.length-1),A.reverse()),n[i++]=new mT(w,A,a,f,h,m)}}return n}var mT=class{constructor(e,t,n,i,a,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=a,this.background=s}},gn=(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))(gn||{});function gT(e,t){e.sort((f,h)=>{let m=a2(f.scope,h.scope);return m!==0||(m=s2(f.parentScopes,h.parentScopes),m!==0)?m:f.index-h.index});let n=0,i="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(i=f.foreground),f.background!==null&&(a=f.background)}let s=new vT(t),c=new u2(n,s.getId(i),s.getId(a)),d=new bT(new Cm(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let m=e[f];d.insert(0,m.scope,m.parentScopes,m.fontStyle,s.getId(m.foreground),s.getId(m.background))}return new Id(s,c,d)}var vT=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 new 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)}},yT=Object.freeze([]),Cm=class d2{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,a,s){this.scopeDepth=t,this.parentScopes=n||yT,this.fontStyle=i,this.foreground=a,this.background=s}clone(){return new d2(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,a=t.length;i<a;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),a!==0&&(this.background=a)}},bT=class Em{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,a=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[a]===">"&&a++,!(i>=t.parentScopes.length||a>=n.parentScopes.length);){const s=n.parentScopes[a].length-t.parentScopes[i].length;if(s!==0)return s;i++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),a,s;if(i===-1?(a=t,s=""):(a=t.substring(0,i),s=t.substring(i+1)),this._children.hasOwnProperty(a))return this._children[a].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Em._cmpBySpecificity),n}insert(t,n,i,a,s,c){if(n===""){this._doInsertHere(t,i,a,s,c);return}let d=n.indexOf("."),f,h;d===-1?(f=n,h=""):(f=n.substring(0,d),h=n.substring(d+1));let m;this._children.hasOwnProperty(f)?m=this._children[f]:(m=new Em(this._mainRule.clone(),Cm.cloneArr(this._rulesWithParentScopes)),this._children[f]=m),m.insert(t+1,h,i,a,s,c)}_doInsertHere(t,n,i,a,s){if(n===null){this._mainRule.acceptOverwrite(t,i,a,s);return}for(let c=0,d=this._rulesWithParentScopes.length;c<d;c++){let f=this._rulesWithParentScopes[c];if(s2(f.parentScopes,n)===0){f.acceptOverwrite(t,i,a,s);return}}i===-1&&(i=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Cm(t,n,i,a,s))}},ia=class ui{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ui.getLanguageId(t),i=ui.getTokenType(t),a=ui.getFontStyle(t),s=ui.getForeground(t),c=ui.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:a,foreground:s,background:c})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,a,s,c,d){let f=ui.getLanguageId(t),h=ui.getTokenType(t),m=ui.containsBalancedBrackets(t)?1:0,g=ui.getFontStyle(t),y=ui.getForeground(t),b=ui.getBackground(t);return n!==0&&(f=n),i!==8&&(h=i),a!==null&&(m=a?1:0),s!==-1&&(g=s),c!==0&&(y=c),d!==0&&(b=d),(f<<0|h<<8|m<<10|g<<11|y<<15|b<<24)>>>0}};function Rd(e,t){const n=[],i=ST(e);let a=i.next();for(;a!==null;){let f=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=i.next()}let h=c();if(n.push({matcher:h,priority:f}),a!==",")break;a=i.next()}return n;function s(){if(a==="-"){a=i.next();const f=s();return h=>!!f&&!f(h)}if(a==="("){a=i.next();const f=d();return a===")"&&(a=i.next()),f}if(My(a)){const f=[];do f.push(a),a=i.next();while(My(a));return h=>t(f,h)}return null}function c(){const f=[];let h=s();for(;h;)f.push(h),h=s();return m=>f.every(g=>g(m))}function d(){const f=[];let h=c();for(;h&&(f.push(h),a==="|"||a===",");){do a=i.next();while(a==="|"||a===",");h=c()}return m=>f.some(g=>g(m))}}function My(e){return!!e&&!!e.match(/[\w\.:]+/)}function ST(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function f2(e){typeof e.dispose=="function"&&e.dispose()}var ic=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_T=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},CT=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ET=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ic(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new CT;for(const n of e)wT(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof ic){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function wT(e,t,n,i){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof ic?gd({baseGrammar:s,selfGrammar:a},i):wm(e.ruleName,{baseGrammar:s,selfGrammar:a,repository:a.repository},i);const c=n.injections(e.scopeName);if(c)for(const d of c)i.add(new ic(d))}function wm(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];Dd([i],t,n)}}function gd(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Dd(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Dd(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Dd(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const a=i.repository?r2({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&Dd(i.patterns,{...t,repository:a},n);const s=i.include;if(!s)continue;const c=h2(s);switch(c.kind){case 0:gd({...t,selfGrammar:t.baseGrammar},n);break;case 1:gd(t,n);break;case 2:wm(c.ruleName,{...t,repository:a},n);break;case 3:case 4:const d=c.scopeName===t.selfGrammar.scopeName?t.selfGrammar:c.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const f={baseGrammar:t.baseGrammar,selfGrammar:d,repository:a};c.kind===4?wm(c.ruleName,f,n):gd(f,n)}else c.kind===4?n.add(new _T(c.scopeName,c.ruleName)):n.add(new ic(c.scopeName));break}}}var xT=class{kind=0},TT=class{kind=1},kT=class{constructor(e){this.ruleName=e}kind=2},AT=class{constructor(e){this.scopeName=e}kind=3},LT=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function h2(e){if(e==="$base")return new xT;if(e==="$self")return new TT;const t=e.indexOf("#");if(t===-1)return new AT(e);if(t===0)return new kT(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new LT(n,i)}}var IT=/\\(\d+)/,Oy=/\\(\d+)/g,RT=-1,p2=-2;var Ec=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Gu.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Gu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${o2(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:Gu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Gu.replaceCaptures(this._contentName,e,t)}},DT=class extends Ec{retokenizeCapturedWithRuleId;constructor(e,t,n,i,a){super(e,t,n,i),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},MT=class extends Ec{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,a){super(e,t,n,null),this._match=new rc(i,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Py=class extends Ec{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,a){super(e,t,n,i),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xm=class extends Ec{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,a,s,c,d,f,h){super(e,t,n,i),this._begin=new rc(a,this.id),this.beginCaptures=s,this._end=new rc(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=f||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oc;for(const n of this.patterns)e.getRule(n).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}},Md=class extends Ec{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,a,s,c,d,f){super(e,t,n,i),this._begin=new rc(a,this.id),this.beginCaptures=s,this.whileCaptures=d,this._while=new rc(c,p2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=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,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oc;for(const 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,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new oc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},m2=class mn{static createCaptureRule(t,n,i,a,s){return t.registerRule(c=>new DT(n,c,i,a,s))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new MT(t.$vscodeTextmateLocation,t.id,t.name,t.match,mn._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=r2({},i,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Py(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,mn._compilePatterns(s,n,i))}return t.while?new Md(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,mn._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,mn._compileCaptures(t.whileCaptures||t.captures,n,i),mn._compilePatterns(t.patterns,n,i)):new xm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,mn._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,mn._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,mn._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let a=[];if(t){let s=0;for(const c in t){if(c==="$vscodeTextmateLocation")continue;const d=parseInt(c,10);d>s&&(s=d)}for(let c=0;c<=s;c++)a[c]=null;for(const c in t){if(c==="$vscodeTextmateLocation")continue;const d=parseInt(c,10);let f=0;t[c].patterns&&(f=mn.getCompiledRuleId(t[c],n,i)),a[d]=mn.createCaptureRule(n,t[c].$vscodeTextmateLocation,t[c].name,t[c].contentName,f)}}return a}static _compilePatterns(t,n,i){let a=[];if(t)for(let s=0,c=t.length;s<c;s++){const d=t[s];let f=-1;if(d.include){const h=h2(d.include);switch(h.kind){case 0:case 1:f=mn.getCompiledRuleId(i[d.include],n,i);break;case 2:let m=i[h.ruleName];m&&(f=mn.getCompiledRuleId(m,n,i));break;case 3:case 4:const g=h.scopeName,y=h.kind===4?h.ruleName:null,b=n.getExternalGrammar(g,i);if(b)if(y){let S=b.repository[y];S&&(f=mn.getCompiledRuleId(S,n,b.repository))}else f=mn.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else f=mn.getCompiledRuleId(d,n,i);if(f!==-1){const h=n.getRule(f);let m=!1;if((h instanceof Py||h instanceof xm||h instanceof Md)&&h.hasMissingPatterns&&h.patterns.length===0&&(m=!0),m)continue;a.push(f)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},rc=class g2{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let a=0,s=[],c=!1;for(let d=0;d<i;d++)if(t.charAt(d)==="\\"&&d+1<i){const h=t.charAt(d+1);h==="z"?(s.push(t.substring(a,d)),s.push("$(?!\\n)(?<!\\n)"),a=d+2):(h==="A"||h==="G")&&(c=!0),d++}this.hasAnchor=c,a===0?this.source=t:(s.push(t.substring(a,i)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=IT.test(this.source):this.hasBackReferences=!1}clone(){return new g2(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(a=>t.substring(a.start,a.end));return Oy.lastIndex=0,this.source.replace(Oy,(a,s)=>l2(i[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],a=[],s,c,d,f;for(s=0,c=this.source.length;s<c;s++)d=this.source.charAt(s),t[s]=d,n[s]=d,i[s]=d,a[s]=d,d==="\\"&&s+1<c&&(f=this.source.charAt(s+1),f==="A"?(t[s+1]="￿",n[s+1]="￿",i[s+1]="A",a[s+1]="A"):f==="G"?(t[s+1]="￿",n[s+1]="G",i[s+1]="￿",a[s+1]="G"):(t[s+1]=f,n[s+1]=f,i[s+1]=f,a[s+1]=f),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},oc=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(),this._cached=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(n=>n.source);this._cached=new Ny(e,t,this._items.map(n=>n.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){let i=this._items.map(a=>a.resolveAnchors(t,n));return new Ny(e,i,this._items.map(a=>a.ruleId))}},Ny=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
18
+ */var Ay;function Ix(){if(Ay)return Me;Ay=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,A={};function k(M,q,re){this.props=M,this.context=q,this.refs=A,this.updater=re||S}k.prototype.isReactComponent={},k.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,q,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=k.prototype;function T(M,q,re){this.props=M,this.context=q,this.refs=A,this.updater=re||S}var L=T.prototype=new E;L.constructor=T,w(L,k.prototype),L.isPureReactComponent=!0;var O=Array.isArray;function D(){}var N={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function G(M,q,re){var ae=re.ref;return{$$typeof:e,type:M,key:q,ref:ae!==void 0?ae:null,props:re}}function se(M,q){return G(M.type,q,M.props)}function ie(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function ee(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(re){return q[re]})}var te=/\/+/g;function le(M,q){return typeof M=="object"&&M!==null&&M.key!=null?ee(""+M.key):q.toString(36)}function me(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(D,D):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function H(M,q,re,ae,he){var Se=typeof M;(Se==="undefined"||Se==="boolean")&&(M=null);var be=!1;if(M===null)be=!0;else switch(Se){case"bigint":case"string":case"number":be=!0;break;case"object":switch(M.$$typeof){case e:case t:be=!0;break;case m:return be=M._init,H(be(M._payload),q,re,ae,he)}}if(be)return he=he(M),be=ae===""?"."+le(M,0):ae,O(he)?(re="",be!=null&&(re=be.replace(te,"$&/")+"/"),H(he,q,re,"",function(He){return He})):he!=null&&(ie(he)&&(he=se(he,re+(he.key==null||M&&M.key===he.key?"":(""+he.key).replace(te,"$&/")+"/")+be)),q.push(he)),1;be=0;var Ue=ae===""?".":ae+":";if(O(M))for(var Ce=0;Ce<M.length;Ce++)ae=M[Ce],Se=Ue+le(ae,Ce),be+=H(ae,q,re,Se,he);else if(Ce=b(M),typeof Ce=="function")for(M=Ce.call(M),Ce=0;!(ae=M.next()).done;)ae=ae.value,Se=Ue+le(ae,Ce++),be+=H(ae,q,re,Se,he);else if(Se==="object"){if(typeof M.then=="function")return H(me(M),q,re,ae,he);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return be}function z(M,q,re){if(M==null)return M;var ae=[],he=0;return H(M,ae,"","",function(Se){return q.call(re,Se,he++)}),ae}function Q(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(re){(M._status===0||M._status===-1)&&(M._status=1,M._result=re)},function(re){(M._status===0||M._status===-1)&&(M._status=2,M._result=re)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ce=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},_e={map:z,forEach:function(M,q,re){z(M,function(){q.apply(this,arguments)},re)},count:function(M){var q=0;return z(M,function(){q++}),q},toArray:function(M){return z(M,function(q){return q})||[]},only:function(M){if(!ie(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Me.Activity=g,Me.Children=_e,Me.Component=k,Me.Fragment=n,Me.Profiler=a,Me.PureComponent=T,Me.StrictMode=i,Me.Suspense=f,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Me.__COMPILER_RUNTIME={__proto__:null,c:function(M){return N.H.useMemoCache(M)}},Me.cache=function(M){return function(){return M.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(M,q,re){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ae=w({},M.props),he=M.key;if(q!=null)for(Se in q.key!==void 0&&(he=""+q.key),q)!K.call(q,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&q.ref===void 0||(ae[Se]=q[Se]);var Se=arguments.length-2;if(Se===1)ae.children=re;else if(1<Se){for(var be=Array(Se),Ue=0;Ue<Se;Ue++)be[Ue]=arguments[Ue+2];ae.children=be}return G(M.type,he,ae)},Me.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:s,_context:M},M},Me.createElement=function(M,q,re){var ae,he={},Se=null;if(q!=null)for(ae in q.key!==void 0&&(Se=""+q.key),q)K.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(he[ae]=q[ae]);var be=arguments.length-2;if(be===1)he.children=re;else if(1<be){for(var Ue=Array(be),Ce=0;Ce<be;Ce++)Ue[Ce]=arguments[Ce+2];he.children=Ue}if(M&&M.defaultProps)for(ae in be=M.defaultProps,be)he[ae]===void 0&&(he[ae]=be[ae]);return G(M,Se,he)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(M){return{$$typeof:d,render:M}},Me.isValidElement=ie,Me.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:Q}},Me.memo=function(M,q){return{$$typeof:h,type:M,compare:q===void 0?null:q}},Me.startTransition=function(M){var q=N.T,re={};N.T=re;try{var ae=M(),he=N.S;he!==null&&he(re,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(D,ce)}catch(Se){ce(Se)}finally{q!==null&&re.types!==null&&(q.types=re.types),N.T=q}},Me.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Me.use=function(M){return N.H.use(M)},Me.useActionState=function(M,q,re){return N.H.useActionState(M,q,re)},Me.useCallback=function(M,q){return N.H.useCallback(M,q)},Me.useContext=function(M){return N.H.useContext(M)},Me.useDebugValue=function(){},Me.useDeferredValue=function(M,q){return N.H.useDeferredValue(M,q)},Me.useEffect=function(M,q){return N.H.useEffect(M,q)},Me.useEffectEvent=function(M){return N.H.useEffectEvent(M)},Me.useId=function(){return N.H.useId()},Me.useImperativeHandle=function(M,q,re){return N.H.useImperativeHandle(M,q,re)},Me.useInsertionEffect=function(M,q){return N.H.useInsertionEffect(M,q)},Me.useLayoutEffect=function(M,q){return N.H.useLayoutEffect(M,q)},Me.useMemo=function(M,q){return N.H.useMemo(M,q)},Me.useOptimistic=function(M,q){return N.H.useOptimistic(M,q)},Me.useReducer=function(M,q,re){return N.H.useReducer(M,q,re)},Me.useRef=function(M){return N.H.useRef(M)},Me.useState=function(M){return N.H.useState(M)},Me.useSyncExternalStore=function(M,q,re){return N.H.useSyncExternalStore(M,q,re)},Me.useTransition=function(){return N.H.useTransition()},Me.version="19.2.8",Me}var Ly;function Cg(){return Ly||(Ly=1,Lp.exports=Ix()),Lp.exports}var W=Cg();function dn(e){const t=W.useRef(e);return W.useInsertionEffect(()=>void(t.current=e)),W.useCallback((...n)=>t.current(...n),[])}function ua(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}const ym=new Set;function tc(e){const t=[],n=new Set;for(const g of Rx(e.themes)){const y=Q_(g)?g.getThemes():[g];for(const b of y){if(n.has(b.name))throw new Error(`Theme collection already contains theme "${b.name}"`);n.add(b.name),t.push(b)}}const i=Object.freeze([...t]),a=Object.freeze(i.filter(g=>g.colorScheme==="light")),s=Object.freeze(i.filter(g=>g.colorScheme==="dark")),c=new Map(i.map(g=>[g.name,g])),d=Object.freeze(i.map(g=>g.name)),f=Object.freeze(a.map(g=>g.name)),h=Object.freeze(s.map(g=>g.name));function m(g){if(g==null)return i;const{colorScheme:y,collection:b}=g;return b==null?y==="light"?a:y==="dark"?s:i:i.filter(S=>S.collection!==b?!1:y==null||S.colorScheme===y)}return{getTheme(g){return c.get(g)},getThemes(g){return m(g)},getThemeNames(g){return g?.collection==null?g?.colorScheme==="light"?f:g?.colorScheme==="dark"?h:d:m(g).map(y=>y.name)},hasTheme(g){return c.has(g)},orderBy(g){return tc({themes:i.map((y,b)=>({descriptor:y,index:b})).sort((y,b)=>{const S=g(y.descriptor,b.descriptor);return S!==0?S:y.index-b.index}).map(y=>y.descriptor)})},pick(g){const y=[],b=new Set;for(const S of g){if(b.has(S))throw new Error(`Theme collection pick already includes theme "${S}"`);b.add(S);const w=c.get(S);if(w==null)throw new Error(`Theme collection does not contain theme "${S}"`);y.push(w)}return tc({themes:y})},registerInto(g){for(const y of i)g.registerThemeIfAbsent(y.name,y.load)}}}function Rx(e){return Dx(e)?[e]:e}function Dx(e){return Q_(e)||Mx(e)}function Mx(e){return typeof e.name=="string"&&typeof e.load=="function"}function Q_(e){return typeof e.getThemes=="function"}function Z_(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var Ox=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Px=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},Nx=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function Hx(){const e=new Map,t=new Map,n=new Map;let i=0;function a(k,E){if(e.has(k))throw new Ox(k);e.set(k,E)}function s(k,E){return e.has(k)?!1:(e.set(k,E),!0)}function c(k){return e.has(k)}function d(k){const E=t.get(k);if(E!==void 0)return Promise.resolve(E);const T=n.get(k);if(T!==void 0)return T;const L=e.get(k);if(L===void 0)return Promise.reject(new Px(k));const O=i,D=L().then(N=>{const K=Z_(N);return O===i&&t.set(k,K),n.get(k)===D&&n.delete(k),K}).catch(N=>{throw n.get(k)===D&&n.delete(k),N});return n.set(k,D),D}function f(k){return Promise.all(k.map(E=>d(E)))}function h(k,E){t.set(k,E)}function m(k){for(const[E,T]of k)h(E,T)}function g(k){return t.get(k)}function y(k){const E=[];for(const T of k){const L=t.get(T);if(L===void 0)throw new Nx(T);E.push(L)}return E}function b(k){return t.has(k)}function S(k){for(const E of k)if(!t.has(E))return!1;return!0}function w(k){const E=t.get(k);return E!==void 0?E:d(k)}function A(){i++,t.clear(),n.clear()}return{clearResolvedThemes:A,getResolvedOrResolveTheme:w,getResolvedTheme:g,getResolvedThemes:y,hasRegisteredTheme:c,hasResolvedTheme:b,hasResolvedThemes:S,registerTheme:a,registerThemeIfAbsent:s,resolveTheme:d,resolveThemes:f,seedResolvedTheme:h,seedResolvedThemes:m}}const xi=Hx();function bm(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=xi.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,xi.getResolvedTheme(n)==null&&xi.seedResolvedTheme(n,i);ym.has(n)||(ym.add(n),t.loadThemeSync(i))}}const zx="modulepreload",Vx=function(e,t){return new URL(e,t).href},Iy={},C=function(t,n,i){let a=Promise.resolve();if(n&&n.length>0){let c=function(m){return Promise.all(m.map(g=>Promise.resolve(g).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),h=f?.nonce||f?.getAttribute("nonce");a=c(n.map(m=>{if(m=Vx(m,i),m in Iy)return;Iy[m]=!0;const g=m.endsWith(".css"),y=g?'[rel="stylesheet"]':"";if(!!i)for(let w=d.length-1;w>=0;w--){const A=d[w];if(A.href===m&&(!g||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${y}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":zx,g||(S.as="script"),S.crossOrigin="",S.href=m,h&&S.setAttribute("nonce",h),document.head.appendChild(S),g)return new Promise((w,A)=>{S.addEventListener("load",w),S.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&s(d.reason);return t().catch(s)})},oa=new Map,Ip=new Map,Bx=new Map,Sm=new Set;function Ry(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(Sm.has(n.name))continue;let i=oa.get(n.name);i==null&&(i=n,oa.set(n.name,i)),Sm.add(i.name),t.loadLanguageSync(i.data)}}function J_(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var _m=Object.defineProperty,Ux=Object.getOwnPropertyDescriptor,Fx=Object.getOwnPropertyNames,jx=Object.prototype.hasOwnProperty,Eg=(e,t)=>{let n={};for(var i in e)_m(n,i,{get:e[i],enumerable:!0});return _m(n,Symbol.toStringTag,{value:"Module"}),n},$x=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var a=Fx(t),s=0,c=a.length,d;s<c;s++)d=a[s],!jx.call(e,d)&&d!==n&&_m(e,d,{get:(f=>t[f]).bind(null,d),enumerable:!(i=Ux(t,d))||i.enumerable});return e},e2=(e,t,n)=>($x(e,t,"default"),n);const Jd=[{id:"abap",name:"ABAP",import:(()=>C(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",import:(()=>C(()=>import("./actionscript-3-CoDkCxhg.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>C(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>C(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>C(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>C(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>C(()=>import("./apex-Dqspr-GT.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>C(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>C(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>C(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>C(()=>import("./asciidoc-Ve4PFQV2.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>C(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>C(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>C(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>C(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>C(()=>import("./bat-BkioyH1T.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>C(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>C(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>C(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>C(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>C(()=>import("./bird2-BIv1doCn.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>C(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>C(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>C(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>C(()=>import("./c3-MRO5bC_T.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>C(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>C(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>C(()=>import("./clarity-D53aC0YG.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>C(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>C(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>C(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>C(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>C(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>C(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>C(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Coq",import:(()=>C(()=>import("./coq-DkFqJrB1.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>C(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>C(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>C(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>C(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>C(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>C(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>C(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>C(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>C(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>C(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>C(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>C(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>C(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>C(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>C(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>C(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>C(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>C(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>C(()=>import("./emacs-lisp-CXvaQtF9.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>C(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>C(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>C(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>C(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>C(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>C(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>C(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>C(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>C(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>C(()=>import("./gdscript-C5YyOfLZ.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>C(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>C(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>C(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>C(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>C(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>C(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>C(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>C(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>C(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26]),import.meta.url))},{id:"gn",name:"GN",import:(()=>C(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>C(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>C(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>C(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>C(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>C(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>C(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>C(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>C(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>C(()=>import("./haxe-CzTSHFRz.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>C(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>C(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>C(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>C(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>C(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>C(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>C(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>C(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>C(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>C(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>C(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>C(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>C(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>C(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>C(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>C(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>C(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>C(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>C(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>C(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>C(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>C(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>C(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62]),import.meta.url))},{id:"just",name:"Just",import:(()=>C(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>C(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>C(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>C(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>C(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>C(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>C(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>C(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>C(()=>import("./llvm-DjAJT7YJ.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>C(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>C(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>C(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>C(()=>import("./luau-KW6xsasC.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>C(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>C(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>C(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>C(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>C(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>C(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>C(()=>import("./mermaid-mWjccvbQ.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>C(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>C(()=>import("./mojo-rZm6bMo-.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>C(()=>import("./moonbit-_H4v1dQx.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>C(()=>import("./move-IF9eRakj.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>C(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>C(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>C(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>C(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>C(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>C(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>C(()=>import("./nushell-Cz2AlsmD.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>C(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>C(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>C(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>C(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>C(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>C(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>C(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>C(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>C(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>C(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>C(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>C(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>C(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>C(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>C(()=>import("./powershell-Dpen1YoG.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>C(()=>import("./prisma-Dd19v3D-.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>C(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>C(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>C(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>C(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>C(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>C(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>C(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>C(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>C(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>C(()=>import("./r-Dspwwk_N.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>C(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>C(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>C(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79]),import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>C(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>C(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>C(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>C(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>C(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>C(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>C(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>C(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>C(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>C(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>C(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>C(()=>import("./scala-C151Ov-r.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>C(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>C(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>C(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>C(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>C(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>C(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28]),import.meta.url))},{id:"smalltalk",name:"Smalltalk",import:(()=>C(()=>import("./smalltalk-BERRCDM3.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>C(()=>import("./solidity-rGO070M0.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>C(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>C(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>C(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>C(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>C(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>C(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>C(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>C(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>C(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>C(()=>import("./swift-D82vCrfD.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>C(()=>import("./system-verilog-CnnmHF94.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>C(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>C(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>C(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>C(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>C(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>C(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>C(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>C(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>C(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>C(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>C(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>C(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>C(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>C(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>C(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>C(()=>import("./typst-DHCkPAjA.js"),[],import.meta.url))},{id:"v",name:"V",import:(()=>C(()=>import("./v-BcVCzyr7.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>C(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>C(()=>import("./vb-D17OF-Vu.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>C(()=>import("./verilog-BQ8w6xss.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>C(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>C(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>C(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>C(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>C(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>C(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>C(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>C(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>C(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>C(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>C(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>C(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>C(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>C(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>C(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>C(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>C(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],wg=Object.fromEntries(Jd.map(e=>[e.id,e.import])),xg=Object.fromEntries(Jd.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),nc={...wg,...xg},Tg=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>C(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>C(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>C(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>C(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>C(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>C(()=>import("./catppuccin-frappe-DFWUc33u.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>C(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>C(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>C(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>C(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>C(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>C(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>C(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>C(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>C(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>C(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>C(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>C(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>C(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>C(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>C(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>C(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>C(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>C(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>C(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>C(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>C(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>C(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>C(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>C(()=>import("./kanagawa-wave-DWedfzmr.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>C(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>C(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>C(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>C(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>C(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>C(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>C(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>C(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>C(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>C(()=>import("./monokai-D4h5O-jR.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>C(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>C(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>C(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>C(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>C(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>C(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>C(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>C(()=>import("./red-bN70gL4F.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>C(()=>import("./rose-pine-qdsjHGoJ.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>C(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>C(()=>import("./rose-pine-moon-D4_iv3hh.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>C(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>C(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>C(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>C(()=>import("./solarized-dark-DXbdFlpD.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>C(()=>import("./solarized-light-L9t79GZl.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>C(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>C(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>C(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>C(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>C(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>C(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],kg=Object.fromEntries(Tg.map(e=>[e.id,e.import]));var Ag=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qx(){return 2147483648}function Gx(){return typeof performance<"u"?performance.now():Date.now()}const Wx=(e,t)=>e+(t-e%t)%t;async function Kx(e){let t,n;const i={};function a(b){n=b,i.HEAPU8=new Uint8Array(b),i.HEAPU32=new Uint32Array(b)}function s(b,S,w){i.HEAPU8.copyWithin(b,S,S+w)}function c(b){try{return t.grow(b-n.byteLength+65535>>>16),a(t.buffer),1}catch{}}function d(b){const S=i.HEAPU8.length;b=b>>>0;const w=qx();if(b>w)return!1;for(let A=1;A<=4;A*=2){let k=S*(1+.2/A);k=Math.min(k,b+100663296);const E=Math.min(w,Wx(Math.max(b,k),65536));if(c(E))return!0}return!1}const f=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function h(b,S,w=1024){const A=S+w;let k=S;for(;b[k]&&!(k>=A);)++k;if(k-S>16&&b.buffer&&f)return f.decode(b.subarray(S,k));let E="";for(;S<k;){let T=b[S++];if(!(T&128)){E+=String.fromCharCode(T);continue}const L=b[S++]&63;if((T&224)===192){E+=String.fromCharCode((T&31)<<6|L);continue}const O=b[S++]&63;if((T&240)===224?T=(T&15)<<12|L<<6|O:T=(T&7)<<18|L<<12|O<<6|b[S++]&63,T<65536)E+=String.fromCharCode(T);else{const D=T-65536;E+=String.fromCharCode(55296|D>>10,56320|D&1023)}}return E}function m(b,S){return b?h(i.HEAPU8,b,S):""}const g={emscripten_get_now:Gx,emscripten_memcpy_big:s,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const S=await e({env:g,wasi_snapshot_preview1:g});t=S.memory,a(t.buffer),Object.assign(i,S),i.UTF8ToString=m}return await y(),i}var Yx=Object.defineProperty,Xx=(e,t,n)=>t in e?Yx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$t=(e,t,n)=>Xx(e,typeof t!="symbol"?t+"":t,n);let Jt=null;function Qx(e){throw new Ag(e.UTF8ToString(e.getLastOnigError()))}class ef{constructor(t){$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16Value"),$t(this,"utf8Value"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16");const n=t.length,i=ef._utf8ByteLength(t),a=i!==n,s=a?new Uint32Array(n+1):null;a&&(s[n]=i);const c=a?new Uint32Array(i+1):null;a&&(c[i]=n);const d=new Uint8Array(i);let f=0;for(let h=0;h<n;h++){const m=t.charCodeAt(h);let g=m,y=!1;if(m>=55296&&m<=56319&&h+1<n){const b=t.charCodeAt(h+1);b>=56320&&b<=57343&&(g=(m-55296<<10)+65536|b-56320,y=!0)}a&&(s[h]=f,y&&(s[h+1]=f),g<=127?c[f+0]=h:g<=2047?(c[f+0]=h,c[f+1]=h):g<=65535?(c[f+0]=h,c[f+1]=h,c[f+2]=h):(c[f+0]=h,c[f+1]=h,c[f+2]=h,c[f+3]=h)),g<=127?d[f++]=g:g<=2047?(d[f++]=192|(g&1984)>>>6,d[f++]=128|(g&63)>>>0):g<=65535?(d[f++]=224|(g&61440)>>>12,d[f++]=128|(g&4032)>>>6,d[f++]=128|(g&63)>>>0):(d[f++]=240|(g&1835008)>>>18,d[f++]=128|(g&258048)>>>12,d[f++]=128|(g&4032)>>>6,d[f++]=128|(g&63)>>>0),y&&h++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=c}static _utf8ByteLength(t){let n=0;for(let i=0,a=t.length;i<a;i++){const s=t.charCodeAt(i);let c=s,d=!1;if(s>=55296&&s<=56319&&i+1<a){const f=t.charCodeAt(i+1);f>=56320&&f<=57343&&(c=(s-55296<<10)+65536|f-56320,d=!0)}c<=127?n+=1:c<=2047?n+=2:c<=65535?n+=3:n+=4,d&&i++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const tf=class Bi{constructor(t){if($t(this,"id",++Bi.LAST_ID),$t(this,"_onigBinding"),$t(this,"content"),$t(this,"utf16Length"),$t(this,"utf8Length"),$t(this,"utf16OffsetToUtf8"),$t(this,"utf8OffsetToUtf16"),$t(this,"ptr"),!Jt)throw new Ag("Must invoke loadWasm first.");this._onigBinding=Jt,this.content=t;const n=new ef(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Bi._sharedPtrInUse?(Bi._sharedPtr||(Bi._sharedPtr=Jt.omalloc(1e4)),Bi._sharedPtrInUse=!0,Jt.HEAPU8.set(n.utf8Value,Bi._sharedPtr),this.ptr=Bi._sharedPtr):this.ptr=n.createString(Jt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Bi._sharedPtr?Bi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};$t(tf,"LAST_ID",0);$t(tf,"_sharedPtr",0);$t(tf,"_sharedPtrInUse",!1);let t2=tf;class Zx{constructor(t){if($t(this,"_onigBinding"),$t(this,"_ptr"),!Jt)throw new Ag("Must invoke loadWasm first.");const n=[],i=[];for(let d=0,f=t.length;d<f;d++){const h=new ef(t[d]);n[d]=h.createString(Jt),i[d]=h.utf8Length}const a=Jt.omalloc(4*t.length);Jt.HEAPU32.set(n,a/4);const s=Jt.omalloc(4*t.length);Jt.HEAPU32.set(i,s/4);const c=Jt.createOnigScanner(a,s,t.length);for(let d=0,f=t.length;d<f;d++)Jt.ofree(n[d]);Jt.ofree(s),Jt.ofree(a),c===0&&Qx(Jt),this._onigBinding=Jt,this._ptr=c}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,i){let a=0;if(typeof i=="number"&&(a=i),typeof t=="string"){t=new t2(t);const s=this._findNextMatchSync(t,n,!1,a);return t.dispose(),s}return this._findNextMatchSync(t,n,!1,a)}_findNextMatchSync(t,n,i,a){const s=this._onigBinding,c=s.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),a);if(c===0)return null;const d=s.HEAPU32;let f=c/4;const h=d[f++],m=d[f++],g=[];for(let y=0;y<m;y++){const b=t.convertUtf8OffsetToUtf16(d[f++]),S=t.convertUtf8OffsetToUtf16(d[f++]);g[y]={start:b,end:S,length:S-b}}return{index:h,captureIndices:g}}}function Jx(e){return typeof e.instantiator=="function"}function eT(e){return typeof e.default=="function"}function tT(e){return typeof e.data<"u"}function nT(e){return typeof Response<"u"&&e instanceof Response}function iT(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}let qu;function Lg(e){if(qu)return qu;async function t(){Jt=await Kx(async n=>{let i=e;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),Jx(i)?i=await i.instantiator(n):eT(i)?i=await i.default(n):(tT(i)&&(i=i.data),nT(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await rT(i)(n):i=await oT(i)(n):iT(i)?i=await Rp(i)(n):i instanceof WebAssembly.Module?i=await Rp(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await Rp(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return qu=t(),qu}function Rp(e){return t=>WebAssembly.instantiate(e,t)}function rT(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oT(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let n2;function aT(e){n2=e}function sT(){return n2}async function Ig(e){return e&&await Lg(e),{createScanner(t){return new Zx(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new t2(t)}}}const lT=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:Ig,getDefaultWasmLoader:sT,loadWasm:Lg,setDefaultWasmLoader:aT},Symbol.toStringTag,{value:"Module"}));var i2=Eg({});e2(i2,lT);var gt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function cT(e){return Rg(e)}function Rg(e){return Array.isArray(e)?uT(e):e instanceof RegExp?e:typeof e=="object"?dT(e):e}function uT(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=Rg(e[n]);return t}function dT(e){let t={};for(let n in e)t[n]=Rg(e[n]);return t}function r2(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function o2(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?o2(e.substring(0,e.length-1)):e.substr(~t+1)}var Dp=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Gu=class{static hasCaptures(e){return e===null?!1:(Dp.lastIndex=0,Dp.test(e))}static replaceCaptures(e,t,n){return e.replace(Dp,(i,a,s,c)=>{let d=n[parseInt(a||s,10)];if(d){let f=t.substring(d.start,d.end);for(;f[0]===".";)f=f.substring(1);switch(c){case"downcase":return f.toLowerCase();case"upcase":return f.toUpperCase();default:return f}}else return i})}};function a2(e,t){return e<t?-1:e>t?1:0}function s2(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let a=0;a<n;a++){let s=a2(e[a],t[a]);if(s!==0)return s}return 0}return n-i}function Dy(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 l2(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var c2=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Id=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(pT(e),t)}static createFromParsedTheme(e,t){return gT(e,t)}_cachedMatchRoot=new c2(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(a=>fT(e.parent,a.parentScopes));return i?new u2(i.fontStyle,i.foreground,i.background):null}},Mp=class md{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new md(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new md(n,t[i]);return n}push(t){return new md(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function fT(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],a=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],a=!0}for(;e&&!hT(e.scopeName,i);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function hT(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var u2=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function pT(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let a=0,s=t.length;a<s;a++){let c=t[a];if(!c.settings)continue;let d;if(typeof c.scope=="string"){let g=c.scope;g=g.replace(/^[,]+/,""),g=g.replace(/[,]+$/,""),d=g.split(",")}else Array.isArray(c.scope)?d=c.scope:d=[""];let f=-1;if(typeof c.settings.fontStyle=="string"){f=0;let g=c.settings.fontStyle.split(" ");for(let y=0,b=g.length;y<b;y++)switch(g[y]){case"italic":f=f|1;break;case"bold":f=f|2;break;case"underline":f=f|4;break;case"strikethrough":f=f|8;break}}let h=null;typeof c.settings.foreground=="string"&&Dy(c.settings.foreground)&&(h=c.settings.foreground);let m=null;typeof c.settings.background=="string"&&Dy(c.settings.background)&&(m=c.settings.background);for(let g=0,y=d.length;g<y;g++){let S=d[g].trim().split(" "),w=S[S.length-1],A=null;S.length>1&&(A=S.slice(0,S.length-1),A.reverse()),n[i++]=new mT(w,A,a,f,h,m)}}return n}var mT=class{constructor(e,t,n,i,a,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=a,this.background=s}},gn=(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))(gn||{});function gT(e,t){e.sort((f,h)=>{let m=a2(f.scope,h.scope);return m!==0||(m=s2(f.parentScopes,h.parentScopes),m!==0)?m:f.index-h.index});let n=0,i="#000000",a="#ffffff";for(;e.length>=1&&e[0].scope==="";){let f=e.shift();f.fontStyle!==-1&&(n=f.fontStyle),f.foreground!==null&&(i=f.foreground),f.background!==null&&(a=f.background)}let s=new vT(t),c=new u2(n,s.getId(i),s.getId(a)),d=new bT(new Cm(0,null,-1,0,0),[]);for(let f=0,h=e.length;f<h;f++){let m=e[f];d.insert(0,m.scope,m.parentScopes,m.fontStyle,s.getId(m.foreground),s.getId(m.background))}return new Id(s,c,d)}var vT=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 new 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)}},yT=Object.freeze([]),Cm=class d2{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,a,s){this.scopeDepth=t,this.parentScopes=n||yT,this.fontStyle=i,this.foreground=a,this.background=s}clone(){return new d2(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,a=t.length;i<a;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,a){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),a!==0&&(this.background=a)}},bT=class Em{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,a=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[a]===">"&&a++,!(i>=t.parentScopes.length||a>=n.parentScopes.length);){const s=n.parentScopes[a].length-t.parentScopes[i].length;if(s!==0)return s;i++,a++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),a,s;if(i===-1?(a=t,s=""):(a=t.substring(0,i),s=t.substring(i+1)),this._children.hasOwnProperty(a))return this._children[a].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Em._cmpBySpecificity),n}insert(t,n,i,a,s,c){if(n===""){this._doInsertHere(t,i,a,s,c);return}let d=n.indexOf("."),f,h;d===-1?(f=n,h=""):(f=n.substring(0,d),h=n.substring(d+1));let m;this._children.hasOwnProperty(f)?m=this._children[f]:(m=new Em(this._mainRule.clone(),Cm.cloneArr(this._rulesWithParentScopes)),this._children[f]=m),m.insert(t+1,h,i,a,s,c)}_doInsertHere(t,n,i,a,s){if(n===null){this._mainRule.acceptOverwrite(t,i,a,s);return}for(let c=0,d=this._rulesWithParentScopes.length;c<d;c++){let f=this._rulesWithParentScopes[c];if(s2(f.parentScopes,n)===0){f.acceptOverwrite(t,i,a,s);return}}i===-1&&(i=this._mainRule.fontStyle),a===0&&(a=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Cm(t,n,i,a,s))}},ia=class ui{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ui.getLanguageId(t),i=ui.getTokenType(t),a=ui.getFontStyle(t),s=ui.getForeground(t),c=ui.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:a,foreground:s,background:c})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,a,s,c,d){let f=ui.getLanguageId(t),h=ui.getTokenType(t),m=ui.containsBalancedBrackets(t)?1:0,g=ui.getFontStyle(t),y=ui.getForeground(t),b=ui.getBackground(t);return n!==0&&(f=n),i!==8&&(h=i),a!==null&&(m=a?1:0),s!==-1&&(g=s),c!==0&&(y=c),d!==0&&(b=d),(f<<0|h<<8|m<<10|g<<11|y<<15|b<<24)>>>0}};function Rd(e,t){const n=[],i=ST(e);let a=i.next();for(;a!==null;){let f=0;if(a.length===2&&a.charAt(1)===":"){switch(a.charAt(0)){case"R":f=1;break;case"L":f=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=i.next()}let h=c();if(n.push({matcher:h,priority:f}),a!==",")break;a=i.next()}return n;function s(){if(a==="-"){a=i.next();const f=s();return h=>!!f&&!f(h)}if(a==="("){a=i.next();const f=d();return a===")"&&(a=i.next()),f}if(My(a)){const f=[];do f.push(a),a=i.next();while(My(a));return h=>t(f,h)}return null}function c(){const f=[];let h=s();for(;h;)f.push(h),h=s();return m=>f.every(g=>g(m))}function d(){const f=[];let h=c();for(;h&&(f.push(h),a==="|"||a===",");){do a=i.next();while(a==="|"||a===",");h=c()}return m=>f.some(g=>g(m))}}function My(e){return!!e&&!!e.match(/[\w\.:]+/)}function ST(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function f2(e){typeof e.dispose=="function"&&e.dispose()}var ic=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_T=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},CT=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ET=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ic(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new CT;for(const n of e)wT(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof ic){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function wT(e,t,n,i){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const s=n.lookup(t);e instanceof ic?gd({baseGrammar:s,selfGrammar:a},i):wm(e.ruleName,{baseGrammar:s,selfGrammar:a,repository:a.repository},i);const c=n.injections(e.scopeName);if(c)for(const d of c)i.add(new ic(d))}function wm(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];Dd([i],t,n)}}function gd(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Dd(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Dd(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Dd(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const a=i.repository?r2({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&Dd(i.patterns,{...t,repository:a},n);const s=i.include;if(!s)continue;const c=h2(s);switch(c.kind){case 0:gd({...t,selfGrammar:t.baseGrammar},n);break;case 1:gd(t,n);break;case 2:wm(c.ruleName,{...t,repository:a},n);break;case 3:case 4:const d=c.scopeName===t.selfGrammar.scopeName?t.selfGrammar:c.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const f={baseGrammar:t.baseGrammar,selfGrammar:d,repository:a};c.kind===4?wm(c.ruleName,f,n):gd(f,n)}else c.kind===4?n.add(new _T(c.scopeName,c.ruleName)):n.add(new ic(c.scopeName));break}}}var xT=class{kind=0},TT=class{kind=1},kT=class{constructor(e){this.ruleName=e}kind=2},AT=class{constructor(e){this.scopeName=e}kind=3},LT=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function h2(e){if(e==="$base")return new xT;if(e==="$self")return new TT;const t=e.indexOf("#");if(t===-1)return new AT(e);if(t===0)return new kT(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new LT(n,i)}}var IT=/\\(\d+)/,Oy=/\\(\d+)/g,RT=-1,p2=-2;var Ec=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Gu.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Gu.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${o2(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:Gu.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Gu.replaceCaptures(this._contentName,e,t)}},DT=class extends Ec{retokenizeCapturedWithRuleId;constructor(e,t,n,i,a){super(e,t,n,i),this.retokenizeCapturedWithRuleId=a}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},MT=class extends Ec{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,a){super(e,t,n,null),this._match=new rc(i,this.id),this.captures=a,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Py=class extends Ec{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,a){super(e,t,n,i),this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},xm=class extends Ec{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,a,s,c,d,f,h){super(e,t,n,i),this._begin=new rc(a,this.id),this.beginCaptures=s,this._end=new rc(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=d,this.applyEndPatternLast=f||!1,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=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,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oc;for(const n of this.patterns)e.getRule(n).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}},Md=class extends Ec{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,a,s,c,d,f){super(e,t,n,i),this._begin=new rc(a,this.id),this.beginCaptures=s,this.whileCaptures=d,this._while=new rc(c,p2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=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,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oc;for(const 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,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new oc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},m2=class mn{static createCaptureRule(t,n,i,a,s){return t.registerRule(c=>new DT(n,c,i,a,s))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(a=>{if(t.id=a,t.match)return new MT(t.$vscodeTextmateLocation,t.id,t.name,t.match,mn._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=r2({},i,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Py(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,mn._compilePatterns(s,n,i))}return t.while?new Md(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,mn._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,mn._compileCaptures(t.whileCaptures||t.captures,n,i),mn._compilePatterns(t.patterns,n,i)):new xm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,mn._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,mn._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,mn._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let a=[];if(t){let s=0;for(const c in t){if(c==="$vscodeTextmateLocation")continue;const d=parseInt(c,10);d>s&&(s=d)}for(let c=0;c<=s;c++)a[c]=null;for(const c in t){if(c==="$vscodeTextmateLocation")continue;const d=parseInt(c,10);let f=0;t[c].patterns&&(f=mn.getCompiledRuleId(t[c],n,i)),a[d]=mn.createCaptureRule(n,t[c].$vscodeTextmateLocation,t[c].name,t[c].contentName,f)}}return a}static _compilePatterns(t,n,i){let a=[];if(t)for(let s=0,c=t.length;s<c;s++){const d=t[s];let f=-1;if(d.include){const h=h2(d.include);switch(h.kind){case 0:case 1:f=mn.getCompiledRuleId(i[d.include],n,i);break;case 2:let m=i[h.ruleName];m&&(f=mn.getCompiledRuleId(m,n,i));break;case 3:case 4:const g=h.scopeName,y=h.kind===4?h.ruleName:null,b=n.getExternalGrammar(g,i);if(b)if(y){let S=b.repository[y];S&&(f=mn.getCompiledRuleId(S,n,b.repository))}else f=mn.getCompiledRuleId(b.repository.$self,n,b.repository);break}}else f=mn.getCompiledRuleId(d,n,i);if(f!==-1){const h=n.getRule(f);let m=!1;if((h instanceof Py||h instanceof xm||h instanceof Md)&&h.hasMissingPatterns&&h.patterns.length===0&&(m=!0),m)continue;a.push(f)}}return{patterns:a,hasMissingPatterns:(t?t.length:0)!==a.length}}},rc=class g2{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let a=0,s=[],c=!1;for(let d=0;d<i;d++)if(t.charAt(d)==="\\"&&d+1<i){const h=t.charAt(d+1);h==="z"?(s.push(t.substring(a,d)),s.push("$(?!\\n)(?<!\\n)"),a=d+2):(h==="A"||h==="G")&&(c=!0),d++}this.hasAnchor=c,a===0?this.source=t:(s.push(t.substring(a,i)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=IT.test(this.source):this.hasBackReferences=!1}clone(){return new g2(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(a=>t.substring(a.start,a.end));return Oy.lastIndex=0,this.source.replace(Oy,(a,s)=>l2(i[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],a=[],s,c,d,f;for(s=0,c=this.source.length;s<c;s++)d=this.source.charAt(s),t[s]=d,n[s]=d,i[s]=d,a[s]=d,d==="\\"&&s+1<c&&(f=this.source.charAt(s+1),f==="A"?(t[s+1]="￿",n[s+1]="￿",i[s+1]="A",a[s+1]="A"):f==="G"?(t[s+1]="￿",n[s+1]="G",i[s+1]="￿",a[s+1]="G"):(t[s+1]=f,n[s+1]=f,i[s+1]=f,a[s+1]=f),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:a.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},oc=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(),this._cached=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(n=>n.source);this._cached=new Ny(e,t,this._items.map(n=>n.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){let i=this._items.map(a=>a.resolveAnchors(t,n));return new Ny(e,i,this._items.map(a=>a.ruleId))}},Ny=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
19
19
  `)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Op=class{constructor(e,t){this.languageId=e,this.tokenType=t}},OT=class Tm{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Op(t,8),this._embeddedLanguagesMatcher=new PT(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Tm._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Op(0,0);_getBasicScopeAttributes=new c2(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Op(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Tm.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 new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},PT=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>l2(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Hy=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function v2(e,t,n,i,a,s,c,d){const f=t.content.length;let h=!1,m=-1;if(c){const b=NT(e,t,n,i,a,s);a=b.stack,i=b.linePos,n=b.isFirstLine,m=b.anchorPosition}const g=Date.now();for(;!h;){if(d!==0&&Date.now()-g>d)return new Hy(a,!0);y()}return new Hy(a,!1);function y(){const b=HT(e,t,n,i,a,m);if(!b){s.produce(a,f),h=!0;return}const S=b.captureIndices,w=b.matchedRuleId,A=S&&S.length>0?S[0].end>i:!1;if(w===RT){const k=a.getRule(e);s.produce(a,S[0].start),a=a.withContentNameScopesList(a.nameScopesList),Bl(e,t,n,a,s,k.endCaptures,S),s.produce(a,S[0].end);const E=a;if(a=a.parent,m=E.getAnchorPos(),!A&&E.getEnterPos()===i){a=E,s.produce(a,f),h=!0;return}}else{const k=e.getRule(w);s.produce(a,S[0].start);const E=a,T=k.getName(t.content,S),L=a.contentNameScopesList.pushAttributed(T,e);if(a=a.push(w,i,m,S[0].end===f,null,L,L),k instanceof xm){const O=k;Bl(e,t,n,a,s,O.beginCaptures,S),s.produce(a,S[0].end),m=S[0].end;const D=O.getContentName(t.content,S),N=L.pushAttributed(D,e);if(a=a.withContentNameScopesList(N),O.endHasBackReferences&&(a=a.withEndRule(O.getEndWithResolvedBackReferences(t.content,S))),!A&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,f),h=!0;return}}else if(k instanceof Md){const O=k;Bl(e,t,n,a,s,O.beginCaptures,S),s.produce(a,S[0].end),m=S[0].end;const D=O.getContentName(t.content,S),N=L.pushAttributed(D,e);if(a=a.withContentNameScopesList(N),O.whileHasBackReferences&&(a=a.withEndRule(O.getWhileWithResolvedBackReferences(t.content,S))),!A&&E.hasSameRuleAs(a)){a=a.pop(),s.produce(a,f),h=!0;return}}else if(Bl(e,t,n,a,s,k.captures,S),s.produce(a,S[0].end),a=a.pop(),!A){a=a.safePop(),s.produce(a,f),h=!0;return}}S[0].end>i&&(i=S[0].end,n=!1)}}function NT(e,t,n,i,a,s){let c=a.beginRuleCapturedEOL?0:-1;const d=[];for(let f=a;f;f=f.pop()){const h=f.getRule(e);h instanceof Md&&d.push({rule:h,stack:f})}for(let f=d.pop();f;f=d.pop()){const{ruleScanner:h,findOptions:m}=BT(f.rule,e,f.stack.endRule,n,i===c),g=h.findNextMatchSync(t,i,m);if(g){if(g.ruleId!==p2){a=f.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(s.produce(f.stack,g.captureIndices[0].start),Bl(e,t,n,f.stack,s,f.rule.whileCaptures,g.captureIndices),s.produce(f.stack,g.captureIndices[0].end),c=g.captureIndices[0].end,g.captureIndices[0].end>i&&(i=g.captureIndices[0].end,n=!1))}else{a=f.stack.pop();break}}return{stack:a,linePos:i,anchorPosition:c,isFirstLine:n}}function HT(e,t,n,i,a,s){const c=zT(e,t,n,i,a,s),d=e.getInjections();if(d.length===0)return c;const f=VT(d,e,t,n,i,a,s);if(!f)return c;if(!c)return f;const h=c.captureIndices[0].start,m=f.captureIndices[0].start;return m<h||f.priorityMatch&&m===h?f:c}function zT(e,t,n,i,a,s){const c=a.getRule(e),{ruleScanner:d,findOptions:f}=y2(c,e,a.endRule,n,i===s),h=d.findNextMatchSync(t,i,f);return h?{captureIndices:h.captureIndices,matchedRuleId:h.ruleId}:null}function VT(e,t,n,i,a,s,c){let d=Number.MAX_VALUE,f=null,h,m=0;const g=s.contentNameScopesList.getScopeNames();for(let y=0,b=e.length;y<b;y++){const S=e[y];if(!S.matcher(g))continue;const w=t.getRule(S.ruleId),{ruleScanner:A,findOptions:k}=y2(w,t,null,i,a===c),E=A.findNextMatchSync(n,a,k);if(!E)continue;const T=E.captureIndices[0].start;if(!(T>=d)&&(d=T,f=E.captureIndices,h=E.ruleId,m=S.priority,d===a))break}return f?{priorityMatch:m===-1,captureIndices:f,matchedRuleId:h}:null}function y2(e,t,n,i,a){return{ruleScanner:e.compileAG(t,n,i,a),findOptions:0}}function BT(e,t,n,i,a){return{ruleScanner:e.compileWhileAG(t,n,i,a),findOptions:0}}function Bl(e,t,n,i,a,s,c){if(s.length===0)return;const d=t.content,f=Math.min(s.length,c.length),h=[],m=c[0].end;for(let g=0;g<f;g++){const y=s[g];if(y===null)continue;const b=c[g];if(b.length===0)continue;if(b.start>m)break;for(;h.length>0&&h[h.length-1].endPos<=b.start;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop();if(h.length>0?a.produceFromScopes(h[h.length-1].scopes,b.start):a.produce(i,b.start),y.retokenizeCapturedWithRuleId){const w=y.getName(d,c),A=i.contentNameScopesList.pushAttributed(w,e),k=y.getContentName(d,c),E=A.pushAttributed(k,e),T=i.push(y.retokenizeCapturedWithRuleId,b.start,-1,!1,null,A,E),L=e.createOnigString(d.substring(0,b.end));v2(e,L,n&&b.start===0,b.start,T,a,!1,0),f2(L);continue}const S=y.getName(d,c);if(S!==null){const A=(h.length>0?h[h.length-1].scopes:i.contentNameScopesList).pushAttributed(S,e);h.push(new UT(A,b.end))}}for(;h.length>0;)a.produceFromScopes(h[h.length-1].scopes,h[h.length-1].endPos),h.pop()}var UT=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function FT(e,t,n,i,a,s,c,d){return new $T(e,t,n,i,a,s,c,d)}function zy(e,t,n,i,a){const s=Rd(t,Od),c=m2.getCompiledRuleId(n,i,a.repository);for(const d of s)e.push({debugSelector:t,matcher:d.matcher,ruleId:c,grammar:a,priority:d.priority})}function Od(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let a=n;a<t.length;a++)if(jT(t[a],i))return n=a+1,!0;return!1})}function jT(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var $T=class{constructor(e,t,n,i,a,s,c,d){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=d,this._basicScopeAttributesProvider=new OT(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=c,this._grammar=Vy(t,null),this._injections=null,this._tokenTypeMatchers=[],a)for(const f of Object.keys(a)){const h=Rd(f,Od);for(const m of h)this._tokenTypeMatchers.push({matcher:m.matcher,type:a[f]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const 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(){const e={lookup:a=>a===this._rootScopeName?this._grammar:this.getExternalGrammar(a),injections:a=>this._grammarRepository.injections(a)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const a=i.injections;if(a)for(let c in a)zy(t,c,a[c],this,i);const s=this._grammarRepository.injections(n);s&&s.forEach(c=>{const d=this.getExternalGrammar(c);if(d){const f=d.injectionSelector;f&&zy(t,f,d,this,d)}})}return t.sort((a,s)=>a.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Vy(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=m2.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let a;if(!t||t===km.NULL){a=!0;const h=this._basicScopeAttributesProvider.getDefaultAttributes(),m=this.themeProvider.getDefaults(),g=ia.set(0,h.languageId,h.tokenType,null,m.fontStyle,m.foregroundId,m.backgroundId),y=this.getRule(this._rootId).getName(null,null);let b;y?b=Kl.createRootAndLookUpScopeName(y,g,this):b=Kl.createRoot("unknown",g),t=new km(null,this._rootId,-1,-1,!1,null,b,b)}else a=!1,t.reset();e=e+`
20
- `;const s=this.createOnigString(e),c=s.content.length,d=new GT(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=v2(this,s,a,0,t,d,!0,i);return f2(s),{lineLength:c,lineTokens:d,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function Vy(e,t){return e=cT(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 Kl=class Ui{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,a=t?.scopePath??null;for(const s of n)a=Mp.push(a,s.scopeNames),i=new Ui(i,a,s.encodedTokenAttributes);return i}static createRoot(t,n){return new Ui(null,new Mp(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const a=i.getMetadataForScope(t),s=new Mp(null,t),c=i.themeProvider.themeMatch(s),d=Ui.mergeAttributes(n,a,c);return new Ui(null,s,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ui.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let a=-1,s=0,c=0;return i!==null&&(a=i.fontStyle,s=i.foregroundId,c=i.backgroundId),ia.set(t,n.languageId,n.tokenType,null,a,s,c)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ui._pushAttributed(this,t,n);const i=t.split(/ /g);let a=this;for(const s of i)a=Ui._pushAttributed(a,s,n);return a}static _pushAttributed(t,n,i){const a=i.getMetadataForScope(n),s=t.scopePath.push(n),c=i.themeProvider.themeMatch(s),d=Ui.mergeAttributes(t.tokenAttributes,a,c);return new Ui(t,s,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},km=class Qo{constructor(t,n,i,a,s,c,d,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=c,this.nameScopesList=d,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new Qo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Qo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Kl.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Qo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,a,s,c,d){return new Qo(this,t,n,i,a,s,c,d)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Qo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId: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){const i=Kl.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Qo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Kl.fromExtension(i,n.contentNameScopesList))}},qT=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Rd(n,Od).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Rd(n,Od).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},GT=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const c of this._tokenTypeOverrides)c.matcher(s)&&(i=ia.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(s))}if(a&&(i=ia.set(i,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const 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);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,a=this._binaryTokens.length;i<a;i++)n[i]=this._binaryTokens[i];return n}},WT=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const 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,i,a){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,FT(e,s,t,n,i,a,this,this._onigLib))}return this._grammars.get(e)}},KT=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new WT(Id.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Id.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new qT(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,a,s){const c=new ET(this._syncRegistry,t);for(;c.Q.length>0;)c.Q.map(d=>this._loadSingleGrammar(d.scopeName)),c.processQueue();return this._grammarForScopeName(t,n,i,a,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,a=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,a)}_grammarForScopeName(t,n=0,i=null,a=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,i,a,s)}},Am=km.NULL;function Pd(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[a,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[a]=s:a===i&&Object.assign(n,s);return n}function So(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function YT(e){return Array.isArray(e)?e:[e]}async function b2(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function nf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function S2(e){return e==="ansi"||nf(e)}function rf(e){return e==="none"}function _2(e){return rf(e)}const XT=/(\r?\n)/g;function of(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(XT);let i=0;const a=[];for(let s=0;s<n.length;s+=2){const c=t?n[s]+(n[s+1]||""):n[s];a.push([c,i]),i+=n[s].length,i+=n[s+1]?.length||0}return a}const By={light:"#333333",dark:"#bbbbbb"},Uy={light:"#fffffe",dark:"#1e1e1e"},Fy="__shiki_resolved";function af(e){if(e?.[Fy])return e;const 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:i}=t;if(!n||!i){const d=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;d?.settings?.foreground&&(i=d.settings.foreground),d?.settings?.background&&(n=d.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?By.light:By.dark),n||(n=t.type==="light"?Uy.light:Uy.dark),t.fg=i,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 a=0;const s=new Map;function c(d){if(s.has(d))return s.get(d);a+=1;const f=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?c(d):(s.set(d,f),f)}t.settings=t.settings.map(d=>{const f=d.settings?.foreground&&!d.settings.foreground.startsWith("#"),h=d.settings?.background&&!d.settings.background.startsWith("#");if(!f&&!h)return d;const m={...d,settings:{...d.settings}};if(f){const g=c(d.settings.foreground);t.colorReplacements[g]=d.settings.foreground,m.settings.foreground=g}if(h){const g=c(d.settings.background);t.colorReplacements[g]=d.settings.background,m.settings.background=g}return m});for(const d of Object.keys(t.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!t.colors[d]?.startsWith("#")){const f=c(t.colors[d]);t.colorReplacements[f]=t.colors[d],t.colors[d]=f}return Object.defineProperty(t,Fy,{enumerable:!1,writable:!1,value:!0}),t}async function C2(e){return[...new Set((await Promise.all(e.filter(t=>!S2(t)).map(async t=>await b2(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function E2(e){return(await Promise.all(e.map(async t=>_2(t)?null:af(await b2(t))))).filter(t=>!!t)}function w2(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gt(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var QT=class extends KT{_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,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=af(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Id.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=w2(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(const a of t)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const t=[...this._langGraph.entries()],n=t.filter(([i,a])=>!a);if(n.length){const i=t.filter(([a,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(c=>n.map(([d])=>d).includes(c)):!1).filter(a=>!n.includes(a));throw new gt(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${i.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[i,a]of t)this._resolver.addLanguage(a);for(const[i,a]of t)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(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);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},ZT=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}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){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const a=t.slice(0,i).join(".");n=[...n,...this._injections.get(a)||[]]}return n}};let Il=0;function JT(e){Il+=1,e.warnings!==!1&&Il>=10&&Il%10===0&&console.warn(`[Shiki] ${Il} 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 gt("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(af),a=new QT(new ZT(e.engine,n),i,n,e.langAlias);let s;function c(E){return w2(E,e.langAlias)}function d(E){A();const T=a.getGrammar(typeof E=="string"?E:E.name);if(!T)throw new gt(`Language \`${E}\` not found, you may need to load it first`);return T}function f(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};A();const T=a.getTheme(E);if(!T)throw new gt(`Theme \`${E}\` not found, you may need to load it first`);return T}function h(E){A();const T=f(E);return s!==E&&(a.setTheme(T),s=E),{theme:T,colorMap:a.getColorMap()}}function m(){return A(),a.getLoadedThemes()}function g(){return A(),a.getLoadedLanguages()}function y(...E){A(),a.loadLanguages(E.flat(1))}async function b(...E){return y(await C2(E))}function S(...E){A();for(const T of E.flat(1))a.loadTheme(T)}async function w(...E){return A(),S(await E2(E))}function A(){if(t)throw new gt("Shiki instance has been disposed")}function k(){t||(t=!0,a.dispose(),Il-=1)}return{setTheme:h,getTheme:f,getLanguage:d,getLoadedThemes:m,getLoadedLanguages:g,resolveLangAlias:c,loadLanguage:b,loadLanguageSync:y,loadTheme:w,loadThemeSync:S,dispose:k,[Symbol.dispose]:k}}async function e3(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([E2(e.themes||[]),C2(e.langs||[]),e.engine]);return JT({...e,themes:t,langs:n,engine:i})}const x2=new WeakMap;function sf(e,t){x2.set(e,t)}function ac(e){return x2.get(e)}var lf=class T2{_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 T2(Object.fromEntries(YT(n).map(i=>[i,Am])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,a]=t;this.lang=i,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return t3(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function t3(e){const t=[],n=new Set;function i(a){if(n.has(a))return;n.add(a);const s=a?.nameScopesList?.scopeName;s&&t.push(s),a.parent&&i(a.parent)}return i(e),t}function n3(e,t){if(!(e instanceof lf))throw new gt("Invalid grammar state");return e.getInternalStack(t)}const i3=/,/,r3=/ /;function k2(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(nf(e.resolveLangAlias(n.lang||"text"))||rf(i))return of(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:a,colorMap:s}=e.setTheme(i),c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new gt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new gt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return a3(t,c,a,s,n)}function o3(...e){if(e.length===2)return ac(e[1]);const[t,n,i={}]=e,{lang:a="text",theme:s=t.getLoadedThemes()[0]}=i;if(nf(a)||rf(s))throw new gt("Plain language does not have grammar state");if(a==="ansi")throw new gt("ANSI language does not have grammar state");const{theme:c,colorMap:d}=t.setTheme(s),f=t.getLanguage(a);return new lf(Dg(n,f,c,d,i).stateStack,f.name,c.name)}function a3(e,t,n,i,a){const s=Dg(e,t,n,i,a),c=new lf(s.stateStack,t.name,n.name);return sf(s.tokens,c),s.tokens}function Dg(e,t,n,i,a){const s=Pd(n,a),{tokenizeMaxLineLength:c=0,tokenizeTimeLimit:d=500,includeExplanation:f=!1}=a,h=of(e);let m=a.grammarState?n3(a.grammarState,n.name)??Am:a.grammarContextCode!=null?Dg(a.grammarContextCode,t,n,i,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:Am,g=[];const y=[];for(let b=0,S=h.length;b<S;b++){const[w,A]=h[b];if(w===""){g=[],y.push([]);continue}if(c>0&&w.length>=c){g=[],y.push([{content:w,offset:A,color:"",fontStyle:0}]);continue}let k,E,T;f&&f!=="tokenType"&&(k=t.tokenizeLine(w,m,d),E=k.tokens,T=0);const L=t.tokenizeLine2(w,m,d),O=L.tokens.length/2;for(let D=0;D<O;D++){const N=L.tokens[2*D],W=D+1<O?L.tokens[2*D+2]:w.length;if(N===W)continue;const G=L.tokens[2*D+1],se=So(i[ia.getForeground(G)],s),ie=ia.getFontStyle(G),ee={content:w.substring(N,W),offset:A+N,color:se,fontStyle:ie};if(f==="tokenType")ee.type=ia.getTokenType(G);else if(f){const te=[];if(f!=="scopeName")for(const me of n.settings){let H;switch(typeof me.scope){case"string":H=me.scope.split(i3).map(z=>z.trim());break;case"object":H=me.scope;break;default:continue}te.push({settings:me,selectors:H.map(z=>z.split(r3))})}ee.explanation=[];let le=0;for(;N+le<W;){const me=E[T],H=w.substring(me.startIndex,me.endIndex);le+=H.length,ee.explanation.push({content:H,scopes:f==="scopeName"?s3(me.scopes):l3(te,me.scopes)}),T+=1}}g.push(ee)}y.push(g),g=[],m=L.ruleStack}return{tokens:y,stateStack:m}}function s3(e){return e.map(t=>({scopeName:t}))}function l3(e,t){const n=[];for(let i=0,a=t.length;i<a;i++){const s=t[i];n[i]={scopeName:s,themeMatches:u3(e,s,t.slice(0,i))}}return n}function jy(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function c3(e,t,n){if(!jy(e.at(-1),t))return!1;let i=e.length-2,a=n.length-1;for(;i>=0&&a>=0;)jy(e[i],n[a])&&(i-=1),a-=1;return i===-1}function u3(e,t,n){const i=[];for(const{selectors:a,settings:s}of e)for(const c of a)if(c3(c,t,n)){i.push(s);break}return i}function A2(e,t,n,i=k2){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),s=a.map(h=>{const m=i(e,t,{...n,theme:h.theme});return{tokens:m,state:ac(m),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),c=d3(...s.map(h=>h.tokens)),d=c[0].map((h,m)=>h.map((g,y)=>{const b={content:g.content,variants:{},offset:g.offset};return"includeExplanation"in n&&n.includeExplanation&&(b.explanation=g.explanation),c.forEach((S,w)=>{const{content:A,explanation:k,offset:E,...T}=S[m][y];b.variants[a[w].color]=T}),b})),f=s[0].state?new lf(Object.fromEntries(s.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),s[0].state.lang):void 0;return f&&sf(d,f),d}function d3(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const a=e.map(f=>f[i]),s=t.map(()=>[]);t.forEach((f,h)=>f.push(s[h]));const c=a.map(()=>0),d=a.map(f=>f[0]);for(;d.every(f=>f);){const f=Math.min(...d.map(h=>h.content.length));for(let h=0;h<n;h++){const m=d[h];m.content.length===f?(s[h].push(m),c[h]+=1,d[h]=a[h][c[h]]):(s[h].push({...m,content:m.content.slice(0,f)}),d[h]={...m,content:m.content.slice(f),offset:m.offset+f})}}}return t}const f3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class wc{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}wc.prototype.normal={};wc.prototype.property={};wc.prototype.space=void 0;function L2(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new wc(n,i,t)}function Lm(e){return e.toLowerCase()}class Pn{constructor(t,n){this.attribute=n,this.property=t}}Pn.prototype.attribute="";Pn.prototype.booleanish=!1;Pn.prototype.boolean=!1;Pn.prototype.commaOrSpaceSeparated=!1;Pn.prototype.commaSeparated=!1;Pn.prototype.defined=!1;Pn.prototype.mustUseProperty=!1;Pn.prototype.number=!1;Pn.prototype.overloadedBoolean=!1;Pn.prototype.property="";Pn.prototype.spaceSeparated=!1;Pn.prototype.space=void 0;let h3=0;const De=da(),Bt=da(),Im=da(),oe=da(),dt=da(),ra=da(),Wn=da();function da(){return 2**++h3}const Rm=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Bt,commaOrSpaceSeparated:Wn,commaSeparated:ra,number:oe,overloadedBoolean:Im,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),Pp=Object.keys(Rm);class Mg extends Pn{constructor(t,n,i,a){let s=-1;if(super(t,n),$y(this,"space",a),typeof i=="number")for(;++s<Pp.length;){const c=Pp[s];$y(this,Pp[s],(i&Rm[c])===Rm[c])}}}Mg.prototype.defined=!0;function $y(e,t,n){n&&(e[t]=n)}function _s(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const s=new Mg(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Lm(i)]=i,n[Lm(s.attribute)]=i}return new wc(t,n,e.space)}const I2=_s({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:dt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:oe,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:dt,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Bt,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function R2(e,t){return t in e?e[t]:t}function D2(e,t){return R2(e,t.toLowerCase())}const p3=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ra,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:dt,autoFocus:De,autoPlay:De,blocking:dt,capture:null,charSet:null,checked:De,cite:null,className:dt,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:Bt,controls:De,controlsList:dt,coords:oe|ra,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Im,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:dt,height:oe,hidden:Im,high:oe,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:dt,itemRef:dt,itemScope:De,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:oe,pattern:null,ping:dt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:dt,required:De,reversed:De,rows:oe,rowSpan:oe,sandbox:dt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Bt,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:ra,part:dt,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:D2}),m3=_s({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:Wn,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:dt,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:ra,g2:ra,glyphName:ra,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,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:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wn,rev:Wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wn,requiredFeatures:Wn,requiredFonts:Wn,requiredFormats:Wn,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R2}),M2=_s({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()}}),O2=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D2}),P2=_s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),g3=/[A-Z]/g,qy=/-[a-z]/g,v3=/^data[-\w.:]+$/i;function y3(e,t){const n=Lm(t);let i=t,a=Pn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&v3.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(qy,S3);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!qy.test(s)){let c=s.replace(g3,b3);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Mg}return new a(i,t)}function b3(e){return"-"+e.toLowerCase()}function S3(e){return e.charAt(1).toUpperCase()}const _3=L2([I2,p3,M2,O2,P2],"html"),N2=L2([I2,m3,M2,O2,P2],"svg"),Gy={}.hasOwnProperty;function C3(e,t){const n=t||{};function i(a,...s){let c=i.invalid;const d=i.handlers;if(a&&Gy.call(a,e)){const f=String(a[e]);c=Gy.call(d,f)?d[f]:i.unknown}if(c)return c.call(this,a,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const E3=/["&'<>`]/g,w3=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,x3=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,T3=/[|\\{}()[\]^$+*?.]/g,Wy=new WeakMap;function k3(e,t){if(e=e.replace(t.subset?A3(t.subset):E3,i),t.subset||t.escapeOnly)return e;return e.replace(w3,n).replace(x3,i);function n(a,s,c){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,c.charCodeAt(s+2),t)}function i(a,s,c){return t.format(a.charCodeAt(0),c.charCodeAt(s+1),t)}}function A3(e){let t=Wy.get(e);return t||(t=L3(e),Wy.set(e,t)),t}function L3(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(T3,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const I3=/[\dA-Fa-f]/;function R3(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!I3.test(String.fromCharCode(t))?i:i+";"}const D3=/\d/;function M3(e,t,n){const i="&#"+String(e);return n&&t&&!D3.test(String.fromCharCode(t))?i:i+";"}const O3=["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"],Np={nbsp:" ",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:"€"},P3=["cent","copy","divide","gt","lt","not","para","times"],H2={}.hasOwnProperty,Dm={};let Wu;for(Wu in Np)H2.call(Np,Wu)&&(Dm[Np[Wu]]=Wu);const N3=/[^\dA-Za-z]/;function H3(e,t,n,i){const a=String.fromCharCode(e);if(H2.call(Dm,a)){const s=Dm[a],c="&"+s;return n&&O3.includes(s)&&!P3.includes(s)&&(!i||t&&t!==61&&N3.test(String.fromCharCode(t)))?c:c+";"}return""}function z3(e,t,n){let i=R3(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=H3(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const s=M3(e,t,n.omitOptionalSemicolons);s.length<i.length&&(i=s)}return a&&(!n.useShortestReferences||a.length<i.length)?a:i}function hs(e,t){return k3(e,Object.assign({format:z3},t))}const V3=/^>|^->|<!--|-->|--!>|<!-$/g,B3=[">"],U3=["<",">"];function F3(e,t,n,i){return i.settings.bogusComments?"<?"+hs(e.value,Object.assign({},i.settings.characterReferences,{subset:B3}))+">":"<!--"+e.value.replace(V3,a)+"-->";function a(s){return hs(s,Object.assign({},i.settings.characterReferences,{subset:U3}))}}function j3(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Ky(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=n.indexOf(t);for(;a!==-1;)i++,a=n.indexOf(t,a+t.length);return i}function $3(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function q3(e){return e.join(" ").trim()}const G3=/[ \t\n\f\r]/g;function Og(e){return typeof e=="object"?e.type==="text"?Yy(e.value):!1:Yy(e)}function Yy(e){return e.replace(G3,"")===""}const Gt=V2(1),z2=V2(-1),W3=[];function V2(e){return t;function t(n,i,a){const s=n?n.children:W3;let c=(i||0)+e,d=s[c];if(!a)for(;d&&Og(d);)c+=e,d=s[c];return d}}const K3={}.hasOwnProperty;function B2(e){return t;function t(n,i,a){return K3.call(e,n.tagName)&&e[n.tagName](n,i,a)}}const Pg=B2({body:X3,caption:Hp,colgroup:Hp,dd:ek,dt:J3,head:Hp,html:Y3,li:Z3,optgroup:tk,option:nk,p:Q3,rp:Xy,rt:Xy,tbody:rk,td:Qy,tfoot:ok,th:Qy,thead:ik,tr:ak});function Hp(e,t,n){const i=Gt(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Og(i.value.charAt(0)))}function Y3(e,t,n){const i=Gt(n,t);return!i||i.type!=="comment"}function X3(e,t,n){const i=Gt(n,t);return!i||i.type!=="comment"}function Q3(e,t,n){const i=Gt(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 Z3(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="li"}function J3(e,t,n){const i=Gt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function ek(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Xy(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function tk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function nk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function ik(e,t,n){const i=Gt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function rk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function ok(e,t,n){return!Gt(n,t)}function ak(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Qy(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const sk=B2({body:uk,colgroup:dk,head:ck,html:lk,tbody:fk});function lk(e){const t=Gt(e,-1);return!t||t.type!=="comment"}function ck(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function uk(e){const t=Gt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Og(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function dk(e,t,n){const i=z2(n,t),a=Gt(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Pg(i,n.children.indexOf(i),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function fk(e,t,n){const i=z2(n,t),a=Gt(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Pg(i,n.children.indexOf(i),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Ku={name:[[`
20
+ `;const s=this.createOnigString(e),c=s.content.length,d=new GT(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=v2(this,s,a,0,t,d,!0,i);return f2(s),{lineLength:c,lineTokens:d,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}};function Vy(e,t){return e=cT(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 Kl=class Ui{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,a=t?.scopePath??null;for(const s of n)a=Mp.push(a,s.scopeNames),i=new Ui(i,a,s.encodedTokenAttributes);return i}static createRoot(t,n){return new Ui(null,new Mp(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const a=i.getMetadataForScope(t),s=new Mp(null,t),c=i.themeProvider.themeMatch(s),d=Ui.mergeAttributes(n,a,c);return new Ui(null,s,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ui.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let a=-1,s=0,c=0;return i!==null&&(a=i.fontStyle,s=i.foregroundId,c=i.backgroundId),ia.set(t,n.languageId,n.tokenType,null,a,s,c)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ui._pushAttributed(this,t,n);const i=t.split(/ /g);let a=this;for(const s of i)a=Ui._pushAttributed(a,s,n);return a}static _pushAttributed(t,n,i){const a=i.getMetadataForScope(n),s=t.scopePath.push(n),c=i.themeProvider.themeMatch(s),d=Ui.mergeAttributes(t.tokenAttributes,a,c);return new Ui(t,s,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},km=class Qo{constructor(t,n,i,a,s,c,d,f){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=c,this.nameScopesList=d,this.contentNameScopesList=f,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=a}_stackElementBrand=void 0;static NULL=new Qo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Qo._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Kl.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Qo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,a,s,c,d){return new Qo(this,t,n,i,a,s,c,d)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Qo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId: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){const i=Kl.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Qo(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Kl.fromExtension(i,n.contentNameScopesList))}},qT=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Rd(n,Od).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Rd(n,Od).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},GT=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,a=!1;if(this.balancedBracketSelectors?.matchesAlways&&(a=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=e?.getScopeNames()??[];for(const c of this._tokenTypeOverrides)c.matcher(s)&&(i=ia.set(i,0,c.type,null,-1,0,0));this.balancedBracketSelectors&&(a=this.balancedBracketSelectors.match(s))}if(a&&(i=ia.set(i,0,8,a,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const 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);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,a=this._binaryTokens.length;i<a;i++)n[i]=this._binaryTokens[i];return n}},WT=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const 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,i,a){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,FT(e,s,t,n,i,a,this,this._onigLib))}return this._grammars.get(e)}},KT=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new WT(Id.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Id.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new qT(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,a,s){const c=new ET(this._syncRegistry,t);for(;c.Q.length>0;)c.Q.map(d=>this._loadSingleGrammar(d.scopeName)),c.processQueue();return this._grammarForScopeName(t,n,i,a,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,a=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,a)}_grammarForScopeName(t,n=0,i=null,a=null,s=null){return this._syncRegistry.grammarForScopeName(t,n,i,a,s)}},Am=km.NULL;function Pd(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[a,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[a]=s:a===i&&Object.assign(n,s);return n}function So(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function YT(e){return Array.isArray(e)?e:[e]}async function b2(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function nf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function S2(e){return e==="ansi"||nf(e)}function rf(e){return e==="none"}function _2(e){return rf(e)}const XT=/(\r?\n)/g;function of(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(XT);let i=0;const a=[];for(let s=0;s<n.length;s+=2){const c=t?n[s]+(n[s+1]||""):n[s];a.push([c,i]),i+=n[s].length,i+=n[s+1]?.length||0}return a}const By={light:"#333333",dark:"#bbbbbb"},Uy={light:"#fffffe",dark:"#1e1e1e"},Fy="__shiki_resolved";function af(e){if(e?.[Fy])return e;const 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:i}=t;if(!n||!i){const d=t.settings?t.settings.find(f=>!f.name&&!f.scope):void 0;d?.settings?.foreground&&(i=d.settings.foreground),d?.settings?.background&&(n=d.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?By.light:By.dark),n||(n=t.type==="light"?Uy.light:Uy.dark),t.fg=i,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 a=0;const s=new Map;function c(d){if(s.has(d))return s.get(d);a+=1;const f=`#${a.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${f}`]?c(d):(s.set(d,f),f)}t.settings=t.settings.map(d=>{const f=d.settings?.foreground&&!d.settings.foreground.startsWith("#"),h=d.settings?.background&&!d.settings.background.startsWith("#");if(!f&&!h)return d;const m={...d,settings:{...d.settings}};if(f){const g=c(d.settings.foreground);t.colorReplacements[g]=d.settings.foreground,m.settings.foreground=g}if(h){const g=c(d.settings.background);t.colorReplacements[g]=d.settings.background,m.settings.background=g}return m});for(const d of Object.keys(t.colors||{}))if((d==="editor.foreground"||d==="editor.background"||d.startsWith("terminal.ansi"))&&!t.colors[d]?.startsWith("#")){const f=c(t.colors[d]);t.colorReplacements[f]=t.colors[d],t.colors[d]=f}return Object.defineProperty(t,Fy,{enumerable:!1,writable:!1,value:!0}),t}async function C2(e){return[...new Set((await Promise.all(e.filter(t=>!S2(t)).map(async t=>await b2(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function E2(e){return(await Promise.all(e.map(async t=>_2(t)?null:af(await b2(t))))).filter(t=>!!t)}function w2(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new gt(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var QT=class extends KT{_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,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(a=>this.loadTheme(a)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=af(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Id.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=w2(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(a=>a.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(a=>{this._alias[a]=e.name}),this._loadedLanguagesCache=null,t.size)for(const a of t)this._resolvedGrammars.delete(a.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(a.scopeName),this._syncRegistry?._grammars?.delete(a.scopeName),this.loadLanguage(this._langMap.get(a.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const t=[...this._langGraph.entries()],n=t.filter(([i,a])=>!a);if(n.length){const i=t.filter(([a,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(c=>n.map(([d])=>d).includes(c)):!1).filter(a=>!n.includes(a));throw new gt(`Missing languages ${n.map(([a])=>`\`${a}\``).join(", ")}, required by ${i.map(([a])=>`\`${a}\``).join(", ")}`)}for(const[i,a]of t)this._resolver.addLanguage(a);for(const[i,a]of t)this.loadLanguage(a)}getLoadedLanguages(){return this._loadedLanguagesCache||(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);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},ZT=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}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){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const a=t.slice(0,i).join(".");n=[...n,...this._injections.get(a)||[]]}return n}};let Il=0;function JT(e){Il+=1,e.warnings!==!1&&Il>=10&&Il%10===0&&console.warn(`[Shiki] ${Il} 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 gt("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(af),a=new QT(new ZT(e.engine,n),i,n,e.langAlias);let s;function c(E){return w2(E,e.langAlias)}function d(E){A();const T=a.getGrammar(typeof E=="string"?E:E.name);if(!T)throw new gt(`Language \`${E}\` not found, you may need to load it first`);return T}function f(E){if(E==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};A();const T=a.getTheme(E);if(!T)throw new gt(`Theme \`${E}\` not found, you may need to load it first`);return T}function h(E){A();const T=f(E);return s!==E&&(a.setTheme(T),s=E),{theme:T,colorMap:a.getColorMap()}}function m(){return A(),a.getLoadedThemes()}function g(){return A(),a.getLoadedLanguages()}function y(...E){A(),a.loadLanguages(E.flat(1))}async function b(...E){return y(await C2(E))}function S(...E){A();for(const T of E.flat(1))a.loadTheme(T)}async function w(...E){return A(),S(await E2(E))}function A(){if(t)throw new gt("Shiki instance has been disposed")}function k(){t||(t=!0,a.dispose(),Il-=1)}return{setTheme:h,getTheme:f,getLanguage:d,getLoadedThemes:m,getLoadedLanguages:g,resolveLangAlias:c,loadLanguage:b,loadLanguageSync:y,loadTheme:w,loadThemeSync:S,dispose:k,[Symbol.dispose]:k}}async function e3(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([E2(e.themes||[]),C2(e.langs||[]),e.engine]);return JT({...e,themes:t,langs:n,engine:i})}const x2=new WeakMap;function sf(e,t){x2.set(e,t)}function ac(e){return x2.get(e)}var lf=class T2{_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 T2(Object.fromEntries(YT(n).map(i=>[i,Am])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,a]=t;this.lang=i,this._stacks={[a]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return t3(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function t3(e){const t=[],n=new Set;function i(a){if(n.has(a))return;n.add(a);const s=a?.nameScopesList?.scopeName;s&&t.push(s),a.parent&&i(a.parent)}return i(e),t}function n3(e,t){if(!(e instanceof lf))throw new gt("Invalid grammar state");return e.getInternalStack(t)}const i3=/,/,r3=/ /;function k2(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(nf(e.resolveLangAlias(n.lang||"text"))||rf(i))return of(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:a,colorMap:s}=e.setTheme(i),c=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==c.name)throw new gt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${c.name}"`);if(!n.grammarState.themes.includes(a.name))throw new gt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return a3(t,c,a,s,n)}function o3(...e){if(e.length===2)return ac(e[1]);const[t,n,i={}]=e,{lang:a="text",theme:s=t.getLoadedThemes()[0]}=i;if(nf(a)||rf(s))throw new gt("Plain language does not have grammar state");if(a==="ansi")throw new gt("ANSI language does not have grammar state");const{theme:c,colorMap:d}=t.setTheme(s),f=t.getLanguage(a);return new lf(Dg(n,f,c,d,i).stateStack,f.name,c.name)}function a3(e,t,n,i,a){const s=Dg(e,t,n,i,a),c=new lf(s.stateStack,t.name,n.name);return sf(s.tokens,c),s.tokens}function Dg(e,t,n,i,a){const s=Pd(n,a),{tokenizeMaxLineLength:c=0,tokenizeTimeLimit:d=500,includeExplanation:f=!1}=a,h=of(e);let m=a.grammarState?n3(a.grammarState,n.name)??Am:a.grammarContextCode!=null?Dg(a.grammarContextCode,t,n,i,{...a,grammarState:void 0,grammarContextCode:void 0}).stateStack:Am,g=[];const y=[];for(let b=0,S=h.length;b<S;b++){const[w,A]=h[b];if(w===""){g=[],y.push([]);continue}if(c>0&&w.length>=c){g=[],y.push([{content:w,offset:A,color:"",fontStyle:0}]);continue}let k,E,T;f&&f!=="tokenType"&&(k=t.tokenizeLine(w,m,d),E=k.tokens,T=0);const L=t.tokenizeLine2(w,m,d),O=L.tokens.length/2;for(let D=0;D<O;D++){const N=L.tokens[2*D],K=D+1<O?L.tokens[2*D+2]:w.length;if(N===K)continue;const G=L.tokens[2*D+1],se=So(i[ia.getForeground(G)],s),ie=ia.getFontStyle(G),ee={content:w.substring(N,K),offset:A+N,color:se,fontStyle:ie};if(f==="tokenType")ee.type=ia.getTokenType(G);else if(f){const te=[];if(f!=="scopeName")for(const me of n.settings){let H;switch(typeof me.scope){case"string":H=me.scope.split(i3).map(z=>z.trim());break;case"object":H=me.scope;break;default:continue}te.push({settings:me,selectors:H.map(z=>z.split(r3))})}ee.explanation=[];let le=0;for(;N+le<K;){const me=E[T],H=w.substring(me.startIndex,me.endIndex);le+=H.length,ee.explanation.push({content:H,scopes:f==="scopeName"?s3(me.scopes):l3(te,me.scopes)}),T+=1}}g.push(ee)}y.push(g),g=[],m=L.ruleStack}return{tokens:y,stateStack:m}}function s3(e){return e.map(t=>({scopeName:t}))}function l3(e,t){const n=[];for(let i=0,a=t.length;i<a;i++){const s=t[i];n[i]={scopeName:s,themeMatches:u3(e,s,t.slice(0,i))}}return n}function jy(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function c3(e,t,n){if(!jy(e.at(-1),t))return!1;let i=e.length-2,a=n.length-1;for(;i>=0&&a>=0;)jy(e[i],n[a])&&(i-=1),a-=1;return i===-1}function u3(e,t,n){const i=[];for(const{selectors:a,settings:s}of e)for(const c of a)if(c3(c,t,n)){i.push(s);break}return i}function A2(e,t,n,i=k2){const a=Object.entries(n.themes).filter(h=>h[1]).map(h=>({color:h[0],theme:h[1]})),s=a.map(h=>{const m=i(e,t,{...n,theme:h.theme});return{tokens:m,state:ac(m),theme:typeof h.theme=="string"?h.theme:h.theme.name}}),c=d3(...s.map(h=>h.tokens)),d=c[0].map((h,m)=>h.map((g,y)=>{const b={content:g.content,variants:{},offset:g.offset};return"includeExplanation"in n&&n.includeExplanation&&(b.explanation=g.explanation),c.forEach((S,w)=>{const{content:A,explanation:k,offset:E,...T}=S[m][y];b.variants[a[w].color]=T}),b})),f=s[0].state?new lf(Object.fromEntries(s.map(h=>[h.theme,h.state?.getInternalStack(h.theme)])),s[0].state.lang):void 0;return f&&sf(d,f),d}function d3(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const a=e.map(f=>f[i]),s=t.map(()=>[]);t.forEach((f,h)=>f.push(s[h]));const c=a.map(()=>0),d=a.map(f=>f[0]);for(;d.every(f=>f);){const f=Math.min(...d.map(h=>h.content.length));for(let h=0;h<n;h++){const m=d[h];m.content.length===f?(s[h].push(m),c[h]+=1,d[h]=a[h][c[h]]):(s[h].push({...m,content:m.content.slice(0,f)}),d[h]={...m,content:m.content.slice(f),offset:m.offset+f})}}}return t}const f3=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class wc{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}wc.prototype.normal={};wc.prototype.property={};wc.prototype.space=void 0;function L2(e,t){const n={},i={};for(const a of e)Object.assign(n,a.property),Object.assign(i,a.normal);return new wc(n,i,t)}function Lm(e){return e.toLowerCase()}class Pn{constructor(t,n){this.attribute=n,this.property=t}}Pn.prototype.attribute="";Pn.prototype.booleanish=!1;Pn.prototype.boolean=!1;Pn.prototype.commaOrSpaceSeparated=!1;Pn.prototype.commaSeparated=!1;Pn.prototype.defined=!1;Pn.prototype.mustUseProperty=!1;Pn.prototype.number=!1;Pn.prototype.overloadedBoolean=!1;Pn.prototype.property="";Pn.prototype.spaceSeparated=!1;Pn.prototype.space=void 0;let h3=0;const De=da(),Bt=da(),Im=da(),oe=da(),dt=da(),ra=da(),Wn=da();function da(){return 2**++h3}const Rm=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:Bt,commaOrSpaceSeparated:Wn,commaSeparated:ra,number:oe,overloadedBoolean:Im,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),Pp=Object.keys(Rm);class Mg extends Pn{constructor(t,n,i,a){let s=-1;if(super(t,n),$y(this,"space",a),typeof i=="number")for(;++s<Pp.length;){const c=Pp[s];$y(this,Pp[s],(i&Rm[c])===Rm[c])}}}Mg.prototype.defined=!0;function $y(e,t,n){n&&(e[t]=n)}function _s(e){const t={},n={};for(const[i,a]of Object.entries(e.properties)){const s=new Mg(i,e.transform(e.attributes||{},i),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(s.mustUseProperty=!0),t[i]=s,n[Lm(i)]=i,n[Lm(s.attribute)]=i}return new wc(t,n,e.space)}const I2=_s({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:oe,ariaColIndex:oe,ariaColSpan:oe,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:dt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:oe,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:oe,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:dt,ariaRowCount:oe,ariaRowIndex:oe,ariaRowSpan:oe,ariaSelected:Bt,ariaSetSize:oe,ariaSort:null,ariaValueMax:oe,ariaValueMin:oe,ariaValueNow:oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function R2(e,t){return t in e?e[t]:t}function D2(e,t){return R2(e,t.toLowerCase())}const p3=_s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ra,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alpha:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:dt,autoFocus:De,autoPlay:De,blocking:dt,capture:null,charSet:null,checked:De,cite:null,className:dt,closedBy:null,colorSpace:null,cols:oe,colSpan:oe,command:null,commandFor:null,content:null,contentEditable:Bt,controls:De,controlsList:dt,coords:oe|ra,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:Im,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:dt,height:oe,hidden:Im,high:oe,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:dt,itemRef:dt,itemScope:De,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:oe,manifest:null,max:null,maxLength:oe,media:null,method:null,min:null,minLength:oe,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:oe,pattern:null,ping:dt,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:dt,required:De,reversed:De,rows:oe,rowSpan:oe,sandbox:dt,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootCustomElementRegistry:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shadowRootSerializable:De,shape:null,size:oe,sizes:null,slot:null,span:oe,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:oe,step:null,style:null,tabIndex:oe,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:Bt,width:oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:oe,borderColor:null,bottomMargin:oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:oe,leftMargin:oe,link:null,longDesc:null,lowSrc:null,marginHeight:oe,marginWidth:oe,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:oe,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:De,disablePictureInPicture:De,disableRemotePlayback:De,exportParts:ra,part:dt,prefix:null,property:null,results:oe,security:null,unselectable:null},space:"html",transform:D2}),m3=_s({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:Wn,accentHeight:oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:oe,amplitude:oe,arabicForm:null,ascent:oe,attributeName:null,attributeType:null,azimuth:oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:oe,by:null,calcMode:null,capHeight:oe,className:dt,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:oe,diffuseConstant:oe,direction:null,display:null,dur:null,divisor:oe,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:oe,enableBackground:null,end:null,event:null,exponent:oe,externalResourcesRequired:null,fill:null,fillOpacity:oe,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:ra,g2:ra,glyphName:ra,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:oe,horizOriginX:oe,horizOriginY:oe,id:null,ideographic:oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:oe,k:oe,k1:oe,k2:oe,k3:oe,k4:oe,kernelMatrix:Wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:oe,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:oe,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:oe,overlineThickness:oe,paintOrder:null,panose1:null,path:null,pathLength:oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:oe,pointsAtY:oe,pointsAtZ:oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wn,rev:Wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wn,requiredFeatures:Wn,requiredFonts:Wn,requiredFormats:Wn,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:oe,specularExponent:oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:oe,strikethroughThickness:oe,string:null,stroke:null,strokeDashArray:Wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:oe,strokeOpacity:oe,strokeWidth:null,style:null,surfaceScale:oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wn,tabIndex:oe,tableValues:null,target:null,targetX:oe,targetY:oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:oe,underlineThickness:oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:oe,values:null,vAlphabetic:oe,vMathematical:oe,vectorEffect:null,vHanging:oe,vIdeographic:oe,version:null,vertAdvY:oe,vertOriginX:oe,vertOriginY:oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:R2}),M2=_s({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()}}),O2=_s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:D2}),P2=_s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),g3=/[A-Z]/g,qy=/-[a-z]/g,v3=/^data[-\w.:]+$/i;function y3(e,t){const n=Lm(t);let i=t,a=Pn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&v3.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(qy,S3);i="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!qy.test(s)){let c=s.replace(g3,b3);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}a=Mg}return new a(i,t)}function b3(e){return"-"+e.toLowerCase()}function S3(e){return e.charAt(1).toUpperCase()}const _3=L2([I2,p3,M2,O2,P2],"html"),N2=L2([I2,m3,M2,O2,P2],"svg"),Gy={}.hasOwnProperty;function C3(e,t){const n=t||{};function i(a,...s){let c=i.invalid;const d=i.handlers;if(a&&Gy.call(a,e)){const f=String(a[e]);c=Gy.call(d,f)?d[f]:i.unknown}if(c)return c.call(this,a,...s)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const E3=/["&'<>`]/g,w3=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,x3=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,T3=/[|\\{}()[\]^$+*?.]/g,Wy=new WeakMap;function k3(e,t){if(e=e.replace(t.subset?A3(t.subset):E3,i),t.subset||t.escapeOnly)return e;return e.replace(w3,n).replace(x3,i);function n(a,s,c){return t.format((a.charCodeAt(0)-55296)*1024+a.charCodeAt(1)-56320+65536,c.charCodeAt(s+2),t)}function i(a,s,c){return t.format(a.charCodeAt(0),c.charCodeAt(s+1),t)}}function A3(e){let t=Wy.get(e);return t||(t=L3(e),Wy.set(e,t)),t}function L3(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(T3,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const I3=/[\dA-Fa-f]/;function R3(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!I3.test(String.fromCharCode(t))?i:i+";"}const D3=/\d/;function M3(e,t,n){const i="&#"+String(e);return n&&t&&!D3.test(String.fromCharCode(t))?i:i+";"}const O3=["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"],Np={nbsp:" ",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:"€"},P3=["cent","copy","divide","gt","lt","not","para","times"],H2={}.hasOwnProperty,Dm={};let Wu;for(Wu in Np)H2.call(Np,Wu)&&(Dm[Np[Wu]]=Wu);const N3=/[^\dA-Za-z]/;function H3(e,t,n,i){const a=String.fromCharCode(e);if(H2.call(Dm,a)){const s=Dm[a],c="&"+s;return n&&O3.includes(s)&&!P3.includes(s)&&(!i||t&&t!==61&&N3.test(String.fromCharCode(t)))?c:c+";"}return""}function z3(e,t,n){let i=R3(e,t,n.omitOptionalSemicolons),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=H3(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){const s=M3(e,t,n.omitOptionalSemicolons);s.length<i.length&&(i=s)}return a&&(!n.useShortestReferences||a.length<i.length)?a:i}function hs(e,t){return k3(e,Object.assign({format:z3},t))}const V3=/^>|^->|<!--|-->|--!>|<!-$/g,B3=[">"],U3=["<",">"];function F3(e,t,n,i){return i.settings.bogusComments?"<?"+hs(e.value,Object.assign({},i.settings.characterReferences,{subset:B3}))+">":"<!--"+e.value.replace(V3,a)+"-->";function a(s){return hs(s,Object.assign({},i.settings.characterReferences,{subset:U3}))}}function j3(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Ky(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,a=n.indexOf(t);for(;a!==-1;)i++,a=n.indexOf(t,a+t.length);return i}function $3(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function q3(e){return e.join(" ").trim()}const G3=/[ \t\n\f\r]/g;function Og(e){return typeof e=="object"?e.type==="text"?Yy(e.value):!1:Yy(e)}function Yy(e){return e.replace(G3,"")===""}const Gt=V2(1),z2=V2(-1),W3=[];function V2(e){return t;function t(n,i,a){const s=n?n.children:W3;let c=(i||0)+e,d=s[c];if(!a)for(;d&&Og(d);)c+=e,d=s[c];return d}}const K3={}.hasOwnProperty;function B2(e){return t;function t(n,i,a){return K3.call(e,n.tagName)&&e[n.tagName](n,i,a)}}const Pg=B2({body:X3,caption:Hp,colgroup:Hp,dd:ek,dt:J3,head:Hp,html:Y3,li:Z3,optgroup:tk,option:nk,p:Q3,rp:Xy,rt:Xy,tbody:rk,td:Qy,tfoot:ok,th:Qy,thead:ik,tr:ak});function Hp(e,t,n){const i=Gt(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&Og(i.value.charAt(0)))}function Y3(e,t,n){const i=Gt(n,t);return!i||i.type!=="comment"}function X3(e,t,n){const i=Gt(n,t);return!i||i.type!=="comment"}function Q3(e,t,n){const i=Gt(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 Z3(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="li"}function J3(e,t,n){const i=Gt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function ek(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Xy(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function tk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function nk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function ik(e,t,n){const i=Gt(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function rk(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function ok(e,t,n){return!Gt(n,t)}function ak(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Qy(e,t,n){const i=Gt(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const sk=B2({body:uk,colgroup:dk,head:ck,html:lk,tbody:fk});function lk(e){const t=Gt(e,-1);return!t||t.type!=="comment"}function ck(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function uk(e){const t=Gt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&Og(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function dk(e,t,n){const i=z2(n,t),a=Gt(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Pg(i,n.children.indexOf(i),n)?!1:!!(a&&a.type==="element"&&a.tagName==="col")}function fk(e,t,n){const i=z2(n,t),a=Gt(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Pg(i,n.children.indexOf(i),n)?!1:!!(a&&a.type==="element"&&a.tagName==="tr")}const Ku={name:[[`
21
21
  \f\r &/=>`.split(""),`
22
22
  \f\r "&'/=>\``.split("")],[`\0
23
23
  \f\r "&'/<=>`.split(""),`\0
@@ -58,7 +58,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuF
58
58
  | &&
59
59
  | .
60
60
  `.replace(/\s+/g,""),"gsu");function dA(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=IA(n.flags),a=[i.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(g){a.push(g)},replaceCurrentModX(g){a[a.length-1]=g},singleline:n.rules.singleline};let c=[],d;for(Yu.lastIndex=0;d=Yu.exec(e);){const g=fA(s,e,d[0],Yu.lastIndex);g.tokens?c.push(...g.tokens):g.token&&c.push(g.token),g.lastIndex!==void 0&&(Yu.lastIndex=g.lastIndex)}const f=[];let h=0;c.filter(g=>g.type==="GroupOpen").forEach(g=>{g.kind==="capturing"?g.number=++h:g.raw==="("&&f.push(g)}),h||f.forEach((g,y)=>{g.kind="capturing",g.number=y+1});const m=h||f.length;return{tokens:c.map(g=>g.type==="EscapedNumber"?DA(g,m):g).flat(),flags:i}}function fA(e,t,n,i){const[a,s]=n;if(n==="["||n==="[^"){const c=hA(t,n,i);return{tokens:c.tokens,lastIndex:c.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(s))return{token:nb(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:EA(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:tC(n)}}if(s==="K")return{token:nC("keep",n)};if(s==="N"||s==="R")return{token:na("newline",n,{negate:s==="N"})};if(s==="O")return{token:na("any",n)};if(s==="X")return{token:na("text_segment",n)};const c=eC(n,{inCharClass:!1});return Array.isArray(c)?{tokens:c}:{token:c}}if(a==="("){if(s==="*")return{token:kA(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:TA(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:ss("group",n)};if(n==="(?>")return{token:ss("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ss(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ss("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ss("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:SA(n)}}if(e.getCurrentModX()){if(n==="#"){const c=t.indexOf(`
61
- `,i);return{lastIndex:c===-1?t.length:c}}if(/^\s$/.test(n)){const c=/\s+/y;return c.lastIndex=i,{lastIndex:c.exec(t)?c.lastIndex:i}}}if(n===".")return{token:na("dot",n)};if(n==="^"||n==="$"){const c=e.singleline?{"^":en`\A`,$:en`\Z`}[n]:n;return{token:nb(c,n)}}return n==="|"?{token:mA(n)}:Hg.test(n)?{tokens:MA(n)}:{token:Ar(Cs(n),n)}}function hA(e,t,n){const i=[ib(t[1]==="^",t)];let a=1,s;for(Vp.lastIndex=n;s=Vp.exec(e);){const c=s[0];if(c[0]==="["&&c[1]!==":")a++,i.push(ib(c[1]==="^",c));else if(c==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Ar(93,c));else if(a--,i.push(gA(c)),!a)break}else{const d=pA(c);Array.isArray(d)?i.push(...d):i.push(d)}}return{tokens:i,lastIndex:Vp.lastIndex||e.length}}function pA(e){if(e[0]==="\\")return eC(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ng.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return na("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?vA(e):e==="&&"?yA(e):Ar(Cs(e),e)}function eC(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return xA(e);if("dDhHsSwW".includes(n))return AA(e);if(e.startsWith(en`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return LA(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const i=e.split(/\\x/).slice(1).map(c=>parseInt(c,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),s=new TextEncoder;return[...a].map(c=>{const d=[...s.encode(c)].map(f=>`\\x${f.toString(16)}`).join("");return Ar(Cs(c),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ar(RA(e),e);if(rb.has(n))return Ar(rb.get(n),e);if(/\d/.test(n))return bA(t,e);if(e==="\\")throw new Error(en`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ar(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function mA(e){return{type:"Alternator",raw:e}}function nb(e,t){return{type:"Assertion",kind:e,raw:t}}function tC(e){return{type:"Backreference",raw:e}}function Ar(e,t){return{type:"Character",value:e,raw:t}}function gA(e){return{type:"CharacterClassClose",raw:e}}function vA(e){return{type:"CharacterClassHyphen",raw:e}}function yA(e){return{type:"CharacterClassIntersector",raw:e}}function ib(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function na(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function nC(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Es(n.flags),raw:t}}function bA(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function SA(e){return{type:"GroupClose",raw:e}}function ss(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function _A(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function CA(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function EA(e){return{type:"Subroutine",raw:e}}const wA=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),rb=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function xA(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Ar(Cs(t.toUpperCase())-64,e)}function TA(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const a=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),s=ab(n),c=ab(i),d={};if(s&&(d.enable=s),c&&(d.disable=c),e.endsWith(")"))return t.replaceCurrentModX(a),nC("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,ss("group",e,{...(s||c)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function kA(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:a}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=a?a.split(",").filter(m=>m!=="").map(m=>/^[+-]?\d+$/.test(m)?+m:m):[],[c,d,f]=s,h=wA.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof c=="string")throw new Error(`Named callout argument must be a number "${c}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument one must be a tag or number "${c}"`);if(s.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${c}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument one must be a tag or number "${c}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return _A(h,i??null,a?.split(",")??null,e)}function ob(e){let t=null,n,i;if(e[0]==="{"){const{minStr:a,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,c=1e5;if(+a>c||s&&+s>c)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,i=s===void 0?+a:s===""?1/0:+s,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return CA(t,n,i,e)}function AA(e){const t=e[1].toLowerCase();return na({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function LA(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return na("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function ab(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function IA(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function RA(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function DA(e,t){const{raw:n,inCharClass:i}=e,a=n.slice(1);if(!i&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=t))return[tC(n)];const s=[],c=a.match(/^[0-7]+|\d/g);for(let d=0;d<c.length;d++){const f=c[d];let h;if(d===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(en`Octal encoded byte above 177 unsupported "${n}"`)}else h=Cs(f);s.push(Ar(h,(d===0?"\\":"")+f))}return s}function MA(e){const t=[],n=new RegExp(Hg,"gy");let i;for(;i=n.exec(e);){const a=i[0];if(a[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(s){const{min:c,max:d}=s.groups;if(+c>+d&&a.endsWith("?")){n.lastIndex--,t.push(ob(a.slice(0,-1)));continue}}}t.push(ob(a))}return t}function iC(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function OA(e){return PA.has(e.type)}const PA=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function rC(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=dA(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(y,b)=>{const S=i.tokens[s.nextIndex];switch(s.parent=y,s.nextIndex++,S.type){case"Alternator":return aa();case"Assertion":return NA(S);case"Backreference":return HA(S,s);case"Character":return uf(S.value,{useLastValid:!!b.isCheckingRangeEnd});case"CharacterClassHyphen":return zA(S,s,b);case"CharacterClassOpen":return VA(S,s,b);case"CharacterSet":return BA(S,s);case"Directive":return GA(S.kind,{flags:S.flags});case"GroupOpen":return UA(S,s,b);case"NamedCallout":return KA(S.kind,S.tag,S.arguments);case"Quantifier":return FA(S,s);case"Subroutine":return jA(S,s);default:throw new Error(`Unexpected token type "${S.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},c=XA(WA(i.flags));let d=c.body[0];for(;s.nextIndex<i.tokens.length;){const y=a(d,{});y.type==="Alternative"?(c.body.push(y),d=y):d.body.push(y)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:m,subroutines:g}=s;if(h&&m.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>f.length)throw new Error("Subroutine uses a group number that's not defined");y&&(f[y-1].isSubroutined=!0)}else if(m.has(y)){if(m.get(y).length>1)throw new Error(en`Subroutine uses a duplicate group name "\g<${y}>"`);m.get(y)[0].isSubroutined=!0}else throw new Error(en`Subroutine uses a group name that's not defined "\g<${y}>"`);return c}function NA({kind:e}){return Pm(Es({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===en`\B`||e===en`\Y`})}function HA({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),a=(s,c=!1)=>{const d=t.capturingGroups.length;let f=!1;if(s>d)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Nm(c?d+1-s:s,{orphan:f})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(s)return a(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return Nm(i)}return a(+i)}function zA(e,t,n){const{tokens:i,walk:a}=t,s=t.parent,c=s.body.at(-1),d=i[t.nextIndex];if(!n.isCheckingRangeEnd&&c&&c.type!=="CharacterClass"&&c.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const f=a(s,{...n,isCheckingRangeEnd:!0});if(c.type==="Character"&&f.type==="Character")return s.body.pop(),qA(c,f);throw new Error("Invalid character class range")}return uf(Cs("-"))}function VA({negate:e},t,n){const{tokens:i,walk:a}=t,s=[vd()],c=i[t.nextIndex];let d=cb(c);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")s.push(vd()),t.nextIndex++;else{const h=s.at(-1);h.body.push(a(h,n))}d=cb(i[t.nextIndex],c)}const f=vd({negate:e});return s.length===1?f.body=s[0].body:(f.kind="intersection",f.body=s.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function BA({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:c}=i;if(e==="property"){const d=df(n);if(Ng.has(d)&&!c?.has(d))e="posix",n=d;else return ls(n,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:c})}return e==="posix"?YA(n,{negate:t}):Hm(e,{negate:t})}function UA(e,t,n){const{tokens:i,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:c,walk:d}=t,f=QA(e),h=f.type==="AbsenceFunction",m=lb(f),g=m&&f.negate;if(f.type==="CapturingGroup"&&(a.push(f),f.name&&uA(s,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=ub(i[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(aa()),t.nextIndex++;else{const b=f.body.at(-1),S=d(b,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||m,isInNegLookbehind:n.isInNegLookbehind||g});if(b.body.push(S),(m||n.isInLookbehind)&&!c){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(sb(S)||S.type==="CapturingGroup")throw new Error(w)}else if(sb(S)||lb(S)&&S.negate)throw new Error(w)}}y=ub(i[t.nextIndex])}return t.nextIndex++,f}function FA({kind:e,min:t,max:n},i){const a=i.parent,s=a.body.at(-1);if(!s||!OA(s))throw new Error("Quantifier requires a repeatable token");const c=aC(e,t,n,s);return a.body.pop(),c}function jA({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let a=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(s){const d=+s.groups.num,f=n.length;if(t.hasNumberedRef=!0,a={"":d,"+":f+d,"-":f+1-d}[s.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const c=sC(a);return i.push(c),c}function $A(e,t){return{type:"AbsenceFunction",kind:e,body:xc(t?.body)}}function aa(e){return{type:"Alternative",body:lC(e?.body)}}function Pm(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Nm(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function oC(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ZA(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:xc(t?.body)}}function uf(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function vd(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:lC(e?.body)}}function qA(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Hm(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function GA(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Es(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function WA(e){return{type:"Flags",...e}}function Ei(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:xc(e?.body)}}function Jo(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:xc(e?.body)}}function KA(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function YA(e,t){const n=!!t?.negate;if(!Ng.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function aC(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function XA(e,t){return{type:"Regex",body:xc(t?.body),flags:e}}function sC(e){return{type:"Subroutine",ref:e}}function ls(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(df(e));if(!i){if(n.normalizeUnknownPropertyNames)i=JA(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(en`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function QA({flags:e,kind:t,name:n,negate:i,number:a}){switch(t){case"absence_repeater":return $A("repeater");case"atomic":return Ei({atomic:!0});case"capturing":return oC(a,{name:n});case"group":return Ei({flags:e});case"lookahead":case"lookbehind":return Jo({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function xc(e){if(e===void 0)e=[aa()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function lC(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function sb(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function lb(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ZA(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function JA(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function df(e){return e.replace(/[- _]+/g,"").toLowerCase()}function cb(e,t){const n=t;return Es(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function ub(e){return Es(e,"Unclosed group")}function Yl(e,t,n=null){function i(s,c){for(let d=0;d<s.length;d++){const f=a(s[d],c,d,s);d=Math.max(-1,d+f)}}function a(s,c=null,d=null,f=null){let h=0,m=!1;const g={node:s,parent:c,key:d,container:f,root:e,remove(){Xu(f).splice(Math.max(0,is(d)+h),1),h--,m=!0},removeAllNextSiblings(){return Xu(f).splice(is(d)+1)},removeAllPrevSiblings(){const k=is(d)+h;return h-=k,Xu(f).splice(0,Math.max(0,k))},replaceWith(k,E={}){const T=!!E.traverse;f?f[Math.max(0,is(d)+h)]=k:Es(c,"Can't replace root node")[d]=k,T&&a(k,c,d,f),m=!0},replaceWithMultiple(k,E={}){const T=!!E.traverse;if(Xu(f).splice(Math.max(0,is(d)+h),1,...k),h+=k.length-1,T){let L=0;for(let O=0;O<k.length;O++)L+=a(k[O],c,is(d)+O+L,f)}m=!0},skip(){m=!0}},{type:y}=s,b=t["*"],S=t[y],w=typeof b=="function"?b:b?.enter,A=typeof S=="function"?S:S?.enter;if(w?.(g,n),A?.(g,n),!m)switch(y){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(s.min,s,"min"),a(s.max,s,"max");break;case"Quantifier":a(s.body,s,"body");break;case"Regex":i(s.body,s),a(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return S?.exit?.(g,n),b?.exit?.(g,n),h}return a(e),e}function Xu(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function is(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const e4=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function t4(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function n4(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const fi=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function zg(e,t,n,i){const a=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let c=0,d="";for(const f of e.matchAll(a)){const{0:h,groups:{$skip:m}}=f;if(!m&&(!i||i===fi.DEFAULT==!c)){n instanceof Function?d+=n(f,{context:c?fi.CHAR_CLASS:fi.DEFAULT,negated:s[s.length-1]}):d+=n;continue}h[0]==="["?(c++,s.push(h[1]==="^")):h==="]"&&c&&(c--,s.pop()),d+=h}return d}function cC(e,t,n,i){zg(e,t,n,i)}function i4(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const a=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let s=0,c;for(;c=a.exec(e);){const{0:d,groups:{$skip:f}}=c;if(!f&&(!i||i===fi.DEFAULT==!s))return c;d==="["?s++:d==="]"&&s&&s--,a.lastIndex==c.index&&a.lastIndex++}return null}function Qu(e,t,n){return!!i4(e,t,0,n)}function r4(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,a=0,s=1,c;for(;c=n.exec(e);){const[d]=c;if(d==="[")a++;else if(a)d==="]"&&a--;else if(d==="(")s++;else if(d===")"&&(s--,!s)){i=c.index;break}}return e.slice(t,i)}const db=new RegExp(String.raw`(?<noncapturingStart>${e4})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function o4(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const a="(?>",s="(?:(?=(",c=[0],d=[];let f=0,h=0,m=NaN,g;do{g=!1;let y=0,b=0,S=!1,w;for(db.lastIndex=Number.isNaN(m)?0:m+s.length;w=db.exec(e);){const{0:A,index:k,groups:{capturingStart:E,noncapturingStart:T}}=w;if(A==="[")y++;else if(y)A==="]"&&y--;else if(A===a&&!S)m=k,S=!0;else if(S&&T)b++;else if(E)S?b++:(f++,c.push(f+h));else if(A===")"&&S){if(!b){h++;const L=f+h;if(e=`${e.slice(0,m)}${s}${e.slice(m+a.length,k)}))<$$${L}>)${e.slice(k+1)}`,g=!0,d.push(L),t4(n,L),i.size){const O=new Map;i.forEach((D,N)=>{O.set(N>=L?N+1:N,D.map(W=>W>=L?W+1:W))}),i=O}break}b--}}}while(g);return n.push(...d),e=zg(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:b,wrappedBackrefNum:S}})=>{if(b){const w=+b;if(w>c.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${c[w]}`}return`\\${S}`},fi.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const uC=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Bp=new RegExp(String.raw`
61
+ `,i);return{lastIndex:c===-1?t.length:c}}if(/^\s$/.test(n)){const c=/\s+/y;return c.lastIndex=i,{lastIndex:c.exec(t)?c.lastIndex:i}}}if(n===".")return{token:na("dot",n)};if(n==="^"||n==="$"){const c=e.singleline?{"^":en`\A`,$:en`\Z`}[n]:n;return{token:nb(c,n)}}return n==="|"?{token:mA(n)}:Hg.test(n)?{tokens:MA(n)}:{token:Ar(Cs(n),n)}}function hA(e,t,n){const i=[ib(t[1]==="^",t)];let a=1,s;for(Vp.lastIndex=n;s=Vp.exec(e);){const c=s[0];if(c[0]==="["&&c[1]!==":")a++,i.push(ib(c[1]==="^",c));else if(c==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Ar(93,c));else if(a--,i.push(gA(c)),!a)break}else{const d=pA(c);Array.isArray(d)?i.push(...d):i.push(d)}}return{tokens:i,lastIndex:Vp.lastIndex||e.length}}function pA(e){if(e[0]==="\\")return eC(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ng.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return na("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?vA(e):e==="&&"?yA(e):Ar(Cs(e),e)}function eC(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return xA(e);if("dDhHsSwW".includes(n))return AA(e);if(e.startsWith(en`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return LA(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const i=e.split(/\\x/).slice(1).map(c=>parseInt(c,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),s=new TextEncoder;return[...a].map(c=>{const d=[...s.encode(c)].map(f=>`\\x${f.toString(16)}`).join("");return Ar(Cs(c),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ar(RA(e),e);if(rb.has(n))return Ar(rb.get(n),e);if(/\d/.test(n))return bA(t,e);if(e==="\\")throw new Error(en`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Ar(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function mA(e){return{type:"Alternator",raw:e}}function nb(e,t){return{type:"Assertion",kind:e,raw:t}}function tC(e){return{type:"Backreference",raw:e}}function Ar(e,t){return{type:"Character",value:e,raw:t}}function gA(e){return{type:"CharacterClassClose",raw:e}}function vA(e){return{type:"CharacterClassHyphen",raw:e}}function yA(e){return{type:"CharacterClassIntersector",raw:e}}function ib(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function na(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function nC(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Es(n.flags),raw:t}}function bA(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function SA(e){return{type:"GroupClose",raw:e}}function ss(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function _A(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function CA(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function EA(e){return{type:"Subroutine",raw:e}}const wA=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),rb=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function xA(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Ar(Cs(t.toUpperCase())-64,e)}function TA(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const a=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),s=ab(n),c=ab(i),d={};if(s&&(d.enable=s),c&&(d.disable=c),e.endsWith(")"))return t.replaceCurrentModX(a),nC("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,ss("group",e,{...(s||c)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function kA(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:a}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const s=a?a.split(",").filter(m=>m!=="").map(m=>/^[+-]?\d+$/.test(m)?+m:m):[],[c,d,f]=s,h=wA.has(n)?n.toLowerCase():"custom";switch(h){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof c=="string")throw new Error(`Named callout argument must be a number "${c}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument one must be a tag or number "${c}"`);if(s.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof c=="number"||!/^[<>X]$/.test(c)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${c}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof c=="string"&&!/^[A-Za-z_]\w*$/.test(c))throw new Error(`Named callout argument one must be a tag or number "${c}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);if(typeof f=="string"&&!/^[A-Za-z_]\w*$/.test(f))throw new Error(`Named callout argument three must be a tag or number "${f}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${h}"`)}return _A(h,i??null,a?.split(",")??null,e)}function ob(e){let t=null,n,i;if(e[0]==="{"){const{minStr:a,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,c=1e5;if(+a>c||s&&+s>c)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+a,i=s===void 0?+a:s===""?1/0:+s,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return CA(t,n,i,e)}function AA(e){const t=e[1].toLowerCase();return na({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function LA(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return na("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function ab(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function IA(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function RA(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function DA(e,t){const{raw:n,inCharClass:i}=e,a=n.slice(1);if(!i&&(a!=="0"&&a.length===1||a[0]!=="0"&&+a<=t))return[tC(n)];const s=[],c=a.match(/^[0-7]+|\d/g);for(let d=0;d<c.length;d++){const f=c[d];let h;if(d===0&&f!=="8"&&f!=="9"){if(h=parseInt(f,8),h>127)throw new Error(en`Octal encoded byte above 177 unsupported "${n}"`)}else h=Cs(f);s.push(Ar(h,(d===0?"\\":"")+f))}return s}function MA(e){const t=[],n=new RegExp(Hg,"gy");let i;for(;i=n.exec(e);){const a=i[0];if(a[0]==="{"){const s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(a);if(s){const{min:c,max:d}=s.groups;if(+c>+d&&a.endsWith("?")){n.lastIndex--,t.push(ob(a.slice(0,-1)));continue}}}t.push(ob(a))}return t}function iC(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function OA(e){return PA.has(e.type)}const PA=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function rC(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=dA(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),a=(y,b)=>{const S=i.tokens[s.nextIndex];switch(s.parent=y,s.nextIndex++,S.type){case"Alternator":return aa();case"Assertion":return NA(S);case"Backreference":return HA(S,s);case"Character":return uf(S.value,{useLastValid:!!b.isCheckingRangeEnd});case"CharacterClassHyphen":return zA(S,s,b);case"CharacterClassOpen":return VA(S,s,b);case"CharacterSet":return BA(S,s);case"Directive":return GA(S.kind,{flags:S.flags});case"GroupOpen":return UA(S,s,b);case"NamedCallout":return KA(S.kind,S.tag,S.arguments);case"Quantifier":return FA(S,s);case"Subroutine":return jA(S,s);default:throw new Error(`Unexpected token type "${S.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:a},c=XA(WA(i.flags));let d=c.body[0];for(;s.nextIndex<i.tokens.length;){const y=a(d,{});y.type==="Alternative"?(c.body.push(y),d=y):d.body.push(y)}const{capturingGroups:f,hasNumberedRef:h,namedGroupsByName:m,subroutines:g}=s;if(h&&m.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of g)if(typeof y=="number"){if(y>f.length)throw new Error("Subroutine uses a group number that's not defined");y&&(f[y-1].isSubroutined=!0)}else if(m.has(y)){if(m.get(y).length>1)throw new Error(en`Subroutine uses a duplicate group name "\g<${y}>"`);m.get(y)[0].isSubroutined=!0}else throw new Error(en`Subroutine uses a group name that's not defined "\g<${y}>"`);return c}function NA({kind:e}){return Pm(Es({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===en`\B`||e===en`\Y`})}function HA({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),a=(s,c=!1)=>{const d=t.capturingGroups.length;let f=!1;if(s>d)if(t.skipBackrefValidation)f=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Nm(c?d+1-s:s,{orphan:f})};if(n){const s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(s)return a(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return Nm(i)}return a(+i)}function zA(e,t,n){const{tokens:i,walk:a}=t,s=t.parent,c=s.body.at(-1),d=i[t.nextIndex];if(!n.isCheckingRangeEnd&&c&&c.type!=="CharacterClass"&&c.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const f=a(s,{...n,isCheckingRangeEnd:!0});if(c.type==="Character"&&f.type==="Character")return s.body.pop(),qA(c,f);throw new Error("Invalid character class range")}return uf(Cs("-"))}function VA({negate:e},t,n){const{tokens:i,walk:a}=t,s=[vd()],c=i[t.nextIndex];let d=cb(c);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")s.push(vd()),t.nextIndex++;else{const h=s.at(-1);h.body.push(a(h,n))}d=cb(i[t.nextIndex],c)}const f=vd({negate:e});return s.length===1?f.body=s[0].body:(f.kind="intersection",f.body=s.map(h=>h.body.length===1?h.body[0]:h)),t.nextIndex++,f}function BA({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:c}=i;if(e==="property"){const d=df(n);if(Ng.has(d)&&!c?.has(d))e="posix",n=d;else return ls(n,{negate:t,normalizeUnknownPropertyNames:a,skipPropertyNameValidation:s,unicodePropertyMap:c})}return e==="posix"?YA(n,{negate:t}):Hm(e,{negate:t})}function UA(e,t,n){const{tokens:i,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:c,walk:d}=t,f=QA(e),h=f.type==="AbsenceFunction",m=lb(f),g=m&&f.negate;if(f.type==="CapturingGroup"&&(a.push(f),f.name&&uA(s,f.name,[]).push(f)),h&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=ub(i[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")f.body.push(aa()),t.nextIndex++;else{const b=f.body.at(-1),S=d(b,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||m,isInNegLookbehind:n.isInNegLookbehind||g});if(b.body.push(S),(m||n.isInLookbehind)&&!c){const w="Lookbehind includes a pattern not allowed by Oniguruma";if(g||n.isInNegLookbehind){if(sb(S)||S.type==="CapturingGroup")throw new Error(w)}else if(sb(S)||lb(S)&&S.negate)throw new Error(w)}}y=ub(i[t.nextIndex])}return t.nextIndex++,f}function FA({kind:e,min:t,max:n},i){const a=i.parent,s=a.body.at(-1);if(!s||!OA(s))throw new Error("Quantifier requires a repeatable token");const c=aC(e,t,n,s);return a.body.pop(),c}function jA({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let a=e.slice(3,-1);const s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(a);if(s){const d=+s.groups.num,f=n.length;if(t.hasNumberedRef=!0,a={"":d,"+":f+d,"-":f+1-d}[s.groups.sign],a<1)throw new Error("Invalid subroutine number")}else a==="0"&&(a=0);const c=sC(a);return i.push(c),c}function $A(e,t){return{type:"AbsenceFunction",kind:e,body:xc(t?.body)}}function aa(e){return{type:"Alternative",body:lC(e?.body)}}function Pm(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Nm(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function oC(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ZA(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:xc(t?.body)}}function uf(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function vd(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:lC(e?.body)}}function qA(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Hm(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function GA(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Es(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function WA(e){return{type:"Flags",...e}}function Ei(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:xc(e?.body)}}function Jo(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:xc(e?.body)}}function KA(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function YA(e,t){const n=!!t?.negate;if(!Ng.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function aC(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function XA(e,t){return{type:"Regex",body:xc(t?.body),flags:e}}function sC(e){return{type:"Subroutine",ref:e}}function ls(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(df(e));if(!i){if(n.normalizeUnknownPropertyNames)i=JA(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(en`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function QA({flags:e,kind:t,name:n,negate:i,number:a}){switch(t){case"absence_repeater":return $A("repeater");case"atomic":return Ei({atomic:!0});case"capturing":return oC(a,{name:n});case"group":return Ei({flags:e});case"lookahead":case"lookbehind":return Jo({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function xc(e){if(e===void 0)e=[aa()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function lC(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function sb(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function lb(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ZA(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function JA(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function df(e){return e.replace(/[- _]+/g,"").toLowerCase()}function cb(e,t){const n=t;return Es(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function ub(e){return Es(e,"Unclosed group")}function Yl(e,t,n=null){function i(s,c){for(let d=0;d<s.length;d++){const f=a(s[d],c,d,s);d=Math.max(-1,d+f)}}function a(s,c=null,d=null,f=null){let h=0,m=!1;const g={node:s,parent:c,key:d,container:f,root:e,remove(){Xu(f).splice(Math.max(0,is(d)+h),1),h--,m=!0},removeAllNextSiblings(){return Xu(f).splice(is(d)+1)},removeAllPrevSiblings(){const k=is(d)+h;return h-=k,Xu(f).splice(0,Math.max(0,k))},replaceWith(k,E={}){const T=!!E.traverse;f?f[Math.max(0,is(d)+h)]=k:Es(c,"Can't replace root node")[d]=k,T&&a(k,c,d,f),m=!0},replaceWithMultiple(k,E={}){const T=!!E.traverse;if(Xu(f).splice(Math.max(0,is(d)+h),1,...k),h+=k.length-1,T){let L=0;for(let O=0;O<k.length;O++)L+=a(k[O],c,is(d)+O+L,f)}m=!0},skip(){m=!0}},{type:y}=s,b=t["*"],S=t[y],w=typeof b=="function"?b:b?.enter,A=typeof S=="function"?S:S?.enter;if(w?.(g,n),A?.(g,n),!m)switch(y){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":a(s.min,s,"min"),a(s.max,s,"max");break;case"Quantifier":a(s.body,s,"body");break;case"Regex":i(s.body,s),a(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return S?.exit?.(g,n),b?.exit?.(g,n),h}return a(e),e}function Xu(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function is(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const e4=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function t4(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function n4(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const fi=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function zg(e,t,n,i){const a=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let c=0,d="";for(const f of e.matchAll(a)){const{0:h,groups:{$skip:m}}=f;if(!m&&(!i||i===fi.DEFAULT==!c)){n instanceof Function?d+=n(f,{context:c?fi.CHAR_CLASS:fi.DEFAULT,negated:s[s.length-1]}):d+=n;continue}h[0]==="["?(c++,s.push(h[1]==="^")):h==="]"&&c&&(c--,s.pop()),d+=h}return d}function cC(e,t,n,i){zg(e,t,n,i)}function i4(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const a=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");a.lastIndex=n;let s=0,c;for(;c=a.exec(e);){const{0:d,groups:{$skip:f}}=c;if(!f&&(!i||i===fi.DEFAULT==!s))return c;d==="["?s++:d==="]"&&s&&s--,a.lastIndex==c.index&&a.lastIndex++}return null}function Qu(e,t,n){return!!i4(e,t,0,n)}function r4(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,a=0,s=1,c;for(;c=n.exec(e);){const[d]=c;if(d==="[")a++;else if(a)d==="]"&&a--;else if(d==="(")s++;else if(d===")"&&(s--,!s)){i=c.index;break}}return e.slice(t,i)}const db=new RegExp(String.raw`(?<noncapturingStart>${e4})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function o4(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const a="(?>",s="(?:(?=(",c=[0],d=[];let f=0,h=0,m=NaN,g;do{g=!1;let y=0,b=0,S=!1,w;for(db.lastIndex=Number.isNaN(m)?0:m+s.length;w=db.exec(e);){const{0:A,index:k,groups:{capturingStart:E,noncapturingStart:T}}=w;if(A==="[")y++;else if(y)A==="]"&&y--;else if(A===a&&!S)m=k,S=!0;else if(S&&T)b++;else if(E)S?b++:(f++,c.push(f+h));else if(A===")"&&S){if(!b){h++;const L=f+h;if(e=`${e.slice(0,m)}${s}${e.slice(m+a.length,k)}))<$$${L}>)${e.slice(k+1)}`,g=!0,d.push(L),t4(n,L),i.size){const O=new Map;i.forEach((D,N)=>{O.set(N>=L?N+1:N,D.map(K=>K>=L?K+1:K))}),i=O}break}b--}}}while(g);return n.push(...d),e=zg(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:b,wrappedBackrefNum:S}})=>{if(b){const w=+b;if(w>c.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${c[w]}`}return`\\${S}`},fi.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const uC=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Bp=new RegExp(String.raw`
62
62
  \\(?: \d+
63
63
  | c[A-Za-z]
64
64
  | [gk]<[^>]+>
@@ -73,7 +73,7 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuF
73
73
  ))?
74
74
  | (?<qBase>${uC})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
75
75
  | \\?.
76
- `.replace(/\s+/g,""),"gsu");function a4(e){if(!new RegExp(`${uC}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,a="",s=0,c;for(Bp.lastIndex=0;c=Bp.exec(e);){const{0:d,index:f,groups:{qBase:h,qMod:m,invalidQ:g}}=c;if(d==="[")s||(i=f),s++;else if(d==="]")s?s--:i=null;else if(!s)if(m==="+"&&a&&!a.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${d}"`);let y=-1;if(/^\{\d+\}$/.test(h))e=n4(e,f+h.length,m,"");else{if(a===")"||a==="]"){const b=a===")"?n:i;if(b===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,b)}(?>${e.slice(b,f)}${h})${e.slice(f+d.length)}`}else e=`${e.slice(0,f-a.length)}(?>${a}${h})${e.slice(f+d.length)}`;y+=4}Bp.lastIndex+=y}else d[0]==="("?t.push(f):d===")"&&(n=t.length?t.pop():null);a=d}return{pattern:e}}const di=String.raw,s4=di`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,zm=di`\(\?R=(?<rDepth>[^\)]+)\)|${s4}`,ff=di`\(\?<(?![=!])(?<captureName>[^>]+)>`,dC=di`${ff}|(?<unnamed>\()(?!\?)`,Yo=new RegExp(di`${ff}|${zm}|\(\?|\\?.`,"gsu"),Up="Cannot use multiple overlapping recursions";function l4(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let a=t?.captureTransfers??new Map;if(!new RegExp(zm,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(i==="plugin"&&Qu(e,di`\(\?\(DEFINE\)`,fi.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],c=Qu(e,di`\\[1-9]`,fi.DEFAULT),d=new Map,f=[];let h=!1,m=0,g=0,y;for(Yo.lastIndex=0;y=Yo.exec(e);){const{0:b,groups:{captureName:S,rDepth:w,gRNameOrNum:A,gRDepth:k}}=y;if(b==="[")m++;else if(m)b==="]"&&m--;else if(w){if(fb(w),h)throw new Error(Up);if(c)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,y.index),T=e.slice(Yo.lastIndex);if(Qu(T,zm,fi.DEFAULT))throw new Error(Up);const L=+w-1;e=hb(E,T,L,!1,n,s,g),a=mb(a,E,L,s.length,0,g);break}else if(A){fb(k);let E=!1;for(const ee of f)if(ee.name===A||ee.num===+A){if(E=!0,ee.hasRecursedWithin)throw new Error(Up);break}if(!E)throw new Error(di`Recursive \g cannot be used outside the referenced group "${i==="external"?A:di`\g<${A}&R=${k}>`}"`);const T=d.get(A),L=r4(e,T);if(c&&Qu(L,di`${ff}|\((?!\?)`,fi.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const O=e.slice(T,y.index),D=L.slice(O.length+b.length),N=s.length,W=+k-1,G=hb(O,D,W,!0,n,s,g);a=mb(a,O,W,s.length-N,N,g);const se=e.slice(0,T),ie=e.slice(T+L.length);e=`${se}${G}${ie}`,Yo.lastIndex+=G.length-b.length-O.length-D.length,f.forEach(ee=>ee.hasRecursedWithin=!0),h=!0}else if(S)g++,d.set(String(g),Yo.lastIndex),d.set(S,Yo.lastIndex),f.push({num:g,name:S});else if(b[0]==="("){const E=b==="(";E&&(g++,d.set(String(g),Yo.lastIndex)),f.push(E?{num:g}:{})}else b===")"&&f.pop()}return n.push(...s),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function fb(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function hb(e,t,n,i,a,s,c){const d=new Set;i&&cC(e+t,ff,({groups:{captureName:h}})=>{d.add(h)},fi.DEFAULT);const f=[n,i?d:null,a,s,c];return`${e}${pb(`(?:${e}`,"forward",...f)}(?:)${pb(`${t})`,"backward",...f)}${t}`}function pb(e,t,n,i,a,s,c){const f=m=>t==="forward"?m+2:n-m+2-1;let h="";for(let m=0;m<n;m++){const g=f(m);h+=zg(e,di`${dC}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:b,unnamed:S,backref:w}})=>{if(w&&i&&!i.has(w))return y;const A=`_$${g}`;if(S||b){const k=c+s.length+1;return s.push(k),c4(a,k),S?y:`(?<${b}${A}>`}return di`\k<${w}${A}>`},fi.DEFAULT)}return h}function c4(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mb(e,t,n,i,a,s){if(e.size&&i){let c=0;cC(t,dC,()=>c++,fi.DEFAULT);const d=s-c+a,f=new Map;return e.forEach((h,m)=>{const g=(i-c*n)/n,y=c*n,b=m>d+c?m+i:m,S=[];for(const w of h)if(w<=d)S.push(w);else if(w>d+c+g)S.push(w+i);else if(w<=d+c)for(let A=0;A<=n;A++)S.push(w+c*A);else for(let A=0;A<=n;A++)S.push(w+y+g*A);f.set(b,S)}),f}return e}var qt=String.fromCodePoint,Oe=String.raw,Ti={},hf=globalThis.RegExp;Ti.flagGroups=(()=>{try{new hf("(?i:)")}catch{return!1}return!0})();Ti.unicodeSets=(()=>{try{new hf("[[]]","v")}catch{return!1}return!0})();Ti.bugFlagVLiteralHyphenIsRange=Ti.unicodeSets?(()=>{try{new hf(Oe`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Ti.bugNestedClassIgnoresNegation=Ti.unicodeSets&&new hf("[[^a]]","v").test("a");function Bd(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function sc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Vm(e,t){return gb[e]>=gb[t]}function u4(e,t){if(e==null)throw new Error(t??"Value expected");return e}var gb={ES2025:2025,ES2024:2024,ES2018:2018},d4={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function fC(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!d4[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Ti.flagGroups?"ES2025":Ti.unicodeSets?"ES2024":"ES2018"),t}var f4="[ -\r ]",h4=new Set([qt(304),qt(305)]),_r=Oe`[\p{L}\p{M}\p{N}\p{Pc}]`;function hC(e){if(h4.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),a=g4.get(n),s=p4.get(n),c=m4.get(n);return[...i].length===1&&t.add(i),c&&t.add(c),a&&t.add(a),t.add(n),s&&t.add(s),[...t]}var Vg=new Map(`C Other
76
+ `.replace(/\s+/g,""),"gsu");function a4(e){if(!new RegExp(`${uC}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,a="",s=0,c;for(Bp.lastIndex=0;c=Bp.exec(e);){const{0:d,index:f,groups:{qBase:h,qMod:m,invalidQ:g}}=c;if(d==="[")s||(i=f),s++;else if(d==="]")s?s--:i=null;else if(!s)if(m==="+"&&a&&!a.startsWith("(")){if(g)throw new Error(`Invalid quantifier "${d}"`);let y=-1;if(/^\{\d+\}$/.test(h))e=n4(e,f+h.length,m,"");else{if(a===")"||a==="]"){const b=a===")"?n:i;if(b===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,b)}(?>${e.slice(b,f)}${h})${e.slice(f+d.length)}`}else e=`${e.slice(0,f-a.length)}(?>${a}${h})${e.slice(f+d.length)}`;y+=4}Bp.lastIndex+=y}else d[0]==="("?t.push(f):d===")"&&(n=t.length?t.pop():null);a=d}return{pattern:e}}const di=String.raw,s4=di`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,zm=di`\(\?R=(?<rDepth>[^\)]+)\)|${s4}`,ff=di`\(\?<(?![=!])(?<captureName>[^>]+)>`,dC=di`${ff}|(?<unnamed>\()(?!\?)`,Yo=new RegExp(di`${ff}|${zm}|\(\?|\\?.`,"gsu"),Up="Cannot use multiple overlapping recursions";function l4(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let a=t?.captureTransfers??new Map;if(!new RegExp(zm,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(i==="plugin"&&Qu(e,di`\(\?\(DEFINE\)`,fi.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],c=Qu(e,di`\\[1-9]`,fi.DEFAULT),d=new Map,f=[];let h=!1,m=0,g=0,y;for(Yo.lastIndex=0;y=Yo.exec(e);){const{0:b,groups:{captureName:S,rDepth:w,gRNameOrNum:A,gRDepth:k}}=y;if(b==="[")m++;else if(m)b==="]"&&m--;else if(w){if(fb(w),h)throw new Error(Up);if(c)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const E=e.slice(0,y.index),T=e.slice(Yo.lastIndex);if(Qu(T,zm,fi.DEFAULT))throw new Error(Up);const L=+w-1;e=hb(E,T,L,!1,n,s,g),a=mb(a,E,L,s.length,0,g);break}else if(A){fb(k);let E=!1;for(const ee of f)if(ee.name===A||ee.num===+A){if(E=!0,ee.hasRecursedWithin)throw new Error(Up);break}if(!E)throw new Error(di`Recursive \g cannot be used outside the referenced group "${i==="external"?A:di`\g<${A}&R=${k}>`}"`);const T=d.get(A),L=r4(e,T);if(c&&Qu(L,di`${ff}|\((?!\?)`,fi.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const O=e.slice(T,y.index),D=L.slice(O.length+b.length),N=s.length,K=+k-1,G=hb(O,D,K,!0,n,s,g);a=mb(a,O,K,s.length-N,N,g);const se=e.slice(0,T),ie=e.slice(T+L.length);e=`${se}${G}${ie}`,Yo.lastIndex+=G.length-b.length-O.length-D.length,f.forEach(ee=>ee.hasRecursedWithin=!0),h=!0}else if(S)g++,d.set(String(g),Yo.lastIndex),d.set(S,Yo.lastIndex),f.push({num:g,name:S});else if(b[0]==="("){const E=b==="(";E&&(g++,d.set(String(g),Yo.lastIndex)),f.push(E?{num:g}:{})}else b===")"&&f.pop()}return n.push(...s),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function fb(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function hb(e,t,n,i,a,s,c){const d=new Set;i&&cC(e+t,ff,({groups:{captureName:h}})=>{d.add(h)},fi.DEFAULT);const f=[n,i?d:null,a,s,c];return`${e}${pb(`(?:${e}`,"forward",...f)}(?:)${pb(`${t})`,"backward",...f)}${t}`}function pb(e,t,n,i,a,s,c){const f=m=>t==="forward"?m+2:n-m+2-1;let h="";for(let m=0;m<n;m++){const g=f(m);h+=zg(e,di`${dC}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:b,unnamed:S,backref:w}})=>{if(w&&i&&!i.has(w))return y;const A=`_$${g}`;if(S||b){const k=c+s.length+1;return s.push(k),c4(a,k),S?y:`(?<${b}${A}>`}return di`\k<${w}${A}>`},fi.DEFAULT)}return h}function c4(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function mb(e,t,n,i,a,s){if(e.size&&i){let c=0;cC(t,dC,()=>c++,fi.DEFAULT);const d=s-c+a,f=new Map;return e.forEach((h,m)=>{const g=(i-c*n)/n,y=c*n,b=m>d+c?m+i:m,S=[];for(const w of h)if(w<=d)S.push(w);else if(w>d+c+g)S.push(w+i);else if(w<=d+c)for(let A=0;A<=n;A++)S.push(w+c*A);else for(let A=0;A<=n;A++)S.push(w+y+g*A);f.set(b,S)}),f}return e}var qt=String.fromCodePoint,Oe=String.raw,Ti={},hf=globalThis.RegExp;Ti.flagGroups=(()=>{try{new hf("(?i:)")}catch{return!1}return!0})();Ti.unicodeSets=(()=>{try{new hf("[[]]","v")}catch{return!1}return!0})();Ti.bugFlagVLiteralHyphenIsRange=Ti.unicodeSets?(()=>{try{new hf(Oe`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Ti.bugNestedClassIgnoresNegation=Ti.unicodeSets&&new hf("[[^a]]","v").test("a");function Bd(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function sc(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Vm(e,t){return gb[e]>=gb[t]}function u4(e,t){if(e==null)throw new Error(t??"Value expected");return e}var gb={ES2025:2025,ES2024:2024,ES2018:2018},d4={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function fC(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!d4[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Ti.flagGroups?"ES2025":Ti.unicodeSets?"ES2024":"ES2018"),t}var f4="[ -\r ]",h4=new Set([qt(304),qt(305)]),_r=Oe`[\p{L}\p{M}\p{N}\p{Pc}]`;function hC(e){if(h4.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),a=g4.get(n),s=p4.get(n),c=m4.get(n);return[...i].length===1&&t.add(i),c&&t.add(c),a&&t.add(a),t.add(n),s&&t.add(s),[...t]}var Vg=new Map(`C Other
77
77
  Cc Control cntrl
78
78
  Cf Format
79
79
  Cn Unassigned
@@ -169,7 +169,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[df(e),e])),p4=new Map([["s",qt(383)],[qt(383
169
169
  \v\f…\u2028\u2029])`),t));else if(f==="posix")if(!a&&(m==="graph"||m==="print")){if(i==="strict")throw new Error(`POSIX class "${m}" requires min target ES2024 or non-strict accuracy`);let g={graph:"!-~",print:" -~"}[m];h&&(g=`\0-${qt(g.codePointAt(0)-1)}${qt(g.codePointAt(2)+1)}-􏿿`),n(Mt(Cr(`[${g}]`),t))}else n(Mt(qp(Cr(v4.get(m)),h),t));else if(f==="property")Vg.has(df(m))||(e.key="sc");else if(f==="space")n(ho(ls("space",{negate:h}),t));else if(f==="word")n(Mt(qp(Cr(_r),h),t));else throw new Error(`Unexpected character set kind "${f}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:a,removeAllPrevSiblings:s,removeAllNextSiblings:c}){const{kind:d,flags:f}=e;if(d==="flags")if(!f.enable&&!f.disable)i();else{const h=Ei({flags:f});h.body[0].body=c(),a(Mt(h,t),{traverse:!0})}else if(d==="keep"){const h=n.body[0],g=n.body.length===1&&iC(h,{type:"Group"})&&h.body[0].body.length===1?h.body[0]:n;if(t.parent!==g||g.body.length>1)throw new Error(Oe`Uses "\K" in a way that's unsupported`);const y=Jo({behind:!0});y.body[0].body=s(),a(Mt(y,t))}else throw new Error(`Unexpected directive kind "${d}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),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;const{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){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(Mt(Jo({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ei();t.body[0].body.push(e.body),e.body=Mt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,a=!1;for(const s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const c=bC(s.body);c?(i=!0,Array.isArray(c)?n.push(...c):n.push(c)):a=!0}i&&!a&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(Oe`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!$p(n)&&(n=jp(n,t),e.ref=n)}},_4={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:a}=e;i||n.set(e,[...t.get(a).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:a,groupsByName:s,multiplexCapturesToLeftByRef:c,openRefs:d,reffedNodesByReferencer:f}){const h=a.get(e);if(h&&d.has(e.number)){const g=ho(vb(e.number),t);f.set(g,d.get(e.number)),n(g);return}d.set(e.number,e),c.set(e.number,[]),e.name&&sc(c,e.name,[]);const m=c.get(e.name??e.number);for(let g=0;g<m.length;g++){const y=m[g];if(h===y.node||h&&h===y.origin||e===y.origin){m.splice(g,1);break}}if(c.get(e.number).push({node:e,origin:h}),e.name&&c.get(e.name).push({node:e,origin:h}),e.name){const g=sc(s,e.name,new Map);let y=!1;if(h)y=!0;else for(const b of g.values())if(!b.hasDuplicateNameToRemove){y=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},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=Bd(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:a,ref:s}=e;if(a){let m=t;for(;(m=m.parent)&&!(m.type==="CapturingGroup"&&(m.name===s||m.number===s)););i.reffedNodesByReferencer.set(e,m);return}const c=i.subroutineRefMap.get(s),d=s===0,f=d?vb(0):gC(c,i.groupOriginByCopy,null);let h=f;if(!d){const m=vC(x4(c,y=>y.type==="Group"&&!!y.flags)),g=m?Bd(i.globalFlags,m):i.globalFlags;E4(g,i.currentFlags)||(h=Ei({flags:T4(g)}),h.body[0].body.push(f))}n(Mt(h,t),{traverse:!d})}},C4={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const s=i.reffedNodesByReferencer.get(e).filter(c=>w4(c,e));if(!s.length)n(Mt(Jo({negate:!0}),t));else if(s.length>1){const c=Ei({atomic:!0,body:s.reverse().map(d=>aa({body:[Nm(d.number)]}))});n(Mt(c,t))}else e.ref=s[0].number},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){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const a=oC();e.body.at(-1).body.push(a)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function mC(e){Yl(e,{"*"({node:t,parent:n}){t.parent=n}})}function E4(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function w4(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=yC(n.parent);for(const a of i){if(a===n)break;if(a===e||SC(a,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function gC(e,t,n,i){const a=Array.isArray(e)?[]:{};for(const[s,c]of Object.entries(e))s==="parent"?a.parent=Array.isArray(n)?i:n:c&&typeof c=="object"?a[s]=gC(c,t,a,n):(s==="type"&&c==="CapturingGroup"&&t.set(a,t.get(e)??e),a[s]=c);return a}function vb(e){const t=sC(e);return t.isRecursive=!0,t}function x4(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function jp(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function vC(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(a=>{i.enable?.[a]&&(delete n.disable[a],n.enable[a]=!0),i.disable?.[a]&&(n.disable[a]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function T4({dotAll:e,ignoreCase:t}){const 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 yC(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function bC(e){const t=e.find(n=>n.kind==="search_start"||L4(n,{negate:!1})||!k4(n));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"){const n=[];for(const i of t.body){const a=bC(i.body);if(!a)return null;Array.isArray(a)?n.push(...a):n.push(a)}return n}return null}function SC(e,t){const n=yC(e)??[];for(const i of n)if(i===t||SC(i,t))return!0;return!1}function k4({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function A4(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function L4(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&iC(e.body[0],{type:"Assertion",kind:"search_start"})}function $p(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Cr(e,t){const i=rC(e,{...t,unicodePropertyMap:Vg}).body;return i.length>1||i[0].body.length>1?Ei({body:i}):i[0].body[0]}function qp(e,t){return e.negate=t,e}function ho(e,t){return e.parent=t,e}function Mt(e,t){return mC(e),e.parent=t,e}function I4(e,t){const n=fC(t),i=Vm(n.target,"ES2024"),a=Vm(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let c=null,d=null;if(!a){const b=[e.flags.ignoreCase];Yl(e,R4,{getCurrentModI:()=>b.at(-1),popModI(){b.pop()},pushModI(S){b.push(S)},setHasCasedChar(){b.at(-1)?c=!0:d=!0}})}const f={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||c)&&!d)};let h=e;const m={accuracy:n.accuracy,appliedGlobalFlags:f,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:h,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!a&&c&&d),useFlagMods:a,useFlagV:i,verbose:n.verbose};function g(b){return m.lastNode=h,h=b,u4(D4[b.type],`Unexpected node type "${b.type}"`)(b,m,g)}const y={pattern:e.body.map(g).join("|"),flags:g(e.flags),options:{...e.options}};return i||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],m.captureMap.forEach((b,S)=>{b.hidden&&y._hiddenCaptures.push(S),b.transferTo&&sc(y._captureTransfers,b.transferTo,[]).push(S)}),y}var R4={"*":{enter({node:e},t){if(bb(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Bd({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){bb(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Bg(qt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),_C(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&pC.has(e.value)&&t.setHasCasedChar()}},D4={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?Oe`\B`:Oe`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:a,number:s}=e,c={ignoreCase:t.currentFlags.ignoreCase},d=t.originMap.get(e);return d&&(c.hidden=!0,s>d.number&&(c.transferTo=d.number)),t.captureMap.set(s,c),`(${a?`?<${a}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=qt(e),i=rs(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Bg(n)){const a=hC(n);return t.inCharClass?a.join(""):a.length>1?`[${a.join("")}]`:a[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:a,parent:s}=e;let{body:c}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Ti.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&c.some(Sb)&&(c=[uf(45),...c.filter(h=>!Sb(h))]);const d=()=>`[${a?"^":""}${c.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Ti.bugNestedClassIgnoresNegation)&&!a){const m=c.filter(g=>g.type==="CharacterClass"&&g.kind==="union"&&g.negate);if(m.length){const g=Ei(),y=g.body[0];return g.parent=s,y.parent=g,c=c.filter(b=>!m.includes(b)),e.body=c,c.length?(e.parent=y,y.body.push(e)):g.body.pop(),m.forEach(b=>{const S=aa({body:[b]});b.parent=S,S.parent=g,g.body.push(S)}),n(g)}}t.inCharClass=!0;const h=d();return t.inCharClass=!1,h}const f=c[0];if(i==="union"&&!a&&f&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(Ti.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&c.length===1&&f.type!=="CharacterClassRange"))return c.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return d()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,a={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=rs(n,a),c=rs(i,a),d=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const f=_C(e);H4(f).forEach(m=>{d.add(Array.isArray(m)?`${rs(m[0],a)}-${rs(m[1],a)}`:rs(m,a))})}return`${s}-${c}${[...d].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},a){if(e==="dot")return a.currentFlags.dotAll?a.appliedGlobalFlags.dotAll||a.useFlagMods?".":"[^]":Oe`[^\n]`;if(e==="digit")return t?Oe`\D`:Oe`\d`;if(e==="property"){if(a.useAppliedIgnoreCase&&a.currentFlags.ignoreCase&&pC.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Oe`\P`:Oe`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Oe`\W`:Oe`\w`;throw new 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:i},a,s){const c=a.currentFlags;n&&(a.currentFlags=Bd(c,n));const d=t.map(s).join("|"),f=!a.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!a.useFlagMods||!n)?d:`(?${z4(e,n,a.useFlagMods)}${d})`;return a.currentFlags=c,f},LookaroundAssertion({body:e,kind:t,negate:n},i,a){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(a).join("|")})`},Quantifier(e,t,n){return n(e.body)+V4(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:Oe`\g<${t}&R=${i}>`}},M4=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),O4=new Set(["-","\\","]","^","["]),P4=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),yb=new Map([[9,Oe`\t`],[10,Oe`\n`],[11,Oe`\v`],[12,Oe`\f`],[13,Oe`\r`],[8232,Oe`\u2028`],[8233,Oe`\u2029`],[65279,Oe`\uFEFF`]]),N4=/^\p{Cased}$/u;function Bg(e){return N4.test(e)}function _C(e,t){const n=!!t?.firstOnly,i=e.min.value,a=e.max.value,s=[];if(i<65&&(a===65535||a>=131071)||i===65536&&a>=131071)return s;for(let c=i;c<=a;c++){const d=qt(c);if(!Bg(d))continue;const f=hC(d).filter(h=>{const m=h.codePointAt(0);return m<i||m>a});if(f.length&&(s.push(...f),n))break}return s}function rs(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(yb.has(e))return yb.get(e);if(e<32||e>126&&e<160||e>262143||t&&B4(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const a=n?i?P4:O4:M4,s=qt(e);return(a.has(s)?"\\":"")+s}function H4(e){const t=e.map(a=>a.codePointAt(0)).sort((a,s)=>a-s),n=[];let i=null;for(let a=0;a<t.length;a++)t[a+1]===t[a]+1?i??=t[a]:i===null?n.push(t[a]):(n.push([i,t[a]]),i=null);return n}function z4(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:a,disable:s}=t;i=(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${i}:`}function V4({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function bb({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function B4(e){return e>47&&e<58}function Sb({type:e,value:t}){return e==="Character"&&t===45}var U4=class Bm extends RegExp{#e=new Map;#t=null;#l;#a=null;#r=null;rawOptions={};get source(){return this.#l||"(?:)"}constructor(t,n,i){const a=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const s=t;super(s,n),this.#l=s.source,s instanceof Bm&&(this.#e=s.#e,this.#a=s.#a,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...i};super(a?"":t,n),this.#l=t,this.#e=j4(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=i??{}}a||(this.#t=this)}exec(t){if(!this.#t){const{lazyCompile:a,...s}=this.rawOptions;this.#t=new Bm(this.#l,this.flags,s)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;const a=this.#A(t.slice(i));return a&&(F4(a,i,t,this.hasIndices),this.lastIndex+=i),a}return this.#A(t)}#A(t){this.#t.lastIndex=this.lastIndex;const n=super.exec.call(this.#t,t);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;const i=[...n];n.length=1;let a;this.hasIndices&&(a=[...n.indices],n.indices.length=1);const s=[0];for(let c=1;c<i.length;c++){const{hidden:d,transferTo:f}=this.#e.get(c)??{};if(d?s.push(null):(s.push(n.length),n.push(i[c]),this.hasIndices&&n.indices.push(a[c])),f&&i[c]!==void 0){const h=s[f];if(!h)throw new Error(`Invalid capture transfer to "${h}"`);if(n[h]=i[c],this.hasIndices&&(n.indices[h]=a[c]),n.groups){this.#a||(this.#a=$4(this.source));const m=this.#a.get(f);m&&(n.groups[m]=i[c],this.hasIndices&&(n.indices.groups[m]=a[c]))}}}return n}};function F4(e,t,n,i){if(e.index+=t,e.input=n,i){const a=e.indices;for(let c=0;c<a.length;c++){const d=a[c];d&&(a[c]=[d[0]+t,d[1]+t])}const s=a.groups;s&&Object.keys(s).forEach(c=>{const d=s[c];d&&(s[c]=[d[0]+t,d[1]+t])})}}function j4(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,a]of t)for(const s of a)sc(n,s,{}).transferTo=i;return n}function $4(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,a=0,s;for(;s=t.exec(e);){const{0:c,groups:{capture:d,name:f}}=s;c==="["?i++:i?c==="]"&&i--:d&&(a++,f&&n.set(a,f))}return n}function q4(e,t){const n=G4(e,t);return n.options?new U4(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function G4(e,t){const n=fC(t),i=rC(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Vg}),a=b4(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=I4(a,n),c=l4(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),d=a4(c.pattern),f=o4(d.pattern,{captureTransfers:c.captureTransfers,hiddenCaptures:c.hiddenCaptures}),h={pattern:f.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const m=f.hiddenCaptures.sort((S,w)=>S-w),g=Array.from(f.captureTransfers),y=a._strategy,b=h.pattern.length>=n.lazyCompileLength;(m.length||g.length||y||b)&&(h.options={...m.length&&{hiddenCaptures:m},...g.length&&{transfers:g},...y&&{strategy:y},...b&&{lazyCompile:b}})}return h}function CC(e,t){return q4(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function EC(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>CC(n,{target:t.target}),{createScanner(n){return new cA(n,t)},createString(n){return{content:n}}}}e2(Eg({bundledLanguages:()=>nc,bundledLanguagesAlias:()=>xg,bundledLanguagesBase:()=>wg,bundledLanguagesInfo:()=>Jd,bundledThemes:()=>kg,bundledThemesInfo:()=>Tg,codeToHast:()=>G2,codeToHtml:()=>q2,codeToTokens:()=>W2,codeToTokensBase:()=>K2,codeToTokensWithThemes:()=>Y2,createHighlighter:()=>cf,createJavaScriptRegexEngine:()=>EC,createOnigurumaEngine:()=>Ig,defaultJavaScriptRegexConstructor:()=>CC,getLastGrammarState:()=>Q2,getSingletonHighlighter:()=>X2,loadWasm:()=>Lg}),lA);async function wC(e){if(J_())throw new 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.`);const t=Ip.get(e);if(t!=null)return t;try{let n=Bx.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(nc,e)&&(n=nc[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:a})=>{const s={name:e,data:a};return oa.has(e)||oa.set(e,s),s});return Ip.set(e,i),await i}finally{Ip.delete(e)}}function xC(e){return oa.get(e)??wC(e)}function TC({name:e,load:t,colorScheme:n,collection:i,displayName:a}){return{name:e,colorScheme:n,collection:i,displayName:a,load:W4(t)}}function W4(e){return async()=>af(Z_(await e()))}const K4="pierre",Y4=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],kC=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],X4=[...kC,...Y4],Q4=new Set(kC);function Z4(e){return Q4.has(e)?"light":"dark"}const J4={"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"},e8={"pierre-dark":()=>C(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>C(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>C(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>C(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>C(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>C(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>C(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>C(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>C(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>C(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function t8(e){return TC({name:e,collection:K4,colorScheme:Z4(e),displayName:J4[e],load:e8[e]})}const AC=tc({themes:X4.map(e=>t8(e))}),n8="shiki",LC=["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"],i8=["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"],r8=new Set(LC);function o8(e){return r8.has(e)?"light":"dark"}const a8={andromeeda:()=>C(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>C(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>C(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>C(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>C(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>C(()=>import("./catppuccin-frappe-DFWUc33u.js"),[],import.meta.url),"catppuccin-latte":()=>C(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[],import.meta.url),"catppuccin-macchiato":()=>C(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[],import.meta.url),"catppuccin-mocha":()=>C(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[],import.meta.url),"dark-plus":()=>C(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>C(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>C(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>C(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>C(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>C(()=>import("./github-dark-DHJKELXO.js"),[],import.meta.url),"github-dark-default":()=>C(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>C(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>C(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>C(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),"github-light-default":()=>C(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>C(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>C(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>C(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>C(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>C(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>C(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>C(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>C(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>C(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>C(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>C(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[],import.meta.url),"kanagawa-lotus":()=>C(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[],import.meta.url),"kanagawa-wave":()=>C(()=>import("./kanagawa-wave-DWedfzmr.js"),[],import.meta.url),laserwave:()=>C(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>C(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>C(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>C(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>C(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>C(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>C(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>C(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>C(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>C(()=>import("./monokai-D4h5O-jR.js"),[],import.meta.url),"night-owl":()=>C(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>C(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>C(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>C(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>C(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>C(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>C(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>C(()=>import("./red-bN70gL4F.js"),[],import.meta.url),"rose-pine":()=>C(()=>import("./rose-pine-qdsjHGoJ.js"),[],import.meta.url),"rose-pine-dawn":()=>C(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[],import.meta.url),"rose-pine-moon":()=>C(()=>import("./rose-pine-moon-D4_iv3hh.js"),[],import.meta.url),"slack-dark":()=>C(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>C(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>C(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>C(()=>import("./solarized-dark-DXbdFlpD.js"),[],import.meta.url),"solarized-light":()=>C(()=>import("./solarized-light-L9t79GZl.js"),[],import.meta.url),"synthwave-84":()=>C(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>C(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>C(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>C(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>C(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>C(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function _b(e){return TC({name:e,collection:n8,colorScheme:o8(e),load:a8[e]})}const IC=tc({themes:Object.freeze([...LC.map(e=>_b(e)),...i8.map(e=>_b(e))])});tc({themes:[AC,IC]});function RC(e){if(J_())throw new 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(xi.hasRegisteredTheme(e))return;const t=IC.getTheme(e);if(t!=null){xi.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function DC(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function s8(e){RC(e);const t=await xi.resolveTheme(e);return DC(e,t),t}function l8(e){return xi.getResolvedTheme(e)??s8(e)}let Fi;async function Ud({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){Fi??=cf({themes:[],langs:["text"],engine:n==="shiki-wasm"?Ig(C(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):EC()});const i=c8(Fi)?await Fi:Fi;Fi=i;const a=[];for(const c of t){if(c==="text"||c==="ansi")continue;const d=xC(c);"then"in d?a.push(d):Ry(d,i)}const s=[];for(const c of e){const d=l8(c);"then"in d?s.push(d):bm(d,Fi)}return(a.length>0||s.length>0)&&await Promise.all([Promise.all(a).then(c=>{Ry(c,i)}),Promise.all(s).then(c=>{bm(c,i)})]),i}function MC(){if(Fi!=null&&!("then"in Fi))return Fi}function c8(e=Fi){return e!=null&&"then"in e}for(const e of AC.getThemes())xi.registerThemeIfAbsent(e.name,e.load);function lc(e=xt){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function Um(e){return xi.hasResolvedThemes(e)}function go(e,t){return ua(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function vo(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}const Zo=new Map;let u8=0;const Rl={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function xn(e){if(Zo.has(e))return Zo.get(e)??"text";if(Rl[e]!=null)return Rl[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Zo.has(t[1]))return Zo.get(t[1])??"text";if(Rl[t[1]]!=null)return Rl[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return Zo.has(n)?Zo.get(n)??"text":Rl[n]??"text"}function d8(){return u8}function f8(){return Object.fromEntries(Zo)}function cc(e){return(e.lang??xn(e.name))==="text"}function Fd({lines:e,startingLine:t=0,totalLines:n=1/0,callback:i}){const a=Math.min(t+n,e.length),s=(()=>{const c=e.at(-1);return c===""||c===`
170
170
  `||c===`\r
171
171
  `||c==="\r"?Math.max(0,e.length-2):e.length-1})();for(let c=t;c<a;c++){const d=c===s;if(i({lineIndex:c,lineNumber:c+1,content:e[c],isLastLine:d})===!0||d)break}}function sa(e){return e.replace(/\n$|\r\n$/,"")}function Gi(e){return{type:"text",value:e}}function Ne({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function jd({name:e,width:t=16,height:n=16,properties:i}){return Ne({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[Ne({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function h8(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function us(e){return Ne({tagName:"div",properties:{"data-gutter":""},children:e})}function OC(e,t,n,i={}){return Ne({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[Ne({tagName:"span",properties:{"data-line-number-content":""},children:[Gi(`${t}`)]})]:void 0})}function Yn(e,t,n){return Ne({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 p8(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const a=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(a,{node:e,line:t,state:n}),new Error(a)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(Gi(`
172
- `)),e}const Zu=Symbol("no-token"),Gp=Symbol("multiple-tokens");function PC(e){const t=m8(e);if(t!=null)return t;let n=Zu;const i=[];let a=[],s;const c=()=>{if(a.length===0||s==null){a=[],s=void 0;return}if(a.length===1){const f=a[0];if(f?.type==="element"){g8(f,s);for(const h of f.children)yd(h)}else yd(f);i.push(f),a=[],s=void 0;return}for(const f of a)yd(f);i.push(Ne({tagName:"span",properties:{"data-char":s},children:a})),a=[],s=void 0},d=f=>{if(f!==Zu){if(f===Gp){n=Gp;return}if(n===Zu){n=f;return}n!==f&&(n=Gp)}};for(const f of e.children){const h=f.type==="element"?PC(f):Zu;if(d(h),typeof h!="number"){c(),i.push(f);continue}s!=null&&s!==h&&c(),s??=h,a.push(f)}return c(),e.children=i,n}function m8(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function yd(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)yd(t)}}function g8(e,t){e.properties["data-char"]=t}function v8(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=d=>d}=e,a=new Map;function s(d){return Object.entries(d).map(([f,h])=>`${f}:${h}`).join(";")}function c(d){let f=t+y8(typeof d=="string"?d:s(d))+n;return f=i(f),a.has(f)||a.set(f,typeof d=="string"?d:{...d}),f}return{name:"@shikijs/transformers:style-to-class",pre(d){if(!d.properties.style)return;const f=c(d.properties.style);delete d.properties.style,this.addClassToHast(d,f)},tokens(d){for(const f of d)for(const h of f){if(!h.htmlStyle)continue;const m=c(h.htmlStyle);h.htmlStyle={},h.htmlAttrs||={},h.htmlAttrs.class?h.htmlAttrs.class+=` ${m}`:h.htmlAttrs.class=m}},getClassRegistry(){return a},getCSS(){let d="";for(const[f,h]of a.entries())d+=`.${f}{${typeof h=="string"?h:s(h)}}`;return d},clearRegistry(){a.clear()}}}function y8(e,t=0){let n=3735928559^t,i=1103547991^t;for(let a=0,s;a<e.length;a++)s=e.charCodeAt(a),n=Math.imul(n^s,2654435761),i=Math.imul(i^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function NC(e=!1,t=!1){const n={lineInfo:[]},i=[{line(a){return delete a.properties.class,a},pre(a){const s=h8(a),c=[];if(s!=null){let d=1;for(const f of s.children)f.type==="element"&&(e&&PC(f),c.push(p8(f,d,n)),d++);s.children=c}return a},...e?{tokens(a){for(const s of a){let c=0;for(const d of s){const f=d;f.__lineChar??=c,c+=d.content.length}}},preprocess(a,s){s.mergeWhitespaces="never"},span(a,s,c,d,f){if(f?.offset!=null&&f.content!=null){const h=f.__lineChar;return h!=null&&(a.properties["data-char"]=h),a}return a}}:null}];return t&&i.push(b8,Cb),{state:n,transformers:i,toClass:Cb}}const Cb=v8({classPrefix:"hl-"}),b8={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function Xn(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const S8=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,_8=/^0(?:\.0+)?%?$/;function C8(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const a=i.lastIndexOf("/");if(a!==-1)return i.slice(a+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const s=i.split(",");if(s.length===4)return s[3]?.trim()}}function E8(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,a=1;return n.length===3?i=n.split("").map(s=>s+s).join(""):n.length===6?i=n:(i=n.slice(0,6),a=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),a]}function Wp(e){if(e==null)return null;const t=E8(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,a=t[2]/255,s=c=>c<=.03928?c/12.92:((c+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(i)+.0722*s(a)}function Eb(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||S8.test(t))return!0;const n=C8(t);return n!=null&&_8.test(n)}function w8(e,t,n){if(t==null||n==null)return!1;const i=Wp(e),a=Wp(t),s=Wp(n);return i==null||a==null||s==null?!1:Math.abs(i-s)<Math.abs(i-a)}const wb=new WeakMap;function Kp(e){const t=wb.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},a=n["editor.background"]??e.bg,s=n["editor.foreground"]??e.fg,c=n["sideBar.background"]??a,d=n["sideBar.foreground"]??s;Hi(i,"editor.background",a),Hi(i,"editor.foreground",s),Hi(i,"sideBar.background",c),Hi(i,"sideBar.foreground",d),Hi(i,"input.background",n["input.background"]??c),Hi(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??d),Hi(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??d),Hi(i,"gitDecoration.addedResourceForeground",Yp(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Hi(i,"gitDecoration.modifiedResourceForeground",Yp(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Hi(i,"gitDecoration.deletedResourceForeground",Yp(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const f=(Eb(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(Eb(n.focusBorder)?void 0:n.focusBorder);f!=null?i["list.focusOutline"]=f:delete i["list.focusOutline"];const h=n["list.hoverBackground"];h!=null&&(x8(h,c)||w8(h,c,d))&&delete i["list.hoverBackground"];const m=Object.freeze({...e,colors:Object.freeze(i)});return wb.set(e,m),m}function Hi(e,t,n){n!=null&&n!==""&&(e[t]=n)}function Yp(...e){for(const t of e)if(t!=null&&t!=="")return t}function x8(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function HC({theme:e=xt,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const a=t.getTheme(e),s=Kp(a);i+=`color:${s.fg};`,i+=`background-color:${s.bg};`,i+=`${Xn("global")}fg:${s.fg};`,i+=`${Xn("global")}bg:${s.bg};`,i+=Xp(a,n)}else{let a=t.getTheme(e.dark),s=Kp(a);i+=`${Xn("global")}dark:${s.fg};`,i+=`${Xn("global")}dark-bg:${s.bg};`,i+=Xp(a,"dark"),a=t.getTheme(e.light),s=Kp(a),i+=`${Xn("global")}light:${s.fg};`,i+=`${Xn("global")}light-bg:${s.bg};`,i+=Xp(a,"light")}return i}function Xp(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${Xn("global")}${t}addition-color:${i};`);const a=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];a!=null&&(n+=`${Xn("global")}${t}deletion-color:${a};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${Xn("global")}${t}modified-color:${s};`),n}function Fm(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function jm(e){return e!==""?e.split(fx):[]}const T8={forcePlainText:!1};function zC(e,t,{theme:n=xt,tokenizeMaxLineLength:i,useTokenTransformer:a},{forcePlainText:s,startingLine:c,totalLines:d,lines:f}=T8){s?(c??=0,d??=1/0):(c=0,d=1/0);const h=c>0||d<1/0,{state:m,transformers:g}=NC(a),y=s?"text":e.lang??xn(e.name),b=typeof n=="string"?t.getTheme(n).type:void 0,S=HC({theme:n,highlighter:t});m.lineInfo=E=>({type:"context",lineIndex:E-1+c,lineNumber:E+c});const w=typeof n=="string"?{lang:y,theme:n,transformers:g,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:y,themes:n,transformers:g,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},A=Fm(t.codeToHast(h?k8(f??jm(e.contents),c,d):sa(e.contents),w)),k=h?new Array(c):A;return h&&k.push(...A),{code:k,themeStyles:S,baseThemeType:b}}function k8(e,t,n){let i="";return Fd({lines:e,startingLine:t,totalLines:n,callback({content:a}){i+=a}}),i}function ds(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function kr(e,t){return ua(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function uc(e){const t=e.lang??xn(e.name),n=e.lang??(e.prevName!=null?xn(e.prevName):"text");return t==="text"&&n==="text"}function Qp(e){return{..._g,...e}}function ji(e,t){const n=A8(e,t);return t?n:e.diffHeaderHeight+n}function A8(e,t){return e.paddingTop??(t?e.spacing:0)}function $d(e){return e.paddingBottom??e.spacing}function L8(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function dc({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:a}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(n===!0||s<=a)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const c=n?.get(i),d=Math.min(Math.max(c?.fromStart??0,0),s),f=Math.min(Math.max(c?.fromEnd??0,0),s),h=d+f,m=h>=s;return{fromStart:m?s:d,fromEnd:m?0:f,rangeSize:s,collapsedLines:Math.max(s-h,0),renderAll:m}}function VC({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-(n.additionLineIndex+n.additionCount),a=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(i<=0&&a<=0)return 0;if(i!==a)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${a}) for ${e.name}`);return Math.min(i,a)}function fc({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:a}){if(t!==e.hunks.length-1)return;const s=VC({fileDiff:e,errorPrefix:a});if(s<=0)return;if(n===!0||s<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const c=n?.get(e.hunks.length),d=Math.min(Math.max(c?.fromStart??0,0),s);return{fromStart:d,fromEnd:0,rangeSize:s,collapsedLines:s-d,renderAll:d>=s}}function BC({type:e,metrics:t}){return t.hunkSeparatorHeight??L8(e)}function UC({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function I8({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 R8(e){return e!=="simple"&&e!=="metadata"}function Ul({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!I8({type:e,hunkIndex:n,hunkSpecs:i}))return;const a=BC({type:e,metrics:t}),s=UC({type:e,metrics:t}),c=n>0?s:0,d=s;return{height:a,gapBefore:c,gapAfter:d,totalHeight:c+a+d}}function Fl({type:e,metrics:t}){if(!R8(e))return;const n=BC({type:e,metrics:t}),i=UC({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function Xl({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:a,collapsedContextThreshold:s=1,callback:c}){const d=D8({diff:e,diffStyle:t,startingLine:n,expandedHunks:a,collapsedContextThreshold:s}),f={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:d.splitCount,unifiedCount:d.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!f.isWindowedHighlight)return!1;const h=f.unifiedCount>=n+i,m=f.splitCount>=n+i;return t==="unified"?h:(t==="split"||h)&&m},shouldSkip(h,m){if(!f.isWindowedHighlight)return!1;const g=f.unifiedCount+h<n,y=f.splitCount+m<n;return t==="unified"?g:(t==="split"||g)&&y},incrementCounts(h,m){(t==="unified"||t==="both")&&(f.unifiedCount+=h),(t==="split"||t==="both")&&(f.splitCount+=m)},isInWindow(h,m){if(!f.isWindowedHighlight)return!0;const g=f.isInUnifiedWindow(h),y=f.isInSplitWindow(m);return t==="unified"?g:t==="split"?y:g||y},isInUnifiedWindow(h){return!f.isWindowedHighlight||f.unifiedCount>=n-h&&f.unifiedCount<n+i},isInSplitWindow(h){return!f.isWindowedHighlight||f.splitCount>=n-h&&f.splitCount<n+i},emit(h,m=!1){return m||(t==="unified"?f.incrementCounts(1,0):t==="split"?f.incrementCounts(0,1):f.incrementCounts(1,1)),c(h)??!1}};e:for(let h=d.hunkIndex;h<e.hunks.length;h++){let S=function(W,G){return y==null||y.collapsedLines<=0||y.fromStart+y.fromEnd>0?0:t==="unified"?W===m.unifiedLineStart+m.unifiedLineCount-1?y.collapsedLines:0:G===m.splitLineStart+m.splitLineCount-1?y.collapsedLines:0},A=function(){return w?0:(w=!0,g.collapsedLines)};const m=e.hunks[h];if(m==null)throw new Error("iterateOverDiff: invalid hunk index");if(f.shouldBreak())break;const g=dc({isPartial:e.isPartial,rangeSize:m.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:s}),y=h===f.finalHunkIndex?fc({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,b=g.fromStart+g.fromEnd;let w=g.collapsedLines===0;if(f.shouldSkip(b,b))f.incrementCounts(b,b),A();else{let W=m.unifiedLineStart-g.rangeSize,G=m.splitLineStart-g.rangeSize,se=m.deletionLineIndex-g.rangeSize,ie=m.additionLineIndex-g.rangeSize,ee=m.deletionStart-g.rangeSize,te=m.additionStart-g.rangeSize;if(Ju(f,g.fromStart,t,le=>f.emit({hunkIndex:h,hunk:m,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:ee+le,lineIndex:se+le,noEOFCR:!1,unifiedLineIndex:W+le,splitLineIndex:G+le},additionLine:{unifiedLineIndex:W+le,splitLineIndex:G+le,lineIndex:ie+le,lineNumber:te+le,noEOFCR:!1}}))||(W=m.unifiedLineStart-g.fromEnd,G=m.splitLineStart-g.fromEnd,se=m.deletionLineIndex-g.fromEnd,ie=m.additionLineIndex-g.fromEnd,ee=m.deletionStart-g.fromEnd,te=m.additionStart-g.fromEnd,Ju(f,g.fromEnd,t,le=>f.emit({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:ee+le,lineIndex:se+le,noEOFCR:!1,unifiedLineIndex:W+le,splitLineIndex:G+le},additionLine:{unifiedLineIndex:W+le,splitLineIndex:G+le,lineIndex:ie+le,lineNumber:te+le,noEOFCR:!1}}),()=>{A()})))break e}let k=m.unifiedLineStart,E=m.splitLineStart,T=m.deletionLineIndex,L=m.additionLineIndex,O=m.deletionStart,D=m.additionStart;const N=m.hunkContent.at(-1);for(const W of m.hunkContent){if(f.shouldBreak())break e;const G=W===N;if(W.type==="context"){if(f.shouldSkip(W.lines,W.lines))f.incrementCounts(W.lines,W.lines),A();else if(Ju(f,W.lines,t,se=>{const ie=G&&se===W.lines-1,ee=k+se,te=E+se;return f.emit({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:S(ee,te),type:"context",deletionLine:{lineNumber:O+se,lineIndex:T+se,noEOFCR:ie&&m.noEOFCRDeletions,unifiedLineIndex:ee,splitLineIndex:te},additionLine:{unifiedLineIndex:ee,splitLineIndex:te,lineIndex:L+se,lineNumber:D+se,noEOFCR:ie&&m.noEOFCRAdditions}})},()=>{A()}))break e;k+=W.lines,E+=W.lines,T+=W.lines,L+=W.lines,O+=W.lines,D+=W.lines}else{const se=Math.max(W.deletions,W.additions),ie=W.deletions+W.additions;if(!f.shouldSkip(ie,se)){const ee=P8(f,W,t);(ee[0]?.[0]??0)>0&&A();for(const[te,le]of ee)for(let me=te;me<le;me++){const H=S(k+me,t==="unified"?E+(me<W.deletions?me:me-W.deletions):E+me);if(f.emit(N8({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:H,diffStyle:t,index:me,unifiedLineIndex:k,splitLineIndex:E,additionLineIndex:L,deletionLineIndex:T,additionLineNumber:D,deletionLineNumber:O,content:W,isLastContent:G,unifiedCount:ie,splitCount:se}),!0))break e}}A(),f.incrementCounts(ie,se),k+=ie,E+=se,T+=W.deletions,L+=W.additions,O+=W.deletions,D+=W.additions}}if(y!=null){const{collapsedLines:W,fromStart:G,fromEnd:se}=y,ie=G+se;if(Ju(f,ie,t,ee=>{const te=ee===ie-1;return f.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:te?W:0,type:"context-expanded",deletionLine:{lineNumber:O+ee,lineIndex:T+ee,noEOFCR:!1,unifiedLineIndex:k+ee,splitLineIndex:E+ee},additionLine:{unifiedLineIndex:k+ee,splitLineIndex:E+ee,lineIndex:L+ee,lineNumber:D+ee,noEOFCR:!1}})},void 0,()=>f.shouldBreak()))break e}}}function D8({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=M8({diff:e,expandedHunks:i,collapsedContextThreshold:a});let c=0,d=e.hunks.length-1,f=e.hunks.length;for(;c<=d;){const m=c+d>>1,g=s[m+1];if(g==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?g.unifiedCount:g.splitCount)>n?(f=m,d=m-1):c=m+1}if(f>=e.hunks.length){const m=s[e.hunks.length];if(m==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:m.splitCount,unifiedCount:m.unifiedCount}}const h=s[f];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:f,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function M8({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,a=0;const s=e.hunks.length-1,c=[{splitCount:0,unifiedCount:0}];for(let d=0;d<e.hunks.length;d++){const f=e.hunks[d];if(f==null)throw new Error("iterateOverDiff: invalid hunk summary index");const h=dc({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:t,hunkIndex:d,collapsedContextThreshold:n}),m=h.fromStart+h.fromEnd;i+=m+f.splitLineCount,a+=m+f.unifiedLineCount;const g=d===s?fc({fileDiff:e,hunkIndex:d,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(g!=null){const y=g.fromStart+g.fromEnd;i+=y,a+=y}c.push({splitCount:i,unifiedCount:a})}return c}function O8(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const i=[];function a(d){const f=Math.max(0,e.viewportStart-d),h=Math.min(t,e.viewportEnd-d);h>f&&i.push([f,h])}if(n!=="split"&&a(e.unifiedCount),n!=="unified"&&a(e.splitCount),i.length===0)return[0,0];let s=i[0][0],c=i[0][1];for(let d=1;d<i.length;d++){const f=i[d];s=Math.min(s,f[0]),c=Math.max(c,f[1])}return[s,c]}function Ju(e,t,n,i,a,s){const[c,d]=O8(e,t,n);c>0&&(e.incrementCounts(c,c),a?.());let f=c;for(;f<t;){if(s?.()===!0)return!0;if(f>=d){e.incrementCounts(t-f,t-f);break}if(e.isInWindow(0,0)){if(i(f)===!0)return!0}else e.incrementCounts(1,1);f++}return!1}function P8(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",a=n!=="unified",s=n==="unified"?"unified":"split",c=[];function d(g,y){if(g+y<=e.viewportStart||g>=e.viewportEnd)return;const b=Math.max(0,e.viewportStart-g),S=Math.min(y,e.viewportEnd-g);return S>b?[b,S]:void 0}function f(g,y){return s==="split"?g:y==="additions"?[g[0]+t.deletions,g[1]+t.deletions]:g}function h(g,y){if(g==null)return;const[b,S]=f(g,y);S>b&&c.push([b,S])}if(i&&(h(d(e.unifiedCount,t.deletions),"deletions"),h(d(e.unifiedCount+t.deletions,t.additions),"additions")),a&&(h(d(e.splitCount,t.deletions),"deletions"),h(d(e.splitCount,t.additions),"additions")),c.length===0)return c;c.sort((g,y)=>g[0]-y[0]);const m=[c[0]];for(const[g,y]of c.slice(1)){const b=m[m.length-1];g<=b[1]?b[1]=Math.max(b[1],y):m.push([g,y])}return m}function N8({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:a,index:s,unifiedLineIndex:c,splitLineIndex:d,additionLineIndex:f,deletionLineIndex:h,additionLineNumber:m,deletionLineNumber:g,content:y,isLastContent:b,unifiedCount:S,splitCount:w}){const A=s<y.deletions?c+s:void 0,k=a==="unified"?s>=y.deletions?c+s:void 0:s<y.additions?c+y.deletions+s:void 0,E=a==="unified"?d+(s<y.deletions?s:s-y.deletions):d+s,T=s<y.deletions?h+s:void 0,L=s<y.deletions?g+s:void 0,O=a==="unified"?s>=y.deletions?f+(s-y.deletions):void 0:s<y.additions?f+s:void 0,D=a==="unified"?s>=y.deletions?m+(s-y.deletions):void 0:s<y.additions?m+s:void 0,N=a==="unified"?b&&s===y.deletions-1&&t.noEOFCRDeletions:b&&s===w-1&&t.noEOFCRDeletions,W=a==="unified"?b&&s===S-1&&t.noEOFCRAdditions:b&&s===w-1&&t.noEOFCRAdditions,G=T!=null&&L!=null&&A!=null?{lineNumber:L,lineIndex:T,noEOFCR:N,unifiedLineIndex:A,splitLineIndex:E}:void 0,se=O!=null&&D!=null&&k!=null?{unifiedLineIndex:k,splitLineIndex:E,lineIndex:O,lineNumber:D,noEOFCR:W}:void 0;if(G==null&&se!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:se};if(G!=null&&se==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:G,additionLine:void 0};if(G==null||se==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:G,additionLine:se}}class Ug{diff(t,n,i={}){let a;typeof i=="function"?(a=i,i={}):"callback"in i&&(a=i.callback);const s=this.castInput(t,i),c=this.castInput(n,i),d=this.removeEmpty(this.tokenize(s,i)),f=this.removeEmpty(this.tokenize(c,i));return this.diffWithOptionsObj(d,f,i,a)}diffWithOptionsObj(t,n,i,a){var s;const c=E=>{if(E=this.postProcess(E,i),a){setTimeout(function(){a(E)},0);return}else return E},d=n.length,f=t.length;let h=1,m=d+f;i.maxEditLength!=null&&(m=Math.min(m,i.maxEditLength));const g=(s=i.timeout)!==null&&s!==void 0?s:1/0,y=Date.now()+g,b=[{oldPos:-1,lastComponent:void 0}];let S=this.extractCommon(b[0],n,t,0,i);if(b[0].oldPos+1>=f&&S+1>=d)return c(this.buildValues(b[0].lastComponent,n,t));let w=-1/0,A=1/0;const k=()=>{for(let E=Math.max(w,-h);E<=Math.min(A,h);E+=2){let T;const L=b[E-1],O=b[E+1];L&&(b[E-1]=void 0);let D=!1;if(O){const W=O.oldPos-E;D=O&&0<=W&&W<d}const N=L&&L.oldPos+1<f;if(!D&&!N){b[E]=void 0;continue}if(!N||D&&L.oldPos<O.oldPos?T=this.addToPath(O,!0,!1,0,i):T=this.addToPath(L,!1,!0,1,i),S=this.extractCommon(T,n,t,E,i),T.oldPos+1>=f&&S+1>=d)return c(this.buildValues(T.lastComponent,n,t))||!0;b[E]=T,T.oldPos+1>=f&&(A=Math.min(A,E-1)),S+1>=d&&(w=Math.max(w,E+1))}h++};if(a)(function E(){setTimeout(function(){if(h>m||Date.now()>y)return a(void 0);k()||E()},0)})();else for(;h<=m&&Date.now()<=y;){const E=k();if(E)return E}}addToPath(t,n,i,a,s){const c=t.lastComponent;return c&&!s.oneChangePerToken&&c.added===n&&c.removed===i?{oldPos:t.oldPos+a,lastComponent:{count:c.count+1,added:n,removed:i,previousComponent:c.previousComponent}}:{oldPos:t.oldPos+a,lastComponent:{count:1,added:n,removed:i,previousComponent:c}}}extractCommon(t,n,i,a,s){const c=n.length,d=i.length;let f=t.oldPos,h=f-a,m=0;for(;h+1<c&&f+1<d&&this.equals(i[f+1],n[h+1],s);)h++,f++,m++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return m&&!s.oneChangePerToken&&(t.lastComponent={count:m,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=f,h}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){const a=[];let s;for(;t;)a.push(t),s=t.previousComponent,delete t.previousComponent,t=s;a.reverse();const c=a.length;let d=0,f=0,h=0;for(;d<c;d++){const m=a[d];if(m.removed)m.value=this.join(i.slice(h,h+m.count)),h+=m.count;else{if(!m.added&&this.useLongestToken){let g=n.slice(f,f+m.count);g=g.map(function(y,b){const S=i[h+b];return S.length>y.length?S:y}),m.value=this.join(g)}else m.value=this.join(n.slice(f,f+m.count));f+=m.count,m.added||(h+=m.count)}}return a}}class H8 extends Ug{}const z8=new H8;function V8(e,t,n){return z8.diff(e,t,n)}const xb="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}";class B8 extends Ug{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${xb}]+|[^\\S\\n\\r]+|[^${xb}]`,"ug");return t.match(n)||[]}}const U8=new B8;function F8(e,t,n){return U8.diff(e,t,n)}class j8 extends Ug{constructor(){super(...arguments),this.tokenize=q8}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
172
+ `)),e}const Zu=Symbol("no-token"),Gp=Symbol("multiple-tokens");function PC(e){const t=m8(e);if(t!=null)return t;let n=Zu;const i=[];let a=[],s;const c=()=>{if(a.length===0||s==null){a=[],s=void 0;return}if(a.length===1){const f=a[0];if(f?.type==="element"){g8(f,s);for(const h of f.children)yd(h)}else yd(f);i.push(f),a=[],s=void 0;return}for(const f of a)yd(f);i.push(Ne({tagName:"span",properties:{"data-char":s},children:a})),a=[],s=void 0},d=f=>{if(f!==Zu){if(f===Gp){n=Gp;return}if(n===Zu){n=f;return}n!==f&&(n=Gp)}};for(const f of e.children){const h=f.type==="element"?PC(f):Zu;if(d(h),typeof h!="number"){c(),i.push(f);continue}s!=null&&s!==h&&c(),s??=h,a.push(f)}return c(),e.children=i,n}function m8(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function yd(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)yd(t)}}function g8(e,t){e.properties["data-char"]=t}function v8(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=d=>d}=e,a=new Map;function s(d){return Object.entries(d).map(([f,h])=>`${f}:${h}`).join(";")}function c(d){let f=t+y8(typeof d=="string"?d:s(d))+n;return f=i(f),a.has(f)||a.set(f,typeof d=="string"?d:{...d}),f}return{name:"@shikijs/transformers:style-to-class",pre(d){if(!d.properties.style)return;const f=c(d.properties.style);delete d.properties.style,this.addClassToHast(d,f)},tokens(d){for(const f of d)for(const h of f){if(!h.htmlStyle)continue;const m=c(h.htmlStyle);h.htmlStyle={},h.htmlAttrs||={},h.htmlAttrs.class?h.htmlAttrs.class+=` ${m}`:h.htmlAttrs.class=m}},getClassRegistry(){return a},getCSS(){let d="";for(const[f,h]of a.entries())d+=`.${f}{${typeof h=="string"?h:s(h)}}`;return d},clearRegistry(){a.clear()}}}function y8(e,t=0){let n=3735928559^t,i=1103547991^t;for(let a=0,s;a<e.length;a++)s=e.charCodeAt(a),n=Math.imul(n^s,2654435761),i=Math.imul(i^s,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function NC(e=!1,t=!1){const n={lineInfo:[]},i=[{line(a){return delete a.properties.class,a},pre(a){const s=h8(a),c=[];if(s!=null){let d=1;for(const f of s.children)f.type==="element"&&(e&&PC(f),c.push(p8(f,d,n)),d++);s.children=c}return a},...e?{tokens(a){for(const s of a){let c=0;for(const d of s){const f=d;f.__lineChar??=c,c+=d.content.length}}},preprocess(a,s){s.mergeWhitespaces="never"},span(a,s,c,d,f){if(f?.offset!=null&&f.content!=null){const h=f.__lineChar;return h!=null&&(a.properties["data-char"]=h),a}return a}}:null}];return t&&i.push(b8,Cb),{state:n,transformers:i,toClass:Cb}}const Cb=v8({classPrefix:"hl-"}),b8={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function Xn(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const S8=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,_8=/^0(?:\.0+)?%?$/;function C8(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const a=i.lastIndexOf("/");if(a!==-1)return i.slice(a+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const s=i.split(",");if(s.length===4)return s[3]?.trim()}}function E8(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const n=t[1];let i,a=1;return n.length===3?i=n.split("").map(s=>s+s).join(""):n.length===6?i=n:(i=n.slice(0,6),a=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),a]}function Wp(e){if(e==null)return null;const t=E8(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,a=t[2]/255,s=c=>c<=.03928?c/12.92:((c+.055)/1.055)**2.4;return .2126*s(n)+.7152*s(i)+.0722*s(a)}function Eb(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||S8.test(t))return!0;const n=C8(t);return n!=null&&_8.test(n)}function w8(e,t,n){if(t==null||n==null)return!1;const i=Wp(e),a=Wp(t),s=Wp(n);return i==null||a==null||s==null?!1:Math.abs(i-s)<Math.abs(i-a)}const wb=new WeakMap;function Kp(e){const t=wb.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},a=n["editor.background"]??e.bg,s=n["editor.foreground"]??e.fg,c=n["sideBar.background"]??a,d=n["sideBar.foreground"]??s;Hi(i,"editor.background",a),Hi(i,"editor.foreground",s),Hi(i,"sideBar.background",c),Hi(i,"sideBar.foreground",d),Hi(i,"input.background",n["input.background"]??c),Hi(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??d),Hi(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??d),Hi(i,"gitDecoration.addedResourceForeground",Yp(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Hi(i,"gitDecoration.modifiedResourceForeground",Yp(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Hi(i,"gitDecoration.deletedResourceForeground",Yp(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const f=(Eb(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(Eb(n.focusBorder)?void 0:n.focusBorder);f!=null?i["list.focusOutline"]=f:delete i["list.focusOutline"];const h=n["list.hoverBackground"];h!=null&&(x8(h,c)||w8(h,c,d))&&delete i["list.hoverBackground"];const m=Object.freeze({...e,colors:Object.freeze(i)});return wb.set(e,m),m}function Hi(e,t,n){n!=null&&n!==""&&(e[t]=n)}function Yp(...e){for(const t of e)if(t!=null&&t!=="")return t}function x8(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function HC({theme:e=xt,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const a=t.getTheme(e),s=Kp(a);i+=`color:${s.fg};`,i+=`background-color:${s.bg};`,i+=`${Xn("global")}fg:${s.fg};`,i+=`${Xn("global")}bg:${s.bg};`,i+=Xp(a,n)}else{let a=t.getTheme(e.dark),s=Kp(a);i+=`${Xn("global")}dark:${s.fg};`,i+=`${Xn("global")}dark-bg:${s.bg};`,i+=Xp(a,"dark"),a=t.getTheme(e.light),s=Kp(a),i+=`${Xn("global")}light:${s.fg};`,i+=`${Xn("global")}light-bg:${s.bg};`,i+=Xp(a,"light")}return i}function Xp(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${Xn("global")}${t}addition-color:${i};`);const a=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];a!=null&&(n+=`${Xn("global")}${t}deletion-color:${a};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${Xn("global")}${t}modified-color:${s};`),n}function Fm(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function jm(e){return e!==""?e.split(fx):[]}const T8={forcePlainText:!1};function zC(e,t,{theme:n=xt,tokenizeMaxLineLength:i,useTokenTransformer:a},{forcePlainText:s,startingLine:c,totalLines:d,lines:f}=T8){s?(c??=0,d??=1/0):(c=0,d=1/0);const h=c>0||d<1/0,{state:m,transformers:g}=NC(a),y=s?"text":e.lang??xn(e.name),b=typeof n=="string"?t.getTheme(n).type:void 0,S=HC({theme:n,highlighter:t});m.lineInfo=E=>({type:"context",lineIndex:E-1+c,lineNumber:E+c});const w=typeof n=="string"?{lang:y,theme:n,transformers:g,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}:{lang:y,themes:n,transformers:g,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0},A=Fm(t.codeToHast(h?k8(f??jm(e.contents),c,d):sa(e.contents),w)),k=h?new Array(c):A;return h&&k.push(...A),{code:k,themeStyles:S,baseThemeType:b}}function k8(e,t,n){let i="";return Fd({lines:e,startingLine:t,totalLines:n,callback({content:a}){i+=a}}),i}function ds(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}function kr(e,t){return ua(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function uc(e){const t=e.lang??xn(e.name),n=e.lang??(e.prevName!=null?xn(e.prevName):"text");return t==="text"&&n==="text"}function Qp(e){return{..._g,...e}}function ji(e,t){const n=A8(e,t);return t?n:e.diffHeaderHeight+n}function A8(e,t){return e.paddingTop??(t?e.spacing:0)}function $d(e){return e.paddingBottom??e.spacing}function L8(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function dc({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:a}){const s=Math.max(t,0);if(s===0||e)return{fromStart:0,fromEnd:0,rangeSize:s,collapsedLines:s,renderAll:!1};if(n===!0||s<=a)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const c=n?.get(i),d=Math.min(Math.max(c?.fromStart??0,0),s),f=Math.min(Math.max(c?.fromEnd??0,0),s),h=d+f,m=h>=s;return{fromStart:m?s:d,fromEnd:m?0:f,rangeSize:s,collapsedLines:Math.max(s-h,0),renderAll:m}}function VC({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-(n.additionLineIndex+n.additionCount),a=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(i<=0&&a<=0)return 0;if(i!==a)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${a}) for ${e.name}`);return Math.min(i,a)}function fc({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:a}){if(t!==e.hunks.length-1)return;const s=VC({fileDiff:e,errorPrefix:a});if(s<=0)return;if(n===!0||s<=i)return{fromStart:s,fromEnd:0,rangeSize:s,collapsedLines:0,renderAll:!0};const c=n?.get(e.hunks.length),d=Math.min(Math.max(c?.fromStart??0,0),s);return{fromStart:d,fromEnd:0,rangeSize:s,collapsedLines:s-d,renderAll:d>=s}}function BC({type:e,metrics:t}){return t.hunkSeparatorHeight??L8(e)}function UC({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function I8({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 R8(e){return e!=="simple"&&e!=="metadata"}function Ul({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!I8({type:e,hunkIndex:n,hunkSpecs:i}))return;const a=BC({type:e,metrics:t}),s=UC({type:e,metrics:t}),c=n>0?s:0,d=s;return{height:a,gapBefore:c,gapAfter:d,totalHeight:c+a+d}}function Fl({type:e,metrics:t}){if(!R8(e))return;const n=BC({type:e,metrics:t}),i=UC({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function Xl({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:a,collapsedContextThreshold:s=1,callback:c}){const d=D8({diff:e,diffStyle:t,startingLine:n,expandedHunks:a,collapsedContextThreshold:s}),f={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:d.splitCount,unifiedCount:d.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!f.isWindowedHighlight)return!1;const h=f.unifiedCount>=n+i,m=f.splitCount>=n+i;return t==="unified"?h:(t==="split"||h)&&m},shouldSkip(h,m){if(!f.isWindowedHighlight)return!1;const g=f.unifiedCount+h<n,y=f.splitCount+m<n;return t==="unified"?g:(t==="split"||g)&&y},incrementCounts(h,m){(t==="unified"||t==="both")&&(f.unifiedCount+=h),(t==="split"||t==="both")&&(f.splitCount+=m)},isInWindow(h,m){if(!f.isWindowedHighlight)return!0;const g=f.isInUnifiedWindow(h),y=f.isInSplitWindow(m);return t==="unified"?g:t==="split"?y:g||y},isInUnifiedWindow(h){return!f.isWindowedHighlight||f.unifiedCount>=n-h&&f.unifiedCount<n+i},isInSplitWindow(h){return!f.isWindowedHighlight||f.splitCount>=n-h&&f.splitCount<n+i},emit(h,m=!1){return m||(t==="unified"?f.incrementCounts(1,0):t==="split"?f.incrementCounts(0,1):f.incrementCounts(1,1)),c(h)??!1}};e:for(let h=d.hunkIndex;h<e.hunks.length;h++){let S=function(K,G){return y==null||y.collapsedLines<=0||y.fromStart+y.fromEnd>0?0:t==="unified"?K===m.unifiedLineStart+m.unifiedLineCount-1?y.collapsedLines:0:G===m.splitLineStart+m.splitLineCount-1?y.collapsedLines:0},A=function(){return w?0:(w=!0,g.collapsedLines)};const m=e.hunks[h];if(m==null)throw new Error("iterateOverDiff: invalid hunk index");if(f.shouldBreak())break;const g=dc({isPartial:e.isPartial,rangeSize:m.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:s}),y=h===f.finalHunkIndex?fc({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:s,errorPrefix:"iterateOverDiff"}):void 0,b=g.fromStart+g.fromEnd;let w=g.collapsedLines===0;if(f.shouldSkip(b,b))f.incrementCounts(b,b),A();else{let K=m.unifiedLineStart-g.rangeSize,G=m.splitLineStart-g.rangeSize,se=m.deletionLineIndex-g.rangeSize,ie=m.additionLineIndex-g.rangeSize,ee=m.deletionStart-g.rangeSize,te=m.additionStart-g.rangeSize;if(Ju(f,g.fromStart,t,le=>f.emit({hunkIndex:h,hunk:m,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:ee+le,lineIndex:se+le,noEOFCR:!1,unifiedLineIndex:K+le,splitLineIndex:G+le},additionLine:{unifiedLineIndex:K+le,splitLineIndex:G+le,lineIndex:ie+le,lineNumber:te+le,noEOFCR:!1}}))||(K=m.unifiedLineStart-g.fromEnd,G=m.splitLineStart-g.fromEnd,se=m.deletionLineIndex-g.fromEnd,ie=m.additionLineIndex-g.fromEnd,ee=m.deletionStart-g.fromEnd,te=m.additionStart-g.fromEnd,Ju(f,g.fromEnd,t,le=>f.emit({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:ee+le,lineIndex:se+le,noEOFCR:!1,unifiedLineIndex:K+le,splitLineIndex:G+le},additionLine:{unifiedLineIndex:K+le,splitLineIndex:G+le,lineIndex:ie+le,lineNumber:te+le,noEOFCR:!1}}),()=>{A()})))break e}let k=m.unifiedLineStart,E=m.splitLineStart,T=m.deletionLineIndex,L=m.additionLineIndex,O=m.deletionStart,D=m.additionStart;const N=m.hunkContent.at(-1);for(const K of m.hunkContent){if(f.shouldBreak())break e;const G=K===N;if(K.type==="context"){if(f.shouldSkip(K.lines,K.lines))f.incrementCounts(K.lines,K.lines),A();else if(Ju(f,K.lines,t,se=>{const ie=G&&se===K.lines-1,ee=k+se,te=E+se;return f.emit({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:S(ee,te),type:"context",deletionLine:{lineNumber:O+se,lineIndex:T+se,noEOFCR:ie&&m.noEOFCRDeletions,unifiedLineIndex:ee,splitLineIndex:te},additionLine:{unifiedLineIndex:ee,splitLineIndex:te,lineIndex:L+se,lineNumber:D+se,noEOFCR:ie&&m.noEOFCRAdditions}})},()=>{A()}))break e;k+=K.lines,E+=K.lines,T+=K.lines,L+=K.lines,O+=K.lines,D+=K.lines}else{const se=Math.max(K.deletions,K.additions),ie=K.deletions+K.additions;if(!f.shouldSkip(ie,se)){const ee=P8(f,K,t);(ee[0]?.[0]??0)>0&&A();for(const[te,le]of ee)for(let me=te;me<le;me++){const H=S(k+me,t==="unified"?E+(me<K.deletions?me:me-K.deletions):E+me);if(f.emit(N8({hunkIndex:h,hunk:m,collapsedBefore:A(),collapsedAfter:H,diffStyle:t,index:me,unifiedLineIndex:k,splitLineIndex:E,additionLineIndex:L,deletionLineIndex:T,additionLineNumber:D,deletionLineNumber:O,content:K,isLastContent:G,unifiedCount:ie,splitCount:se}),!0))break e}}A(),f.incrementCounts(ie,se),k+=ie,E+=se,T+=K.deletions,L+=K.additions,O+=K.deletions,D+=K.additions}}if(y!=null){const{collapsedLines:K,fromStart:G,fromEnd:se}=y,ie=G+se;if(Ju(f,ie,t,ee=>{const te=ee===ie-1;return f.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:te?K:0,type:"context-expanded",deletionLine:{lineNumber:O+ee,lineIndex:T+ee,noEOFCR:!1,unifiedLineIndex:k+ee,splitLineIndex:E+ee},additionLine:{unifiedLineIndex:k+ee,splitLineIndex:E+ee,lineIndex:L+ee,lineNumber:D+ee,noEOFCR:!1}})},void 0,()=>f.shouldBreak()))break e}}}function D8({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const s=M8({diff:e,expandedHunks:i,collapsedContextThreshold:a});let c=0,d=e.hunks.length-1,f=e.hunks.length;for(;c<=d;){const m=c+d>>1,g=s[m+1];if(g==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?g.unifiedCount:g.splitCount)>n?(f=m,d=m-1):c=m+1}if(f>=e.hunks.length){const m=s[e.hunks.length];if(m==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:m.splitCount,unifiedCount:m.unifiedCount}}const h=s[f];if(h==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:f,splitCount:h.splitCount,unifiedCount:h.unifiedCount}}function M8({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,a=0;const s=e.hunks.length-1,c=[{splitCount:0,unifiedCount:0}];for(let d=0;d<e.hunks.length;d++){const f=e.hunks[d];if(f==null)throw new Error("iterateOverDiff: invalid hunk summary index");const h=dc({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:t,hunkIndex:d,collapsedContextThreshold:n}),m=h.fromStart+h.fromEnd;i+=m+f.splitLineCount,a+=m+f.unifiedLineCount;const g=d===s?fc({fileDiff:e,hunkIndex:d,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(g!=null){const y=g.fromStart+g.fromEnd;i+=y,a+=y}c.push({splitCount:i,unifiedCount:a})}return c}function O8(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const i=[];function a(d){const f=Math.max(0,e.viewportStart-d),h=Math.min(t,e.viewportEnd-d);h>f&&i.push([f,h])}if(n!=="split"&&a(e.unifiedCount),n!=="unified"&&a(e.splitCount),i.length===0)return[0,0];let s=i[0][0],c=i[0][1];for(let d=1;d<i.length;d++){const f=i[d];s=Math.min(s,f[0]),c=Math.max(c,f[1])}return[s,c]}function Ju(e,t,n,i,a,s){const[c,d]=O8(e,t,n);c>0&&(e.incrementCounts(c,c),a?.());let f=c;for(;f<t;){if(s?.()===!0)return!0;if(f>=d){e.incrementCounts(t-f,t-f);break}if(e.isInWindow(0,0)){if(i(f)===!0)return!0}else e.incrementCounts(1,1);f++}return!1}function P8(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",a=n!=="unified",s=n==="unified"?"unified":"split",c=[];function d(g,y){if(g+y<=e.viewportStart||g>=e.viewportEnd)return;const b=Math.max(0,e.viewportStart-g),S=Math.min(y,e.viewportEnd-g);return S>b?[b,S]:void 0}function f(g,y){return s==="split"?g:y==="additions"?[g[0]+t.deletions,g[1]+t.deletions]:g}function h(g,y){if(g==null)return;const[b,S]=f(g,y);S>b&&c.push([b,S])}if(i&&(h(d(e.unifiedCount,t.deletions),"deletions"),h(d(e.unifiedCount+t.deletions,t.additions),"additions")),a&&(h(d(e.splitCount,t.deletions),"deletions"),h(d(e.splitCount,t.additions),"additions")),c.length===0)return c;c.sort((g,y)=>g[0]-y[0]);const m=[c[0]];for(const[g,y]of c.slice(1)){const b=m[m.length-1];g<=b[1]?b[1]=Math.max(b[1],y):m.push([g,y])}return m}function N8({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:a,index:s,unifiedLineIndex:c,splitLineIndex:d,additionLineIndex:f,deletionLineIndex:h,additionLineNumber:m,deletionLineNumber:g,content:y,isLastContent:b,unifiedCount:S,splitCount:w}){const A=s<y.deletions?c+s:void 0,k=a==="unified"?s>=y.deletions?c+s:void 0:s<y.additions?c+y.deletions+s:void 0,E=a==="unified"?d+(s<y.deletions?s:s-y.deletions):d+s,T=s<y.deletions?h+s:void 0,L=s<y.deletions?g+s:void 0,O=a==="unified"?s>=y.deletions?f+(s-y.deletions):void 0:s<y.additions?f+s:void 0,D=a==="unified"?s>=y.deletions?m+(s-y.deletions):void 0:s<y.additions?m+s:void 0,N=a==="unified"?b&&s===y.deletions-1&&t.noEOFCRDeletions:b&&s===w-1&&t.noEOFCRDeletions,K=a==="unified"?b&&s===S-1&&t.noEOFCRAdditions:b&&s===w-1&&t.noEOFCRAdditions,G=T!=null&&L!=null&&A!=null?{lineNumber:L,lineIndex:T,noEOFCR:N,unifiedLineIndex:A,splitLineIndex:E}:void 0,se=O!=null&&D!=null&&k!=null?{unifiedLineIndex:k,splitLineIndex:E,lineIndex:O,lineNumber:D,noEOFCR:K}:void 0;if(G==null&&se!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:se};if(G!=null&&se==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:G,additionLine:void 0};if(G==null||se==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:G,additionLine:se}}class Ug{diff(t,n,i={}){let a;typeof i=="function"?(a=i,i={}):"callback"in i&&(a=i.callback);const s=this.castInput(t,i),c=this.castInput(n,i),d=this.removeEmpty(this.tokenize(s,i)),f=this.removeEmpty(this.tokenize(c,i));return this.diffWithOptionsObj(d,f,i,a)}diffWithOptionsObj(t,n,i,a){var s;const c=E=>{if(E=this.postProcess(E,i),a){setTimeout(function(){a(E)},0);return}else return E},d=n.length,f=t.length;let h=1,m=d+f;i.maxEditLength!=null&&(m=Math.min(m,i.maxEditLength));const g=(s=i.timeout)!==null&&s!==void 0?s:1/0,y=Date.now()+g,b=[{oldPos:-1,lastComponent:void 0}];let S=this.extractCommon(b[0],n,t,0,i);if(b[0].oldPos+1>=f&&S+1>=d)return c(this.buildValues(b[0].lastComponent,n,t));let w=-1/0,A=1/0;const k=()=>{for(let E=Math.max(w,-h);E<=Math.min(A,h);E+=2){let T;const L=b[E-1],O=b[E+1];L&&(b[E-1]=void 0);let D=!1;if(O){const K=O.oldPos-E;D=O&&0<=K&&K<d}const N=L&&L.oldPos+1<f;if(!D&&!N){b[E]=void 0;continue}if(!N||D&&L.oldPos<O.oldPos?T=this.addToPath(O,!0,!1,0,i):T=this.addToPath(L,!1,!0,1,i),S=this.extractCommon(T,n,t,E,i),T.oldPos+1>=f&&S+1>=d)return c(this.buildValues(T.lastComponent,n,t))||!0;b[E]=T,T.oldPos+1>=f&&(A=Math.min(A,E-1)),S+1>=d&&(w=Math.max(w,E+1))}h++};if(a)(function E(){setTimeout(function(){if(h>m||Date.now()>y)return a(void 0);k()||E()},0)})();else for(;h<=m&&Date.now()<=y;){const E=k();if(E)return E}}addToPath(t,n,i,a,s){const c=t.lastComponent;return c&&!s.oneChangePerToken&&c.added===n&&c.removed===i?{oldPos:t.oldPos+a,lastComponent:{count:c.count+1,added:n,removed:i,previousComponent:c.previousComponent}}:{oldPos:t.oldPos+a,lastComponent:{count:1,added:n,removed:i,previousComponent:c}}}extractCommon(t,n,i,a,s){const c=n.length,d=i.length;let f=t.oldPos,h=f-a,m=0;for(;h+1<c&&f+1<d&&this.equals(i[f+1],n[h+1],s);)h++,f++,m++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return m&&!s.oneChangePerToken&&(t.lastComponent={count:m,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=f,h}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){const a=[];let s;for(;t;)a.push(t),s=t.previousComponent,delete t.previousComponent,t=s;a.reverse();const c=a.length;let d=0,f=0,h=0;for(;d<c;d++){const m=a[d];if(m.removed)m.value=this.join(i.slice(h,h+m.count)),h+=m.count;else{if(!m.added&&this.useLongestToken){let g=n.slice(f,f+m.count);g=g.map(function(y,b){const S=i[h+b];return S.length>y.length?S:y}),m.value=this.join(g)}else m.value=this.join(n.slice(f,f+m.count));f+=m.count,m.added||(h+=m.count)}}return a}}class H8 extends Ug{}const z8=new H8;function V8(e,t,n){return z8.diff(e,t,n)}const xb="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}";class B8 extends Ug{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${xb}]+|[^\\S\\n\\r]+|[^${xb}]`,"ug");return t.match(n)||[]}}const U8=new B8;function F8(e,t,n){return U8.diff(e,t,n)}class j8 extends Ug{constructor(){super(...arguments),this.tokenize=q8}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
173
173
  `))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
174
174
  `))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
175
175
  `)&&(t=t.slice(0,-1)),n.endsWith(`
@@ -181,7 +181,7 @@ XID_Start XIDS`.split(/\s/).map(e=>[df(e),e])),p4=new Map([["s",qt(383)],[qt(383
181
181
  `}function W8(e,t,n,i,a,s,c){if(typeof c=="function"&&(c={callback:c}),c?.callback){const{callback:d}=c;Ab(e,t,n,i,a,s,Object.assign(Object.assign({},c),{callback:f=>{d(f?$m(f,c.headerOptions):void 0)}}))}else{const d=Ab(e,t,n,i,a,s,c);return d?$m(d,c?.headerOptions):void 0}}function K8(e){const t=e.endsWith(`
182
182
  `),n=e.split(`
183
183
  `).map(i=>i+`
184
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Lb({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 ed({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:a=!1}){const s=t[t.length-1];if(s==null||a||!n){t.push([i?0:1,e.value]);return}const c=s[0]===0;if(i===c||i&&e.value.length===1&&!c){s[1]+=e.value;return}t.push([i?0:1,e.value])}const Y8={forcePlainText:!1};function FC(e,t,n,{forcePlainText:i,startingLine:a,totalLines:s,expandedHunks:c,collapsedContextThreshold:d=1}=Y8){i?(a??=0,s??=1/0):(a=0,s=1/0);const f=a>0||s<1/0,h=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,m=HC({theme:n.theme,highlighter:t}),g=i&&!f&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,y={deletionLines:[],additionLines:[]},{maxLineDiffLength:b}=n,S=!i&&!e.isPartial,w=i?c:void 0,A=new Map;function k(T){const L=S?0:T,O=A.get(L)??Q8();return A.set(L,O),O}function E(T,L,O,D){if(f){let N=O.at(-1);(N==null||N.targetIndex+N.count!==L)&&(N={targetIndex:L,originalOffset:D.length,count:0},O.push(N)),N.count++}D.push(T)}Xl({diff:e,diffStyle:"both",startingLine:a,totalLines:s,expandedHunks:f?w:!0,collapsedContextThreshold:d,callback:({hunkIndex:T,additionLine:L,deletionLine:O,type:D})=>{const N=k(T),W=L!=null?L.splitLineIndex:O.splitLineIndex;D==="change"&&L!=null&&O!=null&&X8({additionLine:e.additionLines[L.lineIndex],deletionLine:e.deletionLines[O.lineIndex],deletionLineIndex:N.deletionContent.length,additionLineIndex:N.additionContent.length,deletionDecorations:N.deletionDecorations,additionDecorations:N.additionDecorations,lineDiffType:g,maxLineDiffLength:b}),O!=null&&(E(e.deletionLines[O.lineIndex],O.lineIndex,N.deletionSegments,N.deletionContent),N.deletionInfo.push({type:D==="change"?"change-deletion":D,lineNumber:O.lineNumber,altLineNumber:D==="change"?void 0:L.lineNumber??void 0,lineIndex:`${O.unifiedLineIndex},${W}`})),L!=null&&(E(e.additionLines[L.lineIndex],L.lineIndex,N.additionSegments,N.additionContent),N.additionInfo.push({type:D==="change"?"change-addition":D,lineNumber:L.lineNumber,altLineNumber:D==="change"?void 0:O.lineNumber??void 0,lineIndex:`${L.unifiedLineIndex},${W}`}))}});for(const T of A.values()){if(T.deletionContent.length===0&&T.additionContent.length===0)continue;const L={name:e.prevName??e.name,contents:T.deletionContent.value},O={name:e.name,contents:T.additionContent.value},{deletionLines:D,additionLines:N}=Z8({deletionFile:L,deletionInfo:T.deletionInfo,deletionDecorations:T.deletionDecorations,additionFile:O,additionInfo:T.additionInfo,additionDecorations:T.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(S){y.deletionLines=D,y.additionLines=N;continue}if(T.deletionSegments.length>0)for(const W of T.deletionSegments)for(let G=0;G<W.count;G++)y.deletionLines[W.targetIndex+G]=D[W.originalOffset+G];else y.deletionLines.push(...D);if(T.additionSegments.length>0)for(const W of T.additionSegments)for(let G=0;G<W.count;G++)y.additionLines[W.targetIndex+G]=N[W.originalOffset+G];else y.additionLines.push(...N)}return{code:y,themeStyles:m,baseThemeType:h}}function X8({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:a,additionDecorations:s,lineDiffType:c,maxLineDiffLength:d}){if(e==null||t==null||c==="none"||(e=sa(e),t=sa(t),e.length>d||t.length>d))return;const f=c==="char"?V8(e,t):F8(e,t),h=[],m=[],g=c==="word-alt",y=f.at(-1);for(const S of f){const w=S===y;!S.added&&!S.removed?(ed({item:S,arr:h,enableJoin:g,isNeutral:!0,isLastItem:w}),ed({item:S,arr:m,enableJoin:g,isNeutral:!0,isLastItem:w})):S.removed?ed({item:S,arr:h,enableJoin:g,isLastItem:w}):ed({item:S,arr:m,enableJoin:g,isLastItem:w})}let b=0;for(const S of h)S[0]===1&&a.push(Lb({line:n,spanStart:b,spanLength:S[1].length})),b+=S[1].length;b=0;for(const S of m)S[0]===1&&s.push(Lb({line:i,spanStart:b,spanLength:S[1].length})),b+=S[1].length}function Q8(){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 Z8({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:a,deletionDecorations:s,additionDecorations:c,languageOverride:d,options:{theme:f=xt,...h}}){const m=d??xn(e.name),g=d??xn(t.name),{state:y,transformers:b}=NC(h.useTokenTransformer),S=typeof f=="string"?{...h,lang:"text",theme:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(S.lang=m,y.lineInfo=n,S.decorations=s,Fm(a.codeToHast(sa(e.contents),S))),additionLines:t.contents===""?[]:(S.lang=g,S.decorations=c,y.lineInfo=i,Fm(a.codeToHast(sa(t.contents),S)))}}function Ib(e){const t=[];for(const n of e){const i=oa.get(n);if(i==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(i)}return t}function Rb(e){for(const t of Array.isArray(e)?e:[e])if(!oa.has(t))return!1;return!0}async function Db(e){const t=[],n=[];for(const i of e){if(i==="text"||i==="ansi")continue;const a=xC(i)??wC(i);"then"in a?n.push(a):t.push(a)}return n.length>0&&await Promise.all(n).then(i=>{for(const a of i){if(a==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(a)}}),t}function Mb(e){return xi.getResolvedThemes(e)}async function Ob(e){for(const n of e)RC(n);const t=await xi.resolveThemes(e);for(let n=0;n<e.length;n++)DC(e[n],t[n]);return t}var jl={exports:{}},J8=jl.exports,Pb;function e6(){return Pb||(Pb=1,(function(e,t){(function(n,i){i(t)})(J8,function(n){const i=Symbol("newer"),a=Symbol("older");class s{constructor(g,y){typeof g!="number"&&(y=g,g=0),this.size=0,this.limit=g,this.oldest=this.newest=void 0,this._keymap=new Map,y&&(this.assign(y),g<1&&(this.limit=this.size))}_markEntryAsUsed(g){g!==this.newest&&(g[i]&&(g===this.oldest&&(this.oldest=g[i]),g[i][a]=g[a]),g[a]&&(g[a][i]=g[i]),g[i]=void 0,g[a]=this.newest,this.newest&&(this.newest[i]=g),this.newest=g)}assign(g){let y,b=this.limit||Number.MAX_VALUE;this._keymap.clear();let S=g[Symbol.iterator]();for(let w=S.next();!w.done;w=S.next()){let A=new c(w.value[0],w.value[1]);if(this._keymap.set(A.key,A),y?(y[i]=A,A[a]=y):this.oldest=A,y=A,b--==0)throw new Error("overflow")}this.newest=y,this.size=this._keymap.size}get(g){var y=this._keymap.get(g);return y?(this._markEntryAsUsed(y),y.value):void 0}set(g,y){var b=this._keymap.get(g);return b?(b.value=y,this._markEntryAsUsed(b),this):(this._keymap.set(g,b=new c(g,y)),this.newest?(this.newest[i]=b,b[a]=this.newest):this.oldest=b,this.newest=b,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var g=this.oldest;if(g)return this.oldest[i]?(this.oldest=this.oldest[i],this.oldest[a]=void 0):(this.oldest=void 0,this.newest=void 0),g[i]=g[a]=void 0,this._keymap.delete(g.key),--this.size,[g.key,g.value]}find(g){let y=this._keymap.get(g);return y?y.value:void 0}has(g){return this._keymap.has(g)}delete(g){var y=this._keymap.get(g);return y?(this._keymap.delete(y.key),y[i]&&y[a]?(y[a][i]=y[i],y[i][a]=y[a]):y[i]?(y[i][a]=void 0,this.oldest=y[i]):y[a]?(y[a][i]=void 0,this.newest=y[a]):this.oldest=this.newest=void 0,this.size--,y.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new f(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new d(this.oldest)}forEach(g,y){typeof y!="object"&&(y=this);let b=this.oldest;for(;b;)g.call(y,b.value,b.key,this),b=b[i]}toJSON(){for(var g=new Array(this.size),y=0,b=this.oldest;b;)g[y++]={key:b.key,value:b.value},b=b[i];return g}toString(){for(var g="",y=this.oldest;y;)g+=String(y.key)+":"+y.value,y=y[i],y&&(g+=" < ");return g}}n.LRUMap=s;function c(m,g){this.key=m,this.value=g,this[i]=void 0,this[a]=void 0}function d(m){this.entry=m}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:[m.key,m.value]}):{done:!0,value:void 0}};function f(m){this.entry=m}f.prototype[Symbol.iterator]=function(){return this},f.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:m.key}):{done:!0,value:void 0}};function h(m){this.entry=m}h.prototype[Symbol.iterator]=function(){return this},h.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:m.value}):{done:!0,value:void 0}}})})(jl,jl.exports)),jl.exports}var t6=e6();const Nb=ax(t6),td=Symbol("IGNORE_RESPONSE");var Zp=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},n6=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=xt,useTokenTransformer:i=!1,lineDiffType:a="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:c=1e3,preferredHighlighter:d="shiki-js"}){this.options=e,this.preferredHighlighter=d,this.renderOptions={theme:n,useTokenTransformer:i,lineDiffType:a,maxLineDiffLength:s,tokenizeMaxLineLength:c},this.fileCache=new Nb.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Nb.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??xt,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:i=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:a=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,c=++this.renderOptionsRequestVersion,d=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===c;try{const f={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:i,tokenizeMaxLineLength:a};if(this.isInitialized()||await this.initialize(),!d()||kr(f,this.renderOptions))return;const h=lc(e);let m=[];if(ua(f.theme,this.renderOptions.theme)||(Um(h)?m=Mb(h):m=await Ob(h)),!d())return;if(this.highlighter!=null)bm(m,this.highlighter);else{const y=await Ud({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!d())return;this.highlighter=y}const g=this.setRenderOptionsOnWorkers(f,m);this.renderOptions=f,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const y of this.themeSubscribers)y.onThemeChange();await g}catch(f){if(f instanceof Zp||!d())return;throw f}}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const i of this.workers){if(!i.initialized)throw console.log({managedWorker:i}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((a,s)=>{const c=this.generateRequestId(),d={type:"set-render-options",id:c,request:{type:"set-render-options",id:c,renderOptions:e,resolvedThemes:t},resolve:a,reject:s,requestStart:Date.now()};this.activeTaskById.set(c,d),i.pendingSetupRequestId=c,i.worker.postMessage(d.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const n=this.activeTaskById.get(t);Xo(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((n,i)=>{(async()=>{try{const a=lc(this.renderOptions.theme);let s=[];if(Um(a)?s=Mb(a):s=await Ob(a),!this.isCurrentLifecycle(t)){n();return}let c=[];if(Rb(e)?c=Ib(e):c=await Db(e),!this.isCurrentLifecycle(t)){n();return}const[d]=await Promise.all([Ud({themes:a,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,c)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=d,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(a){if(a instanceof Zp||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),i(a)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],i=void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const s=this.options.workerFactory(),c={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:d})=>d)]),customExtensionsVersion:0};s.addEventListener("message",d=>{this.handleWorkerMessage(c,d.data)}),s.addEventListener("error",d=>console.error("Worker error:",d,c)),this.workers.push(c),n.push(new Promise((d,f)=>{const h=this.generateRequestId(),m={type:"initialize",id:h,request:{type:"initialize",id:h,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:i},resolve(){c.initialized=!0,d()},reject:f,requestStart:Date.now()};this.activeTaskById.set(h,m),this.executeTask(c,m)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const n=Hb(t),i=this.getAvailableWorker(n);if(i==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,i),this.resolveLanguagesAndExecuteTask(i,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);cc(t)||n!=null&&go(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||cc(e)||t!=null&&go(t.options,this.getFileRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"file",file:e},n)}getPlainFileAST(e,t,n,i){if(this.highlighter==null){this.queueInitialization();return}return zC(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:i})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);uc(t)||n!=null&&kr(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||uc(e)||t!=null&&kr(t.options,this.getDiffRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"diff",diff:e},n)}getPlainDiffAST(e,t,n,i,a){return this.highlighter!=null?FC(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:i,collapsedContextThreshold:a}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new Zp;for(const t of this.activeTaskById.values())"reject"in t&&t.reject(e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.getHighlightKeyForRequest(t),i=n!=null?this.getTaskByHighlightKey(n):void 0;if(i!=null){this.detachInstanceFromQueuedTasks(e,i),this.addInstanceToTask(i,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const a=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:c}=this,d=(()=>{switch(t.type){case"file":return{type:"file",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:c,requestStart:s};case"diff":return{type:"diff",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:c,requestStart:s}}})();this.enqueueRenderTask(d,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),i=Date.now(),{renderOptionsVersion:a}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:a,requestStart:i};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:a,requestStart:i}}})();this.enqueueRenderTask(s)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const i=n.filter(a=>!e.langs.has(a));if(i.length>0&&(Rb(i)?t.request.resolvedLanguages=Ib(i):t.request.resolvedLanguages=await Db(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const n=this.activeTaskById.get(t.id);try{if(n==null)throw td;if(t.type==="error"){const i=new Error(t.error);if(t.stack&&(i.stack=t.stack),"reject"in n)n.reject(i);else if(Xo(n))this.notifyHighlightError(n,i);else throw new Error("handleWorkerMessage: unknown task type");throw i}else switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:a}=t;if(!this.isCurrentRenderTask(n)||!go(a,this.getFileRenderOptions()))throw td;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.file.cacheKey!=null&&this.fileCache.set(s.file.cacheKey,{result:i,options:a}),this.notifyFileInstances(n,i,a);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:a}=t;if(!this.isCurrentRenderTask(n)||!kr(a,this.getDiffRenderOptions()))throw td;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.diff.cacheKey!=null&&this.diffCache.set(s.diff.cacheKey,{result:i,options:a}),this.notifyDiffInstances(n,i,a);break}}}catch(i){i!==td&&console.error(i,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Xo(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Xo(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){i6(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of Hb(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),Xo(t)?this.notifyHighlightError(t,n):"reject"in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const n=d8();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=f8())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let i=!0;for(const a of e)if(!n.langs.has(a)){i=!1;break}if(i)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of Dl(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Xo(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of Dl(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of Dl(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of Dl(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of Dl(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="file"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&vo(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="diff"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&ds(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Xo(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function i6(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function Hb(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??xn(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??xn(e.request.diff.name)),t.add(e.request.diff.lang??xn(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function Xo(e){return e?.type==="file"||e?.type==="diff"}function Dl(e){return e.instances}let Ql;function r6({poolOptions:e,highlighterOptions:t}){return Ql??=new n6(e,t),Ql}function o6(){Ql!=null&&(Ql.terminate(),Ql=void 0)}const jC=Y.createContext(void 0);let Jp=0;function a6({children:e,poolOptions:t,highlighterOptions:n}){const[i]=Y.useState(()=>{if(!(typeof window>"u"))return r6({poolOptions:t,highlighterOptions:n})});return Y.useInsertionEffect(()=>{if(i!=null)return Jp++,()=>{Jp--}},[i]),Y.useEffect(()=>()=>{Jp===0&&o6()},[]),U.jsx(jC.Provider,{value:i,children:e})}function vs(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),a=Object.keys(e),s=new Set(Object.keys(t));for(const c of a)if(s.delete(c),!i.has(c)&&(!(c in t)||e[c]!==t[c]))return!1;for(const c of Array.from(s))if(!i.has(c))return!1;return!0}function pf(e,t){const n=e?.theme??xt,i=t?.theme??xt,a=zb(e),s=zb(t);return ua(n,i)&&vs(e,t,["theme","parseDiffOptions"])&&vs(a,s)}function zb(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}const ps=new Set;let ms=null;function s6(e){ps.add(e),ms??=requestAnimationFrame($C)}function l6(e){ps.delete(e),ps.size===0&&ms!=null&&(cancelAnimationFrame(ms),ms=null)}function $C(e){const t=new Set(ps);ps.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}ps.size>0?ms=requestAnimationFrame($C):ms=null}function qm(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function c6({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:a=0,overscrollSize:s}){const c=n+s*2,d=i?n+a*2:c;if(t=Math.max(t,d),c>=t||i){const m=Math.max(e-a,0),g=Math.min(e+d,t);return{top:m,bottom:Math.max(g,m)}}let f=e+n/2-c/2,h=f+c;return f<0&&(f=0),h>t&&(h=t),f=Math.floor(Math.max(f,0)),{top:f,bottom:Math.ceil(Math.max(Math.min(h,t),f))}}function hc(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function u6(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function zi(e){const t=window.devicePixelRatio??1;return Math.round(e*t)/t}const qC="-1,-1";function Gm(e){return e?.some(t=>t.lineNumber===0)??!1}function Wm(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function mf(e){return e.startingLine===0&&e.totalLines>0}function d6(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function f6(){return Ne({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[jd({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}var GC=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||qm(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const 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=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:a,onMergeConflictActionClick:s}=this.options;t==null&&n==null&&i==null&&s==null&&a==null||this.options.onGutterUtilityClick!=null&&id(e.composedPath())||(Er(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:a,onTokenLeave:s,enableGutterUtility:c=!1}=this.options;t==="disabled"&&!c&&n==null&&i==null&&a==null&&s==null||(Er(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Er(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Er(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}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();Er(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const a=this.resolvePointerTarget(i);Er(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",a);const{onLineClick:s,onLineNumberClick:c,onLineEnter:d,onLineLeave:f,onTokenClick:h,onTokenEnter:m,onTokenLeave:g,onHunkExpand:y,onMergeConflictActionClick:b}=this.options;switch(e){case"move":{const S=em(a)&&this.hoveredLine?.lineElement===a.lineElement;bd(a)&&this.hoveredToken?.tokenElement===a.tokenElement||(this.hoveredToken!=null&&(g?.(this.hoveredToken,t),this.clearHoveredToken()),bd(a)&&(this.setHoveredToken(this.toTokenEventBaseProps(a)),m?.(this.hoveredToken,t))),S||(this.hoveredLine!=null&&(f?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),em(a)?(this.setHoveredLine(this.toEventBaseProps(a)),this.placeUtility(),d?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(a==null)break;if(m6(a)&&b!=null){b(a);break}if(p6(a)&&y!=null){y(a.hunkIndex,a.all||t.shiftKey?"both":a.direction,a.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!em(a))break;bd(a)&&h!=null&&h(this.toTokenEventBaseProps(a),t);const S=this.toEventBaseProps(a);c!=null&&a.numberColumn?c({...S,event:t}):s?.({...S,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:a,onLineEnter:s,onLineLeave:c,onTokenClick:d,onTokenEnter:f,onTokenLeave:h,onHunkExpand:m,onMergeConflictActionClick:g,enableGutterUtility:y=!1,enableLineSelection:b=!1,onGutterUtilityClick:S}=this.options,w=S!=null,A=n!=="disabled"||i!=null||a!=null||s!=null||c!=null||d!=null||f!=null||h!=null||m!=null||g!=null||y||b||w;A&&!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,Er(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const T=[];return(t==="both"||t==="click")&&(i!=null&&T.push("onLineClick"),a!=null&&T.push("onLineNumberClick"),m!=null&&T.push("expandable hunk separators"),g!=null&&T.push("merge conflict actions")),T})()),Er(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Er(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!A&&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);const k=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",E=this.pointerSession.mode==="gutterSelecting";(!b&&k||!w&&E)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,a=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),a&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!a&&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;const t=e.composedPath();id(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:a,eventSide:s,lineIndex:c}=n;if(e.shiftKey&&this.selectedRange!=null){const d=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(d==null)return;const f=d.start<=d.end?c>=d.start:c<=d.end;this.selectionAnchor={lineNumber:f?this.selectedRange.start:this.selectedRange.end,side:f?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===a&&this.selectedRange?.end===a){const d={lineNumber:a,side:s};this.selectionAnchor=d,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:d,pending:d},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:a,side:s},this.updateSelection(a,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),a=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),s=i?.top??a;a==null||s==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:s,current:a},t&&(this.selectionAnchor={lineNumber:s.lineNumber,side:s.side},this.updateSelection(a.lineNumber,a.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(d6(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{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==null&&(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==null&&(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){const t=document.createElement("div");t.innerHTML=qi(f6());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);$l(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const 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(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),a=this.selectionPointRowIndex(n);if(!(i==null||a==null))return i>a?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const a of i){if(!(a instanceof HTMLElement))continue;const s=this.resolvePointerTarget(nd(a));if($l(s)&&!(this.mode==="diff"&&e.side!=null&&s.side!==e.side))return s}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if($l(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){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if($l(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&id(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=nd(e);if(t&&id(n))return;const i=v6(e);return i!=null?nd(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=b6(y6(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?nd(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=Bb(t)?t:Bb(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let a;if(e==null)a=null;else{const s=this.selectionAnchor?.side??t,c=this.selectionAnchor?.lineNumber??e;a=this.buildSelectionRange(c,e,s,t)}qm(i??void 0,a??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=a:(this.selectedRange=a,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const d of e)d.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const a=i.start===i.end,s=Math.min(i.start,i.end),c=Math.max(i.start,i.end);for(const d of t){const[f,h]=d.children,m=h.children.length;if(m!==f.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let g=0;g<m;g++){const y=h.children[g],b=f.children[g];if(!(y instanceof HTMLElement)||!(b instanceof HTMLElement))continue;const S=this.parseLineIndex(y,n);if((S??0)>c)break;if(S==null||S<s)continue;let w=a?"single":S===s?"first":S===c?"last":"";y.setAttribute("data-selected-line",w),b.setAttribute("data-selected-line",w),b.nextSibling instanceof HTMLElement&&y.nextSibling instanceof HTMLElement&&(y.nextSibling.hasAttribute("data-line-annotation")||y.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(a?(w="last",y.setAttribute("data-selected-line","first")):S===s?w="":S===c&&y.setAttribute("data-selected-line",""),y.nextSibling.setAttribute("data-selected-line",w),b.nextSibling.setAttribute("data-selected-line",w))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:a,tokenText:s}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:a,tokenText:s}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:a,tokenText:s}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,a,s,c,d,f,h,m,g;for(const b of e){if(!(b instanceof HTMLElement))continue;if(g==null&&b.hasAttribute("data-merge-conflict-action")){const k=b.getAttribute("data-merge-conflict-action")??void 0,E=b.getAttribute("data-merge-conflict-conflict-index")??void 0,T=E!=null?Number.parseInt(E,10):NaN;g6(k)&&Number.isFinite(T)&&(g={kind:"merge-conflict-action",resolution:k,conflictIndex:T})}if(d==null&&b.hasAttribute("data-char")){d=b;const k=b.getAttribute("data-char");if(k!=null){const E=Number.parseInt(k,10);if(!Number.isNaN(E)){const T=b.textContent??"",L=E+T.length;(T.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(f={tokenElement:d,lineCharStart:E,lineCharEnd:L,tokenText:T});continue}}}const S=c==null?b.getAttribute("data-column-number")??void 0:void 0;if(S!=null){c=b,m=Number.parseInt(S,10),t=!0,n=Fb(b),s=b.getAttribute("data-line-index")??void 0;continue}const w=a==null?b.getAttribute("data-line")??void 0:void 0;if(w!=null){a=b,m=Number.parseInt(w,10),n=Fb(b),s=b.getAttribute("data-line-index")??void 0;continue}if(h==null&&(b.hasAttribute("data-expand-button")||b.hasAttribute("data-unmodified-lines"))){h={hunkIndex:void 0,direction:b.hasAttribute("data-expand-up")?"up":b.hasAttribute("data-expand-down")?"down":"both",all:b.hasAttribute("data-expand-all-button")};continue}const A=h!=null?b.getAttribute("data-expand-index")??void 0:void 0;if(h!=null&&A!=null){const k=Number.parseInt(A,10);Number.isNaN(k)||(h.hunkIndex=k);continue}if(i==null&&b.hasAttribute("data-code")){i=b;break}}if(g!=null)return g;if(h?.hunkIndex!=null)return{type:"line-info",hunkIndex:h.hunkIndex,direction:h.direction,all:h.all};if(a??=s!=null?Vb(i,`[data-line][data-line-index="${s}"]`):void 0,c??=s!=null?Vb(i,`[data-column-number][data-line-index="${s}"]`):void 0,i==null||a==null||c==null||n==null||m==null||Number.isNaN(m))return;const y=this.parseLineIndex(a,this.isSplitDiff());return f!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:void 0,splitLineIndex:y,...f}:{kind:"token",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:Ub(n,i),splitLineIndex:y,...f}:this.mode==="file"?{kind:"line",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:void 0,splitLineIndex:y}:{kind:"line",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:Ub(n,i),splitLineIndex:y}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function qd({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:a,onLineEnter:s,onLineLeave:c,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:m,renderGutterUtility:g,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:w,onLineSelectionStart:A,onLineSelectionChange:k,onLineSelectionEnd:E},T,L,O){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:h6({enableGutterUtility:t,renderGutterUtility:g,onGutterUtilityClick:i}),usesCustomGutterUtility:g!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:T,onMergeConflictActionClick:O,onLineClick:a,onLineEnter:s,onLineLeave:c,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:m,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:w,onLineSelectionStart:A,onLineSelectionChange:k,onLineSelectionEnd:E,getLineIndex:L}}function h6({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function $l(e){return e!=null&&"kind"in e&&e.kind==="line"}function bd(e){return e!=null&&"kind"in e&&e.kind==="token"}function em(e){return $l(e)||bd(e)}function p6(e){return"type"in e&&e.type==="line-info"}function m6(e){return"kind"in e&&e.kind==="merge-conflict-action"}function g6(e){return e==="current"||e==="incoming"||e==="both"}function Vb(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function nd(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function v6(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function y6(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function b6(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Bb(e){return e!=null&&typeof e.elementFromPoint=="function"}function Ub(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Fb(e){const 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 id(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function Er(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var WC=class xr{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=xr.resizeObserver??new ResizeObserver(xr.handleSharedResizeEntries);return xr.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const a=xr.managersByElement.get(i.target);if(a==null)continue;const s=n.get(a);s==null?n.set(a,[i]):s.push(i)}for(const[i,a]of n)i.handleResizeEntries(a)}observedNodes=new Map;setup(t,n){const i=new Set;let a=0;const s=new Map(this.observedNodes);this.observedNodes.clear();for(const c of t.children){if(a===2)break;const d=(()=>{if(c instanceof HTMLElement&&c.tagName==="CODE")return c})();if(d==null)continue;a++;let f=s.get(d);if(f!=null&&f.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let h=d.firstElementChild;h instanceof HTMLElement||(h=null),f!=null?(this.observedNodes.set(d,f),s.delete(d),f.numberElement!==h?(f.numberElement!=null&&(this.unobserve(f.numberElement),s.delete(f.numberElement)),h!=null&&(this.observe(h),s.delete(h),this.observedNodes.set(h,f)),f.numberElement=h,f.numberWidth=0):f.numberElement!=null?(s.delete(f.numberElement),this.observedNodes.set(f.numberElement,f)):f.numberWidth=0):(f={type:"code",codeElement:d,numberElement:h,codeWidth:"auto",numberWidth:0},this.observedNodes.set(d,f),this.observe(d),h!=null&&(this.observedNodes.set(h,f),this.observe(h)))}if(a>1&&!n){const c=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(const f of c){if(!(f instanceof HTMLElement))continue;const h=f.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(h)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:h,element:f});continue}let m=d.get(h);m==null&&(m=[],d.set(h,m)),m.push(f)}for(const[f,h]of d){if(h.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",f,h);continue}const[m,g]=h,y=m.firstElementChild,b=g.firstElementChild;if(!(m instanceof HTMLElement)||!(g instanceof HTMLElement)||!(y instanceof HTMLElement)||!(b instanceof HTMLElement))continue;let S=s.get(y);if(S!=null){this.observedNodes.set(y,S),this.observedNodes.set(b,S),s.delete(y),s.delete(b);continue}const w=y.getBoundingClientRect().height,A=b.getBoundingClientRect().height;S={type:"annotations",column1:{container:m,child:y,childHeight:w},column2:{container:g,child:b,childHeight:A},currentHeight:"auto"},i.add({child1:y,child2:b,item:S,newHeight:Math.max(w,A)})}for(const f of i)this.applyNewHeight(f.item,f.newHeight),this.observedNodes.set(f.child1,f.item),this.observedNodes.set(f.child2,f.item),this.observe(f.child1),this.observe(f.child2);i.clear()}for(const[c,d]of s)this.unobserve(c),d.type==="code"?C6(d):E6(d);s.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=xr,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),xr.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=xr,a=n.get(t);if(a!=null){if(a!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),xr.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const a of t){const{target:s,borderBoxSize:c,contentBoxSize:d}=a;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",a);continue}const f=this.observedNodes.get(s);if(f==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",a);continue}if(f.type==="annotations"){const h=(()=>{if(s===f.column1.child)return f.column1;if(s===f.column2.child)return f.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:f,target:s});continue}h.childHeight=c[0].blockSize,i.add(f)}else if(f.type==="code"){const h=n.get(f)??{},m=d[0].inlineSize;s===f.codeElement?h.codeInlineSize=m:s===f.numberElement&&(h.numberInlineSize=m),n.set(f,h)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const a=i.codeInlineSize!=null?S6(i.codeInlineSize):n.codeWidth,s=i.numberInlineSize!=null?_6(i.numberInlineSize):n.numberWidth,c=a!==n.codeWidth,d=s!==n.numberWidth;if(!(!c&&!d)&&(n.codeWidth=a,n.numberWidth=s,c&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof a=="number"?`${a}px`:"auto"}`),d&&n.codeElement.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),c||d&&a!=="auto")){const f=typeof a=="number"?Math.max(a-s,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${f>0?`${f}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function S6(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function _6(e){return Math.max(Math.ceil(e),0)}function C6(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function E6(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 gf(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 Gd(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Sm.has(t))return!1;return!0}function Zl(e){for(const t of lc(e))if(!ym.has(t))return!1;return!0}function Km(e){return Ne({tagName:"div",children:[Ne({tagName:"div",children:e.annotations?.map(t=>Ne({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function KC(e,t){return Ne({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function w6(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 YC({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,a={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return Ne({tagName:"div",children:[t==="custom"?Ne({tagName:"slot",properties:{name:Cc}}):x6({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[T6(i)]],properties:a})}function x6({name:e,prevName:t,iconType:n}){const i=[Ne({tagName:"slot",properties:{name:bg}}),jd({name:w6(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(Ne({tagName:"div",children:[Ne({tagName:"bdi",children:[Gi(t)]})],properties:{"data-prev-name":""}})),i.push(jd({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(Ne({tagName:"div",children:[Ne({tagName:"bdi",children:[Gi(e)]})],properties:{"data-title":""}})),Ne({tagName:"div",children:i,properties:{"data-header-content":""}})}function T6(e){const t=[];if(e!=null){let n=0,i=0;for(const a of e.hunks)n+=a.additionLines,i+=a.deletionLines;(i>0||n===0)&&t.push(Ne({tagName:"span",children:[Gi(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(Ne({tagName:"span",children:[Gi(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Ne({tagName:"slot",properties:{name:Sg}})),Ne({tagName:"div",children:t,properties:{"data-metadata":""}})}function XC(e){return Ne({tagName:"pre",properties:k6(e)})}function k6({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:a,totalLines:s,type:c,customProperties:d}){return{...d,"data-diff":c==="diff"?"":void 0,"data-file":c==="file"?"":void 0,"data-diff-type":c==="diff"?a?"split":"single":void 0,"data-overflow":i,"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:${`${s}`.length}ch;`}}function QC(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:lc(t),preferredHighlighter:n}}function ZC(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let A6=-1;var L6=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++A6}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:xt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Zl(e.theme??xt)?MC():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=tm(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!go(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!cc(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??xn(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=xt,tokenizeMaxLineLength:a=1e3}=this.options;return{theme:i,useTokenTransformer:ZC(this.options),tokenizeMaxLineLength:a}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!vo(e,n.file)||!go(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,jm(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:jm(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ld){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const a=this.getMatchingWorkerResultCache(e,n);a!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...a},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const s=this.getOrCreateLineCache(e),c=e.contents.length>0,d=!c||cc(e)||tm(s.length,this.getTokenizeMaxLength()),f=!vo(e,this.renderCache.file),h=!gf(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(d||this.renderCache.result==null||!this.renderCache.highlighted&&(f||h))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||f||h||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!d&&c&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??xn(e.name);const m=this.highlighter!=null&&Zl(n.theme),g=this.highlighter!=null&&Gd(this.computedLang),y=!d&&g;if(this.highlighter!=null&&m&&(i||d||!this.renderCache.highlighted&&y||this.renderCache.result==null)){const{result:b,options:S}=this.renderFileWithHighlighter(e,this.highlighter,d||!g);this.renderCache={file:e,options:S,highlighted:y,result:b,renderRange:void 0}}(!m||!d&&!g)&&this.asyncHighlight(e).then(({result:b,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,b,S,!d)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ld){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=tm(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??xn(e.name);const n=this.highlighter!=null&&Um(lc(this.options.theme)),i=t||this.highlighter!=null&&Gd(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:zC(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:a}){const{disableFileHeader:s=!1}=this.options,c=[],d=us(),f=this.getOrCreateLineCache(e);let h=0;const m=mf(t)?Wm(this.lineAnnotations):void 0;return m!=null&&(d.children.push(Yn("context","annotation",1)),c.push(Km({hunkIndex:-1,lineIndex:-1,annotations:m.map(g=>ki(g))})),h++),Fd({lines:f,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:g,lineNumber:y})=>{const b=n[g];if(b==null){const S="FileRenderer.processFileResult: Line doesnt exist";throw console.error(S,{name:e.name,lineIndex:g,lineNumber:y,lines:f}),new Error(S)}if(b!=null){d.children.push(OC("context",y,`${g}`)),c.push(b),h++;const S=this.lineAnnotations[y];S!=null&&(d.children.push(Yn("context","annotation",1)),c.push(Km({hunkIndex:0,lineIndex:y,annotations:S.map(w=>ki(w))})),h++)}}}),d.properties.style=`grid-row: span ${h}`,{gutterAST:d.children??[],contentAST:c,preAST:this.createPreElement(f.length),headerAST:s?void 0:this.renderHeader(e),totalLines:f.length,rowCount:h,themeStyles:i,baseThemeType:a,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return YC({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return qi(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Ne({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=us();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,KC(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return qi(t?Ne({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await Ud(QC(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const a=!vo(e,this.renderCache.file)||!this.renderCache.highlighted||!go(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!go(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&vo(e,n.file)&&go(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return XC({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function tm(e,t){return e>t}const JC=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
184
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Lb({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 ed({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:a=!1}){const s=t[t.length-1];if(s==null||a||!n){t.push([i?0:1,e.value]);return}const c=s[0]===0;if(i===c||i&&e.value.length===1&&!c){s[1]+=e.value;return}t.push([i?0:1,e.value])}const Y8={forcePlainText:!1};function FC(e,t,n,{forcePlainText:i,startingLine:a,totalLines:s,expandedHunks:c,collapsedContextThreshold:d=1}=Y8){i?(a??=0,s??=1/0):(a=0,s=1/0);const f=a>0||s<1/0,h=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,m=HC({theme:n.theme,highlighter:t}),g=i&&!f&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,y={deletionLines:[],additionLines:[]},{maxLineDiffLength:b}=n,S=!i&&!e.isPartial,w=i?c:void 0,A=new Map;function k(T){const L=S?0:T,O=A.get(L)??Q8();return A.set(L,O),O}function E(T,L,O,D){if(f){let N=O.at(-1);(N==null||N.targetIndex+N.count!==L)&&(N={targetIndex:L,originalOffset:D.length,count:0},O.push(N)),N.count++}D.push(T)}Xl({diff:e,diffStyle:"both",startingLine:a,totalLines:s,expandedHunks:f?w:!0,collapsedContextThreshold:d,callback:({hunkIndex:T,additionLine:L,deletionLine:O,type:D})=>{const N=k(T),K=L!=null?L.splitLineIndex:O.splitLineIndex;D==="change"&&L!=null&&O!=null&&X8({additionLine:e.additionLines[L.lineIndex],deletionLine:e.deletionLines[O.lineIndex],deletionLineIndex:N.deletionContent.length,additionLineIndex:N.additionContent.length,deletionDecorations:N.deletionDecorations,additionDecorations:N.additionDecorations,lineDiffType:g,maxLineDiffLength:b}),O!=null&&(E(e.deletionLines[O.lineIndex],O.lineIndex,N.deletionSegments,N.deletionContent),N.deletionInfo.push({type:D==="change"?"change-deletion":D,lineNumber:O.lineNumber,altLineNumber:D==="change"?void 0:L.lineNumber??void 0,lineIndex:`${O.unifiedLineIndex},${K}`})),L!=null&&(E(e.additionLines[L.lineIndex],L.lineIndex,N.additionSegments,N.additionContent),N.additionInfo.push({type:D==="change"?"change-addition":D,lineNumber:L.lineNumber,altLineNumber:D==="change"?void 0:O.lineNumber??void 0,lineIndex:`${L.unifiedLineIndex},${K}`}))}});for(const T of A.values()){if(T.deletionContent.length===0&&T.additionContent.length===0)continue;const L={name:e.prevName??e.name,contents:T.deletionContent.value},O={name:e.name,contents:T.additionContent.value},{deletionLines:D,additionLines:N}=Z8({deletionFile:L,deletionInfo:T.deletionInfo,deletionDecorations:T.deletionDecorations,additionFile:O,additionInfo:T.additionInfo,additionDecorations:T.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(S){y.deletionLines=D,y.additionLines=N;continue}if(T.deletionSegments.length>0)for(const K of T.deletionSegments)for(let G=0;G<K.count;G++)y.deletionLines[K.targetIndex+G]=D[K.originalOffset+G];else y.deletionLines.push(...D);if(T.additionSegments.length>0)for(const K of T.additionSegments)for(let G=0;G<K.count;G++)y.additionLines[K.targetIndex+G]=N[K.originalOffset+G];else y.additionLines.push(...N)}return{code:y,themeStyles:m,baseThemeType:h}}function X8({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:a,additionDecorations:s,lineDiffType:c,maxLineDiffLength:d}){if(e==null||t==null||c==="none"||(e=sa(e),t=sa(t),e.length>d||t.length>d))return;const f=c==="char"?V8(e,t):F8(e,t),h=[],m=[],g=c==="word-alt",y=f.at(-1);for(const S of f){const w=S===y;!S.added&&!S.removed?(ed({item:S,arr:h,enableJoin:g,isNeutral:!0,isLastItem:w}),ed({item:S,arr:m,enableJoin:g,isNeutral:!0,isLastItem:w})):S.removed?ed({item:S,arr:h,enableJoin:g,isLastItem:w}):ed({item:S,arr:m,enableJoin:g,isLastItem:w})}let b=0;for(const S of h)S[0]===1&&a.push(Lb({line:n,spanStart:b,spanLength:S[1].length})),b+=S[1].length;b=0;for(const S of m)S[0]===1&&s.push(Lb({line:i,spanStart:b,spanLength:S[1].length})),b+=S[1].length}function Q8(){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 Z8({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:a,deletionDecorations:s,additionDecorations:c,languageOverride:d,options:{theme:f=xt,...h}}){const m=d??xn(e.name),g=d??xn(t.name),{state:y,transformers:b}=NC(h.useTokenTransformer),S=typeof f=="string"?{...h,lang:"text",theme:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeTimeLimit:0}:{...h,lang:"text",themes:f,transformers:b,decorations:void 0,defaultColor:!1,cssVariablePrefix:Xn("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(S.lang=m,y.lineInfo=n,S.decorations=s,Fm(a.codeToHast(sa(e.contents),S))),additionLines:t.contents===""?[]:(S.lang=g,S.decorations=c,y.lineInfo=i,Fm(a.codeToHast(sa(t.contents),S)))}}function Ib(e){const t=[];for(const n of e){const i=oa.get(n);if(i==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(i)}return t}function Rb(e){for(const t of Array.isArray(e)?e:[e])if(!oa.has(t))return!1;return!0}async function Db(e){const t=[],n=[];for(const i of e){if(i==="text"||i==="ansi")continue;const a=xC(i)??wC(i);"then"in a?n.push(a):t.push(a)}return n.length>0&&await Promise.all(n).then(i=>{for(const a of i){if(a==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(a)}}),t}function Mb(e){return xi.getResolvedThemes(e)}async function Ob(e){for(const n of e)RC(n);const t=await xi.resolveThemes(e);for(let n=0;n<e.length;n++)DC(e[n],t[n]);return t}var jl={exports:{}},J8=jl.exports,Pb;function e6(){return Pb||(Pb=1,(function(e,t){(function(n,i){i(t)})(J8,function(n){const i=Symbol("newer"),a=Symbol("older");class s{constructor(g,y){typeof g!="number"&&(y=g,g=0),this.size=0,this.limit=g,this.oldest=this.newest=void 0,this._keymap=new Map,y&&(this.assign(y),g<1&&(this.limit=this.size))}_markEntryAsUsed(g){g!==this.newest&&(g[i]&&(g===this.oldest&&(this.oldest=g[i]),g[i][a]=g[a]),g[a]&&(g[a][i]=g[i]),g[i]=void 0,g[a]=this.newest,this.newest&&(this.newest[i]=g),this.newest=g)}assign(g){let y,b=this.limit||Number.MAX_VALUE;this._keymap.clear();let S=g[Symbol.iterator]();for(let w=S.next();!w.done;w=S.next()){let A=new c(w.value[0],w.value[1]);if(this._keymap.set(A.key,A),y?(y[i]=A,A[a]=y):this.oldest=A,y=A,b--==0)throw new Error("overflow")}this.newest=y,this.size=this._keymap.size}get(g){var y=this._keymap.get(g);return y?(this._markEntryAsUsed(y),y.value):void 0}set(g,y){var b=this._keymap.get(g);return b?(b.value=y,this._markEntryAsUsed(b),this):(this._keymap.set(g,b=new c(g,y)),this.newest?(this.newest[i]=b,b[a]=this.newest):this.oldest=b,this.newest=b,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var g=this.oldest;if(g)return this.oldest[i]?(this.oldest=this.oldest[i],this.oldest[a]=void 0):(this.oldest=void 0,this.newest=void 0),g[i]=g[a]=void 0,this._keymap.delete(g.key),--this.size,[g.key,g.value]}find(g){let y=this._keymap.get(g);return y?y.value:void 0}has(g){return this._keymap.has(g)}delete(g){var y=this._keymap.get(g);return y?(this._keymap.delete(y.key),y[i]&&y[a]?(y[a][i]=y[i],y[i][a]=y[a]):y[i]?(y[i][a]=void 0,this.oldest=y[i]):y[a]?(y[a][i]=void 0,this.newest=y[a]):this.oldest=this.newest=void 0,this.size--,y.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new f(this.oldest)}values(){return new h(this.oldest)}entries(){return this}[Symbol.iterator](){return new d(this.oldest)}forEach(g,y){typeof y!="object"&&(y=this);let b=this.oldest;for(;b;)g.call(y,b.value,b.key,this),b=b[i]}toJSON(){for(var g=new Array(this.size),y=0,b=this.oldest;b;)g[y++]={key:b.key,value:b.value},b=b[i];return g}toString(){for(var g="",y=this.oldest;y;)g+=String(y.key)+":"+y.value,y=y[i],y&&(g+=" < ");return g}}n.LRUMap=s;function c(m,g){this.key=m,this.value=g,this[i]=void 0,this[a]=void 0}function d(m){this.entry=m}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:[m.key,m.value]}):{done:!0,value:void 0}};function f(m){this.entry=m}f.prototype[Symbol.iterator]=function(){return this},f.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:m.key}):{done:!0,value:void 0}};function h(m){this.entry=m}h.prototype[Symbol.iterator]=function(){return this},h.prototype.next=function(){let m=this.entry;return m?(this.entry=m[i],{done:!1,value:m.value}):{done:!0,value:void 0}}})})(jl,jl.exports)),jl.exports}var t6=e6();const Nb=ax(t6),td=Symbol("IGNORE_RESPONSE");var Zp=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},n6=class{options;highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=xt,useTokenTransformer:i=!1,lineDiffType:a="word-alt",maxLineDiffLength:s=1e3,tokenizeMaxLineLength:c=1e3,preferredHighlighter:d="shiki-js"}){this.options=e,this.preferredHighlighter=d,this.renderOptions={theme:n,useTokenTransformer:i,lineDiffType:a,maxLineDiffLength:s,tokenizeMaxLineLength:c},this.fileCache=new Nb.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Nb.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??xt,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:i=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:a=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:s}=this,c=++this.renderOptionsRequestVersion,d=()=>this.isCurrentLifecycle(s)&&this.renderOptionsRequestVersion===c;try{const f={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:i,tokenizeMaxLineLength:a};if(this.isInitialized()||await this.initialize(),!d()||kr(f,this.renderOptions))return;const h=lc(e);let m=[];if(ua(f.theme,this.renderOptions.theme)||(Um(h)?m=Mb(h):m=await Ob(h)),!d())return;if(this.highlighter!=null)bm(m,this.highlighter);else{const y=await Ud({themes:h,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!d())return;this.highlighter=y}const g=this.setRenderOptionsOnWorkers(f,m);this.renderOptions=f,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const y of this.themeSubscribers)y.onThemeChange();await g}catch(f){if(f instanceof Zp||!d())return;throw f}}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const i of this.workers){if(!i.initialized)throw console.log({managedWorker:i}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((a,s)=>{const c=this.generateRequestId(),d={type:"set-render-options",id:c,request:{type:"set-render-options",id:c,renderOptions:e,resolvedThemes:t},resolve:a,reject:s,requestStart:Date.now()};this.activeTaskById.set(c,d),i.pendingSetupRequestId=c,i.worker.postMessage(d.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const n=this.activeTaskById.get(t);Xo(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((n,i)=>{(async()=>{try{const a=lc(this.renderOptions.theme);let s=[];if(Um(a)?s=Mb(a):s=await Ob(a),!this.isCurrentLifecycle(t)){n();return}let c=[];if(Rb(e)?c=Ib(e):c=await Db(e),!this.isCurrentLifecycle(t)){n();return}const[d]=await Promise.all([Ud({themes:a,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(s,c)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=d,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(a){if(a instanceof Zp||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),i(a)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],i=void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){const s=this.options.workerFactory(),c={worker:s,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:d})=>d)]),customExtensionsVersion:0};s.addEventListener("message",d=>{this.handleWorkerMessage(c,d.data)}),s.addEventListener("error",d=>console.error("Worker error:",d,c)),this.workers.push(c),n.push(new Promise((d,f)=>{const h=this.generateRequestId(),m={type:"initialize",id:h,request:{type:"initialize",id:h,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:i},resolve(){c.initialized=!0,d()},reject:f,requestStart:Date.now()};this.activeTaskById.set(h,m),this.executeTask(c,m)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const n=Hb(t),i=this.getAvailableWorker(n);if(i==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,i),this.resolveLanguagesAndExecuteTask(i,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);cc(t)||n!=null&&go(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||cc(e)||t!=null&&go(t.options,this.getFileRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"file",file:e},n)}getPlainFileAST(e,t,n,i){if(this.highlighter==null){this.queueInitialization();return}return zC(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:i})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);uc(t)||n!=null&&kr(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||uc(e)||t!=null&&kr(t.options,this.getDiffRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"diff",diff:e},n)}getPlainDiffAST(e,t,n,i,a){return this.highlighter!=null?FC(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:i,collapsedContextThreshold:a}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new Zp;for(const t of this.activeTaskById.values())"reject"in t&&t.reject(e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.getHighlightKeyForRequest(t),i=n!=null?this.getTaskByHighlightKey(n):void 0;if(i!=null){this.detachInstanceFromQueuedTasks(e,i),this.addInstanceToTask(i,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const a=this.generateRequestId(),s=Date.now(),{renderOptionsVersion:c}=this,d=(()=>{switch(t.type){case"file":return{type:"file",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:c,requestStart:s};case"diff":return{type:"diff",id:a,request:{...t,id:a},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:c,requestStart:s}}})();this.enqueueRenderTask(d,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),i=Date.now(),{renderOptionsVersion:a}=this,s=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:a,requestStart:i};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:a,requestStart:i}}})();this.enqueueRenderTask(s)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const i=n.filter(a=>!e.langs.has(a));if(i.length>0&&(Rb(i)?t.request.resolvedLanguages=Ib(i):t.request.resolvedLanguages=await Db(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const n=this.activeTaskById.get(t.id);try{if(n==null)throw td;if(t.type==="error"){const i=new Error(t.error);if(t.stack&&(i.stack=t.stack),"reject"in n)n.reject(i);else if(Xo(n))this.notifyHighlightError(n,i);else throw new Error("handleWorkerMessage: unknown task type");throw i}else switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:a}=t;if(!this.isCurrentRenderTask(n)||!go(a,this.getFileRenderOptions()))throw td;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.file.cacheKey!=null&&this.fileCache.set(s.file.cacheKey,{result:i,options:a}),this.notifyFileInstances(n,i,a);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:a}=t;if(!this.isCurrentRenderTask(n)||!kr(a,this.getDiffRenderOptions()))throw td;const{request:s}=n;this.syncCustomExtensionVersion(e,s),s.diff.cacheKey!=null&&this.diffCache.set(s.diff.cacheKey,{result:i,options:a}),this.notifyDiffInstances(n,i,a);break}}}catch(i){i!==td&&console.error(i,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Xo(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Xo(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){i6(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of Hb(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),Xo(t)?this.notifyHighlightError(t,n):"reject"in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const n=d8();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=f8())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let i=!0;for(const a of e)if(!n.langs.has(a)){i=!1;break}if(i)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of Dl(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))Xo(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of Dl(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of Dl(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of Dl(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of Dl(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="file"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&vo(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="diff"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&ds(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())Xo(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function i6(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function Hb(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??xn(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??xn(e.request.diff.name)),t.add(e.request.diff.lang??xn(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function Xo(e){return e?.type==="file"||e?.type==="diff"}function Dl(e){return e.instances}let Ql;function r6({poolOptions:e,highlighterOptions:t}){return Ql??=new n6(e,t),Ql}function o6(){Ql!=null&&(Ql.terminate(),Ql=void 0)}const jC=W.createContext(void 0);let Jp=0;function a6({children:e,poolOptions:t,highlighterOptions:n}){const[i]=W.useState(()=>{if(!(typeof window>"u"))return r6({poolOptions:t,highlighterOptions:n})});return W.useInsertionEffect(()=>{if(i!=null)return Jp++,()=>{Jp--}},[i]),W.useEffect(()=>()=>{Jp===0&&o6()},[]),U.jsx(jC.Provider,{value:i,children:e})}function vs(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),a=Object.keys(e),s=new Set(Object.keys(t));for(const c of a)if(s.delete(c),!i.has(c)&&(!(c in t)||e[c]!==t[c]))return!1;for(const c of Array.from(s))if(!i.has(c))return!1;return!0}function pf(e,t){const n=e?.theme??xt,i=t?.theme??xt,a=zb(e),s=zb(t);return ua(n,i)&&vs(e,t,["theme","parseDiffOptions"])&&vs(a,s)}function zb(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}const ps=new Set;let ms=null;function s6(e){ps.add(e),ms??=requestAnimationFrame($C)}function l6(e){ps.delete(e),ps.size===0&&ms!=null&&(cancelAnimationFrame(ms),ms=null)}function $C(e){const t=new Set(ps);ps.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}ps.size>0?ms=requestAnimationFrame($C):ms=null}function qm(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function c6({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:a=0,overscrollSize:s}){const c=n+s*2,d=i?n+a*2:c;if(t=Math.max(t,d),c>=t||i){const m=Math.max(e-a,0),g=Math.min(e+d,t);return{top:m,bottom:Math.max(g,m)}}let f=e+n/2-c/2,h=f+c;return f<0&&(f=0),h>t&&(h=t),f=Math.floor(Math.max(f,0)),{top:f,bottom:Math.ceil(Math.max(Math.min(h,t),f))}}function hc(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function u6(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function zi(e){const t=window.devicePixelRatio??1;return Math.round(e*t)/t}const qC="-1,-1";function Gm(e){return e?.some(t=>t.lineNumber===0)??!1}function Wm(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function mf(e){return e.startingLine===0&&e.totalLines>0}function d6(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function f6(){return Ne({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[jd({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}var GC=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||qm(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const 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=>{const{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:a,onMergeConflictActionClick:s}=this.options;t==null&&n==null&&i==null&&s==null&&a==null||this.options.onGutterUtilityClick!=null&&id(e.composedPath())||(Er(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:a,onTokenLeave:s,enableGutterUtility:c=!1}=this.options;t==="disabled"&&!c&&n==null&&i==null&&a==null&&s==null||(Er(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Er(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Er(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}){const{__debugPointerEvents:n}=this.options,i=t.composedPath();Er(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const a=this.resolvePointerTarget(i);Er(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",a);const{onLineClick:s,onLineNumberClick:c,onLineEnter:d,onLineLeave:f,onTokenClick:h,onTokenEnter:m,onTokenLeave:g,onHunkExpand:y,onMergeConflictActionClick:b}=this.options;switch(e){case"move":{const S=em(a)&&this.hoveredLine?.lineElement===a.lineElement;bd(a)&&this.hoveredToken?.tokenElement===a.tokenElement||(this.hoveredToken!=null&&(g?.(this.hoveredToken,t),this.clearHoveredToken()),bd(a)&&(this.setHoveredToken(this.toTokenEventBaseProps(a)),m?.(this.hoveredToken,t))),S||(this.hoveredLine!=null&&(f?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),em(a)?(this.setHoveredLine(this.toEventBaseProps(a)),this.placeUtility(),d?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(a==null)break;if(m6(a)&&b!=null){b(a);break}if(p6(a)&&y!=null){y(a.hunkIndex,a.all||t.shiftKey?"both":a.direction,a.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!em(a))break;bd(a)&&h!=null&&h(this.toTokenEventBaseProps(a),t);const S=this.toEventBaseProps(a);c!=null&&a.numberColumn?c({...S,event:t}):s?.({...S,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:a,onLineEnter:s,onLineLeave:c,onTokenClick:d,onTokenEnter:f,onTokenLeave:h,onHunkExpand:m,onMergeConflictActionClick:g,enableGutterUtility:y=!1,enableLineSelection:b=!1,onGutterUtilityClick:S}=this.options,w=S!=null,A=n!=="disabled"||i!=null||a!=null||s!=null||c!=null||d!=null||f!=null||h!=null||m!=null||g!=null||y||b||w;A&&!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,Er(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const T=[];return(t==="both"||t==="click")&&(i!=null&&T.push("onLineClick"),a!=null&&T.push("onLineNumberClick"),m!=null&&T.push("expandable hunk separators"),g!=null&&T.push("merge conflict actions")),T})()),Er(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Er(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!A&&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);const k=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",E=this.pointerSession.mode==="gutterSelecting";(!b&&k||!w&&E)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,a=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),a&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!a&&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;const t=e.composedPath();id(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;const{lineNumber:a,eventSide:s,lineIndex:c}=n;if(e.shiftKey&&this.selectedRange!=null){const d=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(d==null)return;const f=d.start<=d.end?c>=d.start:c<=d.end;this.selectionAnchor={lineNumber:f?this.selectedRange.start:this.selectedRange.end,side:f?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(a,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===a&&this.selectedRange?.end===a){const d={lineNumber:a,side:s};this.selectionAnchor=d,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:d,pending:d},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:a,side:s},this.updateSelection(a,s,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),a=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),s=i?.top??a;a==null||s==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:s,current:a},t&&(this.selectionAnchor={lineNumber:s.lineNumber,side:s.side},this.updateSelection(a.lineNumber,a.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(d6(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{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==null&&(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==null&&(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){const t=document.createElement("div");t.innerHTML=qi(f6());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);$l(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const 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(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),a=this.selectionPointRowIndex(n);if(!(i==null||a==null))return i>a?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const a of i){if(!(a instanceof HTMLElement))continue;const s=this.resolvePointerTarget(nd(a));if($l(s)&&!(this.mode==="diff"&&e.side!=null&&s.side!==e.side))return s}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const n=this.resolvePointerTarget(e);if($l(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){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if($l(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&id(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=nd(e);if(t&&id(n))return;const i=v6(e);return i!=null?nd(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=b6(y6(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?nd(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=Bb(t)?t:Bb(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=this.getCurrentSelectionRange();let a;if(e==null)a=null;else{const s=this.selectionAnchor?.side??t,c=this.selectionAnchor?.lineNumber??e;a=this.buildSelectionRange(c,e,s,t)}qm(i??void 0,a??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=a:(this.selectedRange=a,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const d of e)d.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const a=i.start===i.end,s=Math.min(i.start,i.end),c=Math.max(i.start,i.end);for(const d of t){const[f,h]=d.children,m=h.children.length;if(m!==f.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let g=0;g<m;g++){const y=h.children[g],b=f.children[g];if(!(y instanceof HTMLElement)||!(b instanceof HTMLElement))continue;const S=this.parseLineIndex(y,n);if((S??0)>c)break;if(S==null||S<s)continue;let w=a?"single":S===s?"first":S===c?"last":"";y.setAttribute("data-selected-line",w),b.setAttribute("data-selected-line",w),b.nextSibling instanceof HTMLElement&&y.nextSibling instanceof HTMLElement&&(y.nextSibling.hasAttribute("data-line-annotation")||y.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(a?(w="last",y.setAttribute("data-selected-line","first")):S===s?w="":S===c&&y.setAttribute("data-selected-line",""),y.nextSibling.setAttribute("data-selected-line",w),b.nextSibling.setAttribute("data-selected-line",w))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:a,tokenText:s}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:a,tokenText:s}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:a,tokenText:s}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,a,s,c,d,f,h,m,g;for(const b of e){if(!(b instanceof HTMLElement))continue;if(g==null&&b.hasAttribute("data-merge-conflict-action")){const k=b.getAttribute("data-merge-conflict-action")??void 0,E=b.getAttribute("data-merge-conflict-conflict-index")??void 0,T=E!=null?Number.parseInt(E,10):NaN;g6(k)&&Number.isFinite(T)&&(g={kind:"merge-conflict-action",resolution:k,conflictIndex:T})}if(d==null&&b.hasAttribute("data-char")){d=b;const k=b.getAttribute("data-char");if(k!=null){const E=Number.parseInt(k,10);if(!Number.isNaN(E)){const T=b.textContent??"",L=E+T.length;(T.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(f={tokenElement:d,lineCharStart:E,lineCharEnd:L,tokenText:T});continue}}}const S=c==null?b.getAttribute("data-column-number")??void 0:void 0;if(S!=null){c=b,m=Number.parseInt(S,10),t=!0,n=Fb(b),s=b.getAttribute("data-line-index")??void 0;continue}const w=a==null?b.getAttribute("data-line")??void 0:void 0;if(w!=null){a=b,m=Number.parseInt(w,10),n=Fb(b),s=b.getAttribute("data-line-index")??void 0;continue}if(h==null&&(b.hasAttribute("data-expand-button")||b.hasAttribute("data-unmodified-lines"))){h={hunkIndex:void 0,direction:b.hasAttribute("data-expand-up")?"up":b.hasAttribute("data-expand-down")?"down":"both",all:b.hasAttribute("data-expand-all-button")};continue}const A=h!=null?b.getAttribute("data-expand-index")??void 0:void 0;if(h!=null&&A!=null){const k=Number.parseInt(A,10);Number.isNaN(k)||(h.hunkIndex=k);continue}if(i==null&&b.hasAttribute("data-code")){i=b;break}}if(g!=null)return g;if(h?.hunkIndex!=null)return{type:"line-info",hunkIndex:h.hunkIndex,direction:h.direction,all:h.all};if(a??=s!=null?Vb(i,`[data-line][data-line-index="${s}"]`):void 0,c??=s!=null?Vb(i,`[data-column-number][data-line-index="${s}"]`):void 0,i==null||a==null||c==null||n==null||m==null||Number.isNaN(m))return;const y=this.parseLineIndex(a,this.isSplitDiff());return f!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:void 0,splitLineIndex:y,...f}:{kind:"token",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:Ub(n,i),splitLineIndex:y,...f}:this.mode==="file"?{kind:"line",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:void 0,splitLineIndex:y}:{kind:"line",lineType:n,lineElement:a,lineNumber:m,numberColumn:t,numberElement:c,side:Ub(n,i),splitLineIndex:y}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function qd({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:a,onLineEnter:s,onLineLeave:c,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:m,renderGutterUtility:g,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:w,onLineSelectionStart:A,onLineSelectionChange:k,onLineSelectionEnd:E},T,L,O){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:h6({enableGutterUtility:t,renderGutterUtility:g,onGutterUtilityClick:i}),usesCustomGutterUtility:g!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:T,onMergeConflictActionClick:O,onLineClick:a,onLineEnter:s,onLineLeave:c,onLineNumberClick:d,onTokenClick:f,onTokenEnter:h,onTokenLeave:m,__debugPointerEvents:y,enableLineSelection:b,controlledSelection:S,onLineSelected:w,onLineSelectionStart:A,onLineSelectionChange:k,onLineSelectionEnd:E,getLineIndex:L}}function h6({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function $l(e){return e!=null&&"kind"in e&&e.kind==="line"}function bd(e){return e!=null&&"kind"in e&&e.kind==="token"}function em(e){return $l(e)||bd(e)}function p6(e){return"type"in e&&e.type==="line-info"}function m6(e){return"kind"in e&&e.kind==="merge-conflict-action"}function g6(e){return e==="current"||e==="incoming"||e==="both"}function Vb(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function nd(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function v6(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function y6(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function b6(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Bb(e){return e!=null&&typeof e.elementFromPoint=="function"}function Ub(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Fb(e){const 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 id(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}function Er(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var WC=class xr{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=xr.resizeObserver??new ResizeObserver(xr.handleSharedResizeEntries);return xr.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const a=xr.managersByElement.get(i.target);if(a==null)continue;const s=n.get(a);s==null?n.set(a,[i]):s.push(i)}for(const[i,a]of n)i.handleResizeEntries(a)}observedNodes=new Map;setup(t,n){const i=new Set;let a=0;const s=new Map(this.observedNodes);this.observedNodes.clear();for(const c of t.children){if(a===2)break;const d=(()=>{if(c instanceof HTMLElement&&c.tagName==="CODE")return c})();if(d==null)continue;a++;let f=s.get(d);if(f!=null&&f.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let h=d.firstElementChild;h instanceof HTMLElement||(h=null),f!=null?(this.observedNodes.set(d,f),s.delete(d),f.numberElement!==h?(f.numberElement!=null&&(this.unobserve(f.numberElement),s.delete(f.numberElement)),h!=null&&(this.observe(h),s.delete(h),this.observedNodes.set(h,f)),f.numberElement=h,f.numberWidth=0):f.numberElement!=null?(s.delete(f.numberElement),this.observedNodes.set(f.numberElement,f)):f.numberWidth=0):(f={type:"code",codeElement:d,numberElement:h,codeWidth:"auto",numberWidth:0},this.observedNodes.set(d,f),this.observe(d),h!=null&&(this.observedNodes.set(h,f),this.observe(h)))}if(a>1&&!n){const c=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(const f of c){if(!(f instanceof HTMLElement))continue;const h=f.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(h)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:h,element:f});continue}let m=d.get(h);m==null&&(m=[],d.set(h,m)),m.push(f)}for(const[f,h]of d){if(h.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",f,h);continue}const[m,g]=h,y=m.firstElementChild,b=g.firstElementChild;if(!(m instanceof HTMLElement)||!(g instanceof HTMLElement)||!(y instanceof HTMLElement)||!(b instanceof HTMLElement))continue;let S=s.get(y);if(S!=null){this.observedNodes.set(y,S),this.observedNodes.set(b,S),s.delete(y),s.delete(b);continue}const w=y.getBoundingClientRect().height,A=b.getBoundingClientRect().height;S={type:"annotations",column1:{container:m,child:y,childHeight:w},column2:{container:g,child:b,childHeight:A},currentHeight:"auto"},i.add({child1:y,child2:b,item:S,newHeight:Math.max(w,A)})}for(const f of i)this.applyNewHeight(f.item,f.newHeight),this.observedNodes.set(f.child1,f.item),this.observedNodes.set(f.child2,f.item),this.observe(f.child1),this.observe(f.child2);i.clear()}for(const[c,d]of s)this.unobserve(c),d.type==="code"?C6(d):E6(d);s.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=xr,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),xr.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=xr,a=n.get(t);if(a!=null){if(a!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),xr.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=new Set;for(const a of t){const{target:s,borderBoxSize:c,contentBoxSize:d}=a;if(!(s instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",a);continue}const f=this.observedNodes.get(s);if(f==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",a);continue}if(f.type==="annotations"){const h=(()=>{if(s===f.column1.child)return f.column1;if(s===f.column2.child)return f.column2})();if(h==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:f,target:s});continue}h.childHeight=c[0].blockSize,i.add(f)}else if(f.type==="code"){const h=n.get(f)??{},m=d[0].inlineSize;s===f.codeElement?h.codeInlineSize=m:s===f.numberElement&&(h.numberInlineSize=m),n.set(f,h)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const a=i.codeInlineSize!=null?S6(i.codeInlineSize):n.codeWidth,s=i.numberInlineSize!=null?_6(i.numberInlineSize):n.numberWidth,c=a!==n.codeWidth,d=s!==n.numberWidth;if(!(!c&&!d)&&(n.codeWidth=a,n.numberWidth=s,c&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof a=="number"?`${a}px`:"auto"}`),d&&n.codeElement.style.setProperty("--diffs-column-number-width",`${s===0?"auto":`${s}px`}`),c||d&&a!=="auto")){const f=typeof a=="number"?Math.max(a-s,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${f>0?`${f}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function S6(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function _6(e){return Math.max(Math.ceil(e),0)}function C6(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function E6(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 gf(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 Gd(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!Sm.has(t))return!1;return!0}function Zl(e){for(const t of lc(e))if(!ym.has(t))return!1;return!0}function Km(e){return Ne({tagName:"div",children:[Ne({tagName:"div",children:e.annotations?.map(t=>Ne({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function KC(e,t){return Ne({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function w6(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 YC({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,a={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return Ne({tagName:"div",children:[t==="custom"?Ne({tagName:"slot",properties:{name:Cc}}):x6({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[T6(i)]],properties:a})}function x6({name:e,prevName:t,iconType:n}){const i=[Ne({tagName:"slot",properties:{name:bg}}),jd({name:w6(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push(Ne({tagName:"div",children:[Ne({tagName:"bdi",children:[Gi(t)]})],properties:{"data-prev-name":""}})),i.push(jd({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push(Ne({tagName:"div",children:[Ne({tagName:"bdi",children:[Gi(e)]})],properties:{"data-title":""}})),Ne({tagName:"div",children:i,properties:{"data-header-content":""}})}function T6(e){const t=[];if(e!=null){let n=0,i=0;for(const a of e.hunks)n+=a.additionLines,i+=a.deletionLines;(i>0||n===0)&&t.push(Ne({tagName:"span",children:[Gi(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push(Ne({tagName:"span",children:[Gi(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(Ne({tagName:"slot",properties:{name:Sg}})),Ne({tagName:"div",children:t,properties:{"data-metadata":""}})}function XC(e){return Ne({tagName:"pre",properties:k6(e)})}function k6({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:a,totalLines:s,type:c,customProperties:d}){return{...d,"data-diff":c==="diff"?"":void 0,"data-file":c==="file"?"":void 0,"data-diff-type":c==="diff"?a?"split":"single":void 0,"data-overflow":i,"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:${`${s}`.length}ch;`}}function QC(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:lc(t),preferredHighlighter:n}}function ZC(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let A6=-1;var L6=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++A6}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:xt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Zl(e.theme??xt)?MC():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=tm(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!go(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!cc(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??xn(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=xt,tokenizeMaxLineLength:a=1e3}=this.options;return{theme:i,useTokenTransformer:ZC(this.options),tokenizeMaxLineLength:a}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!vo(e,n.file)||!go(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,jm(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:jm(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Ld){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const a=this.getMatchingWorkerResultCache(e,n);a!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...a},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const s=this.getOrCreateLineCache(e),c=e.contents.length>0,d=!c||cc(e)||tm(s.length,this.getTokenizeMaxLength()),f=!vo(e,this.renderCache.file),h=!gf(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(d||this.renderCache.result==null||!this.renderCache.highlighted&&(f||h))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||f||h||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,s)),this.renderCache.renderRange=t),!d&&c&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??xn(e.name);const m=this.highlighter!=null&&Zl(n.theme),g=this.highlighter!=null&&Gd(this.computedLang),y=!d&&g;if(this.highlighter!=null&&m&&(i||d||!this.renderCache.highlighted&&y||this.renderCache.result==null)){const{result:b,options:S}=this.renderFileWithHighlighter(e,this.highlighter,d||!g);this.renderCache={file:e,options:S,highlighted:y,result:b,renderRange:void 0}}(!m||!d&&!g)&&this.asyncHighlight(e).then(({result:b,options:S})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,b,S,!d)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Ld){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=tm(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??xn(e.name);const n=this.highlighter!=null&&Um(lc(this.options.theme)),i=t||this.highlighter!=null&&Gd(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:zC(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:a}){const{disableFileHeader:s=!1}=this.options,c=[],d=us(),f=this.getOrCreateLineCache(e);let h=0;const m=mf(t)?Wm(this.lineAnnotations):void 0;return m!=null&&(d.children.push(Yn("context","annotation",1)),c.push(Km({hunkIndex:-1,lineIndex:-1,annotations:m.map(g=>ki(g))})),h++),Fd({lines:f,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:g,lineNumber:y})=>{const b=n[g];if(b==null){const S="FileRenderer.processFileResult: Line doesnt exist";throw console.error(S,{name:e.name,lineIndex:g,lineNumber:y,lines:f}),new Error(S)}if(b!=null){d.children.push(OC("context",y,`${g}`)),c.push(b),h++;const S=this.lineAnnotations[y];S!=null&&(d.children.push(Yn("context","annotation",1)),c.push(Km({hunkIndex:0,lineIndex:y,annotations:S.map(w=>ki(w))})),h++)}}}),d.properties.style=`grid-row: span ${h}`,{gutterAST:d.children??[],contentAST:c,preAST:this.createPreElement(f.length),headerAST:s?void 0:this.renderHeader(e),totalLines:f.length,rowCount:h,themeStyles:i,baseThemeType:a,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return YC({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return qi(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(Ne({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=us();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,KC(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return qi(t?Ne({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await Ud(QC(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const a=!vo(e,this.renderCache.file)||!this.renderCache.highlighted||!go(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!go(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&vo(e,n.file)&&go(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return XC({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function tm(e,t){return e>t}const JC=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
185
185
  <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
186
186
  <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"/>
187
187
  </symbol>
@@ -1562,11 +1562,11 @@ XID_Start XIDS`.split(/\s/).map(e=>[df(e),e])),p4=new Map([["s",qt(383)],[qt(383
1562
1562
  ${rE(n)}
1563
1563
  ${e}
1564
1564
  }
1565
- }`}function lE(e,t){const n=rE(t);return e.replace(M6,n)}function O6(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $b(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Sd({code:e,pre:t,columnType:n,rowSpan:i,containerSize:a=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),a?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function cE({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=P6(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function P6(){const e=document.createElement("style");return e.setAttribute(vx,""),e}function uE(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function dE(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:a,overflow:s,split:c,totalLines:d,customProperties:f}){if(f!=null)for(const h in f){const m=f[h];m!=null&&e.setAttribute(h,`${m}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return a?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",c?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",s),e.style.setProperty("--diffs-min-number-column-width-default",`${`${d}`.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;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(D6)),i.adoptedStyleSheets=[e]}connectedCallback(){pc(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(W_,t)}const N6=[];let H6=-1;var z6=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++H6}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(e={theme:xt},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new L6(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new WC,this.interactionManager=new GC("file",qd(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(qd(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ua(this.appliedThemeCSS.theme,this.options.theme??xt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e==="wrap"),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:a,lineAnnotations:s}=e;this.hydrateElements(t,n),V6(this.pre,a,this.options.collapsed)||B6(this.headerElement,a,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:a,lineAnnotations:s}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),uE(e,t);for(const n of Array.from(e.shadowRoot?.children??[])){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n,this.appliedPreAttributes=void 0;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}if("diffsHeader"in n.dataset){this.headerElement=n,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions($b(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e!=null?this.fileRenderer.getOrCreateLineCache(e):N6}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:i=!1,containerWrapper:a,deferManagers:s=!1,lineAnnotations:c,renderRange:d}){const{collapsed:f=!1,themeType:h="system"}=this.options;if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const m=f?void 0:d,g=this.renderRange,y=this.hasThemeChanged(),b=c!=null&&(c.length>0||this.lineAnnotations.length>0)?c!==this.lineAnnotations:!1,S=!vo(this.file,e);if(!f&&!n&&gf(m,this.renderRange)&&!S&&!b&&!y)return this.applyCachedThemeState(h);this.renderRange=m,S&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions($b(this.options)),this.syncInteractionOptions(),c!=null&&this.setLineAnnotations(c),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:A=!1}=this.options;if(A&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,a),this.applyCachedThemeState(h),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const k=this.fileRenderer.renderFile(e,X_);k!=null&&this.applyThemeState(t,k.themeStyles,h,k.baseThemeType),k?.headerAST!=null&&this.applyHeaderToDOM(k.headerAST,t),this.injectUnsafeCSS()}catch(k){if(w)throw k;console.error(k),k instanceof Error&&this.applyErrorToDOM(k,t)}return i||this.emitPostRender(),!0}try{const k=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,b,S||y)||!this.applyPartialRender(g,m)){const E=this.fileRenderer.renderFile(e,m);if(E==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,E.themeStyles,h,E.baseThemeType),E.headerAST!=null&&this.applyHeaderToDOM(E.headerAST,t),this.applyFullRender(E,k)}this.applyBuffers(k,m),this.injectUnsafeCSS(),this.managersDirty=!0,s||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(k){if(w)throw k;console.error(k),k instanceof Error&&this.applyErrorToDOM(k,t)}return i||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{file:e,workerManager:t}=this;e==null||e.cacheKey==null||t==null||cc(e)||this.fileRenderer.getOrCreateLineCache(e).length>(this.options.tokenizeMaxLength??1e5)||t.primeFileHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const a=`${n}-${ki(i)}`;let s=this.annotationCache.get(a);if(s==null||!I6(i,s.annotation)){s?.element.remove();const c=t(i);if(c==null)continue;s={element:tE(ki(i)),annotation:i},s.element.appendChild(c),this.fileContainer.appendChild(s.element),this.annotationCache.set(a,s)}e.delete(a)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=nE();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){const{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??=iE(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=aE(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const a=e.shadowRoot??e.attachShadow({mode:"open"}),s=i??n,c=this.options.theme??xt,d=typeof c=="string"?c:{...c},f=pc(a);if(this.themeCSSStyle?.parentNode===a&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===a){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f};return}this.themeCSSStyle=cE({shadowRoot:a,currentNode:this.themeCSSStyle,themeCSS:sE(t,s,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lE(this.themeCSSStyle.textContent??"",pc(e)))}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=Sd({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;const{file:n,code:i}=this,a=i!=null?this.getColumns(i):void 0;if(n==null||i==null||a==null)return!1;const s=e.startingLine,c=t.startingLine,d=e.totalLines===1/0?Number.POSITIVE_INFINITY:s+e.totalLines,f=t.totalLines===1/0?Number.POSITIVE_INFINITY:c+t.totalLines,h=Math.max(s,c),m=Math.min(d,f);if(m<=h||!this.trimDOMToOverlap(a.gutter,h,m)||!this.trimDOMToOverlap(a.content,h,m))return!1;let{length:g}=a.content.children;const y=(A,k)=>{if(!(k<=0))return this.fileRenderer.renderFile(n,{startingLine:A,totalLines:k,bufferBefore:0,bufferAfter:0})},b=c<h?y(c,h-c):void 0;if(b===void 0&&c<h)return!1;const S=f===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,f-m),w=f>m?y(m,S):void 0;return w===void 0&&f>m?!1:(this.cleanupErrorWrapper(),b!=null&&(a.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(b.gutterAST)),a.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(b.contentAST)),g+=b.rowCount),w!=null&&(a.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),a.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),g+=w.rowCount),this.lastRowCount!==g&&(a.gutter.style.setProperty("grid-row",`span ${g}`),a.content.style.setProperty("grid-row",`span ${g}`),this.lastRowCount=g),!0)}getColumns(e){const t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){const i=this.getDOMBoundaryIndices(e,[t,n]),a=i.get(t)??e.children.length,s=i.get(n)??e.children.length;if(a>s)return!1;for(let c=e.children.length-1;c>=s;c-=1)e.children[c]?.remove();for(let c=a-1;c>=0;c-=1)e.children[c]?.remove();return!0}getDOMBoundaryIndices(e,t){const n=[...new Set(t)].sort((d,f)=>d-f),i=new Map;if(n.length===0)return i;let a=0,s=n[a];const{children:c}=e;s===0&&(i.set(0,0),a+=1,s=n[a]);for(let d=0;d<c.length;d+=1){const f=c[d];if(!(f instanceof HTMLElement))continue;const h=this.getLineIndexFromDOMNode(f);if(h!=null){for(;s!=null&&h>=s;)i.set(s,d),a+=1,s=n[a];if(a>=n.length)break}}for(const d of n)i.has(d)||i.set(d,c.length);return i}getLineIndexFromDOMNode(e){const t=e.dataset.lineIndex;if(t==null)return;const n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(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==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){const{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const i=this.cachedHeaderHTML??qi(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const d=document.createElement("div");d.innerHTML=i;const f=d.firstElementChild;if(!(f instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(f,this.headerElement):t.shadowRoot?.prepend(f),this.headerElement=f,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:a,renderCustomHeader:s,renderHeaderMetadata:c}=this.options;if(s!=null){const d=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Cc,d),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{const d=a?.(n)??void 0,f=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,bg,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Sg,f),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const a=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(a),this.replaceHeaderSlotContent(a,i),a}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}getOrCreateFileContainerNode(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),a=n!==i;return a&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&a&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),a&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:hc(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):hc(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=JC;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(const t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){const{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,a={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};eE(a,this.appliedPreAttributes)||(dE(e,a),this.appliedPreAttributes=a)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const a=document.createElement("pre");a.dataset.errorStack="",a.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function V6(e,t,n=!1){return!n&&e==null&&t!=null}function B6(e,t,n=!1){return e==null&&t!=null&&!n}const U6=5e3;let F6=-1;function j6(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var $6=class extends z6{virtualizer;metrics;__id=`virtualized-file:${++F6}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=_g,i,a=!1){super(e,i,a),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&vs(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!pf(t,e),i=j6(t,e);super.setOptions(e),i&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;const i=Gm(this.lineAnnotations);if(this.renderRange!=null&&i&&mf(this.renderRange)){const a=q6(n)??0;a!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=a,e=!0)}else!i&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const a of n.children){if(!(a instanceof HTMLElement))continue;const s=a.dataset.lineIndex;if(s==null)continue;const c=Number(s);let d=a.getBoundingClientRect().height,f=!1;a.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in a.nextElementSibling.dataset||"noNewline"in a.nextElementSibling.dataset)&&("noNewline"in a.nextElementSibling.dataset&&(f=!0),d+=a.nextElementSibling.getBoundingClientRect().height);const h=this.getLineHeight(c,f);d!==h&&(e=!0,d===this.metrics.lineHeight*(f?2:1)?this.cache.heights.delete(c):this.cache.heights.set(c,d))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,i){const a=this.syncLineAnnotations(i);let s=n?.resetFileLayoutCache===!0||a;n?.metrics!=null&&(this.metrics=n.metrics,s=!0);const{collapsed:c=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,s=!0),s&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=qb(this.getOrCreateLineCache(this.file));let a=ji(this.metrics,t);if(n||i<0)return{top:a,height:0};const s=Math.min(Math.max(e-1,0),i),{overflow:c="scroll"}=this.options,{lineHeight:d}=this.metrics;if(a+=this.cache.fileAnnotationHeight,c==="scroll"&&!this.hasLineAnnotations())return{top:a+s*d,height:d};const f=this.getLayoutCheckpointBeforeLineIndex(s);a=f?.top??a;for(let h=f?.lineIndex??0;h<s;h++)a+=this.getLineHeight(h,!1);return{top:a,height:this.getLineHeight(s,!1)}}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:i="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const a=qb(this.getOrCreateLineCache(this.file));if(a<0)return;const s=ji(this.metrics,t),c=Math.min(this.renderRange.startingLine,a),d=Math.min(c+this.renderRange.totalLines-1,a);if(d<c)return;const{fileAnnotationHeight:f}=this.cache;if(i==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:m}=this.metrics,g=s+(c===0?f:this.renderRange.bufferBefore),y=c+Math.max(Math.ceil((e-g)/m),0);return y>d?void 0:{lineNumber:y+1,top:s+f+y*m}}let h=s+(c===0?f:this.renderRange.bufferBefore);for(let m=c;m<=d;m++){if(h>=e)return{lineNumber:m+1,top:h};h+=this.getLineHeight(m)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:a}=t;let s=0;if(a===0){const c=e??this.virtualizer.getWindowSpecs();this.top<c.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.file==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:a=!1,overflow:s="scroll"}=this.options,{lineHeight:c}=this.metrics,d=this.getOrCreateLineCache(this.file),f=ji(this.metrics,i),h=$d(this.metrics);if(this.height+=f,a){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,s==="scroll"&&!this.hasLineAnnotations()?this.height+=this.getOrCreateLineCache(this.file).length*c:Fd({lines:d,callback:({lineIndex:m})=>{this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1)}}),d.length>0&&(this.height+=h),this.fileContainer!=null&&t&&!n){const m=this.fileContainer.getBoundingClientRect();m.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:m.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:i,...a}){const{forceRenderOverride:s,isSetup:c}=this;this.forceRenderOverride=void 0;const d=this.syncLineAnnotations(i);if(d&&this.resetLayoutCache(),this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(c)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const g=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(g==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");g.connect(e,this),this.isVisible=g.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const f=this.virtualizer.getWindowSpecs(),h=this.top??0,m=this.computeRenderRangeFromWindow(this.file,h,f);return super.render({file:this.file,fileContainer:e,renderRange:m,lineAnnotations:i,forceRender:(s??n)||d,...a})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%U6===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(i=s,t=a+1):n=a-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFile: invalid checkpoint index");c.top<=e?(a=s,n=s+1):i=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(c.lineIndex%t===0)return c}}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:a=!1,overflow:s="scroll"}=this.options,{hunkLineCount:c,lineHeight:d}=this.metrics,f=this.getOrCreateLineCache(e),h=f.length,m=this.height,g=ji(this.metrics,a),y=h>0?$d(this.metrics):0,{fileAnnotationHeight:b}=this.cache,S=g+b,w=Math.max(0,m-g-b-y),A=Gm(this.lineAnnotations),k=t+g,E=b>0&&A&&k<i&&k+b>n;if(t<n-m||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};if(h<=c)return{startingLine:0,totalLines:c,bufferBefore:0,bufferAfter:0};const T=Math.ceil(Math.max(i-n,0)/d),L=Math.ceil(T/c)*c+c*2,O=L/c,D=(n+i)/2;if(s==="scroll"&&!this.hasLineAnnotations()){const ae=t+S,he=ae+w;if(!E&&!(ae<i&&he>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};const Se=Math.floor(E&&D<t+S?0:(D-(t+S))/d),be=Math.floor(Se/c)-Math.floor(O/2),Ue=Math.ceil(h/c),Ce=Math.max(0,Math.min(be,Ue))*c,He=be<0?L+be*c:L,We=Ce===0?0:b+Ce*d,lt=Math.min(He,h-Ce);return{startingLine:Ce,totalLines:He,bufferBefore:We,bufferAfter:Math.max(0,(h-Ce-lt)*d)}}const N=O,W=[],G=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-L*d*2),c);let se=t+(G?.top??S),ie=G?.lineIndex??0,ee,te,le;if(Fd({lines:f,startingLine:G?.lineIndex??0,callback:({lineIndex:ae})=>{const he=ie%c===0,Se=Math.floor(ie/c);if(he&&(W[Se]=se-(t+S),le!=null)){if(le<=0)return!0;le--}const be=this.getLineHeight(ae,!1);return se>n-be&&se<i&&(ee??=Se),se+be>D&&(te??=Se),le==null&&se>=i&&he&&(le=N),ie++,se+=be,!1}}),ee==null)if(E)ee=0,te=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};te??=ee;const me=Math.round(te-O/2),H=Math.max(0,Math.ceil(h/c)-O),z=Math.max(0,Math.min(me,H)),Q=z*c,ce=me<0?L+me*c:L,_e=W[z]??0,M=Q===0?0:b+_e,q=z+ce/c,re=q<W.length?w-W[q]:w-(se-t-S);return{startingLine:Q,totalLines:ce,bufferBefore:M,bufferAfter:Math.max(0,re)}}};function q6(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===qC&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function qb(e){const t=e.at(-1);return t==null||t===""||t===`
1565
+ }`}function lE(e,t){const n=rE(t);return e.replace(M6,n)}function O6(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function $b(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Sd({code:e,pre:t,columnType:n,rowSpan:i,containerSize:a=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),a?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function cE({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=P6(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function P6(){const e=document.createElement("style");return e.setAttribute(vx,""),e}function uE(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function dE(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:a,overflow:s,split:c,totalLines:d,customProperties:f}){if(f!=null)for(const h in f){const m=f[h];m!=null&&e.setAttribute(h,`${m}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return a?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",c?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",s),e.style.setProperty("--diffs-min-number-column-width-default",`${`${d}`.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;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(D6)),i.adoptedStyleSheets=[e]}connectedCallback(){pc(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(W_,t)}const N6=[];let H6=-1;var z6=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++H6}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(e={theme:xt},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new L6(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new WC,this.interactionManager=new GC("file",qd(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(qd(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ua(this.appliedThemeCSS.theme,this.options.theme??xt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e==="wrap"),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:a,lineAnnotations:s}=e;this.hydrateElements(t,n),V6(this.pre,a,this.options.collapsed)||B6(this.headerElement,a,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:a,lineAnnotations:s}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),uE(e,t);for(const n of Array.from(e.shadowRoot?.children??[])){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n,this.appliedPreAttributes=void 0;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}if("diffsHeader"in n.dataset){this.headerElement=n,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions($b(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e!=null?this.fileRenderer.getOrCreateLineCache(e):N6}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:i=!1,containerWrapper:a,deferManagers:s=!1,lineAnnotations:c,renderRange:d}){const{collapsed:f=!1,themeType:h="system"}=this.options;if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const m=f?void 0:d,g=this.renderRange,y=this.hasThemeChanged(),b=c!=null&&(c.length>0||this.lineAnnotations.length>0)?c!==this.lineAnnotations:!1,S=!vo(this.file,e);if(!f&&!n&&gf(m,this.renderRange)&&!S&&!b&&!y)return this.applyCachedThemeState(h);this.renderRange=m,S&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions($b(this.options)),this.syncInteractionOptions(),c!=null&&this.setLineAnnotations(c),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:w=!1,disableFileHeader:A=!1}=this.options;if(A&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,a),this.applyCachedThemeState(h),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const k=this.fileRenderer.renderFile(e,X_);k!=null&&this.applyThemeState(t,k.themeStyles,h,k.baseThemeType),k?.headerAST!=null&&this.applyHeaderToDOM(k.headerAST,t),this.injectUnsafeCSS()}catch(k){if(w)throw k;console.error(k),k instanceof Error&&this.applyErrorToDOM(k,t)}return i||this.emitPostRender(),!0}try{const k=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,b,S||y)||!this.applyPartialRender(g,m)){const E=this.fileRenderer.renderFile(e,m);if(E==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,E.themeStyles,h,E.baseThemeType),E.headerAST!=null&&this.applyHeaderToDOM(E.headerAST,t),this.applyFullRender(E,k)}this.applyBuffers(k,m),this.injectUnsafeCSS(),this.managersDirty=!0,s||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(k){if(w)throw k;console.error(k),k instanceof Error&&this.applyErrorToDOM(k,t)}return i||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{file:e,workerManager:t}=this;e==null||e.cacheKey==null||t==null||cc(e)||this.fileRenderer.getOrCreateLineCache(e).length>(this.options.tokenizeMaxLength??1e5)||t.primeFileHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const a=`${n}-${ki(i)}`;let s=this.annotationCache.get(a);if(s==null||!I6(i,s.annotation)){s?.element.remove();const c=t(i);if(c==null)continue;s={element:tE(ki(i)),annotation:i},s.element.appendChild(c),this.fileContainer.appendChild(s.element),this.annotationCache.set(a,s)}e.delete(a)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=nE();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){const{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??=iE(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=aE(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const a=e.shadowRoot??e.attachShadow({mode:"open"}),s=i??n,c=this.options.theme??xt,d=typeof c=="string"?c:{...c},f=pc(a);if(this.themeCSSStyle?.parentNode===a&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===a){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f};return}this.themeCSSStyle=cE({shadowRoot:a,currentNode:this.themeCSSStyle,themeCSS:sE(t,s,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lE(this.themeCSSStyle.textContent??"",pc(e)))}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=Sd({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;const{file:n,code:i}=this,a=i!=null?this.getColumns(i):void 0;if(n==null||i==null||a==null)return!1;const s=e.startingLine,c=t.startingLine,d=e.totalLines===1/0?Number.POSITIVE_INFINITY:s+e.totalLines,f=t.totalLines===1/0?Number.POSITIVE_INFINITY:c+t.totalLines,h=Math.max(s,c),m=Math.min(d,f);if(m<=h||!this.trimDOMToOverlap(a.gutter,h,m)||!this.trimDOMToOverlap(a.content,h,m))return!1;let{length:g}=a.content.children;const y=(A,k)=>{if(!(k<=0))return this.fileRenderer.renderFile(n,{startingLine:A,totalLines:k,bufferBefore:0,bufferAfter:0})},b=c<h?y(c,h-c):void 0;if(b===void 0&&c<h)return!1;const S=f===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,f-m),w=f>m?y(m,S):void 0;return w===void 0&&f>m?!1:(this.cleanupErrorWrapper(),b!=null&&(a.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(b.gutterAST)),a.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(b.contentAST)),g+=b.rowCount),w!=null&&(a.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.gutterAST)),a.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(w.contentAST)),g+=w.rowCount),this.lastRowCount!==g&&(a.gutter.style.setProperty("grid-row",`span ${g}`),a.content.style.setProperty("grid-row",`span ${g}`),this.lastRowCount=g),!0)}getColumns(e){const t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){const i=this.getDOMBoundaryIndices(e,[t,n]),a=i.get(t)??e.children.length,s=i.get(n)??e.children.length;if(a>s)return!1;for(let c=e.children.length-1;c>=s;c-=1)e.children[c]?.remove();for(let c=a-1;c>=0;c-=1)e.children[c]?.remove();return!0}getDOMBoundaryIndices(e,t){const n=[...new Set(t)].sort((d,f)=>d-f),i=new Map;if(n.length===0)return i;let a=0,s=n[a];const{children:c}=e;s===0&&(i.set(0,0),a+=1,s=n[a]);for(let d=0;d<c.length;d+=1){const f=c[d];if(!(f instanceof HTMLElement))continue;const h=this.getLineIndexFromDOMNode(f);if(h!=null){for(;s!=null&&h>=s;)i.set(s,d),a+=1,s=n[a];if(a>=n.length)break}}for(const d of n)i.has(d)||i.set(d,c.length);return i}getLineIndexFromDOMNode(e){const t=e.dataset.lineIndex;if(t==null)return;const n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(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==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){const{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const i=this.cachedHeaderHTML??qi(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const d=document.createElement("div");d.innerHTML=i;const f=d.firstElementChild;if(!(f instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(f,this.headerElement):t.shadowRoot?.prepend(f),this.headerElement=f,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:a,renderCustomHeader:s,renderHeaderMetadata:c}=this.options;if(s!=null){const d=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Cc,d),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{const d=a?.(n)??void 0,f=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,bg,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Sg,f),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const a=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(a),this.replaceHeaderSlotContent(a,i),a}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}getOrCreateFileContainerNode(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),a=n!==i;return a&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&a&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),a&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:hc(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):hc(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=JC;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(const t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){const{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,a={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};eE(a,this.appliedPreAttributes)||(dE(e,a),this.appliedPreAttributes=a)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const a=document.createElement("pre");a.dataset.errorStack="",a.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function V6(e,t,n=!1){return!n&&e==null&&t!=null}function B6(e,t,n=!1){return e==null&&t!=null&&!n}const U6=5e3;let F6=-1;function j6(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var $6=class extends z6{virtualizer;metrics;__id=`virtualized-file:${++F6}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=_g,i,a=!1){super(e,i,a),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&vs(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache()}syncLineAnnotations(e){return e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(e),!0)}hasLineAnnotations(){return this.lineAnnotations.some(e=>e.lineNumber>0)}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!pf(t,e),i=j6(t,e);super.setOptions(e),i&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;const i=Gm(this.lineAnnotations);if(this.renderRange!=null&&i&&mf(this.renderRange)){const a=q6(n)??0;a!==this.cache.fileAnnotationHeight&&(this.cache.fileAnnotationHeight=a,e=!0)}else!i&&this.cache.fileAnnotationHeight!==0&&(this.cache.fileAnnotationHeight=0,e=!0);for(const a of n.children){if(!(a instanceof HTMLElement))continue;const s=a.dataset.lineIndex;if(s==null)continue;const c=Number(s);let d=a.getBoundingClientRect().height,f=!1;a.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in a.nextElementSibling.dataset||"noNewline"in a.nextElementSibling.dataset)&&("noNewline"in a.nextElementSibling.dataset&&(f=!0),d+=a.nextElementSibling.getBoundingClientRect().height);const h=this.getLineHeight(c,f);d!==h&&(e=!0,d===this.metrics.lineHeight*(f?2:1)?this.cache.heights.delete(c):this.cache.heights.set(c,d))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n,i){const a=this.syncLineAnnotations(i);let s=n?.resetFileLayoutCache===!0||a;n?.metrics!=null&&(this.metrics=n.metrics,s=!0);const{collapsed:c=!1}=this.options;return this.currentCollapsed!==c&&(this.currentCollapsed=c,s=!0),s&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=qb(this.getOrCreateLineCache(this.file));let a=ji(this.metrics,t);if(n||i<0)return{top:a,height:0};const s=Math.min(Math.max(e-1,0),i),{overflow:c="scroll"}=this.options,{lineHeight:d}=this.metrics;if(a+=this.cache.fileAnnotationHeight,c==="scroll"&&!this.hasLineAnnotations())return{top:a+s*d,height:d};const f=this.getLayoutCheckpointBeforeLineIndex(s);a=f?.top??a;for(let h=f?.lineIndex??0;h<s;h++)a+=this.getLineHeight(h,!1);return{top:a,height:this.getLineHeight(s,!1)}}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:i="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const a=qb(this.getOrCreateLineCache(this.file));if(a<0)return;const s=ji(this.metrics,t),c=Math.min(this.renderRange.startingLine,a),d=Math.min(c+this.renderRange.totalLines-1,a);if(d<c)return;const{fileAnnotationHeight:f}=this.cache;if(i==="scroll"&&!this.hasLineAnnotations()){const{lineHeight:m}=this.metrics,g=s+(c===0?f:this.renderRange.bufferBefore),y=c+Math.max(Math.ceil((e-g)/m),0);return y>d?void 0:{lineNumber:y+1,top:s+f+y*m}}let h=s+(c===0?f:this.renderRange.bufferBefore);for(let m=c;m<=d;m++){if(h>=e)return{lineNumber:m+1,top:h};h+=this.getLineHeight(m)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:a}=t;let s=0;if(a===0){const c=e??this.virtualizer.getWindowSpecs();this.top<c.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache(),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.file==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:a=!1,overflow:s="scroll"}=this.options,{lineHeight:c}=this.metrics,d=this.getOrCreateLineCache(this.file),f=ji(this.metrics,i),h=$d(this.metrics);if(this.height+=f,a){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,s==="scroll"&&!this.hasLineAnnotations()?this.height+=this.getOrCreateLineCache(this.file).length*c:Fd({lines:d,callback:({lineIndex:m})=>{this.addLayoutCheckpoint(m,this.height),this.height+=this.getLineHeight(m,!1)}}),d.length>0&&(this.height+=h),this.fileContainer!=null&&t&&!n){const m=this.fileContainer.getBoundingClientRect();m.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:m.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}render({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:i,...a}){const{forceRenderOverride:s,isSetup:c}=this;this.forceRenderOverride=void 0;const d=this.syncLineAnnotations(i);if(d&&this.resetLayoutCache(),this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(c)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const g=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(g==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");g.connect(e,this),this.isVisible=g.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const f=this.virtualizer.getWindowSpecs(),h=this.top??0,m=this.computeRenderRangeFromWindow(this.file,h,f);return super.render({file:this.file,fileContainer:e,renderRange:m,lineAnnotations:i,forceRender:(s??n)||d,...a})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%U6===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.lineIndex<=e?(i=s,t=a+1):n=a-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFile: invalid checkpoint index");c.top<=e?(a=s,n=s+1):i=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFile: invalid checkpoint index");if(c.lineIndex%t===0)return c}}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:a=!1,overflow:s="scroll"}=this.options,{hunkLineCount:c,lineHeight:d}=this.metrics,f=this.getOrCreateLineCache(e),h=f.length,m=this.height,g=ji(this.metrics,a),y=h>0?$d(this.metrics):0,{fileAnnotationHeight:b}=this.cache,S=g+b,w=Math.max(0,m-g-b-y),A=Gm(this.lineAnnotations),k=t+g,E=b>0&&A&&k<i&&k+b>n;if(t<n-m||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};if(h<=c)return{startingLine:0,totalLines:c,bufferBefore:0,bufferAfter:0};const T=Math.ceil(Math.max(i-n,0)/d),L=Math.ceil(T/c)*c+c*2,O=L/c,D=(n+i)/2;if(s==="scroll"&&!this.hasLineAnnotations()){const ae=t+S,he=ae+w;if(!E&&!(ae<i&&he>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};const Se=Math.floor(E&&D<t+S?0:(D-(t+S))/d),be=Math.floor(Se/c)-Math.floor(O/2),Ue=Math.ceil(h/c),Ce=Math.max(0,Math.min(be,Ue))*c,He=be<0?L+be*c:L,We=Ce===0?0:b+Ce*d,lt=Math.min(He,h-Ce);return{startingLine:Ce,totalLines:He,bufferBefore:We,bufferAfter:Math.max(0,(h-Ce-lt)*d)}}const N=O,K=[],G=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-L*d*2),c);let se=t+(G?.top??S),ie=G?.lineIndex??0,ee,te,le;if(Fd({lines:f,startingLine:G?.lineIndex??0,callback:({lineIndex:ae})=>{const he=ie%c===0,Se=Math.floor(ie/c);if(he&&(K[Se]=se-(t+S),le!=null)){if(le<=0)return!0;le--}const be=this.getLineHeight(ae,!1);return se>n-be&&se<i&&(ee??=Se),se+be>D&&(te??=Se),le==null&&se>=i&&he&&(le=N),ie++,se+=be,!1}}),ee==null)if(E)ee=0,te=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-g-y};te??=ee;const me=Math.round(te-O/2),H=Math.max(0,Math.ceil(h/c)-O),z=Math.max(0,Math.min(me,H)),Q=z*c,ce=me<0?L+me*c:L,_e=K[z]??0,M=Q===0?0:b+_e,q=z+ce/c,re=q<K.length?w-K[q]:w-(se-t-S);return{startingLine:Q,totalLines:ce,bufferBefore:M,bufferAfter:Math.max(0,re)}}};function q6(e){let t;for(const n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===qC&&(t=Math.max(t??0,n.getBoundingClientRect().height));return t}function qb(e){const t=e.at(-1);return t==null||t===""||t===`
1566
1566
  `||t===`\r
1567
1567
  `||t==="\r"?e.length-2:e.length-1}function G6({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:a,expandedHunks:s,collapsedContextThreshold:c}){let d=ji(t,n),f=d;const h=a?!0:s,m=e.hunks.length-1;for(let g=0;g<e.hunks.length;g++){const y=e.hunks[g];if(y==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const b=dc({isPartial:e.isPartial,rangeSize:y.collapsedBefore,expandedHunks:h,hunkIndex:g,collapsedContextThreshold:c}),S=(b.fromStart+b.fromEnd)*t.lineHeight;if(d+=S,f+=S,b.collapsedLines>0){const k=Ul({type:i,metrics:t,hunkIndex:g,hunkSpecs:y.hunkSpecs})?.totalHeight??0;d+=k,f+=k}d+=y.splitLineCount*t.lineHeight,f+=y.unifiedLineCount*t.lineHeight;const w=W6(y);d+=w.split*t.lineHeight,f+=w.unified*t.lineHeight;const A=g===m?fc({fileDiff:e,hunkIndex:g,expandedHunks:h,collapsedContextThreshold:c,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(A!=null){const k=(A.fromStart+A.fromEnd)*t.lineHeight;if(d+=k,f+=k,A.collapsedLines>0){const E=Fl({type:i,metrics:t})?.totalHeight??0;d+=E,f+=E}}}if(e.hunks.length>0){const g=$d(t);d+=g,f+=g}return{splitHeight:d,unifiedHeight:f}}function W6(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const n=t.lines>0?1:0;return{split:n,unified:n}}return K6(e,t)}function K6(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,a=t.additions>0&&e.noEOFCRAdditions;return{split:i||a?1:0,unified:n}}const Y6=new TextEncoder,X6=new TextDecoder("utf-8",{ignoreBOM:!0}),Q6=/[\uD800-\uDFFF]/,Ym=1024;let fs=new Uint8Array(Ym);function fE(){fs.length!==Ym&&(fs=new Uint8Array(Ym))}function jt(e){if(e.length===0)return e;if(Q6.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;fs.length<t&&(fs=new Uint8Array(t));const{written:n}=Y6.encodeInto(e,fs);return X6.decode(fs.subarray(0,n))}function Z6(e,t,n){try{return J6(e,t,n)}finally{fE()}}function J6(e,t,n=!1){const i=cL(e),a=i?iL(e):rL(e);let s;const c=[];for(const d of a){if(i&&!K_.test(d)){if(s==null)s=jt(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}else if(!i&&!oL(d)){if(s==null)s=jt(d);else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",d)}continue}const f=hE(d,{cacheKey:t!=null?`${t}-${c.length}`:void 0,isGitDiff:i,throwOnError:n});f!=null&&c.push(f)}return{patchMetadata:s,files:c}}function eL(e,t){try{return hE(e,t)}finally{fE()}}function hE(e,{cacheKey:t,isGitDiff:n=K_.test(e),oldFile:i,newFile:a,throwOnError:s=!1}={}){let c=0;const d=vE(e,"@@ ");let f;const h=i==null||a==null;let m=0,g=0;for(const y of d){const b=pE(y),S=b[0];if(S==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",y);continue}const w=gE(S);let A=0,k=0;if(w==null||f==null){if(f!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",y);continue}f={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:h,additionLines:!h&&i!=null&&a!=null?Gb(a.contents):[],deletionLines:!h&&i!=null&&a!=null?Gb(i.contents):[],cacheKey:Yb(t)},f.additionLines.length===1&&a?.contents===""&&(f.additionLines.length=0),f.deletionLines.length===1&&i?.contents===""&&(f.deletionLines.length=0);for(const G of b){if(G.startsWith("diff --git")){const ie=G.trim().match(mx),ee=ie?.[1]??ie?.[2],te=ie?.[3]??ie?.[4];if(ee==null||te==null){if(s)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",G);continue}f.name=jt(te.trim()),ee!==te&&(f.prevName=jt(ee.trim()));continue}const se=G.startsWith("---")||G.startsWith("+++")?G.match(n?px:hx):null;if(se!=null){const[,ie,ee]=se;if(ie==="---"&&ee!=="/dev/null"){const te=jt(ee.trim());f.prevName=te,f.name=te}else ie==="+++"&&ee!=="/dev/null"&&(f.name=jt(ee.trim()))}else if(n){if(G.startsWith("new mode ")&&(f.mode=jt(G.slice(8).trim())),G.startsWith("old mode ")&&(f.prevMode=jt(G.slice(8).trim())),G.startsWith("new file mode")&&(f.type="new",f.mode=jt(G.slice(13).trim())),G.startsWith("deleted file mode")&&(f.type="deleted",f.mode=jt(G.slice(17).trim())),G.startsWith("similarity index")&&(G.startsWith("similarity index 100%")?f.type="rename-pure":f.type="rename-changed"),G.startsWith("index ")){const[,ie,ee,te]=G.trim().match(gx)??[];ie!=null&&(f.prevObjectId=jt(ie)),ee!=null&&(f.newObjectId=jt(ee)),te!=null&&(f.mode=jt(te))}G.startsWith("rename from ")&&(f.prevName=jt(G.slice(12).trim())),G.startsWith("rename to ")&&(f.name=jt(G.slice(10).trim()))}}continue}let E,T;for(;b.length>0&&(b[b.length-1]===`
1568
1568
  `||b[b.length-1]==="\r"||b[b.length-1]===`\r
1569
- `||b[b.length-1]==="");)b.pop();const{additionStart:L,deletionStart:O}=w;m=h?m:O-1,g=h?g:L-1;const D={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:w.additionCount,additionStart:L,additionLines:A,deletionCount:w.deletionCount,deletionStart:O,deletionLines:k,deletionLineIndex:m,additionLineIndex:g,hunkContent:[],hunkContext:Yb(w.hunkContext),hunkSpecs:jt(S),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let N=0,W=0;for(let G=1;G<b.length;G++){const se=b[G];if(N>=D.additionCount&&W>=D.deletionCount&&!se.startsWith("\\")){if(s&&aL(se)&&!sL(se))throw Error("parsePatchContent: hunk has more lines than expected");break}const ie=se[0];if(ie!=="+"&&ie!=="-"&&ie!==" "&&ie!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${ie}", full line: "${se}"`),console.error("processFile: invalid rawLine:",se);continue}const ee=uL(ie);if(ee==="addition"){if(s&&N>=D.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const te=nm(se);(E==null||E.type!=="change")&&(E=im("change",m,g),D.hunkContent.push(E)),g++,N++,h&&f.additionLines.push(te),E.additions++,A++,T="addition"}else if(ee==="deletion"){if(s&&W>=D.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const te=nm(se);(E==null||E.type!=="change")&&(E=im("change",m,g),D.hunkContent.push(E)),m++,W++,h&&f.deletionLines.push(te),E.deletions++,k++,T="deletion"}else if(ee==="context"){if(s&&(W>=D.deletionCount||N>=D.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const te=nm(se);(E==null||E.type!=="context")&&(E=im("context",m,g),D.hunkContent.push(E)),g++,m++,N++,W++,h&&(f.deletionLines.push(te),f.additionLines.push(te)),E.lines++,T="context"}else if(ee==="metadata"&&E!=null){if(E.type==="context"?(D.noEOFCRAdditions=!0,D.noEOFCRDeletions=!0):T==="deletion"?D.noEOFCRDeletions=!0:T==="addition"&&(D.noEOFCRAdditions=!0),h&&(T==="addition"||T==="context")){const te=f.additionLines.length-1;te>=0&&(f.additionLines[te]=sa(f.additionLines[te]))}if(h&&(T==="deletion"||T==="context")){const te=f.deletionLines.length-1;te>=0&&(f.deletionLines[te]=sa(f.deletionLines[te]))}}}if(s&&(N!==D.additionCount||W!==D.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");D.additionLines=A,D.deletionLines=k,D.collapsedBefore=Math.max(D.additionStart-1-c,0),f.hunks.push(D),c=D.additionStart+D.additionCount-1;for(const G of D.hunkContent)G.type==="context"?(D.splitLineCount+=G.lines,D.unifiedLineCount+=G.lines):(D.splitLineCount+=Math.max(G.additions,G.deletions),D.unifiedLineCount+=G.deletions+G.additions);D.splitLineStart=f.splitLineCount+D.collapsedBefore,D.unifiedLineStart=f.unifiedLineCount+D.collapsedBefore,f.splitLineCount+=D.collapsedBefore+D.splitLineCount,f.unifiedLineCount+=D.collapsedBefore+D.unifiedLineCount}if(f!=null){if(s&&h&&!n&&f.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(f.hunks.length>0&&!h&&f.additionLines.length>0&&f.deletionLines.length>0){const y=f.hunks[f.hunks.length-1],b=y.additionStart+y.additionCount-1,S=f.additionLines.length,w=Math.max(S-b,0);f.splitLineCount+=w,f.unifiedLineCount+=w}return n||(f.prevName!=null&&f.name!==f.prevName?f.hunks.length>0?f.type="rename-changed":f.type="rename-pure":(i==null||i.contents==="")&&a!=null&&a.contents!==""?f.type="new":i!=null&&i.contents!==""&&(a==null||a.contents==="")&&(f.type="deleted")),f.type!=="rename-pure"&&f.type!=="rename-changed"&&(f.prevName=void 0),f}}function tL(e,t,n=!1){const i=[],a=nL(e)?e.split(dx):[e];for(const s of a)try{i.push(Z6(s,t!=null?`${t}-${i.length}`:void 0,n))}catch(c){if(n)throw c;console.error(c)}return i}function nL(e){return e.startsWith("From ")||e.includes(`
1569
+ `||b[b.length-1]==="");)b.pop();const{additionStart:L,deletionStart:O}=w;m=h?m:O-1,g=h?g:L-1;const D={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:w.additionCount,additionStart:L,additionLines:A,deletionCount:w.deletionCount,deletionStart:O,deletionLines:k,deletionLineIndex:m,additionLineIndex:g,hunkContent:[],hunkContext:Yb(w.hunkContext),hunkSpecs:jt(S),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let N=0,K=0;for(let G=1;G<b.length;G++){const se=b[G];if(N>=D.additionCount&&K>=D.deletionCount&&!se.startsWith("\\")){if(s&&aL(se)&&!sL(se))throw Error("parsePatchContent: hunk has more lines than expected");break}const ie=se[0];if(ie!=="+"&&ie!=="-"&&ie!==" "&&ie!=="\\"){if(s)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${ie}", full line: "${se}"`),console.error("processFile: invalid rawLine:",se);continue}const ee=uL(ie);if(ee==="addition"){if(s&&N>=D.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const te=nm(se);(E==null||E.type!=="change")&&(E=im("change",m,g),D.hunkContent.push(E)),g++,N++,h&&f.additionLines.push(te),E.additions++,A++,T="addition"}else if(ee==="deletion"){if(s&&K>=D.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const te=nm(se);(E==null||E.type!=="change")&&(E=im("change",m,g),D.hunkContent.push(E)),m++,K++,h&&f.deletionLines.push(te),E.deletions++,k++,T="deletion"}else if(ee==="context"){if(s&&(K>=D.deletionCount||N>=D.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const te=nm(se);(E==null||E.type!=="context")&&(E=im("context",m,g),D.hunkContent.push(E)),g++,m++,N++,K++,h&&(f.deletionLines.push(te),f.additionLines.push(te)),E.lines++,T="context"}else if(ee==="metadata"&&E!=null){if(E.type==="context"?(D.noEOFCRAdditions=!0,D.noEOFCRDeletions=!0):T==="deletion"?D.noEOFCRDeletions=!0:T==="addition"&&(D.noEOFCRAdditions=!0),h&&(T==="addition"||T==="context")){const te=f.additionLines.length-1;te>=0&&(f.additionLines[te]=sa(f.additionLines[te]))}if(h&&(T==="deletion"||T==="context")){const te=f.deletionLines.length-1;te>=0&&(f.deletionLines[te]=sa(f.deletionLines[te]))}}}if(s&&(N!==D.additionCount||K!==D.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");D.additionLines=A,D.deletionLines=k,D.collapsedBefore=Math.max(D.additionStart-1-c,0),f.hunks.push(D),c=D.additionStart+D.additionCount-1;for(const G of D.hunkContent)G.type==="context"?(D.splitLineCount+=G.lines,D.unifiedLineCount+=G.lines):(D.splitLineCount+=Math.max(G.additions,G.deletions),D.unifiedLineCount+=G.deletions+G.additions);D.splitLineStart=f.splitLineCount+D.collapsedBefore,D.unifiedLineStart=f.unifiedLineCount+D.collapsedBefore,f.splitLineCount+=D.collapsedBefore+D.splitLineCount,f.unifiedLineCount+=D.collapsedBefore+D.unifiedLineCount}if(f!=null){if(s&&h&&!n&&f.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(f.hunks.length>0&&!h&&f.additionLines.length>0&&f.deletionLines.length>0){const y=f.hunks[f.hunks.length-1],b=y.additionStart+y.additionCount-1,S=f.additionLines.length,w=Math.max(S-b,0);f.splitLineCount+=w,f.unifiedLineCount+=w}return n||(f.prevName!=null&&f.name!==f.prevName?f.hunks.length>0?f.type="rename-changed":f.type="rename-pure":(i==null||i.contents==="")&&a!=null&&a.contents!==""?f.type="new":i!=null&&i.contents!==""&&(a==null||a.contents==="")&&(f.type="deleted")),f.type!=="rename-pure"&&f.type!=="rename-changed"&&(f.prevName=void 0),f}}function tL(e,t,n=!1){const i=[],a=nL(e)?e.split(dx):[e];for(const s of a)try{i.push(Z6(s,t!=null?`${t}-${i.length}`:void 0,n))}catch(c){if(n)throw c;console.error(c)}return i}function nL(e){return e.startsWith("From ")||e.includes(`
1570
1570
  From `)}function Gb(e){const t=pE(e);for(let n=0;n<t.length;n++)t[n]=jt(t[n]);return t}function pE(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const i=e.indexOf(`
1571
1571
  `,n);if(i===-1)break;t.push(e.slice(n,i+1)),n=i+1}return n<e.length&&t.push(e.slice(n)),t}function iL(e){return vE(e,"diff --git")}function rL(e){if(e.length===0)return[""];const t=[];let n=0,i=0,a=0,s=0,c=!1;for(;i<e.length;){const d=Xm(e,i);if(a<=0&&s<=0){if(mE(e,i)){i>n&&t.push(e.slice(n,i)),n=i,c=!0,i=Xm(e,d);continue}if(c&&e.startsWith("@@ -",i)){const h=gE(e.slice(i,d));h!=null&&(a=h.deletionCount,s=h.additionCount)}i=d;continue}const f=e[i];if(f==="\\"){i=d;continue}f===" "?(a=Math.max(a-1,0),s=Math.max(s-1,0)):f==="-"?a=Math.max(a-1,0):f==="+"&&(s=Math.max(s-1,0)),i=d}return t.push(e.slice(n)),t}function oL(e){return mE(e,0)}function mE(e,t){const n=Xm(e,t);return Wb(e,t,"---")&&Wb(e,n,"+++")}function Wb(e,t,n){if(!e.startsWith(n,t))return!1;const i=e[t+n.length];if(i!==" "&&i!==" ")return!1;for(let a=t+n.length+1;a<e.length;a++){const s=e[a];if(s===`
1572
1572
  `||s==="\r")break;if(s!==" "&&s!==" ")return!0}return!1}function Xm(e,t){const n=e.indexOf(`
@@ -1576,7 +1576,7 @@ From `)}function Gb(e){const t=pE(e);for(let n=0;n<t.length;n++)t[n]=jt(t[n]);re
1576
1576
  `)?e.slice(0,-1):e}function cL(e){return e.startsWith("diff --git")||e.includes(`
1577
1577
  diff --git`)}function vE(e,t){if(e.length===0)return[""];const n=`
1578
1578
  ${t}`,i=e.startsWith(t)?0:Kb(e,n,0);if(i===-1)return[e];const a=[];i>0&&a.push(e.slice(0,i));let s=i;for(;;){const c=Kb(e,n,s+1);if(c===-1)break;a.push(e.slice(s,c)),s=c}return a.push(e.slice(s)),a}function Kb(e,t,n){const i=e.indexOf(t,n);return i===-1?-1:i+1}function Yb(e){return e==null?e:jt(e)}function uL(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function nm(e){const t=e.slice(1);return jt(t===""?`
1579
- `:t)}function im(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}function Qm(e,t,n,i=!1){const a=eL(W8(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(a==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(a.lang=t.lang),a}var dL=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,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));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 ad(e){return Ne({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function sd(e){return Ne({tagName:"div",children:[Ne({tagName:"span",children:[Gi("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function rm(e){return Ne({tagName:"div",children:[jd({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 os({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:a,isFirstHunk:s,isLastHunk:c}){let d=0;const f=[];if(e==="metadata"&&t!=null&&f.push(Ne({tagName:"div",children:[Gi(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];n!=null&&(i?(s||(h.push(rm("up")),d++),c||(h.push(rm("down")),d++)):(h.push(rm(!s&&!c?"both":s?"down":"up")),d++)),h.push(Ne({tagName:"div",children:[Ne({tagName:"span",children:[Gi(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&h.push(Ne({tagName:"div",children:[Gi("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),f.push(Ne({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":d>1?"":void 0}}))}return e==="custom"&&a!=null&&f.push(Ne({tagName:"slot",properties:{name:a}})),Ne({tagName:"div",children:f,properties:{"data-separator":f.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":c?"":void 0}})}function fL(e,t){return`hunk-separator-${e}-${t}`}function hL(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function pL(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}let mL=-1;var gL=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++mL}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:xt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Zl(e.theme??xt)?MC():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)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??Ex}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t!=="change"?{gutterLineType:t}:{gutterLineType:e==="deletions"?"change-deletion":"change-addition"}}createAnnotationElement=e=>Km(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:a=!1,disableVirtualizationBuffers:s=!1,collapsed:c=!1,expandUnchanged:d=!1,collapsedContextThreshold:f=1,expansionLineCount:h=100,hunkSeparators:m="line-info",lineDiffType:g="word-alt",maxLineDiffLength:y=1e3,overflow:b="scroll",stickyHeader:S=!1,theme:w=xt,headerRenderMode:A="default",tokenizeMaxLineLength:k=1e3,tokenizeMaxLength:E=Sx,useTokenTransformer:T=!1,useCSSClasses:L=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:a,disableVirtualizationBuffers:s,collapsed:c,expandUnchanged:d,collapsedContextThreshold:f,expansionLineCount:h,hunkSeparators:m,lineDiffType:g,maxLineDiffLength:y,overflow:b,stickyHeader:S,theme:this.workerManager?.getDiffRenderOptions().theme??w,headerRenderMode:A,tokenizeMaxLineLength:k,tokenizeMaxLength:E,useTokenTransformer:T,useCSSClasses:L}}async initializeHighlighter(){return this.highlighter=await Ud(QC(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=am(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!kr(t,i.options)&&(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!uc(e),options:t,result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??xn(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:i,tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:c}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:ZC(this.options),tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:c}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ds(e,n.diff)||!kr(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Ld){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:a,forceHighlight:s}=this.getRenderOptions(e);const c=this.getMatchingWorkerResultCache(e,a);c!=null&&!this.hasHighlightedRenderCache(e,a)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...c},s=!1),this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0};const d=e.additionLines.length>0||e.deletionLines.length>0,f=!d||uc(e)||am(e,this.getTokenizeMaxLength()),h=!ds(e,this.renderCache.diff),m=!gf(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(f||this.renderCache.result==null||!this.renderCache.highlighted&&(h||m))&&(this.renderCache.diff=e,this.renderCache.options=a,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||m||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,pL(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!f&&d&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??xn(e.name);const g=this.highlighter!=null&&Zl(a.theme),y=this.highlighter!=null&&Gd(this.computedLang),b=!f&&y;if(this.highlighter!=null&&g&&(s||f||!this.renderCache.highlighted&&b||this.renderCache.result==null)){const{result:S,options:w}=this.renderDiffWithHighlighter(e,this.highlighter,f||!y);this.renderCache={diff:e,options:w,highlighted:b,result:S,renderRange:void 0}}(!g||!f&&!y)&&this.asyncHighlight(e).then(({result:S,options:w})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,S,w,!f)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Ld){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:a,disableLineNumbers:s,overflow:c}=this.getOptionsWithDefaults();return XC({type:"diff",diffIndicators:i,disableBackground:a,disableLineNumbers:s,overflow:c,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=am(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??xn(e.name);const n=this.highlighter!=null&&Zl(this.options.theme??xt),i=t||this.highlighter!=null&&Gd(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:a}=this.getOptionsWithDefaults();return{result:FC(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:a}),options:i}}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const a=!this.renderCache.highlighted||!kr(this.renderCache.options,n)||!ds(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!kr(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ds(e,n.diff)&&kr(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:a}){const{diffStyle:s,disableFileHeader:c,expandUnchanged:d,expansionLineCount:f,collapsedContextThreshold:h,hunkSeparators:m}=this.getOptionsWithDefaults();this.diff=e;const g=s==="unified";let y=[],b=[],S=[];const w=[],{additionLines:A,deletionLines:k}=n,E={rowCount:0,hunkSeparators:m,additionsContentAST:y,deletionsContentAST:b,unifiedContentAST:S,unifiedGutterAST:us(),deletionsGutterAST:us(),additionsGutterAST:us(),expansionLineCount:f,hunkData:w,incrementRowCount(te=1){E.rowCount+=te},pushToGutter(te,le){switch(te){case"unified":E.unifiedGutterAST.children.push(le);break;case"deletions":E.deletionsGutterAST.children.push(le);break;case"additions":E.additionsGutterAST.children.push(le);break}}},T=VC({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),L={size:0,side:void 0,increment(){this.size+=1},flush(){if(s!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(E.pushToGutter("additions",Yn(void 0,"buffer",this.size)),y?.push(ad(this.size))):(E.pushToGutter("deletions",Yn(void 0,"buffer",this.size)),b?.push(ad(this.size))),this.size=0,this.side=void 0}}},O=(te,le,me,H,z)=>{E.pushToGutter(te,OC(le,me,H,z))};function D(te){L.flush(),s==="unified"?om("unified",te,E):(om("deletions",te,E),om("additions",te,E))}this.pushFileLevelAnnotations(e,s,t,E),Xl({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:d?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:te,hunk:le,collapsedBefore:me,collapsedAfter:H,additionLine:z,deletionLine:Q,type:ce})=>{const _e=Q!=null?Q.splitLineIndex:z.splitLineIndex,M=z!=null?z.unifiedLineIndex:Q.unifiedLineIndex;s==="split"&&ce!=="change"&&L.flush(),me>0&&D({hunkIndex:te,collapsedLines:me,rangeSize:Math.max(le?.collapsedBefore??0,0),hunkSpecs:le?.hunkSpecs,isFirstHunk:te===0,isLastHunk:!1,isExpandable:!e.isPartial});const q=s==="unified"?M:_e,re={type:ce,hunkIndex:te,lineIndex:q,unifiedLineIndex:M,splitLineIndex:_e,deletionLine:Q,additionLine:z};if(s==="unified"){const Ce=this.getUnifiedInjectedRowsForLine?.(re);Ce?.before!=null&&Zb(Ce.before,E);let He=Q!=null?k[Q.lineIndex]:void 0,We=z!=null?A[z.lineIndex]:void 0;if(He==null&&We==null){const de="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(de,{file:e.name}),new Error(de)}const lt=ce==="change"?z!=null?"change-addition":"change-deletion":ce,ne=this.getUnifiedLineDecoration({type:ce,lineType:lt,additionLineIndex:z?.lineIndex,deletionLineIndex:Q?.lineIndex});O("unified",ne.gutterLineType,z!=null?z.lineNumber:Q.lineNumber,`${M},${_e}`,ne.gutterProperties),We!=null?We=cd(We,ne.contentProperties):He!=null&&(He=cd(He,ne.contentProperties)),ld({diffStyle:"unified",type:ce,deletionLine:He,additionLine:We,unifiedSpan:this.getAnnotations("unified",Q?.lineNumber,z?.lineNumber,te,q),createAnnotationElement:de=>this.createAnnotationElement(de),context:E}),Ce?.after!=null&&Zb(Ce.after,E)}else{const Ce=this.getSplitInjectedRowsForLine?.(re);Ce?.before!=null&&Jb(Ce.before,E,L);let He=Q!=null?k[Q.lineIndex]:void 0,We=z!=null?A[z.lineIndex]:void 0;const lt=this.getSplitLineDecoration({side:"deletions",type:ce,lineIndex:Q?.lineIndex}),ne=this.getSplitLineDecoration({side:"additions",type:ce,lineIndex:z?.lineIndex});if(He==null&&We==null){const Ve="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Ve,{file:e.name}),new Error(Ve)}const de=(()=>{if(ce==="change"){if(We==null)return"additions";if(He==null)return"deletions"}})();if(de!=null){if(L.side!=null&&L.side!==de)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");L.side=de,L.increment()}const Le=this.getAnnotations("split",Q?.lineNumber,z?.lineNumber,te,q);if(Le!=null&&L.size>0&&L.flush(),Q!=null){const Ve=cd(He,lt.contentProperties);O("deletions",lt.gutterLineType,Q.lineNumber,`${Q.unifiedLineIndex},${_e}`,lt.gutterProperties),Ve!=null&&(He=Ve)}if(z!=null){const Ve=cd(We,ne.contentProperties);O("additions",ne.gutterLineType,z.lineNumber,`${z.unifiedLineIndex},${_e}`,ne.gutterProperties),Ve!=null&&(We=Ve)}ld({diffStyle:"split",type:ce,additionLine:We,deletionLine:He,...Le,createAnnotationElement:Ve=>this.createAnnotationElement(Ve),context:E}),Ce?.after!=null&&Jb(Ce.after,E,L)}const ae=s==="split"&&le!=null&&_e===le.splitLineStart+le.splitLineCount-1,he=ae?le.noEOFCRDeletions:!1,Se=ae?le.noEOFCRAdditions:!1,be=(Q?.noEOFCR??!1)||he,Ue=(z?.noEOFCR??!1)||Se;if(Ue||be){if(s==="split"&&L.flush(),be){const Ce=ce==="context"||ce==="context-expanded"?ce:"change-deletion";s==="unified"?(E.unifiedContentAST.push(sd(Ce)),E.pushToGutter("unified",Yn(Ce,"metadata",1))):(E.deletionsContentAST.push(sd(Ce)),E.pushToGutter("deletions",Yn(Ce,"metadata",1)),Ue||(E.pushToGutter("additions",Yn(void 0,"buffer",1)),E.additionsContentAST.push(ad(1))))}if(Ue){const Ce=ce==="context"||ce==="context-expanded"?ce:"change-addition";s==="unified"?(E.unifiedContentAST.push(sd(Ce)),E.pushToGutter("unified",Yn(Ce,"metadata",1))):(E.additionsContentAST.push(sd(Ce)),E.pushToGutter("additions",Yn(Ce,"metadata",1)),be||(E.pushToGutter("deletions",Yn(void 0,"buffer",1)),E.deletionsContentAST.push(ad(1))))}E.incrementRowCount(1)}H>0&&m!=="simple"&&D({hunkIndex:ce==="context-expanded"?te:te+1,collapsedLines:H,rangeSize:T,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),E.incrementRowCount(1)}}),s==="split"&&L.flush();const N=Math.max(hL(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),W=t.bufferBefore>0||t.bufferAfter>0,G=!g&&e.type!=="deleted",se=!g&&e.type!=="new",ie=E.rowCount>0||W;y=G&&ie?y:void 0,b=se&&ie?b:void 0,S=g&&ie?S:void 0;const ee=this.createPreElement(b!=null&&y!=null,N);return{unifiedGutterAST:g&&ie?E.unifiedGutterAST.children:void 0,unifiedContentAST:S,deletionsGutterAST:se&&ie?E.deletionsGutterAST.children:void 0,deletionsContentAST:b,additionsGutterAST:G&&ie?E.additionsGutterAST.children:void 0,additionsContentAST:y,hunkData:w,preNode:ee,themeStyles:i,baseThemeType:a,headerElement:c?void 0:this.renderHeader(this.diff),totalLines:N,rowCount:E.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const a=us(n);return a.properties.style=`grid-row: span ${t.rowCount}`,[a,KC(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(Ne({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const a=this.renderCodeAST("deletions",e);a!=null&&t.push(Ne({tagName:"code",children:a,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",e);return s!=null&&t.push(Ne({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return qi(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?qi(e):qi(Ne({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!mf(n))return;const a=e.type!=="new"?Xb(Wm(this.deletionAnnotations)):[],s=e.type!=="deleted"?Xb(Wm(this.additionAnnotations)):[];if(a.length===0&&s.length===0)return;const c=-1,d=-1,{createAnnotationElement:f}=this;if(t==="unified"){ld({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:a.concat(s)},createAnnotationElement:f,context:i});return}ld({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:a},additionSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:s},createAnnotationElement:f,context:i})}getAnnotations(e,t,n,i,a){const s={type:"annotation",hunkIndex:i,lineIndex:a,annotations:[]};if(t!=null)for(const d of this.deletionAnnotations[t]??[])s.annotations.push(ki(d));const c={type:"annotation",hunkIndex:i,lineIndex:a,annotations:[]};if(n!=null)for(const d of this.additionAnnotations[n]??[])(e==="unified"?s:c).annotations.push(ki(d));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(c.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:c}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return YC({fileOrDiff:e,mode:t,stickyHeader:n})}};function Xb(e){return e?.map(t=>ki(t))??[]}const vL=new Intl.PluralRules("en-US");function Qb(e){return`${e} unmodified line${vL.select(e)==="one"?"":"s"}`}function Zb(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function Jb(e,t,n){for(const{deletion:i,addition:a}of e){if(i==null&&a==null)continue;const s=i!=null&&a!=null?void 0:i==null?"deletions":"additions";(s==null||n.side!==s)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),a!=null&&(t.additionsContentAST.push(a.content),t.pushToGutter("additions",a.gutter)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function ld({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:a,deletionSpan:s,additionSpan:c,createAnnotationElement:d,context:f}){let h=!1;if(e==="unified"){if(i!=null?f.unifiedContentAST.push(i):n!=null&&f.unifiedContentAST.push(n),a!=null){const m=t==="change"?n!=null?"change-deletion":"change-addition":t;f.unifiedContentAST.push(d(a)),f.pushToGutter("unified",Yn(m,"annotation",1)),h=!0}}else if(e==="split"){if(n!=null&&f.deletionsContentAST.push(n),i!=null&&f.additionsContentAST.push(i),s!=null){const m=t==="change"?n!=null?"change-deletion":"context":t;f.deletionsContentAST.push(d(s)),f.pushToGutter("deletions",Yn(m,"annotation",1)),h=!0}if(c!=null){const m=t==="change"?i!=null?"change-addition":"context":t;f.additionsContentAST.push(d(c)),f.pushToGutter("additions",Yn(m,"annotation",1)),h=!0}}h&&f.incrementRowCount(1)}function om(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:a,isFirstHunk:s,isLastHunk:c,isExpandable:d},f){if(n<=0)return;const h=e==="unified"?f.unifiedContentAST:e==="deletions"?f.deletionsContentAST:f.additionsContentAST;if(f.hunkSeparators==="metadata"){a!=null&&(f.pushToGutter(e,os({type:"metadata",content:a,isFirstHunk:s,isLastHunk:c})),h.push(os({type:"metadata",content:a,isFirstHunk:s,isLastHunk:c})),e!=="additions"&&f.incrementRowCount(1));return}if(f.hunkSeparators==="simple"){t>0&&(f.pushToGutter(e,os({type:"simple",isFirstHunk:s,isLastHunk:!1})),h.push(os({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&f.incrementRowCount(1));return}const m=fL(e,t),g=i>f.expansionLineCount,y=d?t:void 0;f.pushToGutter(e,os({type:f.hunkSeparators,content:Qb(n),expandIndex:y,chunked:g,slotName:m,isFirstHunk:s,isLastHunk:c})),h.push(os({type:f.hunkSeparators,content:Qb(n),expandIndex:y,chunked:g,slotName:m,isFirstHunk:s,isLastHunk:c})),e!=="additions"&&f.incrementRowCount(1),f.hunkData.push({slotName:m,hunkIndex:t,lines:n,type:e,expandable:d?{up:!s,down:!c,chunked:g}:void 0})}function cd(e,t){return e==null||e.type!=="element"||t==null?e:{...e,properties:{...e.properties,...t}}}function am(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function yL(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function bL(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function SL(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}let _L=-1;var CL=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++_L}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:xt},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new WC,this.scrollSyncManager=new dL,this.interactionManager=new GC("diff",qd(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 SL(e)}createHunksRenderer(e){return new gL(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let i,a;e:for(const s of this.fileDiff.hunks){let c=t==="deletions"?s.deletionStart:s.additionStart;const d=t==="deletions"?s.deletionCount:s.additionCount;let f=s.splitLineStart,h=s.unifiedLineStart;if(e<c){const m=c-e;i=Math.max(h-m,0),a=Math.max(f-m,0);break e}if(e>=c+d){if(s===n){const m=e-(c+d);i=h+s.unifiedLineCount+m,a=f+s.splitLineCount+m;break e}continue}for(const m of s.hunkContent)if(m.type==="context")if(e<c+m.lines){const g=e-c;a=f+g,i=h+g;break e}else c+=m.lines,f+=m.lines,h+=m.lines;else{const g=t==="deletions"?m.deletions:m.additions;if(e<c+g){const y=e-c;i=h+(t==="additions"?m.deletions:0)+y,a=f+y;break e}else c+=g,f+=Math.max(m.deletions,m.additions),h+=m.deletions+m.additions}break e}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(qd(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;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ua(this.appliedThemeCSS.theme,this.options.theme??xt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:a,oldFile:s,newFile:c,fileDiff:d}=e;this.hydrateElements(t,n),xL(this.pre,EL({fileDiff:d,oldFile:s,newFile:c}),this.options.collapsed)||TL(this.headerElement,wL({fileDiff:d,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:d,oldFile:s,newFile:c,lineAnnotations:a}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),uE(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.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:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?Qm(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:i=!1,forceRender:a=!1,preventEmit:s=!1,lineAnnotations:c,fileContainer:d,containerWrapper:f,renderRange:h}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:m=!1,themeType:g="system"}=this.options,y=m?void 0:h,b=this.hasThemeChanged(),S=e!=null&&t!=null&&(!vo(e,this.deletionFile)||!vo(t,this.additionFile));let w=n!=null&&n!==this.fileDiff;const A=c!=null&&(c.length>0||this.lineAnnotations.length>0)?c!==this.lineAnnotations:!1;if(!m&&gf(y,this.renderRange)&&!a&&!A&&!b&&(n!=null&&n===this.fileDiff||n==null&&!S))return this.applyCachedThemeState(g);const{renderRange:k}=this;if(this.renderRange=y,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&S&&(w=!0,this.fileDiff=Qm(e,t,this.options.parseDiffOptions)),w&&(this.cachedHeaderHTML=void 0),c!=null&&this.setLineAnnotations(c),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:E=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),d=this.getOrCreateFileContainer(d,f),this.applyCachedThemeState(g),m){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const L=this.hunksRenderer.renderDiff(this.fileDiff,X_);L!=null&&this.applyThemeState(d,L.themeStyles,g,L.baseThemeType),L?.headerElement!=null&&this.applyHeaderToDOM(L.headerElement,d),this.renderSeparators([]),this.injectUnsafeCSS()}catch(L){if(E)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,d)}return s||this.emitPostRender(),!0}try{const L=this.getOrCreatePreNode(d);if(!(this.canPartiallyRender(a,A,S||w||b)&&this.applyPartialRender({previousRenderRange:k,renderRange:y}))){const O=this.hunksRenderer.renderDiff(this.fileDiff,y);if(O==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(d,O.themeStyles,g,O.baseThemeType),O.headerElement!=null&&this.applyHeaderToDOM(O.headerElement,d),O.additionsContentAST!=null||O.deletionsContentAST!=null||O.unifiedContentAST!=null?this.applyHunksToDOM(L,O):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(O.hunkData)}this.applyBuffers(L,y),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,i||this.flushManagers()}catch(L){if(E)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,d)}return s||this.emitPostRender(),!0}emitPostRender(e=!1){const{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;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}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(const{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{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){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{fileDiff:e,workerManager:t}=this;if(e==null||t==null||uc(e))return;const n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.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.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){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const i of e){const a=i.slotName;let s=this.separatorCache.get(a);if(s==null||!bL(i,s.hunkData)){s?.element.remove();const c=document.createElement("div");c.style.display="contents",c.slot=i.slotName;const d=t(i,this);d!=null&&c.appendChild(d),this.fileContainer.appendChild(c),s={element:c,hunkData:i},this.separatorCache.set(a,s)}n.delete(a)}for(const[i,{element:a}]of n.entries())this.separatorCache.delete(i),a.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const a=`${n}-${ki(i)}`;let s=this.annotationCache.get(a);if(s==null||!yL(i,s.annotation)){s?.element.remove();const c=t(i);if(c==null)continue;s={element:tE(ki(i)),annotation:i},s.element.appendChild(c),this.fileContainer.appendChild(s.element),this.annotationCache.set(a,s)}e.delete(a)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=nE();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),a=n!==i;return a&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&a&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),a&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:hc(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):hc(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=JC;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const 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;const{fileDiff:n}=this,i=this.cachedHeaderHTML??qi(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const h=document.createElement("div");h.innerHTML=i;const m=h.firstElementChild;if(!(m instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(m,this.headerElement):t.shadowRoot?.prepend(m),this.headerElement=m,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;const{renderCustomHeader:a,renderHeaderPrefix:s,renderHeaderMetadata:c}=this.options;if(a!=null){const h=a(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Cc,h),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}const d=s?.(n)??void 0,f=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,bg,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Sg,f),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const a=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(a),this.replaceHeaderSlotContent(a,i),a}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{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??=iE(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=aE(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const a=e.shadowRoot??e.attachShadow({mode:"open"}),s=i??n,c=this.options.theme??xt,d=typeof c=="string"?c:{...c},f=pc(a);if(this.themeCSSStyle?.parentNode===a&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===a){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f};return}this.themeCSSStyle=cE({shadowRoot:a,currentNode:this.themeCSSStyle,themeCSS:sE(t,s,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lE(this.themeCSSStyle.textContent??"",pc(e)))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",a=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let s=!1;const c=[],d=this.hunksRenderer.renderCodeAST("unified",t),f=this.hunksRenderer.renderCodeAST("deletions",t),h=this.hunksRenderer.renderCodeAST("additions",t);d!=null?(s=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=Sd({code:this.codeUnified,columnType:"unified",rowSpan:a,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(d),c.push(this.codeUnified)):f!=null||h!=null?(f!=null?(s=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Sd({code:this.codeDeletions,columnType:"deletions",rowSpan:a,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(f),c.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),h!=null?(s=s||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Sd({code:this.codeAdditions,columnType:"additions",rowSpan:a,containerSize:i}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(h),c.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),c.length===0?e.textContent="":s&&e.replaceChildren(...c),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:i,codeAdditions:a,codeDeletions:s,options:{diffStyle:c="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const d=this.getCodeColumns(c,i,s,a);if(d==null)return!1;const f=e.startingLine,h=t.startingLine,m=f+e.totalLines,g=h+t.totalLines,y=Math.max(f,h),b=Math.min(m,g);if(b<=y)return!1;const S=Math.max(0,y-f),w=Math.max(0,m-b),A=this.trimColumns({columns:d,trimStart:S,trimEnd:w,previousStart:f,overlapStart:y,overlapEnd:b,diffStyle:c});if(A<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<A)throw new Error("applyPartialRender: trimmed beyond DOM row count");let k=this.lastRowCount-A;const E=(D,N)=>{if(!(N<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:D,totalLines:N,bufferBefore:0,bufferAfter:0})},T=E(h,Math.max(y-h,0));if(T==null&&h<y)return!1;const L=E(b,Math.max(g-b,0));if(L==null&&g>b)return!1;const O=(D,N)=>{if(D!=null){if(c==="unified"&&!Array.isArray(d))this.insertPartialHTML(c,d,D,N);else if(c==="split"&&Array.isArray(d))this.insertPartialHTML(c,d,D,N);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");k+=D.rowCount}};return this.cleanupErrorWrapper(),O(T,"afterbegin"),O(L,"beforeend"),this.lastRowCount!==k&&(this.applyRowSpan(c,d,k),this.lastRowCount=k),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){const a=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,a,i)}else if(e==="split"&&Array.isArray(t)){const a=this.hunksRenderer.renderCodeAST("deletions",n),s=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],a,i),this.renderPartialColumn(t[1],s,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const i=eS(t[0]),a=eS(t[1]);if(i==null||a==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const s=a.at(0);n==="beforeend"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,a,!0);const c=a.at(-1);n==="afterbegin"&&c?.type==="element"&&typeof c.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(c.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,a,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(a))}mergeBuffersIfNecessary(e,t,n,i,a,s){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const c=this.getBufferSize(t.dataset);c!=null&&(s?(i.shift(),a.shift()):(i.pop(),a.pop()),this.updateBufferSize(t,c+e),this.updateBufferSize(n,c+e))}applyRowSpan(e,t,n){const i=a=>{a!=null&&(a.gutter.style.setProperty("grid-row",`span ${n}`),a.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,a=0,s=0,c=!1;const d=n>=0;if(e==null)return 0;const f=Array.from(e.content.children),h=Array.from(e.gutter.children);if(f.length!==h.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;s<f.length&&!(t<=0&&!d&&!c);){const m=h[s],g=f[s];if(s++,!(m instanceof HTMLElement)||!(g instanceof HTMLElement))throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: invalid row elements");if(c&&(c=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset)){m.remove(),g.remove(),a++;continue}if("lineIndex"in m.dataset&&"lineIndex"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),t>0&&(t--,t===0&&(c=!0)),a++),i++;continue}if("separator"in m.dataset&&"separator"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="buffer"&&"contentBuffer"in g.dataset){const y=this.getBufferSize(g.dataset);if(y==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const b=Math.min(t,y),S=y-b;S>0?(this.updateBufferSize(m,S),this.updateBufferSize(g,S),a+=b):(m.remove(),g.remove(),a+=y),t-=b,t===0&&S===0&&(c=!0)}else if(d){const b=i,S=i+y-1;if(n<=b)m.remove(),g.remove(),a+=y;else if(n<=S){const w=S-n+1,A=y-w;this.updateBufferSize(m,A),this.updateBufferSize(g,A),a+=w}}i+=y;continue}throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: unknown row elements")}return a}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:a,trimEnd:s,trimStart:c}){const d=Math.max(0,i-a),f=n-a;if(f<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const h=c>0,m=s>0;if(!h&&!m)return 0;const g=h?d:0,y=m?f:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,g,y);if(t==="split"&&Array.isArray(e)){const b=this.trimColumnRows(e[0],g,y),S=this.trimColumnRows(e[1],g,y);if(e[0]!=null&&e[1]!=null&&b!==S)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?b:S}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,i){function a(s){if(s==null)return;const c=s.children[0],d=s.children[1];if(!(!(c instanceof HTMLElement)||!(d instanceof HTMLElement)||c.dataset.gutter==null||d.dataset.content==null))return{gutter:c,content:d}}if(e==="unified")return a(t);{const s=a(n),c=a(i);return s!=null||c!=null?[s,c]:void 0}}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==null&&(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==null&&(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:i},a){const{diffIndicators:s="bars",disableBackground:c=!1,disableLineNumbers:d=!1,overflow:f="scroll",diffStyle:h="split"}=this.options,m={type:"diff",diffIndicators:s,disableBackground:c,disableLineNumbers:d,overflow:f,split:h==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:a};eE(m,this.appliedPreAttributes)||(dE(e,m),this.appliedPreAttributes=m)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const a=document.createElement("pre");a.dataset.errorStack="",a.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function EL({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function wL({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function xL(e,t,n=!1){return!n&&e==null&&t}function TL(e,t,n=!1){return e==null&&t&&!n}function eS(e){if(!(e==null||e.type!=="element"))return e.children??[]}const Zm=5e3;let kL=-1;var AL=class extends CL{__id=`little-virtualized-file-diff:${++kL}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,i,a=!1){super(e,i,a),this.virtualizer=t,this.metrics=Qp(n)}setMetrics(e,t=!1){const n=Qp(e);!t&&vs(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){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Gm(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber!==0?!1:e.type==="new"?t.side==="additions":e.type==="deleted"?t.side==="deletions":!0)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!pf(t,e),i=n&&OL(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:PL(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;const{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;const n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],a=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&a&&mf(this.renderRange)){const s=LL(i)??0;this.setFileAnnotationHeight(s)&&(e=!0)}else!a&&this.setFileAnnotationHeight(0)&&(e=!0);for(const s of i){if(s==null)continue;const c=s.children[1];if(c instanceof HTMLElement)for(const d of c.children){if(!(d instanceof HTMLElement))continue;const f=d.dataset.lineIndex;if(f==null)continue;const h=HL(f,n);let m=d.getBoundingClientRect().height,g=!1;d.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in d.nextElementSibling.dataset||"noNewline"in d.nextElementSibling.dataset)&&("noNewline"in d.nextElementSibling.dataset&&(g=!0),m+=d.nextElementSibling.getBoundingClientRect().height);const y=this.getEstimatedLineHeight(g),b=this.cache.heightDeltas.get(h)??0,S=m-y;S!==b&&(e=!0,this.cache.measuredHeightDeltaTotal+=S-b,S===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,S))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,i){const a=!ds(this.fileDiff,e),s=this.syncLineAnnotations(i);let c=n?.resetDiffLayoutCache===!0||a||s,d=a||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=Qp(n.metrics),c=!0,d=!0);const{collapsed:f=!1}=this.options;return this.currentCollapsed!==f&&(this.currentCollapsed=f,c=!0),c&&this.resetLayoutCache({includeEstimatedHeights:d}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null||e<1)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:s=!1,collapsedContextThreshold:c=1}=this.options,d=this.getDiffStyle(),f=this.getHunkSeparatorType(),h=d==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const m=ji(this.metrics,i),g=this.getLayoutCheckpointBeforeLineIndex(h);let y=g?.top??m+this.cache.fileAnnotationHeight;if(s)return{top:m,height:0};let b;return Xl({diff:this.fileDiff,diffStyle:d,startingLine:g?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:c,callback:({hunkIndex:S,hunk:w,collapsedBefore:A,collapsedAfter:k,deletionLine:E,additionLine:T})=>{const L=d==="split"?T?.splitLineIndex??E?.splitLineIndex:T?.unifiedLineIndex??E?.unifiedLineIndex;if(L==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(A>0){const D=Ul({type:f,metrics:this.metrics,hunkIndex:S,hunkSpecs:w?.hunkSpecs});if(D!=null){if(y+=D.gapBefore,h>=L-A&&h<L)return b={top:y,height:D.height},!0;y+=D.height+D.gapAfter}}const O=this.getLineHeight(L,(T?.noEOFCR??!1)||(E?.noEOFCR??!1));if(L===h)return b={top:y,height:O},!0;if(y+=O,k>0){const D=Fl({type:f,metrics:this.metrics});if(D!=null){if(h>L&&h<=L+k)return b={top:y+D.gapBefore,height:D.height},!0;y+=D.totalHeight}}return!1}}),b}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;const s=this.getDiffStyle(),c=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const d=this.getLayoutCheckpointBeforeTop(e);let f=d?.top??ji(this.metrics,t)+this.cache.fileAnnotationHeight,h;return Xl({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:m,hunk:g,collapsedBefore:y,collapsedAfter:b,deletionLine:S,additionLine:w})=>{const A=s==="split"?w?.splitLineIndex??S?.splitLineIndex:w?.unifiedLineIndex??S?.unifiedLineIndex;if(A==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(y>0){const E=Ul({type:c,metrics:this.metrics,hunkIndex:m,hunkSpecs:g?.hunkSpecs});E!=null&&(f+=E.totalHeight)}if(f>=e&&(S!=null?h={lineNumber:S.lineNumber,side:"deletions",top:f}:w!=null&&(h={lineNumber:w.lineNumber,side:"additions",top:f}),h!=null))return!0;const k=this.getLineHeight(A,(w?.noEOFCR??!1)||(S?.noEOFCR??!1));if(f+=k,b>0){const E=Fl({type:c,metrics:this.metrics});E!=null&&(f+=E.totalHeight)}return!1}}),h}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};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:a}=t;let s=0;if(a===0){const c=e??this.virtualizer.getWindowSpecs();this.top<c.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:a=!1}=this.options,s=ji(this.metrics,i);if(this.height+=s,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();const e=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:i,unifiedHeight:a}=G6({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;const e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:i,forceRender:a=!1,lineAnnotations:s,...c}={}){const{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;const h=this.syncLineAnnotations(s);if(h&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=i??(t!=null&&n!=null?Qm(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(f)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const b=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(b==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");b.connect(e,this),this.isVisible=b.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const m=this.virtualizer.getWindowSpecs(),g=this.top??0,y=this.computeRenderRangeFromWindow(this.fileDiff,g,m);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:y,oldFile:t,newFile:n,lineAnnotations:s,forceRender:(d??a)||h,...c})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return NL(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,i=this.fileDiff.hunks.length-1,a=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=t?!0:this.hunksRenderer.getExpandedHunksMap(),d=IL(this.cache.heightDeltas);let f=ji(this.metrics,e)+this.cache.fileAnnotationHeight,h=0;const m=({rowCount:g,startLineIndex:y,preSeparatorHeight:b=0,postSeparatorHeight:S=0,metadataOffsets:w=[]})=>{if(g<=0)return;const A=h,k=h+g;let E=RL(A);for(;E<k;){const T=E-A,L=f+(T>0?b:0)+T*this.metrics.lineHeight+DL(w,T)*this.metrics.lineHeight+tS(d,y,y+T);this.cache.checkpoints.push({renderedLineIndex:E,lineIndex:y+T,top:L}),E+=Zm}f+=b+g*this.metrics.lineHeight+w.length*this.metrics.lineHeight+tS(d,y,y+g)+S,h=k};for(let g=0;g<this.fileDiff.hunks.length;g++){const y=this.fileDiff.hunks[g];if(y==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const b=dc({isPartial:this.fileDiff.isPartial,rangeSize:y.collapsedBefore,expandedHunks:c,hunkIndex:g,collapsedContextThreshold:n}),S=b.collapsedLines>0?Ul({type:s,metrics:this.metrics,hunkIndex:g,hunkSpecs:y.hunkSpecs})?.totalHeight??0:0;m({rowCount:b.fromStart,startLineIndex:(a==="split"?y.splitLineStart:y.unifiedLineStart)-b.rangeSize});let w=S;m({rowCount:b.fromEnd,startLineIndex:(a==="split"?y.splitLineStart:y.unifiedLineStart)-b.fromEnd,preSeparatorHeight:w}),b.fromEnd>0&&(w=0);const A=g===i?fc({fileDiff:this.fileDiff,hunkIndex:g,expandedHunks:c,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,k=A!=null&&A.collapsedLines>0?Fl({type:s,metrics:this.metrics})?.totalHeight??0:0,E=A!=null?A.fromStart+A.fromEnd:0,T=a==="split"?y.splitLineCount:y.unifiedLineCount,L=a==="split"?y.splitLineStart:y.unifiedLineStart;m({rowCount:T,startLineIndex:L,preSeparatorHeight:w,postSeparatorHeight:E===0?k:0,metadataOffsets:ML({diffStyle:a,hunk:y,rowCount:T})}),A!=null&&E>0&&m({rowCount:E,startLineIndex:L+T,postSeparatorHeight:k})}this.cache.totalLines=h}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(i=s,t=a+1):n=a-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");c.top<=e?(a=s,n=s+1):i=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(c.renderedLineIndex%t===0)return c}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const d of e.hunks)n+=t==="split"?d.splitLineCount:d.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:a=1}=this.options,s=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[d,f]of e.hunks.entries()){const h=t==="split"?f.splitLineCount:f.unifiedLineCount;n+=h;const m=Math.max(f.collapsedBefore,0),{fromStart:g,fromEnd:y,renderAll:b}=dc({isPartial:e.isPartial,rangeSize:m,expandedHunks:s,hunkIndex:d,collapsedContextThreshold:a});m>0&&(n+=b?m:g+y)}const c=fc({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,collapsedContextThreshold:a,errorPrefix:"VirtualizedFileDiff"});return c!=null&&(n+=c.fromStart+c.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:a=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1}=this.options,{hunkLineCount:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),m=this.getHunkSeparatorType(),g=this.height;let y=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,h);const b=ji(this.metrics,a),S=e.hunks.length>0?$d(this.metrics):0,{fileAnnotationHeight:w}=this.cache,A=b+w,k=Math.max(0,g-b-w-S),E=this.hasFileAnnotations(e),T=t+b,L=w>0&&E&&T<i&&T+w>n;if(t<n-g||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-b-S};if(y<=d||e.hunks.length===0)return{startingLine:0,totalLines:d,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),y=this.cache.totalLines>0?this.cache.totalLines:y;const O=Math.ceil(Math.max(i-n,0)/f),D=Math.ceil(O/d)*d+d,N=D/d,W=N,G=[],se=(n+i)/2,ie=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-D*f*2),d);let ee=t+(ie?.top??A),te=ie?.renderedLineIndex??0,le,me,H;if(Xl({diff:e,diffStyle:h,startingLine:ie?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:c,callback:({hunkIndex:Se,hunk:be,collapsedBefore:Ue,collapsedAfter:Ce,deletionLine:He,additionLine:We})=>{const lt=We!=null?We.splitLineIndex:He.splitLineIndex,ne=We!=null?We.unifiedLineIndex:He.unifiedLineIndex,de=(We?.noEOFCR??!1)||(He?.noEOFCR??!1),Le=(Ue>0?Ul({type:m,metrics:this.metrics,hunkIndex:Se,hunkSpecs:be?.hunkSpecs}):void 0)?.totalHeight??0;ee+=Le;const Ve=te%d===0,Tt=Math.floor(te/d);if(Ve&&(G[Tt]=ee-(t+A+Le),H!=null)){if(H<=0)return!0;H--}const vn=this.getLineHeight(h==="split"?lt:ne,de);return ee>n-vn&&ee<i&&(le??=Tt),me==null&&ee+vn>se&&(me=Tt),H==null&&ee>=i&&Ve&&(H=W),te++,ee+=vn,Ce>0&&(ee+=Fl({type:m,metrics:this.metrics})?.totalHeight??0),!1}}),le==null)if(L)le=0,me=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-b-S};me??=le;const z=Math.round(me-N/2),Q=Math.max(0,Math.ceil(y/d)-N),ce=Math.max(0,Math.min(z,Q)),_e=ce*d,M=z<0?D+z*d:D,q=G[ce]??0,re=_e===0?0:w+q,ae=ce+M/d,he=ae<G.length?k-G[ae]:k-(ee-t-A);return{startingLine:_e,totalLines:M,bufferBefore:re,bufferAfter:Math.max(0,he)}}};function LL(e){let t;for(const n of e){if(n==null)continue;const i=n.children[1];if(i instanceof HTMLElement)for(const a of i.children)a instanceof HTMLElement&&a.dataset.lineAnnotation===qC&&(t=Math.max(t??0,a.getBoundingClientRect().height))}return t}function IL(e){const t=Array.from(e).sort((s,c)=>s[0]-c[0]),n=[],i=[0];let a=0;for(const[s,c]of t)n.push(s),a+=c,i.push(a);return{lineIndexes:n,prefixTotals:i}}function tS({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const a=nS(e,n);return(t[nS(e,i)]??0)-(t[a]??0)}function nS(e,t){let n=0,i=e.length;for(;n<i;){const a=n+i>>1,s=e[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s<t?n=a+1:i=a}return n}function RL(e){return Math.ceil(e/Zm)*Zm}function DL(e,t){let n=0;for(const i of e)i<t&&n++;return n}function ML({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];const a=Math.max(i.deletions,i.additions),s=i.deletions+i.additions;if(e==="split")return a>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const c=[],d=n-s;return i.deletions>0&&t.noEOFCRDeletions&&c.push(d+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&c.push(n-1),c}function OL(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function PL(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function NL(e){return typeof e=="function"?"custom":e??"line-info"}function HL(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}const zL=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","diffStyle","diffIndicators","disableBackground","expandUnchanged","collapsedContextThreshold","lineDiffType","maxLineDiffLength","expansionLineCount","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],VL=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],iS=["renderCustomHeader","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","onPostRender","onGutterUtilityClick","onLineClick","onLineNumberClick","onLineEnter","onLineLeave","onTokenClick","onTokenEnter","onTokenLeave"],rS=["onLineSelected","onLineSelectionStart","onLineSelectionChange","onLineSelectionEnd"],yE=Symbol("CodeView.itemOptionsState");function oS(e,t){Object.defineProperty(e,yE,{configurable:!1,enumerable:!1,value:t})}function Ml(e){return e[yE]}function wr(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}const BL=120,aS="--diffs-overflow-override",Fg=12e6,bE=1e6,SE=2e6,UL=Fg-SE,sS=Fg-bE,FL=(()=>{const{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),i=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(n||i)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})();var jL=class Tr{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=Ll;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isContainerManaged;constructor(t={theme:xt},n,i=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=n,this.isContainerManaged=i,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??_x}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??Ll.hunkLineCount,lineHeight:t?.lineHeight??Ll.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??Ll.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??Ll.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??Cx}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return ux&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;const n=t.instance.getAdvancedStickySpecs();if(n==null)return;const i=n.height,a=t.element.getBoundingClientRect().height;i!==a&&console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:i,actualHeight:a,delta:a-i,stickyTopOffset:n.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;const{firstIndex:t,lastIndex:n,stickyHeight:i,stickyTop:a,stickyBottom:s}=this.renderState;if(t===-1||n===-1)return;const c=this.stickyContainer.getBoundingClientRect().height;Math.abs(c-i)<1||console.error("CodeView: sticky container height does not match computed layout",{computedStickyHeight:i,actualStickyHeight:c,delta:c-i,stickyTop:a,stickyBottom:s,firstIndex:t,lastIndex:n,firstStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[n]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents="none",this.pointerEventsDisabled=!0),FL&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(aS,"hidden"),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,BL)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&(this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1),this.codeOverflowFix&&(this.stickyContainer.style.setProperty(aS,"auto"),this.codeOverflowFix=!1)};syncLayout(){const{gap:t,paddingBottom:n,paddingTop:i}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${i}px`),this.container?.style.setProperty("margin-bottom",`${n}px`)}setup(t){if(this.root!=null)throw new Error("CodeView.setup: already setup");this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",this.root.hasAttribute("tabindex")||(this.root.tabIndex=-1),this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{Tr.__STOP?(Tr.__STOP=!1,this.scrollTo({type:"position",position:Tr.__lastScrollPosition,behavior:"instant"})):(Tr.__lastScrollPosition=this.getScrollTop(),Tr.__STOP=!0)}}reset(){this.restoreScrollInteractions(),this.cleanAllRenderedItems(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){const n=this.items[t];if(n==null)throw new Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(n)}}primeScrollTarget(t){if(t.type==="position")return;const n=this.idToItem.get(t.id);n?.instance.primeHighlightCache()}getElementPoolLimit(){const t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:n}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(n,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();for(;t!=null&&!this.isElementPoolGenerationCurrent(t);)t=this.elementPool.pop();return t??=document.createElement(W_),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){const{element:n}=t;n!=null&&this.renderedItemOwnsFocus(n)&&(this.shouldFixContainerFocus=!0),t.instance.cleanUp(!0),t.element=void 0,n!=null&&(n.remove(),this.cleanElement(n),this.queueElementForPool(n))}renderedItemOwnsFocus(t){const{activeElement:n}=document;return n===t||t.contains(n)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(t){const{shadowRoot:n}=t;if(n!=null)for(const i of Array.from(n.children))KL(i)||i.remove();this.isContainerManaged||t.replaceChildren()}queueElementForPool(t){const n=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=n||(this.isElementClean(t)?this.elementPool.push(t):this.pendingElementPool.push(t))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;const{pendingElementPool:t}=this;this.pendingElementPool=[];const n=this.getElementPoolLimit();for(const i of t)this.isElementPoolGenerationCurrent(i)&&this.isElementClean(i)&&this.elementPool.length<n?this.elementPool.push(i):this.isElementPoolGenerationCurrent(i)&&this.getElementPoolSize()<n&&this.pendingElementPool.push(i)}isElementClean(t){return t.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(t){this.elementPoolTracker.set(t,this.elementPoolVersion)}isElementPoolGenerationCurrent(t){return this.elementPoolTracker.get(t)===this.elementPoolVersion}resolveEffectiveScrollBehavior(t,n){return u6()?"instant":t.behavior!=="smooth-auto"?t.behavior??"instant":Math.abs(n-this.getScrollTop())<=this.getHeight()*10?"smooth":"instant"}scrollTo(t){if(this.root==null)return;const n=this.normalizeScrollTarget(t);if(n==null)return;const i=this.resolveScrollTargetTop(n);i!=null&&(this.primeScrollTarget(n),this.resolveEffectiveScrollBehavior(n,i)==="smooth"?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=n,this.render())}setSelectedLines(t,n){this.applySelectedLines(t,n)}getSelectedLines(){return this.selectedLines}clearSelectedLines(t){this.applySelectedLines(null,t)}getItem(t){return this.idToItem.get(t)?.item}updateItem(t){const n=this.idToItem.get(t.id);return n==null?(console.error(`CodeView.updateItem: unknown item id "${t.id}"`),!1):this.syncItemRecord(n,t)?(this.markItemLayoutDirty(n),this.scrollDirty=!0,this.render(),this.syncSelection(),!0):!1}updateItemId(t,n){if(t===n)return!0;const i=this.idToItem.get(t);return i==null?(console.error(`CodeView.updateItemId: unknown item id "${t}"`),!1):this.idToItem.has(n)?(console.error(`CodeView.updateItemId: duplicate item id "${n}"`),!1):(this.idToItem.delete(t),i.item.id=n,this.idToItem.set(n,i),this.updateItemOptionsId(i.instance.options,n),this.selectedLines?.id===t&&(this.selectedLines={...this.selectedLines,id:n},this.options.onSelectedLinesChange?.(this.selectedLines)),this.renamePendingScrollTarget(t,n),this.renamePendingLayoutAnchor(t,n),this.render(),!0)}addItem(t){this.addItems([t]),this.syncSelection()}addItems(t){this.appendItemsInternal(t),this.syncSelection()}setItems(t){t.length===0?this.reset():this.items.length===0?this.appendItemsInternal(t):this.tryAppendItems(t)||this.reconcileItems(t),this.syncSelection()}appendItemsInternal(t,n=!0){if(t.length===0)return;const i=this.getLayout();let a=this.items.length===0?0:this.scrollHeight+i.gap;const s=a;for(let c=0;c<t.length;c++){const d=t[c];if(d==null)throw new Error("CodeView.appendItemsInternal: missing input item");if(this.idToItem.has(d.id))throw new Error(`CodeView.addItem: duplicate id "${d.id}"`);const f=this.createItem(d,this.items.length,a);this.items.push(f),this.idToItem.set(f.item.id,f),this.instanceToItem.set(f.instance,f),f.height=$L(f),a+=f.height+i.gap}this.scrollHeight=a-i.gap,this.scrollDirty=!0,n&&(this.canSkipRenderForAppend(s)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(t){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&t>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();const{options:n}=this,i=this.getLayout(),{itemMetricsCache:a}=this;qL(n,t)&&this.invalidateElementPool(),this.options=t;const s=this.computeMetricsCache(t.itemMetrics),c=!vs(a,s),d=!vs(i,this.getLayout());d&&this.syncLayout();const f=c||GL(n,t);if(f){const h=this.pendingLayoutReset;this.pendingLayoutReset={metrics:c?s:h?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:h?.includeEstimatedDiffHeights===!0||c||WL(n,t)}}(d||f)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),pf(n,t)||this.renderOptionsRevision++,!this.isContainerManaged&&this.items.length>0&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){Tr.__STOP||(t?(l6(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):s6(this.computeRenderRangeAndEmit))}instanceChanged(t,n){const i=this.instanceToItem.get(t);if(i==null)throw new Error("CodeView.instanceChanged: An instance has changed that is not registered");n&&this.markItemLayoutDirty(i),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getRenderedItems(){const{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1||n===-1||n<t)return[];const i=[];for(let a=t;a<=n;a++){const s=this.items[a];s?.element!=null&&(s.type==="diff"?i.push({id:s.item.id,type:"diff",item:s.item,version:s.version,element:s.element,instance:s.instance}):i.push({id:s.item.id,type:"file",item:s.item,version:s.version,element:s.element,instance:s.instance}))}return i}setSlotCoordinator(t){return t===this.slotCoordinator?!1:(this.slotCoordinator=t,this.slotSnapshot=void 0,!0)}getSlotSnapshot(t){return fS(this.getRenderedItems(),t)}subscribeToScroll(t){return this.scrollListeners.add(t),()=>{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){const n=this.instanceToItem.get(t);if(n==null)throw new Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return n.top}getTopForItem(t){const n=this.idToItem.get(t);if(n!=null)return n.top+this.getLayout().paddingTop}createItem(t,n,i){const{itemMetricsCache:a}=this;if(t.type==="diff"){const c=new AL(this.createDiffOptions(t.id),this,a,this.workerManager,this.isContainerManaged);return{type:"diff",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:c}}const s=new $6(this.createFileOptions(t.id),this,a,this.workerManager,this.isContainerManaged);return{type:"file",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:s}}applySelectedLines(t,n){const{selectedLines:i}=this;t==null&&i==null||t!=null&&i?.id===t.id&&qm(i.range,t.range)||(i!=null&&i.id!==t?.id&&this.idToItem.get(i.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,n))}syncSelection(){if(this.selectedLines==null)return;const t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null;return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}renamePendingScrollTarget(t,n){const{pendingScrollTarget:i}=this;i==null||i.type==="position"||i.id!==t||(this.pendingScrollTarget={...i,id:n})}renamePendingLayoutAnchor(t,n){this.pendingLayoutAnchor?.id===t&&(this.pendingLayoutAnchor.id=n)}createFileOptionsPrototype(){const t={};for(const n of VL)wr(t,n,()=>this.options[n]);wr(t,"stickyHeader",()=>this.options.stickyHeaders),wr(t,"collapsed",n=>this.getItemOptions(Ml(n),"file")?.item.collapsed===!0);for(const n of iS)this.defineItemSharedCallback(t,"file",n);for(const n of rS)this.defineItemSelectionCallback(t,"file",n);return t}createDiffOptionsPrototype(){const t={};for(const n of zL)wr(t,n,()=>this.options[n]);wr(t,"stickyHeader",()=>this.options.stickyHeaders),wr(t,"hunkSeparators",()=>this.options.hunkSeparators),wr(t,"collapsed",n=>this.getItemOptions(Ml(n),"diff")?.item.collapsed===!0);for(const n of iS)this.defineItemSharedCallback(t,"diff",n);for(const n of rS)this.defineItemSelectionCallback(t,"diff",n);return t}createFileOptions(t){const n=Object.create(this.fileOptionsPrototype);return oS(n,{id:t}),n}createDiffOptions(t){const n=Object.create(this.diffOptionsPrototype);return oS(n,{id:t}),n}updateItemOptionsId(t,n){Ml(t).id=n}getItemOptions(t,n){const i=this.idToItem.get(t.id);if(!(i==null||i.type!==n))return i}defineItemSharedCallback(t,n,i){wr(t,i,a=>{if(this.options[i]==null)return;const s=Ml(a),c=s.callbackCache??={};let d=c[i];return d==null&&(d=((...f)=>{const h=this.getItemOptions(s,n);if(h==null)return;const m=this.options[i];return m?.(...f,h)}),c[i]=d),d})}defineItemSelectionCallback(t,n,i){wr(t,i,a=>{if(this.options.enableLineSelection!==!0)return;const s=Ml(a),c=s.callbackCache??={};let d=c[i];return d==null&&(d=(f=>{const h=this.getItemOptions(s,n);if(h==null)return;const m=f==null?null:{id:h.item.id,range:f};this.options.controlledSelection!==!0&&(f!=null||this.selectedLines?.id===h.item.id)&&this.applySelectedLines(m,{notify:!1}),this.options.onSelectedLinesChange?.(m);const g=this.options[i];return g?.(f,h)}),c[i]=d),d})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw new Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i==null)throw new Error("CodeView.tryAppendItems: missing existing item");const a=t[n];if(a==null||i.item.id!==a.id||i.type!==a.type)return!1}for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i==null)throw new Error("CodeView.tryAppendItems: missing existing item");const a=t[n];if(a==null)throw new Error("CodeView.tryAppendItems: append candidate missing prefix item");this.syncItemRecord(i,a)&&this.markLayoutDirtyFromIndex(n)}return this.appendItemsInternal(t.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(t){const{items:n,idToItem:i}=this,a=new Set(n),s=[],c=new Map,d=new Map;let f;for(let h=0;h<t.length;h++){const m=t[h];if(m==null)throw new Error("CodeView.reconcileItems: missing input item");if(c.has(m.id))throw new Error(`CodeView.setItems: duplicate id "${m.id}"`);const g=i.get(m.id),y=g!=null&&g.type===m.type?g:this.createItem(m,h,0);y.index=h,g!=null&&g.type===m.type?(a.delete(g),this.syncItemRecord(y,m)&&(f=Math.min(f??h,h))):f=Math.min(f??h,h),n[h]!==y&&(f=Math.min(f??h,h)),s.push(y),c.set(m.id,y),d.set(y.instance,y)}for(let h=0;h<n.length;h++){const m=n[h];if(m==null||!a.has(m))continue;this.releaseRenderedItem(m);const g=Math.max(s.length-1,0);f=Math.min(f??g,g)}f!=null&&(this.items=s,this.idToItem=c,this.instanceToItem=d,this.renderState.firstIndex>=s.length?this.resetRenderState():this.renderState.lastIndex>=s.length&&(this.renderState.lastIndex=s.length-1),this.markLayoutDirtyFromIndex(f),this.scrollDirty=!0,this.render())}syncItemRecord(t,n){if(t.type!==n.type)throw new Error(`CodeView.syncItemRecord: type mismatch for id "${n.id}"`);return t.version===n.version?!1:(t.item=n,t.version=n.version,t.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(t){const{paddingBottom:n,paddingTop:i}=this.getLayout();return Math.max(i+t+n-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>sS}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),Fg):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){const n=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,n))}clampScrollTop(t){const n=this.getMaxScrollTop();return Math.max(0,Math.min(t,n))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){const n=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,n))}resolveScrollPageWindow(t,n){let i=zi(this.clampPagedScrollTop(n)),a=this.clampScrollPageOffset(t-i);return i=zi(this.clampPagedScrollTop(t-a)),a=this.clampScrollPageOffset(t-i),{pagedScrollTop:i,scrollPageOffset:a}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};const n=this.clampScrollPageOffset(this.scrollPageOffset),i=t-n,a=this.getMaxPagedScrollTop(),s=this.getMaxScrollPageOffset(),c=i>sS&&n<s,d=i<bE&&n>0;return i<0||i>a||c||d?this.resolveScrollPageWindow(t,d?Math.min(UL,a):SE):{pagedScrollTop:zi(this.clampPagedScrollTop(i)),scrollPageOffset:n}}needsScrollPageUpdate(t){const n=zi(this.clampScrollTop(t)),{scrollPageOffset:i}=this.resolvePagedScrollPosition(n);return i!==this.scrollPageOffset}getPagedLayoutTop(t){return this.shouldRebaseScroll()?Math.max(t-this.scrollPageOffset,0):t}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:n.top,height:n.height};if(t.type==="range"){const a=this.getRangeScrollPosition(n,t);if(a==null){console.warn(`CodeView.scrollTo: unable to resolve range ${lS(t.range)} for item "${t.id}"`);return}return{top:n.top+a.top,height:a.height}}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:n.top+i.top,height:i.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;const n=this.getScrollTargetRect(t);if(n==null)return;const i=t.offset??0,a=this.getLayout().paddingTop+n.top,s=a+n.height,c=this.getScrollTop(),d=c+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),f=c+this.getHeight();if(!(a-i<=d&&s+i>=f)){if(a-i<d)return{...t,align:"start"};if(s+i>f)return{...t,align:"end"}}}resolveScrollTargetTop(t){if(t.type==="position"){const a=this.clampScrollTop(t.position);return a!==t.position?a:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top,n.height,t.align,t.offset));if(t.type==="range"){const a=this.getRangeScrollPosition(n,t);if(a==null){console.warn(`CodeView.scrollTo: unable to resolve range ${lS(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+a.top,a.height,t.align,t.offset,this.getStickyHeaderOffset()))}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+i.top,i.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,n,i,a=0,s=0){t+=this.getLayout().paddingTop;const c=this.getHeight();return i==="center"&&n+a<c?t-(c-n)/2+a:i==="end"?t-(c-n)+a:t-s-a}getLineScrollPosition(t,n){return t.type==="diff"?t.instance.getLinePosition(n.lineNumber,n.side):t.instance.getLinePosition(n.lineNumber)}getRangeScrollPosition(t,n){const{range:i}=n,a=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.start,side:i.side}),s=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.end,side:i.endSide??i.side});if(a==null||s==null)return;const c=a.top,d=c+a.height,f=s.top,h=f+s.height,m=Math.min(c,f);return{top:m,height:Math.max(d,h)-m}}computeTargetScrollTopForFrame(t,n){if(this.pendingScrollTarget==null)return t;const i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null)return t;const{scrollAnimation:a}=this;return a==null?i:this.computeSpringStep(a,i,n).position}computeSpringStep(t,n,i){const a=Math.max(0,i-t.lastTimestamp),{omega:s}=this.getSmoothScrollSettings(),c=Math.exp(-s*a),d=t.position-n,f=t.velocity+s*d;return{position:n+(d+f*a)*c,velocity:(f*(1-s*a)-s*d)*c}}advanceScrollAnimation(t,n){if(this.pendingScrollTarget==null)return;const i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}const a=this.scrollAnimation;if(a==null)return i;a.position+=n;const{position:s,velocity:c}=this.computeSpringStep(a,i,t);a.lastTimestamp=t,a.position=s,a.velocity=c;const{positionEpsilon:d,velocityEpsilon:f}=this.getSmoothScrollSettings();return Math.abs(i-s)<=d&&Math.abs(c)<=f?(a.position=i,a.velocity=0,this.scrollAnimation=void 0,i):a.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(Tr.__STOP||this.container==null)return;const n=this.getHeight(),i=this.getScrollTop();let a=i,s=this.pendingLayoutAnchor!=null,c=this.getScrollAnchor(a);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,s=!0),s&&c!=null){const D=this.resolveAnchoredScrollTop(c);if(D!=null){const N=D-a;a=D,this.scrollAnimation!=null&&(this.scrollAnimation.position+=N)}}s&&(a=this.clampScrollTop(a),this.syncContainerHeight());const d=this.computeTargetScrollTopForFrame(a,t),f=!s&&(this.renderState.scrollTop===-1||Math.abs(d-this.renderState.scrollTop)>n+this.config.overscrollSize*2);f&&(c=void 0),this.windowSpecs=c6({scrollTop:d,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:f,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let h=i;(this.pendingScrollTarget!=null&&d!==h||this.needsScrollPageUpdate(d))&&(this.applyScrollFix(d,h,this.windowSpecs),h=d);const{top:m,bottom:g}=this.windowSpecs,{firstIndex:y,lastIndex:b}=this.renderState;if(y>=0)for(let D=y;D<=b;D++){const N=this.items[D];if(N==null)throw new Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${D}`);N.top>m-N.height&&N.top<=g||this.releaseRenderedItem(N)}let S;const w=new Set,A=this.findFirstVisibleIndex(m),k=this.findLastVisibleIndex(g);for(let D=A;D<=k;D++){const N=this.items[D];if(N==null)throw new Error("CodeView.computeRenderRangeAndEmit: missing item");const{instance:W}=N;N.element==null?(N.element=this.acquireElement(),dS(this.stickyContainer,N.element,S),W.virtualizedSetup(),uS(N,N.element)&&(N.renderedOptionsRevision=this.renderOptionsRevision,w.add(N)),S=N.element):(dS(this.stickyContainer,N.element,S),uS(N,void 0,N.renderedOptionsRevision!==this.renderOptionsRevision)&&(N.renderedOptionsRevision=this.renderOptionsRevision,w.add(N)),S=N.element)}this.renderState.firstIndex=A<=k?A:-1,this.renderState.lastIndex=k,this.flushSlotCoordinator(),this.reconcileRenderedItems(w),this.syncContainerHeight(),this.updateStickyPositioning();const E=c!=null?this.resolveAnchoredScrollTop(c):void 0;c===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);const T=E!=null?E-a:0;let L=d,O=!1;if(this.pendingScrollTarget!=null){const D=this.advanceScrollAnimation(t,T);D!=null?(L=D,O=!0):L=a}else L=E??d;L!==h&&(this.applyScrollFix(L,h,this.windowSpecs),h=L),O&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=zi(h),this.flushManagers(w),this.validateStickyContainerHeight(),this.fixContainerFocus(),(f||this.scrollAnimation!=null)&&this.render()};flushManagers(t){for(const n of t)n.instance.flushManagers()}syncContainerHeight(){const t=this.getPagedScrollHeight();this.container==null||this.containerHeight===t||(this.container.style.height=`${t}px`,this.containerHeight=t)}getStickyBounds(t){const{firstIndex:n,lastIndex:i}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(n===-1||i===-1||n>i)return;const a=this.items[n]?.instance.getAdvancedStickySpecs(t),s=this.items[i]?.instance.getAdvancedStickySpecs(t);if(!(a==null||s==null))return{stickyTop:this.getPagedLayoutTop(Math.max(a.topOffset,0)),stickyBottom:this.getPagedLayoutTop(s.topOffset+s.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:n}){const i=this.getHeight(),{itemMetricsCache:a}=this,s=n-t;this.renderState.stickyHeight=s,this.renderState.stickyTop=t,this.renderState.stickyBottom=n,this.stickyOffset.style.height=`${t}px`;const c=(Math.random()*a.lineHeight>>0)*-1,d=-Math.max(s+c,0)+i;this.stickyContainer.style.top=`${d}px`,this.stickyContainer.style.bottom=`${d+a.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();const n=this.getStickyBounds(t);n!=null&&this.applyStickyPositioning(n)}reconcileRenderedItems(t){const{firstIndex:n,lastIndex:i}=this.renderState;if(n===-1)return;let a=-1,s=!1;for(let c=n;c<this.items.length&&!(!s&&c>i);c++){const d=this.items[c];if(d==null)throw new Error("CodeView.reconcileRenderedItems: Invalid item");a===-1?a=d.top:d.top!==a&&(d.top=a,d.instance.syncVirtualizedTop(),s=!0),(t==null?c<=i:t.has(d))&&(d.instance.reconcileHeights()&&(s=!0,d.height=d.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(d)),a+=d.instance.getVirtualizedHeight(),c<this.items.length-1&&(a+=this.getLayout().gap)}s&&a!=null&&(this.scrollDirty=!0,this.scrollHeight=a)}updateStickyPositioning(){const t=this.getStickyBounds();if(t==null)return;const{stickyTop:n,stickyBottom:i}=t;i-n===this.renderState.stickyHeight&&n===this.renderState.stickyTop&&i===this.renderState.stickyBottom||this.applyStickyPositioning(t)}handleScroll=()=>{Tr.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=t=>{for(const n of t)if(n.target===this.stickyContainer){if(n.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){const i=this.getScrollTop(),a=this.getScrollAnchor(i);this.reconcileRenderedItems(),this.updateStickyPositioning();const s=a!=null?this.resolveAnchoredScrollTop(a):void 0;if(s!=null){const c=s-i;this.applyScrollFix(s,i,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=c)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(t,n){return t<n?n+this.getStickyHeaderOffset():n}getScrollAnchor(t){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;const{firstIndex:n,lastIndex:i,stickyTop:a,stickyBottom:s}=this.renderState;if(n===-1||i===-1)return;const c=this.getHeight();if(!(a===-1||s===-1))for(let d=n;d<=i;d++){const f=this.items[d];if(f==null)continue;const h=this.getLayout().paddingTop+f.top;if(h+f.height<=t)continue;if(h>=t+c)break;if(h>=t)return{type:"item",id:f.item.id,viewportOffset:h-t};const m=this.getScrollAnchorViewportTop(h,t)-h,g=f.instance.getNumericScrollAnchor(m);if(g!=null){const y=h+g.top;return{type:"line",id:f.item.id,lineNumber:g.lineNumber,side:g.side,viewportOffset:y-t}}}}resolveAnchoredScrollTop(t){const n=this.idToItem.get(t.id);if(n==null)return;const{paddingTop:i}=this.getLayout();if(t.type==="item"){const c=i+n.top;return this.clampScrollTop(c-t.viewportOffset)}const a=n.type==="diff"?n.instance.getLinePosition(t.lineNumber,t.side):n.instance.getLinePosition(t.lineNumber);if(a==null)return;const s=i+n.top+a.top;return this.clampScrollTop(s-t.viewportOffset)}applyScrollFix(t,n,i){if(this.root==null)return;const a=zi(this.clampScrollTop(t)),s=zi(n),{scrollPageOffset:c}=this,d=zi(this.clampPagedScrollTop(s-c)),{pagedScrollTop:f,scrollPageOffset:h}=this.resolvePagedScrollPosition(a),m=f,g=c!==h;a===this.renderState.scrollTop&&a===s&&m===d&&!g||(this.suspendScrollInteractions(),(m!==d||g)&&(this.scrollPageOffset=h,this.syncPagedScrollScaffolding(i)),m!==d&&this.root.scrollTo({top:m,behavior:"instant"}),this.renderState.scrollTop=a,this.scrollTop=a,this.scrollDirty=!1)}isPendingTargetSettled(t){const n=this.resolveScrollTargetTop(t);return n==null?!0:zi(this.getScrollTop())===zi(n)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;const t=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(t+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;const{onSnapshotChange:t}=this.slotCoordinator,n=fS(this.getRenderedItems(),this.slotCoordinator);XL(this.slotSnapshot,n)||(this.slotSnapshot=n,t(n))}notifyScroll(){if(this.scrollListeners.size===0)return;const t=this.getScrollTop();for(const n of this.scrollListeners)n(t,this)}findFirstVisibleIndex(t){let n=0,i=this.items.length-1,a=this.items.length;for(;n<=i;){const s=n+i>>1,c=this.items[s];if(c==null)throw new Error("CodeView.findFirstVisibleIndex: invalid item index");c.top+c.height>t?(a=s,i=s-1):n=s+1}return a}findLastVisibleIndex(t){let n=0,i=this.items.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.items[s];if(c==null)throw new Error("CodeView.findLastVisibleIndex: invalid item index");c.top<=t?(a=s,n=s+1):i=s-1}return a}recomputeLayout(t=0,n){if(this.items.length===0){this.scrollHeight=0;return}const i=this.getLayout();let a=0;if(t>0){const s=this.items[t-1];if(s==null)throw new Error("CodeView.recomputeLayout: invalid dirty index");a=s.top+s.height+i.gap}for(let s=t;s<this.items.length;s++){const c=this.items[s];if(c==null)throw new Error("CodeView.recomputeLayout: invalid item index");c.top=a,c.type==="diff"?c.height=c.instance.prepareCodeViewItem(c.item.fileDiff,a,n,c.item.annotations??[]):c.height=c.instance.prepareCodeViewItem(c.item.file,a,n,c.item.annotations??[]),a+=c.height,s<this.items.length-1&&(a+=i.gap)}a!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=a}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function $L(e){return e.instance.cleanUp(!0),e.type==="diff"?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function qL(e,t){return!ua(e.theme??xt,t.theme??xt)||(e.themeType??"system")!==(t.themeType??"system")||e.unsafeCSS!==t.unsafeCSS}function GL(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function WL(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function KL(e){return e instanceof SVGElement?!0:hc(e)&&(e.hasAttribute("data-core-css")||e.hasAttribute("data-theme-css")||e.hasAttribute("data-unsafe-css"))}function lS(e){const t=cS(e.start,e.side),n=cS(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function cS(e,t){return t==null?`${e}`:`${t==="deletions"?"D":"A"}${e}`}function uS(e,t,n=!1){return e.type==="diff"?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function dS(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function YL(e){return(e.annotations?.length??0)>0}function fS(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:i}){if(e.length===0)return;if(t||i)return e;if(!n)return;const a=[];for(const s of e)YL(s.item)&&a.push(s);return a.length>0?a:void 0}function XL(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i==null||a==null||i.id!==a.id||i.type!==a.type||i.element!==a.element||i.version!==a.version)return!1}return!0}function QL(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i==null||a==null||i.id!==a.id||i.type!==a.type||i.element!==a.element||i.version!==a.version)return!1}return!0}var sm={exports:{}},hn={};/**
1579
+ `:t)}function im(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}function Qm(e,t,n,i=!1){const a=eL(W8(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(a==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(a.lang=t.lang),a}var dL=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,this.enabled=!1)}setup(e,t,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));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 ad(e){return Ne({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function sd(e){return Ne({tagName:"div",children:[Ne({tagName:"span",children:[Gi("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function rm(e){return Ne({tagName:"div",children:[jd({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 os({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:a,isFirstHunk:s,isLastHunk:c}){let d=0;const f=[];if(e==="metadata"&&t!=null&&f.push(Ne({tagName:"div",children:[Gi(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const h=[];n!=null&&(i?(s||(h.push(rm("up")),d++),c||(h.push(rm("down")),d++)):(h.push(rm(!s&&!c?"both":s?"down":"up")),d++)),h.push(Ne({tagName:"div",children:[Ne({tagName:"span",children:[Gi(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&h.push(Ne({tagName:"div",children:[Gi("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),f.push(Ne({tagName:"div",children:h,properties:{"data-separator-wrapper":"","data-separator-multi-button":d>1?"":void 0}}))}return e==="custom"&&a!=null&&f.push(Ne({tagName:"slot",properties:{name:a}})),Ne({tagName:"div",children:f,properties:{"data-separator":f.length===0?"simple":e,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":c?"":void 0}})}function fL(e,t){return`hunk-separator-${e}-${t}`}function hL(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function pL(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}let mL=-1;var gL=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++mL}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:xt},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=Zl(e.theme??xt)?MC():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)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??Ex}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t!=="change"?{gutterLineType:t}:{gutterLineType:e==="deletions"?"change-deletion":"change-addition"}}createAnnotationElement=e=>Km(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:a=!1,disableVirtualizationBuffers:s=!1,collapsed:c=!1,expandUnchanged:d=!1,collapsedContextThreshold:f=1,expansionLineCount:h=100,hunkSeparators:m="line-info",lineDiffType:g="word-alt",maxLineDiffLength:y=1e3,overflow:b="scroll",stickyHeader:S=!1,theme:w=xt,headerRenderMode:A="default",tokenizeMaxLineLength:k=1e3,tokenizeMaxLength:E=Sx,useTokenTransformer:T=!1,useCSSClasses:L=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:a,disableVirtualizationBuffers:s,collapsed:c,expandUnchanged:d,collapsedContextThreshold:f,expansionLineCount:h,hunkSeparators:m,lineDiffType:g,maxLineDiffLength:y,overflow:b,stickyHeader:S,theme:this.workerManager?.getDiffRenderOptions().theme??w,headerRenderMode:A,tokenizeMaxLineLength:k,tokenizeMaxLength:E,useTokenTransformer:T,useCSSClasses:L}}async initializeHighlighter(){return this.highlighter=await Ud(QC(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=am(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!kr(t,i.options)&&(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!uc(e),options:t,result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??xn(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:i,tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:c}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:ZC(this.options),tokenizeMaxLineLength:a,lineDiffType:s,maxLineDiffLength:c}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!ds(e,n.diff)||!kr(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Ld){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:a,forceHighlight:s}=this.getRenderOptions(e);const c=this.getMatchingWorkerResultCache(e,a);c!=null&&!this.hasHighlightedRenderCache(e,a)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...c},s=!1),this.renderCache??={diff:e,highlighted:!1,options:a,result:void 0,renderRange:void 0};const d=e.additionLines.length>0||e.deletionLines.length>0,f=!d||uc(e)||am(e,this.getTokenizeMaxLength()),h=!ds(e,this.renderCache.diff),m=!gf(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(f||this.renderCache.result==null||!this.renderCache.highlighted&&(h||m))&&(this.renderCache.diff=e,this.renderCache.options=a,this.renderCache.highlighted=!1,(this.renderCache.result==null||h||m||s)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,pL(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!f&&d&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??xn(e.name);const g=this.highlighter!=null&&Zl(a.theme),y=this.highlighter!=null&&Gd(this.computedLang),b=!f&&y;if(this.highlighter!=null&&g&&(s||f||!this.renderCache.highlighted&&b||this.renderCache.result==null)){const{result:S,options:w}=this.renderDiffWithHighlighter(e,this.highlighter,f||!y);this.renderCache={diff:e,options:w,highlighted:b,result:S,renderRange:void 0}}(!g||!f&&!y)&&this.asyncHighlight(e).then(({result:S,options:w})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,S,w,!f)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Ld){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:a,disableLineNumbers:s,overflow:c}=this.getOptionsWithDefaults();return XC({type:"diff",diffIndicators:i,disableBackground:a,disableLineNumbers:s,overflow:c,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=am(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??xn(e.name);const n=this.highlighter!=null&&Zl(this.options.theme??xt),i=t||this.highlighter!=null&&Gd(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:a}=this.getOptionsWithDefaults();return{result:FC(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:a}),options:i}}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const a=!this.renderCache.highlighted||!kr(this.renderCache.options,n)||!ds(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},a&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!kr(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&ds(e,n.diff)&&kr(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:a}){const{diffStyle:s,disableFileHeader:c,expandUnchanged:d,expansionLineCount:f,collapsedContextThreshold:h,hunkSeparators:m}=this.getOptionsWithDefaults();this.diff=e;const g=s==="unified";let y=[],b=[],S=[];const w=[],{additionLines:A,deletionLines:k}=n,E={rowCount:0,hunkSeparators:m,additionsContentAST:y,deletionsContentAST:b,unifiedContentAST:S,unifiedGutterAST:us(),deletionsGutterAST:us(),additionsGutterAST:us(),expansionLineCount:f,hunkData:w,incrementRowCount(te=1){E.rowCount+=te},pushToGutter(te,le){switch(te){case"unified":E.unifiedGutterAST.children.push(le);break;case"deletions":E.deletionsGutterAST.children.push(le);break;case"additions":E.additionsGutterAST.children.push(le);break}}},T=VC({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),L={size:0,side:void 0,increment(){this.size+=1},flush(){if(s!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(E.pushToGutter("additions",Yn(void 0,"buffer",this.size)),y?.push(ad(this.size))):(E.pushToGutter("deletions",Yn(void 0,"buffer",this.size)),b?.push(ad(this.size))),this.size=0,this.side=void 0}}},O=(te,le,me,H,z)=>{E.pushToGutter(te,OC(le,me,H,z))};function D(te){L.flush(),s==="unified"?om("unified",te,E):(om("deletions",te,E),om("additions",te,E))}this.pushFileLevelAnnotations(e,s,t,E),Xl({diff:e,diffStyle:s,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:d?!0:this.expandedHunks,collapsedContextThreshold:h,callback:({hunkIndex:te,hunk:le,collapsedBefore:me,collapsedAfter:H,additionLine:z,deletionLine:Q,type:ce})=>{const _e=Q!=null?Q.splitLineIndex:z.splitLineIndex,M=z!=null?z.unifiedLineIndex:Q.unifiedLineIndex;s==="split"&&ce!=="change"&&L.flush(),me>0&&D({hunkIndex:te,collapsedLines:me,rangeSize:Math.max(le?.collapsedBefore??0,0),hunkSpecs:le?.hunkSpecs,isFirstHunk:te===0,isLastHunk:!1,isExpandable:!e.isPartial});const q=s==="unified"?M:_e,re={type:ce,hunkIndex:te,lineIndex:q,unifiedLineIndex:M,splitLineIndex:_e,deletionLine:Q,additionLine:z};if(s==="unified"){const Ce=this.getUnifiedInjectedRowsForLine?.(re);Ce?.before!=null&&Zb(Ce.before,E);let He=Q!=null?k[Q.lineIndex]:void 0,We=z!=null?A[z.lineIndex]:void 0;if(He==null&&We==null){const de="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(de,{file:e.name}),new Error(de)}const lt=ce==="change"?z!=null?"change-addition":"change-deletion":ce,ne=this.getUnifiedLineDecoration({type:ce,lineType:lt,additionLineIndex:z?.lineIndex,deletionLineIndex:Q?.lineIndex});O("unified",ne.gutterLineType,z!=null?z.lineNumber:Q.lineNumber,`${M},${_e}`,ne.gutterProperties),We!=null?We=cd(We,ne.contentProperties):He!=null&&(He=cd(He,ne.contentProperties)),ld({diffStyle:"unified",type:ce,deletionLine:He,additionLine:We,unifiedSpan:this.getAnnotations("unified",Q?.lineNumber,z?.lineNumber,te,q),createAnnotationElement:de=>this.createAnnotationElement(de),context:E}),Ce?.after!=null&&Zb(Ce.after,E)}else{const Ce=this.getSplitInjectedRowsForLine?.(re);Ce?.before!=null&&Jb(Ce.before,E,L);let He=Q!=null?k[Q.lineIndex]:void 0,We=z!=null?A[z.lineIndex]:void 0;const lt=this.getSplitLineDecoration({side:"deletions",type:ce,lineIndex:Q?.lineIndex}),ne=this.getSplitLineDecoration({side:"additions",type:ce,lineIndex:z?.lineIndex});if(He==null&&We==null){const Ve="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Ve,{file:e.name}),new Error(Ve)}const de=(()=>{if(ce==="change"){if(We==null)return"additions";if(He==null)return"deletions"}})();if(de!=null){if(L.side!=null&&L.side!==de)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");L.side=de,L.increment()}const Le=this.getAnnotations("split",Q?.lineNumber,z?.lineNumber,te,q);if(Le!=null&&L.size>0&&L.flush(),Q!=null){const Ve=cd(He,lt.contentProperties);O("deletions",lt.gutterLineType,Q.lineNumber,`${Q.unifiedLineIndex},${_e}`,lt.gutterProperties),Ve!=null&&(He=Ve)}if(z!=null){const Ve=cd(We,ne.contentProperties);O("additions",ne.gutterLineType,z.lineNumber,`${z.unifiedLineIndex},${_e}`,ne.gutterProperties),Ve!=null&&(We=Ve)}ld({diffStyle:"split",type:ce,additionLine:We,deletionLine:He,...Le,createAnnotationElement:Ve=>this.createAnnotationElement(Ve),context:E}),Ce?.after!=null&&Jb(Ce.after,E,L)}const ae=s==="split"&&le!=null&&_e===le.splitLineStart+le.splitLineCount-1,he=ae?le.noEOFCRDeletions:!1,Se=ae?le.noEOFCRAdditions:!1,be=(Q?.noEOFCR??!1)||he,Ue=(z?.noEOFCR??!1)||Se;if(Ue||be){if(s==="split"&&L.flush(),be){const Ce=ce==="context"||ce==="context-expanded"?ce:"change-deletion";s==="unified"?(E.unifiedContentAST.push(sd(Ce)),E.pushToGutter("unified",Yn(Ce,"metadata",1))):(E.deletionsContentAST.push(sd(Ce)),E.pushToGutter("deletions",Yn(Ce,"metadata",1)),Ue||(E.pushToGutter("additions",Yn(void 0,"buffer",1)),E.additionsContentAST.push(ad(1))))}if(Ue){const Ce=ce==="context"||ce==="context-expanded"?ce:"change-addition";s==="unified"?(E.unifiedContentAST.push(sd(Ce)),E.pushToGutter("unified",Yn(Ce,"metadata",1))):(E.additionsContentAST.push(sd(Ce)),E.pushToGutter("additions",Yn(Ce,"metadata",1)),be||(E.pushToGutter("deletions",Yn(void 0,"buffer",1)),E.deletionsContentAST.push(ad(1))))}E.incrementRowCount(1)}H>0&&m!=="simple"&&D({hunkIndex:ce==="context-expanded"?te:te+1,collapsedLines:H,rangeSize:T,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),E.incrementRowCount(1)}}),s==="split"&&L.flush();const N=Math.max(hL(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),K=t.bufferBefore>0||t.bufferAfter>0,G=!g&&e.type!=="deleted",se=!g&&e.type!=="new",ie=E.rowCount>0||K;y=G&&ie?y:void 0,b=se&&ie?b:void 0,S=g&&ie?S:void 0;const ee=this.createPreElement(b!=null&&y!=null,N);return{unifiedGutterAST:g&&ie?E.unifiedGutterAST.children:void 0,unifiedContentAST:S,deletionsGutterAST:se&&ie?E.deletionsGutterAST.children:void 0,deletionsContentAST:b,additionsGutterAST:G&&ie?E.additionsGutterAST.children:void 0,additionsContentAST:y,hunkData:w,preNode:ee,themeStyles:i,baseThemeType:a,headerElement:c?void 0:this.renderHeader(this.diff),totalLines:N,rowCount:E.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const a=us(n);return a.properties.style=`grid-row: span ${t.rowCount}`,[a,KC(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(Ne({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const a=this.renderCodeAST("deletions",e);a!=null&&t.push(Ne({tagName:"code",children:a,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",e);return s!=null&&t.push(Ne({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return qi(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?qi(e):qi(Ne({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!mf(n))return;const a=e.type!=="new"?Xb(Wm(this.deletionAnnotations)):[],s=e.type!=="deleted"?Xb(Wm(this.additionAnnotations)):[];if(a.length===0&&s.length===0)return;const c=-1,d=-1,{createAnnotationElement:f}=this;if(t==="unified"){ld({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:a.concat(s)},createAnnotationElement:f,context:i});return}ld({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:a},additionSpan:{type:"annotation",hunkIndex:c,lineIndex:d,annotations:s},createAnnotationElement:f,context:i})}getAnnotations(e,t,n,i,a){const s={type:"annotation",hunkIndex:i,lineIndex:a,annotations:[]};if(t!=null)for(const d of this.deletionAnnotations[t]??[])s.annotations.push(ki(d));const c={type:"annotation",hunkIndex:i,lineIndex:a,annotations:[]};if(n!=null)for(const d of this.additionAnnotations[n]??[])(e==="unified"?s:c).annotations.push(ki(d));if(e==="unified")return s.annotations.length>0?s:void 0;if(!(c.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:c}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return YC({fileOrDiff:e,mode:t,stickyHeader:n})}};function Xb(e){return e?.map(t=>ki(t))??[]}const vL=new Intl.PluralRules("en-US");function Qb(e){return`${e} unmodified line${vL.select(e)==="one"?"":"s"}`}function Zb(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function Jb(e,t,n){for(const{deletion:i,addition:a}of e){if(i==null&&a==null)continue;const s=i!=null&&a!=null?void 0:i==null?"deletions":"additions";(s==null||n.side!==s)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),a!=null&&(t.additionsContentAST.push(a.content),t.pushToGutter("additions",a.gutter)),s!=null&&(n.side=s,n.increment()),t.incrementRowCount(1)}}function ld({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:a,deletionSpan:s,additionSpan:c,createAnnotationElement:d,context:f}){let h=!1;if(e==="unified"){if(i!=null?f.unifiedContentAST.push(i):n!=null&&f.unifiedContentAST.push(n),a!=null){const m=t==="change"?n!=null?"change-deletion":"change-addition":t;f.unifiedContentAST.push(d(a)),f.pushToGutter("unified",Yn(m,"annotation",1)),h=!0}}else if(e==="split"){if(n!=null&&f.deletionsContentAST.push(n),i!=null&&f.additionsContentAST.push(i),s!=null){const m=t==="change"?n!=null?"change-deletion":"context":t;f.deletionsContentAST.push(d(s)),f.pushToGutter("deletions",Yn(m,"annotation",1)),h=!0}if(c!=null){const m=t==="change"?i!=null?"change-addition":"context":t;f.additionsContentAST.push(d(c)),f.pushToGutter("additions",Yn(m,"annotation",1)),h=!0}}h&&f.incrementRowCount(1)}function om(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:a,isFirstHunk:s,isLastHunk:c,isExpandable:d},f){if(n<=0)return;const h=e==="unified"?f.unifiedContentAST:e==="deletions"?f.deletionsContentAST:f.additionsContentAST;if(f.hunkSeparators==="metadata"){a!=null&&(f.pushToGutter(e,os({type:"metadata",content:a,isFirstHunk:s,isLastHunk:c})),h.push(os({type:"metadata",content:a,isFirstHunk:s,isLastHunk:c})),e!=="additions"&&f.incrementRowCount(1));return}if(f.hunkSeparators==="simple"){t>0&&(f.pushToGutter(e,os({type:"simple",isFirstHunk:s,isLastHunk:!1})),h.push(os({type:"simple",isFirstHunk:s,isLastHunk:!1})),e!=="additions"&&f.incrementRowCount(1));return}const m=fL(e,t),g=i>f.expansionLineCount,y=d?t:void 0;f.pushToGutter(e,os({type:f.hunkSeparators,content:Qb(n),expandIndex:y,chunked:g,slotName:m,isFirstHunk:s,isLastHunk:c})),h.push(os({type:f.hunkSeparators,content:Qb(n),expandIndex:y,chunked:g,slotName:m,isFirstHunk:s,isLastHunk:c})),e!=="additions"&&f.incrementRowCount(1),f.hunkData.push({slotName:m,hunkIndex:t,lines:n,type:e,expandable:d?{up:!s,down:!c,chunked:g}:void 0})}function cd(e,t){return e==null||e.type!=="element"||t==null?e:{...e,properties:{...e.properties,...t}}}function am(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function yL(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function bL(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function SL(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}let _L=-1;var CL=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++_L}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:xt},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new WC,this.scrollSyncManager=new dL,this.interactionManager=new GC("diff",qd(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 SL(e)}createHunksRenderer(e){return new gL(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let i,a;e:for(const s of this.fileDiff.hunks){let c=t==="deletions"?s.deletionStart:s.additionStart;const d=t==="deletions"?s.deletionCount:s.additionCount;let f=s.splitLineStart,h=s.unifiedLineStart;if(e<c){const m=c-e;i=Math.max(h-m,0),a=Math.max(f-m,0);break e}if(e>=c+d){if(s===n){const m=e-(c+d);i=h+s.unifiedLineCount+m,a=f+s.splitLineCount+m;break e}continue}for(const m of s.hunkContent)if(m.type==="context")if(e<c+m.lines){const g=e-c;a=f+g,i=h+g;break e}else c+=m.lines,f+=m.lines,h+=m.lines;else{const g=t==="deletions"?m.deletions:m.additions;if(e<c+g){const y=e-c;i=h+(t==="additions"?m.deletions:0)+y,a=f+y;break e}else c+=g,f+=Math.max(m.deletions,m.additions),h+=m.deletions+m.additions}break e}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(qd(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;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!ua(this.appliedThemeCSS.theme,this.options.theme??xt)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:a,oldFile:s,newFile:c,fileDiff:d}=e;this.hydrateElements(t,n),xL(this.pre,EL({fileDiff:d,oldFile:s,newFile:c}),this.options.collapsed)||TL(this.headerElement,wL({fileDiff:d,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:d,oldFile:s,newFile:c,lineAnnotations:a}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),uE(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.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:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?Qm(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:i=!1,forceRender:a=!1,preventEmit:s=!1,lineAnnotations:c,fileContainer:d,containerWrapper:f,renderRange:h}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:m=!1,themeType:g="system"}=this.options,y=m?void 0:h,b=this.hasThemeChanged(),S=e!=null&&t!=null&&(!vo(e,this.deletionFile)||!vo(t,this.additionFile));let w=n!=null&&n!==this.fileDiff;const A=c!=null&&(c.length>0||this.lineAnnotations.length>0)?c!==this.lineAnnotations:!1;if(!m&&gf(y,this.renderRange)&&!a&&!A&&!b&&(n!=null&&n===this.fileDiff||n==null&&!S))return this.applyCachedThemeState(g);const{renderRange:k}=this;if(this.renderRange=y,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&S&&(w=!0,this.fileDiff=Qm(e,t,this.options.parseDiffOptions)),w&&(this.cachedHeaderHTML=void 0),c!=null&&this.setLineAnnotations(c),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:E=!1,disableFileHeader:T=!1}=this.options;if(T&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),d=this.getOrCreateFileContainer(d,f),this.applyCachedThemeState(g),m){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const L=this.hunksRenderer.renderDiff(this.fileDiff,X_);L!=null&&this.applyThemeState(d,L.themeStyles,g,L.baseThemeType),L?.headerElement!=null&&this.applyHeaderToDOM(L.headerElement,d),this.renderSeparators([]),this.injectUnsafeCSS()}catch(L){if(E)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,d)}return s||this.emitPostRender(),!0}try{const L=this.getOrCreatePreNode(d);if(!(this.canPartiallyRender(a,A,S||w||b)&&this.applyPartialRender({previousRenderRange:k,renderRange:y}))){const O=this.hunksRenderer.renderDiff(this.fileDiff,y);if(O==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(d,O.themeStyles,g,O.baseThemeType),O.headerElement!=null&&this.applyHeaderToDOM(O.headerElement,d),O.additionsContentAST!=null||O.deletionsContentAST!=null||O.unifiedContentAST!=null?this.applyHunksToDOM(L,O):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(O.hunkData)}this.applyBuffers(L,y),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,i||this.flushManagers()}catch(L){if(E)throw L;console.error(L),L instanceof Error&&this.applyErrorToDOM(L,d)}return s||this.emitPostRender(),!0}emitPostRender(e=!1){const{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;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}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(const{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{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){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{fileDiff:e,workerManager:t}=this;if(e==null||t==null||uc(e))return;const n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.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.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){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const i of e){const a=i.slotName;let s=this.separatorCache.get(a);if(s==null||!bL(i,s.hunkData)){s?.element.remove();const c=document.createElement("div");c.style.display="contents",c.slot=i.slotName;const d=t(i,this);d!=null&&c.appendChild(d),this.fileContainer.appendChild(c),s={element:c,hunkData:i},this.separatorCache.set(a,s)}n.delete(a)}for(const[i,{element:a}]of n.entries())this.separatorCache.delete(i),a.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const a=`${n}-${ki(i)}`;let s=this.annotationCache.get(a);if(s==null||!yL(i,s.annotation)){s?.element.remove();const c=t(i);if(c==null)continue;s={element:tE(ki(i)),annotation:i},s.element.appendChild(c),this.fileContainer.appendChild(s.element),this.annotationCache.set(a,s)}e.delete(a)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=nE();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),a=n!==i;return a&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&a&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),a&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const n of t.children)n instanceof SVGElement?this.spriteSVG??=n:hc(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):hc(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=JC;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const 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;const{fileDiff:n}=this,i=this.cachedHeaderHTML??qi(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const h=document.createElement("div");h.innerHTML=i;const m=h.firstElementChild;if(!(m instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(m,this.headerElement):t.shadowRoot?.prepend(m),this.headerElement=m,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;const{renderCustomHeader:a,renderHeaderPrefix:s,renderHeaderMetadata:c}=this.options;if(a!=null){const h=a(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,Cc,h),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}const d=s?.(n)??void 0,f=c?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,bg,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Sg,f),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const a=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(a),this.replaceHeaderSlotContent(a,i),a}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{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??=iE(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=aE(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const a=e.shadowRoot??e.attachShadow({mode:"open"}),s=i??n,c=this.options.theme??xt,d=typeof c=="string"?c:{...c},f=pc(a);if(this.themeCSSStyle?.parentNode===a&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===f){this.appliedThemeCSS.theme=d;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===a){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f};return}this.themeCSSStyle=cE({shadowRoot:a,currentNode:this.themeCSSStyle,themeCSS:sE(t,s,f)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:d,themeStyles:t,themeType:s,baseThemeType:i,scrollbarGutter:f}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=lE(this.themeCSSStyle.textContent??"",pc(e)))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",a=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let s=!1;const c=[],d=this.hunksRenderer.renderCodeAST("unified",t),f=this.hunksRenderer.renderCodeAST("deletions",t),h=this.hunksRenderer.renderCodeAST("additions",t);d!=null?(s=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=Sd({code:this.codeUnified,columnType:"unified",rowSpan:a,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(d),c.push(this.codeUnified)):f!=null||h!=null?(f!=null?(s=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Sd({code:this.codeDeletions,columnType:"deletions",rowSpan:a,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(f),c.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),h!=null?(s=s||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Sd({code:this.codeAdditions,columnType:"additions",rowSpan:a,containerSize:i}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(h),c.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),c.length===0?e.textContent="":s&&e.replaceChildren(...c),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:i,codeAdditions:a,codeDeletions:s,options:{diffStyle:c="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const d=this.getCodeColumns(c,i,s,a);if(d==null)return!1;const f=e.startingLine,h=t.startingLine,m=f+e.totalLines,g=h+t.totalLines,y=Math.max(f,h),b=Math.min(m,g);if(b<=y)return!1;const S=Math.max(0,y-f),w=Math.max(0,m-b),A=this.trimColumns({columns:d,trimStart:S,trimEnd:w,previousStart:f,overlapStart:y,overlapEnd:b,diffStyle:c});if(A<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<A)throw new Error("applyPartialRender: trimmed beyond DOM row count");let k=this.lastRowCount-A;const E=(D,N)=>{if(!(N<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:D,totalLines:N,bufferBefore:0,bufferAfter:0})},T=E(h,Math.max(y-h,0));if(T==null&&h<y)return!1;const L=E(b,Math.max(g-b,0));if(L==null&&g>b)return!1;const O=(D,N)=>{if(D!=null){if(c==="unified"&&!Array.isArray(d))this.insertPartialHTML(c,d,D,N);else if(c==="split"&&Array.isArray(d))this.insertPartialHTML(c,d,D,N);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");k+=D.rowCount}};return this.cleanupErrorWrapper(),O(T,"afterbegin"),O(L,"beforeend"),this.lastRowCount!==k&&(this.applyRowSpan(c,d,k),this.lastRowCount=k),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){const a=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,a,i)}else if(e==="split"&&Array.isArray(t)){const a=this.hunksRenderer.renderCodeAST("deletions",n),s=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],a,i),this.renderPartialColumn(t[1],s,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const i=eS(t[0]),a=eS(t[1]);if(i==null||a==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const s=a.at(0);n==="beforeend"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,a,!0);const c=a.at(-1);n==="afterbegin"&&c?.type==="element"&&typeof c.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(c.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,a,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(a))}mergeBuffersIfNecessary(e,t,n,i,a,s){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const c=this.getBufferSize(t.dataset);c!=null&&(s?(i.shift(),a.shift()):(i.pop(),a.pop()),this.updateBufferSize(t,c+e),this.updateBufferSize(n,c+e))}applyRowSpan(e,t,n){const i=a=>{a!=null&&(a.gutter.style.setProperty("grid-row",`span ${n}`),a.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,a=0,s=0,c=!1;const d=n>=0;if(e==null)return 0;const f=Array.from(e.content.children),h=Array.from(e.gutter.children);if(f.length!==h.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;s<f.length&&!(t<=0&&!d&&!c);){const m=h[s],g=f[s];if(s++,!(m instanceof HTMLElement)||!(g instanceof HTMLElement))throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: invalid row elements");if(c&&(c=!1,m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset||m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset)){m.remove(),g.remove(),a++;continue}if("lineIndex"in m.dataset&&"lineIndex"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),t>0&&(t--,t===0&&(c=!0)),a++),i++;continue}if("separator"in m.dataset&&"separator"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="metadata"&&"noNewline"in g.dataset){(t>0||d&&i>=n)&&(m.remove(),g.remove(),a++);continue}if(m.dataset.gutterBuffer==="buffer"&&"contentBuffer"in g.dataset){const y=this.getBufferSize(g.dataset);if(y==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const b=Math.min(t,y),S=y-b;S>0?(this.updateBufferSize(m,S),this.updateBufferSize(g,S),a+=b):(m.remove(),g.remove(),a+=y),t-=b,t===0&&S===0&&(c=!0)}else if(d){const b=i,S=i+y-1;if(n<=b)m.remove(),g.remove(),a+=y;else if(n<=S){const w=S-n+1,A=y-w;this.updateBufferSize(m,A),this.updateBufferSize(g,A),a+=w}}i+=y;continue}throw console.error({gutterElement:m,contentElement:g}),new Error("FileDiff.trimColumnRows: unknown row elements")}return a}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:a,trimEnd:s,trimStart:c}){const d=Math.max(0,i-a),f=n-a;if(f<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const h=c>0,m=s>0;if(!h&&!m)return 0;const g=h?d:0,y=m?f:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,g,y);if(t==="split"&&Array.isArray(e)){const b=this.trimColumnRows(e[0],g,y),S=this.trimColumnRows(e[1],g,y);if(e[0]!=null&&e[1]!=null&&b!==S)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?b:S}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,i){function a(s){if(s==null)return;const c=s.children[0],d=s.children[1];if(!(!(c instanceof HTMLElement)||!(d instanceof HTMLElement)||c.dataset.gutter==null||d.dataset.content==null))return{gutter:c,content:d}}if(e==="unified")return a(t);{const s=a(n),c=a(i);return s!=null||c!=null?[s,c]:void 0}}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==null&&(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==null&&(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:i},a){const{diffIndicators:s="bars",disableBackground:c=!1,disableLineNumbers:d=!1,overflow:f="scroll",diffStyle:h="split"}=this.options,m={type:"diff",diffIndicators:s,disableBackground:c,disableLineNumbers:d,overflow:f,split:h==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:a};eE(m,this.appliedPreAttributes)||(dE(e,m),this.appliedPreAttributes=m)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);const a=document.createElement("pre");a.dataset.errorStack="",a.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(a)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function EL({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function wL({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function xL(e,t,n=!1){return!n&&e==null&&t}function TL(e,t,n=!1){return e==null&&t&&!n}function eS(e){if(!(e==null||e.type!=="element"))return e.children??[]}const Zm=5e3;let kL=-1;var AL=class extends CL{__id=`little-virtualized-file-diff:${++kL}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,i,a=!1){super(e,i,a),this.virtualizer=t,this.metrics=Qp(n)}setMetrics(e,t=!1){const n=Qp(e);!t&&vs(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){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){return e==null||!Gm(this.lineAnnotations)?!1:this.lineAnnotations.some(t=>t.lineNumber!==0?!1:e.type==="new"?t.side==="additions":e.type==="deleted"?t.side==="deletions":!0)}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!pf(t,e),i=n&&OL(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:PL(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;const{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;const n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],a=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&a&&mf(this.renderRange)){const s=LL(i)??0;this.setFileAnnotationHeight(s)&&(e=!0)}else!a&&this.setFileAnnotationHeight(0)&&(e=!0);for(const s of i){if(s==null)continue;const c=s.children[1];if(c instanceof HTMLElement)for(const d of c.children){if(!(d instanceof HTMLElement))continue;const f=d.dataset.lineIndex;if(f==null)continue;const h=HL(f,n);let m=d.getBoundingClientRect().height,g=!1;d.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in d.nextElementSibling.dataset||"noNewline"in d.nextElementSibling.dataset)&&("noNewline"in d.nextElementSibling.dataset&&(g=!0),m+=d.nextElementSibling.getBoundingClientRect().height);const y=this.getEstimatedLineHeight(g),b=this.cache.heightDeltas.get(h)??0,S=m-y;S!==b&&(e=!0,this.cache.measuredHeightDeltaTotal+=S-b,S===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,S))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,i){const a=!ds(this.fileDiff,e),s=this.syncLineAnnotations(i);let c=n?.resetDiffLayoutCache===!0||a||s,d=a||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=Qp(n.metrics),c=!0,d=!0);const{collapsed:f=!1}=this.options;return this.currentCollapsed!==f&&(this.currentCollapsed=f,c=!0),c&&this.resetLayoutCache({includeEstimatedHeights:d}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null||e<1)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:s=!1,collapsedContextThreshold:c=1}=this.options,d=this.getDiffStyle(),f=this.getHunkSeparatorType(),h=d==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const m=ji(this.metrics,i),g=this.getLayoutCheckpointBeforeLineIndex(h);let y=g?.top??m+this.cache.fileAnnotationHeight;if(s)return{top:m,height:0};let b;return Xl({diff:this.fileDiff,diffStyle:d,startingLine:g?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:c,callback:({hunkIndex:S,hunk:w,collapsedBefore:A,collapsedAfter:k,deletionLine:E,additionLine:T})=>{const L=d==="split"?T?.splitLineIndex??E?.splitLineIndex:T?.unifiedLineIndex??E?.unifiedLineIndex;if(L==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(A>0){const D=Ul({type:f,metrics:this.metrics,hunkIndex:S,hunkSpecs:w?.hunkSpecs});if(D!=null){if(y+=D.gapBefore,h>=L-A&&h<L)return b={top:y,height:D.height},!0;y+=D.height+D.gapAfter}}const O=this.getLineHeight(L,(T?.noEOFCR??!1)||(E?.noEOFCR??!1));if(L===h)return b={top:y,height:O},!0;if(y+=O,k>0){const D=Fl({type:f,metrics:this.metrics});if(D!=null){if(h>L&&h<=L+k)return b={top:y+D.gapBefore,height:D.height},!0;y+=D.totalHeight}}return!1}}),b}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;const s=this.getDiffStyle(),c=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const d=this.getLayoutCheckpointBeforeTop(e);let f=d?.top??ji(this.metrics,t)+this.cache.fileAnnotationHeight,h;return Xl({diff:this.fileDiff,diffStyle:s,startingLine:d?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:m,hunk:g,collapsedBefore:y,collapsedAfter:b,deletionLine:S,additionLine:w})=>{const A=s==="split"?w?.splitLineIndex??S?.splitLineIndex:w?.unifiedLineIndex??S?.unifiedLineIndex;if(A==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(y>0){const E=Ul({type:c,metrics:this.metrics,hunkIndex:m,hunkSpecs:g?.hunkSpecs});E!=null&&(f+=E.totalHeight)}if(f>=e&&(S!=null?h={lineNumber:S.lineNumber,side:"deletions",top:f}:w!=null&&(h={lineNumber:w.lineNumber,side:"additions",top:f}),h!=null))return!0;const k=this.getLineHeight(A,(w?.noEOFCR??!1)||(S?.noEOFCR??!1));if(f+=k,b>0){const E=Fl({type:c,metrics:this.metrics});E!=null&&(f+=E.totalHeight)}return!1}}),h}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};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:a}=t;let s=0;if(a===0){const c=e??this.virtualizer.getWindowSpecs();this.top<c.top&&(s=i)}return{topOffset:this.top+n+s,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:a=!1}=this.options,s=ji(this.metrics,i);if(this.height+=s,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();const e=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:i,unifiedHeight:a}=G6({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;const e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:i,forceRender:a=!1,lineAnnotations:s,...c}={}){const{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;const h=this.syncLineAnnotations(s);if(h&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=i??(t!=null&&n!=null?Qm(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(f)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const b=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(b==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");b.connect(e,this),this.isVisible=b.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const m=this.virtualizer.getWindowSpecs(),g=this.top??0,y=this.computeRenderRangeFromWindow(this.fileDiff,g,m);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:y,oldFile:t,newFile:n,lineAnnotations:s,forceRender:(d??a)||h,...c})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return NL(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,i=this.fileDiff.hunks.length-1,a=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=t?!0:this.hunksRenderer.getExpandedHunksMap(),d=IL(this.cache.heightDeltas);let f=ji(this.metrics,e)+this.cache.fileAnnotationHeight,h=0;const m=({rowCount:g,startLineIndex:y,preSeparatorHeight:b=0,postSeparatorHeight:S=0,metadataOffsets:w=[]})=>{if(g<=0)return;const A=h,k=h+g;let E=RL(A);for(;E<k;){const T=E-A,L=f+(T>0?b:0)+T*this.metrics.lineHeight+DL(w,T)*this.metrics.lineHeight+tS(d,y,y+T);this.cache.checkpoints.push({renderedLineIndex:E,lineIndex:y+T,top:L}),E+=Zm}f+=b+g*this.metrics.lineHeight+w.length*this.metrics.lineHeight+tS(d,y,y+g)+S,h=k};for(let g=0;g<this.fileDiff.hunks.length;g++){const y=this.fileDiff.hunks[g];if(y==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const b=dc({isPartial:this.fileDiff.isPartial,rangeSize:y.collapsedBefore,expandedHunks:c,hunkIndex:g,collapsedContextThreshold:n}),S=b.collapsedLines>0?Ul({type:s,metrics:this.metrics,hunkIndex:g,hunkSpecs:y.hunkSpecs})?.totalHeight??0:0;m({rowCount:b.fromStart,startLineIndex:(a==="split"?y.splitLineStart:y.unifiedLineStart)-b.rangeSize});let w=S;m({rowCount:b.fromEnd,startLineIndex:(a==="split"?y.splitLineStart:y.unifiedLineStart)-b.fromEnd,preSeparatorHeight:w}),b.fromEnd>0&&(w=0);const A=g===i?fc({fileDiff:this.fileDiff,hunkIndex:g,expandedHunks:c,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,k=A!=null&&A.collapsedLines>0?Fl({type:s,metrics:this.metrics})?.totalHeight??0:0,E=A!=null?A.fromStart+A.fromEnd:0,T=a==="split"?y.splitLineCount:y.unifiedLineCount,L=a==="split"?y.splitLineStart:y.unifiedLineStart;m({rowCount:T,startLineIndex:L,preSeparatorHeight:w,postSeparatorHeight:E===0?k:0,metadataOffsets:ML({diffStyle:a,hunk:y,rowCount:T})}),A!=null&&E>0&&m({rowCount:E,startLineIndex:L+T,postSeparatorHeight:k})}this.cache.totalLines=h}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const a=t+n>>1,s=this.cache.checkpoints[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.lineIndex<=e?(i=s,t=a+1):n=a-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");c.top<=e?(a=s,n=s+1):i=s-1}if(t==null)return a>=0?this.cache.checkpoints[a]:void 0;for(let s=a;s>=0;s--){const c=this.cache.checkpoints[s];if(c==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(c.renderedLineIndex%t===0)return c}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(const d of e.hunks)n+=t==="split"?d.splitLineCount:d.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:a=1}=this.options,s=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[d,f]of e.hunks.entries()){const h=t==="split"?f.splitLineCount:f.unifiedLineCount;n+=h;const m=Math.max(f.collapsedBefore,0),{fromStart:g,fromEnd:y,renderAll:b}=dc({isPartial:e.isPartial,rangeSize:m,expandedHunks:s,hunkIndex:d,collapsedContextThreshold:a});m>0&&(n+=b?m:g+y)}const c=fc({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:s,collapsedContextThreshold:a,errorPrefix:"VirtualizedFileDiff"});return c!=null&&(n+=c.fromStart+c.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:a=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1}=this.options,{hunkLineCount:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),m=this.getHunkSeparatorType(),g=this.height;let y=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,h);const b=ji(this.metrics,a),S=e.hunks.length>0?$d(this.metrics):0,{fileAnnotationHeight:w}=this.cache,A=b+w,k=Math.max(0,g-b-w-S),E=this.hasFileAnnotations(e),T=t+b,L=w>0&&E&&T<i&&T+w>n;if(t<n-g||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-b-S};if(y<=d||e.hunks.length===0)return{startingLine:0,totalLines:d,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),y=this.cache.totalLines>0?this.cache.totalLines:y;const O=Math.ceil(Math.max(i-n,0)/f),D=Math.ceil(O/d)*d+d,N=D/d,K=N,G=[],se=(n+i)/2,ie=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-D*f*2),d);let ee=t+(ie?.top??A),te=ie?.renderedLineIndex??0,le,me,H;if(Xl({diff:e,diffStyle:h,startingLine:ie?.renderedLineIndex??0,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:c,callback:({hunkIndex:Se,hunk:be,collapsedBefore:Ue,collapsedAfter:Ce,deletionLine:He,additionLine:We})=>{const lt=We!=null?We.splitLineIndex:He.splitLineIndex,ne=We!=null?We.unifiedLineIndex:He.unifiedLineIndex,de=(We?.noEOFCR??!1)||(He?.noEOFCR??!1),Le=(Ue>0?Ul({type:m,metrics:this.metrics,hunkIndex:Se,hunkSpecs:be?.hunkSpecs}):void 0)?.totalHeight??0;ee+=Le;const Ve=te%d===0,Tt=Math.floor(te/d);if(Ve&&(G[Tt]=ee-(t+A+Le),H!=null)){if(H<=0)return!0;H--}const vn=this.getLineHeight(h==="split"?lt:ne,de);return ee>n-vn&&ee<i&&(le??=Tt),me==null&&ee+vn>se&&(me=Tt),H==null&&ee>=i&&Ve&&(H=K),te++,ee+=vn,Ce>0&&(ee+=Fl({type:m,metrics:this.metrics})?.totalHeight??0),!1}}),le==null)if(L)le=0,me=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:g-b-S};me??=le;const z=Math.round(me-N/2),Q=Math.max(0,Math.ceil(y/d)-N),ce=Math.max(0,Math.min(z,Q)),_e=ce*d,M=z<0?D+z*d:D,q=G[ce]??0,re=_e===0?0:w+q,ae=ce+M/d,he=ae<G.length?k-G[ae]:k-(ee-t-A);return{startingLine:_e,totalLines:M,bufferBefore:re,bufferAfter:Math.max(0,he)}}};function LL(e){let t;for(const n of e){if(n==null)continue;const i=n.children[1];if(i instanceof HTMLElement)for(const a of i.children)a instanceof HTMLElement&&a.dataset.lineAnnotation===qC&&(t=Math.max(t??0,a.getBoundingClientRect().height))}return t}function IL(e){const t=Array.from(e).sort((s,c)=>s[0]-c[0]),n=[],i=[0];let a=0;for(const[s,c]of t)n.push(s),a+=c,i.push(a);return{lineIndexes:n,prefixTotals:i}}function tS({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const a=nS(e,n);return(t[nS(e,i)]??0)-(t[a]??0)}function nS(e,t){let n=0,i=e.length;for(;n<i;){const a=n+i>>1,s=e[a];if(s==null)throw new Error("VirtualizedFileDiff: invalid prefix index");s<t?n=a+1:i=a}return n}function RL(e){return Math.ceil(e/Zm)*Zm}function DL(e,t){let n=0;for(const i of e)i<t&&n++;return n}function ML({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];const a=Math.max(i.deletions,i.additions),s=i.deletions+i.additions;if(e==="split")return a>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const c=[],d=n-s;return i.deletions>0&&t.noEOFCRDeletions&&c.push(d+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&c.push(n-1),c}function OL(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function PL(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function NL(e){return typeof e=="function"?"custom":e??"line-info"}function HL(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}const zL=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","diffStyle","diffIndicators","disableBackground","expandUnchanged","collapsedContextThreshold","lineDiffType","maxLineDiffLength","expansionLineCount","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],VL=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],iS=["renderCustomHeader","renderHeaderPrefix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","onPostRender","onGutterUtilityClick","onLineClick","onLineNumberClick","onLineEnter","onLineLeave","onTokenClick","onTokenEnter","onTokenLeave"],rS=["onLineSelected","onLineSelectionStart","onLineSelectionChange","onLineSelectionEnd"],yE=Symbol("CodeView.itemOptionsState");function oS(e,t){Object.defineProperty(e,yE,{configurable:!1,enumerable:!1,value:t})}function Ml(e){return e[yE]}function wr(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}const BL=120,aS="--diffs-overflow-override",Fg=12e6,bE=1e6,SE=2e6,UL=Fg-SE,sS=Fg-bE,FL=(()=>{const{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),i=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(n||i)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})();var jL=class Tr{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=Ll;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isContainerManaged;constructor(t={theme:xt},n,i=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=n,this.isContainerManaged=i,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??_x}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??Ll.hunkLineCount,lineHeight:t?.lineHeight??Ll.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??Ll.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??Ll.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??Cx}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return ux&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;const n=t.instance.getAdvancedStickySpecs();if(n==null)return;const i=n.height,a=t.element.getBoundingClientRect().height;i!==a&&console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:i,actualHeight:a,delta:a-i,stickyTopOffset:n.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;const{firstIndex:t,lastIndex:n,stickyHeight:i,stickyTop:a,stickyBottom:s}=this.renderState;if(t===-1||n===-1)return;const c=this.stickyContainer.getBoundingClientRect().height;Math.abs(c-i)<1||console.error("CodeView: sticky container height does not match computed layout",{computedStickyHeight:i,actualStickyHeight:c,delta:c-i,stickyTop:a,stickyBottom:s,firstIndex:t,lastIndex:n,firstStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[n]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents="none",this.pointerEventsDisabled=!0),FL&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(aS,"hidden"),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,BL)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&(this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1),this.codeOverflowFix&&(this.stickyContainer.style.setProperty(aS,"auto"),this.codeOverflowFix=!1)};syncLayout(){const{gap:t,paddingBottom:n,paddingTop:i}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${i}px`),this.container?.style.setProperty("margin-bottom",`${n}px`)}setup(t){if(this.root!=null)throw new Error("CodeView.setup: already setup");this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",this.root.hasAttribute("tabindex")||(this.root.tabIndex=-1),this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{Tr.__STOP?(Tr.__STOP=!1,this.scrollTo({type:"position",position:Tr.__lastScrollPosition,behavior:"instant"})):(Tr.__lastScrollPosition=this.getScrollTop(),Tr.__STOP=!0)}}reset(){this.restoreScrollInteractions(),this.cleanAllRenderedItems(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){const n=this.items[t];if(n==null)throw new Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(n)}}primeScrollTarget(t){if(t.type==="position")return;const n=this.idToItem.get(t.id);n?.instance.primeHighlightCache()}getElementPoolLimit(){const t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:n}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(n,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();for(;t!=null&&!this.isElementPoolGenerationCurrent(t);)t=this.elementPool.pop();return t??=document.createElement(W_),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){const{element:n}=t;n!=null&&this.renderedItemOwnsFocus(n)&&(this.shouldFixContainerFocus=!0),t.instance.cleanUp(!0),t.element=void 0,n!=null&&(n.remove(),this.cleanElement(n),this.queueElementForPool(n))}renderedItemOwnsFocus(t){const{activeElement:n}=document;return n===t||t.contains(n)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(t){const{shadowRoot:n}=t;if(n!=null)for(const i of Array.from(n.children))KL(i)||i.remove();this.isContainerManaged||t.replaceChildren()}queueElementForPool(t){const n=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=n||(this.isElementClean(t)?this.elementPool.push(t):this.pendingElementPool.push(t))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;const{pendingElementPool:t}=this;this.pendingElementPool=[];const n=this.getElementPoolLimit();for(const i of t)this.isElementPoolGenerationCurrent(i)&&this.isElementClean(i)&&this.elementPool.length<n?this.elementPool.push(i):this.isElementPoolGenerationCurrent(i)&&this.getElementPoolSize()<n&&this.pendingElementPool.push(i)}isElementClean(t){return t.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(t){this.elementPoolTracker.set(t,this.elementPoolVersion)}isElementPoolGenerationCurrent(t){return this.elementPoolTracker.get(t)===this.elementPoolVersion}resolveEffectiveScrollBehavior(t,n){return u6()?"instant":t.behavior!=="smooth-auto"?t.behavior??"instant":Math.abs(n-this.getScrollTop())<=this.getHeight()*10?"smooth":"instant"}scrollTo(t){if(this.root==null)return;const n=this.normalizeScrollTarget(t);if(n==null)return;const i=this.resolveScrollTargetTop(n);i!=null&&(this.primeScrollTarget(n),this.resolveEffectiveScrollBehavior(n,i)==="smooth"?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=n,this.render())}setSelectedLines(t,n){this.applySelectedLines(t,n)}getSelectedLines(){return this.selectedLines}clearSelectedLines(t){this.applySelectedLines(null,t)}getItem(t){return this.idToItem.get(t)?.item}updateItem(t){const n=this.idToItem.get(t.id);return n==null?(console.error(`CodeView.updateItem: unknown item id "${t.id}"`),!1):this.syncItemRecord(n,t)?(this.markItemLayoutDirty(n),this.scrollDirty=!0,this.render(),this.syncSelection(),!0):!1}updateItemId(t,n){if(t===n)return!0;const i=this.idToItem.get(t);return i==null?(console.error(`CodeView.updateItemId: unknown item id "${t}"`),!1):this.idToItem.has(n)?(console.error(`CodeView.updateItemId: duplicate item id "${n}"`),!1):(this.idToItem.delete(t),i.item.id=n,this.idToItem.set(n,i),this.updateItemOptionsId(i.instance.options,n),this.selectedLines?.id===t&&(this.selectedLines={...this.selectedLines,id:n},this.options.onSelectedLinesChange?.(this.selectedLines)),this.renamePendingScrollTarget(t,n),this.renamePendingLayoutAnchor(t,n),this.render(),!0)}addItem(t){this.addItems([t]),this.syncSelection()}addItems(t){this.appendItemsInternal(t),this.syncSelection()}setItems(t){t.length===0?this.reset():this.items.length===0?this.appendItemsInternal(t):this.tryAppendItems(t)||this.reconcileItems(t),this.syncSelection()}appendItemsInternal(t,n=!0){if(t.length===0)return;const i=this.getLayout();let a=this.items.length===0?0:this.scrollHeight+i.gap;const s=a;for(let c=0;c<t.length;c++){const d=t[c];if(d==null)throw new Error("CodeView.appendItemsInternal: missing input item");if(this.idToItem.has(d.id))throw new Error(`CodeView.addItem: duplicate id "${d.id}"`);const f=this.createItem(d,this.items.length,a);this.items.push(f),this.idToItem.set(f.item.id,f),this.instanceToItem.set(f.instance,f),f.height=$L(f),a+=f.height+i.gap}this.scrollHeight=a-i.gap,this.scrollDirty=!0,n&&(this.canSkipRenderForAppend(s)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(t){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&t>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();const{options:n}=this,i=this.getLayout(),{itemMetricsCache:a}=this;qL(n,t)&&this.invalidateElementPool(),this.options=t;const s=this.computeMetricsCache(t.itemMetrics),c=!vs(a,s),d=!vs(i,this.getLayout());d&&this.syncLayout();const f=c||GL(n,t);if(f){const h=this.pendingLayoutReset;this.pendingLayoutReset={metrics:c?s:h?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:h?.includeEstimatedDiffHeights===!0||c||WL(n,t)}}(d||f)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),pf(n,t)||this.renderOptionsRevision++,!this.isContainerManaged&&this.items.length>0&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){Tr.__STOP||(t?(l6(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):s6(this.computeRenderRangeAndEmit))}instanceChanged(t,n){const i=this.instanceToItem.get(t);if(i==null)throw new Error("CodeView.instanceChanged: An instance has changed that is not registered");n&&this.markItemLayoutDirty(i),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getRenderedItems(){const{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1||n===-1||n<t)return[];const i=[];for(let a=t;a<=n;a++){const s=this.items[a];s?.element!=null&&(s.type==="diff"?i.push({id:s.item.id,type:"diff",item:s.item,version:s.version,element:s.element,instance:s.instance}):i.push({id:s.item.id,type:"file",item:s.item,version:s.version,element:s.element,instance:s.instance}))}return i}setSlotCoordinator(t){return t===this.slotCoordinator?!1:(this.slotCoordinator=t,this.slotSnapshot=void 0,!0)}getSlotSnapshot(t){return fS(this.getRenderedItems(),t)}subscribeToScroll(t){return this.scrollListeners.add(t),()=>{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){const n=this.instanceToItem.get(t);if(n==null)throw new Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return n.top}getTopForItem(t){const n=this.idToItem.get(t);if(n!=null)return n.top+this.getLayout().paddingTop}createItem(t,n,i){const{itemMetricsCache:a}=this;if(t.type==="diff"){const c=new AL(this.createDiffOptions(t.id),this,a,this.workerManager,this.isContainerManaged);return{type:"diff",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:c}}const s=new $6(this.createFileOptions(t.id),this,a,this.workerManager,this.isContainerManaged);return{type:"file",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:s}}applySelectedLines(t,n){const{selectedLines:i}=this;t==null&&i==null||t!=null&&i?.id===t.id&&qm(i.range,t.range)||(i!=null&&i.id!==t?.id&&this.idToItem.get(i.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,n))}syncSelection(){if(this.selectedLines==null)return;const t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null;return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}renamePendingScrollTarget(t,n){const{pendingScrollTarget:i}=this;i==null||i.type==="position"||i.id!==t||(this.pendingScrollTarget={...i,id:n})}renamePendingLayoutAnchor(t,n){this.pendingLayoutAnchor?.id===t&&(this.pendingLayoutAnchor.id=n)}createFileOptionsPrototype(){const t={};for(const n of VL)wr(t,n,()=>this.options[n]);wr(t,"stickyHeader",()=>this.options.stickyHeaders),wr(t,"collapsed",n=>this.getItemOptions(Ml(n),"file")?.item.collapsed===!0);for(const n of iS)this.defineItemSharedCallback(t,"file",n);for(const n of rS)this.defineItemSelectionCallback(t,"file",n);return t}createDiffOptionsPrototype(){const t={};for(const n of zL)wr(t,n,()=>this.options[n]);wr(t,"stickyHeader",()=>this.options.stickyHeaders),wr(t,"hunkSeparators",()=>this.options.hunkSeparators),wr(t,"collapsed",n=>this.getItemOptions(Ml(n),"diff")?.item.collapsed===!0);for(const n of iS)this.defineItemSharedCallback(t,"diff",n);for(const n of rS)this.defineItemSelectionCallback(t,"diff",n);return t}createFileOptions(t){const n=Object.create(this.fileOptionsPrototype);return oS(n,{id:t}),n}createDiffOptions(t){const n=Object.create(this.diffOptionsPrototype);return oS(n,{id:t}),n}updateItemOptionsId(t,n){Ml(t).id=n}getItemOptions(t,n){const i=this.idToItem.get(t.id);if(!(i==null||i.type!==n))return i}defineItemSharedCallback(t,n,i){wr(t,i,a=>{if(this.options[i]==null)return;const s=Ml(a),c=s.callbackCache??={};let d=c[i];return d==null&&(d=((...f)=>{const h=this.getItemOptions(s,n);if(h==null)return;const m=this.options[i];return m?.(...f,h)}),c[i]=d),d})}defineItemSelectionCallback(t,n,i){wr(t,i,a=>{if(this.options.enableLineSelection!==!0)return;const s=Ml(a),c=s.callbackCache??={};let d=c[i];return d==null&&(d=(f=>{const h=this.getItemOptions(s,n);if(h==null)return;const m=f==null?null:{id:h.item.id,range:f};this.options.controlledSelection!==!0&&(f!=null||this.selectedLines?.id===h.item.id)&&this.applySelectedLines(m,{notify:!1}),this.options.onSelectedLinesChange?.(m);const g=this.options[i];return g?.(f,h)}),c[i]=d),d})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw new Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i==null)throw new Error("CodeView.tryAppendItems: missing existing item");const a=t[n];if(a==null||i.item.id!==a.id||i.type!==a.type)return!1}for(let n=0;n<this.items.length;n++){const i=this.items[n];if(i==null)throw new Error("CodeView.tryAppendItems: missing existing item");const a=t[n];if(a==null)throw new Error("CodeView.tryAppendItems: append candidate missing prefix item");this.syncItemRecord(i,a)&&this.markLayoutDirtyFromIndex(n)}return this.appendItemsInternal(t.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(t){const{items:n,idToItem:i}=this,a=new Set(n),s=[],c=new Map,d=new Map;let f;for(let h=0;h<t.length;h++){const m=t[h];if(m==null)throw new Error("CodeView.reconcileItems: missing input item");if(c.has(m.id))throw new Error(`CodeView.setItems: duplicate id "${m.id}"`);const g=i.get(m.id),y=g!=null&&g.type===m.type?g:this.createItem(m,h,0);y.index=h,g!=null&&g.type===m.type?(a.delete(g),this.syncItemRecord(y,m)&&(f=Math.min(f??h,h))):f=Math.min(f??h,h),n[h]!==y&&(f=Math.min(f??h,h)),s.push(y),c.set(m.id,y),d.set(y.instance,y)}for(let h=0;h<n.length;h++){const m=n[h];if(m==null||!a.has(m))continue;this.releaseRenderedItem(m);const g=Math.max(s.length-1,0);f=Math.min(f??g,g)}f!=null&&(this.items=s,this.idToItem=c,this.instanceToItem=d,this.renderState.firstIndex>=s.length?this.resetRenderState():this.renderState.lastIndex>=s.length&&(this.renderState.lastIndex=s.length-1),this.markLayoutDirtyFromIndex(f),this.scrollDirty=!0,this.render())}syncItemRecord(t,n){if(t.type!==n.type)throw new Error(`CodeView.syncItemRecord: type mismatch for id "${n.id}"`);return t.version===n.version?!1:(t.item=n,t.version=n.version,t.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(t){const{paddingBottom:n,paddingTop:i}=this.getLayout();return Math.max(i+t+n-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>sS}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),Fg):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){const n=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,n))}clampScrollTop(t){const n=this.getMaxScrollTop();return Math.max(0,Math.min(t,n))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){const n=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,n))}resolveScrollPageWindow(t,n){let i=zi(this.clampPagedScrollTop(n)),a=this.clampScrollPageOffset(t-i);return i=zi(this.clampPagedScrollTop(t-a)),a=this.clampScrollPageOffset(t-i),{pagedScrollTop:i,scrollPageOffset:a}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};const n=this.clampScrollPageOffset(this.scrollPageOffset),i=t-n,a=this.getMaxPagedScrollTop(),s=this.getMaxScrollPageOffset(),c=i>sS&&n<s,d=i<bE&&n>0;return i<0||i>a||c||d?this.resolveScrollPageWindow(t,d?Math.min(UL,a):SE):{pagedScrollTop:zi(this.clampPagedScrollTop(i)),scrollPageOffset:n}}needsScrollPageUpdate(t){const n=zi(this.clampScrollTop(t)),{scrollPageOffset:i}=this.resolvePagedScrollPosition(n);return i!==this.scrollPageOffset}getPagedLayoutTop(t){return this.shouldRebaseScroll()?Math.max(t-this.scrollPageOffset,0):t}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:n.top,height:n.height};if(t.type==="range"){const a=this.getRangeScrollPosition(n,t);if(a==null){console.warn(`CodeView.scrollTo: unable to resolve range ${lS(t.range)} for item "${t.id}"`);return}return{top:n.top+a.top,height:a.height}}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:n.top+i.top,height:i.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;const n=this.getScrollTargetRect(t);if(n==null)return;const i=t.offset??0,a=this.getLayout().paddingTop+n.top,s=a+n.height,c=this.getScrollTop(),d=c+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),f=c+this.getHeight();if(!(a-i<=d&&s+i>=f)){if(a-i<d)return{...t,align:"start"};if(s+i>f)return{...t,align:"end"}}}resolveScrollTargetTop(t){if(t.type==="position"){const a=this.clampScrollTop(t.position);return a!==t.position?a:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}const n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top,n.height,t.align,t.offset));if(t.type==="range"){const a=this.getRangeScrollPosition(n,t);if(a==null){console.warn(`CodeView.scrollTo: unable to resolve range ${lS(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+a.top,a.height,t.align,t.offset,this.getStickyHeaderOffset()))}const i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+i.top,i.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,n,i,a=0,s=0){t+=this.getLayout().paddingTop;const c=this.getHeight();return i==="center"&&n+a<c?t-(c-n)/2+a:i==="end"?t-(c-n)+a:t-s-a}getLineScrollPosition(t,n){return t.type==="diff"?t.instance.getLinePosition(n.lineNumber,n.side):t.instance.getLinePosition(n.lineNumber)}getRangeScrollPosition(t,n){const{range:i}=n,a=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.start,side:i.side}),s=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.end,side:i.endSide??i.side});if(a==null||s==null)return;const c=a.top,d=c+a.height,f=s.top,h=f+s.height,m=Math.min(c,f);return{top:m,height:Math.max(d,h)-m}}computeTargetScrollTopForFrame(t,n){if(this.pendingScrollTarget==null)return t;const i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null)return t;const{scrollAnimation:a}=this;return a==null?i:this.computeSpringStep(a,i,n).position}computeSpringStep(t,n,i){const a=Math.max(0,i-t.lastTimestamp),{omega:s}=this.getSmoothScrollSettings(),c=Math.exp(-s*a),d=t.position-n,f=t.velocity+s*d;return{position:n+(d+f*a)*c,velocity:(f*(1-s*a)-s*d)*c}}advanceScrollAnimation(t,n){if(this.pendingScrollTarget==null)return;const i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}const a=this.scrollAnimation;if(a==null)return i;a.position+=n;const{position:s,velocity:c}=this.computeSpringStep(a,i,t);a.lastTimestamp=t,a.position=s,a.velocity=c;const{positionEpsilon:d,velocityEpsilon:f}=this.getSmoothScrollSettings();return Math.abs(i-s)<=d&&Math.abs(c)<=f?(a.position=i,a.velocity=0,this.scrollAnimation=void 0,i):a.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(Tr.__STOP||this.container==null)return;const n=this.getHeight(),i=this.getScrollTop();let a=i,s=this.pendingLayoutAnchor!=null,c=this.getScrollAnchor(a);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,s=!0),s&&c!=null){const D=this.resolveAnchoredScrollTop(c);if(D!=null){const N=D-a;a=D,this.scrollAnimation!=null&&(this.scrollAnimation.position+=N)}}s&&(a=this.clampScrollTop(a),this.syncContainerHeight());const d=this.computeTargetScrollTopForFrame(a,t),f=!s&&(this.renderState.scrollTop===-1||Math.abs(d-this.renderState.scrollTop)>n+this.config.overscrollSize*2);f&&(c=void 0),this.windowSpecs=c6({scrollTop:d,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:f,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let h=i;(this.pendingScrollTarget!=null&&d!==h||this.needsScrollPageUpdate(d))&&(this.applyScrollFix(d,h,this.windowSpecs),h=d);const{top:m,bottom:g}=this.windowSpecs,{firstIndex:y,lastIndex:b}=this.renderState;if(y>=0)for(let D=y;D<=b;D++){const N=this.items[D];if(N==null)throw new Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${D}`);N.top>m-N.height&&N.top<=g||this.releaseRenderedItem(N)}let S;const w=new Set,A=this.findFirstVisibleIndex(m),k=this.findLastVisibleIndex(g);for(let D=A;D<=k;D++){const N=this.items[D];if(N==null)throw new Error("CodeView.computeRenderRangeAndEmit: missing item");const{instance:K}=N;N.element==null?(N.element=this.acquireElement(),dS(this.stickyContainer,N.element,S),K.virtualizedSetup(),uS(N,N.element)&&(N.renderedOptionsRevision=this.renderOptionsRevision,w.add(N)),S=N.element):(dS(this.stickyContainer,N.element,S),uS(N,void 0,N.renderedOptionsRevision!==this.renderOptionsRevision)&&(N.renderedOptionsRevision=this.renderOptionsRevision,w.add(N)),S=N.element)}this.renderState.firstIndex=A<=k?A:-1,this.renderState.lastIndex=k,this.flushSlotCoordinator(),this.reconcileRenderedItems(w),this.syncContainerHeight(),this.updateStickyPositioning();const E=c!=null?this.resolveAnchoredScrollTop(c):void 0;c===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);const T=E!=null?E-a:0;let L=d,O=!1;if(this.pendingScrollTarget!=null){const D=this.advanceScrollAnimation(t,T);D!=null?(L=D,O=!0):L=a}else L=E??d;L!==h&&(this.applyScrollFix(L,h,this.windowSpecs),h=L),O&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=zi(h),this.flushManagers(w),this.validateStickyContainerHeight(),this.fixContainerFocus(),(f||this.scrollAnimation!=null)&&this.render()};flushManagers(t){for(const n of t)n.instance.flushManagers()}syncContainerHeight(){const t=this.getPagedScrollHeight();this.container==null||this.containerHeight===t||(this.container.style.height=`${t}px`,this.containerHeight=t)}getStickyBounds(t){const{firstIndex:n,lastIndex:i}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(n===-1||i===-1||n>i)return;const a=this.items[n]?.instance.getAdvancedStickySpecs(t),s=this.items[i]?.instance.getAdvancedStickySpecs(t);if(!(a==null||s==null))return{stickyTop:this.getPagedLayoutTop(Math.max(a.topOffset,0)),stickyBottom:this.getPagedLayoutTop(s.topOffset+s.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:n}){const i=this.getHeight(),{itemMetricsCache:a}=this,s=n-t;this.renderState.stickyHeight=s,this.renderState.stickyTop=t,this.renderState.stickyBottom=n,this.stickyOffset.style.height=`${t}px`;const c=(Math.random()*a.lineHeight>>0)*-1,d=-Math.max(s+c,0)+i;this.stickyContainer.style.top=`${d}px`,this.stickyContainer.style.bottom=`${d+a.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();const n=this.getStickyBounds(t);n!=null&&this.applyStickyPositioning(n)}reconcileRenderedItems(t){const{firstIndex:n,lastIndex:i}=this.renderState;if(n===-1)return;let a=-1,s=!1;for(let c=n;c<this.items.length&&!(!s&&c>i);c++){const d=this.items[c];if(d==null)throw new Error("CodeView.reconcileRenderedItems: Invalid item");a===-1?a=d.top:d.top!==a&&(d.top=a,d.instance.syncVirtualizedTop(),s=!0),(t==null?c<=i:t.has(d))&&(d.instance.reconcileHeights()&&(s=!0,d.height=d.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(d)),a+=d.instance.getVirtualizedHeight(),c<this.items.length-1&&(a+=this.getLayout().gap)}s&&a!=null&&(this.scrollDirty=!0,this.scrollHeight=a)}updateStickyPositioning(){const t=this.getStickyBounds();if(t==null)return;const{stickyTop:n,stickyBottom:i}=t;i-n===this.renderState.stickyHeight&&n===this.renderState.stickyTop&&i===this.renderState.stickyBottom||this.applyStickyPositioning(t)}handleScroll=()=>{Tr.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=t=>{for(const n of t)if(n.target===this.stickyContainer){if(n.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){const i=this.getScrollTop(),a=this.getScrollAnchor(i);this.reconcileRenderedItems(),this.updateStickyPositioning();const s=a!=null?this.resolveAnchoredScrollTop(a):void 0;if(s!=null){const c=s-i;this.applyScrollFix(s,i,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=c)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(t,n){return t<n?n+this.getStickyHeaderOffset():n}getScrollAnchor(t){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;const{firstIndex:n,lastIndex:i,stickyTop:a,stickyBottom:s}=this.renderState;if(n===-1||i===-1)return;const c=this.getHeight();if(!(a===-1||s===-1))for(let d=n;d<=i;d++){const f=this.items[d];if(f==null)continue;const h=this.getLayout().paddingTop+f.top;if(h+f.height<=t)continue;if(h>=t+c)break;if(h>=t)return{type:"item",id:f.item.id,viewportOffset:h-t};const m=this.getScrollAnchorViewportTop(h,t)-h,g=f.instance.getNumericScrollAnchor(m);if(g!=null){const y=h+g.top;return{type:"line",id:f.item.id,lineNumber:g.lineNumber,side:g.side,viewportOffset:y-t}}}}resolveAnchoredScrollTop(t){const n=this.idToItem.get(t.id);if(n==null)return;const{paddingTop:i}=this.getLayout();if(t.type==="item"){const c=i+n.top;return this.clampScrollTop(c-t.viewportOffset)}const a=n.type==="diff"?n.instance.getLinePosition(t.lineNumber,t.side):n.instance.getLinePosition(t.lineNumber);if(a==null)return;const s=i+n.top+a.top;return this.clampScrollTop(s-t.viewportOffset)}applyScrollFix(t,n,i){if(this.root==null)return;const a=zi(this.clampScrollTop(t)),s=zi(n),{scrollPageOffset:c}=this,d=zi(this.clampPagedScrollTop(s-c)),{pagedScrollTop:f,scrollPageOffset:h}=this.resolvePagedScrollPosition(a),m=f,g=c!==h;a===this.renderState.scrollTop&&a===s&&m===d&&!g||(this.suspendScrollInteractions(),(m!==d||g)&&(this.scrollPageOffset=h,this.syncPagedScrollScaffolding(i)),m!==d&&this.root.scrollTo({top:m,behavior:"instant"}),this.renderState.scrollTop=a,this.scrollTop=a,this.scrollDirty=!1)}isPendingTargetSettled(t){const n=this.resolveScrollTargetTop(t);return n==null?!0:zi(this.getScrollTop())===zi(n)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;const t=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(t+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;const{onSnapshotChange:t}=this.slotCoordinator,n=fS(this.getRenderedItems(),this.slotCoordinator);XL(this.slotSnapshot,n)||(this.slotSnapshot=n,t(n))}notifyScroll(){if(this.scrollListeners.size===0)return;const t=this.getScrollTop();for(const n of this.scrollListeners)n(t,this)}findFirstVisibleIndex(t){let n=0,i=this.items.length-1,a=this.items.length;for(;n<=i;){const s=n+i>>1,c=this.items[s];if(c==null)throw new Error("CodeView.findFirstVisibleIndex: invalid item index");c.top+c.height>t?(a=s,i=s-1):n=s+1}return a}findLastVisibleIndex(t){let n=0,i=this.items.length-1,a=-1;for(;n<=i;){const s=n+i>>1,c=this.items[s];if(c==null)throw new Error("CodeView.findLastVisibleIndex: invalid item index");c.top<=t?(a=s,n=s+1):i=s-1}return a}recomputeLayout(t=0,n){if(this.items.length===0){this.scrollHeight=0;return}const i=this.getLayout();let a=0;if(t>0){const s=this.items[t-1];if(s==null)throw new Error("CodeView.recomputeLayout: invalid dirty index");a=s.top+s.height+i.gap}for(let s=t;s<this.items.length;s++){const c=this.items[s];if(c==null)throw new Error("CodeView.recomputeLayout: invalid item index");c.top=a,c.type==="diff"?c.height=c.instance.prepareCodeViewItem(c.item.fileDiff,a,n,c.item.annotations??[]):c.height=c.instance.prepareCodeViewItem(c.item.file,a,n,c.item.annotations??[]),a+=c.height,s<this.items.length-1&&(a+=i.gap)}a!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=a}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function $L(e){return e.instance.cleanUp(!0),e.type==="diff"?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function qL(e,t){return!ua(e.theme??xt,t.theme??xt)||(e.themeType??"system")!==(t.themeType??"system")||e.unsafeCSS!==t.unsafeCSS}function GL(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function WL(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function KL(e){return e instanceof SVGElement?!0:hc(e)&&(e.hasAttribute("data-core-css")||e.hasAttribute("data-theme-css")||e.hasAttribute("data-unsafe-css"))}function lS(e){const t=cS(e.start,e.side),n=cS(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function cS(e,t){return t==null?`${e}`:`${t==="deletions"?"D":"A"}${e}`}function uS(e,t,n=!1){return e.type==="diff"?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function dS(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function YL(e){return(e.annotations?.length??0)>0}function fS(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:i}){if(e.length===0)return;if(t||i)return e;if(!n)return;const a=[];for(const s of e)YL(s.item)&&a.push(s);return a.length>0?a:void 0}function XL(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i==null||a==null||i.id!==a.id||i.type!==a.type||i.element!==a.element||i.version!==a.version)return!1}return!0}function QL(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i==null||a==null||i.id!==a.id||i.type!==a.type||i.element!==a.element||i.version!==a.version)return!1}return!0}var sm={exports:{}},hn={};/**
1580
1580
  * @license React
1581
1581
  * react-dom.production.js
1582
1582
  *
@@ -1584,7 +1584,7 @@ ${t}`,i=e.startsWith(t)?0:Kb(e,n,0);if(i===-1)return[e];const a=[];i>0&&a.push(e
1584
1584
  *
1585
1585
  * This source code is licensed under the MIT license found in the
1586
1586
  * LICENSE file in the root directory of this source tree.
1587
- */var hS;function ZL(){if(hS)return hn;hS=1;var e=Cg();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,hn.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,m)},hn.flushSync=function(f){var h=c.T,m=i.p;try{if(c.T=null,i.p=2,f)return f()}finally{c.T=h,i.p=m,i.d.f()}},hn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},hn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},hn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=d(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&i.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},hn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},hn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=d(m,h.crossOrigin);i.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},hn.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},hn.requestFormReset=function(f){i.d.r(f)},hn.unstable_batchedUpdates=function(f,h){return f(h)},hn.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},hn.useFormStatus=function(){return c.H.useHostTransitionStatus()},hn.version="19.2.8",hn}var pS;function _E(){if(pS)return sm.exports;pS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sm.exports=ZL(),sm.exports}var CE=_E();const mS=typeof window>"u"?Y.useEffect:Y.useLayoutEffect;function gS(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function JL(e,t){const{className:n,containerRef:i,disableWorkerPool:a=!1,initialItems:s,items:c,onScroll:d,onSelectedLinesChange:f,options:h,renderAnnotation:m,renderCustomHeader:g,renderGutterUtility:y,renderHeaderMetadata:b,renderHeaderPrefix:S,selectedLines:w,style:A}=e,k=c!==void 0,E=Y.useContext(jC),T=Y.useRef(gS(k)),L=g!=null,O=m!=null,D=y!=null,N=L||S!=null||b!=null,W=N||O||D,G=dn(z=>{f?.(z)}),se=w!==void 0,ie=Y.useMemo(()=>rI({options:h,hasCustomHeader:L,hasGutterRenderer:D,onSelectedLinesChange:f!=null?G:void 0,controlledSelection:se}),[h,L,D,f,G,se]),[ee]=Y.useState(()=>iI()),[,te]=Y.useState({}),le=dn(z=>{T.current.instance!=null&&(z==null||z!==T.current.instance.getContainerElement())&&(T.current.instance.cleanUp(),ee.publish(void 0),T.current=gS(k)),z!=null&&z!==T.current.instance?.getContainerElement()&&(T.current.instance=new jL(ie,a?void 0:E,!0),T.current.instance.setup(z)),typeof i=="function"?i(z):i!=null&&(i.current=z)}),me=dn(z=>{T.current.disableFlushSync?ee.publish(z):CE.flushSync(()=>{ee.publish(z)})}),H=Y.useMemo(()=>{if(!(!N&&!O&&!D))return{hasHeaderRenderers:N,hasAnnotationRenderer:O,hasGutterRenderer:D,onSnapshotChange:me}},[me,O,D,N]);return mS(()=>d!=null?T.current.instance?.subscribeToScroll(d):void 0),mS(()=>{const{instance:z,controlled:Q,items:ce,managedOptions:_e,slotCoordinator:M}=T.current;if(z!=null)try{T.current.disableFlushSync=!0;let q=!1;if(pf(ie,_e)||(T.current.managedOptions=ie,z.setOptions(ie),q=!0),Q!==k){console.error("CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.");return}if(k)c!==ce&&(nI(ce,c)?T.current.items=c:tI(ce,c)?(T.current.items=c,z.addItems(c.slice(ce.length))):(T.current.items=c,z.setItems(c),q=!0));else if(ce==null){const he=s??[];T.current.items=he,he.length>0&&(z.setItems(he),q=!0)}w!==void 0&&z.setSelectedLines(w,{notify:!1});const re=z.setSlotCoordinator(H);let ae=!1;H!==M&&((H==null||M==null)&&(ae=!0),T.current.slotCoordinator=H),(q||re)&&z.render(!0),re&&H==null&&ee.publish(void 0),ae&&te({})}finally{T.current.disableFlushSync=!1}}),Y.useImperativeHandle(t,()=>({addItems(z){const{controlled:Q,instance:ce}=T.current;lm(Q,"addItems"),ce==null?console.error("CodeView.addItems: no valid instance to append items with",z):ce.addItems(z)},getItem(z){const{instance:Q}=T.current;if(Q==null){console.error("CodeView.getItem: no valid instance exists",z);return}else return Q.getItem(z)},updateItem(z){const{controlled:Q,instance:ce}=T.current;return lm(Q,"updateItem"),ce==null?(console.error("CodeView.updateItem: no valid instance to update item with",z),!1):ce.updateItem(z)},updateItemId(z,Q){const{controlled:ce,instance:_e}=T.current;return lm(ce,"updateItemId"),_e==null?(console.error("CodeView.updateItemId: no valid instance to update item id with",z,Q),!1):_e.updateItemId(z,Q)},scrollTo(z){const{instance:Q}=T.current;Q==null?console.error("CodeView.scrollTo: no valid instance to scroll with",z):Q.scrollTo(z)},setSelectedLines(z){const{instance:Q}=T.current;Q==null?console.error("CodeView.setSelectedLines: no valid instance to update selection with",z):(Q.setSelectedLines(z,{notify:!1}),G(z))},getSelectedLines(){const{instance:z}=T.current;return z==null?(console.error("CodeView.getSelectedLines: no valid instance exists"),null):z.getSelectedLines()},clearSelectedLines(){const{instance:z}=T.current;z==null?console.error("CodeView.clearSelectedLines: no valid instance to update selection with"):(z.clearSelectedLines({notify:!1}),G(null))},getInstance(){return T.current.instance}}),[G]),U.jsxs(U.Fragment,{children:[U.jsx("div",{ref:le,className:n,style:A}),W&&U.jsx(oI,{managedContentStore:ee,renderCustomHeader:g,renderHeaderPrefix:S,renderHeaderMetadata:b,renderAnnotation:m,renderGutterUtility:y})]})}const eI=Y.forwardRef(JL);function tI(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function nI(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function lm(e,t){if(e)throw new Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function iI(){let e;const t=new Set;return{getSnapshot(){return e},publish(n){if(!QL(e,n)){e=n;for(const i of t)i()}},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function rI({options:e,hasCustomHeader:t,hasGutterRenderer:n,onSelectedLinesChange:i,controlledSelection:a}){return!t&&!n&&i==null&&!a||(e={...e,controlledSelection:a,onSelectedLinesChange:i},t&&(e.renderCustomHeader=vS),n&&(e.renderGutterUtility=vS)),e}const oI=Y.memo(function({managedContentStore:t,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderMetadata:a,renderAnnotation:s,renderGutterUtility:c}){const d=dn(h=>t.subscribe(h)),f=dn(()=>t.getSnapshot());return Y.useSyncExternalStore(d,f,f)?.map(h=>CE.createPortal(aI({renderedItem:h,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderMetadata:a,renderAnnotation:s,renderGutterUtility:c}),h.element,h.id))});function aI({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:s}){if(e.type==="diff"){const{item:c,instance:d}=e;return kx({fileDiff:c.fileDiff,renderCustomHeader:t!=null?()=>t(c):void 0,renderHeaderPrefix:n!=null?()=>n(c):void 0,renderHeaderMetadata:i!=null?()=>i(c):void 0,renderAnnotation:a!=null?f=>a(f,c):void 0,lineAnnotations:c.annotations,renderGutterUtility:s!=null?f=>s(f,c):void 0,getHoveredLine:d.getHoveredLine})}else{const{item:c,instance:d}=e;return Lx({file:c.file,renderCustomHeader:t!=null?()=>t(c):void 0,renderHeaderPrefix:n!=null?()=>n(c):void 0,renderHeaderMetadata:i!=null?()=>i(c):void 0,renderAnnotation:a!=null?f=>a(f,c):void 0,lineAnnotations:c.annotations,renderGutterUtility:s!=null?f=>s(f,c):void 0,getHoveredLine:d.getHoveredLine})}}function vS(){}function sI(e){return new Worker(""+new URL("worker-DLF4drjM.js",import.meta.url).href,{type:"module",name:e?.name})}var cm={exports:{}},Ol={},um={exports:{}},dm={};/**
1587
+ */var hS;function ZL(){if(hS)return hn;hS=1;var e=Cg();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(f,h,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:h,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,hn.createPortal=function(f,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return s(f,h,null,m)},hn.flushSync=function(f){var h=c.T,m=i.p;try{if(c.T=null,i.p=2,f)return f()}finally{c.T=h,i.p=m,i.d.f()}},hn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(f,h))},hn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},hn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var m=h.as,g=d(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?i.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&i.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},hn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=d(h.as,h.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(f)},hn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,g=d(m,h.crossOrigin);i.d.L(f,m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},hn.preloadModule=function(f,h){if(typeof f=="string")if(h){var m=d(h.as,h.crossOrigin);i.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(f)},hn.requestFormReset=function(f){i.d.r(f)},hn.unstable_batchedUpdates=function(f,h){return f(h)},hn.useFormState=function(f,h,m){return c.H.useFormState(f,h,m)},hn.useFormStatus=function(){return c.H.useHostTransitionStatus()},hn.version="19.2.8",hn}var pS;function _E(){if(pS)return sm.exports;pS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),sm.exports=ZL(),sm.exports}var CE=_E();const mS=typeof window>"u"?W.useEffect:W.useLayoutEffect;function gS(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function JL(e,t){const{className:n,containerRef:i,disableWorkerPool:a=!1,initialItems:s,items:c,onScroll:d,onSelectedLinesChange:f,options:h,renderAnnotation:m,renderCustomHeader:g,renderGutterUtility:y,renderHeaderMetadata:b,renderHeaderPrefix:S,selectedLines:w,style:A}=e,k=c!==void 0,E=W.useContext(jC),T=W.useRef(gS(k)),L=g!=null,O=m!=null,D=y!=null,N=L||S!=null||b!=null,K=N||O||D,G=dn(z=>{f?.(z)}),se=w!==void 0,ie=W.useMemo(()=>rI({options:h,hasCustomHeader:L,hasGutterRenderer:D,onSelectedLinesChange:f!=null?G:void 0,controlledSelection:se}),[h,L,D,f,G,se]),[ee]=W.useState(()=>iI()),[,te]=W.useState({}),le=dn(z=>{T.current.instance!=null&&(z==null||z!==T.current.instance.getContainerElement())&&(T.current.instance.cleanUp(),ee.publish(void 0),T.current=gS(k)),z!=null&&z!==T.current.instance?.getContainerElement()&&(T.current.instance=new jL(ie,a?void 0:E,!0),T.current.instance.setup(z)),typeof i=="function"?i(z):i!=null&&(i.current=z)}),me=dn(z=>{T.current.disableFlushSync?ee.publish(z):CE.flushSync(()=>{ee.publish(z)})}),H=W.useMemo(()=>{if(!(!N&&!O&&!D))return{hasHeaderRenderers:N,hasAnnotationRenderer:O,hasGutterRenderer:D,onSnapshotChange:me}},[me,O,D,N]);return mS(()=>d!=null?T.current.instance?.subscribeToScroll(d):void 0),mS(()=>{const{instance:z,controlled:Q,items:ce,managedOptions:_e,slotCoordinator:M}=T.current;if(z!=null)try{T.current.disableFlushSync=!0;let q=!1;if(pf(ie,_e)||(T.current.managedOptions=ie,z.setOptions(ie),q=!0),Q!==k){console.error("CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.");return}if(k)c!==ce&&(nI(ce,c)?T.current.items=c:tI(ce,c)?(T.current.items=c,z.addItems(c.slice(ce.length))):(T.current.items=c,z.setItems(c),q=!0));else if(ce==null){const he=s??[];T.current.items=he,he.length>0&&(z.setItems(he),q=!0)}w!==void 0&&z.setSelectedLines(w,{notify:!1});const re=z.setSlotCoordinator(H);let ae=!1;H!==M&&((H==null||M==null)&&(ae=!0),T.current.slotCoordinator=H),(q||re)&&z.render(!0),re&&H==null&&ee.publish(void 0),ae&&te({})}finally{T.current.disableFlushSync=!1}}),W.useImperativeHandle(t,()=>({addItems(z){const{controlled:Q,instance:ce}=T.current;lm(Q,"addItems"),ce==null?console.error("CodeView.addItems: no valid instance to append items with",z):ce.addItems(z)},getItem(z){const{instance:Q}=T.current;if(Q==null){console.error("CodeView.getItem: no valid instance exists",z);return}else return Q.getItem(z)},updateItem(z){const{controlled:Q,instance:ce}=T.current;return lm(Q,"updateItem"),ce==null?(console.error("CodeView.updateItem: no valid instance to update item with",z),!1):ce.updateItem(z)},updateItemId(z,Q){const{controlled:ce,instance:_e}=T.current;return lm(ce,"updateItemId"),_e==null?(console.error("CodeView.updateItemId: no valid instance to update item id with",z,Q),!1):_e.updateItemId(z,Q)},scrollTo(z){const{instance:Q}=T.current;Q==null?console.error("CodeView.scrollTo: no valid instance to scroll with",z):Q.scrollTo(z)},setSelectedLines(z){const{instance:Q}=T.current;Q==null?console.error("CodeView.setSelectedLines: no valid instance to update selection with",z):(Q.setSelectedLines(z,{notify:!1}),G(z))},getSelectedLines(){const{instance:z}=T.current;return z==null?(console.error("CodeView.getSelectedLines: no valid instance exists"),null):z.getSelectedLines()},clearSelectedLines(){const{instance:z}=T.current;z==null?console.error("CodeView.clearSelectedLines: no valid instance to update selection with"):(z.clearSelectedLines({notify:!1}),G(null))},getInstance(){return T.current.instance}}),[G]),U.jsxs(U.Fragment,{children:[U.jsx("div",{ref:le,className:n,style:A}),K&&U.jsx(oI,{managedContentStore:ee,renderCustomHeader:g,renderHeaderPrefix:S,renderHeaderMetadata:b,renderAnnotation:m,renderGutterUtility:y})]})}const eI=W.forwardRef(JL);function tI(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function nI(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function lm(e,t){if(e)throw new Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function iI(){let e;const t=new Set;return{getSnapshot(){return e},publish(n){if(!QL(e,n)){e=n;for(const i of t)i()}},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function rI({options:e,hasCustomHeader:t,hasGutterRenderer:n,onSelectedLinesChange:i,controlledSelection:a}){return!t&&!n&&i==null&&!a||(e={...e,controlledSelection:a,onSelectedLinesChange:i},t&&(e.renderCustomHeader=vS),n&&(e.renderGutterUtility=vS)),e}const oI=W.memo(function({managedContentStore:t,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderMetadata:a,renderAnnotation:s,renderGutterUtility:c}){const d=dn(h=>t.subscribe(h)),f=dn(()=>t.getSnapshot());return W.useSyncExternalStore(d,f,f)?.map(h=>CE.createPortal(aI({renderedItem:h,renderCustomHeader:n,renderHeaderPrefix:i,renderHeaderMetadata:a,renderAnnotation:s,renderGutterUtility:c}),h.element,h.id))});function aI({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:s}){if(e.type==="diff"){const{item:c,instance:d}=e;return kx({fileDiff:c.fileDiff,renderCustomHeader:t!=null?()=>t(c):void 0,renderHeaderPrefix:n!=null?()=>n(c):void 0,renderHeaderMetadata:i!=null?()=>i(c):void 0,renderAnnotation:a!=null?f=>a(f,c):void 0,lineAnnotations:c.annotations,renderGutterUtility:s!=null?f=>s(f,c):void 0,getHoveredLine:d.getHoveredLine})}else{const{item:c,instance:d}=e;return Lx({file:c.file,renderCustomHeader:t!=null?()=>t(c):void 0,renderHeaderPrefix:n!=null?()=>n(c):void 0,renderHeaderMetadata:i!=null?()=>i(c):void 0,renderAnnotation:a!=null?f=>a(f,c):void 0,lineAnnotations:c.annotations,renderGutterUtility:s!=null?f=>s(f,c):void 0,getHoveredLine:d.getHoveredLine})}}function vS(){}function sI(e){return new Worker(""+new URL("worker-DLF4drjM.js",import.meta.url).href,{type:"module",name:e?.name})}var cm={exports:{}},Ol={},um={exports:{}},dm={};/**
1588
1588
  * @license React
1589
1589
  * scheduler.production.js
1590
1590
  *
@@ -1592,7 +1592,7 @@ ${t}`,i=e.startsWith(t)?0:Kb(e,n,0);if(i===-1)return[e];const a=[];i>0&&a.push(e
1592
1592
  *
1593
1593
  * This source code is licensed under the MIT license found in the
1594
1594
  * LICENSE file in the root directory of this source tree.
1595
- */var yS;function lI(){return yS||(yS=1,(function(e){function t(H,z){var Q=H.length;H.push(z);e:for(;0<Q;){var ce=Q-1>>>1,_e=H[ce];if(0<a(_e,z))H[ce]=z,H[Q]=_e,Q=ce;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var z=H[0],Q=H.pop();if(Q!==z){H[0]=Q;e:for(var ce=0,_e=H.length,M=_e>>>1;ce<M;){var q=2*(ce+1)-1,re=H[q],ae=q+1,he=H[ae];if(0>a(re,Q))ae<_e&&0>a(he,re)?(H[ce]=he,H[ae]=Q,ce=ae):(H[ce]=re,H[q]=Q,ce=q);else if(ae<_e&&0>a(he,Q))H[ce]=he,H[ae]=Q,ce=ae;else break e}}return z}function a(H,z){var Q=H.sortIndex-z.sortIndex;return Q!==0?Q:H.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,w=!1,A=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var z=n(h);z!==null;){if(z.callback===null)i(h);else if(z.startTime<=H)i(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function O(H){if(w=!1,L(H),!S)if(n(f)!==null)S=!0,D||(D=!0,ee());else{var z=n(h);z!==null&&me(O,z.startTime-H)}}var D=!1,N=-1,W=5,G=-1;function se(){return A?!0:!(e.unstable_now()-G<W)}function ie(){if(A=!1,D){var H=e.unstable_now();G=H;var z=!0;try{e:{S=!1,w&&(w=!1,E(N),N=-1),b=!0;var Q=y;try{t:{for(L(H),g=n(f);g!==null&&!(g.expirationTime>H&&se());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,y=g.priorityLevel;var _e=ce(g.expirationTime<=H);if(H=e.unstable_now(),typeof _e=="function"){g.callback=_e,L(H),z=!0;break t}g===n(f)&&i(f),L(H)}else i(f);g=n(f)}if(g!==null)z=!0;else{var M=n(h);M!==null&&me(O,M.startTime-H),z=!1}}break e}finally{g=null,y=Q,b=!1}z=void 0}}finally{z?ee():D=!1}}}var ee;if(typeof T=="function")ee=function(){T(ie)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,le=te.port2;te.port1.onmessage=ie,ee=function(){le.postMessage(null)}}else ee=function(){k(ie,0)};function me(H,z){N=k(function(){H(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var Q=y;y=z;try{return H()}finally{y=Q}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(H,z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Q=y;y=H;try{return z()}finally{y=Q}},e.unstable_scheduleCallback=function(H,z,Q){var ce=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ce+Q:ce):Q=ce,H){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=Q+_e,H={id:m++,callback:z,priorityLevel:H,startTime:Q,expirationTime:_e,sortIndex:-1},Q>ce?(H.sortIndex=Q,t(h,H),n(f)===null&&H===n(h)&&(w?(E(N),N=-1):w=!0,me(O,Q-ce))):(H.sortIndex=_e,t(f,H),S||b||(S=!0,D||(D=!0,ee()))),H},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(H){var z=y;return function(){var Q=y;y=z;try{return H.apply(this,arguments)}finally{y=Q}}}})(dm)),dm}var bS;function cI(){return bS||(bS=1,um.exports=lI()),um.exports}/**
1595
+ */var yS;function lI(){return yS||(yS=1,(function(e){function t(H,z){var Q=H.length;H.push(z);e:for(;0<Q;){var ce=Q-1>>>1,_e=H[ce];if(0<a(_e,z))H[ce]=z,H[Q]=_e,Q=ce;else break e}}function n(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var z=H[0],Q=H.pop();if(Q!==z){H[0]=Q;e:for(var ce=0,_e=H.length,M=_e>>>1;ce<M;){var q=2*(ce+1)-1,re=H[q],ae=q+1,he=H[ae];if(0>a(re,Q))ae<_e&&0>a(he,re)?(H[ce]=he,H[ae]=Q,ce=ae):(H[ce]=re,H[q]=Q,ce=q);else if(ae<_e&&0>a(he,Q))H[ce]=he,H[ae]=Q,ce=ae;else break e}}return z}function a(H,z){var Q=H.sortIndex-z.sortIndex;return Q!==0?Q:H.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],m=1,g=null,y=3,b=!1,S=!1,w=!1,A=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function L(H){for(var z=n(h);z!==null;){if(z.callback===null)i(h);else if(z.startTime<=H)i(h),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(h)}}function O(H){if(w=!1,L(H),!S)if(n(f)!==null)S=!0,D||(D=!0,ee());else{var z=n(h);z!==null&&me(O,z.startTime-H)}}var D=!1,N=-1,K=5,G=-1;function se(){return A?!0:!(e.unstable_now()-G<K)}function ie(){if(A=!1,D){var H=e.unstable_now();G=H;var z=!0;try{e:{S=!1,w&&(w=!1,E(N),N=-1),b=!0;var Q=y;try{t:{for(L(H),g=n(f);g!==null&&!(g.expirationTime>H&&se());){var ce=g.callback;if(typeof ce=="function"){g.callback=null,y=g.priorityLevel;var _e=ce(g.expirationTime<=H);if(H=e.unstable_now(),typeof _e=="function"){g.callback=_e,L(H),z=!0;break t}g===n(f)&&i(f),L(H)}else i(f);g=n(f)}if(g!==null)z=!0;else{var M=n(h);M!==null&&me(O,M.startTime-H),z=!1}}break e}finally{g=null,y=Q,b=!1}z=void 0}}finally{z?ee():D=!1}}}var ee;if(typeof T=="function")ee=function(){T(ie)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,le=te.port2;te.port1.onmessage=ie,ee=function(){le.postMessage(null)}}else ee=function(){k(ie,0)};function me(H,z){N=k(function(){H(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var Q=y;y=z;try{return H()}finally{y=Q}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(H,z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var Q=y;y=H;try{return z()}finally{y=Q}},e.unstable_scheduleCallback=function(H,z,Q){var ce=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?ce+Q:ce):Q=ce,H){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=Q+_e,H={id:m++,callback:z,priorityLevel:H,startTime:Q,expirationTime:_e,sortIndex:-1},Q>ce?(H.sortIndex=Q,t(h,H),n(f)===null&&H===n(h)&&(w?(E(N),N=-1):w=!0,me(O,Q-ce))):(H.sortIndex=_e,t(f,H),S||b||(S=!0,D||(D=!0,ee()))),H},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(H){var z=y;return function(){var Q=y;y=z;try{return H.apply(this,arguments)}finally{y=Q}}}})(dm)),dm}var bS;function cI(){return bS||(bS=1,um.exports=lI()),um.exports}/**
1596
1596
  * @license React
1597
1597
  * react-dom-client.production.js
1598
1598
  *
@@ -1600,15 +1600,15 @@ ${t}`,i=e.startsWith(t)?0:Kb(e,n,0);if(i===-1)return[e];const a=[];i>0&&a.push(e
1600
1600
  *
1601
1601
  * This source code is licensed under the MIT license found in the
1602
1602
  * LICENSE file in the root directory of this source tree.
1603
- */var SS;function uI(){if(SS)return Ol;SS=1;var e=cI(),t=Cg(),n=_E();function i(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function s(r){var o=r,l=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(l=o.return),r=o.return;while(r)}return o.tag===3?l:null}function c(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function f(r){if(s(r)!==r)throw Error(i(188))}function h(r){var o=r.alternate;if(!o){if(o=s(r),o===null)throw Error(i(188));return o!==r?null:r}for(var l=r,u=o;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(u=p.return,u!==null){l=u;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return f(p),r;if(v===u)return f(p),o;v=v.sibling}throw Error(i(188))}if(l.return!==u.return)l=p,u=v;else{for(var _=!1,x=p.child;x;){if(x===l){_=!0,l=p,u=v;break}if(x===u){_=!0,u=p,l=v;break}x=x.sibling}if(!_){for(x=v.child;x;){if(x===l){_=!0,l=v,u=p;break}if(x===u){_=!0,u=v,l=p;break}x=x.sibling}if(!_)throw Error(i(189))}}if(l.alternate!==u)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?r:o}function m(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=m(r),o!==null)return o;r=r.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function ee(r){return r===null||typeof r!="object"?null:(r=ie&&r[ie]||r["@@iterator"],typeof r=="function"?r:null)}var te=Symbol.for("react.client.reference");function le(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===te?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case G:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case T:return r.displayName||"Context";case E:return(r._context.displayName||"Context")+".Consumer";case L:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return o=r.displayName||null,o!==null?o:le(r.type)||"Memo";case W:o=r._payload,r=r._init;try{return le(r(o))}catch{}}return null}var me=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},ce=[],_e=-1;function M(r){return{current:r}}function q(r){0>_e||(r.current=ce[_e],ce[_e]=null,_e--)}function re(r,o){_e++,ce[_e]=r.current,r.current=o}var ae=M(null),he=M(null),Se=M(null),be=M(null);function Ue(r,o){switch(re(Se,o),re(he,r),re(ae,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?Yv(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=Yv(o),r=Xv(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}q(ae),re(ae,r)}function Ce(){q(ae),q(he),q(Se)}function He(r){r.memoizedState!==null&&re(be,r);var o=ae.current,l=Xv(o,r.type);o!==l&&(re(he,r),re(ae,l))}function We(r){he.current===r&&(q(ae),q(he)),be.current===r&&(q(be),wl._currentValue=Q)}var lt,ne;function de(r){if(lt===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);lt=o&&o[1]||"",ne=-1<l.stack.indexOf(`
1603
+ */var SS;function uI(){if(SS)return Ol;SS=1;var e=cI(),t=Cg(),n=_E();function i(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function s(r){var o=r,l=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(l=o.return),r=o.return;while(r)}return o.tag===3?l:null}function c(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function f(r){if(s(r)!==r)throw Error(i(188))}function h(r){var o=r.alternate;if(!o){if(o=s(r),o===null)throw Error(i(188));return o!==r?null:r}for(var l=r,u=o;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(u=p.return,u!==null){l=u;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return f(p),r;if(v===u)return f(p),o;v=v.sibling}throw Error(i(188))}if(l.return!==u.return)l=p,u=v;else{for(var _=!1,x=p.child;x;){if(x===l){_=!0,l=p,u=v;break}if(x===u){_=!0,u=p,l=v;break}x=x.sibling}if(!_){for(x=v.child;x;){if(x===l){_=!0,l=v,u=p;break}if(x===u){_=!0,u=v,l=p;break}x=x.sibling}if(!_)throw Error(i(189))}}if(l.alternate!==u)throw Error(i(190))}if(l.tag!==3)throw Error(i(188));return l.stateNode.current===l?r:o}function m(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=m(r),o!==null)return o;r=r.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function ee(r){return r===null||typeof r!="object"?null:(r=ie&&r[ie]||r["@@iterator"],typeof r=="function"?r:null)}var te=Symbol.for("react.client.reference");function le(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===te?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case O:return"Suspense";case D:return"SuspenseList";case G:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case T:return r.displayName||"Context";case E:return(r._context.displayName||"Context")+".Consumer";case L:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return o=r.displayName||null,o!==null?o:le(r.type)||"Memo";case K:o=r._payload,r=r._init;try{return le(r(o))}catch{}}return null}var me=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},ce=[],_e=-1;function M(r){return{current:r}}function q(r){0>_e||(r.current=ce[_e],ce[_e]=null,_e--)}function re(r,o){_e++,ce[_e]=r.current,r.current=o}var ae=M(null),he=M(null),Se=M(null),be=M(null);function Ue(r,o){switch(re(Se,o),re(he,r),re(ae,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?Yv(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=Yv(o),r=Xv(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}q(ae),re(ae,r)}function Ce(){q(ae),q(he),q(Se)}function He(r){r.memoizedState!==null&&re(be,r);var o=ae.current,l=Xv(o,r.type);o!==l&&(re(he,r),re(ae,l))}function We(r){he.current===r&&(q(ae),q(he)),be.current===r&&(q(be),wl._currentValue=Q)}var lt,ne;function de(r){if(lt===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);lt=o&&o[1]||"",ne=-1<l.stack.indexOf(`
1604
1604
  at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
1605
1605
  `+lt+r+ne}var Le=!1;function Ve(r,o){if(!r||Le)return"";Le=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch($){var j=$}Reflect.construct(r,[],J)}else{try{J.call()}catch($){j=$}r.call(J.prototype)}}else{try{throw Error()}catch($){j=$}(J=r())&&typeof J.catch=="function"&&J.catch(function(){})}}catch($){if($&&j&&typeof $.stack=="string")return[$.stack,j.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),_=v[0],x=v[1];if(_&&x){var R=_.split(`
1606
1606
  `),F=x.split(`
1607
- `);for(p=u=0;u<R.length&&!R[u].includes("DetermineComponentFrameRoot");)u++;for(;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;if(u===R.length||p===F.length)for(u=R.length-1,p=F.length-1;1<=u&&0<=p&&R[u]!==F[p];)p--;for(;1<=u&&0<=p;u--,p--)if(R[u]!==F[p]){if(u!==1||p!==1)do if(u--,p--,0>p||R[u]!==F[p]){var K=`
1608
- `+R[u].replace(" at new "," at ");return r.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",r.displayName)),K}while(1<=u&&0<=p);break}}}finally{Le=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?de(l):""}function Tt(r,o){switch(r.tag){case 26:case 27:case 5:return de(r.type);case 16:return de("Lazy");case 13:return r.child!==o&&o!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return Ve(r.type,!1);case 11:return Ve(r.type.render,!1);case 1:return Ve(r.type,!0);case 31:return de("Activity");default:return""}}function vn(r){try{var o="",l=null;do o+=Tt(r,l),l=r,r=r.return;while(r);return o}catch(u){return`
1607
+ `);for(p=u=0;u<R.length&&!R[u].includes("DetermineComponentFrameRoot");)u++;for(;p<F.length&&!F[p].includes("DetermineComponentFrameRoot");)p++;if(u===R.length||p===F.length)for(u=R.length-1,p=F.length-1;1<=u&&0<=p&&R[u]!==F[p];)p--;for(;1<=u&&0<=p;u--,p--)if(R[u]!==F[p]){if(u!==1||p!==1)do if(u--,p--,0>p||R[u]!==F[p]){var Y=`
1608
+ `+R[u].replace(" at new "," at ");return r.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",r.displayName)),Y}while(1<=u&&0<=p);break}}}finally{Le=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?de(l):""}function Tt(r,o){switch(r.tag){case 26:case 27:case 5:return de(r.type);case 16:return de("Lazy");case 13:return r.child!==o&&o!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return Ve(r.type,!1);case 11:return Ve(r.type.render,!1);case 1:return Ve(r.type,!0);case 31:return de("Activity");default:return""}}function vn(r){try{var o="",l=null;do o+=Tt(r,l),l=r,r=r.return;while(r);return o}catch(u){return`
1609
1609
  Error generating stack: `+u.message+`
1610
- `+u.stack}}var yn=Object.prototype.hasOwnProperty,Qn=e.unstable_scheduleCallback,Ki=e.unstable_cancelCallback,Ef=e.unstable_shouldYield,Yi=e.unstable_requestPaint,bn=e.unstable_now,wf=e.unstable_getCurrentPriorityLevel,Ze=e.unstable_ImmediatePriority,ha=e.unstable_UserBlockingPriority,Ai=e.unstable_NormalPriority,pa=e.unstable_LowPriority,Lr=e.unstable_IdlePriority,Co=e.log,Eo=e.unstable_setDisableYieldValue,Ir=null,Wt=null;function Li(r){if(typeof Co=="function"&&Eo(r),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(Ir,r)}catch{}}var tn=Math.clz32?Math.clz32:Tf,xf=Math.log,Ac=Math.LN2;function Tf(r){return r>>>=0,r===0?32:31-(xf(r)/Ac|0)|0}var wo=256,xo=262144,Rr=4194304;function Xi(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ma(r,o,l){var u=r.pendingLanes;if(u===0)return 0;var p=0,v=r.suspendedLanes,_=r.pingedLanes;r=r.warmLanes;var x=u&134217727;return x!==0?(u=x&~v,u!==0?p=Xi(u):(_&=x,_!==0?p=Xi(_):l||(l=x&~r,l!==0&&(p=Xi(l))))):(x=u&~v,x!==0?p=Xi(x):_!==0?p=Xi(_):l||(l=u&~r,l!==0&&(p=Xi(l)))),p===0?0:o!==0&&o!==p&&(o&v)===0&&(v=p&-p,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:p}function To(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function kf(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nn(){var r=Rr;return Rr<<=1,(Rr&62914560)===0&&(Rr=4194304),r}function Ii(r){for(var o=[],l=0;31>l;l++)o.push(r);return o}function Zn(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Lc(r,o,l,u,p,v){var _=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var x=r.entanglements,R=r.expirationTimes,F=r.hiddenUpdates;for(l=_&~l;0<l;){var K=31-tn(l),J=1<<K;x[K]=0,R[K]=-1;var j=F[K];if(j!==null)for(F[K]=null,K=0;K<j.length;K++){var $=j[K];$!==null&&($.lane&=-536870913)}l&=~J}u!==0&&Ic(r,u,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(_&~o))}function Ic(r,o,l){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-tn(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|l&261930}function Rc(r,o){var l=r.entangledLanes|=o;for(r=r.entanglements;l;){var u=31-tn(l),p=1<<u;p&o|r[u]&o&&(r[u]|=o),l&=~p}}function Dc(r,o){var l=o&-o;return l=(l&42)!==0?1:Ts(l),(l&(r.suspendedLanes|o))!==0?0:l}function Ts(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Qi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ks(){var r=z.p;return r!==0?r:(r=window.event,r===void 0?32:by(r.type))}function As(r,o){var l=z.p;try{return z.p=r,o()}finally{z.p=l}}var Tn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Tn,Kt="__reactProps$"+Tn,rn="__reactContainer$"+Tn,Ls="__reactEvents$"+Tn,Be="__reactListeners$"+Tn,et="__reactHandles$"+Tn,Ri="__reactResources$"+Tn,Sn="__reactMarker$"+Tn;function Zi(r){delete r[Ct],delete r[Kt],delete r[Ls],delete r[Be],delete r[et]}function Dr(r){var o=r[Ct];if(o)return o;for(var l=r.parentNode;l;){if(o=l[rn]||l[Ct]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(r=iy(r);r!==null;){if(l=r[Ct])return l;r=iy(r)}return o}r=l,l=r.parentNode}return null}function Mr(r){if(r=r[Ct]||r[rn]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function mi(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(i(33))}function Ji(r){var o=r[Ri];return o||(o=r[Ri]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Pt(r){r[Sn]=!0}var Mc=new Set,It={};function Jn(r,o){Et(r,o),Et(r+"Capture",o)}function Et(r,o){for(It[r]=o,r=0;r<o.length;r++)Mc.add(o[r])}var Nn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Or={},Is={};function er(r){return yn.call(Is,r)?!0:yn.call(Or,r)?!1:Nn.test(r)?Is[r]=!0:(Or[r]=!0,!1)}function gi(r,o,l){if(er(o))if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+l)}}function tr(r,o,l){if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+l)}}function Hn(r,o,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(o,l,""+u)}}function kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Rs(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ga(r,o,l){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return p.call(this)},set:function(_){l=""+_,v.call(this,_)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(_){l=""+_},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function va(r){if(!r._valueTracker){var o=Rs(r)?"checked":"value";r._valueTracker=ga(r,o,""+r[o])}}function nr(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var l=o.getValue(),u="";return r&&(u=Rs(r)?r.checked?"true":"false":r.value),r=u,r!==l?(o.setValue(r),!0):!1}function Pr(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var An=/[\n"\\]/g;function Yt(r){return r.replace(An,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ya(r,o,l,u,p,v,_,x){r.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.type=_:r.removeAttribute("type"),o!=null?_==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+kn(o)):r.value!==""+kn(o)&&(r.value=""+kn(o)):_!=="submit"&&_!=="reset"||r.removeAttribute("value"),o!=null?Nr(r,_,kn(o)):l!=null?Nr(r,_,kn(l)):u!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?r.name=""+kn(x):r.removeAttribute("name")}function Oc(r,o,l,u,p,v,_,x){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){va(r);return}l=l!=null?""+kn(l):"",o=o!=null?""+kn(o):l,x||o===r.value||(r.value=o),r.defaultValue=o}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=x?r.checked:!!u,r.defaultChecked=!!u,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.name=_),va(r)}function Nr(r,o,l){o==="number"&&Pr(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Hr(r,o,l,u){if(r=r.options,o){o={};for(var p=0;p<l.length;p++)o["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=o.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&u&&(r[l].defaultSelected=!0)}else{for(l=""+kn(l),o=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,u&&(r[p].defaultSelected=!0);return}o!==null||r[p].disabled||(o=r[p])}o!==null&&(o.selected=!0)}}function Ds(r,o,l){if(o!=null&&(o=""+kn(o),o!==r.value&&(r.value=o),l==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=l!=null?""+kn(l):""}function Pc(r,o,l,u){if(o==null){if(u!=null){if(l!=null)throw Error(i(92));if(me(u)){if(1<u.length)throw Error(i(93));u=u[0]}l=u}l==null&&(l=""),o=l}l=kn(o),r.defaultValue=l,u=r.textContent,u===l&&u!==""&&u!==null&&(r.value=u),va(r)}function _n(r,o){if(o){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=o;return}}r.textContent=o}var ba=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zr(r,o,l){var u=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,l):typeof l!="number"||l===0||ba.has(o)?o==="float"?r.cssFloat=l:r[o]=(""+l).trim():r[o]=l+"px"}function Ms(r,o,l){if(o!=null&&typeof o!="object")throw Error(i(62));if(r=r.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var p in o)u=o[p],o.hasOwnProperty(p)&&l[p]!==u&&zr(r,p,u)}else for(var v in o)o.hasOwnProperty(v)&&zr(r,v,o[v])}function ir(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sa=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Os=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ko(r){return Os.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ei(){}var Ps=null;function Ns(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vr=null,rr=null;function Hs(r){var o=Mr(r);if(o&&(r=o.stateNode)){var l=r[Kt]||null;e:switch(r=o.stateNode,o.type){case"input":if(ya(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Yt(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var u=l[o];if(u!==r&&u.form===r.form){var p=u[Kt]||null;if(!p)throw Error(i(90));ya(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<l.length;o++)u=l[o],u.form===r.form&&nr(u)}break e;case"textarea":Ds(r,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Hr(r,!!l.multiple,o,!1)}}}var zs=!1;function Nc(r,o,l){if(zs)return r(o,l);zs=!0;try{var u=r(o);return u}finally{if(zs=!1,(Vr!==null||rr!==null)&&(Eu(),Vr&&(o=Vr,r=rr,rr=Vr=null,Hs(o),r)))for(o=0;o<r.length;o++)Hs(r[o])}}function Ao(r,o){var l=r.stateNode;if(l===null)return null;var u=l[Kt]||null;if(u===null)return null;l=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(i(231,o,typeof l));return l}var vi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vs=!1;if(vi)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Vs=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Vs=!1}var yi=null,Bs=null,_a=null;function Hc(){if(_a)return _a;var r,o=Bs,l=o.length,u,p="value"in yi?yi.value:yi.textContent,v=p.length;for(r=0;r<l&&o[r]===p[r];r++);var _=l-r;for(u=1;u<=_&&o[l-u]===p[v-u];u++);return _a=p.slice(r,1<u?1-u:void 0)}function Ca(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Ea(){return!0}function Br(){return!1}function fn(r){function o(l,u,p,v,_){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=v,this.target=_,this.currentTarget=null;for(var x in r)r.hasOwnProperty(x)&&(l=r[x],this[x]=l?l(v):v[x]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ea:Br,this.isPropagationStopped=Br,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ea)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ea)},persist:function(){},isPersistent:Ea}),o}var or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wa=fn(or),Lo=g({},or,{view:0,detail:0}),Ur=fn(Lo),xa,ti,Io,Di=g({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$s,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Io&&(Io&&r.type==="mousemove"?(xa=r.screenX-Io.screenX,ti=r.screenY-Io.screenY):ti=xa=0,Io=r),xa)},movementY:function(r){return"movementY"in r?r.movementY:ti}}),Us=fn(Di),Af=g({},Di,{dataTransfer:0}),Lf=fn(Af),If=g({},Lo,{relatedTarget:0}),Fs=fn(If),Ro=g({},or,{animationName:0,elapsedTime:0,pseudoElement:0}),js=fn(Ro),Rf=g({},or,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Ta=fn(Rf),zc=g({},or,{data:0}),Vc=fn(zc),Df={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Of={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ka(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Of[r])?!!o[r]:!1}function $s(){return ka}var I=g({},Lo,{key:function(r){if(r.key){var o=Df[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Ca(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Mf[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$s,charCode:function(r){return r.type==="keypress"?Ca(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ca(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Z=fn(I),Ee=g({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ue=fn(Ee),fe=g({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$s}),Ae=fn(fe),ct=g({},or,{propertyName:0,elapsedTime:0,pseudoElement:0}),ke=fn(ct),Je=g({},Di,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),rt=fn(Je),tt=g({},or,{newState:0,oldState:0}),ht=fn(tt),Xt=[9,13,27,32],Cn=vi&&"CompositionEvent"in window,pt=null;vi&&"documentMode"in document&&(pt=document.documentMode);var Xe=vi&&"TextEvent"in window&&!pt,mt=vi&&(!Cn||pt&&8<pt&&11>=pt),Qt=" ",Do=!1;function Mo(r,o){switch(r){case"keyup":return Xt.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vt(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var on=!1;function Aa(r,o){switch(r){case"compositionend":return vt(o);case"keypress":return o.which!==32?null:(Do=!0,Qt);case"textInput":return r=o.data,r===Qt&&Do?null:r;default:return null}}function qs(r,o){if(on)return r==="compositionend"||!Cn&&Mo(r,o)?(r=Hc(),_a=Bs=yi=null,on=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return mt&&o.locale!=="ko"?null:o.data;default:return null}}var Bc={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Uc(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!Bc[r.type]:o==="textarea"}function s0(r,o,l,u){Vr?rr?rr.push(u):rr=[u]:Vr=u,o=Iu(o,"onChange"),0<o.length&&(l=new wa("onChange","change",null,l,u),r.push({event:l,listeners:o}))}var Gs=null,Ws=null;function M5(r){jv(r,0)}function Fc(r){var o=mi(r);if(nr(o))return r}function l0(r,o){if(r==="change")return o}var c0=!1;if(vi){var Pf;if(vi){var Nf="oninput"in document;if(!Nf){var u0=document.createElement("div");u0.setAttribute("oninput","return;"),Nf=typeof u0.oninput=="function"}Pf=Nf}else Pf=!1;c0=Pf&&(!document.documentMode||9<document.documentMode)}function d0(){Gs&&(Gs.detachEvent("onpropertychange",f0),Ws=Gs=null)}function f0(r){if(r.propertyName==="value"&&Fc(Ws)){var o=[];s0(o,Ws,r,Ns(r)),Nc(M5,o)}}function O5(r,o,l){r==="focusin"?(d0(),Gs=o,Ws=l,Gs.attachEvent("onpropertychange",f0)):r==="focusout"&&d0()}function P5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Fc(Ws)}function N5(r,o){if(r==="click")return Fc(o)}function H5(r,o){if(r==="input"||r==="change")return Fc(o)}function z5(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Vn=typeof Object.is=="function"?Object.is:z5;function Ks(r,o){if(Vn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var l=Object.keys(r),u=Object.keys(o);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!yn.call(o,p)||!Vn(r[p],o[p]))return!1}return!0}function h0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function p0(r,o){var l=h0(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=o&&u>=o)return{node:l,offset:o-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=h0(l)}}function m0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?m0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function g0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=Pr(r.document);o instanceof r.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)r=o.contentWindow;else break;o=Pr(r.document)}return o}function Hf(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var V5=vi&&"documentMode"in document&&11>=document.documentMode,La=null,zf=null,Ys=null,Vf=!1;function v0(r,o,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vf||La==null||La!==Pr(u)||(u=La,"selectionStart"in u&&Hf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ys&&Ks(Ys,u)||(Ys=u,u=Iu(zf,"onSelect"),0<u.length&&(o=new wa("onSelect","select",null,o,l),r.push({event:o,listeners:u}),o.target=La)))}function Oo(r,o){var l={};return l[r.toLowerCase()]=o.toLowerCase(),l["Webkit"+r]="webkit"+o,l["Moz"+r]="moz"+o,l}var Ia={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},Bf={},y0={};vi&&(y0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Po(r){if(Bf[r])return Bf[r];if(!Ia[r])return r;var o=Ia[r],l;for(l in o)if(o.hasOwnProperty(l)&&l in y0)return Bf[r]=o[l];return r}var b0=Po("animationend"),S0=Po("animationiteration"),_0=Po("animationstart"),B5=Po("transitionrun"),U5=Po("transitionstart"),F5=Po("transitioncancel"),C0=Po("transitionend"),E0=new Map,Uf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Uf.push("scrollEnd");function bi(r,o){E0.set(r,o),Jn(o,[r])}var jc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ni=[],Ra=0,Ff=0;function $c(){for(var r=Ra,o=Ff=Ra=0;o<r;){var l=ni[o];ni[o++]=null;var u=ni[o];ni[o++]=null;var p=ni[o];ni[o++]=null;var v=ni[o];if(ni[o++]=null,u!==null&&p!==null){var _=u.pending;_===null?p.next=p:(p.next=_.next,_.next=p),u.pending=p}v!==0&&w0(l,p,v)}}function qc(r,o,l,u){ni[Ra++]=r,ni[Ra++]=o,ni[Ra++]=l,ni[Ra++]=u,Ff|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function jf(r,o,l,u){return qc(r,o,l,u),Gc(r)}function No(r,o){return qc(r,null,null,o),Gc(r)}function w0(r,o,l){r.lanes|=l;var u=r.alternate;u!==null&&(u.lanes|=l);for(var p=!1,v=r.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&o!==null&&(p=31-tn(l),r=v.hiddenUpdates,u=r[p],u===null?r[p]=[o]:u.push(o),o.lane=l|536870912),v):null}function Gc(r){if(50<vl)throw vl=0,Zh=null,Error(i(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function j5(r,o,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(r,o,l,u){return new j5(r,o,l,u)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ar(r,o){var l=r.alternate;return l===null?(l=Bn(r.tag,o,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=o,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,o=r.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function x0(r,o){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,o=l.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Wc(r,o,l,u,p,v){var _=0;if(u=r,typeof r=="function")$f(r)&&(_=1);else if(typeof r=="string")_=Kw(r,l,ae.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case G:return r=Bn(31,l,o,p),r.elementType=G,r.lanes=v,r;case w:return Ho(l.children,p,v,o);case A:_=8,p|=24;break;case k:return r=Bn(12,l,o,p|2),r.elementType=k,r.lanes=v,r;case O:return r=Bn(13,l,o,p),r.elementType=O,r.lanes=v,r;case D:return r=Bn(19,l,o,p),r.elementType=D,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:_=10;break e;case E:_=9;break e;case L:_=11;break e;case N:_=14;break e;case W:_=16,u=null;break e}_=29,l=Error(i(130,r===null?"null":typeof r,"")),u=null}return o=Bn(_,l,o,p),o.elementType=r,o.type=u,o.lanes=v,o}function Ho(r,o,l,u){return r=Bn(7,r,u,o),r.lanes=l,r}function qf(r,o,l){return r=Bn(6,r,null,o),r.lanes=l,r}function T0(r){var o=Bn(18,null,null,0);return o.stateNode=r,o}function Gf(r,o,l){return o=Bn(4,r.children!==null?r.children:[],r.key,o),o.lanes=l,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var k0=new WeakMap;function ii(r,o){if(typeof r=="object"&&r!==null){var l=k0.get(r);return l!==void 0?l:(o={value:r,source:o,stack:vn(o)},k0.set(r,o),o)}return{value:r,source:o,stack:vn(o)}}var Ma=[],Oa=0,Kc=null,Xs=0,ri=[],oi=0,Fr=null,Mi=1,Oi="";function sr(r,o){Ma[Oa++]=Xs,Ma[Oa++]=Kc,Kc=r,Xs=o}function A0(r,o,l){ri[oi++]=Mi,ri[oi++]=Oi,ri[oi++]=Fr,Fr=r;var u=Mi;r=Oi;var p=32-tn(u)-1;u&=~(1<<p),l+=1;var v=32-tn(o)+p;if(30<v){var _=p-p%5;v=(u&(1<<_)-1).toString(32),u>>=_,p-=_,Mi=1<<32-tn(o)+p|l<<p|u,Oi=v+r}else Mi=1<<v|l<<p|u,Oi=r}function Wf(r){r.return!==null&&(sr(r,1),A0(r,1,0))}function Kf(r){for(;r===Kc;)Kc=Ma[--Oa],Ma[Oa]=null,Xs=Ma[--Oa],Ma[Oa]=null;for(;r===Fr;)Fr=ri[--oi],ri[oi]=null,Oi=ri[--oi],ri[oi]=null,Mi=ri[--oi],ri[oi]=null}function L0(r,o){ri[oi++]=Mi,ri[oi++]=Oi,ri[oi++]=Fr,Mi=o.id,Oi=o.overflow,Fr=r}var an=null,yt=null,Ge=!1,jr=null,ai=!1,Yf=Error(i(519));function $r(r){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qs(ii(o,r)),Yf}function I0(r){var o=r.stateNode,l=r.type,u=r.memoizedProps;switch(o[Ct]=r,o[Kt]=u,l){case"dialog":je("cancel",o),je("close",o);break;case"iframe":case"object":case"embed":je("load",o);break;case"video":case"audio":for(l=0;l<bl.length;l++)je(bl[l],o);break;case"source":je("error",o);break;case"img":case"image":case"link":je("error",o),je("load",o);break;case"details":je("toggle",o);break;case"input":je("invalid",o),Oc(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":je("invalid",o);break;case"textarea":je("invalid",o),Pc(o,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||u.suppressHydrationWarning===!0||Wv(o.textContent,l)?(u.popover!=null&&(je("beforetoggle",o),je("toggle",o)),u.onScroll!=null&&je("scroll",o),u.onScrollEnd!=null&&je("scrollend",o),u.onClick!=null&&(o.onclick=ei),o=!0):o=!1,o||$r(r,!0)}function R0(r){for(an=r.return;an;)switch(an.tag){case 5:case 31:case 13:ai=!1;return;case 27:case 3:ai=!0;return;default:an=an.return}}function Pa(r){if(r!==an)return!1;if(!Ge)return R0(r),Ge=!0,!1;var o=r.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||hp(r.type,r.memoizedProps)),l=!l),l&&yt&&$r(r),R0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));yt=ny(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));yt=ny(r)}else o===27?(o=yt,ro(r.type)?(r=yp,yp=null,yt=r):yt=o):yt=an?li(r.stateNode.nextSibling):null;return!0}function zo(){yt=an=null,Ge=!1}function Xf(){var r=jr;return r!==null&&(Dn===null?Dn=r:Dn.push.apply(Dn,r),jr=null),r}function Qs(r){jr===null?jr=[r]:jr.push(r)}var Qf=M(null),Vo=null,lr=null;function qr(r,o,l){re(Qf,o._currentValue),o._currentValue=l}function cr(r){r._currentValue=Qf.current,q(Qf)}function Zf(r,o,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===l)break;r=r.return}}function Jf(r,o,l,u){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var _=p.child;v=v.firstContext;e:for(;v!==null;){var x=v;v=p;for(var R=0;R<o.length;R++)if(x.context===o[R]){v.lanes|=l,x=v.alternate,x!==null&&(x.lanes|=l),Zf(v.return,l,r),u||(_=null);break e}v=x.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(i(341));_.lanes|=l,v=_.alternate,v!==null&&(v.lanes|=l),Zf(_,l,r),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===r){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function Na(r,o,l,u){r=null;for(var p=o,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var _=p.alternate;if(_===null)throw Error(i(387));if(_=_.memoizedProps,_!==null){var x=p.type;Vn(p.pendingProps.value,_.value)||(r!==null?r.push(x):r=[x])}}else if(p===be.current){if(_=p.alternate,_===null)throw Error(i(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(wl):r=[wl])}p=p.return}r!==null&&Jf(o,r,l,u),o.flags|=262144}function Yc(r){for(r=r.firstContext;r!==null;){if(!Vn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Bo(r){Vo=r,lr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function sn(r){return D0(Vo,r)}function Xc(r,o){return Vo===null&&Bo(r),D0(r,o)}function D0(r,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},lr===null){if(r===null)throw Error(i(308));lr=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else lr=lr.next=o;return l}var $5=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(l,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(l){return l()})}},q5=e.unstable_scheduleCallback,G5=e.unstable_NormalPriority,Nt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eh(){return{controller:new $5,data:new Map,refCount:0}}function Zs(r){r.refCount--,r.refCount===0&&q5(G5,function(){r.controller.abort()})}var Js=null,th=0,Ha=0,za=null;function W5(r,o){if(Js===null){var l=Js=[];th=0,Ha=rp(),za={status:"pending",value:void 0,then:function(u){l.push(u)}}}return th++,o.then(M0,M0),o}function M0(){if(--th===0&&Js!==null){za!==null&&(za.status="fulfilled");var r=Js;Js=null,Ha=0,za=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function K5(r,o){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var p=0;p<l.length;p++)(0,l[p])(o)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var O0=H.S;H.S=function(r,o){vv=bn(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&W5(r,o),O0!==null&&O0(r,o)};var Uo=M(null);function nh(){var r=Uo.current;return r!==null?r:ut.pooledCache}function Qc(r,o){o===null?re(Uo,Uo.current):re(Uo,o.pool)}function P0(){var r=nh();return r===null?null:{parent:Nt._currentValue,pool:r}}var Va=Error(i(460)),ih=Error(i(474)),Zc=Error(i(542)),Jc={then:function(){}};function N0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function H0(r,o,l){switch(l=r[l],l===void 0?r.push(o):l!==o&&(o.then(ei,ei),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,V0(r),r;default:if(typeof o.status=="string")o.then(ei,ei);else{if(r=ut,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=u}},function(u){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,V0(r),r}throw jo=o,Va}}function Fo(r){try{var o=r._init;return o(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(jo=l,Va):l}}var jo=null;function z0(){if(jo===null)throw Error(i(459));var r=jo;return jo=null,r}function V0(r){if(r===Va||r===Zc)throw Error(i(483))}var Ba=null,el=0;function eu(r){var o=el;return el+=1,Ba===null&&(Ba=[]),H0(Ba,r,o)}function tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function tu(r,o){throw o.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(o),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function B0(r){function o(V,P){if(r){var B=V.deletions;B===null?(V.deletions=[P],V.flags|=16):B.push(P)}}function l(V,P){if(!r)return null;for(;P!==null;)o(V,P),P=P.sibling;return null}function u(V){for(var P=new Map;V!==null;)V.key!==null?P.set(V.key,V):P.set(V.index,V),V=V.sibling;return P}function p(V,P){return V=ar(V,P),V.index=0,V.sibling=null,V}function v(V,P,B){return V.index=B,r?(B=V.alternate,B!==null?(B=B.index,B<P?(V.flags|=67108866,P):B):(V.flags|=67108866,P)):(V.flags|=1048576,P)}function _(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function x(V,P,B,X){return P===null||P.tag!==6?(P=qf(B,V.mode,X),P.return=V,P):(P=p(P,B),P.return=V,P)}function R(V,P,B,X){var xe=B.type;return xe===w?K(V,P,B.props.children,X,B.key):P!==null&&(P.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===W&&Fo(xe)===P.type)?(P=p(P,B.props),tl(P,B),P.return=V,P):(P=Wc(B.type,B.key,B.props,null,V.mode,X),tl(P,B),P.return=V,P)}function F(V,P,B,X){return P===null||P.tag!==4||P.stateNode.containerInfo!==B.containerInfo||P.stateNode.implementation!==B.implementation?(P=Gf(B,V.mode,X),P.return=V,P):(P=p(P,B.children||[]),P.return=V,P)}function K(V,P,B,X,xe){return P===null||P.tag!==7?(P=Ho(B,V.mode,X,xe),P.return=V,P):(P=p(P,B),P.return=V,P)}function J(V,P,B){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=qf(""+P,V.mode,B),P.return=V,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return B=Wc(P.type,P.key,P.props,null,V.mode,B),tl(B,P),B.return=V,B;case S:return P=Gf(P,V.mode,B),P.return=V,P;case W:return P=Fo(P),J(V,P,B)}if(me(P)||ee(P))return P=Ho(P,V.mode,B,null),P.return=V,P;if(typeof P.then=="function")return J(V,eu(P),B);if(P.$$typeof===T)return J(V,Xc(V,P),B);tu(V,P)}return null}function j(V,P,B,X){var xe=P!==null?P.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return xe!==null?null:x(V,P,""+B,X);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return B.key===xe?R(V,P,B,X):null;case S:return B.key===xe?F(V,P,B,X):null;case W:return B=Fo(B),j(V,P,B,X)}if(me(B)||ee(B))return xe!==null?null:K(V,P,B,X,null);if(typeof B.then=="function")return j(V,P,eu(B),X);if(B.$$typeof===T)return j(V,P,Xc(V,B),X);tu(V,B)}return null}function $(V,P,B,X,xe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return V=V.get(B)||null,x(P,V,""+X,xe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return V=V.get(X.key===null?B:X.key)||null,R(P,V,X,xe);case S:return V=V.get(X.key===null?B:X.key)||null,F(P,V,X,xe);case W:return X=Fo(X),$(V,P,B,X,xe)}if(me(X)||ee(X))return V=V.get(B)||null,K(P,V,X,xe,null);if(typeof X.then=="function")return $(V,P,B,eu(X),xe);if(X.$$typeof===T)return $(V,P,B,Xc(P,X),xe);tu(P,X)}return null}function ge(V,P,B,X){for(var xe=null,Ke=null,ye=P,ze=P=0,qe=null;ye!==null&&ze<B.length;ze++){ye.index>ze?(qe=ye,ye=null):qe=ye.sibling;var Ye=j(V,ye,B[ze],X);if(Ye===null){ye===null&&(ye=qe);break}r&&ye&&Ye.alternate===null&&o(V,ye),P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye,ye=qe}if(ze===B.length)return l(V,ye),Ge&&sr(V,ze),xe;if(ye===null){for(;ze<B.length;ze++)ye=J(V,B[ze],X),ye!==null&&(P=v(ye,P,ze),Ke===null?xe=ye:Ke.sibling=ye,Ke=ye);return Ge&&sr(V,ze),xe}for(ye=u(ye);ze<B.length;ze++)qe=$(ye,V,ze,B[ze],X),qe!==null&&(r&&qe.alternate!==null&&ye.delete(qe.key===null?ze:qe.key),P=v(qe,P,ze),Ke===null?xe=qe:Ke.sibling=qe,Ke=qe);return r&&ye.forEach(function(co){return o(V,co)}),Ge&&sr(V,ze),xe}function Ie(V,P,B,X){if(B==null)throw Error(i(151));for(var xe=null,Ke=null,ye=P,ze=P=0,qe=null,Ye=B.next();ye!==null&&!Ye.done;ze++,Ye=B.next()){ye.index>ze?(qe=ye,ye=null):qe=ye.sibling;var co=j(V,ye,Ye.value,X);if(co===null){ye===null&&(ye=qe);break}r&&ye&&co.alternate===null&&o(V,ye),P=v(co,P,ze),Ke===null?xe=co:Ke.sibling=co,Ke=co,ye=qe}if(Ye.done)return l(V,ye),Ge&&sr(V,ze),xe;if(ye===null){for(;!Ye.done;ze++,Ye=B.next())Ye=J(V,Ye.value,X),Ye!==null&&(P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye);return Ge&&sr(V,ze),xe}for(ye=u(ye);!Ye.done;ze++,Ye=B.next())Ye=$(ye,V,ze,Ye.value,X),Ye!==null&&(r&&Ye.alternate!==null&&ye.delete(Ye.key===null?ze:Ye.key),P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye);return r&&ye.forEach(function(ox){return o(V,ox)}),Ge&&sr(V,ze),xe}function st(V,P,B,X){if(typeof B=="object"&&B!==null&&B.type===w&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case b:e:{for(var xe=B.key;P!==null;){if(P.key===xe){if(xe=B.type,xe===w){if(P.tag===7){l(V,P.sibling),X=p(P,B.props.children),X.return=V,V=X;break e}}else if(P.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===W&&Fo(xe)===P.type){l(V,P.sibling),X=p(P,B.props),tl(X,B),X.return=V,V=X;break e}l(V,P);break}else o(V,P);P=P.sibling}B.type===w?(X=Ho(B.props.children,V.mode,X,B.key),X.return=V,V=X):(X=Wc(B.type,B.key,B.props,null,V.mode,X),tl(X,B),X.return=V,V=X)}return _(V);case S:e:{for(xe=B.key;P!==null;){if(P.key===xe)if(P.tag===4&&P.stateNode.containerInfo===B.containerInfo&&P.stateNode.implementation===B.implementation){l(V,P.sibling),X=p(P,B.children||[]),X.return=V,V=X;break e}else{l(V,P);break}else o(V,P);P=P.sibling}X=Gf(B,V.mode,X),X.return=V,V=X}return _(V);case W:return B=Fo(B),st(V,P,B,X)}if(me(B))return ge(V,P,B,X);if(ee(B)){if(xe=ee(B),typeof xe!="function")throw Error(i(150));return B=xe.call(B),Ie(V,P,B,X)}if(typeof B.then=="function")return st(V,P,eu(B),X);if(B.$$typeof===T)return st(V,P,Xc(V,B),X);tu(V,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,P!==null&&P.tag===6?(l(V,P.sibling),X=p(P,B),X.return=V,V=X):(l(V,P),X=qf(B,V.mode,X),X.return=V,V=X),_(V)):l(V,P)}return function(V,P,B,X){try{el=0;var xe=st(V,P,B,X);return Ba=null,xe}catch(ye){if(ye===Va||ye===Zc)throw ye;var Ke=Bn(29,ye,null,V.mode);return Ke.lanes=X,Ke.return=V,Ke}finally{}}}var $o=B0(!0),U0=B0(!1),Gr=!1;function rh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oh(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Wr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Kr(r,o,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(Qe&2)!==0){var p=u.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),u.pending=o,o=Gc(r),w0(r,null,l),o}return qc(r,u,o,l),Gc(r)}function nl(r,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,Rc(r,l)}}function ah(r,o){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?p=v=_:v=v.next=_,l=l.next}while(l!==null);v===null?p=v=o:v=v.next=o}else p=v=o;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=o:r.next=o,l.lastBaseUpdate=o}var sh=!1;function il(){if(sh){var r=za;if(r!==null)throw r}}function rl(r,o,l,u){sh=!1;var p=r.updateQueue;Gr=!1;var v=p.firstBaseUpdate,_=p.lastBaseUpdate,x=p.shared.pending;if(x!==null){p.shared.pending=null;var R=x,F=R.next;R.next=null,_===null?v=F:_.next=F,_=R;var K=r.alternate;K!==null&&(K=K.updateQueue,x=K.lastBaseUpdate,x!==_&&(x===null?K.firstBaseUpdate=F:x.next=F,K.lastBaseUpdate=R))}if(v!==null){var J=p.baseState;_=0,K=F=R=null,x=v;do{var j=x.lane&-536870913,$=j!==x.lane;if($?($e&j)===j:(u&j)===j){j!==0&&j===Ha&&(sh=!0),K!==null&&(K=K.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ge=r,Ie=x;j=o;var st=l;switch(Ie.tag){case 1:if(ge=Ie.payload,typeof ge=="function"){J=ge.call(st,J,j);break e}J=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ie.payload,j=typeof ge=="function"?ge.call(st,J,j):ge,j==null)break e;J=g({},J,j);break e;case 2:Gr=!0}}j=x.callback,j!==null&&(r.flags|=64,$&&(r.flags|=8192),$=p.callbacks,$===null?p.callbacks=[j]:$.push(j))}else $={lane:j,tag:x.tag,payload:x.payload,callback:x.callback,next:null},K===null?(F=K=$,R=J):K=K.next=$,_|=j;if(x=x.next,x===null){if(x=p.shared.pending,x===null)break;$=x,x=$.next,$.next=null,p.lastBaseUpdate=$,p.shared.pending=null}}while(!0);K===null&&(R=J),p.baseState=R,p.firstBaseUpdate=F,p.lastBaseUpdate=K,v===null&&(p.shared.lanes=0),Jr|=_,r.lanes=_,r.memoizedState=J}}function F0(r,o){if(typeof r!="function")throw Error(i(191,r));r.call(o)}function j0(r,o){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)F0(l[r],o)}var Ua=M(null),nu=M(0);function $0(r,o){r=yr,re(nu,r),re(Ua,o),yr=r|o.baseLanes}function lh(){re(nu,yr),re(Ua,Ua.current)}function ch(){yr=nu.current,q(Ua),q(nu)}var Un=M(null),si=null;function Yr(r){var o=r.alternate;re(Rt,Rt.current&1),re(Un,r),si===null&&(o===null||Ua.current!==null||o.memoizedState!==null)&&(si=r)}function uh(r){re(Rt,Rt.current),re(Un,r),si===null&&(si=r)}function q0(r){r.tag===22?(re(Rt,Rt.current),re(Un,r),si===null&&(si=r)):Xr()}function Xr(){re(Rt,Rt.current),re(Un,Un.current)}function Fn(r){q(Un),si===r&&(si=null),q(Rt)}var Rt=M(0);function iu(r){for(var o=r;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gp(l)||vp(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ur=0,Pe=null,ot=null,Ht=null,ru=!1,Fa=!1,qo=!1,ou=0,ol=0,ja=null,Y5=0;function kt(){throw Error(i(321))}function dh(r,o){if(o===null)return!1;for(var l=0;l<o.length&&l<r.length;l++)if(!Vn(r[l],o[l]))return!1;return!0}function fh(r,o,l,u,p,v){return ur=v,Pe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=r===null||r.memoizedState===null?A1:kh,qo=!1,v=l(u,p),qo=!1,Fa&&(v=W0(o,l,u,p)),G0(r),v}function G0(r){H.H=ll;var o=ot!==null&&ot.next!==null;if(ur=0,Ht=ot=Pe=null,ru=!1,ol=0,ja=null,o)throw Error(i(300));r===null||zt||(r=r.dependencies,r!==null&&Yc(r)&&(zt=!0))}function W0(r,o,l,u){Pe=r;var p=0;do{if(Fa&&(ja=null),ol=0,Fa=!1,25<=p)throw Error(i(301));if(p+=1,Ht=ot=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=L1,v=o(l,u)}while(Fa);return v}function X5(){var r=H.H,o=r.useState()[0];return o=typeof o.then=="function"?al(o):o,r=r.useState()[0],(ot!==null?ot.memoizedState:null)!==r&&(Pe.flags|=1024),o}function hh(){var r=ou!==0;return ou=0,r}function ph(r,o,l){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~l}function mh(r){if(ru){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ru=!1}ur=0,Ht=ot=Pe=null,Fa=!1,ol=ou=0,ja=null}function En(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Pe.memoizedState=Ht=r:Ht=Ht.next=r,Ht}function Dt(){if(ot===null){var r=Pe.alternate;r=r!==null?r.memoizedState:null}else r=ot.next;var o=Ht===null?Pe.memoizedState:Ht.next;if(o!==null)Ht=o,ot=r;else{if(r===null)throw Pe.alternate===null?Error(i(467)):Error(i(310));ot=r,r={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ht===null?Pe.memoizedState=Ht=r:Ht=Ht.next=r}return Ht}function au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(r){var o=ol;return ol+=1,ja===null&&(ja=[]),r=H0(ja,r,o),o=Pe,(Ht===null?o.memoizedState:Ht.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?A1:kh),r}function su(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return al(r);if(r.$$typeof===T)return sn(r)}throw Error(i(438,String(r)))}function gh(r){var o=null,l=Pe.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var u=Pe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=au(),Pe.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(r),u=0;u<r;u++)l[u]=se;return o.index++,l}function dr(r,o){return typeof o=="function"?o(r):o}function lu(r){var o=Dt();return vh(o,ot,r)}function vh(r,o,l){var u=r.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=l;var p=r.baseQueue,v=u.pending;if(v!==null){if(p!==null){var _=p.next;p.next=v.next,v.next=_}o.baseQueue=p=v,u.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{o=p.next;var x=_=null,R=null,F=o,K=!1;do{var J=F.lane&-536870913;if(J!==F.lane?($e&J)===J:(ur&J)===J){var j=F.revertLane;if(j===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),J===Ha&&(K=!0);else if((ur&j)===j){F=F.next,j===Ha&&(K=!0);continue}else J={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(x=R=J,_=v):R=R.next=J,Pe.lanes|=j,Jr|=j;J=F.action,qo&&l(v,J),v=F.hasEagerState?F.eagerState:l(v,J)}else j={lane:J,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(x=R=j,_=v):R=R.next=j,Pe.lanes|=J,Jr|=J;F=F.next}while(F!==null&&F!==o);if(R===null?_=v:R.next=x,!Vn(v,r.memoizedState)&&(zt=!0,K&&(l=za,l!==null)))throw l;r.memoizedState=v,r.baseState=_,r.baseQueue=R,u.lastRenderedState=v}return p===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function yh(r){var o=Dt(),l=o.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=r;var u=l.dispatch,p=l.pending,v=o.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do v=r(v,_.action),_=_.next;while(_!==p);Vn(v,o.memoizedState)||(zt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,u]}function K0(r,o,l){var u=Pe,p=Dt(),v=Ge;if(v){if(l===void 0)throw Error(i(407));l=l()}else l=o();var _=!Vn((ot||p).memoizedState,l);if(_&&(p.memoizedState=l,zt=!0),p=p.queue,_h(Q0.bind(null,u,p,r),[r]),p.getSnapshot!==o||_||Ht!==null&&Ht.memoizedState.tag&1){if(u.flags|=2048,$a(9,{destroy:void 0},X0.bind(null,u,p,l,o),null),ut===null)throw Error(i(349));v||(ur&127)!==0||Y0(u,o,l)}return l}function Y0(r,o,l){r.flags|=16384,r={getSnapshot:o,value:l},o=Pe.updateQueue,o===null?(o=au(),Pe.updateQueue=o,o.stores=[r]):(l=o.stores,l===null?o.stores=[r]:l.push(r))}function X0(r,o,l,u){o.value=l,o.getSnapshot=u,Z0(o)&&J0(r)}function Q0(r,o,l){return l(function(){Z0(o)&&J0(r)})}function Z0(r){var o=r.getSnapshot;r=r.value;try{var l=o();return!Vn(r,l)}catch{return!0}}function J0(r){var o=No(r,2);o!==null&&Mn(o,r,2)}function bh(r){var o=En();if(typeof r=="function"){var l=r;if(r=l(),qo){Li(!0);try{l()}finally{Li(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:r},o}function e1(r,o,l,u){return r.baseState=l,vh(r,ot,typeof u=="function"?u:dr)}function Q5(r,o,l,u,p){if(du(r))throw Error(i(485));if(r=o.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){v.listeners.push(_)}};H.T!==null?l(!0):v.isTransition=!1,u(v),l=o.pending,l===null?(v.next=o.pending=v,t1(o,v)):(v.next=l.next,o.pending=l.next=v)}}function t1(r,o){var l=o.action,u=o.payload,p=r.state;if(o.isTransition){var v=H.T,_={};H.T=_;try{var x=l(p,u),R=H.S;R!==null&&R(_,x),n1(r,o,x)}catch(F){Sh(r,o,F)}finally{v!==null&&_.types!==null&&(v.types=_.types),H.T=v}}else try{v=l(p,u),n1(r,o,v)}catch(F){Sh(r,o,F)}}function n1(r,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){i1(r,o,u)},function(u){return Sh(r,o,u)}):i1(r,o,l)}function i1(r,o,l){o.status="fulfilled",o.value=l,r1(o),r.state=l,o=r.pending,o!==null&&(l=o.next,l===o?r.pending=null:(l=l.next,o.next=l,t1(r,l)))}function Sh(r,o,l){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=l,r1(o),o=o.next;while(o!==u)}r.action=null}function r1(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function o1(r,o){return o}function a1(r,o){if(Ge){var l=ut.formState;if(l!==null){e:{var u=Pe;if(Ge){if(yt){t:{for(var p=yt,v=ai;p.nodeType!==8;){if(!v){p=null;break t}if(p=li(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){yt=li(p.nextSibling),u=p.data==="F!";break e}}$r(u)}u=!1}u&&(o=l[0])}}return l=En(),l.memoizedState=l.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o1,lastRenderedState:o},l.queue=u,l=x1.bind(null,Pe,u),u.dispatch=l,u=bh(!1),v=Th.bind(null,Pe,!1,u.queue),u=En(),p={state:o,dispatch:null,action:r,pending:null},u.queue=p,l=Q5.bind(null,Pe,p,v,l),p.dispatch=l,u.memoizedState=r,[o,l,!1]}function s1(r){var o=Dt();return l1(o,ot,r)}function l1(r,o,l){if(o=vh(r,o,o1)[0],r=lu(dr)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=al(o)}catch(_){throw _===Va?Zc:_}else u=o;o=Dt();var p=o.queue,v=p.dispatch;return l!==o.memoizedState&&(Pe.flags|=2048,$a(9,{destroy:void 0},Z5.bind(null,p,l),null)),[u,v,r]}function Z5(r,o){r.action=o}function c1(r){var o=Dt(),l=ot;if(l!==null)return l1(o,l,r);Dt(),o=o.memoizedState,l=Dt();var u=l.queue.dispatch;return l.memoizedState=r,[o,u,!1]}function $a(r,o,l,u){return r={tag:r,create:l,deps:u,inst:o,next:null},o=Pe.updateQueue,o===null&&(o=au(),Pe.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,o.lastEffect=r),r}function u1(){return Dt().memoizedState}function cu(r,o,l,u){var p=En();Pe.flags|=r,p.memoizedState=$a(1|o,{destroy:void 0},l,u===void 0?null:u)}function uu(r,o,l,u){var p=Dt();u=u===void 0?null:u;var v=p.memoizedState.inst;ot!==null&&u!==null&&dh(u,ot.memoizedState.deps)?p.memoizedState=$a(o,v,l,u):(Pe.flags|=r,p.memoizedState=$a(1|o,v,l,u))}function d1(r,o){cu(8390656,8,r,o)}function _h(r,o){uu(2048,8,r,o)}function J5(r){Pe.flags|=4;var o=Pe.updateQueue;if(o===null)o=au(),Pe.updateQueue=o,o.events=[r];else{var l=o.events;l===null?o.events=[r]:l.push(r)}}function f1(r){var o=Dt().memoizedState;return J5({ref:o,nextImpl:r}),function(){if((Qe&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function h1(r,o){return uu(4,2,r,o)}function p1(r,o){return uu(4,4,r,o)}function m1(r,o){if(typeof o=="function"){r=r();var l=o(r);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function g1(r,o,l){l=l!=null?l.concat([r]):null,uu(4,4,m1.bind(null,o,r),l)}function Ch(){}function v1(r,o){var l=Dt();o=o===void 0?null:o;var u=l.memoizedState;return o!==null&&dh(o,u[1])?u[0]:(l.memoizedState=[r,o],r)}function y1(r,o){var l=Dt();o=o===void 0?null:o;var u=l.memoizedState;if(o!==null&&dh(o,u[1]))return u[0];if(u=r(),qo){Li(!0);try{r()}finally{Li(!1)}}return l.memoizedState=[u,o],u}function Eh(r,o,l){return l===void 0||(ur&1073741824)!==0&&($e&261930)===0?r.memoizedState=o:(r.memoizedState=l,r=bv(),Pe.lanes|=r,Jr|=r,l)}function b1(r,o,l,u){return Vn(l,o)?l:Ua.current!==null?(r=Eh(r,l,u),Vn(r,o)||(zt=!0),r):(ur&42)===0||(ur&1073741824)!==0&&($e&261930)===0?(zt=!0,r.memoizedState=l):(r=bv(),Pe.lanes|=r,Jr|=r,o)}function S1(r,o,l,u,p){var v=z.p;z.p=v!==0&&8>v?v:8;var _=H.T,x={};H.T=x,Th(r,!1,o,l);try{var R=p(),F=H.S;if(F!==null&&F(x,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var K=K5(R,u);sl(r,o,K,qn(r))}else sl(r,o,u,qn(r))}catch(J){sl(r,o,{then:function(){},status:"rejected",reason:J},qn())}finally{z.p=v,_!==null&&x.types!==null&&(_.types=x.types),H.T=_}}function ew(){}function wh(r,o,l,u){if(r.tag!==5)throw Error(i(476));var p=_1(r).queue;S1(r,p,o,Q,l===null?ew:function(){return C1(r),l(u)})}function _1(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:Q},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:l},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function C1(r){var o=_1(r);o.next===null&&(o=r.alternate.memoizedState),sl(r,o.next.queue,{},qn())}function xh(){return sn(wl)}function E1(){return Dt().memoizedState}function w1(){return Dt().memoizedState}function tw(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var l=qn();r=Wr(l);var u=Kr(o,r,l);u!==null&&(Mn(u,o,l),nl(u,o,l)),o={cache:eh()},r.payload=o;return}o=o.return}}function nw(r,o,l){var u=qn();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},du(r)?T1(o,l):(l=jf(r,o,l,u),l!==null&&(Mn(l,r,u),k1(l,o,u)))}function x1(r,o,l){var u=qn();sl(r,o,l,u)}function sl(r,o,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(du(r))T1(o,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var _=o.lastRenderedState,x=v(_,l);if(p.hasEagerState=!0,p.eagerState=x,Vn(x,_))return qc(r,o,p,0),ut===null&&$c(),!1}catch{}finally{}if(l=jf(r,o,p,u),l!==null)return Mn(l,r,u),k1(l,o,u),!0}return!1}function Th(r,o,l,u){if(u={lane:2,revertLane:rp(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},du(r)){if(o)throw Error(i(479))}else o=jf(r,l,u,2),o!==null&&Mn(o,r,2)}function du(r){var o=r.alternate;return r===Pe||o!==null&&o===Pe}function T1(r,o){Fa=ru=!0;var l=r.pending;l===null?o.next=o:(o.next=l.next,l.next=o),r.pending=o}function k1(r,o,l){if((l&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,Rc(r,l)}}var ll={readContext:sn,use:su,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};ll.useEffectEvent=kt;var A1={readContext:sn,use:su,useCallback:function(r,o){return En().memoizedState=[r,o===void 0?null:o],r},useContext:sn,useEffect:d1,useImperativeHandle:function(r,o,l){l=l!=null?l.concat([r]):null,cu(4194308,4,m1.bind(null,o,r),l)},useLayoutEffect:function(r,o){return cu(4194308,4,r,o)},useInsertionEffect:function(r,o){cu(4,2,r,o)},useMemo:function(r,o){var l=En();o=o===void 0?null:o;var u=r();if(qo){Li(!0);try{r()}finally{Li(!1)}}return l.memoizedState=[u,o],u},useReducer:function(r,o,l){var u=En();if(l!==void 0){var p=l(o);if(qo){Li(!0);try{l(o)}finally{Li(!1)}}}else p=o;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=nw.bind(null,Pe,r),[u.memoizedState,r]},useRef:function(r){var o=En();return r={current:r},o.memoizedState=r},useState:function(r){r=bh(r);var o=r.queue,l=x1.bind(null,Pe,o);return o.dispatch=l,[r.memoizedState,l]},useDebugValue:Ch,useDeferredValue:function(r,o){var l=En();return Eh(l,r,o)},useTransition:function(){var r=bh(!1);return r=S1.bind(null,Pe,r.queue,!0,!1),En().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,l){var u=Pe,p=En();if(Ge){if(l===void 0)throw Error(i(407));l=l()}else{if(l=o(),ut===null)throw Error(i(349));($e&127)!==0||Y0(u,o,l)}p.memoizedState=l;var v={value:l,getSnapshot:o};return p.queue=v,d1(Q0.bind(null,u,v,r),[r]),u.flags|=2048,$a(9,{destroy:void 0},X0.bind(null,u,v,l,o),null),l},useId:function(){var r=En(),o=ut.identifierPrefix;if(Ge){var l=Oi,u=Mi;l=(u&~(1<<32-tn(u)-1)).toString(32)+l,o="_"+o+"R_"+l,l=ou++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=Y5++,o="_"+o+"r_"+l.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:xh,useFormState:a1,useActionState:a1,useOptimistic:function(r){var o=En();o.memoizedState=o.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Th.bind(null,Pe,!0,l),l.dispatch=o,[r,o]},useMemoCache:gh,useCacheRefresh:function(){return En().memoizedState=tw.bind(null,Pe)},useEffectEvent:function(r){var o=En(),l={impl:r};return o.memoizedState=l,function(){if((Qe&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},kh={readContext:sn,use:su,useCallback:v1,useContext:sn,useEffect:_h,useImperativeHandle:g1,useInsertionEffect:h1,useLayoutEffect:p1,useMemo:y1,useReducer:lu,useRef:u1,useState:function(){return lu(dr)},useDebugValue:Ch,useDeferredValue:function(r,o){var l=Dt();return b1(l,ot.memoizedState,r,o)},useTransition:function(){var r=lu(dr)[0],o=Dt().memoizedState;return[typeof r=="boolean"?r:al(r),o]},useSyncExternalStore:K0,useId:E1,useHostTransitionStatus:xh,useFormState:s1,useActionState:s1,useOptimistic:function(r,o){var l=Dt();return e1(l,ot,r,o)},useMemoCache:gh,useCacheRefresh:w1};kh.useEffectEvent=f1;var L1={readContext:sn,use:su,useCallback:v1,useContext:sn,useEffect:_h,useImperativeHandle:g1,useInsertionEffect:h1,useLayoutEffect:p1,useMemo:y1,useReducer:yh,useRef:u1,useState:function(){return yh(dr)},useDebugValue:Ch,useDeferredValue:function(r,o){var l=Dt();return ot===null?Eh(l,r,o):b1(l,ot.memoizedState,r,o)},useTransition:function(){var r=yh(dr)[0],o=Dt().memoizedState;return[typeof r=="boolean"?r:al(r),o]},useSyncExternalStore:K0,useId:E1,useHostTransitionStatus:xh,useFormState:c1,useActionState:c1,useOptimistic:function(r,o){var l=Dt();return ot!==null?e1(l,ot,r,o):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:gh,useCacheRefresh:w1};L1.useEffectEvent=f1;function Ah(r,o,l,u){o=r.memoizedState,l=l(u,o),l=l==null?o:g({},o,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Lh={enqueueSetState:function(r,o,l){r=r._reactInternals;var u=qn(),p=Wr(u);p.payload=o,l!=null&&(p.callback=l),o=Kr(r,p,u),o!==null&&(Mn(o,r,u),nl(o,r,u))},enqueueReplaceState:function(r,o,l){r=r._reactInternals;var u=qn(),p=Wr(u);p.tag=1,p.payload=o,l!=null&&(p.callback=l),o=Kr(r,p,u),o!==null&&(Mn(o,r,u),nl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var l=qn(),u=Wr(l);u.tag=2,o!=null&&(u.callback=o),o=Kr(r,u,l),o!==null&&(Mn(o,r,l),nl(o,r,l))}};function I1(r,o,l,u,p,v,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,_):o.prototype&&o.prototype.isPureReactComponent?!Ks(l,u)||!Ks(p,v):!0}function R1(r,o,l,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,u),o.state!==r&&Lh.enqueueReplaceState(o,o.state,null)}function Go(r,o){var l=o;if("ref"in o){l={};for(var u in o)u!=="ref"&&(l[u]=o[u])}if(r=r.defaultProps){l===o&&(l=g({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}function D1(r){jc(r)}function M1(r){console.error(r)}function O1(r){jc(r)}function fu(r,o){try{var l=r.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function P1(r,o,l){try{var u=r.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ih(r,o,l){return l=Wr(l),l.tag=3,l.payload={element:null},l.callback=function(){fu(r,o)},l}function N1(r){return r=Wr(r),r.tag=3,r}function H1(r,o,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var v=u.value;r.payload=function(){return p(v)},r.callback=function(){P1(o,l,u)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){P1(o,l,u),typeof p!="function"&&(eo===null?eo=new Set([this]):eo.add(this));var x=u.stack;this.componentDidCatch(u.value,{componentStack:x!==null?x:""})})}function iw(r,o,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=l.alternate,o!==null&&Na(o,l,p,!0),l=Un.current,l!==null){switch(l.tag){case 31:case 13:return si===null?wu():l.alternate===null&&At===0&&(At=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Jc?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([u]):o.add(u),tp(r,u,p)),!1;case 22:return l.flags|=65536,u===Jc?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([u]):l.add(u)),tp(r,u,p)),!1}throw Error(i(435,l.tag))}return tp(r,u,p),wu(),!1}if(Ge)return o=Un.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=p,u!==Yf&&(r=Error(i(422),{cause:u}),Qs(ii(r,l)))):(u!==Yf&&(o=Error(i(423),{cause:u}),Qs(ii(o,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,u=ii(u,l),p=Ih(r.stateNode,u,p),ah(r,p),At!==4&&(At=2)),!1;var v=Error(i(520),{cause:u});if(v=ii(v,l),gl===null?gl=[v]:gl.push(v),At!==4&&(At=2),o===null)return!0;u=ii(u,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Ih(l.stateNode,u,r),ah(l,r),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(eo===null||!eo.has(v))))return l.flags|=65536,p&=-p,l.lanes|=p,p=N1(p),H1(p,r,l,u),ah(l,p),!1}l=l.return}while(l!==null);return!1}var Rh=Error(i(461)),zt=!1;function ln(r,o,l,u){o.child=r===null?U0(o,null,l,u):$o(o,r.child,l,u)}function z1(r,o,l,u,p){l=l.render;var v=o.ref;if("ref"in u){var _={};for(var x in u)x!=="ref"&&(_[x]=u[x])}else _=u;return Bo(o),u=fh(r,o,l,_,v,p),x=hh(),r!==null&&!zt?(ph(r,o,p),fr(r,o,p)):(Ge&&x&&Wf(o),o.flags|=1,ln(r,o,u,p),o.child)}function V1(r,o,l,u,p){if(r===null){var v=l.type;return typeof v=="function"&&!$f(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,B1(r,o,v,u,p)):(r=Wc(l.type,null,u,o,o.mode,p),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Vh(r,p)){var _=v.memoizedProps;if(l=l.compare,l=l!==null?l:Ks,l(_,u)&&r.ref===o.ref)return fr(r,o,p)}return o.flags|=1,r=ar(v,u),r.ref=o.ref,r.return=o,o.child=r}function B1(r,o,l,u,p){if(r!==null){var v=r.memoizedProps;if(Ks(v,u)&&r.ref===o.ref)if(zt=!1,o.pendingProps=u=v,Vh(r,p))(r.flags&131072)!==0&&(zt=!0);else return o.lanes=r.lanes,fr(r,o,p)}return Dh(r,o,l,u,p)}function U1(r,o,l,u){var p=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(u=o.child=r.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~v}else u=0,o.child=null;return F1(r,o,v,l,u)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Qc(o,v!==null?v.cachePool:null),v!==null?$0(o,v):lh(),q0(o);else return u=o.lanes=536870912,F1(r,o,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(Qc(o,v.cachePool),$0(o,v),Xr(),o.memoizedState=null):(r!==null&&Qc(o,null),lh(),Xr());return ln(r,o,p,l),o.child}function cl(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function F1(r,o,l,u,p){var v=nh();return v=v===null?null:{parent:Nt._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},r!==null&&Qc(o,null),lh(),q0(o),r!==null&&Na(r,o,u,!0),o.childLanes=p,null}function hu(r,o){return o=mu({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function j1(r,o,l){return $o(o,r.child,null,l),r=hu(o,o.pendingProps),r.flags|=2,Fn(o),o.memoizedState=null,r}function rw(r,o,l){var u=o.pendingProps,p=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Ge){if(u.mode==="hidden")return r=hu(o,u),o.lanes=536870912,cl(null,r);if(uh(o),(r=yt)?(r=ty(r,ai),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Fr!==null?{id:Mi,overflow:Oi}:null,retryLane:536870912,hydrationErrors:null},l=T0(r),l.return=o,o.child=l,an=o,yt=null)):r=null,r===null)throw $r(o);return o.lanes=536870912,null}return hu(o,u)}var v=r.memoizedState;if(v!==null){var _=v.dehydrated;if(uh(o),p)if(o.flags&256)o.flags&=-257,o=j1(r,o,l);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(i(558));else if(zt||Na(r,o,l,!1),p=(l&r.childLanes)!==0,zt||p){if(u=ut,u!==null&&(_=Dc(u,l),_!==0&&_!==v.retryLane))throw v.retryLane=_,No(r,_),Mn(u,r,_),Rh;wu(),o=j1(r,o,l)}else r=v.treeContext,yt=li(_.nextSibling),an=o,Ge=!0,jr=null,ai=!1,r!==null&&L0(o,r),o=hu(o,u),o.flags|=4096;return o}return r=ar(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function pu(r,o){var l=o.ref;if(l===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(r===null||r.ref!==l)&&(o.flags|=4194816)}}function Dh(r,o,l,u,p){return Bo(o),l=fh(r,o,l,u,void 0,p),u=hh(),r!==null&&!zt?(ph(r,o,p),fr(r,o,p)):(Ge&&u&&Wf(o),o.flags|=1,ln(r,o,l,p),o.child)}function $1(r,o,l,u,p,v){return Bo(o),o.updateQueue=null,l=W0(o,u,l,p),G0(r),u=hh(),r!==null&&!zt?(ph(r,o,v),fr(r,o,v)):(Ge&&u&&Wf(o),o.flags|=1,ln(r,o,l,v),o.child)}function q1(r,o,l,u,p){if(Bo(o),o.stateNode===null){var v=Da,_=l.contextType;typeof _=="object"&&_!==null&&(v=sn(_)),v=new l(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Lh,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},rh(o),_=l.contextType,v.context=typeof _=="object"&&_!==null?sn(_):Da,v.state=o.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(Ah(o,l,_,u),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(_=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),_!==v.state&&Lh.enqueueReplaceState(v,v.state,null),rl(o,u,v,p),il(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var x=o.memoizedProps,R=Go(l,x);v.props=R;var F=v.context,K=l.contextType;_=Da,typeof K=="object"&&K!==null&&(_=sn(K));var J=l.getDerivedStateFromProps;K=typeof J=="function"||typeof v.getSnapshotBeforeUpdate=="function",x=o.pendingProps!==x,K||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(x||F!==_)&&R1(o,v,u,_),Gr=!1;var j=o.memoizedState;v.state=j,rl(o,u,v,p),il(),F=o.memoizedState,x||j!==F||Gr?(typeof J=="function"&&(Ah(o,l,J,u),F=o.memoizedState),(R=Gr||I1(o,l,R,u,j,F,_))?(K||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=F),v.props=u,v.state=F,v.context=_,u=R):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,oh(r,o),_=o.memoizedProps,K=Go(l,_),v.props=K,J=o.pendingProps,j=v.context,F=l.contextType,R=Da,typeof F=="object"&&F!==null&&(R=sn(F)),x=l.getDerivedStateFromProps,(F=typeof x=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_!==J||j!==R)&&R1(o,v,u,R),Gr=!1,j=o.memoizedState,v.state=j,rl(o,u,v,p),il();var $=o.memoizedState;_!==J||j!==$||Gr||r!==null&&r.dependencies!==null&&Yc(r.dependencies)?(typeof x=="function"&&(Ah(o,l,x,u),$=o.memoizedState),(K=Gr||I1(o,l,K,u,j,$,R)||r!==null&&r.dependencies!==null&&Yc(r.dependencies))?(F||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,$,R),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,$,R)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=$),v.props=u,v.state=$,v.context=R,u=K):(typeof v.componentDidUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,pu(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=$o(o,r.child,null,p),o.child=$o(o,null,l,p)):ln(r,o,l,p),o.memoizedState=v.state,r=o.child):r=fr(r,o,p),r}function G1(r,o,l,u){return zo(),o.flags|=256,ln(r,o,l,u),o.child}var Mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oh(r){return{baseLanes:r,cachePool:P0()}}function Ph(r,o,l){return r=r!==null?r.childLanes&~l:0,o&&(r|=$n),r}function W1(r,o,l){var u=o.pendingProps,p=!1,v=(o.flags&128)!==0,_;if((_=v)||(_=r!==null&&r.memoizedState===null?!1:(Rt.current&2)!==0),_&&(p=!0,o.flags&=-129),_=(o.flags&32)!==0,o.flags&=-33,r===null){if(Ge){if(p?Yr(o):Xr(),(r=yt)?(r=ty(r,ai),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Fr!==null?{id:Mi,overflow:Oi}:null,retryLane:536870912,hydrationErrors:null},l=T0(r),l.return=o,o.child=l,an=o,yt=null)):r=null,r===null)throw $r(o);return vp(r)?o.lanes=32:o.lanes=536870912,null}var x=u.children;return u=u.fallback,p?(Xr(),p=o.mode,x=mu({mode:"hidden",children:x},p),u=Ho(u,p,l,null),x.return=o,u.return=o,x.sibling=u,o.child=x,u=o.child,u.memoizedState=Oh(l),u.childLanes=Ph(r,_,l),o.memoizedState=Mh,cl(null,u)):(Yr(o),Nh(o,x))}var R=r.memoizedState;if(R!==null&&(x=R.dehydrated,x!==null)){if(v)o.flags&256?(Yr(o),o.flags&=-257,o=Hh(r,o,l)):o.memoizedState!==null?(Xr(),o.child=r.child,o.flags|=128,o=null):(Xr(),x=u.fallback,p=o.mode,u=mu({mode:"visible",children:u.children},p),x=Ho(x,p,l,null),x.flags|=2,u.return=o,x.return=o,u.sibling=x,o.child=u,$o(o,r.child,null,l),u=o.child,u.memoizedState=Oh(l),u.childLanes=Ph(r,_,l),o.memoizedState=Mh,o=cl(null,u));else if(Yr(o),vp(x)){if(_=x.nextSibling&&x.nextSibling.dataset,_)var F=_.dgst;_=F,u=Error(i(419)),u.stack="",u.digest=_,Qs({value:u,source:null,stack:null}),o=Hh(r,o,l)}else if(zt||Na(r,o,l,!1),_=(l&r.childLanes)!==0,zt||_){if(_=ut,_!==null&&(u=Dc(_,l),u!==0&&u!==R.retryLane))throw R.retryLane=u,No(r,u),Mn(_,r,u),Rh;gp(x)||wu(),o=Hh(r,o,l)}else gp(x)?(o.flags|=192,o.child=r.child,o=null):(r=R.treeContext,yt=li(x.nextSibling),an=o,Ge=!0,jr=null,ai=!1,r!==null&&L0(o,r),o=Nh(o,u.children),o.flags|=4096);return o}return p?(Xr(),x=u.fallback,p=o.mode,R=r.child,F=R.sibling,u=ar(R,{mode:"hidden",children:u.children}),u.subtreeFlags=R.subtreeFlags&65011712,F!==null?x=ar(F,x):(x=Ho(x,p,l,null),x.flags|=2),x.return=o,u.return=o,u.sibling=x,o.child=u,cl(null,u),u=o.child,x=r.child.memoizedState,x===null?x=Oh(l):(p=x.cachePool,p!==null?(R=Nt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=P0(),x={baseLanes:x.baseLanes|l,cachePool:p}),u.memoizedState=x,u.childLanes=Ph(r,_,l),o.memoizedState=Mh,cl(r.child,u)):(Yr(o),l=r.child,r=l.sibling,l=ar(l,{mode:"visible",children:u.children}),l.return=o,l.sibling=null,r!==null&&(_=o.deletions,_===null?(o.deletions=[r],o.flags|=16):_.push(r)),o.child=l,o.memoizedState=null,l)}function Nh(r,o){return o=mu({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function mu(r,o){return r=Bn(22,r,null,o),r.lanes=0,r}function Hh(r,o,l){return $o(o,r.child,null,l),r=Nh(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function K1(r,o,l){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),Zf(r.return,o,l)}function zh(r,o,l,u,p,v){var _=r.memoizedState;_===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:v}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=u,_.tail=l,_.tailMode=p,_.treeForkCount=v)}function Y1(r,o,l){var u=o.pendingProps,p=u.revealOrder,v=u.tail;u=u.children;var _=Rt.current,x=(_&2)!==0;if(x?(_=_&1|2,o.flags|=128):_&=1,re(Rt,_),ln(r,o,u,l),u=Ge?Xs:0,!x&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&K1(r,l,o);else if(r.tag===19)K1(r,l,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(l=o.child,p=null;l!==null;)r=l.alternate,r!==null&&iu(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=o.child,o.child=null):(p=l.sibling,l.sibling=null),zh(o,!1,p,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=o.child,o.child=null;p!==null;){if(r=p.alternate,r!==null&&iu(r)===null){o.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}zh(o,!0,l,null,v,u);break;case"together":zh(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function fr(r,o,l){if(r!==null&&(o.dependencies=r.dependencies),Jr|=o.lanes,(l&o.childLanes)===0)if(r!==null){if(Na(r,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(i(153));if(o.child!==null){for(r=o.child,l=ar(r,r.pendingProps),o.child=l,l.return=o;r.sibling!==null;)r=r.sibling,l=l.sibling=ar(r,r.pendingProps),l.return=o;l.sibling=null}return o.child}function Vh(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Yc(r)))}function ow(r,o,l){switch(o.tag){case 3:Ue(o,o.stateNode.containerInfo),qr(o,Nt,r.memoizedState.cache),zo();break;case 27:case 5:He(o);break;case 4:Ue(o,o.stateNode.containerInfo);break;case 10:qr(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,uh(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(Yr(o),o.flags|=128,null):(l&o.child.childLanes)!==0?W1(r,o,l):(Yr(o),r=fr(r,o,l),r!==null?r.sibling:null);Yr(o);break;case 19:var p=(r.flags&128)!==0;if(u=(l&o.childLanes)!==0,u||(Na(r,o,l,!1),u=(l&o.childLanes)!==0),p){if(u)return Y1(r,o,l);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),re(Rt,Rt.current),u)break;return null;case 22:return o.lanes=0,U1(r,o,l,o.pendingProps);case 24:qr(o,Nt,r.memoizedState.cache)}return fr(r,o,l)}function X1(r,o,l){if(r!==null)if(r.memoizedProps!==o.pendingProps)zt=!0;else{if(!Vh(r,l)&&(o.flags&128)===0)return zt=!1,ow(r,o,l);zt=(r.flags&131072)!==0}else zt=!1,Ge&&(o.flags&1048576)!==0&&A0(o,Xs,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Fo(o.elementType),o.type=r,typeof r=="function")$f(r)?(u=Go(r,u),o.tag=1,o=q1(null,o,r,u,l)):(o.tag=0,o=Dh(null,o,r,u,l));else{if(r!=null){var p=r.$$typeof;if(p===L){o.tag=11,o=z1(null,o,r,u,l);break e}else if(p===N){o.tag=14,o=V1(null,o,r,u,l);break e}}throw o=le(r)||r,Error(i(306,o,""))}}return o;case 0:return Dh(r,o,o.type,o.pendingProps,l);case 1:return u=o.type,p=Go(u,o.pendingProps),q1(r,o,u,p,l);case 3:e:{if(Ue(o,o.stateNode.containerInfo),r===null)throw Error(i(387));u=o.pendingProps;var v=o.memoizedState;p=v.element,oh(r,o),rl(o,u,null,l);var _=o.memoizedState;if(u=_.cache,qr(o,Nt,u),u!==v.cache&&Jf(o,[Nt],l,!0),il(),u=_.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:_.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=G1(r,o,u,l);break e}else if(u!==p){p=ii(Error(i(424)),o),Qs(p),o=G1(r,o,u,l);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(yt=li(r.firstChild),an=o,Ge=!0,jr=null,ai=!0,l=U0(o,null,u,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(zo(),u===p){o=fr(r,o,l);break e}ln(r,o,u,l)}o=o.child}return o;case 26:return pu(r,o),r===null?(l=sy(o.type,null,o.pendingProps,null))?o.memoizedState=l:Ge||(l=o.type,r=o.pendingProps,u=Ru(Se.current).createElement(l),u[Ct]=o,u[Kt]=r,cn(u,l,r),Pt(u),o.stateNode=u):o.memoizedState=sy(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return He(o),r===null&&Ge&&(u=o.stateNode=ry(o.type,o.pendingProps,Se.current),an=o,ai=!0,p=yt,ro(o.type)?(yp=p,yt=li(u.firstChild)):yt=p),ln(r,o,o.pendingProps.children,l),pu(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Ge&&((p=u=yt)&&(u=Pw(u,o.type,o.pendingProps,ai),u!==null?(o.stateNode=u,an=o,yt=li(u.firstChild),ai=!1,p=!0):p=!1),p||$r(o)),He(o),p=o.type,v=o.pendingProps,_=r!==null?r.memoizedProps:null,u=v.children,hp(p,v)?u=null:_!==null&&hp(p,_)&&(o.flags|=32),o.memoizedState!==null&&(p=fh(r,o,X5,null,null,l),wl._currentValue=p),pu(r,o),ln(r,o,u,l),o.child;case 6:return r===null&&Ge&&((r=l=yt)&&(l=Nw(l,o.pendingProps,ai),l!==null?(o.stateNode=l,an=o,yt=null,r=!0):r=!1),r||$r(o)),null;case 13:return W1(r,o,l);case 4:return Ue(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=$o(o,null,u,l):ln(r,o,u,l),o.child;case 11:return z1(r,o,o.type,o.pendingProps,l);case 7:return ln(r,o,o.pendingProps,l),o.child;case 8:return ln(r,o,o.pendingProps.children,l),o.child;case 12:return ln(r,o,o.pendingProps.children,l),o.child;case 10:return u=o.pendingProps,qr(o,o.type,u.value),ln(r,o,u.children,l),o.child;case 9:return p=o.type._context,u=o.pendingProps.children,Bo(o),p=sn(p),u=u(p),o.flags|=1,ln(r,o,u,l),o.child;case 14:return V1(r,o,o.type,o.pendingProps,l);case 15:return B1(r,o,o.type,o.pendingProps,l);case 19:return Y1(r,o,l);case 31:return rw(r,o,l);case 22:return U1(r,o,l,o.pendingProps);case 24:return Bo(o),u=sn(Nt),r===null?(p=nh(),p===null&&(p=ut,v=eh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=l),p=v),o.memoizedState={parent:u,cache:p},rh(o),qr(o,Nt,p)):((r.lanes&l)!==0&&(oh(r,o),rl(o,null,null,l),il()),p=r.memoizedState,v=o.memoizedState,p.parent!==u?(p={parent:u,cache:u},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),qr(o,Nt,u)):(u=v.cache,qr(o,Nt,u),u!==p.cache&&Jf(o,[Nt],l,!0))),ln(r,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function hr(r){r.flags|=4}function Bh(r,o,l,u,p){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Ev())r.flags|=8192;else throw jo=Jc,ih}else r.flags&=-16777217}function Q1(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!fy(o))if(Ev())r.flags|=8192;else throw jo=Jc,ih}function gu(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?nn():536870912,r.lanes|=o,Ka|=o)}function ul(r,o){if(!Ge)switch(r.tailMode){case"hidden":o=r.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function bt(r){var o=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(o)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=u,r.childLanes=l,o}function aw(r,o,l){var u=o.pendingProps;switch(Kf(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(o),null;case 1:return bt(o),null;case 3:return l=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),cr(Nt),Ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Pa(o)?hr(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Xf())),bt(o),null;case 26:var p=o.type,v=o.memoizedState;return r===null?(hr(o),v!==null?(bt(o),Q1(o,v)):(bt(o),Bh(o,p,null,u,l))):v?v!==r.memoizedState?(hr(o),bt(o),Q1(o,v)):(bt(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&hr(o),bt(o),Bh(o,p,r,u,l)),null;case 27:if(We(o),l=Se.current,p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return bt(o),null}r=ae.current,Pa(o)?I0(o):(r=ry(p,u,l),o.stateNode=r,hr(o))}return bt(o),null;case 5:if(We(o),p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return bt(o),null}if(v=ae.current,Pa(o))I0(o);else{var _=Ru(Se.current);switch(v){case 1:v=_.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=_.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=_.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?_.createElement("select",{is:u.is}):_.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?_.createElement(p,{is:u.is}):_.createElement(p)}}v[Ct]=o,v[Kt]=u;e:for(_=o.child;_!==null;){if(_.tag===5||_.tag===6)v.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===o)break e;for(;_.sibling===null;){if(_.return===null||_.return===o)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}o.stateNode=v;e:switch(cn(v,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&hr(o)}}return bt(o),Bh(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,l),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(i(166));if(r=Se.current,Pa(o)){if(r=o.stateNode,l=o.memoizedProps,u=null,p=an,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[Ct]=o,r=!!(r.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Wv(r.nodeValue,l)),r||$r(o,!0)}else r=Ru(r).createTextNode(u),r[Ct]=o,o.stateNode=r}return bt(o),null;case 31:if(l=o.memoizedState,r===null||r.memoizedState!==null){if(u=Pa(o),l!==null){if(r===null){if(!u)throw Error(i(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Ct]=o}else zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bt(o),r=!1}else l=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return o.flags&256?(Fn(o),o):(Fn(o),null);if((o.flags&128)!==0)throw Error(i(558))}return bt(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Pa(o),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Ct]=o}else zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bt(o),p=!1}else p=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return o.flags&256?(Fn(o),o):(Fn(o),null)}return Fn(o),(o.flags&128)!==0?(o.lanes=l,o):(l=u!==null,r=r!==null&&r.memoizedState!==null,l&&(u=o.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==p&&(u.flags|=2048)),l!==r&&l&&(o.child.flags|=8192),gu(o,o.updateQueue),bt(o),null);case 4:return Ce(),r===null&&lp(o.stateNode.containerInfo),bt(o),null;case 10:return cr(o.type),bt(o),null;case 19:if(q(Rt),u=o.memoizedState,u===null)return bt(o),null;if(p=(o.flags&128)!==0,v=u.rendering,v===null)if(p)ul(u,!1);else{if(At!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=iu(r),v!==null){for(o.flags|=128,ul(u,!1),r=v.updateQueue,o.updateQueue=r,gu(o,r),o.subtreeFlags=0,r=l,l=o.child;l!==null;)x0(l,r),l=l.sibling;return re(Rt,Rt.current&1|2),Ge&&sr(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&bn()>_u&&(o.flags|=128,p=!0,ul(u,!1),o.lanes=4194304)}else{if(!p)if(r=iu(v),r!==null){if(o.flags|=128,p=!0,r=r.updateQueue,o.updateQueue=r,gu(o,r),ul(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Ge)return bt(o),null}else 2*bn()-u.renderingStartTime>_u&&l!==536870912&&(o.flags|=128,p=!0,ul(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=bn(),r.sibling=null,l=Rt.current,re(Rt,p?l&1|2:l&1),Ge&&sr(o,u.treeForkCount),r):(bt(o),null);case 22:case 23:return Fn(o),ch(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(l&536870912)!==0&&(o.flags&128)===0&&(bt(o),o.subtreeFlags&6&&(o.flags|=8192)):bt(o),l=o.updateQueue,l!==null&&gu(o,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==l&&(o.flags|=2048),r!==null&&q(Uo),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),cr(Nt),bt(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function sw(r,o){switch(Kf(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return cr(Nt),Ce(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return We(o),null;case 31:if(o.memoizedState!==null){if(Fn(o),o.alternate===null)throw Error(i(340));zo()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Fn(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(i(340));zo()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return q(Rt),null;case 4:return Ce(),null;case 10:return cr(o.type),null;case 22:case 23:return Fn(o),ch(),r!==null&&q(Uo),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return cr(Nt),null;case 25:return null;default:return null}}function Z1(r,o){switch(Kf(o),o.tag){case 3:cr(Nt),Ce();break;case 26:case 27:case 5:We(o);break;case 4:Ce();break;case 31:o.memoizedState!==null&&Fn(o);break;case 13:Fn(o);break;case 19:q(Rt);break;case 10:cr(o.type);break;case 22:case 23:Fn(o),ch(),r!==null&&q(Uo);break;case 24:cr(Nt)}}function dl(r,o){try{var l=o.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&r)===r){u=void 0;var v=l.create,_=l.inst;u=v(),_.destroy=u}l=l.next}while(l!==p)}}catch(x){it(o,o.return,x)}}function Qr(r,o,l){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var v=p.next;u=v;do{if((u.tag&r)===r){var _=u.inst,x=_.destroy;if(x!==void 0){_.destroy=void 0,p=o;var R=l,F=x;try{F()}catch(K){it(p,R,K)}}}u=u.next}while(u!==v)}}catch(K){it(o,o.return,K)}}function J1(r){var o=r.updateQueue;if(o!==null){var l=r.stateNode;try{j0(o,l)}catch(u){it(r,r.return,u)}}}function ev(r,o,l){l.props=Go(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(u){it(r,o,u)}}function fl(r,o){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof l=="function"?r.refCleanup=l(u):l.current=u}}catch(p){it(r,o,p)}}function Pi(r,o){var l=r.ref,u=r.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){it(r,o,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){it(r,o,p)}else l.current=null}function tv(r){var o=r.type,l=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){it(r,r.return,p)}}function Uh(r,o,l){try{var u=r.stateNode;Lw(u,r.type,l,o),u[Kt]=o}catch(p){it(r,r.return,p)}}function nv(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ro(r.type)||r.tag===4}function Fh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||nv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ro(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function jh(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(r),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=ei));else if(u!==4&&(u===27&&ro(r.type)&&(l=r.stateNode,o=null),r=r.child,r!==null))for(jh(r,o,l),r=r.sibling;r!==null;)jh(r,o,l),r=r.sibling}function vu(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?l.insertBefore(r,o):l.appendChild(r);else if(u!==4&&(u===27&&ro(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(vu(r,o,l),r=r.sibling;r!==null;)vu(r,o,l),r=r.sibling}function iv(r){var o=r.stateNode,l=r.memoizedProps;try{for(var u=r.type,p=o.attributes;p.length;)o.removeAttributeNode(p[0]);cn(o,u,l),o[Ct]=r,o[Kt]=l}catch(v){it(r,r.return,v)}}var pr=!1,Vt=!1,$h=!1,rv=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function lw(r,o){if(r=r.containerInfo,dp=zu,r=g0(r),Hf(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,x=-1,R=-1,F=0,K=0,J=r,j=null;t:for(;;){for(var $;J!==l||p!==0&&J.nodeType!==3||(x=_+p),J!==v||u!==0&&J.nodeType!==3||(R=_+u),J.nodeType===3&&(_+=J.nodeValue.length),($=J.firstChild)!==null;)j=J,J=$;for(;;){if(J===r)break t;if(j===l&&++F===p&&(x=_),j===v&&++K===u&&(R=_),($=J.nextSibling)!==null)break;J=j,j=J.parentNode}J=$}l=x===-1||R===-1?null:{start:x,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(fp={focusedElem:r,selectionRange:l},zu=!1,Zt=o;Zt!==null;)if(o=Zt,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Zt=r;else for(;Zt!==null;){switch(o=Zt,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)p=r[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=o,p=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var ge=Go(l.type,p);r=u.getSnapshotBeforeUpdate(ge,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(Ie){it(l,l.return,Ie)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,l=r.nodeType,l===9)mp(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":mp(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=o.sibling,r!==null){r.return=o.return,Zt=r;break}Zt=o.return}}function ov(r,o,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:gr(r,l),u&4&&dl(5,l);break;case 1:if(gr(r,l),u&4)if(r=l.stateNode,o===null)try{r.componentDidMount()}catch(_){it(l,l.return,_)}else{var p=Go(l.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(p,o,r.__reactInternalSnapshotBeforeUpdate)}catch(_){it(l,l.return,_)}}u&64&&J1(l),u&512&&fl(l,l.return);break;case 3:if(gr(r,l),u&64&&(r=l.updateQueue,r!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{j0(r,o)}catch(_){it(l,l.return,_)}}break;case 27:o===null&&u&4&&iv(l);case 26:case 5:gr(r,l),o===null&&u&4&&tv(l),u&512&&fl(l,l.return);break;case 12:gr(r,l);break;case 31:gr(r,l),u&4&&lv(r,l);break;case 13:gr(r,l),u&4&&cv(r,l),u&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=vw.bind(null,l),Hw(r,l))));break;case 22:if(u=l.memoizedState!==null||pr,!u){o=o!==null&&o.memoizedState!==null||Vt,p=pr;var v=Vt;pr=u,(Vt=o)&&!v?vr(r,l,(l.subtreeFlags&8772)!==0):gr(r,l),pr=p,Vt=v}break;case 30:break;default:gr(r,l)}}function av(r){var o=r.alternate;o!==null&&(r.alternate=null,av(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Zi(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var wt=null,Ln=!1;function mr(r,o,l){for(l=l.child;l!==null;)sv(r,o,l),l=l.sibling}function sv(r,o,l){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Ir,l)}catch{}switch(l.tag){case 26:Vt||Pi(l,o),mr(r,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Vt||Pi(l,o);var u=wt,p=Ln;ro(l.type)&&(wt=l.stateNode,Ln=!1),mr(r,o,l),_l(l.stateNode),wt=u,Ln=p;break;case 5:Vt||Pi(l,o);case 6:if(u=wt,p=Ln,wt=null,mr(r,o,l),wt=u,Ln=p,wt!==null)if(Ln)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(l.stateNode)}catch(v){it(l,o,v)}else try{wt.removeChild(l.stateNode)}catch(v){it(l,o,v)}break;case 18:wt!==null&&(Ln?(r=wt,Jv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),ns(r)):Jv(wt,l.stateNode));break;case 4:u=wt,p=Ln,wt=l.stateNode.containerInfo,Ln=!0,mr(r,o,l),wt=u,Ln=p;break;case 0:case 11:case 14:case 15:Qr(2,l,o),Vt||Qr(4,l,o),mr(r,o,l);break;case 1:Vt||(Pi(l,o),u=l.stateNode,typeof u.componentWillUnmount=="function"&&ev(l,o,u)),mr(r,o,l);break;case 21:mr(r,o,l);break;case 22:Vt=(u=Vt)||l.memoizedState!==null,mr(r,o,l),Vt=u;break;default:mr(r,o,l)}}function lv(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ns(r)}catch(l){it(o,o.return,l)}}}function cv(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ns(r)}catch(l){it(o,o.return,l)}}function cw(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new rv),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new rv),o;default:throw Error(i(435,r.tag))}}function yu(r,o){var l=cw(r);o.forEach(function(u){if(!l.has(u)){l.add(u);var p=yw.bind(null,r,u);u.then(p,p)}})}function In(r,o){var l=o.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],v=r,_=o,x=_;e:for(;x!==null;){switch(x.tag){case 27:if(ro(x.type)){wt=x.stateNode,Ln=!1;break e}break;case 5:wt=x.stateNode,Ln=!1;break e;case 3:case 4:wt=x.stateNode.containerInfo,Ln=!0;break e}x=x.return}if(wt===null)throw Error(i(160));sv(v,_,p),wt=null,Ln=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)uv(o,r),o=o.sibling}var Si=null;function uv(r,o){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:In(o,r),Rn(r),u&4&&(Qr(3,r,r.return),dl(3,r),Qr(5,r,r.return));break;case 1:In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),u&64&&pr&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=Si;if(In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=r.memoizedState,l===null)if(u===null)if(r.stateNode===null){e:{u=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Sn]||v[Ct]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(u),p.head.insertBefore(v,p.querySelector("head > title"))),cn(v,u,l),v[Ct]=r,Pt(v),u=v;break e;case"link":var _=uy("link","href",p).get(u+(l.href||""));if(_){for(var x=0;x<_.length;x++)if(v=_[x],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(x,1);break t}}v=p.createElement(u),cn(v,u,l),p.head.appendChild(v);break;case"meta":if(_=uy("meta","content",p).get(u+(l.content||""))){for(x=0;x<_.length;x++)if(v=_[x],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(x,1);break t}}v=p.createElement(u),cn(v,u,l),p.head.appendChild(v);break;default:throw Error(i(468,u))}v[Ct]=r,Pt(v),u=v}r.stateNode=u}else dy(p,r.type,r.stateNode);else r.stateNode=cy(p,u,r.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?dy(p,r.type,r.stateNode):cy(p,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Uh(r,r.memoizedProps,l.memoizedProps)}break;case 27:In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),l!==null&&u&4&&Uh(r,r.memoizedProps,l.memoizedProps);break;case 5:if(In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),r.flags&32){p=r.stateNode;try{_n(p,"")}catch(ge){it(r,r.return,ge)}}u&4&&r.stateNode!=null&&(p=r.memoizedProps,Uh(r,p,l!==null?l.memoizedProps:p)),u&1024&&($h=!0);break;case 6:if(In(o,r),Rn(r),u&4){if(r.stateNode===null)throw Error(i(162));u=r.memoizedProps,l=r.stateNode;try{l.nodeValue=u}catch(ge){it(r,r.return,ge)}}break;case 3:if(Ou=null,p=Si,Si=Du(o.containerInfo),In(o,r),Si=p,Rn(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{ns(o.containerInfo)}catch(ge){it(r,r.return,ge)}$h&&($h=!1,dv(r));break;case 4:u=Si,Si=Du(r.stateNode.containerInfo),In(o,r),Rn(r),Si=u;break;case 12:In(o,r),Rn(r);break;case 31:In(o,r),Rn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 13:In(o,r),Rn(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Su=bn()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 22:p=r.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,F=pr,K=Vt;if(pr=F||p,Vt=K||R,In(o,r),Vt=K,pr=F,Rn(r),u&8192)e:for(o=r.stateNode,o._visibility=p?o._visibility&-2:o._visibility|1,p&&(l===null||R||pr||Vt||Wo(r)),l=null,o=r;;){if(o.tag===5||o.tag===26){if(l===null){R=l=o;try{if(v=R.stateNode,p)_=v.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{x=R.stateNode;var J=R.memoizedProps.style,j=J!=null&&J.hasOwnProperty("display")?J.display:null;x.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(ge){it(R,R.return,ge)}}}else if(o.tag===6){if(l===null){R=o;try{R.stateNode.nodeValue=p?"":R.memoizedProps}catch(ge){it(R,R.return,ge)}}}else if(o.tag===18){if(l===null){R=o;try{var $=R.stateNode;p?ey($,!0):ey(R.stateNode,!1)}catch(ge){it(R,R.return,ge)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,yu(r,l))));break;case 19:In(o,r),Rn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 30:break;case 21:break;default:In(o,r),Rn(r)}}function Rn(r){var o=r.flags;if(o&2){try{for(var l,u=r.return;u!==null;){if(nv(u)){l=u;break}u=u.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var p=l.stateNode,v=Fh(r);vu(r,v,p);break;case 5:var _=l.stateNode;l.flags&32&&(_n(_,""),l.flags&=-33);var x=Fh(r);vu(r,x,_);break;case 3:case 4:var R=l.stateNode.containerInfo,F=Fh(r);jh(r,F,R);break;default:throw Error(i(161))}}catch(K){it(r,r.return,K)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function dv(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;dv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function gr(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ov(r,o.alternate,o),o=o.sibling}function Wo(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Qr(4,o,o.return),Wo(o);break;case 1:Pi(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&ev(o,o.return,l),Wo(o);break;case 27:_l(o.stateNode);case 26:case 5:Pi(o,o.return),Wo(o);break;case 22:o.memoizedState===null&&Wo(o);break;case 30:Wo(o);break;default:Wo(o)}r=r.sibling}}function vr(r,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,p=r,v=o,_=v.flags;switch(v.tag){case 0:case 11:case 15:vr(p,v,l),dl(4,v);break;case 1:if(vr(p,v,l),u=v,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(F){it(u,u.return,F)}if(u=v,p=u.updateQueue,p!==null){var x=u.stateNode;try{var R=p.shared.hiddenCallbacks;if(R!==null)for(p.shared.hiddenCallbacks=null,p=0;p<R.length;p++)F0(R[p],x)}catch(F){it(u,u.return,F)}}l&&_&64&&J1(v),fl(v,v.return);break;case 27:iv(v);case 26:case 5:vr(p,v,l),l&&u===null&&_&4&&tv(v),fl(v,v.return);break;case 12:vr(p,v,l);break;case 31:vr(p,v,l),l&&_&4&&lv(p,v);break;case 13:vr(p,v,l),l&&_&4&&cv(p,v);break;case 22:v.memoizedState===null&&vr(p,v,l),fl(v,v.return);break;case 30:break;default:vr(p,v,l)}o=o.sibling}}function qh(r,o){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Zs(l))}function Gh(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zs(r))}function _i(r,o,l,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)fv(r,o,l,u),o=o.sibling}function fv(r,o,l,u){var p=o.flags;switch(o.tag){case 0:case 11:case 15:_i(r,o,l,u),p&2048&&dl(9,o);break;case 1:_i(r,o,l,u);break;case 3:_i(r,o,l,u),p&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zs(r)));break;case 12:if(p&2048){_i(r,o,l,u),r=o.stateNode;try{var v=o.memoizedProps,_=v.id,x=v.onPostCommit;typeof x=="function"&&x(_,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){it(o,o.return,R)}}else _i(r,o,l,u);break;case 31:_i(r,o,l,u);break;case 13:_i(r,o,l,u);break;case 23:break;case 22:v=o.stateNode,_=o.alternate,o.memoizedState!==null?v._visibility&2?_i(r,o,l,u):hl(r,o):v._visibility&2?_i(r,o,l,u):(v._visibility|=2,qa(r,o,l,u,(o.subtreeFlags&10256)!==0||!1)),p&2048&&qh(_,o);break;case 24:_i(r,o,l,u),p&2048&&Gh(o.alternate,o);break;default:_i(r,o,l,u)}}function qa(r,o,l,u,p){for(p=p&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,_=o,x=l,R=u,F=_.flags;switch(_.tag){case 0:case 11:case 15:qa(v,_,x,R,p),dl(8,_);break;case 23:break;case 22:var K=_.stateNode;_.memoizedState!==null?K._visibility&2?qa(v,_,x,R,p):hl(v,_):(K._visibility|=2,qa(v,_,x,R,p)),p&&F&2048&&qh(_.alternate,_);break;case 24:qa(v,_,x,R,p),p&&F&2048&&Gh(_.alternate,_);break;default:qa(v,_,x,R,p)}o=o.sibling}}function hl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=r,u=o,p=u.flags;switch(u.tag){case 22:hl(l,u),p&2048&&qh(u.alternate,u);break;case 24:hl(l,u),p&2048&&Gh(u.alternate,u);break;default:hl(l,u)}o=o.sibling}}var pl=8192;function Ga(r,o,l){if(r.subtreeFlags&pl)for(r=r.child;r!==null;)hv(r,o,l),r=r.sibling}function hv(r,o,l){switch(r.tag){case 26:Ga(r,o,l),r.flags&pl&&r.memoizedState!==null&&Yw(l,Si,r.memoizedState,r.memoizedProps);break;case 5:Ga(r,o,l);break;case 3:case 4:var u=Si;Si=Du(r.stateNode.containerInfo),Ga(r,o,l),Si=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=pl,pl=16777216,Ga(r,o,l),pl=u):Ga(r,o,l));break;default:Ga(r,o,l)}}function pv(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function ml(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Zt=u,gv(u,r)}pv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)mv(r),r=r.sibling}function mv(r){switch(r.tag){case 0:case 11:case 15:ml(r),r.flags&2048&&Qr(9,r,r.return);break;case 3:ml(r);break;case 12:ml(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,bu(r)):ml(r);break;default:ml(r)}}function bu(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Zt=u,gv(u,r)}pv(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Qr(8,o,o.return),bu(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,bu(o));break;default:bu(o)}r=r.sibling}}function gv(r,o){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:Qr(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Zs(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Zt=u;else e:for(l=r;Zt!==null;){u=Zt;var p=u.sibling,v=u.return;if(av(u),u===l){Zt=null;break e}if(p!==null){p.return=v,Zt=p;break e}Zt=v}}}var uw={getCacheForType:function(r){var o=sn(Nt),l=o.data.get(r);return l===void 0&&(l=r(),o.data.set(r,l)),l},cacheSignal:function(){return sn(Nt).controller.signal}},dw=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ut=null,Fe=null,$e=0,nt=0,jn=null,Zr=!1,Wa=!1,Wh=!1,yr=0,At=0,Jr=0,Ko=0,Kh=0,$n=0,Ka=0,gl=null,Dn=null,Yh=!1,Su=0,vv=0,_u=1/0,Cu=null,eo=null,Ft=0,to=null,Ya=null,br=0,Xh=0,Qh=null,yv=null,vl=0,Zh=null;function qn(){return(Qe&2)!==0&&$e!==0?$e&-$e:H.T!==null?rp():ks()}function bv(){if($n===0)if(($e&536870912)===0||Ge){var r=xo;xo<<=1,(xo&3932160)===0&&(xo=262144),$n=r}else $n=536870912;return r=Un.current,r!==null&&(r.flags|=32),$n}function Mn(r,o,l){(r===ut&&(nt===2||nt===9)||r.cancelPendingCommit!==null)&&(Xa(r,0),no(r,$e,$n,!1)),Zn(r,l),((Qe&2)===0||r!==ut)&&(r===ut&&((Qe&2)===0&&(Ko|=l),At===4&&no(r,$e,$n,!1)),Ni(r))}function Sv(r,o,l){if((Qe&6)!==0)throw Error(i(327));var u=!l&&(o&127)===0&&(o&r.expiredLanes)===0||To(r,o),p=u?pw(r,o):ep(r,o,!0),v=u;do{if(p===0){Wa&&!u&&no(r,o,0,!1);break}else{if(l=r.current.alternate,v&&!fw(l)){p=ep(r,o,!1),v=!1;continue}if(p===2){if(v=o,r.errorRecoveryDisabledLanes&v)var _=0;else _=r.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){o=_;e:{var x=r;p=gl;var R=x.current.memoizedState.isDehydrated;if(R&&(Xa(x,_).flags|=256),_=ep(x,_,!1),_!==2){if(Wh&&!R){x.errorRecoveryDisabledLanes|=v,Ko|=v,p=4;break e}v=Dn,Dn=p,v!==null&&(Dn===null?Dn=v:Dn.push.apply(Dn,v))}p=_}if(v=!1,p!==2)continue}}if(p===1){Xa(r,0),no(r,o,0,!0);break}e:{switch(u=r,v=p,v){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:no(u,o,$n,!Zr);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(p=Su+300-bn(),10<p)){if(no(u,o,$n,!Zr),ma(u,0,!0)!==0)break e;br=o,u.timeoutHandle=Qv(_v.bind(null,u,l,Dn,Cu,Yh,o,$n,Ko,Ka,Zr,v,"Throttled",-0,0),p);break e}_v(u,l,Dn,Cu,Yh,o,$n,Ko,Ka,Zr,v,null,-0,0)}}break}while(!0);Ni(r)}function _v(r,o,l,u,p,v,_,x,R,F,K,J,j,$){if(r.timeoutHandle=-1,J=o.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ei},hv(o,v,J);var ge=(v&62914560)===v?Su-bn():(v&4194048)===v?vv-bn():0;if(ge=Xw(J,ge),ge!==null){br=v,r.cancelPendingCommit=ge(Lv.bind(null,r,o,v,l,u,p,_,x,R,K,J,null,j,$)),no(r,v,_,!F);return}}Lv(r,o,v,l,u,p,_,x,R)}function fw(r){for(var o=r;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],v=p.getSnapshot;p=p.value;try{if(!Vn(v(),p))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function no(r,o,l,u){o&=~Kh,o&=~Ko,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var p=o;0<p;){var v=31-tn(p),_=1<<v;u[v]=-1,p&=~_}l!==0&&Ic(r,l,o)}function Eu(){return(Qe&6)===0?(yl(0),!1):!0}function Jh(){if(Fe!==null){if(nt===0)var r=Fe.return;else r=Fe,lr=Vo=null,mh(r),Ba=null,el=0,r=Fe;for(;r!==null;)Z1(r.alternate,r),r=r.return;Fe=null}}function Xa(r,o){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,Dw(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),br=0,Jh(),ut=r,Fe=l=ar(r.current,null),$e=o,nt=0,jn=null,Zr=!1,Wa=To(r,o),Wh=!1,Ka=$n=Kh=Ko=Jr=At=0,Dn=gl=null,Yh=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var p=31-tn(u),v=1<<p;o|=r[p],u&=~v}return yr=o,$c(),l}function Cv(r,o){Pe=null,H.H=ll,o===Va||o===Zc?(o=z0(),nt=3):o===ih?(o=z0(),nt=4):nt=o===Rh?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,jn=o,Fe===null&&(At=1,fu(r,ii(o,r.current)))}function Ev(){var r=Un.current;return r===null?!0:($e&4194048)===$e?si===null:($e&62914560)===$e||($e&536870912)!==0?r===si:!1}function wv(){var r=H.H;return H.H=ll,r===null?ll:r}function xv(){var r=H.A;return H.A=uw,r}function wu(){At=4,Zr||($e&4194048)!==$e&&Un.current!==null||(Wa=!0),(Jr&134217727)===0&&(Ko&134217727)===0||ut===null||no(ut,$e,$n,!1)}function ep(r,o,l){var u=Qe;Qe|=2;var p=wv(),v=xv();(ut!==r||$e!==o)&&(Cu=null,Xa(r,o)),o=!1;var _=At;e:do try{if(nt!==0&&Fe!==null){var x=Fe,R=jn;switch(nt){case 8:Jh(),_=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(o=!0);var F=nt;if(nt=0,jn=null,Qa(r,x,R,F),l&&Wa){_=0;break e}break;default:F=nt,nt=0,jn=null,Qa(r,x,R,F)}}hw(),_=At;break}catch(K){Cv(r,K)}while(!0);return o&&r.shellSuspendCounter++,lr=Vo=null,Qe=u,H.H=p,H.A=v,Fe===null&&(ut=null,$e=0,$c()),_}function hw(){for(;Fe!==null;)Tv(Fe)}function pw(r,o){var l=Qe;Qe|=2;var u=wv(),p=xv();ut!==r||$e!==o?(Cu=null,_u=bn()+500,Xa(r,o)):Wa=To(r,o);e:do try{if(nt!==0&&Fe!==null){o=Fe;var v=jn;t:switch(nt){case 1:nt=0,jn=null,Qa(r,o,v,1);break;case 2:case 9:if(N0(v)){nt=0,jn=null,kv(o);break}o=function(){nt!==2&&nt!==9||ut!==r||(nt=7),Ni(r)},v.then(o,o);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:N0(v)?(nt=0,jn=null,kv(o)):(nt=0,jn=null,Qa(r,o,v,7));break;case 5:var _=null;switch(Fe.tag){case 26:_=Fe.memoizedState;case 5:case 27:var x=Fe;if(_?fy(_):x.stateNode.complete){nt=0,jn=null;var R=x.sibling;if(R!==null)Fe=R;else{var F=x.return;F!==null?(Fe=F,xu(F)):Fe=null}break t}}nt=0,jn=null,Qa(r,o,v,5);break;case 6:nt=0,jn=null,Qa(r,o,v,6);break;case 8:Jh(),At=6;break e;default:throw Error(i(462))}}mw();break}catch(K){Cv(r,K)}while(!0);return lr=Vo=null,H.H=u,H.A=p,Qe=l,Fe!==null?0:(ut=null,$e=0,$c(),At)}function mw(){for(;Fe!==null&&!Ef();)Tv(Fe)}function Tv(r){var o=X1(r.alternate,r,yr);r.memoizedProps=r.pendingProps,o===null?xu(r):Fe=o}function kv(r){var o=r,l=o.alternate;switch(o.tag){case 15:case 0:o=$1(l,o,o.pendingProps,o.type,void 0,$e);break;case 11:o=$1(l,o,o.pendingProps,o.type.render,o.ref,$e);break;case 5:mh(o);default:Z1(l,o),o=Fe=x0(o,yr),o=X1(l,o,yr)}r.memoizedProps=r.pendingProps,o===null?xu(r):Fe=o}function Qa(r,o,l,u){lr=Vo=null,mh(o),Ba=null,el=0;var p=o.return;try{if(iw(r,p,o,l,$e)){At=1,fu(r,ii(l,r.current)),Fe=null;return}}catch(v){if(p!==null)throw Fe=p,v;At=1,fu(r,ii(l,r.current)),Fe=null;return}o.flags&32768?(Ge||u===1?r=!0:Wa||($e&536870912)!==0?r=!1:(Zr=r=!0,(u===2||u===9||u===3||u===6)&&(u=Un.current,u!==null&&u.tag===13&&(u.flags|=16384))),Av(o,r)):xu(o)}function xu(r){var o=r;do{if((o.flags&32768)!==0){Av(o,Zr);return}r=o.return;var l=aw(o.alternate,o,yr);if(l!==null){Fe=l;return}if(o=o.sibling,o!==null){Fe=o;return}Fe=o=r}while(o!==null);At===0&&(At=5)}function Av(r,o){do{var l=sw(r.alternate,r);if(l!==null){l.flags&=32767,Fe=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(r=r.sibling,r!==null)){Fe=r;return}Fe=r=l}while(r!==null);At=6,Fe=null}function Lv(r,o,l,u,p,v,_,x,R){r.cancelPendingCommit=null;do Tu();while(Ft!==0);if((Qe&6)!==0)throw Error(i(327));if(o!==null){if(o===r.current)throw Error(i(177));if(v=o.lanes|o.childLanes,v|=Ff,Lc(r,l,v,_,x,R),r===ut&&(Fe=ut=null,$e=0),Ya=o,to=r,br=l,Xh=v,Qh=p,yv=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,bw(Ai,function(){return Ov(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=H.T,H.T=null,p=z.p,z.p=2,_=Qe,Qe|=4;try{lw(r,o,l)}finally{Qe=_,z.p=p,H.T=u}}Ft=1,Iv(),Rv(),Dv()}}function Iv(){if(Ft===1){Ft=0;var r=to,o=Ya,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var u=z.p;z.p=2;var p=Qe;Qe|=4;try{uv(o,r);var v=fp,_=g0(r.containerInfo),x=v.focusedElem,R=v.selectionRange;if(_!==x&&x&&x.ownerDocument&&m0(x.ownerDocument.documentElement,x)){if(R!==null&&Hf(x)){var F=R.start,K=R.end;if(K===void 0&&(K=F),"selectionStart"in x)x.selectionStart=F,x.selectionEnd=Math.min(K,x.value.length);else{var J=x.ownerDocument||document,j=J&&J.defaultView||window;if(j.getSelection){var $=j.getSelection(),ge=x.textContent.length,Ie=Math.min(R.start,ge),st=R.end===void 0?Ie:Math.min(R.end,ge);!$.extend&&Ie>st&&(_=st,st=Ie,Ie=_);var V=p0(x,Ie),P=p0(x,st);if(V&&P&&($.rangeCount!==1||$.anchorNode!==V.node||$.anchorOffset!==V.offset||$.focusNode!==P.node||$.focusOffset!==P.offset)){var B=J.createRange();B.setStart(V.node,V.offset),$.removeAllRanges(),Ie>st?($.addRange(B),$.extend(P.node,P.offset)):(B.setEnd(P.node,P.offset),$.addRange(B))}}}}for(J=[],$=x;$=$.parentNode;)$.nodeType===1&&J.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<J.length;x++){var X=J[x];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}zu=!!dp,fp=dp=null}finally{Qe=p,z.p=u,H.T=l}}r.current=o,Ft=2}}function Rv(){if(Ft===2){Ft=0;var r=to,o=Ya,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var u=z.p;z.p=2;var p=Qe;Qe|=4;try{ov(r,o.alternate,o)}finally{Qe=p,z.p=u,H.T=l}}Ft=3}}function Dv(){if(Ft===4||Ft===3){Ft=0,Yi();var r=to,o=Ya,l=br,u=yv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Ft=5:(Ft=0,Ya=to=null,Mv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(eo=null),Qi(l),o=o.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Ir,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=H.T,p=z.p,z.p=2,H.T=null;try{for(var v=r.onRecoverableError,_=0;_<u.length;_++){var x=u[_];v(x.value,{componentStack:x.stack})}}finally{H.T=o,z.p=p}}(br&3)!==0&&Tu(),Ni(r),p=r.pendingLanes,(l&261930)!==0&&(p&42)!==0?r===Zh?vl++:(vl=0,Zh=r):vl=0,yl(0)}}function Mv(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,Zs(o)))}function Tu(){return Iv(),Rv(),Dv(),Ov()}function Ov(){if(Ft!==5)return!1;var r=to,o=Xh;Xh=0;var l=Qi(br),u=H.T,p=z.p;try{z.p=32>l?32:l,H.T=null,l=Qh,Qh=null;var v=to,_=br;if(Ft=0,Ya=to=null,br=0,(Qe&6)!==0)throw Error(i(331));var x=Qe;if(Qe|=4,mv(v.current),fv(v,v.current,_,l),Qe=x,yl(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Ir,v)}catch{}return!0}finally{z.p=p,H.T=u,Mv(r,o)}}function Pv(r,o,l){o=ii(l,o),o=Ih(r.stateNode,o,2),r=Kr(r,o,2),r!==null&&(Zn(r,2),Ni(r))}function it(r,o,l){if(r.tag===3)Pv(r,r,l);else for(;o!==null;){if(o.tag===3){Pv(o,r,l);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(eo===null||!eo.has(u))){r=ii(l,r),l=N1(2),u=Kr(o,l,2),u!==null&&(H1(l,u,o,r),Zn(u,2),Ni(u));break}}o=o.return}}function tp(r,o,l){var u=r.pingCache;if(u===null){u=r.pingCache=new dw;var p=new Set;u.set(o,p)}else p=u.get(o),p===void 0&&(p=new Set,u.set(o,p));p.has(l)||(Wh=!0,p.add(l),r=gw.bind(null,r,o,l),o.then(r,r))}function gw(r,o,l){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,ut===r&&($e&l)===l&&(At===4||At===3&&($e&62914560)===$e&&300>bn()-Su?(Qe&2)===0&&Xa(r,0):Kh|=l,Ka===$e&&(Ka=0)),Ni(r)}function Nv(r,o){o===0&&(o=nn()),r=No(r,o),r!==null&&(Zn(r,o),Ni(r))}function vw(r){var o=r.memoizedState,l=0;o!==null&&(l=o.retryLane),Nv(r,l)}function yw(r,o){var l=0;switch(r.tag){case 31:case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(o),Nv(r,l)}function bw(r,o){return Qn(r,o)}var ku=null,Za=null,np=!1,Au=!1,ip=!1,io=0;function Ni(r){r!==Za&&r.next===null&&(Za===null?ku=Za=r:Za=Za.next=r),Au=!0,np||(np=!0,_w())}function yl(r,o){if(!ip&&Au){ip=!0;do for(var l=!1,u=ku;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var v=0;else{var _=u.suspendedLanes,x=u.pingedLanes;v=(1<<31-tn(42|r)+1)-1,v&=p&~(_&~x),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,Bv(u,v))}else v=$e,v=ma(u,u===ut?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||To(u,v)||(l=!0,Bv(u,v));u=u.next}while(l);ip=!1}}function Sw(){Hv()}function Hv(){Au=np=!1;var r=0;io!==0&&Rw()&&(r=io);for(var o=bn(),l=null,u=ku;u!==null;){var p=u.next,v=zv(u,o);v===0?(u.next=null,l===null?ku=p:l.next=p,p===null&&(Za=l)):(l=u,(r!==0||(v&3)!==0)&&(Au=!0)),u=p}Ft!==0&&Ft!==5||yl(r),io!==0&&(io=0)}function zv(r,o){for(var l=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var _=31-tn(v),x=1<<_,R=p[_];R===-1?((x&l)===0||(x&u)!==0)&&(p[_]=kf(x,o)):R<=o&&(r.expiredLanes|=x),v&=~x}if(o=ut,l=$e,l=ma(r,r===o?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,l===0||r===o&&(nt===2||nt===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ki(u),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||To(r,l)){if(o=l&-l,o===r.callbackPriority)return o;switch(u!==null&&Ki(u),Qi(l)){case 2:case 8:l=ha;break;case 32:l=Ai;break;case 268435456:l=Lr;break;default:l=Ai}return u=Vv.bind(null,r),l=Qn(l,u),r.callbackPriority=o,r.callbackNode=l,o}return u!==null&&u!==null&&Ki(u),r.callbackPriority=2,r.callbackNode=null,2}function Vv(r,o){if(Ft!==0&&Ft!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Tu()&&r.callbackNode!==l)return null;var u=$e;return u=ma(r,r===ut?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(Sv(r,u,o),zv(r,bn()),r.callbackNode!=null&&r.callbackNode===l?Vv.bind(null,r):null)}function Bv(r,o){if(Tu())return null;Sv(r,o,!0)}function _w(){Mw(function(){(Qe&6)!==0?Qn(Ze,Sw):Hv()})}function rp(){if(io===0){var r=Ha;r===0&&(r=wo,wo<<=1,(wo&261888)===0&&(wo=256)),io=r}return io}function Uv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ko(""+r)}function Fv(r,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,r.id&&l.setAttribute("form",r.id),o.parentNode.insertBefore(l,o),r=new FormData(r),l.parentNode.removeChild(l),r}function Cw(r,o,l,u,p){if(o==="submit"&&l&&l.stateNode===p){var v=Uv((p[Kt]||null).action),_=u.submitter;_&&(o=(o=_[Kt]||null)?Uv(o.formAction):_.getAttribute("formAction"),o!==null&&(v=o,_=null));var x=new wa("action","action",null,u,p);r.push({event:x,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(io!==0){var R=_?Fv(p,_):new FormData(p);wh(l,{pending:!0,data:R,method:p.method,action:v},null,R)}}else typeof v=="function"&&(x.preventDefault(),R=_?Fv(p,_):new FormData(p),wh(l,{pending:!0,data:R,method:p.method,action:v},v,R))},currentTarget:p}]})}}for(var op=0;op<Uf.length;op++){var ap=Uf[op],Ew=ap.toLowerCase(),ww=ap[0].toUpperCase()+ap.slice(1);bi(Ew,"on"+ww)}bi(b0,"onAnimationEnd"),bi(S0,"onAnimationIteration"),bi(_0,"onAnimationStart"),bi("dblclick","onDoubleClick"),bi("focusin","onFocus"),bi("focusout","onBlur"),bi(B5,"onTransitionRun"),bi(U5,"onTransitionStart"),bi(F5,"onTransitionCancel"),bi(C0,"onTransitionEnd"),Et("onMouseEnter",["mouseout","mouseover"]),Et("onMouseLeave",["mouseout","mouseover"]),Et("onPointerEnter",["pointerout","pointerover"]),Et("onPointerLeave",["pointerout","pointerover"]),Jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bl));function jv(r,o){o=(o&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],p=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var _=u.length-1;0<=_;_--){var x=u[_],R=x.instance,F=x.currentTarget;if(x=x.listener,R!==v&&p.isPropagationStopped())break e;v=x,p.currentTarget=F;try{v(p)}catch(K){jc(K)}p.currentTarget=null,v=R}else for(_=0;_<u.length;_++){if(x=u[_],R=x.instance,F=x.currentTarget,x=x.listener,R!==v&&p.isPropagationStopped())break e;v=x,p.currentTarget=F;try{v(p)}catch(K){jc(K)}p.currentTarget=null,v=R}}}}function je(r,o){var l=o[Ls];l===void 0&&(l=o[Ls]=new Set);var u=r+"__bubble";l.has(u)||($v(o,r,2,!1),l.add(u))}function sp(r,o,l){var u=0;o&&(u|=4),$v(l,r,u,o)}var Lu="_reactListening"+Math.random().toString(36).slice(2);function lp(r){if(!r[Lu]){r[Lu]=!0,Mc.forEach(function(l){l!=="selectionchange"&&(xw.has(l)||sp(l,!1,r),sp(l,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Lu]||(o[Lu]=!0,sp("selectionchange",!1,o))}}function $v(r,o,l,u){switch(by(o)){case 2:var p=Jw;break;case 8:p=ex;break;default:p=Ep}l=p.bind(null,o,l,r),p=void 0,!Vs||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),u?p!==void 0?r.addEventListener(o,l,{capture:!0,passive:p}):r.addEventListener(o,l,!0):p!==void 0?r.addEventListener(o,l,{passive:p}):r.addEventListener(o,l,!1)}function cp(r,o,l,u,p){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var _=u.tag;if(_===3||_===4){var x=u.stateNode.containerInfo;if(x===p)break;if(_===4)for(_=u.return;_!==null;){var R=_.tag;if((R===3||R===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;x!==null;){if(_=Dr(x),_===null)return;if(R=_.tag,R===5||R===6||R===26||R===27){u=v=_;continue e}x=x.parentNode}}u=u.return}Nc(function(){var F=v,K=Ns(l),J=[];e:{var j=E0.get(r);if(j!==void 0){var $=wa,ge=r;switch(r){case"keypress":if(Ca(l)===0)break e;case"keydown":case"keyup":$=Z;break;case"focusin":ge="focus",$=Fs;break;case"focusout":ge="blur",$=Fs;break;case"beforeblur":case"afterblur":$=Fs;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Us;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Lf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=Ae;break;case b0:case S0:case _0:$=js;break;case C0:$=ke;break;case"scroll":case"scrollend":$=Ur;break;case"wheel":$=rt;break;case"copy":case"cut":case"paste":$=Ta;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=ue;break;case"toggle":case"beforetoggle":$=ht}var Ie=(o&4)!==0,st=!Ie&&(r==="scroll"||r==="scrollend"),V=Ie?j!==null?j+"Capture":null:j;Ie=[];for(var P=F,B;P!==null;){var X=P;if(B=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||B===null||V===null||(X=Ao(P,V),X!=null&&Ie.push(Sl(P,X,B))),st)break;P=P.return}0<Ie.length&&(j=new $(j,ge,null,l,K),J.push({event:j,listeners:Ie}))}}if((o&7)===0){e:{if(j=r==="mouseover"||r==="pointerover",$=r==="mouseout"||r==="pointerout",j&&l!==Ps&&(ge=l.relatedTarget||l.fromElement)&&(Dr(ge)||ge[rn]))break e;if(($||j)&&(j=K.window===K?K:(j=K.ownerDocument)?j.defaultView||j.parentWindow:window,$?(ge=l.relatedTarget||l.toElement,$=F,ge=ge?Dr(ge):null,ge!==null&&(st=s(ge),Ie=ge.tag,ge!==st||Ie!==5&&Ie!==27&&Ie!==6)&&(ge=null)):($=null,ge=F),$!==ge)){if(Ie=Us,X="onMouseLeave",V="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(Ie=ue,X="onPointerLeave",V="onPointerEnter",P="pointer"),st=$==null?j:mi($),B=ge==null?j:mi(ge),j=new Ie(X,P+"leave",$,l,K),j.target=st,j.relatedTarget=B,X=null,Dr(K)===F&&(Ie=new Ie(V,P+"enter",ge,l,K),Ie.target=B,Ie.relatedTarget=st,X=Ie),st=X,$&&ge)t:{for(Ie=Tw,V=$,P=ge,B=0,X=V;X;X=Ie(X))B++;X=0;for(var xe=P;xe;xe=Ie(xe))X++;for(;0<B-X;)V=Ie(V),B--;for(;0<X-B;)P=Ie(P),X--;for(;B--;){if(V===P||P!==null&&V===P.alternate){Ie=V;break t}V=Ie(V),P=Ie(P)}Ie=null}else Ie=null;$!==null&&qv(J,j,$,Ie,!1),ge!==null&&st!==null&&qv(J,st,ge,Ie,!0)}}e:{if(j=F?mi(F):window,$=j.nodeName&&j.nodeName.toLowerCase(),$==="select"||$==="input"&&j.type==="file")var Ke=l0;else if(Uc(j))if(c0)Ke=H5;else{Ke=P5;var ye=O5}else $=j.nodeName,!$||$.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?F&&ir(F.elementType)&&(Ke=l0):Ke=N5;if(Ke&&(Ke=Ke(r,F))){s0(J,Ke,l,K);break e}ye&&ye(r,j,F),r==="focusout"&&F&&j.type==="number"&&F.memoizedProps.value!=null&&Nr(j,"number",j.value)}switch(ye=F?mi(F):window,r){case"focusin":(Uc(ye)||ye.contentEditable==="true")&&(La=ye,zf=F,Ys=null);break;case"focusout":Ys=zf=La=null;break;case"mousedown":Vf=!0;break;case"contextmenu":case"mouseup":case"dragend":Vf=!1,v0(J,l,K);break;case"selectionchange":if(V5)break;case"keydown":case"keyup":v0(J,l,K)}var ze;if(Cn)e:{switch(r){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else on?Mo(r,l)&&(qe="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(mt&&l.locale!=="ko"&&(on||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&on&&(ze=Hc()):(yi=K,Bs="value"in yi?yi.value:yi.textContent,on=!0)),ye=Iu(F,qe),0<ye.length&&(qe=new Vc(qe,r,null,l,K),J.push({event:qe,listeners:ye}),ze?qe.data=ze:(ze=vt(l),ze!==null&&(qe.data=ze)))),(ze=Xe?Aa(r,l):qs(r,l))&&(qe=Iu(F,"onBeforeInput"),0<qe.length&&(ye=new Vc("onBeforeInput","beforeinput",null,l,K),J.push({event:ye,listeners:qe}),ye.data=ze)),Cw(J,r,F,l,K)}jv(J,o)})}function Sl(r,o,l){return{instance:r,listener:o,currentTarget:l}}function Iu(r,o){for(var l=o+"Capture",u=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Ao(r,l),p!=null&&u.unshift(Sl(r,p,v)),p=Ao(r,o),p!=null&&u.push(Sl(r,p,v))),r.tag===3)return u;r=r.return}return[]}function Tw(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function qv(r,o,l,u,p){for(var v=o._reactName,_=[];l!==null&&l!==u;){var x=l,R=x.alternate,F=x.stateNode;if(x=x.tag,R!==null&&R===u)break;x!==5&&x!==26&&x!==27||F===null||(R=F,p?(F=Ao(l,v),F!=null&&_.unshift(Sl(l,F,R))):p||(F=Ao(l,v),F!=null&&_.push(Sl(l,F,R)))),l=l.return}_.length!==0&&r.push({event:o,listeners:_})}var kw=/\r\n?/g,Aw=/\u0000|\uFFFD/g;function Gv(r){return(typeof r=="string"?r:""+r).replace(kw,`
1611
- `).replace(Aw,"")}function Wv(r,o){return o=Gv(o),Gv(r)===o}function at(r,o,l,u,p,v){switch(l){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||_n(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&_n(r,""+u);break;case"className":tr(r,"class",u);break;case"tabIndex":tr(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(r,l,u);break;case"style":Ms(r,u,v);break;case"data":if(o!=="object"){tr(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||l!=="href")){r.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=ko(""+u),r.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(o!=="input"&&at(r,o,"name",p.name,p,null),at(r,o,"formEncType",p.formEncType,p,null),at(r,o,"formMethod",p.formMethod,p,null),at(r,o,"formTarget",p.formTarget,p,null)):(at(r,o,"encType",p.encType,p,null),at(r,o,"method",p.method,p,null),at(r,o,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=ko(""+u),r.setAttribute(l,u);break;case"onClick":u!=null&&(r.onclick=ei);break;case"onScroll":u!=null&&je("scroll",r);break;case"onScrollEnd":u!=null&&je("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}l=ko(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""+u):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":u===!0?r.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,u):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(l,u):r.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(l):r.setAttribute(l,u);break;case"popover":je("beforetoggle",r),je("toggle",r),gi(r,"popover",u);break;case"xlinkActuate":Hn(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Hn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Hn(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Hn(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Hn(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Hn(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":gi(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Sa.get(l)||l,gi(r,l,u))}}function up(r,o,l,u,p,v){switch(l){case"style":Ms(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"children":typeof u=="string"?_n(r,u):(typeof u=="number"||typeof u=="bigint")&&_n(r,""+u);break;case"onScroll":u!=null&&je("scroll",r);break;case"onScrollEnd":u!=null&&je("scrollend",r);break;case"onClick":u!=null&&(r.onclick=ei);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!It.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),o=l.slice(2,p?l.length-7:void 0),v=r[Kt]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(o,v,p),typeof u=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(o,u,p);break e}l in r?r[l]=u:u===!0?r.setAttribute(l,""):gi(r,l,u)}}}function cn(r,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",r),je("load",r);var u=!1,p=!1,v;for(v in l)if(l.hasOwnProperty(v)){var _=l[v];if(_!=null)switch(v){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:at(r,o,v,_,l,null)}}p&&at(r,o,"srcSet",l.srcSet,l,null),u&&at(r,o,"src",l.src,l,null);return;case"input":je("invalid",r);var x=v=_=p=null,R=null,F=null;for(u in l)if(l.hasOwnProperty(u)){var K=l[u];if(K!=null)switch(u){case"name":p=K;break;case"type":_=K;break;case"checked":R=K;break;case"defaultChecked":F=K;break;case"value":v=K;break;case"defaultValue":x=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,o));break;default:at(r,o,u,K,l,null)}}Oc(r,v,x,R,F,_,p,!1);return;case"select":je("invalid",r),u=_=v=null;for(p in l)if(l.hasOwnProperty(p)&&(x=l[p],x!=null))switch(p){case"value":v=x;break;case"defaultValue":_=x;break;case"multiple":u=x;default:at(r,o,p,x,l,null)}o=v,l=_,r.multiple=!!u,o!=null?Hr(r,!!u,o,!1):l!=null&&Hr(r,!!u,l,!0);return;case"textarea":je("invalid",r),v=p=u=null;for(_ in l)if(l.hasOwnProperty(_)&&(x=l[_],x!=null))switch(_){case"value":u=x;break;case"defaultValue":p=x;break;case"children":v=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(i(91));break;default:at(r,o,_,x,l,null)}Pc(r,u,p,v);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(u=l[R],u!=null))switch(R){case"selected":r.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:at(r,o,R,u,l,null)}return;case"dialog":je("beforetoggle",r),je("toggle",r),je("cancel",r),je("close",r);break;case"iframe":case"object":je("load",r);break;case"video":case"audio":for(u=0;u<bl.length;u++)je(bl[u],r);break;case"image":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"embed":case"source":case"link":je("error",r),je("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(u=l[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:at(r,o,F,u,l,null)}return;default:if(ir(o)){for(K in l)l.hasOwnProperty(K)&&(u=l[K],u!==void 0&&up(r,o,K,u,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(u=l[x],u!=null&&at(r,o,x,u,l,null))}function Lw(r,o,l,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,_=null,x=null,R=null,F=null,K=null;for($ in l){var J=l[$];if(l.hasOwnProperty($)&&J!=null)switch($){case"checked":break;case"value":break;case"defaultValue":R=J;default:u.hasOwnProperty($)||at(r,o,$,null,u,J)}}for(var j in u){var $=u[j];if(J=l[j],u.hasOwnProperty(j)&&($!=null||J!=null))switch(j){case"type":v=$;break;case"name":p=$;break;case"checked":F=$;break;case"defaultChecked":K=$;break;case"value":_=$;break;case"defaultValue":x=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,o));break;default:$!==J&&at(r,o,j,$,u,J)}}ya(r,_,x,R,F,K,v,p);return;case"select":$=_=x=j=null;for(v in l)if(R=l[v],l.hasOwnProperty(v)&&R!=null)switch(v){case"value":break;case"multiple":$=R;default:u.hasOwnProperty(v)||at(r,o,v,null,u,R)}for(p in u)if(v=u[p],R=l[p],u.hasOwnProperty(p)&&(v!=null||R!=null))switch(p){case"value":j=v;break;case"defaultValue":x=v;break;case"multiple":_=v;default:v!==R&&at(r,o,p,v,u,R)}o=x,l=_,u=$,j!=null?Hr(r,!!l,j,!1):!!u!=!!l&&(o!=null?Hr(r,!!l,o,!0):Hr(r,!!l,l?[]:"",!1));return;case"textarea":$=j=null;for(x in l)if(p=l[x],l.hasOwnProperty(x)&&p!=null&&!u.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:at(r,o,x,null,u,p)}for(_ in u)if(p=u[_],v=l[_],u.hasOwnProperty(_)&&(p!=null||v!=null))switch(_){case"value":j=p;break;case"defaultValue":$=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==v&&at(r,o,_,p,u,v)}Ds(r,j,$);return;case"option":for(var ge in l)if(j=l[ge],l.hasOwnProperty(ge)&&j!=null&&!u.hasOwnProperty(ge))switch(ge){case"selected":r.selected=!1;break;default:at(r,o,ge,null,u,j)}for(R in u)if(j=u[R],$=l[R],u.hasOwnProperty(R)&&j!==$&&(j!=null||$!=null))switch(R){case"selected":r.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:at(r,o,R,j,u,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in l)j=l[Ie],l.hasOwnProperty(Ie)&&j!=null&&!u.hasOwnProperty(Ie)&&at(r,o,Ie,null,u,j);for(F in u)if(j=u[F],$=l[F],u.hasOwnProperty(F)&&j!==$&&(j!=null||$!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(137,o));break;default:at(r,o,F,j,u,$)}return;default:if(ir(o)){for(var st in l)j=l[st],l.hasOwnProperty(st)&&j!==void 0&&!u.hasOwnProperty(st)&&up(r,o,st,void 0,u,j);for(K in u)j=u[K],$=l[K],!u.hasOwnProperty(K)||j===$||j===void 0&&$===void 0||up(r,o,K,j,u,$);return}}for(var V in l)j=l[V],l.hasOwnProperty(V)&&j!=null&&!u.hasOwnProperty(V)&&at(r,o,V,null,u,j);for(J in u)j=u[J],$=l[J],!u.hasOwnProperty(J)||j===$||j==null&&$==null||at(r,o,J,j,u,$)}function Kv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iw(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],v=p.transferSize,_=p.initiatorType,x=p.duration;if(v&&x&&Kv(_)){for(_=0,x=p.responseEnd,u+=1;u<l.length;u++){var R=l[u],F=R.startTime;if(F>x)break;var K=R.transferSize,J=R.initiatorType;K&&Kv(J)&&(R=R.responseEnd,_+=K*(R<x?1:(x-F)/(R-F)))}if(--u,o+=8*(v+_)/(p.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var dp=null,fp=null;function Ru(r){return r.nodeType===9?r:r.ownerDocument}function Yv(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function hp(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var pp=null;function Rw(){var r=window.event;return r&&r.type==="popstate"?r===pp?!1:(pp=r,!0):(pp=null,!1)}var Qv=typeof setTimeout=="function"?setTimeout:void 0,Dw=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,Mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(r){return Zv.resolve(null).then(r).catch(Ow)}:Qv;function Ow(r){setTimeout(function(){throw r})}function ro(r){return r==="head"}function Jv(r,o){var l=o,u=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){r.removeChild(p),ns(o);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")_l(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,_l(l);for(var v=l.firstChild;v;){var _=v.nextSibling,x=v.nodeName;v[Sn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=_}}else l==="body"&&_l(r.ownerDocument.body);l=p}while(l);ns(o)}function ey(r,o){var l=r;r=0;do{var u=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=u}while(l)}function mp(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":mp(l),Zi(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function Pw(r,o,l,u){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[Sn])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=li(r.nextSibling),r===null)break}return null}function Nw(r,o,l){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=li(r.nextSibling),r===null))return null;return r}function ty(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=li(r.nextSibling),r===null))return null;return r}function gp(r){return r.data==="$?"||r.data==="$~"}function vp(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Hw(r,o){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||l.readyState!=="loading")o();else{var u=function(){o(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function li(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var yp=null;function ny(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(o===0)return li(r.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}r=r.nextSibling}return null}function iy(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return r;o--}else l!=="/$"&&l!=="/&"||o++}r=r.previousSibling}return null}function ry(r,o,l){switch(o=Ru(l),r){case"html":if(r=o.documentElement,!r)throw Error(i(452));return r;case"head":if(r=o.head,!r)throw Error(i(453));return r;case"body":if(r=o.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function _l(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Zi(r)}var ci=new Map,oy=new Set;function Du(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Sr=z.d;z.d={f:zw,r:Vw,D:Bw,C:Uw,L:Fw,m:jw,X:qw,S:$w,M:Gw};function zw(){var r=Sr.f(),o=Eu();return r||o}function Vw(r){var o=Mr(r);o!==null&&o.tag===5&&o.type==="form"?C1(o):Sr.r(r)}var Ja=typeof document>"u"?null:document;function ay(r,o,l){var u=Ja;if(u&&typeof o=="string"&&o){var p=Yt(o);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),oy.has(p)||(oy.add(p),r={rel:r,crossOrigin:l,href:o},u.querySelector(p)===null&&(o=u.createElement("link"),cn(o,"link",r),Pt(o),u.head.appendChild(o)))}}function Bw(r){Sr.D(r),ay("dns-prefetch",r,null)}function Uw(r,o){Sr.C(r,o),ay("preconnect",r,o)}function Fw(r,o,l){Sr.L(r,o,l);var u=Ja;if(u&&r&&o){var p='link[rel="preload"][as="'+Yt(o)+'"]';o==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Yt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Yt(l.imageSizes)+'"]')):p+='[href="'+Yt(r)+'"]';var v=p;switch(o){case"style":v=es(r);break;case"script":v=ts(r)}ci.has(v)||(r=g({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:r,as:o},l),ci.set(v,r),u.querySelector(p)!==null||o==="style"&&u.querySelector(Cl(v))||o==="script"&&u.querySelector(El(v))||(o=u.createElement("link"),cn(o,"link",r),Pt(o),u.head.appendChild(o)))}}function jw(r,o){Sr.m(r,o);var l=Ja;if(l&&r){var u=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+Yt(u)+'"][href="'+Yt(r)+'"]',v=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ts(r)}if(!ci.has(v)&&(r=g({rel:"modulepreload",href:r},o),ci.set(v,r),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(El(v)))return}u=l.createElement("link"),cn(u,"link",r),Pt(u),l.head.appendChild(u)}}}function $w(r,o,l){Sr.S(r,o,l);var u=Ja;if(u&&r){var p=Ji(u).hoistableStyles,v=es(r);o=o||"default";var _=p.get(v);if(!_){var x={loading:0,preload:null};if(_=u.querySelector(Cl(v)))x.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":o},l),(l=ci.get(v))&&bp(r,l);var R=_=u.createElement("link");Pt(R),cn(R,"link",r),R._p=new Promise(function(F,K){R.onload=F,R.onerror=K}),R.addEventListener("load",function(){x.loading|=1}),R.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Mu(_,o,u)}_={type:"stylesheet",instance:_,count:1,state:x},p.set(v,_)}}}function qw(r,o){Sr.X(r,o);var l=Ja;if(l&&r){var u=Ji(l).hoistableScripts,p=ts(r),v=u.get(p);v||(v=l.querySelector(El(p)),v||(r=g({src:r,async:!0},o),(o=ci.get(p))&&Sp(r,o),v=l.createElement("script"),Pt(v),cn(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function Gw(r,o){Sr.M(r,o);var l=Ja;if(l&&r){var u=Ji(l).hoistableScripts,p=ts(r),v=u.get(p);v||(v=l.querySelector(El(p)),v||(r=g({src:r,async:!0,type:"module"},o),(o=ci.get(p))&&Sp(r,o),v=l.createElement("script"),Pt(v),cn(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function sy(r,o,l,u){var p=(p=Se.current)?Du(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=es(l.href),l=Ji(p).hoistableStyles,u=l.get(o),u||(u={type:"style",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=es(l.href);var v=Ji(p).hoistableStyles,_=v.get(r);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,_),(v=p.querySelector(Cl(r)))&&!v._p&&(_.instance=v,_.state.loading=5),ci.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ci.set(r,l),v||Ww(p,r,l,_.state))),o&&u===null)throw Error(i(528,""));return _}if(o&&u!==null)throw Error(i(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ts(l),l=Ji(p).hoistableScripts,u=l.get(o),u||(u={type:"script",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function es(r){return'href="'+Yt(r)+'"'}function Cl(r){return'link[rel="stylesheet"]['+r+"]"}function ly(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function Ww(r,o,l,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),cn(o,"link",l),Pt(o),r.head.appendChild(o))}function ts(r){return'[src="'+Yt(r)+'"]'}function El(r){return"script[async]"+r}function cy(r,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Yt(l.href)+'"]');if(u)return o.instance=u,Pt(u),u;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Pt(u),cn(u,"style",p),Mu(u,l.precedence,r),o.instance=u;case"stylesheet":p=es(l.href);var v=r.querySelector(Cl(p));if(v)return o.state.loading|=4,o.instance=v,Pt(v),v;u=ly(l),(p=ci.get(p))&&bp(u,p),v=(r.ownerDocument||r).createElement("link"),Pt(v);var _=v;return _._p=new Promise(function(x,R){_.onload=x,_.onerror=R}),cn(v,"link",u),o.state.loading|=4,Mu(v,l.precedence,r),o.instance=v;case"script":return v=ts(l.src),(p=r.querySelector(El(v)))?(o.instance=p,Pt(p),p):(u=l,(p=ci.get(v))&&(u=g({},l),Sp(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),Pt(p),cn(p,"link",u),r.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,Mu(u,l.precedence,r));return o.instance}function Mu(r,o,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,v=p,_=0;_<u.length;_++){var x=u[_];if(x.dataset.precedence===o)v=x;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(r,o.firstChild))}function bp(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Sp(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var Ou=null;function uy(r,o,l){if(Ou===null){var u=new Map,p=Ou=new Map;p.set(l,u)}else p=Ou,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(r))return u;for(u.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var v=l[p];if(!(v[Sn]||v[Ct]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var _=v.getAttribute(o)||"";_=r+_;var x=u.get(_);x?x.push(v):u.set(_,[v])}}return u}function dy(r,o,l){r=r.ownerDocument||r,r.head.insertBefore(l,o==="title"?r.querySelector("head > title"):null)}function Kw(r,o,l){if(l===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function fy(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Yw(r,o,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=es(u.href),v=o.querySelector(Cl(p));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=Pu.bind(r),o.then(r,r)),l.state.loading|=4,l.instance=v,Pt(v);return}v=o.ownerDocument||o,u=ly(u),(p=ci.get(p))&&bp(u,p),v=v.createElement("link"),Pt(v);var _=v;_._p=new Promise(function(x,R){_.onload=x,_.onerror=R}),cn(v,"link",u),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=Pu.bind(r),o.addEventListener("load",l),o.addEventListener("error",l))}}var _p=0;function Xw(r,o){return r.stylesheets&&r.count===0&&Hu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var u=setTimeout(function(){if(r.stylesheets&&Hu(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&_p===0&&(_p=62500*Iw());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Hu(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>_p?50:800)+o);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Nu=null;function Hu(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Nu=new Map,o.forEach(Qw,r),Nu=null,Pu.call(r))}function Qw(r,o){if(!(o.state.loading&4)){var l=Nu.get(r);if(l)var u=l.get(null);else{l=new Map,Nu.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var _=p[v];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),u=_)}u&&l.set(null,u)}p=o.instance,_=p.getAttribute("data-precedence"),v=l.get(_)||u,v===u&&l.set(null,p),l.set(_,p),this.count++,u=Pu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),o.state.loading|=4}}var wl={$$typeof:T,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Zw(r,o,l,u,p,v,_,x,R){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ii(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.hiddenUpdates=Ii(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function hy(r,o,l,u,p,v,_,x,R,F,K,J){return r=new Zw(r,o,l,_,R,F,K,J,x),o=1,v===!0&&(o|=24),v=Bn(3,null,null,o),r.current=v,v.stateNode=r,o=eh(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:o},rh(v),r}function py(r){return r?(r=Da,r):Da}function my(r,o,l,u,p,v){p=py(p),u.context===null?u.context=p:u.pendingContext=p,u=Wr(o),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Kr(r,u,o),l!==null&&(Mn(l,r,o),nl(l,r,o))}function gy(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<o?l:o}}function Cp(r,o){gy(r,o),(r=r.alternate)&&gy(r,o)}function vy(r){if(r.tag===13||r.tag===31){var o=No(r,67108864);o!==null&&Mn(o,r,67108864),Cp(r,67108864)}}function yy(r){if(r.tag===13||r.tag===31){var o=qn();o=Ts(o);var l=No(r,o);l!==null&&Mn(l,r,o),Cp(r,o)}}var zu=!0;function Jw(r,o,l,u){var p=H.T;H.T=null;var v=z.p;try{z.p=2,Ep(r,o,l,u)}finally{z.p=v,H.T=p}}function ex(r,o,l,u){var p=H.T;H.T=null;var v=z.p;try{z.p=8,Ep(r,o,l,u)}finally{z.p=v,H.T=p}}function Ep(r,o,l,u){if(zu){var p=wp(u);if(p===null)cp(r,o,u,Vu,l),Sy(r,u);else if(nx(p,r,o,l,u))u.stopPropagation();else if(Sy(r,u),o&4&&-1<tx.indexOf(r)){for(;p!==null;){var v=Mr(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var _=Xi(v.pendingLanes);if(_!==0){var x=v;for(x.pendingLanes|=2,x.entangledLanes|=2;_;){var R=1<<31-tn(_);x.entanglements[1]|=R,_&=~R}Ni(v),(Qe&6)===0&&(_u=bn()+500,yl(0))}}break;case 31:case 13:x=No(v,2),x!==null&&Mn(x,v,2),Eu(),Cp(v,2)}if(v=wp(u),v===null&&cp(r,o,u,Vu,l),v===p)break;p=v}p!==null&&u.stopPropagation()}else cp(r,o,u,null,l)}}function wp(r){return r=Ns(r),xp(r)}var Vu=null;function xp(r){if(Vu=null,r=Dr(r),r!==null){var o=s(r);if(o===null)r=null;else{var l=o.tag;if(l===13){if(r=c(o),r!==null)return r;r=null}else if(l===31){if(r=d(o),r!==null)return r;r=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Vu=r,null}function by(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(wf()){case Ze:return 2;case ha:return 8;case Ai:case pa:return 32;case Lr:return 268435456;default:return 32}default:return 32}}var Tp=!1,oo=null,ao=null,so=null,xl=new Map,Tl=new Map,lo=[],tx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sy(r,o){switch(r){case"focusin":case"focusout":oo=null;break;case"dragenter":case"dragleave":ao=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":xl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(o.pointerId)}}function kl(r,o,l,u,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[p]},o!==null&&(o=Mr(o),o!==null&&vy(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),r)}function nx(r,o,l,u,p){switch(o){case"focusin":return oo=kl(oo,r,o,l,u,p),!0;case"dragenter":return ao=kl(ao,r,o,l,u,p),!0;case"mouseover":return so=kl(so,r,o,l,u,p),!0;case"pointerover":var v=p.pointerId;return xl.set(v,kl(xl.get(v)||null,r,o,l,u,p)),!0;case"gotpointercapture":return v=p.pointerId,Tl.set(v,kl(Tl.get(v)||null,r,o,l,u,p)),!0}return!1}function _y(r){var o=Dr(r.target);if(o!==null){var l=s(o);if(l!==null){if(o=l.tag,o===13){if(o=c(l),o!==null){r.blockedOn=o,As(r.priority,function(){yy(l)});return}}else if(o===31){if(o=d(l),o!==null){r.blockedOn=o,As(r.priority,function(){yy(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Bu(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var l=wp(r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);Ps=u,l.target.dispatchEvent(u),Ps=null}else return o=Mr(l),o!==null&&vy(o),r.blockedOn=l,!1;o.shift()}return!0}function Cy(r,o,l){Bu(r)&&l.delete(o)}function ix(){Tp=!1,oo!==null&&Bu(oo)&&(oo=null),ao!==null&&Bu(ao)&&(ao=null),so!==null&&Bu(so)&&(so=null),xl.forEach(Cy),Tl.forEach(Cy)}function Uu(r,o){r.blockedOn===o&&(r.blockedOn=null,Tp||(Tp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ix)))}var Fu=null;function Ey(r){Fu!==r&&(Fu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fu===r&&(Fu=null);for(var o=0;o<r.length;o+=3){var l=r[o],u=r[o+1],p=r[o+2];if(typeof u!="function"){if(xp(u||l)===null)continue;break}var v=Mr(l);v!==null&&(r.splice(o,3),o-=3,wh(v,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function ns(r){function o(R){return Uu(R,r)}oo!==null&&Uu(oo,r),ao!==null&&Uu(ao,r),so!==null&&Uu(so,r),xl.forEach(o),Tl.forEach(o);for(var l=0;l<lo.length;l++){var u=lo[l];u.blockedOn===r&&(u.blockedOn=null)}for(;0<lo.length&&(l=lo[0],l.blockedOn===null);)_y(l),l.blockedOn===null&&lo.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],v=l[u+1],_=p[Kt]||null;if(typeof v=="function")_||Ey(l);else if(_){var x=null;if(v&&v.hasAttribute("formAction")){if(p=v,_=v[Kt]||null)x=_.formAction;else if(xp(p)!==null)continue}else x=_.action;typeof x=="function"?l[u+1]=x:(l.splice(u,3),u-=3),Ey(l)}}}function wy(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(_){return p=_})},focusReset:"manual",scroll:"manual"})}function o(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),p!==null&&(p(),p=null)}}}function kp(r){this._internalRoot=r}ju.prototype.render=kp.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(i(409));var l=o.current,u=qn();my(l,u,r,o,null,null)},ju.prototype.unmount=kp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;my(r.current,2,null,r,null,null),Eu(),o[rn]=null}};function ju(r){this._internalRoot=r}ju.prototype.unstable_scheduleHydration=function(r){if(r){var o=ks();r={blockedOn:null,target:r,priority:o};for(var l=0;l<lo.length&&o!==0&&o<lo[l].priority;l++);lo.splice(l,0,r),l===0&&_y(r)}};var xy=t.version;if(xy!=="19.2.8")throw Error(i(527,xy,"19.2.8"));z.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(o),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var rx={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{Ir=$u.inject(rx),Wt=$u}catch{}}return Ol.createRoot=function(r,o){if(!a(r))throw Error(i(299));var l=!1,u="",p=D1,v=M1,_=O1;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError)),o=hy(r,1,!1,null,null,l,u,null,p,v,_,wy),r[rn]=o.current,lp(r),new kp(o)},Ol.hydrateRoot=function(r,o,l){if(!a(r))throw Error(i(299));var u=!1,p="",v=D1,_=M1,x=O1,R=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),o=hy(r,1,!0,o,l??null,u,p,R,v,_,x,wy),o.context=py(null),l=o.current,u=qn(),u=Ts(u),p=Wr(u),p.callback=null,Kr(l,p,u),l=u,o.current.lanes=l,Zn(o,l),Ni(o),r[rn]=o.current,lp(r),new ju(o)},Ol.version="19.2.8",Ol}var _S;function dI(){if(_S)return cm.exports;_S=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cm.exports=uI(),cm.exports}var fI=dI();function pi(e,t){if(e==null)return{};var n={},i=Object.keys(e),a,s;for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var hI=["color"],pI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,hI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),mI=["color"],gI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,mI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),vI=["color"],EE=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,vI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),yI=["color"],bI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,yI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M2.14998 14V1H0.849976V14H2.14998ZM6.14998 14V1H4.84998V14H6.14998ZM10.15 1V14H8.84998V1H10.15ZM14.15 14V1H12.85V14H14.15Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),SI=["color"],_I=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,SI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),CI=["color"],EI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,CI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),wI=["color"],xI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,wI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),TI=["color"],kI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,TI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),AI=["color"],LI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,AI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),II=["color"],RI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,II);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M14 12.85L1 12.85L1 14.15L14 14.15L14 12.85ZM14 8.85002L1 8.85002L1 10.15L14 10.15L14 8.85002ZM1 4.85003L14 4.85003L14 6.15003L1 6.15002L1 4.85003ZM14 0.850025L1 0.850025L1 2.15002L14 2.15002L14 0.850025Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],MI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,DI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),OI=["color"],PI=Y.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,OI);return Y.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Y.createElement("path",{d:"M8 2H13.5C13.7761 2 14 2.22386 14 2.5V12.5C14 12.7761 13.7761 13 13.5 13H8V2ZM7 2H1.5C1.22386 2 1 2.22386 1 2.5V12.5C1 12.7761 1.22386 13 1.5 13H7V2ZM0 2.5C0 1.67157 0.671573 1 1.5 1H13.5C14.3284 1 15 1.67157 15 2.5V12.5C15 13.3284 14.3284 14 13.5 14H1.5C0.671573 14 0 13.3284 0 12.5V2.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});function wE(){const e=/^\/s\/[^/]+\//.exec(window.location.pathname);if(!e)throw new Error("not inside a session URL");return e[0]}async function Tc(e,t){const n=await fetch(wE()+e,t);if(!n.ok){let i=`${n.status}`;try{const a=await n.json();a.error&&(i=a.error)}catch{}throw new Error(i)}return await n.json()}function NI(){return Tc("api/session")}function HI(e){return Tc(`api/patch?filter=${e}`)}function zI(e){return Tc("api/comments",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function VI(e,t){return Tc(`api/comments/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({body:t})})}function BI(e){return Tc(`api/comments/${e}`,{method:"DELETE"})}function UI(e,t){const n=new EventSource(`${wE()}api/events?filter=${e}`);return n.addEventListener("open",()=>t.onOpen()),n.addEventListener("error",()=>t.onDisconnect()),n.addEventListener("session",i=>t.onSession(JSON.parse(i.data))),n.addEventListener("patch",i=>t.onPatch(JSON.parse(i.data))),n.addEventListener("comments",i=>t.onComments(JSON.parse(i.data).comments)),n.addEventListener("end",()=>{t.onEnd(),n.close()}),()=>n.close()}function FI(e,t){const n=new Map,i=new Map;for(const a of e){if(a.outdated)continue;const s=`${a.path}\0${a.side}\0${a.endLine}`;let c=i.get(s);c||(c=[],i.set(s,c)),c.push(a)}for(const[a,s]of i){const[c,d,f]=a.split("\0");CS(n,c,{side:d,lineNumber:Number(f),metadata:{kind:"thread",comments:s}})}return t&&CS(n,t.path,{side:t.side,lineNumber:t.endLine,metadata:{kind:"draft",draft:t}}),n}function CS(e,t,n){const i=e.get(t);i?i.push(n):e.set(t,[n])}function jI(e){return!e||e.length===0?"":e.map(t=>{const n=t.metadata,i=n.kind==="thread"?n.comments.map(a=>`${a.id}@${a.updatedAt}:${a.startLine}`).join(","):`draft:${n.draft.startLine}-${n.draft.endLine}`;return`${t.side}:${t.lineNumber}[${i}]`}).sort().join("|")}function $I({meta:e,onCreate:t,onUpdate:n,onDelete:i,onCancelDraft:a}){return e.kind==="draft"?U.jsx(GI,{draft:e.draft,onCreate:t,onCancel:a}):U.jsx("div",{className:"comment-card",children:e.comments.map(s=>U.jsx(qI,{comment:s,onUpdate:n,onDelete:i},s.id))})}function xE(e,t){return e===t?`line ${t}`:`lines ${e}–${t}`}function qI({comment:e,onUpdate:t,onDelete:n}){const[i,a]=Y.useState(!1),[s,c]=Y.useState(e.body),[d,f]=Y.useState(!1),h=async()=>{if(s.trim()!==""){f(!0);try{await t(e.id,s),a(!1)}finally{f(!1)}}};return U.jsxs("div",{className:"comment-row",children:[U.jsxs("div",{className:"comment-meta",children:[U.jsx("span",{className:"comment-side",children:e.side==="additions"?"+":"−"}),U.jsx("span",{children:xE(e.startLine,e.endLine)}),U.jsxs("span",{className:"comment-actions",children:[U.jsx("button",{type:"button",className:"comment-action-button","aria-label":i?"Cancel editing":"Edit comment",title:i?"Cancel editing":"Edit comment",onClick:()=>{a(m=>!m),c(e.body)},children:i?U.jsx(_I,{"aria-hidden":"true"}):U.jsx(LI,{"aria-hidden":"true"})}),U.jsx("button",{type:"button",className:"comment-action-button danger","aria-label":"Delete comment",title:"Delete comment",onClick:()=>void n(e.id),children:U.jsx(MI,{"aria-hidden":"true"})})]})]}),i?U.jsxs("div",{className:"comment-editor",children:[U.jsx("textarea",{value:s,onChange:m=>c(m.target.value),rows:3,disabled:d}),U.jsx("div",{className:"comment-editor-actions",children:U.jsx("button",{type:"button",className:"primary",onClick:()=>void h(),disabled:d||s.trim()==="",children:"Save"})})]}):U.jsx("div",{className:"comment-body",children:e.body})]})}function GI({draft:e,onCreate:t,onCancel:n}){const[i,a]=Y.useState(""),[s,c]=Y.useState(!1),[d,f]=Y.useState(null),h=async()=>{if(i.trim()!==""){c(!0),f(null);try{await t(e,i)}catch(m){f(m instanceof Error?m.message:String(m)),c(!1)}}};return U.jsxs("div",{className:"comment-card draft",children:[U.jsxs("div",{className:"comment-meta",children:[U.jsx("span",{className:"comment-side",children:e.side==="additions"?"+":"−"}),U.jsxs("span",{children:["New comment on ",xE(e.startLine,e.endLine)," (",e.side,")"]})]}),U.jsxs("div",{className:"comment-editor",children:[U.jsx("textarea",{autoFocus:!0,placeholder:"Leave a review comment…",value:i,onChange:m=>a(m.target.value),rows:3,disabled:s}),d&&U.jsx("div",{className:"comment-error",children:d}),U.jsxs("div",{className:"comment-editor-actions",children:[U.jsx("button",{type:"button",onClick:n,disabled:s,children:"Cancel"}),U.jsx("button",{type:"button",className:"primary",onClick:()=>void h(),disabled:s||i.trim()==="",children:"Comment"})]})]})]})}const TE=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1610
+ `+u.stack}}var yn=Object.prototype.hasOwnProperty,Qn=e.unstable_scheduleCallback,Ki=e.unstable_cancelCallback,Ef=e.unstable_shouldYield,Yi=e.unstable_requestPaint,bn=e.unstable_now,wf=e.unstable_getCurrentPriorityLevel,Ze=e.unstable_ImmediatePriority,ha=e.unstable_UserBlockingPriority,Ai=e.unstable_NormalPriority,pa=e.unstable_LowPriority,Lr=e.unstable_IdlePriority,Co=e.log,Eo=e.unstable_setDisableYieldValue,Ir=null,Wt=null;function Li(r){if(typeof Co=="function"&&Eo(r),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(Ir,r)}catch{}}var tn=Math.clz32?Math.clz32:Tf,xf=Math.log,Ac=Math.LN2;function Tf(r){return r>>>=0,r===0?32:31-(xf(r)/Ac|0)|0}var wo=256,xo=262144,Rr=4194304;function Xi(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ma(r,o,l){var u=r.pendingLanes;if(u===0)return 0;var p=0,v=r.suspendedLanes,_=r.pingedLanes;r=r.warmLanes;var x=u&134217727;return x!==0?(u=x&~v,u!==0?p=Xi(u):(_&=x,_!==0?p=Xi(_):l||(l=x&~r,l!==0&&(p=Xi(l))))):(x=u&~v,x!==0?p=Xi(x):_!==0?p=Xi(_):l||(l=u&~r,l!==0&&(p=Xi(l)))),p===0?0:o!==0&&o!==p&&(o&v)===0&&(v=p&-p,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:p}function To(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function kf(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nn(){var r=Rr;return Rr<<=1,(Rr&62914560)===0&&(Rr=4194304),r}function Ii(r){for(var o=[],l=0;31>l;l++)o.push(r);return o}function Zn(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Lc(r,o,l,u,p,v){var _=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var x=r.entanglements,R=r.expirationTimes,F=r.hiddenUpdates;for(l=_&~l;0<l;){var Y=31-tn(l),J=1<<Y;x[Y]=0,R[Y]=-1;var j=F[Y];if(j!==null)for(F[Y]=null,Y=0;Y<j.length;Y++){var $=j[Y];$!==null&&($.lane&=-536870913)}l&=~J}u!==0&&Ic(r,u,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(_&~o))}function Ic(r,o,l){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-tn(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|l&261930}function Rc(r,o){var l=r.entangledLanes|=o;for(r=r.entanglements;l;){var u=31-tn(l),p=1<<u;p&o|r[u]&o&&(r[u]|=o),l&=~p}}function Dc(r,o){var l=o&-o;return l=(l&42)!==0?1:Ts(l),(l&(r.suspendedLanes|o))!==0?0:l}function Ts(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Qi(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ks(){var r=z.p;return r!==0?r:(r=window.event,r===void 0?32:by(r.type))}function As(r,o){var l=z.p;try{return z.p=r,o()}finally{z.p=l}}var Tn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Tn,Kt="__reactProps$"+Tn,rn="__reactContainer$"+Tn,Ls="__reactEvents$"+Tn,Be="__reactListeners$"+Tn,et="__reactHandles$"+Tn,Ri="__reactResources$"+Tn,Sn="__reactMarker$"+Tn;function Zi(r){delete r[Ct],delete r[Kt],delete r[Ls],delete r[Be],delete r[et]}function Dr(r){var o=r[Ct];if(o)return o;for(var l=r.parentNode;l;){if(o=l[rn]||l[Ct]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(r=iy(r);r!==null;){if(l=r[Ct])return l;r=iy(r)}return o}r=l,l=r.parentNode}return null}function Mr(r){if(r=r[Ct]||r[rn]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function mi(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(i(33))}function Ji(r){var o=r[Ri];return o||(o=r[Ri]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Pt(r){r[Sn]=!0}var Mc=new Set,It={};function Jn(r,o){Et(r,o),Et(r+"Capture",o)}function Et(r,o){for(It[r]=o,r=0;r<o.length;r++)Mc.add(o[r])}var Nn=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Or={},Is={};function er(r){return yn.call(Is,r)?!0:yn.call(Or,r)?!1:Nn.test(r)?Is[r]=!0:(Or[r]=!0,!1)}function gi(r,o,l){if(er(o))if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+l)}}function tr(r,o,l){if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+l)}}function Hn(r,o,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(o,l,""+u)}}function kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Rs(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ga(r,o,l){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return p.call(this)},set:function(_){l=""+_,v.call(this,_)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(_){l=""+_},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function va(r){if(!r._valueTracker){var o=Rs(r)?"checked":"value";r._valueTracker=ga(r,o,""+r[o])}}function nr(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var l=o.getValue(),u="";return r&&(u=Rs(r)?r.checked?"true":"false":r.value),r=u,r!==l?(o.setValue(r),!0):!1}function Pr(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var An=/[\n"\\]/g;function Yt(r){return r.replace(An,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function ya(r,o,l,u,p,v,_,x){r.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.type=_:r.removeAttribute("type"),o!=null?_==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+kn(o)):r.value!==""+kn(o)&&(r.value=""+kn(o)):_!=="submit"&&_!=="reset"||r.removeAttribute("value"),o!=null?Nr(r,_,kn(o)):l!=null?Nr(r,_,kn(l)):u!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?r.name=""+kn(x):r.removeAttribute("name")}function Oc(r,o,l,u,p,v,_,x){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){va(r);return}l=l!=null?""+kn(l):"",o=o!=null?""+kn(o):l,x||o===r.value||(r.value=o),r.defaultValue=o}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=x?r.checked:!!u,r.defaultChecked=!!u,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.name=_),va(r)}function Nr(r,o,l){o==="number"&&Pr(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Hr(r,o,l,u){if(r=r.options,o){o={};for(var p=0;p<l.length;p++)o["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=o.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&u&&(r[l].defaultSelected=!0)}else{for(l=""+kn(l),o=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,u&&(r[p].defaultSelected=!0);return}o!==null||r[p].disabled||(o=r[p])}o!==null&&(o.selected=!0)}}function Ds(r,o,l){if(o!=null&&(o=""+kn(o),o!==r.value&&(r.value=o),l==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=l!=null?""+kn(l):""}function Pc(r,o,l,u){if(o==null){if(u!=null){if(l!=null)throw Error(i(92));if(me(u)){if(1<u.length)throw Error(i(93));u=u[0]}l=u}l==null&&(l=""),o=l}l=kn(o),r.defaultValue=l,u=r.textContent,u===l&&u!==""&&u!==null&&(r.value=u),va(r)}function _n(r,o){if(o){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=o;return}}r.textContent=o}var ba=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zr(r,o,l){var u=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,l):typeof l!="number"||l===0||ba.has(o)?o==="float"?r.cssFloat=l:r[o]=(""+l).trim():r[o]=l+"px"}function Ms(r,o,l){if(o!=null&&typeof o!="object")throw Error(i(62));if(r=r.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var p in o)u=o[p],o.hasOwnProperty(p)&&l[p]!==u&&zr(r,p,u)}else for(var v in o)o.hasOwnProperty(v)&&zr(r,v,o[v])}function ir(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sa=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["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"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["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"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["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"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Os=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ko(r){return Os.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ei(){}var Ps=null;function Ns(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vr=null,rr=null;function Hs(r){var o=Mr(r);if(o&&(r=o.stateNode)){var l=r[Kt]||null;e:switch(r=o.stateNode,o.type){case"input":if(ya(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Yt(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var u=l[o];if(u!==r&&u.form===r.form){var p=u[Kt]||null;if(!p)throw Error(i(90));ya(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<l.length;o++)u=l[o],u.form===r.form&&nr(u)}break e;case"textarea":Ds(r,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Hr(r,!!l.multiple,o,!1)}}}var zs=!1;function Nc(r,o,l){if(zs)return r(o,l);zs=!0;try{var u=r(o);return u}finally{if(zs=!1,(Vr!==null||rr!==null)&&(Eu(),Vr&&(o=Vr,r=rr,rr=Vr=null,Hs(o),r)))for(o=0;o<r.length;o++)Hs(r[o])}}function Ao(r,o){var l=r.stateNode;if(l===null)return null;var u=l[Kt]||null;if(u===null)return null;l=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(i(231,o,typeof l));return l}var vi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vs=!1;if(vi)try{var zn={};Object.defineProperty(zn,"passive",{get:function(){Vs=!0}}),window.addEventListener("test",zn,zn),window.removeEventListener("test",zn,zn)}catch{Vs=!1}var yi=null,Bs=null,_a=null;function Hc(){if(_a)return _a;var r,o=Bs,l=o.length,u,p="value"in yi?yi.value:yi.textContent,v=p.length;for(r=0;r<l&&o[r]===p[r];r++);var _=l-r;for(u=1;u<=_&&o[l-u]===p[v-u];u++);return _a=p.slice(r,1<u?1-u:void 0)}function Ca(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Ea(){return!0}function Br(){return!1}function fn(r){function o(l,u,p,v,_){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=v,this.target=_,this.currentTarget=null;for(var x in r)r.hasOwnProperty(x)&&(l=r[x],this[x]=l?l(v):v[x]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ea:Br,this.isPropagationStopped=Br,this}return g(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ea)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ea)},persist:function(){},isPersistent:Ea}),o}var or={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wa=fn(or),Lo=g({},or,{view:0,detail:0}),Ur=fn(Lo),xa,ti,Io,Di=g({},Lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$s,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Io&&(Io&&r.type==="mousemove"?(xa=r.screenX-Io.screenX,ti=r.screenY-Io.screenY):ti=xa=0,Io=r),xa)},movementY:function(r){return"movementY"in r?r.movementY:ti}}),Us=fn(Di),Af=g({},Di,{dataTransfer:0}),Lf=fn(Af),If=g({},Lo,{relatedTarget:0}),Fs=fn(If),Ro=g({},or,{animationName:0,elapsedTime:0,pseudoElement:0}),js=fn(Ro),Rf=g({},or,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Ta=fn(Rf),zc=g({},or,{data:0}),Vc=fn(zc),Df={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Of={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ka(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Of[r])?!!o[r]:!1}function $s(){return ka}var I=g({},Lo,{key:function(r){if(r.key){var o=Df[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Ca(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Mf[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$s,charCode:function(r){return r.type==="keypress"?Ca(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ca(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Z=fn(I),Ee=g({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ue=fn(Ee),fe=g({},Lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$s}),Ae=fn(fe),ct=g({},or,{propertyName:0,elapsedTime:0,pseudoElement:0}),ke=fn(ct),Je=g({},Di,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),rt=fn(Je),tt=g({},or,{newState:0,oldState:0}),ht=fn(tt),Xt=[9,13,27,32],Cn=vi&&"CompositionEvent"in window,pt=null;vi&&"documentMode"in document&&(pt=document.documentMode);var Xe=vi&&"TextEvent"in window&&!pt,mt=vi&&(!Cn||pt&&8<pt&&11>=pt),Qt=" ",Do=!1;function Mo(r,o){switch(r){case"keyup":return Xt.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vt(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var on=!1;function Aa(r,o){switch(r){case"compositionend":return vt(o);case"keypress":return o.which!==32?null:(Do=!0,Qt);case"textInput":return r=o.data,r===Qt&&Do?null:r;default:return null}}function qs(r,o){if(on)return r==="compositionend"||!Cn&&Mo(r,o)?(r=Hc(),_a=Bs=yi=null,on=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return mt&&o.locale!=="ko"?null:o.data;default:return null}}var Bc={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Uc(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!Bc[r.type]:o==="textarea"}function s0(r,o,l,u){Vr?rr?rr.push(u):rr=[u]:Vr=u,o=Iu(o,"onChange"),0<o.length&&(l=new wa("onChange","change",null,l,u),r.push({event:l,listeners:o}))}var Gs=null,Ws=null;function M5(r){jv(r,0)}function Fc(r){var o=mi(r);if(nr(o))return r}function l0(r,o){if(r==="change")return o}var c0=!1;if(vi){var Pf;if(vi){var Nf="oninput"in document;if(!Nf){var u0=document.createElement("div");u0.setAttribute("oninput","return;"),Nf=typeof u0.oninput=="function"}Pf=Nf}else Pf=!1;c0=Pf&&(!document.documentMode||9<document.documentMode)}function d0(){Gs&&(Gs.detachEvent("onpropertychange",f0),Ws=Gs=null)}function f0(r){if(r.propertyName==="value"&&Fc(Ws)){var o=[];s0(o,Ws,r,Ns(r)),Nc(M5,o)}}function O5(r,o,l){r==="focusin"?(d0(),Gs=o,Ws=l,Gs.attachEvent("onpropertychange",f0)):r==="focusout"&&d0()}function P5(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Fc(Ws)}function N5(r,o){if(r==="click")return Fc(o)}function H5(r,o){if(r==="input"||r==="change")return Fc(o)}function z5(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Vn=typeof Object.is=="function"?Object.is:z5;function Ks(r,o){if(Vn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var l=Object.keys(r),u=Object.keys(o);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!yn.call(o,p)||!Vn(r[p],o[p]))return!1}return!0}function h0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function p0(r,o){var l=h0(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=o&&u>=o)return{node:l,offset:o-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=h0(l)}}function m0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?m0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function g0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=Pr(r.document);o instanceof r.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)r=o.contentWindow;else break;o=Pr(r.document)}return o}function Hf(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var V5=vi&&"documentMode"in document&&11>=document.documentMode,La=null,zf=null,Ys=null,Vf=!1;function v0(r,o,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vf||La==null||La!==Pr(u)||(u=La,"selectionStart"in u&&Hf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Ys&&Ks(Ys,u)||(Ys=u,u=Iu(zf,"onSelect"),0<u.length&&(o=new wa("onSelect","select",null,o,l),r.push({event:o,listeners:u}),o.target=La)))}function Oo(r,o){var l={};return l[r.toLowerCase()]=o.toLowerCase(),l["Webkit"+r]="webkit"+o,l["Moz"+r]="moz"+o,l}var Ia={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},Bf={},y0={};vi&&(y0=document.createElement("div").style,"AnimationEvent"in window||(delete Ia.animationend.animation,delete Ia.animationiteration.animation,delete Ia.animationstart.animation),"TransitionEvent"in window||delete Ia.transitionend.transition);function Po(r){if(Bf[r])return Bf[r];if(!Ia[r])return r;var o=Ia[r],l;for(l in o)if(o.hasOwnProperty(l)&&l in y0)return Bf[r]=o[l];return r}var b0=Po("animationend"),S0=Po("animationiteration"),_0=Po("animationstart"),B5=Po("transitionrun"),U5=Po("transitionstart"),F5=Po("transitioncancel"),C0=Po("transitionend"),E0=new Map,Uf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Uf.push("scrollEnd");function bi(r,o){E0.set(r,o),Jn(o,[r])}var jc=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ni=[],Ra=0,Ff=0;function $c(){for(var r=Ra,o=Ff=Ra=0;o<r;){var l=ni[o];ni[o++]=null;var u=ni[o];ni[o++]=null;var p=ni[o];ni[o++]=null;var v=ni[o];if(ni[o++]=null,u!==null&&p!==null){var _=u.pending;_===null?p.next=p:(p.next=_.next,_.next=p),u.pending=p}v!==0&&w0(l,p,v)}}function qc(r,o,l,u){ni[Ra++]=r,ni[Ra++]=o,ni[Ra++]=l,ni[Ra++]=u,Ff|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function jf(r,o,l,u){return qc(r,o,l,u),Gc(r)}function No(r,o){return qc(r,null,null,o),Gc(r)}function w0(r,o,l){r.lanes|=l;var u=r.alternate;u!==null&&(u.lanes|=l);for(var p=!1,v=r.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&o!==null&&(p=31-tn(l),r=v.hiddenUpdates,u=r[p],u===null?r[p]=[o]:u.push(o),o.lane=l|536870912),v):null}function Gc(r){if(50<vl)throw vl=0,Zh=null,Error(i(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Da={};function j5(r,o,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(r,o,l,u){return new j5(r,o,l,u)}function $f(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ar(r,o){var l=r.alternate;return l===null?(l=Bn(r.tag,o,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=o,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,o=r.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function x0(r,o){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,o=l.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Wc(r,o,l,u,p,v){var _=0;if(u=r,typeof r=="function")$f(r)&&(_=1);else if(typeof r=="string")_=Kw(r,l,ae.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case G:return r=Bn(31,l,o,p),r.elementType=G,r.lanes=v,r;case w:return Ho(l.children,p,v,o);case A:_=8,p|=24;break;case k:return r=Bn(12,l,o,p|2),r.elementType=k,r.lanes=v,r;case O:return r=Bn(13,l,o,p),r.elementType=O,r.lanes=v,r;case D:return r=Bn(19,l,o,p),r.elementType=D,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case T:_=10;break e;case E:_=9;break e;case L:_=11;break e;case N:_=14;break e;case K:_=16,u=null;break e}_=29,l=Error(i(130,r===null?"null":typeof r,"")),u=null}return o=Bn(_,l,o,p),o.elementType=r,o.type=u,o.lanes=v,o}function Ho(r,o,l,u){return r=Bn(7,r,u,o),r.lanes=l,r}function qf(r,o,l){return r=Bn(6,r,null,o),r.lanes=l,r}function T0(r){var o=Bn(18,null,null,0);return o.stateNode=r,o}function Gf(r,o,l){return o=Bn(4,r.children!==null?r.children:[],r.key,o),o.lanes=l,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var k0=new WeakMap;function ii(r,o){if(typeof r=="object"&&r!==null){var l=k0.get(r);return l!==void 0?l:(o={value:r,source:o,stack:vn(o)},k0.set(r,o),o)}return{value:r,source:o,stack:vn(o)}}var Ma=[],Oa=0,Kc=null,Xs=0,ri=[],oi=0,Fr=null,Mi=1,Oi="";function sr(r,o){Ma[Oa++]=Xs,Ma[Oa++]=Kc,Kc=r,Xs=o}function A0(r,o,l){ri[oi++]=Mi,ri[oi++]=Oi,ri[oi++]=Fr,Fr=r;var u=Mi;r=Oi;var p=32-tn(u)-1;u&=~(1<<p),l+=1;var v=32-tn(o)+p;if(30<v){var _=p-p%5;v=(u&(1<<_)-1).toString(32),u>>=_,p-=_,Mi=1<<32-tn(o)+p|l<<p|u,Oi=v+r}else Mi=1<<v|l<<p|u,Oi=r}function Wf(r){r.return!==null&&(sr(r,1),A0(r,1,0))}function Kf(r){for(;r===Kc;)Kc=Ma[--Oa],Ma[Oa]=null,Xs=Ma[--Oa],Ma[Oa]=null;for(;r===Fr;)Fr=ri[--oi],ri[oi]=null,Oi=ri[--oi],ri[oi]=null,Mi=ri[--oi],ri[oi]=null}function L0(r,o){ri[oi++]=Mi,ri[oi++]=Oi,ri[oi++]=Fr,Mi=o.id,Oi=o.overflow,Fr=r}var an=null,yt=null,Ge=!1,jr=null,ai=!1,Yf=Error(i(519));function $r(r){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qs(ii(o,r)),Yf}function I0(r){var o=r.stateNode,l=r.type,u=r.memoizedProps;switch(o[Ct]=r,o[Kt]=u,l){case"dialog":je("cancel",o),je("close",o);break;case"iframe":case"object":case"embed":je("load",o);break;case"video":case"audio":for(l=0;l<bl.length;l++)je(bl[l],o);break;case"source":je("error",o);break;case"img":case"image":case"link":je("error",o),je("load",o);break;case"details":je("toggle",o);break;case"input":je("invalid",o),Oc(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":je("invalid",o);break;case"textarea":je("invalid",o),Pc(o,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||u.suppressHydrationWarning===!0||Wv(o.textContent,l)?(u.popover!=null&&(je("beforetoggle",o),je("toggle",o)),u.onScroll!=null&&je("scroll",o),u.onScrollEnd!=null&&je("scrollend",o),u.onClick!=null&&(o.onclick=ei),o=!0):o=!1,o||$r(r,!0)}function R0(r){for(an=r.return;an;)switch(an.tag){case 5:case 31:case 13:ai=!1;return;case 27:case 3:ai=!0;return;default:an=an.return}}function Pa(r){if(r!==an)return!1;if(!Ge)return R0(r),Ge=!0,!1;var o=r.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||hp(r.type,r.memoizedProps)),l=!l),l&&yt&&$r(r),R0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));yt=ny(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));yt=ny(r)}else o===27?(o=yt,ro(r.type)?(r=yp,yp=null,yt=r):yt=o):yt=an?li(r.stateNode.nextSibling):null;return!0}function zo(){yt=an=null,Ge=!1}function Xf(){var r=jr;return r!==null&&(Dn===null?Dn=r:Dn.push.apply(Dn,r),jr=null),r}function Qs(r){jr===null?jr=[r]:jr.push(r)}var Qf=M(null),Vo=null,lr=null;function qr(r,o,l){re(Qf,o._currentValue),o._currentValue=l}function cr(r){r._currentValue=Qf.current,q(Qf)}function Zf(r,o,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===l)break;r=r.return}}function Jf(r,o,l,u){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var _=p.child;v=v.firstContext;e:for(;v!==null;){var x=v;v=p;for(var R=0;R<o.length;R++)if(x.context===o[R]){v.lanes|=l,x=v.alternate,x!==null&&(x.lanes|=l),Zf(v.return,l,r),u||(_=null);break e}v=x.next}}else if(p.tag===18){if(_=p.return,_===null)throw Error(i(341));_.lanes|=l,v=_.alternate,v!==null&&(v.lanes|=l),Zf(_,l,r),_=null}else _=p.child;if(_!==null)_.return=p;else for(_=p;_!==null;){if(_===r){_=null;break}if(p=_.sibling,p!==null){p.return=_.return,_=p;break}_=_.return}p=_}}function Na(r,o,l,u){r=null;for(var p=o,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var _=p.alternate;if(_===null)throw Error(i(387));if(_=_.memoizedProps,_!==null){var x=p.type;Vn(p.pendingProps.value,_.value)||(r!==null?r.push(x):r=[x])}}else if(p===be.current){if(_=p.alternate,_===null)throw Error(i(387));_.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(wl):r=[wl])}p=p.return}r!==null&&Jf(o,r,l,u),o.flags|=262144}function Yc(r){for(r=r.firstContext;r!==null;){if(!Vn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Bo(r){Vo=r,lr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function sn(r){return D0(Vo,r)}function Xc(r,o){return Vo===null&&Bo(r),D0(r,o)}function D0(r,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},lr===null){if(r===null)throw Error(i(308));lr=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else lr=lr.next=o;return l}var $5=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(l,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(l){return l()})}},q5=e.unstable_scheduleCallback,G5=e.unstable_NormalPriority,Nt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eh(){return{controller:new $5,data:new Map,refCount:0}}function Zs(r){r.refCount--,r.refCount===0&&q5(G5,function(){r.controller.abort()})}var Js=null,th=0,Ha=0,za=null;function W5(r,o){if(Js===null){var l=Js=[];th=0,Ha=rp(),za={status:"pending",value:void 0,then:function(u){l.push(u)}}}return th++,o.then(M0,M0),o}function M0(){if(--th===0&&Js!==null){za!==null&&(za.status="fulfilled");var r=Js;Js=null,Ha=0,za=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function K5(r,o){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var p=0;p<l.length;p++)(0,l[p])(o)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var O0=H.S;H.S=function(r,o){vv=bn(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&W5(r,o),O0!==null&&O0(r,o)};var Uo=M(null);function nh(){var r=Uo.current;return r!==null?r:ut.pooledCache}function Qc(r,o){o===null?re(Uo,Uo.current):re(Uo,o.pool)}function P0(){var r=nh();return r===null?null:{parent:Nt._currentValue,pool:r}}var Va=Error(i(460)),ih=Error(i(474)),Zc=Error(i(542)),Jc={then:function(){}};function N0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function H0(r,o,l){switch(l=r[l],l===void 0?r.push(o):l!==o&&(o.then(ei,ei),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,V0(r),r;default:if(typeof o.status=="string")o.then(ei,ei);else{if(r=ut,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=u}},function(u){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,V0(r),r}throw jo=o,Va}}function Fo(r){try{var o=r._init;return o(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(jo=l,Va):l}}var jo=null;function z0(){if(jo===null)throw Error(i(459));var r=jo;return jo=null,r}function V0(r){if(r===Va||r===Zc)throw Error(i(483))}var Ba=null,el=0;function eu(r){var o=el;return el+=1,Ba===null&&(Ba=[]),H0(Ba,r,o)}function tl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function tu(r,o){throw o.$$typeof===y?Error(i(525)):(r=Object.prototype.toString.call(o),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function B0(r){function o(V,P){if(r){var B=V.deletions;B===null?(V.deletions=[P],V.flags|=16):B.push(P)}}function l(V,P){if(!r)return null;for(;P!==null;)o(V,P),P=P.sibling;return null}function u(V){for(var P=new Map;V!==null;)V.key!==null?P.set(V.key,V):P.set(V.index,V),V=V.sibling;return P}function p(V,P){return V=ar(V,P),V.index=0,V.sibling=null,V}function v(V,P,B){return V.index=B,r?(B=V.alternate,B!==null?(B=B.index,B<P?(V.flags|=67108866,P):B):(V.flags|=67108866,P)):(V.flags|=1048576,P)}function _(V){return r&&V.alternate===null&&(V.flags|=67108866),V}function x(V,P,B,X){return P===null||P.tag!==6?(P=qf(B,V.mode,X),P.return=V,P):(P=p(P,B),P.return=V,P)}function R(V,P,B,X){var xe=B.type;return xe===w?Y(V,P,B.props.children,X,B.key):P!==null&&(P.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===K&&Fo(xe)===P.type)?(P=p(P,B.props),tl(P,B),P.return=V,P):(P=Wc(B.type,B.key,B.props,null,V.mode,X),tl(P,B),P.return=V,P)}function F(V,P,B,X){return P===null||P.tag!==4||P.stateNode.containerInfo!==B.containerInfo||P.stateNode.implementation!==B.implementation?(P=Gf(B,V.mode,X),P.return=V,P):(P=p(P,B.children||[]),P.return=V,P)}function Y(V,P,B,X,xe){return P===null||P.tag!==7?(P=Ho(B,V.mode,X,xe),P.return=V,P):(P=p(P,B),P.return=V,P)}function J(V,P,B){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=qf(""+P,V.mode,B),P.return=V,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return B=Wc(P.type,P.key,P.props,null,V.mode,B),tl(B,P),B.return=V,B;case S:return P=Gf(P,V.mode,B),P.return=V,P;case K:return P=Fo(P),J(V,P,B)}if(me(P)||ee(P))return P=Ho(P,V.mode,B,null),P.return=V,P;if(typeof P.then=="function")return J(V,eu(P),B);if(P.$$typeof===T)return J(V,Xc(V,P),B);tu(V,P)}return null}function j(V,P,B,X){var xe=P!==null?P.key:null;if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return xe!==null?null:x(V,P,""+B,X);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case b:return B.key===xe?R(V,P,B,X):null;case S:return B.key===xe?F(V,P,B,X):null;case K:return B=Fo(B),j(V,P,B,X)}if(me(B)||ee(B))return xe!==null?null:Y(V,P,B,X,null);if(typeof B.then=="function")return j(V,P,eu(B),X);if(B.$$typeof===T)return j(V,P,Xc(V,B),X);tu(V,B)}return null}function $(V,P,B,X,xe){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return V=V.get(B)||null,x(P,V,""+X,xe);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return V=V.get(X.key===null?B:X.key)||null,R(P,V,X,xe);case S:return V=V.get(X.key===null?B:X.key)||null,F(P,V,X,xe);case K:return X=Fo(X),$(V,P,B,X,xe)}if(me(X)||ee(X))return V=V.get(B)||null,Y(P,V,X,xe,null);if(typeof X.then=="function")return $(V,P,B,eu(X),xe);if(X.$$typeof===T)return $(V,P,B,Xc(P,X),xe);tu(P,X)}return null}function ge(V,P,B,X){for(var xe=null,Ke=null,ye=P,ze=P=0,qe=null;ye!==null&&ze<B.length;ze++){ye.index>ze?(qe=ye,ye=null):qe=ye.sibling;var Ye=j(V,ye,B[ze],X);if(Ye===null){ye===null&&(ye=qe);break}r&&ye&&Ye.alternate===null&&o(V,ye),P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye,ye=qe}if(ze===B.length)return l(V,ye),Ge&&sr(V,ze),xe;if(ye===null){for(;ze<B.length;ze++)ye=J(V,B[ze],X),ye!==null&&(P=v(ye,P,ze),Ke===null?xe=ye:Ke.sibling=ye,Ke=ye);return Ge&&sr(V,ze),xe}for(ye=u(ye);ze<B.length;ze++)qe=$(ye,V,ze,B[ze],X),qe!==null&&(r&&qe.alternate!==null&&ye.delete(qe.key===null?ze:qe.key),P=v(qe,P,ze),Ke===null?xe=qe:Ke.sibling=qe,Ke=qe);return r&&ye.forEach(function(co){return o(V,co)}),Ge&&sr(V,ze),xe}function Ie(V,P,B,X){if(B==null)throw Error(i(151));for(var xe=null,Ke=null,ye=P,ze=P=0,qe=null,Ye=B.next();ye!==null&&!Ye.done;ze++,Ye=B.next()){ye.index>ze?(qe=ye,ye=null):qe=ye.sibling;var co=j(V,ye,Ye.value,X);if(co===null){ye===null&&(ye=qe);break}r&&ye&&co.alternate===null&&o(V,ye),P=v(co,P,ze),Ke===null?xe=co:Ke.sibling=co,Ke=co,ye=qe}if(Ye.done)return l(V,ye),Ge&&sr(V,ze),xe;if(ye===null){for(;!Ye.done;ze++,Ye=B.next())Ye=J(V,Ye.value,X),Ye!==null&&(P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye);return Ge&&sr(V,ze),xe}for(ye=u(ye);!Ye.done;ze++,Ye=B.next())Ye=$(ye,V,ze,Ye.value,X),Ye!==null&&(r&&Ye.alternate!==null&&ye.delete(Ye.key===null?ze:Ye.key),P=v(Ye,P,ze),Ke===null?xe=Ye:Ke.sibling=Ye,Ke=Ye);return r&&ye.forEach(function(ox){return o(V,ox)}),Ge&&sr(V,ze),xe}function st(V,P,B,X){if(typeof B=="object"&&B!==null&&B.type===w&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case b:e:{for(var xe=B.key;P!==null;){if(P.key===xe){if(xe=B.type,xe===w){if(P.tag===7){l(V,P.sibling),X=p(P,B.props.children),X.return=V,V=X;break e}}else if(P.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===K&&Fo(xe)===P.type){l(V,P.sibling),X=p(P,B.props),tl(X,B),X.return=V,V=X;break e}l(V,P);break}else o(V,P);P=P.sibling}B.type===w?(X=Ho(B.props.children,V.mode,X,B.key),X.return=V,V=X):(X=Wc(B.type,B.key,B.props,null,V.mode,X),tl(X,B),X.return=V,V=X)}return _(V);case S:e:{for(xe=B.key;P!==null;){if(P.key===xe)if(P.tag===4&&P.stateNode.containerInfo===B.containerInfo&&P.stateNode.implementation===B.implementation){l(V,P.sibling),X=p(P,B.children||[]),X.return=V,V=X;break e}else{l(V,P);break}else o(V,P);P=P.sibling}X=Gf(B,V.mode,X),X.return=V,V=X}return _(V);case K:return B=Fo(B),st(V,P,B,X)}if(me(B))return ge(V,P,B,X);if(ee(B)){if(xe=ee(B),typeof xe!="function")throw Error(i(150));return B=xe.call(B),Ie(V,P,B,X)}if(typeof B.then=="function")return st(V,P,eu(B),X);if(B.$$typeof===T)return st(V,P,Xc(V,B),X);tu(V,B)}return typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint"?(B=""+B,P!==null&&P.tag===6?(l(V,P.sibling),X=p(P,B),X.return=V,V=X):(l(V,P),X=qf(B,V.mode,X),X.return=V,V=X),_(V)):l(V,P)}return function(V,P,B,X){try{el=0;var xe=st(V,P,B,X);return Ba=null,xe}catch(ye){if(ye===Va||ye===Zc)throw ye;var Ke=Bn(29,ye,null,V.mode);return Ke.lanes=X,Ke.return=V,Ke}finally{}}}var $o=B0(!0),U0=B0(!1),Gr=!1;function rh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function oh(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Wr(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Kr(r,o,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(Qe&2)!==0){var p=u.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),u.pending=o,o=Gc(r),w0(r,null,l),o}return qc(r,u,o,l),Gc(r)}function nl(r,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,Rc(r,l)}}function ah(r,o){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var _={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?p=v=_:v=v.next=_,l=l.next}while(l!==null);v===null?p=v=o:v=v.next=o}else p=v=o;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=o:r.next=o,l.lastBaseUpdate=o}var sh=!1;function il(){if(sh){var r=za;if(r!==null)throw r}}function rl(r,o,l,u){sh=!1;var p=r.updateQueue;Gr=!1;var v=p.firstBaseUpdate,_=p.lastBaseUpdate,x=p.shared.pending;if(x!==null){p.shared.pending=null;var R=x,F=R.next;R.next=null,_===null?v=F:_.next=F,_=R;var Y=r.alternate;Y!==null&&(Y=Y.updateQueue,x=Y.lastBaseUpdate,x!==_&&(x===null?Y.firstBaseUpdate=F:x.next=F,Y.lastBaseUpdate=R))}if(v!==null){var J=p.baseState;_=0,Y=F=R=null,x=v;do{var j=x.lane&-536870913,$=j!==x.lane;if($?($e&j)===j:(u&j)===j){j!==0&&j===Ha&&(sh=!0),Y!==null&&(Y=Y.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var ge=r,Ie=x;j=o;var st=l;switch(Ie.tag){case 1:if(ge=Ie.payload,typeof ge=="function"){J=ge.call(st,J,j);break e}J=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ie.payload,j=typeof ge=="function"?ge.call(st,J,j):ge,j==null)break e;J=g({},J,j);break e;case 2:Gr=!0}}j=x.callback,j!==null&&(r.flags|=64,$&&(r.flags|=8192),$=p.callbacks,$===null?p.callbacks=[j]:$.push(j))}else $={lane:j,tag:x.tag,payload:x.payload,callback:x.callback,next:null},Y===null?(F=Y=$,R=J):Y=Y.next=$,_|=j;if(x=x.next,x===null){if(x=p.shared.pending,x===null)break;$=x,x=$.next,$.next=null,p.lastBaseUpdate=$,p.shared.pending=null}}while(!0);Y===null&&(R=J),p.baseState=R,p.firstBaseUpdate=F,p.lastBaseUpdate=Y,v===null&&(p.shared.lanes=0),Jr|=_,r.lanes=_,r.memoizedState=J}}function F0(r,o){if(typeof r!="function")throw Error(i(191,r));r.call(o)}function j0(r,o){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)F0(l[r],o)}var Ua=M(null),nu=M(0);function $0(r,o){r=yr,re(nu,r),re(Ua,o),yr=r|o.baseLanes}function lh(){re(nu,yr),re(Ua,Ua.current)}function ch(){yr=nu.current,q(Ua),q(nu)}var Un=M(null),si=null;function Yr(r){var o=r.alternate;re(Rt,Rt.current&1),re(Un,r),si===null&&(o===null||Ua.current!==null||o.memoizedState!==null)&&(si=r)}function uh(r){re(Rt,Rt.current),re(Un,r),si===null&&(si=r)}function q0(r){r.tag===22?(re(Rt,Rt.current),re(Un,r),si===null&&(si=r)):Xr()}function Xr(){re(Rt,Rt.current),re(Un,Un.current)}function Fn(r){q(Un),si===r&&(si=null),q(Rt)}var Rt=M(0);function iu(r){for(var o=r;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gp(l)||vp(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var ur=0,Pe=null,ot=null,Ht=null,ru=!1,Fa=!1,qo=!1,ou=0,ol=0,ja=null,Y5=0;function kt(){throw Error(i(321))}function dh(r,o){if(o===null)return!1;for(var l=0;l<o.length&&l<r.length;l++)if(!Vn(r[l],o[l]))return!1;return!0}function fh(r,o,l,u,p,v){return ur=v,Pe=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,H.H=r===null||r.memoizedState===null?A1:kh,qo=!1,v=l(u,p),qo=!1,Fa&&(v=W0(o,l,u,p)),G0(r),v}function G0(r){H.H=ll;var o=ot!==null&&ot.next!==null;if(ur=0,Ht=ot=Pe=null,ru=!1,ol=0,ja=null,o)throw Error(i(300));r===null||zt||(r=r.dependencies,r!==null&&Yc(r)&&(zt=!0))}function W0(r,o,l,u){Pe=r;var p=0;do{if(Fa&&(ja=null),ol=0,Fa=!1,25<=p)throw Error(i(301));if(p+=1,Ht=ot=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}H.H=L1,v=o(l,u)}while(Fa);return v}function X5(){var r=H.H,o=r.useState()[0];return o=typeof o.then=="function"?al(o):o,r=r.useState()[0],(ot!==null?ot.memoizedState:null)!==r&&(Pe.flags|=1024),o}function hh(){var r=ou!==0;return ou=0,r}function ph(r,o,l){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~l}function mh(r){if(ru){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}ru=!1}ur=0,Ht=ot=Pe=null,Fa=!1,ol=ou=0,ja=null}function En(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?Pe.memoizedState=Ht=r:Ht=Ht.next=r,Ht}function Dt(){if(ot===null){var r=Pe.alternate;r=r!==null?r.memoizedState:null}else r=ot.next;var o=Ht===null?Pe.memoizedState:Ht.next;if(o!==null)Ht=o,ot=r;else{if(r===null)throw Pe.alternate===null?Error(i(467)):Error(i(310));ot=r,r={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ht===null?Pe.memoizedState=Ht=r:Ht=Ht.next=r}return Ht}function au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function al(r){var o=ol;return ol+=1,ja===null&&(ja=[]),r=H0(ja,r,o),o=Pe,(Ht===null?o.memoizedState:Ht.next)===null&&(o=o.alternate,H.H=o===null||o.memoizedState===null?A1:kh),r}function su(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return al(r);if(r.$$typeof===T)return sn(r)}throw Error(i(438,String(r)))}function gh(r){var o=null,l=Pe.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var u=Pe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=au(),Pe.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(r),u=0;u<r;u++)l[u]=se;return o.index++,l}function dr(r,o){return typeof o=="function"?o(r):o}function lu(r){var o=Dt();return vh(o,ot,r)}function vh(r,o,l){var u=r.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=l;var p=r.baseQueue,v=u.pending;if(v!==null){if(p!==null){var _=p.next;p.next=v.next,v.next=_}o.baseQueue=p=v,u.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{o=p.next;var x=_=null,R=null,F=o,Y=!1;do{var J=F.lane&-536870913;if(J!==F.lane?($e&J)===J:(ur&J)===J){var j=F.revertLane;if(j===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),J===Ha&&(Y=!0);else if((ur&j)===j){F=F.next,j===Ha&&(Y=!0);continue}else J={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(x=R=J,_=v):R=R.next=J,Pe.lanes|=j,Jr|=j;J=F.action,qo&&l(v,J),v=F.hasEagerState?F.eagerState:l(v,J)}else j={lane:J,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},R===null?(x=R=j,_=v):R=R.next=j,Pe.lanes|=J,Jr|=J;F=F.next}while(F!==null&&F!==o);if(R===null?_=v:R.next=x,!Vn(v,r.memoizedState)&&(zt=!0,Y&&(l=za,l!==null)))throw l;r.memoizedState=v,r.baseState=_,r.baseQueue=R,u.lastRenderedState=v}return p===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function yh(r){var o=Dt(),l=o.queue;if(l===null)throw Error(i(311));l.lastRenderedReducer=r;var u=l.dispatch,p=l.pending,v=o.memoizedState;if(p!==null){l.pending=null;var _=p=p.next;do v=r(v,_.action),_=_.next;while(_!==p);Vn(v,o.memoizedState)||(zt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,u]}function K0(r,o,l){var u=Pe,p=Dt(),v=Ge;if(v){if(l===void 0)throw Error(i(407));l=l()}else l=o();var _=!Vn((ot||p).memoizedState,l);if(_&&(p.memoizedState=l,zt=!0),p=p.queue,_h(Q0.bind(null,u,p,r),[r]),p.getSnapshot!==o||_||Ht!==null&&Ht.memoizedState.tag&1){if(u.flags|=2048,$a(9,{destroy:void 0},X0.bind(null,u,p,l,o),null),ut===null)throw Error(i(349));v||(ur&127)!==0||Y0(u,o,l)}return l}function Y0(r,o,l){r.flags|=16384,r={getSnapshot:o,value:l},o=Pe.updateQueue,o===null?(o=au(),Pe.updateQueue=o,o.stores=[r]):(l=o.stores,l===null?o.stores=[r]:l.push(r))}function X0(r,o,l,u){o.value=l,o.getSnapshot=u,Z0(o)&&J0(r)}function Q0(r,o,l){return l(function(){Z0(o)&&J0(r)})}function Z0(r){var o=r.getSnapshot;r=r.value;try{var l=o();return!Vn(r,l)}catch{return!0}}function J0(r){var o=No(r,2);o!==null&&Mn(o,r,2)}function bh(r){var o=En();if(typeof r=="function"){var l=r;if(r=l(),qo){Li(!0);try{l()}finally{Li(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:r},o}function e1(r,o,l,u){return r.baseState=l,vh(r,ot,typeof u=="function"?u:dr)}function Q5(r,o,l,u,p){if(du(r))throw Error(i(485));if(r=o.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){v.listeners.push(_)}};H.T!==null?l(!0):v.isTransition=!1,u(v),l=o.pending,l===null?(v.next=o.pending=v,t1(o,v)):(v.next=l.next,o.pending=l.next=v)}}function t1(r,o){var l=o.action,u=o.payload,p=r.state;if(o.isTransition){var v=H.T,_={};H.T=_;try{var x=l(p,u),R=H.S;R!==null&&R(_,x),n1(r,o,x)}catch(F){Sh(r,o,F)}finally{v!==null&&_.types!==null&&(v.types=_.types),H.T=v}}else try{v=l(p,u),n1(r,o,v)}catch(F){Sh(r,o,F)}}function n1(r,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){i1(r,o,u)},function(u){return Sh(r,o,u)}):i1(r,o,l)}function i1(r,o,l){o.status="fulfilled",o.value=l,r1(o),r.state=l,o=r.pending,o!==null&&(l=o.next,l===o?r.pending=null:(l=l.next,o.next=l,t1(r,l)))}function Sh(r,o,l){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=l,r1(o),o=o.next;while(o!==u)}r.action=null}function r1(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function o1(r,o){return o}function a1(r,o){if(Ge){var l=ut.formState;if(l!==null){e:{var u=Pe;if(Ge){if(yt){t:{for(var p=yt,v=ai;p.nodeType!==8;){if(!v){p=null;break t}if(p=li(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){yt=li(p.nextSibling),u=p.data==="F!";break e}}$r(u)}u=!1}u&&(o=l[0])}}return l=En(),l.memoizedState=l.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o1,lastRenderedState:o},l.queue=u,l=x1.bind(null,Pe,u),u.dispatch=l,u=bh(!1),v=Th.bind(null,Pe,!1,u.queue),u=En(),p={state:o,dispatch:null,action:r,pending:null},u.queue=p,l=Q5.bind(null,Pe,p,v,l),p.dispatch=l,u.memoizedState=r,[o,l,!1]}function s1(r){var o=Dt();return l1(o,ot,r)}function l1(r,o,l){if(o=vh(r,o,o1)[0],r=lu(dr)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=al(o)}catch(_){throw _===Va?Zc:_}else u=o;o=Dt();var p=o.queue,v=p.dispatch;return l!==o.memoizedState&&(Pe.flags|=2048,$a(9,{destroy:void 0},Z5.bind(null,p,l),null)),[u,v,r]}function Z5(r,o){r.action=o}function c1(r){var o=Dt(),l=ot;if(l!==null)return l1(o,l,r);Dt(),o=o.memoizedState,l=Dt();var u=l.queue.dispatch;return l.memoizedState=r,[o,u,!1]}function $a(r,o,l,u){return r={tag:r,create:l,deps:u,inst:o,next:null},o=Pe.updateQueue,o===null&&(o=au(),Pe.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,o.lastEffect=r),r}function u1(){return Dt().memoizedState}function cu(r,o,l,u){var p=En();Pe.flags|=r,p.memoizedState=$a(1|o,{destroy:void 0},l,u===void 0?null:u)}function uu(r,o,l,u){var p=Dt();u=u===void 0?null:u;var v=p.memoizedState.inst;ot!==null&&u!==null&&dh(u,ot.memoizedState.deps)?p.memoizedState=$a(o,v,l,u):(Pe.flags|=r,p.memoizedState=$a(1|o,v,l,u))}function d1(r,o){cu(8390656,8,r,o)}function _h(r,o){uu(2048,8,r,o)}function J5(r){Pe.flags|=4;var o=Pe.updateQueue;if(o===null)o=au(),Pe.updateQueue=o,o.events=[r];else{var l=o.events;l===null?o.events=[r]:l.push(r)}}function f1(r){var o=Dt().memoizedState;return J5({ref:o,nextImpl:r}),function(){if((Qe&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function h1(r,o){return uu(4,2,r,o)}function p1(r,o){return uu(4,4,r,o)}function m1(r,o){if(typeof o=="function"){r=r();var l=o(r);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function g1(r,o,l){l=l!=null?l.concat([r]):null,uu(4,4,m1.bind(null,o,r),l)}function Ch(){}function v1(r,o){var l=Dt();o=o===void 0?null:o;var u=l.memoizedState;return o!==null&&dh(o,u[1])?u[0]:(l.memoizedState=[r,o],r)}function y1(r,o){var l=Dt();o=o===void 0?null:o;var u=l.memoizedState;if(o!==null&&dh(o,u[1]))return u[0];if(u=r(),qo){Li(!0);try{r()}finally{Li(!1)}}return l.memoizedState=[u,o],u}function Eh(r,o,l){return l===void 0||(ur&1073741824)!==0&&($e&261930)===0?r.memoizedState=o:(r.memoizedState=l,r=bv(),Pe.lanes|=r,Jr|=r,l)}function b1(r,o,l,u){return Vn(l,o)?l:Ua.current!==null?(r=Eh(r,l,u),Vn(r,o)||(zt=!0),r):(ur&42)===0||(ur&1073741824)!==0&&($e&261930)===0?(zt=!0,r.memoizedState=l):(r=bv(),Pe.lanes|=r,Jr|=r,o)}function S1(r,o,l,u,p){var v=z.p;z.p=v!==0&&8>v?v:8;var _=H.T,x={};H.T=x,Th(r,!1,o,l);try{var R=p(),F=H.S;if(F!==null&&F(x,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var Y=K5(R,u);sl(r,o,Y,qn(r))}else sl(r,o,u,qn(r))}catch(J){sl(r,o,{then:function(){},status:"rejected",reason:J},qn())}finally{z.p=v,_!==null&&x.types!==null&&(_.types=x.types),H.T=_}}function ew(){}function wh(r,o,l,u){if(r.tag!==5)throw Error(i(476));var p=_1(r).queue;S1(r,p,o,Q,l===null?ew:function(){return C1(r),l(u)})}function _1(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:Q},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:l},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function C1(r){var o=_1(r);o.next===null&&(o=r.alternate.memoizedState),sl(r,o.next.queue,{},qn())}function xh(){return sn(wl)}function E1(){return Dt().memoizedState}function w1(){return Dt().memoizedState}function tw(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var l=qn();r=Wr(l);var u=Kr(o,r,l);u!==null&&(Mn(u,o,l),nl(u,o,l)),o={cache:eh()},r.payload=o;return}o=o.return}}function nw(r,o,l){var u=qn();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},du(r)?T1(o,l):(l=jf(r,o,l,u),l!==null&&(Mn(l,r,u),k1(l,o,u)))}function x1(r,o,l){var u=qn();sl(r,o,l,u)}function sl(r,o,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(du(r))T1(o,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var _=o.lastRenderedState,x=v(_,l);if(p.hasEagerState=!0,p.eagerState=x,Vn(x,_))return qc(r,o,p,0),ut===null&&$c(),!1}catch{}finally{}if(l=jf(r,o,p,u),l!==null)return Mn(l,r,u),k1(l,o,u),!0}return!1}function Th(r,o,l,u){if(u={lane:2,revertLane:rp(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},du(r)){if(o)throw Error(i(479))}else o=jf(r,l,u,2),o!==null&&Mn(o,r,2)}function du(r){var o=r.alternate;return r===Pe||o!==null&&o===Pe}function T1(r,o){Fa=ru=!0;var l=r.pending;l===null?o.next=o:(o.next=l.next,l.next=o),r.pending=o}function k1(r,o,l){if((l&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,Rc(r,l)}}var ll={readContext:sn,use:su,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};ll.useEffectEvent=kt;var A1={readContext:sn,use:su,useCallback:function(r,o){return En().memoizedState=[r,o===void 0?null:o],r},useContext:sn,useEffect:d1,useImperativeHandle:function(r,o,l){l=l!=null?l.concat([r]):null,cu(4194308,4,m1.bind(null,o,r),l)},useLayoutEffect:function(r,o){return cu(4194308,4,r,o)},useInsertionEffect:function(r,o){cu(4,2,r,o)},useMemo:function(r,o){var l=En();o=o===void 0?null:o;var u=r();if(qo){Li(!0);try{r()}finally{Li(!1)}}return l.memoizedState=[u,o],u},useReducer:function(r,o,l){var u=En();if(l!==void 0){var p=l(o);if(qo){Li(!0);try{l(o)}finally{Li(!1)}}}else p=o;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=nw.bind(null,Pe,r),[u.memoizedState,r]},useRef:function(r){var o=En();return r={current:r},o.memoizedState=r},useState:function(r){r=bh(r);var o=r.queue,l=x1.bind(null,Pe,o);return o.dispatch=l,[r.memoizedState,l]},useDebugValue:Ch,useDeferredValue:function(r,o){var l=En();return Eh(l,r,o)},useTransition:function(){var r=bh(!1);return r=S1.bind(null,Pe,r.queue,!0,!1),En().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,l){var u=Pe,p=En();if(Ge){if(l===void 0)throw Error(i(407));l=l()}else{if(l=o(),ut===null)throw Error(i(349));($e&127)!==0||Y0(u,o,l)}p.memoizedState=l;var v={value:l,getSnapshot:o};return p.queue=v,d1(Q0.bind(null,u,v,r),[r]),u.flags|=2048,$a(9,{destroy:void 0},X0.bind(null,u,v,l,o),null),l},useId:function(){var r=En(),o=ut.identifierPrefix;if(Ge){var l=Oi,u=Mi;l=(u&~(1<<32-tn(u)-1)).toString(32)+l,o="_"+o+"R_"+l,l=ou++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=Y5++,o="_"+o+"r_"+l.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:xh,useFormState:a1,useActionState:a1,useOptimistic:function(r){var o=En();o.memoizedState=o.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Th.bind(null,Pe,!0,l),l.dispatch=o,[r,o]},useMemoCache:gh,useCacheRefresh:function(){return En().memoizedState=tw.bind(null,Pe)},useEffectEvent:function(r){var o=En(),l={impl:r};return o.memoizedState=l,function(){if((Qe&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}},kh={readContext:sn,use:su,useCallback:v1,useContext:sn,useEffect:_h,useImperativeHandle:g1,useInsertionEffect:h1,useLayoutEffect:p1,useMemo:y1,useReducer:lu,useRef:u1,useState:function(){return lu(dr)},useDebugValue:Ch,useDeferredValue:function(r,o){var l=Dt();return b1(l,ot.memoizedState,r,o)},useTransition:function(){var r=lu(dr)[0],o=Dt().memoizedState;return[typeof r=="boolean"?r:al(r),o]},useSyncExternalStore:K0,useId:E1,useHostTransitionStatus:xh,useFormState:s1,useActionState:s1,useOptimistic:function(r,o){var l=Dt();return e1(l,ot,r,o)},useMemoCache:gh,useCacheRefresh:w1};kh.useEffectEvent=f1;var L1={readContext:sn,use:su,useCallback:v1,useContext:sn,useEffect:_h,useImperativeHandle:g1,useInsertionEffect:h1,useLayoutEffect:p1,useMemo:y1,useReducer:yh,useRef:u1,useState:function(){return yh(dr)},useDebugValue:Ch,useDeferredValue:function(r,o){var l=Dt();return ot===null?Eh(l,r,o):b1(l,ot.memoizedState,r,o)},useTransition:function(){var r=yh(dr)[0],o=Dt().memoizedState;return[typeof r=="boolean"?r:al(r),o]},useSyncExternalStore:K0,useId:E1,useHostTransitionStatus:xh,useFormState:c1,useActionState:c1,useOptimistic:function(r,o){var l=Dt();return ot!==null?e1(l,ot,r,o):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:gh,useCacheRefresh:w1};L1.useEffectEvent=f1;function Ah(r,o,l,u){o=r.memoizedState,l=l(u,o),l=l==null?o:g({},o,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Lh={enqueueSetState:function(r,o,l){r=r._reactInternals;var u=qn(),p=Wr(u);p.payload=o,l!=null&&(p.callback=l),o=Kr(r,p,u),o!==null&&(Mn(o,r,u),nl(o,r,u))},enqueueReplaceState:function(r,o,l){r=r._reactInternals;var u=qn(),p=Wr(u);p.tag=1,p.payload=o,l!=null&&(p.callback=l),o=Kr(r,p,u),o!==null&&(Mn(o,r,u),nl(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var l=qn(),u=Wr(l);u.tag=2,o!=null&&(u.callback=o),o=Kr(r,u,l),o!==null&&(Mn(o,r,l),nl(o,r,l))}};function I1(r,o,l,u,p,v,_){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,_):o.prototype&&o.prototype.isPureReactComponent?!Ks(l,u)||!Ks(p,v):!0}function R1(r,o,l,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,u),o.state!==r&&Lh.enqueueReplaceState(o,o.state,null)}function Go(r,o){var l=o;if("ref"in o){l={};for(var u in o)u!=="ref"&&(l[u]=o[u])}if(r=r.defaultProps){l===o&&(l=g({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}function D1(r){jc(r)}function M1(r){console.error(r)}function O1(r){jc(r)}function fu(r,o){try{var l=r.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function P1(r,o,l){try{var u=r.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ih(r,o,l){return l=Wr(l),l.tag=3,l.payload={element:null},l.callback=function(){fu(r,o)},l}function N1(r){return r=Wr(r),r.tag=3,r}function H1(r,o,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var v=u.value;r.payload=function(){return p(v)},r.callback=function(){P1(o,l,u)}}var _=l.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(r.callback=function(){P1(o,l,u),typeof p!="function"&&(eo===null?eo=new Set([this]):eo.add(this));var x=u.stack;this.componentDidCatch(u.value,{componentStack:x!==null?x:""})})}function iw(r,o,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=l.alternate,o!==null&&Na(o,l,p,!0),l=Un.current,l!==null){switch(l.tag){case 31:case 13:return si===null?wu():l.alternate===null&&At===0&&(At=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Jc?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([u]):o.add(u),tp(r,u,p)),!1;case 22:return l.flags|=65536,u===Jc?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([u]):l.add(u)),tp(r,u,p)),!1}throw Error(i(435,l.tag))}return tp(r,u,p),wu(),!1}if(Ge)return o=Un.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=p,u!==Yf&&(r=Error(i(422),{cause:u}),Qs(ii(r,l)))):(u!==Yf&&(o=Error(i(423),{cause:u}),Qs(ii(o,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,u=ii(u,l),p=Ih(r.stateNode,u,p),ah(r,p),At!==4&&(At=2)),!1;var v=Error(i(520),{cause:u});if(v=ii(v,l),gl===null?gl=[v]:gl.push(v),At!==4&&(At=2),o===null)return!0;u=ii(u,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Ih(l.stateNode,u,r),ah(l,r),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(eo===null||!eo.has(v))))return l.flags|=65536,p&=-p,l.lanes|=p,p=N1(p),H1(p,r,l,u),ah(l,p),!1}l=l.return}while(l!==null);return!1}var Rh=Error(i(461)),zt=!1;function ln(r,o,l,u){o.child=r===null?U0(o,null,l,u):$o(o,r.child,l,u)}function z1(r,o,l,u,p){l=l.render;var v=o.ref;if("ref"in u){var _={};for(var x in u)x!=="ref"&&(_[x]=u[x])}else _=u;return Bo(o),u=fh(r,o,l,_,v,p),x=hh(),r!==null&&!zt?(ph(r,o,p),fr(r,o,p)):(Ge&&x&&Wf(o),o.flags|=1,ln(r,o,u,p),o.child)}function V1(r,o,l,u,p){if(r===null){var v=l.type;return typeof v=="function"&&!$f(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,B1(r,o,v,u,p)):(r=Wc(l.type,null,u,o,o.mode,p),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Vh(r,p)){var _=v.memoizedProps;if(l=l.compare,l=l!==null?l:Ks,l(_,u)&&r.ref===o.ref)return fr(r,o,p)}return o.flags|=1,r=ar(v,u),r.ref=o.ref,r.return=o,o.child=r}function B1(r,o,l,u,p){if(r!==null){var v=r.memoizedProps;if(Ks(v,u)&&r.ref===o.ref)if(zt=!1,o.pendingProps=u=v,Vh(r,p))(r.flags&131072)!==0&&(zt=!0);else return o.lanes=r.lanes,fr(r,o,p)}return Dh(r,o,l,u,p)}function U1(r,o,l,u){var p=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(u=o.child=r.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~v}else u=0,o.child=null;return F1(r,o,v,l,u)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&Qc(o,v!==null?v.cachePool:null),v!==null?$0(o,v):lh(),q0(o);else return u=o.lanes=536870912,F1(r,o,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(Qc(o,v.cachePool),$0(o,v),Xr(),o.memoizedState=null):(r!==null&&Qc(o,null),lh(),Xr());return ln(r,o,p,l),o.child}function cl(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function F1(r,o,l,u,p){var v=nh();return v=v===null?null:{parent:Nt._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},r!==null&&Qc(o,null),lh(),q0(o),r!==null&&Na(r,o,u,!0),o.childLanes=p,null}function hu(r,o){return o=mu({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function j1(r,o,l){return $o(o,r.child,null,l),r=hu(o,o.pendingProps),r.flags|=2,Fn(o),o.memoizedState=null,r}function rw(r,o,l){var u=o.pendingProps,p=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Ge){if(u.mode==="hidden")return r=hu(o,u),o.lanes=536870912,cl(null,r);if(uh(o),(r=yt)?(r=ty(r,ai),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Fr!==null?{id:Mi,overflow:Oi}:null,retryLane:536870912,hydrationErrors:null},l=T0(r),l.return=o,o.child=l,an=o,yt=null)):r=null,r===null)throw $r(o);return o.lanes=536870912,null}return hu(o,u)}var v=r.memoizedState;if(v!==null){var _=v.dehydrated;if(uh(o),p)if(o.flags&256)o.flags&=-257,o=j1(r,o,l);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(i(558));else if(zt||Na(r,o,l,!1),p=(l&r.childLanes)!==0,zt||p){if(u=ut,u!==null&&(_=Dc(u,l),_!==0&&_!==v.retryLane))throw v.retryLane=_,No(r,_),Mn(u,r,_),Rh;wu(),o=j1(r,o,l)}else r=v.treeContext,yt=li(_.nextSibling),an=o,Ge=!0,jr=null,ai=!1,r!==null&&L0(o,r),o=hu(o,u),o.flags|=4096;return o}return r=ar(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function pu(r,o){var l=o.ref;if(l===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(i(284));(r===null||r.ref!==l)&&(o.flags|=4194816)}}function Dh(r,o,l,u,p){return Bo(o),l=fh(r,o,l,u,void 0,p),u=hh(),r!==null&&!zt?(ph(r,o,p),fr(r,o,p)):(Ge&&u&&Wf(o),o.flags|=1,ln(r,o,l,p),o.child)}function $1(r,o,l,u,p,v){return Bo(o),o.updateQueue=null,l=W0(o,u,l,p),G0(r),u=hh(),r!==null&&!zt?(ph(r,o,v),fr(r,o,v)):(Ge&&u&&Wf(o),o.flags|=1,ln(r,o,l,v),o.child)}function q1(r,o,l,u,p){if(Bo(o),o.stateNode===null){var v=Da,_=l.contextType;typeof _=="object"&&_!==null&&(v=sn(_)),v=new l(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Lh,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},rh(o),_=l.contextType,v.context=typeof _=="object"&&_!==null?sn(_):Da,v.state=o.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(Ah(o,l,_,u),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(_=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),_!==v.state&&Lh.enqueueReplaceState(v,v.state,null),rl(o,u,v,p),il(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var x=o.memoizedProps,R=Go(l,x);v.props=R;var F=v.context,Y=l.contextType;_=Da,typeof Y=="object"&&Y!==null&&(_=sn(Y));var J=l.getDerivedStateFromProps;Y=typeof J=="function"||typeof v.getSnapshotBeforeUpdate=="function",x=o.pendingProps!==x,Y||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(x||F!==_)&&R1(o,v,u,_),Gr=!1;var j=o.memoizedState;v.state=j,rl(o,u,v,p),il(),F=o.memoizedState,x||j!==F||Gr?(typeof J=="function"&&(Ah(o,l,J,u),F=o.memoizedState),(R=Gr||I1(o,l,R,u,j,F,_))?(Y||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=F),v.props=u,v.state=F,v.context=_,u=R):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,oh(r,o),_=o.memoizedProps,Y=Go(l,_),v.props=Y,J=o.pendingProps,j=v.context,F=l.contextType,R=Da,typeof F=="object"&&F!==null&&(R=sn(F)),x=l.getDerivedStateFromProps,(F=typeof x=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_!==J||j!==R)&&R1(o,v,u,R),Gr=!1,j=o.memoizedState,v.state=j,rl(o,u,v,p),il();var $=o.memoizedState;_!==J||j!==$||Gr||r!==null&&r.dependencies!==null&&Yc(r.dependencies)?(typeof x=="function"&&(Ah(o,l,x,u),$=o.memoizedState),(Y=Gr||I1(o,l,Y,u,j,$,R)||r!==null&&r.dependencies!==null&&Yc(r.dependencies))?(F||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,$,R),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,$,R)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=$),v.props=u,v.state=$,v.context=R,u=Y):(typeof v.componentDidUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||_===r.memoizedProps&&j===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,pu(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=$o(o,r.child,null,p),o.child=$o(o,null,l,p)):ln(r,o,l,p),o.memoizedState=v.state,r=o.child):r=fr(r,o,p),r}function G1(r,o,l,u){return zo(),o.flags|=256,ln(r,o,l,u),o.child}var Mh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oh(r){return{baseLanes:r,cachePool:P0()}}function Ph(r,o,l){return r=r!==null?r.childLanes&~l:0,o&&(r|=$n),r}function W1(r,o,l){var u=o.pendingProps,p=!1,v=(o.flags&128)!==0,_;if((_=v)||(_=r!==null&&r.memoizedState===null?!1:(Rt.current&2)!==0),_&&(p=!0,o.flags&=-129),_=(o.flags&32)!==0,o.flags&=-33,r===null){if(Ge){if(p?Yr(o):Xr(),(r=yt)?(r=ty(r,ai),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Fr!==null?{id:Mi,overflow:Oi}:null,retryLane:536870912,hydrationErrors:null},l=T0(r),l.return=o,o.child=l,an=o,yt=null)):r=null,r===null)throw $r(o);return vp(r)?o.lanes=32:o.lanes=536870912,null}var x=u.children;return u=u.fallback,p?(Xr(),p=o.mode,x=mu({mode:"hidden",children:x},p),u=Ho(u,p,l,null),x.return=o,u.return=o,x.sibling=u,o.child=x,u=o.child,u.memoizedState=Oh(l),u.childLanes=Ph(r,_,l),o.memoizedState=Mh,cl(null,u)):(Yr(o),Nh(o,x))}var R=r.memoizedState;if(R!==null&&(x=R.dehydrated,x!==null)){if(v)o.flags&256?(Yr(o),o.flags&=-257,o=Hh(r,o,l)):o.memoizedState!==null?(Xr(),o.child=r.child,o.flags|=128,o=null):(Xr(),x=u.fallback,p=o.mode,u=mu({mode:"visible",children:u.children},p),x=Ho(x,p,l,null),x.flags|=2,u.return=o,x.return=o,u.sibling=x,o.child=u,$o(o,r.child,null,l),u=o.child,u.memoizedState=Oh(l),u.childLanes=Ph(r,_,l),o.memoizedState=Mh,o=cl(null,u));else if(Yr(o),vp(x)){if(_=x.nextSibling&&x.nextSibling.dataset,_)var F=_.dgst;_=F,u=Error(i(419)),u.stack="",u.digest=_,Qs({value:u,source:null,stack:null}),o=Hh(r,o,l)}else if(zt||Na(r,o,l,!1),_=(l&r.childLanes)!==0,zt||_){if(_=ut,_!==null&&(u=Dc(_,l),u!==0&&u!==R.retryLane))throw R.retryLane=u,No(r,u),Mn(_,r,u),Rh;gp(x)||wu(),o=Hh(r,o,l)}else gp(x)?(o.flags|=192,o.child=r.child,o=null):(r=R.treeContext,yt=li(x.nextSibling),an=o,Ge=!0,jr=null,ai=!1,r!==null&&L0(o,r),o=Nh(o,u.children),o.flags|=4096);return o}return p?(Xr(),x=u.fallback,p=o.mode,R=r.child,F=R.sibling,u=ar(R,{mode:"hidden",children:u.children}),u.subtreeFlags=R.subtreeFlags&65011712,F!==null?x=ar(F,x):(x=Ho(x,p,l,null),x.flags|=2),x.return=o,u.return=o,u.sibling=x,o.child=u,cl(null,u),u=o.child,x=r.child.memoizedState,x===null?x=Oh(l):(p=x.cachePool,p!==null?(R=Nt._currentValue,p=p.parent!==R?{parent:R,pool:R}:p):p=P0(),x={baseLanes:x.baseLanes|l,cachePool:p}),u.memoizedState=x,u.childLanes=Ph(r,_,l),o.memoizedState=Mh,cl(r.child,u)):(Yr(o),l=r.child,r=l.sibling,l=ar(l,{mode:"visible",children:u.children}),l.return=o,l.sibling=null,r!==null&&(_=o.deletions,_===null?(o.deletions=[r],o.flags|=16):_.push(r)),o.child=l,o.memoizedState=null,l)}function Nh(r,o){return o=mu({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function mu(r,o){return r=Bn(22,r,null,o),r.lanes=0,r}function Hh(r,o,l){return $o(o,r.child,null,l),r=Nh(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function K1(r,o,l){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),Zf(r.return,o,l)}function zh(r,o,l,u,p,v){var _=r.memoizedState;_===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:v}:(_.isBackwards=o,_.rendering=null,_.renderingStartTime=0,_.last=u,_.tail=l,_.tailMode=p,_.treeForkCount=v)}function Y1(r,o,l){var u=o.pendingProps,p=u.revealOrder,v=u.tail;u=u.children;var _=Rt.current,x=(_&2)!==0;if(x?(_=_&1|2,o.flags|=128):_&=1,re(Rt,_),ln(r,o,u,l),u=Ge?Xs:0,!x&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&K1(r,l,o);else if(r.tag===19)K1(r,l,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(l=o.child,p=null;l!==null;)r=l.alternate,r!==null&&iu(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=o.child,o.child=null):(p=l.sibling,l.sibling=null),zh(o,!1,p,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=o.child,o.child=null;p!==null;){if(r=p.alternate,r!==null&&iu(r)===null){o.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}zh(o,!0,l,null,v,u);break;case"together":zh(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function fr(r,o,l){if(r!==null&&(o.dependencies=r.dependencies),Jr|=o.lanes,(l&o.childLanes)===0)if(r!==null){if(Na(r,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(i(153));if(o.child!==null){for(r=o.child,l=ar(r,r.pendingProps),o.child=l,l.return=o;r.sibling!==null;)r=r.sibling,l=l.sibling=ar(r,r.pendingProps),l.return=o;l.sibling=null}return o.child}function Vh(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Yc(r)))}function ow(r,o,l){switch(o.tag){case 3:Ue(o,o.stateNode.containerInfo),qr(o,Nt,r.memoizedState.cache),zo();break;case 27:case 5:He(o);break;case 4:Ue(o,o.stateNode.containerInfo);break;case 10:qr(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,uh(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(Yr(o),o.flags|=128,null):(l&o.child.childLanes)!==0?W1(r,o,l):(Yr(o),r=fr(r,o,l),r!==null?r.sibling:null);Yr(o);break;case 19:var p=(r.flags&128)!==0;if(u=(l&o.childLanes)!==0,u||(Na(r,o,l,!1),u=(l&o.childLanes)!==0),p){if(u)return Y1(r,o,l);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),re(Rt,Rt.current),u)break;return null;case 22:return o.lanes=0,U1(r,o,l,o.pendingProps);case 24:qr(o,Nt,r.memoizedState.cache)}return fr(r,o,l)}function X1(r,o,l){if(r!==null)if(r.memoizedProps!==o.pendingProps)zt=!0;else{if(!Vh(r,l)&&(o.flags&128)===0)return zt=!1,ow(r,o,l);zt=(r.flags&131072)!==0}else zt=!1,Ge&&(o.flags&1048576)!==0&&A0(o,Xs,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Fo(o.elementType),o.type=r,typeof r=="function")$f(r)?(u=Go(r,u),o.tag=1,o=q1(null,o,r,u,l)):(o.tag=0,o=Dh(null,o,r,u,l));else{if(r!=null){var p=r.$$typeof;if(p===L){o.tag=11,o=z1(null,o,r,u,l);break e}else if(p===N){o.tag=14,o=V1(null,o,r,u,l);break e}}throw o=le(r)||r,Error(i(306,o,""))}}return o;case 0:return Dh(r,o,o.type,o.pendingProps,l);case 1:return u=o.type,p=Go(u,o.pendingProps),q1(r,o,u,p,l);case 3:e:{if(Ue(o,o.stateNode.containerInfo),r===null)throw Error(i(387));u=o.pendingProps;var v=o.memoizedState;p=v.element,oh(r,o),rl(o,u,null,l);var _=o.memoizedState;if(u=_.cache,qr(o,Nt,u),u!==v.cache&&Jf(o,[Nt],l,!0),il(),u=_.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:_.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=G1(r,o,u,l);break e}else if(u!==p){p=ii(Error(i(424)),o),Qs(p),o=G1(r,o,u,l);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(yt=li(r.firstChild),an=o,Ge=!0,jr=null,ai=!0,l=U0(o,null,u,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(zo(),u===p){o=fr(r,o,l);break e}ln(r,o,u,l)}o=o.child}return o;case 26:return pu(r,o),r===null?(l=sy(o.type,null,o.pendingProps,null))?o.memoizedState=l:Ge||(l=o.type,r=o.pendingProps,u=Ru(Se.current).createElement(l),u[Ct]=o,u[Kt]=r,cn(u,l,r),Pt(u),o.stateNode=u):o.memoizedState=sy(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return He(o),r===null&&Ge&&(u=o.stateNode=ry(o.type,o.pendingProps,Se.current),an=o,ai=!0,p=yt,ro(o.type)?(yp=p,yt=li(u.firstChild)):yt=p),ln(r,o,o.pendingProps.children,l),pu(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Ge&&((p=u=yt)&&(u=Pw(u,o.type,o.pendingProps,ai),u!==null?(o.stateNode=u,an=o,yt=li(u.firstChild),ai=!1,p=!0):p=!1),p||$r(o)),He(o),p=o.type,v=o.pendingProps,_=r!==null?r.memoizedProps:null,u=v.children,hp(p,v)?u=null:_!==null&&hp(p,_)&&(o.flags|=32),o.memoizedState!==null&&(p=fh(r,o,X5,null,null,l),wl._currentValue=p),pu(r,o),ln(r,o,u,l),o.child;case 6:return r===null&&Ge&&((r=l=yt)&&(l=Nw(l,o.pendingProps,ai),l!==null?(o.stateNode=l,an=o,yt=null,r=!0):r=!1),r||$r(o)),null;case 13:return W1(r,o,l);case 4:return Ue(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=$o(o,null,u,l):ln(r,o,u,l),o.child;case 11:return z1(r,o,o.type,o.pendingProps,l);case 7:return ln(r,o,o.pendingProps,l),o.child;case 8:return ln(r,o,o.pendingProps.children,l),o.child;case 12:return ln(r,o,o.pendingProps.children,l),o.child;case 10:return u=o.pendingProps,qr(o,o.type,u.value),ln(r,o,u.children,l),o.child;case 9:return p=o.type._context,u=o.pendingProps.children,Bo(o),p=sn(p),u=u(p),o.flags|=1,ln(r,o,u,l),o.child;case 14:return V1(r,o,o.type,o.pendingProps,l);case 15:return B1(r,o,o.type,o.pendingProps,l);case 19:return Y1(r,o,l);case 31:return rw(r,o,l);case 22:return U1(r,o,l,o.pendingProps);case 24:return Bo(o),u=sn(Nt),r===null?(p=nh(),p===null&&(p=ut,v=eh(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=l),p=v),o.memoizedState={parent:u,cache:p},rh(o),qr(o,Nt,p)):((r.lanes&l)!==0&&(oh(r,o),rl(o,null,null,l),il()),p=r.memoizedState,v=o.memoizedState,p.parent!==u?(p={parent:u,cache:u},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),qr(o,Nt,u)):(u=v.cache,qr(o,Nt,u),u!==p.cache&&Jf(o,[Nt],l,!0))),ln(r,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function hr(r){r.flags|=4}function Bh(r,o,l,u,p){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Ev())r.flags|=8192;else throw jo=Jc,ih}else r.flags&=-16777217}function Q1(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!fy(o))if(Ev())r.flags|=8192;else throw jo=Jc,ih}function gu(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?nn():536870912,r.lanes|=o,Ka|=o)}function ul(r,o){if(!Ge)switch(r.tailMode){case"hidden":o=r.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function bt(r){var o=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(o)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=u,r.childLanes=l,o}function aw(r,o,l){var u=o.pendingProps;switch(Kf(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(o),null;case 1:return bt(o),null;case 3:return l=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),cr(Nt),Ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Pa(o)?hr(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Xf())),bt(o),null;case 26:var p=o.type,v=o.memoizedState;return r===null?(hr(o),v!==null?(bt(o),Q1(o,v)):(bt(o),Bh(o,p,null,u,l))):v?v!==r.memoizedState?(hr(o),bt(o),Q1(o,v)):(bt(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&hr(o),bt(o),Bh(o,p,r,u,l)),null;case 27:if(We(o),l=Se.current,p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return bt(o),null}r=ae.current,Pa(o)?I0(o):(r=ry(p,u,l),o.stateNode=r,hr(o))}return bt(o),null;case 5:if(We(o),p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(!u){if(o.stateNode===null)throw Error(i(166));return bt(o),null}if(v=ae.current,Pa(o))I0(o);else{var _=Ru(Se.current);switch(v){case 1:v=_.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=_.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=_.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=_.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?_.createElement("select",{is:u.is}):_.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?_.createElement(p,{is:u.is}):_.createElement(p)}}v[Ct]=o,v[Kt]=u;e:for(_=o.child;_!==null;){if(_.tag===5||_.tag===6)v.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===o)break e;for(;_.sibling===null;){if(_.return===null||_.return===o)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}o.stateNode=v;e:switch(cn(v,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&hr(o)}}return bt(o),Bh(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,l),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&hr(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(i(166));if(r=Se.current,Pa(o)){if(r=o.stateNode,l=o.memoizedProps,u=null,p=an,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[Ct]=o,r=!!(r.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||Wv(r.nodeValue,l)),r||$r(o,!0)}else r=Ru(r).createTextNode(u),r[Ct]=o,o.stateNode=r}return bt(o),null;case 31:if(l=o.memoizedState,r===null||r.memoizedState!==null){if(u=Pa(o),l!==null){if(r===null){if(!u)throw Error(i(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[Ct]=o}else zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bt(o),r=!1}else l=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return o.flags&256?(Fn(o),o):(Fn(o),null);if((o.flags&128)!==0)throw Error(i(558))}return bt(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Pa(o),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(i(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[Ct]=o}else zo(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bt(o),p=!1}else p=Xf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return o.flags&256?(Fn(o),o):(Fn(o),null)}return Fn(o),(o.flags&128)!==0?(o.lanes=l,o):(l=u!==null,r=r!==null&&r.memoizedState!==null,l&&(u=o.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==p&&(u.flags|=2048)),l!==r&&l&&(o.child.flags|=8192),gu(o,o.updateQueue),bt(o),null);case 4:return Ce(),r===null&&lp(o.stateNode.containerInfo),bt(o),null;case 10:return cr(o.type),bt(o),null;case 19:if(q(Rt),u=o.memoizedState,u===null)return bt(o),null;if(p=(o.flags&128)!==0,v=u.rendering,v===null)if(p)ul(u,!1);else{if(At!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=iu(r),v!==null){for(o.flags|=128,ul(u,!1),r=v.updateQueue,o.updateQueue=r,gu(o,r),o.subtreeFlags=0,r=l,l=o.child;l!==null;)x0(l,r),l=l.sibling;return re(Rt,Rt.current&1|2),Ge&&sr(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&bn()>_u&&(o.flags|=128,p=!0,ul(u,!1),o.lanes=4194304)}else{if(!p)if(r=iu(v),r!==null){if(o.flags|=128,p=!0,r=r.updateQueue,o.updateQueue=r,gu(o,r),ul(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Ge)return bt(o),null}else 2*bn()-u.renderingStartTime>_u&&l!==536870912&&(o.flags|=128,p=!0,ul(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=bn(),r.sibling=null,l=Rt.current,re(Rt,p?l&1|2:l&1),Ge&&sr(o,u.treeForkCount),r):(bt(o),null);case 22:case 23:return Fn(o),ch(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(l&536870912)!==0&&(o.flags&128)===0&&(bt(o),o.subtreeFlags&6&&(o.flags|=8192)):bt(o),l=o.updateQueue,l!==null&&gu(o,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==l&&(o.flags|=2048),r!==null&&q(Uo),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),cr(Nt),bt(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function sw(r,o){switch(Kf(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return cr(Nt),Ce(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return We(o),null;case 31:if(o.memoizedState!==null){if(Fn(o),o.alternate===null)throw Error(i(340));zo()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Fn(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(i(340));zo()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return q(Rt),null;case 4:return Ce(),null;case 10:return cr(o.type),null;case 22:case 23:return Fn(o),ch(),r!==null&&q(Uo),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return cr(Nt),null;case 25:return null;default:return null}}function Z1(r,o){switch(Kf(o),o.tag){case 3:cr(Nt),Ce();break;case 26:case 27:case 5:We(o);break;case 4:Ce();break;case 31:o.memoizedState!==null&&Fn(o);break;case 13:Fn(o);break;case 19:q(Rt);break;case 10:cr(o.type);break;case 22:case 23:Fn(o),ch(),r!==null&&q(Uo);break;case 24:cr(Nt)}}function dl(r,o){try{var l=o.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&r)===r){u=void 0;var v=l.create,_=l.inst;u=v(),_.destroy=u}l=l.next}while(l!==p)}}catch(x){it(o,o.return,x)}}function Qr(r,o,l){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var v=p.next;u=v;do{if((u.tag&r)===r){var _=u.inst,x=_.destroy;if(x!==void 0){_.destroy=void 0,p=o;var R=l,F=x;try{F()}catch(Y){it(p,R,Y)}}}u=u.next}while(u!==v)}}catch(Y){it(o,o.return,Y)}}function J1(r){var o=r.updateQueue;if(o!==null){var l=r.stateNode;try{j0(o,l)}catch(u){it(r,r.return,u)}}}function ev(r,o,l){l.props=Go(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(u){it(r,o,u)}}function fl(r,o){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof l=="function"?r.refCleanup=l(u):l.current=u}}catch(p){it(r,o,p)}}function Pi(r,o){var l=r.ref,u=r.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){it(r,o,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){it(r,o,p)}else l.current=null}function tv(r){var o=r.type,l=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){it(r,r.return,p)}}function Uh(r,o,l){try{var u=r.stateNode;Lw(u,r.type,l,o),u[Kt]=o}catch(p){it(r,r.return,p)}}function nv(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ro(r.type)||r.tag===4}function Fh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||nv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ro(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function jh(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(r),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=ei));else if(u!==4&&(u===27&&ro(r.type)&&(l=r.stateNode,o=null),r=r.child,r!==null))for(jh(r,o,l),r=r.sibling;r!==null;)jh(r,o,l),r=r.sibling}function vu(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?l.insertBefore(r,o):l.appendChild(r);else if(u!==4&&(u===27&&ro(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(vu(r,o,l),r=r.sibling;r!==null;)vu(r,o,l),r=r.sibling}function iv(r){var o=r.stateNode,l=r.memoizedProps;try{for(var u=r.type,p=o.attributes;p.length;)o.removeAttributeNode(p[0]);cn(o,u,l),o[Ct]=r,o[Kt]=l}catch(v){it(r,r.return,v)}}var pr=!1,Vt=!1,$h=!1,rv=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function lw(r,o){if(r=r.containerInfo,dp=zu,r=g0(r),Hf(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,x=-1,R=-1,F=0,Y=0,J=r,j=null;t:for(;;){for(var $;J!==l||p!==0&&J.nodeType!==3||(x=_+p),J!==v||u!==0&&J.nodeType!==3||(R=_+u),J.nodeType===3&&(_+=J.nodeValue.length),($=J.firstChild)!==null;)j=J,J=$;for(;;){if(J===r)break t;if(j===l&&++F===p&&(x=_),j===v&&++Y===u&&(R=_),($=J.nextSibling)!==null)break;J=j,j=J.parentNode}J=$}l=x===-1||R===-1?null:{start:x,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(fp={focusedElem:r,selectionRange:l},zu=!1,Zt=o;Zt!==null;)if(o=Zt,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Zt=r;else for(;Zt!==null;){switch(o=Zt,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)p=r[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=o,p=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var ge=Go(l.type,p);r=u.getSnapshotBeforeUpdate(ge,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(Ie){it(l,l.return,Ie)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,l=r.nodeType,l===9)mp(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":mp(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=o.sibling,r!==null){r.return=o.return,Zt=r;break}Zt=o.return}}function ov(r,o,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:gr(r,l),u&4&&dl(5,l);break;case 1:if(gr(r,l),u&4)if(r=l.stateNode,o===null)try{r.componentDidMount()}catch(_){it(l,l.return,_)}else{var p=Go(l.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(p,o,r.__reactInternalSnapshotBeforeUpdate)}catch(_){it(l,l.return,_)}}u&64&&J1(l),u&512&&fl(l,l.return);break;case 3:if(gr(r,l),u&64&&(r=l.updateQueue,r!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{j0(r,o)}catch(_){it(l,l.return,_)}}break;case 27:o===null&&u&4&&iv(l);case 26:case 5:gr(r,l),o===null&&u&4&&tv(l),u&512&&fl(l,l.return);break;case 12:gr(r,l);break;case 31:gr(r,l),u&4&&lv(r,l);break;case 13:gr(r,l),u&4&&cv(r,l),u&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=vw.bind(null,l),Hw(r,l))));break;case 22:if(u=l.memoizedState!==null||pr,!u){o=o!==null&&o.memoizedState!==null||Vt,p=pr;var v=Vt;pr=u,(Vt=o)&&!v?vr(r,l,(l.subtreeFlags&8772)!==0):gr(r,l),pr=p,Vt=v}break;case 30:break;default:gr(r,l)}}function av(r){var o=r.alternate;o!==null&&(r.alternate=null,av(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Zi(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var wt=null,Ln=!1;function mr(r,o,l){for(l=l.child;l!==null;)sv(r,o,l),l=l.sibling}function sv(r,o,l){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Ir,l)}catch{}switch(l.tag){case 26:Vt||Pi(l,o),mr(r,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Vt||Pi(l,o);var u=wt,p=Ln;ro(l.type)&&(wt=l.stateNode,Ln=!1),mr(r,o,l),_l(l.stateNode),wt=u,Ln=p;break;case 5:Vt||Pi(l,o);case 6:if(u=wt,p=Ln,wt=null,mr(r,o,l),wt=u,Ln=p,wt!==null)if(Ln)try{(wt.nodeType===9?wt.body:wt.nodeName==="HTML"?wt.ownerDocument.body:wt).removeChild(l.stateNode)}catch(v){it(l,o,v)}else try{wt.removeChild(l.stateNode)}catch(v){it(l,o,v)}break;case 18:wt!==null&&(Ln?(r=wt,Jv(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),ns(r)):Jv(wt,l.stateNode));break;case 4:u=wt,p=Ln,wt=l.stateNode.containerInfo,Ln=!0,mr(r,o,l),wt=u,Ln=p;break;case 0:case 11:case 14:case 15:Qr(2,l,o),Vt||Qr(4,l,o),mr(r,o,l);break;case 1:Vt||(Pi(l,o),u=l.stateNode,typeof u.componentWillUnmount=="function"&&ev(l,o,u)),mr(r,o,l);break;case 21:mr(r,o,l);break;case 22:Vt=(u=Vt)||l.memoizedState!==null,mr(r,o,l),Vt=u;break;default:mr(r,o,l)}}function lv(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{ns(r)}catch(l){it(o,o.return,l)}}}function cv(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{ns(r)}catch(l){it(o,o.return,l)}}function cw(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new rv),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new rv),o;default:throw Error(i(435,r.tag))}}function yu(r,o){var l=cw(r);o.forEach(function(u){if(!l.has(u)){l.add(u);var p=yw.bind(null,r,u);u.then(p,p)}})}function In(r,o){var l=o.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],v=r,_=o,x=_;e:for(;x!==null;){switch(x.tag){case 27:if(ro(x.type)){wt=x.stateNode,Ln=!1;break e}break;case 5:wt=x.stateNode,Ln=!1;break e;case 3:case 4:wt=x.stateNode.containerInfo,Ln=!0;break e}x=x.return}if(wt===null)throw Error(i(160));sv(v,_,p),wt=null,Ln=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)uv(o,r),o=o.sibling}var Si=null;function uv(r,o){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:In(o,r),Rn(r),u&4&&(Qr(3,r,r.return),dl(3,r),Qr(5,r,r.return));break;case 1:In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),u&64&&pr&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=Si;if(In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=r.memoizedState,l===null)if(u===null)if(r.stateNode===null){e:{u=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Sn]||v[Ct]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(u),p.head.insertBefore(v,p.querySelector("head > title"))),cn(v,u,l),v[Ct]=r,Pt(v),u=v;break e;case"link":var _=uy("link","href",p).get(u+(l.href||""));if(_){for(var x=0;x<_.length;x++)if(v=_[x],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){_.splice(x,1);break t}}v=p.createElement(u),cn(v,u,l),p.head.appendChild(v);break;case"meta":if(_=uy("meta","content",p).get(u+(l.content||""))){for(x=0;x<_.length;x++)if(v=_[x],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){_.splice(x,1);break t}}v=p.createElement(u),cn(v,u,l),p.head.appendChild(v);break;default:throw Error(i(468,u))}v[Ct]=r,Pt(v),u=v}r.stateNode=u}else dy(p,r.type,r.stateNode);else r.stateNode=cy(p,u,r.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?dy(p,r.type,r.stateNode):cy(p,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Uh(r,r.memoizedProps,l.memoizedProps)}break;case 27:In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),l!==null&&u&4&&Uh(r,r.memoizedProps,l.memoizedProps);break;case 5:if(In(o,r),Rn(r),u&512&&(Vt||l===null||Pi(l,l.return)),r.flags&32){p=r.stateNode;try{_n(p,"")}catch(ge){it(r,r.return,ge)}}u&4&&r.stateNode!=null&&(p=r.memoizedProps,Uh(r,p,l!==null?l.memoizedProps:p)),u&1024&&($h=!0);break;case 6:if(In(o,r),Rn(r),u&4){if(r.stateNode===null)throw Error(i(162));u=r.memoizedProps,l=r.stateNode;try{l.nodeValue=u}catch(ge){it(r,r.return,ge)}}break;case 3:if(Ou=null,p=Si,Si=Du(o.containerInfo),In(o,r),Si=p,Rn(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{ns(o.containerInfo)}catch(ge){it(r,r.return,ge)}$h&&($h=!1,dv(r));break;case 4:u=Si,Si=Du(r.stateNode.containerInfo),In(o,r),Rn(r),Si=u;break;case 12:In(o,r),Rn(r);break;case 31:In(o,r),Rn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 13:In(o,r),Rn(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Su=bn()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 22:p=r.memoizedState!==null;var R=l!==null&&l.memoizedState!==null,F=pr,Y=Vt;if(pr=F||p,Vt=Y||R,In(o,r),Vt=Y,pr=F,Rn(r),u&8192)e:for(o=r.stateNode,o._visibility=p?o._visibility&-2:o._visibility|1,p&&(l===null||R||pr||Vt||Wo(r)),l=null,o=r;;){if(o.tag===5||o.tag===26){if(l===null){R=l=o;try{if(v=R.stateNode,p)_=v.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{x=R.stateNode;var J=R.memoizedProps.style,j=J!=null&&J.hasOwnProperty("display")?J.display:null;x.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(ge){it(R,R.return,ge)}}}else if(o.tag===6){if(l===null){R=o;try{R.stateNode.nodeValue=p?"":R.memoizedProps}catch(ge){it(R,R.return,ge)}}}else if(o.tag===18){if(l===null){R=o;try{var $=R.stateNode;p?ey($,!0):ey(R.stateNode,!1)}catch(ge){it(R,R.return,ge)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,yu(r,l))));break;case 19:In(o,r),Rn(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,yu(r,u)));break;case 30:break;case 21:break;default:In(o,r),Rn(r)}}function Rn(r){var o=r.flags;if(o&2){try{for(var l,u=r.return;u!==null;){if(nv(u)){l=u;break}u=u.return}if(l==null)throw Error(i(160));switch(l.tag){case 27:var p=l.stateNode,v=Fh(r);vu(r,v,p);break;case 5:var _=l.stateNode;l.flags&32&&(_n(_,""),l.flags&=-33);var x=Fh(r);vu(r,x,_);break;case 3:case 4:var R=l.stateNode.containerInfo,F=Fh(r);jh(r,F,R);break;default:throw Error(i(161))}}catch(Y){it(r,r.return,Y)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function dv(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;dv(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function gr(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ov(r,o.alternate,o),o=o.sibling}function Wo(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Qr(4,o,o.return),Wo(o);break;case 1:Pi(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&ev(o,o.return,l),Wo(o);break;case 27:_l(o.stateNode);case 26:case 5:Pi(o,o.return),Wo(o);break;case 22:o.memoizedState===null&&Wo(o);break;case 30:Wo(o);break;default:Wo(o)}r=r.sibling}}function vr(r,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,p=r,v=o,_=v.flags;switch(v.tag){case 0:case 11:case 15:vr(p,v,l),dl(4,v);break;case 1:if(vr(p,v,l),u=v,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(F){it(u,u.return,F)}if(u=v,p=u.updateQueue,p!==null){var x=u.stateNode;try{var R=p.shared.hiddenCallbacks;if(R!==null)for(p.shared.hiddenCallbacks=null,p=0;p<R.length;p++)F0(R[p],x)}catch(F){it(u,u.return,F)}}l&&_&64&&J1(v),fl(v,v.return);break;case 27:iv(v);case 26:case 5:vr(p,v,l),l&&u===null&&_&4&&tv(v),fl(v,v.return);break;case 12:vr(p,v,l);break;case 31:vr(p,v,l),l&&_&4&&lv(p,v);break;case 13:vr(p,v,l),l&&_&4&&cv(p,v);break;case 22:v.memoizedState===null&&vr(p,v,l),fl(v,v.return);break;case 30:break;default:vr(p,v,l)}o=o.sibling}}function qh(r,o){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Zs(l))}function Gh(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zs(r))}function _i(r,o,l,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)fv(r,o,l,u),o=o.sibling}function fv(r,o,l,u){var p=o.flags;switch(o.tag){case 0:case 11:case 15:_i(r,o,l,u),p&2048&&dl(9,o);break;case 1:_i(r,o,l,u);break;case 3:_i(r,o,l,u),p&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zs(r)));break;case 12:if(p&2048){_i(r,o,l,u),r=o.stateNode;try{var v=o.memoizedProps,_=v.id,x=v.onPostCommit;typeof x=="function"&&x(_,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(R){it(o,o.return,R)}}else _i(r,o,l,u);break;case 31:_i(r,o,l,u);break;case 13:_i(r,o,l,u);break;case 23:break;case 22:v=o.stateNode,_=o.alternate,o.memoizedState!==null?v._visibility&2?_i(r,o,l,u):hl(r,o):v._visibility&2?_i(r,o,l,u):(v._visibility|=2,qa(r,o,l,u,(o.subtreeFlags&10256)!==0||!1)),p&2048&&qh(_,o);break;case 24:_i(r,o,l,u),p&2048&&Gh(o.alternate,o);break;default:_i(r,o,l,u)}}function qa(r,o,l,u,p){for(p=p&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,_=o,x=l,R=u,F=_.flags;switch(_.tag){case 0:case 11:case 15:qa(v,_,x,R,p),dl(8,_);break;case 23:break;case 22:var Y=_.stateNode;_.memoizedState!==null?Y._visibility&2?qa(v,_,x,R,p):hl(v,_):(Y._visibility|=2,qa(v,_,x,R,p)),p&&F&2048&&qh(_.alternate,_);break;case 24:qa(v,_,x,R,p),p&&F&2048&&Gh(_.alternate,_);break;default:qa(v,_,x,R,p)}o=o.sibling}}function hl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=r,u=o,p=u.flags;switch(u.tag){case 22:hl(l,u),p&2048&&qh(u.alternate,u);break;case 24:hl(l,u),p&2048&&Gh(u.alternate,u);break;default:hl(l,u)}o=o.sibling}}var pl=8192;function Ga(r,o,l){if(r.subtreeFlags&pl)for(r=r.child;r!==null;)hv(r,o,l),r=r.sibling}function hv(r,o,l){switch(r.tag){case 26:Ga(r,o,l),r.flags&pl&&r.memoizedState!==null&&Yw(l,Si,r.memoizedState,r.memoizedProps);break;case 5:Ga(r,o,l);break;case 3:case 4:var u=Si;Si=Du(r.stateNode.containerInfo),Ga(r,o,l),Si=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=pl,pl=16777216,Ga(r,o,l),pl=u):Ga(r,o,l));break;default:Ga(r,o,l)}}function pv(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function ml(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Zt=u,gv(u,r)}pv(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)mv(r),r=r.sibling}function mv(r){switch(r.tag){case 0:case 11:case 15:ml(r),r.flags&2048&&Qr(9,r,r.return);break;case 3:ml(r);break;case 12:ml(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,bu(r)):ml(r);break;default:ml(r)}}function bu(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Zt=u,gv(u,r)}pv(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Qr(8,o,o.return),bu(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,bu(o));break;default:bu(o)}r=r.sibling}}function gv(r,o){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:Qr(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Zs(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Zt=u;else e:for(l=r;Zt!==null;){u=Zt;var p=u.sibling,v=u.return;if(av(u),u===l){Zt=null;break e}if(p!==null){p.return=v,Zt=p;break e}Zt=v}}}var uw={getCacheForType:function(r){var o=sn(Nt),l=o.data.get(r);return l===void 0&&(l=r(),o.data.set(r,l)),l},cacheSignal:function(){return sn(Nt).controller.signal}},dw=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ut=null,Fe=null,$e=0,nt=0,jn=null,Zr=!1,Wa=!1,Wh=!1,yr=0,At=0,Jr=0,Ko=0,Kh=0,$n=0,Ka=0,gl=null,Dn=null,Yh=!1,Su=0,vv=0,_u=1/0,Cu=null,eo=null,Ft=0,to=null,Ya=null,br=0,Xh=0,Qh=null,yv=null,vl=0,Zh=null;function qn(){return(Qe&2)!==0&&$e!==0?$e&-$e:H.T!==null?rp():ks()}function bv(){if($n===0)if(($e&536870912)===0||Ge){var r=xo;xo<<=1,(xo&3932160)===0&&(xo=262144),$n=r}else $n=536870912;return r=Un.current,r!==null&&(r.flags|=32),$n}function Mn(r,o,l){(r===ut&&(nt===2||nt===9)||r.cancelPendingCommit!==null)&&(Xa(r,0),no(r,$e,$n,!1)),Zn(r,l),((Qe&2)===0||r!==ut)&&(r===ut&&((Qe&2)===0&&(Ko|=l),At===4&&no(r,$e,$n,!1)),Ni(r))}function Sv(r,o,l){if((Qe&6)!==0)throw Error(i(327));var u=!l&&(o&127)===0&&(o&r.expiredLanes)===0||To(r,o),p=u?pw(r,o):ep(r,o,!0),v=u;do{if(p===0){Wa&&!u&&no(r,o,0,!1);break}else{if(l=r.current.alternate,v&&!fw(l)){p=ep(r,o,!1),v=!1;continue}if(p===2){if(v=o,r.errorRecoveryDisabledLanes&v)var _=0;else _=r.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){o=_;e:{var x=r;p=gl;var R=x.current.memoizedState.isDehydrated;if(R&&(Xa(x,_).flags|=256),_=ep(x,_,!1),_!==2){if(Wh&&!R){x.errorRecoveryDisabledLanes|=v,Ko|=v,p=4;break e}v=Dn,Dn=p,v!==null&&(Dn===null?Dn=v:Dn.push.apply(Dn,v))}p=_}if(v=!1,p!==2)continue}}if(p===1){Xa(r,0),no(r,o,0,!0);break}e:{switch(u=r,v=p,v){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:no(u,o,$n,!Zr);break e;case 2:Dn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(p=Su+300-bn(),10<p)){if(no(u,o,$n,!Zr),ma(u,0,!0)!==0)break e;br=o,u.timeoutHandle=Qv(_v.bind(null,u,l,Dn,Cu,Yh,o,$n,Ko,Ka,Zr,v,"Throttled",-0,0),p);break e}_v(u,l,Dn,Cu,Yh,o,$n,Ko,Ka,Zr,v,null,-0,0)}}break}while(!0);Ni(r)}function _v(r,o,l,u,p,v,_,x,R,F,Y,J,j,$){if(r.timeoutHandle=-1,J=o.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ei},hv(o,v,J);var ge=(v&62914560)===v?Su-bn():(v&4194048)===v?vv-bn():0;if(ge=Xw(J,ge),ge!==null){br=v,r.cancelPendingCommit=ge(Lv.bind(null,r,o,v,l,u,p,_,x,R,Y,J,null,j,$)),no(r,v,_,!F);return}}Lv(r,o,v,l,u,p,_,x,R)}function fw(r){for(var o=r;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],v=p.getSnapshot;p=p.value;try{if(!Vn(v(),p))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function no(r,o,l,u){o&=~Kh,o&=~Ko,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var p=o;0<p;){var v=31-tn(p),_=1<<v;u[v]=-1,p&=~_}l!==0&&Ic(r,l,o)}function Eu(){return(Qe&6)===0?(yl(0),!1):!0}function Jh(){if(Fe!==null){if(nt===0)var r=Fe.return;else r=Fe,lr=Vo=null,mh(r),Ba=null,el=0,r=Fe;for(;r!==null;)Z1(r.alternate,r),r=r.return;Fe=null}}function Xa(r,o){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,Dw(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),br=0,Jh(),ut=r,Fe=l=ar(r.current,null),$e=o,nt=0,jn=null,Zr=!1,Wa=To(r,o),Wh=!1,Ka=$n=Kh=Ko=Jr=At=0,Dn=gl=null,Yh=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var p=31-tn(u),v=1<<p;o|=r[p],u&=~v}return yr=o,$c(),l}function Cv(r,o){Pe=null,H.H=ll,o===Va||o===Zc?(o=z0(),nt=3):o===ih?(o=z0(),nt=4):nt=o===Rh?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,jn=o,Fe===null&&(At=1,fu(r,ii(o,r.current)))}function Ev(){var r=Un.current;return r===null?!0:($e&4194048)===$e?si===null:($e&62914560)===$e||($e&536870912)!==0?r===si:!1}function wv(){var r=H.H;return H.H=ll,r===null?ll:r}function xv(){var r=H.A;return H.A=uw,r}function wu(){At=4,Zr||($e&4194048)!==$e&&Un.current!==null||(Wa=!0),(Jr&134217727)===0&&(Ko&134217727)===0||ut===null||no(ut,$e,$n,!1)}function ep(r,o,l){var u=Qe;Qe|=2;var p=wv(),v=xv();(ut!==r||$e!==o)&&(Cu=null,Xa(r,o)),o=!1;var _=At;e:do try{if(nt!==0&&Fe!==null){var x=Fe,R=jn;switch(nt){case 8:Jh(),_=6;break e;case 3:case 2:case 9:case 6:Un.current===null&&(o=!0);var F=nt;if(nt=0,jn=null,Qa(r,x,R,F),l&&Wa){_=0;break e}break;default:F=nt,nt=0,jn=null,Qa(r,x,R,F)}}hw(),_=At;break}catch(Y){Cv(r,Y)}while(!0);return o&&r.shellSuspendCounter++,lr=Vo=null,Qe=u,H.H=p,H.A=v,Fe===null&&(ut=null,$e=0,$c()),_}function hw(){for(;Fe!==null;)Tv(Fe)}function pw(r,o){var l=Qe;Qe|=2;var u=wv(),p=xv();ut!==r||$e!==o?(Cu=null,_u=bn()+500,Xa(r,o)):Wa=To(r,o);e:do try{if(nt!==0&&Fe!==null){o=Fe;var v=jn;t:switch(nt){case 1:nt=0,jn=null,Qa(r,o,v,1);break;case 2:case 9:if(N0(v)){nt=0,jn=null,kv(o);break}o=function(){nt!==2&&nt!==9||ut!==r||(nt=7),Ni(r)},v.then(o,o);break e;case 3:nt=7;break e;case 4:nt=5;break e;case 7:N0(v)?(nt=0,jn=null,kv(o)):(nt=0,jn=null,Qa(r,o,v,7));break;case 5:var _=null;switch(Fe.tag){case 26:_=Fe.memoizedState;case 5:case 27:var x=Fe;if(_?fy(_):x.stateNode.complete){nt=0,jn=null;var R=x.sibling;if(R!==null)Fe=R;else{var F=x.return;F!==null?(Fe=F,xu(F)):Fe=null}break t}}nt=0,jn=null,Qa(r,o,v,5);break;case 6:nt=0,jn=null,Qa(r,o,v,6);break;case 8:Jh(),At=6;break e;default:throw Error(i(462))}}mw();break}catch(Y){Cv(r,Y)}while(!0);return lr=Vo=null,H.H=u,H.A=p,Qe=l,Fe!==null?0:(ut=null,$e=0,$c(),At)}function mw(){for(;Fe!==null&&!Ef();)Tv(Fe)}function Tv(r){var o=X1(r.alternate,r,yr);r.memoizedProps=r.pendingProps,o===null?xu(r):Fe=o}function kv(r){var o=r,l=o.alternate;switch(o.tag){case 15:case 0:o=$1(l,o,o.pendingProps,o.type,void 0,$e);break;case 11:o=$1(l,o,o.pendingProps,o.type.render,o.ref,$e);break;case 5:mh(o);default:Z1(l,o),o=Fe=x0(o,yr),o=X1(l,o,yr)}r.memoizedProps=r.pendingProps,o===null?xu(r):Fe=o}function Qa(r,o,l,u){lr=Vo=null,mh(o),Ba=null,el=0;var p=o.return;try{if(iw(r,p,o,l,$e)){At=1,fu(r,ii(l,r.current)),Fe=null;return}}catch(v){if(p!==null)throw Fe=p,v;At=1,fu(r,ii(l,r.current)),Fe=null;return}o.flags&32768?(Ge||u===1?r=!0:Wa||($e&536870912)!==0?r=!1:(Zr=r=!0,(u===2||u===9||u===3||u===6)&&(u=Un.current,u!==null&&u.tag===13&&(u.flags|=16384))),Av(o,r)):xu(o)}function xu(r){var o=r;do{if((o.flags&32768)!==0){Av(o,Zr);return}r=o.return;var l=aw(o.alternate,o,yr);if(l!==null){Fe=l;return}if(o=o.sibling,o!==null){Fe=o;return}Fe=o=r}while(o!==null);At===0&&(At=5)}function Av(r,o){do{var l=sw(r.alternate,r);if(l!==null){l.flags&=32767,Fe=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(r=r.sibling,r!==null)){Fe=r;return}Fe=r=l}while(r!==null);At=6,Fe=null}function Lv(r,o,l,u,p,v,_,x,R){r.cancelPendingCommit=null;do Tu();while(Ft!==0);if((Qe&6)!==0)throw Error(i(327));if(o!==null){if(o===r.current)throw Error(i(177));if(v=o.lanes|o.childLanes,v|=Ff,Lc(r,l,v,_,x,R),r===ut&&(Fe=ut=null,$e=0),Ya=o,to=r,br=l,Xh=v,Qh=p,yv=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,bw(Ai,function(){return Ov(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=H.T,H.T=null,p=z.p,z.p=2,_=Qe,Qe|=4;try{lw(r,o,l)}finally{Qe=_,z.p=p,H.T=u}}Ft=1,Iv(),Rv(),Dv()}}function Iv(){if(Ft===1){Ft=0;var r=to,o=Ya,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var u=z.p;z.p=2;var p=Qe;Qe|=4;try{uv(o,r);var v=fp,_=g0(r.containerInfo),x=v.focusedElem,R=v.selectionRange;if(_!==x&&x&&x.ownerDocument&&m0(x.ownerDocument.documentElement,x)){if(R!==null&&Hf(x)){var F=R.start,Y=R.end;if(Y===void 0&&(Y=F),"selectionStart"in x)x.selectionStart=F,x.selectionEnd=Math.min(Y,x.value.length);else{var J=x.ownerDocument||document,j=J&&J.defaultView||window;if(j.getSelection){var $=j.getSelection(),ge=x.textContent.length,Ie=Math.min(R.start,ge),st=R.end===void 0?Ie:Math.min(R.end,ge);!$.extend&&Ie>st&&(_=st,st=Ie,Ie=_);var V=p0(x,Ie),P=p0(x,st);if(V&&P&&($.rangeCount!==1||$.anchorNode!==V.node||$.anchorOffset!==V.offset||$.focusNode!==P.node||$.focusOffset!==P.offset)){var B=J.createRange();B.setStart(V.node,V.offset),$.removeAllRanges(),Ie>st?($.addRange(B),$.extend(P.node,P.offset)):(B.setEnd(P.node,P.offset),$.addRange(B))}}}}for(J=[],$=x;$=$.parentNode;)$.nodeType===1&&J.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<J.length;x++){var X=J[x];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}zu=!!dp,fp=dp=null}finally{Qe=p,z.p=u,H.T=l}}r.current=o,Ft=2}}function Rv(){if(Ft===2){Ft=0;var r=to,o=Ya,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var u=z.p;z.p=2;var p=Qe;Qe|=4;try{ov(r,o.alternate,o)}finally{Qe=p,z.p=u,H.T=l}}Ft=3}}function Dv(){if(Ft===4||Ft===3){Ft=0,Yi();var r=to,o=Ya,l=br,u=yv;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Ft=5:(Ft=0,Ya=to=null,Mv(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(eo=null),Qi(l),o=o.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Ir,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=H.T,p=z.p,z.p=2,H.T=null;try{for(var v=r.onRecoverableError,_=0;_<u.length;_++){var x=u[_];v(x.value,{componentStack:x.stack})}}finally{H.T=o,z.p=p}}(br&3)!==0&&Tu(),Ni(r),p=r.pendingLanes,(l&261930)!==0&&(p&42)!==0?r===Zh?vl++:(vl=0,Zh=r):vl=0,yl(0)}}function Mv(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,Zs(o)))}function Tu(){return Iv(),Rv(),Dv(),Ov()}function Ov(){if(Ft!==5)return!1;var r=to,o=Xh;Xh=0;var l=Qi(br),u=H.T,p=z.p;try{z.p=32>l?32:l,H.T=null,l=Qh,Qh=null;var v=to,_=br;if(Ft=0,Ya=to=null,br=0,(Qe&6)!==0)throw Error(i(331));var x=Qe;if(Qe|=4,mv(v.current),fv(v,v.current,_,l),Qe=x,yl(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Ir,v)}catch{}return!0}finally{z.p=p,H.T=u,Mv(r,o)}}function Pv(r,o,l){o=ii(l,o),o=Ih(r.stateNode,o,2),r=Kr(r,o,2),r!==null&&(Zn(r,2),Ni(r))}function it(r,o,l){if(r.tag===3)Pv(r,r,l);else for(;o!==null;){if(o.tag===3){Pv(o,r,l);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(eo===null||!eo.has(u))){r=ii(l,r),l=N1(2),u=Kr(o,l,2),u!==null&&(H1(l,u,o,r),Zn(u,2),Ni(u));break}}o=o.return}}function tp(r,o,l){var u=r.pingCache;if(u===null){u=r.pingCache=new dw;var p=new Set;u.set(o,p)}else p=u.get(o),p===void 0&&(p=new Set,u.set(o,p));p.has(l)||(Wh=!0,p.add(l),r=gw.bind(null,r,o,l),o.then(r,r))}function gw(r,o,l){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,ut===r&&($e&l)===l&&(At===4||At===3&&($e&62914560)===$e&&300>bn()-Su?(Qe&2)===0&&Xa(r,0):Kh|=l,Ka===$e&&(Ka=0)),Ni(r)}function Nv(r,o){o===0&&(o=nn()),r=No(r,o),r!==null&&(Zn(r,o),Ni(r))}function vw(r){var o=r.memoizedState,l=0;o!==null&&(l=o.retryLane),Nv(r,l)}function yw(r,o){var l=0;switch(r.tag){case 31:case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(o),Nv(r,l)}function bw(r,o){return Qn(r,o)}var ku=null,Za=null,np=!1,Au=!1,ip=!1,io=0;function Ni(r){r!==Za&&r.next===null&&(Za===null?ku=Za=r:Za=Za.next=r),Au=!0,np||(np=!0,_w())}function yl(r,o){if(!ip&&Au){ip=!0;do for(var l=!1,u=ku;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var v=0;else{var _=u.suspendedLanes,x=u.pingedLanes;v=(1<<31-tn(42|r)+1)-1,v&=p&~(_&~x),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,Bv(u,v))}else v=$e,v=ma(u,u===ut?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||To(u,v)||(l=!0,Bv(u,v));u=u.next}while(l);ip=!1}}function Sw(){Hv()}function Hv(){Au=np=!1;var r=0;io!==0&&Rw()&&(r=io);for(var o=bn(),l=null,u=ku;u!==null;){var p=u.next,v=zv(u,o);v===0?(u.next=null,l===null?ku=p:l.next=p,p===null&&(Za=l)):(l=u,(r!==0||(v&3)!==0)&&(Au=!0)),u=p}Ft!==0&&Ft!==5||yl(r),io!==0&&(io=0)}function zv(r,o){for(var l=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var _=31-tn(v),x=1<<_,R=p[_];R===-1?((x&l)===0||(x&u)!==0)&&(p[_]=kf(x,o)):R<=o&&(r.expiredLanes|=x),v&=~x}if(o=ut,l=$e,l=ma(r,r===o?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,l===0||r===o&&(nt===2||nt===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&Ki(u),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||To(r,l)){if(o=l&-l,o===r.callbackPriority)return o;switch(u!==null&&Ki(u),Qi(l)){case 2:case 8:l=ha;break;case 32:l=Ai;break;case 268435456:l=Lr;break;default:l=Ai}return u=Vv.bind(null,r),l=Qn(l,u),r.callbackPriority=o,r.callbackNode=l,o}return u!==null&&u!==null&&Ki(u),r.callbackPriority=2,r.callbackNode=null,2}function Vv(r,o){if(Ft!==0&&Ft!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Tu()&&r.callbackNode!==l)return null;var u=$e;return u=ma(r,r===ut?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(Sv(r,u,o),zv(r,bn()),r.callbackNode!=null&&r.callbackNode===l?Vv.bind(null,r):null)}function Bv(r,o){if(Tu())return null;Sv(r,o,!0)}function _w(){Mw(function(){(Qe&6)!==0?Qn(Ze,Sw):Hv()})}function rp(){if(io===0){var r=Ha;r===0&&(r=wo,wo<<=1,(wo&261888)===0&&(wo=256)),io=r}return io}function Uv(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:ko(""+r)}function Fv(r,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,r.id&&l.setAttribute("form",r.id),o.parentNode.insertBefore(l,o),r=new FormData(r),l.parentNode.removeChild(l),r}function Cw(r,o,l,u,p){if(o==="submit"&&l&&l.stateNode===p){var v=Uv((p[Kt]||null).action),_=u.submitter;_&&(o=(o=_[Kt]||null)?Uv(o.formAction):_.getAttribute("formAction"),o!==null&&(v=o,_=null));var x=new wa("action","action",null,u,p);r.push({event:x,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(io!==0){var R=_?Fv(p,_):new FormData(p);wh(l,{pending:!0,data:R,method:p.method,action:v},null,R)}}else typeof v=="function"&&(x.preventDefault(),R=_?Fv(p,_):new FormData(p),wh(l,{pending:!0,data:R,method:p.method,action:v},v,R))},currentTarget:p}]})}}for(var op=0;op<Uf.length;op++){var ap=Uf[op],Ew=ap.toLowerCase(),ww=ap[0].toUpperCase()+ap.slice(1);bi(Ew,"on"+ww)}bi(b0,"onAnimationEnd"),bi(S0,"onAnimationIteration"),bi(_0,"onAnimationStart"),bi("dblclick","onDoubleClick"),bi("focusin","onFocus"),bi("focusout","onBlur"),bi(B5,"onTransitionRun"),bi(U5,"onTransitionStart"),bi(F5,"onTransitionCancel"),bi(C0,"onTransitionEnd"),Et("onMouseEnter",["mouseout","mouseover"]),Et("onMouseLeave",["mouseout","mouseover"]),Et("onPointerEnter",["pointerout","pointerover"]),Et("onPointerLeave",["pointerout","pointerover"]),Jn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bl));function jv(r,o){o=(o&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],p=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var _=u.length-1;0<=_;_--){var x=u[_],R=x.instance,F=x.currentTarget;if(x=x.listener,R!==v&&p.isPropagationStopped())break e;v=x,p.currentTarget=F;try{v(p)}catch(Y){jc(Y)}p.currentTarget=null,v=R}else for(_=0;_<u.length;_++){if(x=u[_],R=x.instance,F=x.currentTarget,x=x.listener,R!==v&&p.isPropagationStopped())break e;v=x,p.currentTarget=F;try{v(p)}catch(Y){jc(Y)}p.currentTarget=null,v=R}}}}function je(r,o){var l=o[Ls];l===void 0&&(l=o[Ls]=new Set);var u=r+"__bubble";l.has(u)||($v(o,r,2,!1),l.add(u))}function sp(r,o,l){var u=0;o&&(u|=4),$v(l,r,u,o)}var Lu="_reactListening"+Math.random().toString(36).slice(2);function lp(r){if(!r[Lu]){r[Lu]=!0,Mc.forEach(function(l){l!=="selectionchange"&&(xw.has(l)||sp(l,!1,r),sp(l,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Lu]||(o[Lu]=!0,sp("selectionchange",!1,o))}}function $v(r,o,l,u){switch(by(o)){case 2:var p=Jw;break;case 8:p=ex;break;default:p=Ep}l=p.bind(null,o,l,r),p=void 0,!Vs||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),u?p!==void 0?r.addEventListener(o,l,{capture:!0,passive:p}):r.addEventListener(o,l,!0):p!==void 0?r.addEventListener(o,l,{passive:p}):r.addEventListener(o,l,!1)}function cp(r,o,l,u,p){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var _=u.tag;if(_===3||_===4){var x=u.stateNode.containerInfo;if(x===p)break;if(_===4)for(_=u.return;_!==null;){var R=_.tag;if((R===3||R===4)&&_.stateNode.containerInfo===p)return;_=_.return}for(;x!==null;){if(_=Dr(x),_===null)return;if(R=_.tag,R===5||R===6||R===26||R===27){u=v=_;continue e}x=x.parentNode}}u=u.return}Nc(function(){var F=v,Y=Ns(l),J=[];e:{var j=E0.get(r);if(j!==void 0){var $=wa,ge=r;switch(r){case"keypress":if(Ca(l)===0)break e;case"keydown":case"keyup":$=Z;break;case"focusin":ge="focus",$=Fs;break;case"focusout":ge="blur",$=Fs;break;case"beforeblur":case"afterblur":$=Fs;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Us;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Lf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=Ae;break;case b0:case S0:case _0:$=js;break;case C0:$=ke;break;case"scroll":case"scrollend":$=Ur;break;case"wheel":$=rt;break;case"copy":case"cut":case"paste":$=Ta;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=ue;break;case"toggle":case"beforetoggle":$=ht}var Ie=(o&4)!==0,st=!Ie&&(r==="scroll"||r==="scrollend"),V=Ie?j!==null?j+"Capture":null:j;Ie=[];for(var P=F,B;P!==null;){var X=P;if(B=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||B===null||V===null||(X=Ao(P,V),X!=null&&Ie.push(Sl(P,X,B))),st)break;P=P.return}0<Ie.length&&(j=new $(j,ge,null,l,Y),J.push({event:j,listeners:Ie}))}}if((o&7)===0){e:{if(j=r==="mouseover"||r==="pointerover",$=r==="mouseout"||r==="pointerout",j&&l!==Ps&&(ge=l.relatedTarget||l.fromElement)&&(Dr(ge)||ge[rn]))break e;if(($||j)&&(j=Y.window===Y?Y:(j=Y.ownerDocument)?j.defaultView||j.parentWindow:window,$?(ge=l.relatedTarget||l.toElement,$=F,ge=ge?Dr(ge):null,ge!==null&&(st=s(ge),Ie=ge.tag,ge!==st||Ie!==5&&Ie!==27&&Ie!==6)&&(ge=null)):($=null,ge=F),$!==ge)){if(Ie=Us,X="onMouseLeave",V="onMouseEnter",P="mouse",(r==="pointerout"||r==="pointerover")&&(Ie=ue,X="onPointerLeave",V="onPointerEnter",P="pointer"),st=$==null?j:mi($),B=ge==null?j:mi(ge),j=new Ie(X,P+"leave",$,l,Y),j.target=st,j.relatedTarget=B,X=null,Dr(Y)===F&&(Ie=new Ie(V,P+"enter",ge,l,Y),Ie.target=B,Ie.relatedTarget=st,X=Ie),st=X,$&&ge)t:{for(Ie=Tw,V=$,P=ge,B=0,X=V;X;X=Ie(X))B++;X=0;for(var xe=P;xe;xe=Ie(xe))X++;for(;0<B-X;)V=Ie(V),B--;for(;0<X-B;)P=Ie(P),X--;for(;B--;){if(V===P||P!==null&&V===P.alternate){Ie=V;break t}V=Ie(V),P=Ie(P)}Ie=null}else Ie=null;$!==null&&qv(J,j,$,Ie,!1),ge!==null&&st!==null&&qv(J,st,ge,Ie,!0)}}e:{if(j=F?mi(F):window,$=j.nodeName&&j.nodeName.toLowerCase(),$==="select"||$==="input"&&j.type==="file")var Ke=l0;else if(Uc(j))if(c0)Ke=H5;else{Ke=P5;var ye=O5}else $=j.nodeName,!$||$.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?F&&ir(F.elementType)&&(Ke=l0):Ke=N5;if(Ke&&(Ke=Ke(r,F))){s0(J,Ke,l,Y);break e}ye&&ye(r,j,F),r==="focusout"&&F&&j.type==="number"&&F.memoizedProps.value!=null&&Nr(j,"number",j.value)}switch(ye=F?mi(F):window,r){case"focusin":(Uc(ye)||ye.contentEditable==="true")&&(La=ye,zf=F,Ys=null);break;case"focusout":Ys=zf=La=null;break;case"mousedown":Vf=!0;break;case"contextmenu":case"mouseup":case"dragend":Vf=!1,v0(J,l,Y);break;case"selectionchange":if(V5)break;case"keydown":case"keyup":v0(J,l,Y)}var ze;if(Cn)e:{switch(r){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else on?Mo(r,l)&&(qe="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(mt&&l.locale!=="ko"&&(on||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&on&&(ze=Hc()):(yi=Y,Bs="value"in yi?yi.value:yi.textContent,on=!0)),ye=Iu(F,qe),0<ye.length&&(qe=new Vc(qe,r,null,l,Y),J.push({event:qe,listeners:ye}),ze?qe.data=ze:(ze=vt(l),ze!==null&&(qe.data=ze)))),(ze=Xe?Aa(r,l):qs(r,l))&&(qe=Iu(F,"onBeforeInput"),0<qe.length&&(ye=new Vc("onBeforeInput","beforeinput",null,l,Y),J.push({event:ye,listeners:qe}),ye.data=ze)),Cw(J,r,F,l,Y)}jv(J,o)})}function Sl(r,o,l){return{instance:r,listener:o,currentTarget:l}}function Iu(r,o){for(var l=o+"Capture",u=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=Ao(r,l),p!=null&&u.unshift(Sl(r,p,v)),p=Ao(r,o),p!=null&&u.push(Sl(r,p,v))),r.tag===3)return u;r=r.return}return[]}function Tw(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function qv(r,o,l,u,p){for(var v=o._reactName,_=[];l!==null&&l!==u;){var x=l,R=x.alternate,F=x.stateNode;if(x=x.tag,R!==null&&R===u)break;x!==5&&x!==26&&x!==27||F===null||(R=F,p?(F=Ao(l,v),F!=null&&_.unshift(Sl(l,F,R))):p||(F=Ao(l,v),F!=null&&_.push(Sl(l,F,R)))),l=l.return}_.length!==0&&r.push({event:o,listeners:_})}var kw=/\r\n?/g,Aw=/\u0000|\uFFFD/g;function Gv(r){return(typeof r=="string"?r:""+r).replace(kw,`
1611
+ `).replace(Aw,"")}function Wv(r,o){return o=Gv(o),Gv(r)===o}function at(r,o,l,u,p,v){switch(l){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||_n(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&_n(r,""+u);break;case"className":tr(r,"class",u);break;case"tabIndex":tr(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":tr(r,l,u);break;case"style":Ms(r,u,v);break;case"data":if(o!=="object"){tr(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||l!=="href")){r.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=ko(""+u),r.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(o!=="input"&&at(r,o,"name",p.name,p,null),at(r,o,"formEncType",p.formEncType,p,null),at(r,o,"formMethod",p.formMethod,p,null),at(r,o,"formTarget",p.formTarget,p,null)):(at(r,o,"encType",p.encType,p,null),at(r,o,"method",p.method,p,null),at(r,o,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=ko(""+u),r.setAttribute(l,u);break;case"onClick":u!=null&&(r.onclick=ei);break;case"onScroll":u!=null&&je("scroll",r);break;case"onScrollEnd":u!=null&&je("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}l=ko(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""+u):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":u===!0?r.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,u):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(l,u):r.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(l):r.setAttribute(l,u);break;case"popover":je("beforetoggle",r),je("toggle",r),gi(r,"popover",u);break;case"xlinkActuate":Hn(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Hn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Hn(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Hn(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Hn(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Hn(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Hn(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":gi(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Sa.get(l)||l,gi(r,l,u))}}function up(r,o,l,u,p,v){switch(l){case"style":Ms(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(i(60));r.innerHTML=l}}break;case"children":typeof u=="string"?_n(r,u):(typeof u=="number"||typeof u=="bigint")&&_n(r,""+u);break;case"onScroll":u!=null&&je("scroll",r);break;case"onScrollEnd":u!=null&&je("scrollend",r);break;case"onClick":u!=null&&(r.onclick=ei);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!It.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),o=l.slice(2,p?l.length-7:void 0),v=r[Kt]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(o,v,p),typeof u=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(o,u,p);break e}l in r?r[l]=u:u===!0?r.setAttribute(l,""):gi(r,l,u)}}}function cn(r,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",r),je("load",r);var u=!1,p=!1,v;for(v in l)if(l.hasOwnProperty(v)){var _=l[v];if(_!=null)switch(v){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:at(r,o,v,_,l,null)}}p&&at(r,o,"srcSet",l.srcSet,l,null),u&&at(r,o,"src",l.src,l,null);return;case"input":je("invalid",r);var x=v=_=p=null,R=null,F=null;for(u in l)if(l.hasOwnProperty(u)){var Y=l[u];if(Y!=null)switch(u){case"name":p=Y;break;case"type":_=Y;break;case"checked":R=Y;break;case"defaultChecked":F=Y;break;case"value":v=Y;break;case"defaultValue":x=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,o));break;default:at(r,o,u,Y,l,null)}}Oc(r,v,x,R,F,_,p,!1);return;case"select":je("invalid",r),u=_=v=null;for(p in l)if(l.hasOwnProperty(p)&&(x=l[p],x!=null))switch(p){case"value":v=x;break;case"defaultValue":_=x;break;case"multiple":u=x;default:at(r,o,p,x,l,null)}o=v,l=_,r.multiple=!!u,o!=null?Hr(r,!!u,o,!1):l!=null&&Hr(r,!!u,l,!0);return;case"textarea":je("invalid",r),v=p=u=null;for(_ in l)if(l.hasOwnProperty(_)&&(x=l[_],x!=null))switch(_){case"value":u=x;break;case"defaultValue":p=x;break;case"children":v=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(i(91));break;default:at(r,o,_,x,l,null)}Pc(r,u,p,v);return;case"option":for(R in l)if(l.hasOwnProperty(R)&&(u=l[R],u!=null))switch(R){case"selected":r.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:at(r,o,R,u,l,null)}return;case"dialog":je("beforetoggle",r),je("toggle",r),je("cancel",r),je("close",r);break;case"iframe":case"object":je("load",r);break;case"video":case"audio":for(u=0;u<bl.length;u++)je(bl[u],r);break;case"image":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"embed":case"source":case"link":je("error",r),je("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(u=l[F],u!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:at(r,o,F,u,l,null)}return;default:if(ir(o)){for(Y in l)l.hasOwnProperty(Y)&&(u=l[Y],u!==void 0&&up(r,o,Y,u,l,void 0));return}}for(x in l)l.hasOwnProperty(x)&&(u=l[x],u!=null&&at(r,o,x,u,l,null))}function Lw(r,o,l,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,_=null,x=null,R=null,F=null,Y=null;for($ in l){var J=l[$];if(l.hasOwnProperty($)&&J!=null)switch($){case"checked":break;case"value":break;case"defaultValue":R=J;default:u.hasOwnProperty($)||at(r,o,$,null,u,J)}}for(var j in u){var $=u[j];if(J=l[j],u.hasOwnProperty(j)&&($!=null||J!=null))switch(j){case"type":v=$;break;case"name":p=$;break;case"checked":F=$;break;case"defaultChecked":Y=$;break;case"value":_=$;break;case"defaultValue":x=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(i(137,o));break;default:$!==J&&at(r,o,j,$,u,J)}}ya(r,_,x,R,F,Y,v,p);return;case"select":$=_=x=j=null;for(v in l)if(R=l[v],l.hasOwnProperty(v)&&R!=null)switch(v){case"value":break;case"multiple":$=R;default:u.hasOwnProperty(v)||at(r,o,v,null,u,R)}for(p in u)if(v=u[p],R=l[p],u.hasOwnProperty(p)&&(v!=null||R!=null))switch(p){case"value":j=v;break;case"defaultValue":x=v;break;case"multiple":_=v;default:v!==R&&at(r,o,p,v,u,R)}o=x,l=_,u=$,j!=null?Hr(r,!!l,j,!1):!!u!=!!l&&(o!=null?Hr(r,!!l,o,!0):Hr(r,!!l,l?[]:"",!1));return;case"textarea":$=j=null;for(x in l)if(p=l[x],l.hasOwnProperty(x)&&p!=null&&!u.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:at(r,o,x,null,u,p)}for(_ in u)if(p=u[_],v=l[_],u.hasOwnProperty(_)&&(p!=null||v!=null))switch(_){case"value":j=p;break;case"defaultValue":$=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==v&&at(r,o,_,p,u,v)}Ds(r,j,$);return;case"option":for(var ge in l)if(j=l[ge],l.hasOwnProperty(ge)&&j!=null&&!u.hasOwnProperty(ge))switch(ge){case"selected":r.selected=!1;break;default:at(r,o,ge,null,u,j)}for(R in u)if(j=u[R],$=l[R],u.hasOwnProperty(R)&&j!==$&&(j!=null||$!=null))switch(R){case"selected":r.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:at(r,o,R,j,u,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in l)j=l[Ie],l.hasOwnProperty(Ie)&&j!=null&&!u.hasOwnProperty(Ie)&&at(r,o,Ie,null,u,j);for(F in u)if(j=u[F],$=l[F],u.hasOwnProperty(F)&&j!==$&&(j!=null||$!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(i(137,o));break;default:at(r,o,F,j,u,$)}return;default:if(ir(o)){for(var st in l)j=l[st],l.hasOwnProperty(st)&&j!==void 0&&!u.hasOwnProperty(st)&&up(r,o,st,void 0,u,j);for(Y in u)j=u[Y],$=l[Y],!u.hasOwnProperty(Y)||j===$||j===void 0&&$===void 0||up(r,o,Y,j,u,$);return}}for(var V in l)j=l[V],l.hasOwnProperty(V)&&j!=null&&!u.hasOwnProperty(V)&&at(r,o,V,null,u,j);for(J in u)j=u[J],$=l[J],!u.hasOwnProperty(J)||j===$||j==null&&$==null||at(r,o,J,j,u,$)}function Kv(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iw(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],v=p.transferSize,_=p.initiatorType,x=p.duration;if(v&&x&&Kv(_)){for(_=0,x=p.responseEnd,u+=1;u<l.length;u++){var R=l[u],F=R.startTime;if(F>x)break;var Y=R.transferSize,J=R.initiatorType;Y&&Kv(J)&&(R=R.responseEnd,_+=Y*(R<x?1:(x-F)/(R-F)))}if(--u,o+=8*(v+_)/(p.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var dp=null,fp=null;function Ru(r){return r.nodeType===9?r:r.ownerDocument}function Yv(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xv(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function hp(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var pp=null;function Rw(){var r=window.event;return r&&r.type==="popstate"?r===pp?!1:(pp=r,!0):(pp=null,!1)}var Qv=typeof setTimeout=="function"?setTimeout:void 0,Dw=typeof clearTimeout=="function"?clearTimeout:void 0,Zv=typeof Promise=="function"?Promise:void 0,Mw=typeof queueMicrotask=="function"?queueMicrotask:typeof Zv<"u"?function(r){return Zv.resolve(null).then(r).catch(Ow)}:Qv;function Ow(r){setTimeout(function(){throw r})}function ro(r){return r==="head"}function Jv(r,o){var l=o,u=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){r.removeChild(p),ns(o);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")_l(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,_l(l);for(var v=l.firstChild;v;){var _=v.nextSibling,x=v.nodeName;v[Sn]||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=_}}else l==="body"&&_l(r.ownerDocument.body);l=p}while(l);ns(o)}function ey(r,o){var l=r;r=0;do{var u=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=u}while(l)}function mp(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":mp(l),Zi(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function Pw(r,o,l,u){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[Sn])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=li(r.nextSibling),r===null)break}return null}function Nw(r,o,l){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=li(r.nextSibling),r===null))return null;return r}function ty(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=li(r.nextSibling),r===null))return null;return r}function gp(r){return r.data==="$?"||r.data==="$~"}function vp(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function Hw(r,o){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||l.readyState!=="loading")o();else{var u=function(){o(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function li(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var yp=null;function ny(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(o===0)return li(r.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}r=r.nextSibling}return null}function iy(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return r;o--}else l!=="/$"&&l!=="/&"||o++}r=r.previousSibling}return null}function ry(r,o,l){switch(o=Ru(l),r){case"html":if(r=o.documentElement,!r)throw Error(i(452));return r;case"head":if(r=o.head,!r)throw Error(i(453));return r;case"body":if(r=o.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function _l(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Zi(r)}var ci=new Map,oy=new Set;function Du(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Sr=z.d;z.d={f:zw,r:Vw,D:Bw,C:Uw,L:Fw,m:jw,X:qw,S:$w,M:Gw};function zw(){var r=Sr.f(),o=Eu();return r||o}function Vw(r){var o=Mr(r);o!==null&&o.tag===5&&o.type==="form"?C1(o):Sr.r(r)}var Ja=typeof document>"u"?null:document;function ay(r,o,l){var u=Ja;if(u&&typeof o=="string"&&o){var p=Yt(o);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),oy.has(p)||(oy.add(p),r={rel:r,crossOrigin:l,href:o},u.querySelector(p)===null&&(o=u.createElement("link"),cn(o,"link",r),Pt(o),u.head.appendChild(o)))}}function Bw(r){Sr.D(r),ay("dns-prefetch",r,null)}function Uw(r,o){Sr.C(r,o),ay("preconnect",r,o)}function Fw(r,o,l){Sr.L(r,o,l);var u=Ja;if(u&&r&&o){var p='link[rel="preload"][as="'+Yt(o)+'"]';o==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Yt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Yt(l.imageSizes)+'"]')):p+='[href="'+Yt(r)+'"]';var v=p;switch(o){case"style":v=es(r);break;case"script":v=ts(r)}ci.has(v)||(r=g({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:r,as:o},l),ci.set(v,r),u.querySelector(p)!==null||o==="style"&&u.querySelector(Cl(v))||o==="script"&&u.querySelector(El(v))||(o=u.createElement("link"),cn(o,"link",r),Pt(o),u.head.appendChild(o)))}}function jw(r,o){Sr.m(r,o);var l=Ja;if(l&&r){var u=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+Yt(u)+'"][href="'+Yt(r)+'"]',v=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ts(r)}if(!ci.has(v)&&(r=g({rel:"modulepreload",href:r},o),ci.set(v,r),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(El(v)))return}u=l.createElement("link"),cn(u,"link",r),Pt(u),l.head.appendChild(u)}}}function $w(r,o,l){Sr.S(r,o,l);var u=Ja;if(u&&r){var p=Ji(u).hoistableStyles,v=es(r);o=o||"default";var _=p.get(v);if(!_){var x={loading:0,preload:null};if(_=u.querySelector(Cl(v)))x.loading=5;else{r=g({rel:"stylesheet",href:r,"data-precedence":o},l),(l=ci.get(v))&&bp(r,l);var R=_=u.createElement("link");Pt(R),cn(R,"link",r),R._p=new Promise(function(F,Y){R.onload=F,R.onerror=Y}),R.addEventListener("load",function(){x.loading|=1}),R.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Mu(_,o,u)}_={type:"stylesheet",instance:_,count:1,state:x},p.set(v,_)}}}function qw(r,o){Sr.X(r,o);var l=Ja;if(l&&r){var u=Ji(l).hoistableScripts,p=ts(r),v=u.get(p);v||(v=l.querySelector(El(p)),v||(r=g({src:r,async:!0},o),(o=ci.get(p))&&Sp(r,o),v=l.createElement("script"),Pt(v),cn(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function Gw(r,o){Sr.M(r,o);var l=Ja;if(l&&r){var u=Ji(l).hoistableScripts,p=ts(r),v=u.get(p);v||(v=l.querySelector(El(p)),v||(r=g({src:r,async:!0,type:"module"},o),(o=ci.get(p))&&Sp(r,o),v=l.createElement("script"),Pt(v),cn(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function sy(r,o,l,u){var p=(p=Se.current)?Du(p):null;if(!p)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=es(l.href),l=Ji(p).hoistableStyles,u=l.get(o),u||(u={type:"style",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=es(l.href);var v=Ji(p).hoistableStyles,_=v.get(r);if(_||(p=p.ownerDocument||p,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,_),(v=p.querySelector(Cl(r)))&&!v._p&&(_.instance=v,_.state.loading=5),ci.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ci.set(r,l),v||Ww(p,r,l,_.state))),o&&u===null)throw Error(i(528,""));return _}if(o&&u!==null)throw Error(i(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ts(l),l=Ji(p).hoistableScripts,u=l.get(o),u||(u={type:"script",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function es(r){return'href="'+Yt(r)+'"'}function Cl(r){return'link[rel="stylesheet"]['+r+"]"}function ly(r){return g({},r,{"data-precedence":r.precedence,precedence:null})}function Ww(r,o,l,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),cn(o,"link",l),Pt(o),r.head.appendChild(o))}function ts(r){return'[src="'+Yt(r)+'"]'}function El(r){return"script[async]"+r}function cy(r,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Yt(l.href)+'"]');if(u)return o.instance=u,Pt(u),u;var p=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Pt(u),cn(u,"style",p),Mu(u,l.precedence,r),o.instance=u;case"stylesheet":p=es(l.href);var v=r.querySelector(Cl(p));if(v)return o.state.loading|=4,o.instance=v,Pt(v),v;u=ly(l),(p=ci.get(p))&&bp(u,p),v=(r.ownerDocument||r).createElement("link"),Pt(v);var _=v;return _._p=new Promise(function(x,R){_.onload=x,_.onerror=R}),cn(v,"link",u),o.state.loading|=4,Mu(v,l.precedence,r),o.instance=v;case"script":return v=ts(l.src),(p=r.querySelector(El(v)))?(o.instance=p,Pt(p),p):(u=l,(p=ci.get(v))&&(u=g({},l),Sp(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),Pt(p),cn(p,"link",u),r.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,Mu(u,l.precedence,r));return o.instance}function Mu(r,o,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,v=p,_=0;_<u.length;_++){var x=u[_];if(x.dataset.precedence===o)v=x;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(r,o.firstChild))}function bp(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Sp(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var Ou=null;function uy(r,o,l){if(Ou===null){var u=new Map,p=Ou=new Map;p.set(l,u)}else p=Ou,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(r))return u;for(u.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var v=l[p];if(!(v[Sn]||v[Ct]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var _=v.getAttribute(o)||"";_=r+_;var x=u.get(_);x?x.push(v):u.set(_,[v])}}return u}function dy(r,o,l){r=r.ownerDocument||r,r.head.insertBefore(l,o==="title"?r.querySelector("head > title"):null)}function Kw(r,o,l){if(l===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function fy(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Yw(r,o,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=es(u.href),v=o.querySelector(Cl(p));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=Pu.bind(r),o.then(r,r)),l.state.loading|=4,l.instance=v,Pt(v);return}v=o.ownerDocument||o,u=ly(u),(p=ci.get(p))&&bp(u,p),v=v.createElement("link"),Pt(v);var _=v;_._p=new Promise(function(x,R){_.onload=x,_.onerror=R}),cn(v,"link",u),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=Pu.bind(r),o.addEventListener("load",l),o.addEventListener("error",l))}}var _p=0;function Xw(r,o){return r.stylesheets&&r.count===0&&Hu(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var u=setTimeout(function(){if(r.stylesheets&&Hu(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&_p===0&&(_p=62500*Iw());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Hu(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>_p?50:800)+o);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Pu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Hu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Nu=null;function Hu(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Nu=new Map,o.forEach(Qw,r),Nu=null,Pu.call(r))}function Qw(r,o){if(!(o.state.loading&4)){var l=Nu.get(r);if(l)var u=l.get(null);else{l=new Map,Nu.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var _=p[v];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(l.set(_.dataset.precedence,_),u=_)}u&&l.set(null,u)}p=o.instance,_=p.getAttribute("data-precedence"),v=l.get(_)||u,v===u&&l.set(null,p),l.set(_,p),this.count++,u=Pu.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),o.state.loading|=4}}var wl={$$typeof:T,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function Zw(r,o,l,u,p,v,_,x,R){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ii(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ii(0),this.hiddenUpdates=Ii(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function hy(r,o,l,u,p,v,_,x,R,F,Y,J){return r=new Zw(r,o,l,_,R,F,Y,J,x),o=1,v===!0&&(o|=24),v=Bn(3,null,null,o),r.current=v,v.stateNode=r,o=eh(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:o},rh(v),r}function py(r){return r?(r=Da,r):Da}function my(r,o,l,u,p,v){p=py(p),u.context===null?u.context=p:u.pendingContext=p,u=Wr(o),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=Kr(r,u,o),l!==null&&(Mn(l,r,o),nl(l,r,o))}function gy(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<o?l:o}}function Cp(r,o){gy(r,o),(r=r.alternate)&&gy(r,o)}function vy(r){if(r.tag===13||r.tag===31){var o=No(r,67108864);o!==null&&Mn(o,r,67108864),Cp(r,67108864)}}function yy(r){if(r.tag===13||r.tag===31){var o=qn();o=Ts(o);var l=No(r,o);l!==null&&Mn(l,r,o),Cp(r,o)}}var zu=!0;function Jw(r,o,l,u){var p=H.T;H.T=null;var v=z.p;try{z.p=2,Ep(r,o,l,u)}finally{z.p=v,H.T=p}}function ex(r,o,l,u){var p=H.T;H.T=null;var v=z.p;try{z.p=8,Ep(r,o,l,u)}finally{z.p=v,H.T=p}}function Ep(r,o,l,u){if(zu){var p=wp(u);if(p===null)cp(r,o,u,Vu,l),Sy(r,u);else if(nx(p,r,o,l,u))u.stopPropagation();else if(Sy(r,u),o&4&&-1<tx.indexOf(r)){for(;p!==null;){var v=Mr(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var _=Xi(v.pendingLanes);if(_!==0){var x=v;for(x.pendingLanes|=2,x.entangledLanes|=2;_;){var R=1<<31-tn(_);x.entanglements[1]|=R,_&=~R}Ni(v),(Qe&6)===0&&(_u=bn()+500,yl(0))}}break;case 31:case 13:x=No(v,2),x!==null&&Mn(x,v,2),Eu(),Cp(v,2)}if(v=wp(u),v===null&&cp(r,o,u,Vu,l),v===p)break;p=v}p!==null&&u.stopPropagation()}else cp(r,o,u,null,l)}}function wp(r){return r=Ns(r),xp(r)}var Vu=null;function xp(r){if(Vu=null,r=Dr(r),r!==null){var o=s(r);if(o===null)r=null;else{var l=o.tag;if(l===13){if(r=c(o),r!==null)return r;r=null}else if(l===31){if(r=d(o),r!==null)return r;r=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Vu=r,null}function by(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(wf()){case Ze:return 2;case ha:return 8;case Ai:case pa:return 32;case Lr:return 268435456;default:return 32}default:return 32}}var Tp=!1,oo=null,ao=null,so=null,xl=new Map,Tl=new Map,lo=[],tx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sy(r,o){switch(r){case"focusin":case"focusout":oo=null;break;case"dragenter":case"dragleave":ao=null;break;case"mouseover":case"mouseout":so=null;break;case"pointerover":case"pointerout":xl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(o.pointerId)}}function kl(r,o,l,u,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[p]},o!==null&&(o=Mr(o),o!==null&&vy(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),r)}function nx(r,o,l,u,p){switch(o){case"focusin":return oo=kl(oo,r,o,l,u,p),!0;case"dragenter":return ao=kl(ao,r,o,l,u,p),!0;case"mouseover":return so=kl(so,r,o,l,u,p),!0;case"pointerover":var v=p.pointerId;return xl.set(v,kl(xl.get(v)||null,r,o,l,u,p)),!0;case"gotpointercapture":return v=p.pointerId,Tl.set(v,kl(Tl.get(v)||null,r,o,l,u,p)),!0}return!1}function _y(r){var o=Dr(r.target);if(o!==null){var l=s(o);if(l!==null){if(o=l.tag,o===13){if(o=c(l),o!==null){r.blockedOn=o,As(r.priority,function(){yy(l)});return}}else if(o===31){if(o=d(l),o!==null){r.blockedOn=o,As(r.priority,function(){yy(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Bu(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var l=wp(r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);Ps=u,l.target.dispatchEvent(u),Ps=null}else return o=Mr(l),o!==null&&vy(o),r.blockedOn=l,!1;o.shift()}return!0}function Cy(r,o,l){Bu(r)&&l.delete(o)}function ix(){Tp=!1,oo!==null&&Bu(oo)&&(oo=null),ao!==null&&Bu(ao)&&(ao=null),so!==null&&Bu(so)&&(so=null),xl.forEach(Cy),Tl.forEach(Cy)}function Uu(r,o){r.blockedOn===o&&(r.blockedOn=null,Tp||(Tp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ix)))}var Fu=null;function Ey(r){Fu!==r&&(Fu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fu===r&&(Fu=null);for(var o=0;o<r.length;o+=3){var l=r[o],u=r[o+1],p=r[o+2];if(typeof u!="function"){if(xp(u||l)===null)continue;break}var v=Mr(l);v!==null&&(r.splice(o,3),o-=3,wh(v,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function ns(r){function o(R){return Uu(R,r)}oo!==null&&Uu(oo,r),ao!==null&&Uu(ao,r),so!==null&&Uu(so,r),xl.forEach(o),Tl.forEach(o);for(var l=0;l<lo.length;l++){var u=lo[l];u.blockedOn===r&&(u.blockedOn=null)}for(;0<lo.length&&(l=lo[0],l.blockedOn===null);)_y(l),l.blockedOn===null&&lo.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],v=l[u+1],_=p[Kt]||null;if(typeof v=="function")_||Ey(l);else if(_){var x=null;if(v&&v.hasAttribute("formAction")){if(p=v,_=v[Kt]||null)x=_.formAction;else if(xp(p)!==null)continue}else x=_.action;typeof x=="function"?l[u+1]=x:(l.splice(u,3),u-=3),Ey(l)}}}function wy(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(_){return p=_})},focusReset:"manual",scroll:"manual"})}function o(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),p!==null&&(p(),p=null)}}}function kp(r){this._internalRoot=r}ju.prototype.render=kp.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(i(409));var l=o.current,u=qn();my(l,u,r,o,null,null)},ju.prototype.unmount=kp.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;my(r.current,2,null,r,null,null),Eu(),o[rn]=null}};function ju(r){this._internalRoot=r}ju.prototype.unstable_scheduleHydration=function(r){if(r){var o=ks();r={blockedOn:null,target:r,priority:o};for(var l=0;l<lo.length&&o!==0&&o<lo[l].priority;l++);lo.splice(l,0,r),l===0&&_y(r)}};var xy=t.version;if(xy!=="19.2.8")throw Error(i(527,xy,"19.2.8"));z.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=h(o),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var rx={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{Ir=$u.inject(rx),Wt=$u}catch{}}return Ol.createRoot=function(r,o){if(!a(r))throw Error(i(299));var l=!1,u="",p=D1,v=M1,_=O1;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError)),o=hy(r,1,!1,null,null,l,u,null,p,v,_,wy),r[rn]=o.current,lp(r),new kp(o)},Ol.hydrateRoot=function(r,o,l){if(!a(r))throw Error(i(299));var u=!1,p="",v=D1,_=M1,x=O1,R=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(_=l.onCaughtError),l.onRecoverableError!==void 0&&(x=l.onRecoverableError),l.formState!==void 0&&(R=l.formState)),o=hy(r,1,!0,o,l??null,u,p,R,v,_,x,wy),o.context=py(null),l=o.current,u=qn(),u=Ts(u),p=Wr(u),p.callback=null,Kr(l,p,u),l=u,o.current.lanes=l,Zn(o,l),Ni(o),r[rn]=o.current,lp(r),new ju(o)},Ol.version="19.2.8",Ol}var _S;function dI(){if(_S)return cm.exports;_S=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cm.exports=uI(),cm.exports}var fI=dI();function pi(e,t){if(e==null)return{};var n={},i=Object.keys(e),a,s;for(s=0;s<i.length;s++)a=i[s],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var hI=["color"],pI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,hI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M11.5 1C11.7761 1 12 1.22386 12 1.5V13.5C12 13.7761 11.7761 14 11.5 14C11.2239 14 11 13.7761 11 13.5V1.5C11 1.22386 11.2239 1 11.5 1ZM9.5 3C9.77614 3 10 3.22386 10 3.5V13.5C10 13.7761 9.77614 14 9.5 14C9.22386 14 9 13.7761 9 13.5V3.5C9 3.22386 9.22386 3 9.5 3ZM13.5 3C13.7761 3 14 3.22386 14 3.5V13.5C14 13.7761 13.7761 14 13.5 14C13.2239 14 13 13.7761 13 13.5V3.5C13 3.22386 13.2239 3 13.5 3ZM5.5 4C5.77614 4 6 4.22386 6 4.5V13.5C6 13.7761 5.77614 14 5.5 14C5.22386 14 5 13.7761 5 13.5V4.5C5 4.22386 5.22386 4 5.5 4ZM1.5 5C1.77614 5 2 5.22386 2 5.5V13.5C2 13.7761 1.77614 14 1.5 14C1.22386 14 1 13.7761 1 13.5V5.5C1 5.22386 1.22386 5 1.5 5ZM7.5 5C7.77614 5 8 5.22386 8 5.5V13.5C8 13.7761 7.77614 14 7.5 14C7.22386 14 7 13.7761 7 13.5V5.5C7 5.22386 7.22386 5 7.5 5ZM3.5 7C3.77614 7 4 7.22386 4 7.5V13.5C4 13.7761 3.77614 14 3.5 14C3.22386 14 3 13.7761 3 13.5V7.5C3 7.22386 3.22386 7 3.5 7Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),mI=["color"],gI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,mI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M12.5 3L2.5 3.00002C1.67157 3.00002 1 3.6716 1 4.50002V9.50003C1 10.3285 1.67157 11 2.5 11H7.50003C7.63264 11 7.75982 11.0527 7.85358 11.1465L10 13.2929V11.5C10 11.2239 10.2239 11 10.5 11H12.5C13.3284 11 14 10.3285 14 9.50003V4.5C14 3.67157 13.3284 3 12.5 3ZM2.49999 2.00002L12.5 2C13.8807 2 15 3.11929 15 4.5V9.50003C15 10.8807 13.8807 12 12.5 12H11V14.5C11 14.7022 10.8782 14.8845 10.6913 14.9619C10.5045 15.0393 10.2894 14.9965 10.1464 14.8536L7.29292 12H2.5C1.11929 12 0 10.8807 0 9.50003V4.50002C0 3.11931 1.11928 2.00003 2.49999 2.00002Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),vI=["color"],EE=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,vI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),yI=["color"],bI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,yI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M2.14998 14V1H0.849976V14H2.14998ZM6.14998 14V1H4.84998V14H6.14998ZM10.15 1V14H8.84998V1H10.15ZM14.15 14V1H12.85V14H14.15Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),SI=["color"],_I=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,SI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),CI=["color"],EI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,CI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),wI=["color"],xI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,wI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),TI=["color"],kI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,TI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),AI=["color"],LI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,AI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M12.1464 1.14645C12.3417 0.951184 12.6583 0.951184 12.8535 1.14645L14.8535 3.14645C15.0488 3.34171 15.0488 3.65829 14.8535 3.85355L10.9109 7.79618C10.8349 7.87218 10.7471 7.93543 10.651 7.9835L6.72359 9.94721C6.53109 10.0435 6.29861 10.0057 6.14643 9.85355C5.99425 9.70137 5.95652 9.46889 6.05277 9.27639L8.01648 5.34897C8.06455 5.25283 8.1278 5.16507 8.2038 5.08907L12.1464 1.14645ZM12.5 2.20711L8.91091 5.79618L7.87266 7.87267L8.12731 8.12732L10.2038 7.08907L13.7929 3.5L12.5 2.20711ZM9.99998 2L8.99998 3H4.9C4.47171 3 4.18056 3.00039 3.95552 3.01877C3.73631 3.03668 3.62421 3.06915 3.54601 3.10899C3.35785 3.20487 3.20487 3.35785 3.10899 3.54601C3.06915 3.62421 3.03669 3.73631 3.01878 3.95552C3.00039 4.18056 3 4.47171 3 4.9V11.1C3 11.5283 3.00039 11.8194 3.01878 12.0445C3.03669 12.2637 3.06915 12.3758 3.10899 12.454C3.20487 12.6422 3.35785 12.7951 3.54601 12.891C3.62421 12.9309 3.73631 12.9633 3.95552 12.9812C4.18056 12.9996 4.47171 13 4.9 13H11.1C11.5283 13 11.8194 12.9996 12.0445 12.9812C12.2637 12.9633 12.3758 12.9309 12.454 12.891C12.6422 12.7951 12.7951 12.6422 12.891 12.454C12.9309 12.3758 12.9633 12.2637 12.9812 12.0445C12.9996 11.8194 13 11.5283 13 11.1V6.99998L14 5.99998V11.1V11.1207C14 11.5231 14 11.8553 13.9779 12.1259C13.9549 12.407 13.9057 12.6653 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.6653 13.9057 12.407 13.9549 12.1259 13.9779C11.8553 14 11.5231 14 11.1207 14H11.1H4.9H4.87934C4.47686 14 4.14468 14 3.87409 13.9779C3.59304 13.9549 3.33469 13.9057 3.09202 13.782C2.7157 13.5903 2.40973 13.2843 2.21799 12.908C2.09434 12.6653 2.04506 12.407 2.0221 12.1259C1.99999 11.8553 1.99999 11.5231 2 11.1207V11.1206V11.1V4.9V4.87935V4.87932V4.87931C1.99999 4.47685 1.99999 4.14468 2.0221 3.87409C2.04506 3.59304 2.09434 3.33469 2.21799 3.09202C2.40973 2.71569 2.7157 2.40973 3.09202 2.21799C3.33469 2.09434 3.59304 2.04506 3.87409 2.0221C4.14468 1.99999 4.47685 1.99999 4.87932 2H4.87935H4.9H9.99998Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),II=["color"],RI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,II);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M14 12.85L1 12.85L1 14.15L14 14.15L14 12.85ZM14 8.85002L1 8.85002L1 10.15L14 10.15L14 8.85002ZM1 4.85003L14 4.85003L14 6.15003L1 6.15002L1 4.85003ZM14 0.850025L1 0.850025L1 2.15002L14 2.15002L14 0.850025Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),DI=["color"],MI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,DI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}),OI=["color"],PI=W.forwardRef(function(e,t){var n=e.color,i=n===void 0?"currentColor":n,a=pi(e,OI);return W.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),W.createElement("path",{d:"M8 2H13.5C13.7761 2 14 2.22386 14 2.5V12.5C14 12.7761 13.7761 13 13.5 13H8V2ZM7 2H1.5C1.22386 2 1 2.22386 1 2.5V12.5C1 12.7761 1.22386 13 1.5 13H7V2ZM0 2.5C0 1.67157 0.671573 1 1.5 1H13.5C14.3284 1 15 1.67157 15 2.5V12.5C15 13.3284 14.3284 14 13.5 14H1.5C0.671573 14 0 13.3284 0 12.5V2.5Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))});function wE(){const e=/^\/s\/[^/]+\//.exec(window.location.pathname);if(!e)throw new Error("not inside a session URL");return e[0]}async function Tc(e,t){const n=await fetch(wE()+e,t);if(!n.ok){let i=`${n.status}`;try{const a=await n.json();a.error&&(i=a.error)}catch{}throw new Error(i)}return await n.json()}function NI(){return Tc("api/session")}function HI(e){return Tc(`api/patch?filter=${e}`)}function zI(e){return Tc("api/comments",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}function VI(e,t){return Tc(`api/comments/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({body:t})})}function BI(e){return Tc(`api/comments/${e}`,{method:"DELETE"})}function UI(e,t){const n=new EventSource(`${wE()}api/events?filter=${e}`);return n.addEventListener("open",()=>t.onOpen()),n.addEventListener("error",()=>t.onDisconnect()),n.addEventListener("session",i=>t.onSession(JSON.parse(i.data))),n.addEventListener("patch",i=>t.onPatch(JSON.parse(i.data))),n.addEventListener("comments",i=>t.onComments(JSON.parse(i.data).comments)),n.addEventListener("end",()=>{t.onEnd(),n.close()}),()=>n.close()}function FI(e,t){const n=new Map,i=new Map;for(const a of e){if(a.outdated)continue;const s=`${a.path}\0${a.side}\0${a.endLine}`;let c=i.get(s);c||(c=[],i.set(s,c)),c.push(a)}for(const[a,s]of i){const[c,d,f]=a.split("\0");CS(n,c,{side:d,lineNumber:Number(f),metadata:{kind:"thread",comments:s}})}return t&&CS(n,t.path,{side:t.side,lineNumber:t.endLine,metadata:{kind:"draft",draft:t}}),n}function CS(e,t,n){const i=e.get(t);i?i.push(n):e.set(t,[n])}function jI(e){return!e||e.length===0?"":e.map(t=>{const n=t.metadata,i=n.kind==="thread"?n.comments.map(a=>`${a.id}@${a.updatedAt}:${a.startLine}`).join(","):`draft:${n.draft.startLine}-${n.draft.endLine}`;return`${t.side}:${t.lineNumber}[${i}]`}).sort().join("|")}function $I({meta:e,onCreate:t,onUpdate:n,onDelete:i,onCancelDraft:a}){return e.kind==="draft"?U.jsx(GI,{draft:e.draft,onCreate:t,onCancel:a}):U.jsx("div",{className:"comment-card",children:e.comments.map(s=>U.jsx(qI,{comment:s,onUpdate:n,onDelete:i},s.id))})}function xE(e,t){return e===t?`line ${t}`:`lines ${e}–${t}`}function qI({comment:e,onUpdate:t,onDelete:n}){const[i,a]=W.useState(!1),[s,c]=W.useState(e.body),[d,f]=W.useState(!1),h=async()=>{if(s.trim()!==""){f(!0);try{await t(e.id,s),a(!1)}finally{f(!1)}}};return U.jsxs("div",{className:"comment-row",children:[U.jsxs("div",{className:"comment-meta",children:[U.jsx("span",{className:"comment-side",children:e.side==="additions"?"+":"−"}),U.jsx("span",{children:xE(e.startLine,e.endLine)}),U.jsxs("span",{className:"comment-actions",children:[U.jsx("button",{type:"button",className:"comment-action-button","aria-label":i?"Cancel editing":"Edit comment",title:i?"Cancel editing":"Edit comment",onClick:()=>{a(m=>!m),c(e.body)},children:i?U.jsx(_I,{"aria-hidden":"true"}):U.jsx(LI,{"aria-hidden":"true"})}),U.jsx("button",{type:"button",className:"comment-action-button danger","aria-label":"Delete comment",title:"Delete comment",onClick:()=>void n(e.id),children:U.jsx(MI,{"aria-hidden":"true"})})]})]}),i?U.jsxs("div",{className:"comment-editor",children:[U.jsx("textarea",{value:s,onChange:m=>c(m.target.value),rows:3,disabled:d}),U.jsx("div",{className:"comment-editor-actions",children:U.jsx("button",{type:"button",className:"primary",onClick:()=>void h(),disabled:d||s.trim()==="",children:"Save"})})]}):U.jsx("div",{className:"comment-body",children:e.body})]})}function GI({draft:e,onCreate:t,onCancel:n}){const[i,a]=W.useState(""),[s,c]=W.useState(!1),[d,f]=W.useState(null),h=async()=>{if(i.trim()!==""){c(!0),f(null);try{await t(e,i)}catch(m){f(m instanceof Error?m.message:String(m)),c(!1)}}};return U.jsxs("div",{className:"comment-card draft",children:[U.jsxs("div",{className:"comment-meta",children:[U.jsx("span",{className:"comment-side",children:e.side==="additions"?"+":"−"}),U.jsxs("span",{children:["New comment on ",xE(e.startLine,e.endLine)," (",e.side,")"]})]}),U.jsxs("div",{className:"comment-editor",children:[U.jsx("textarea",{autoFocus:!0,placeholder:"Leave a review comment…",value:i,onChange:m=>a(m.target.value),rows:3,disabled:s}),d&&U.jsx("div",{className:"comment-error",children:d}),U.jsxs("div",{className:"comment-editor-actions",children:[U.jsx("button",{type:"button",onClick:n,disabled:s,children:"Cancel"}),U.jsx("button",{type:"button",className:"primary",onClick:()=>void h(),disabled:s||i.trim()==="",children:"Comment"})]})]})]})}const TE=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1612
1612
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
1613
1613
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
1614
1614
  </symbol>
@@ -1777,7 +1777,7 @@ Error generating stack: `+u.message+`
1777
1777
  </symbol>`],GR=[WI,KI,XI,QI,ZI,JI,tR,aR,sR,dR,yR,bR,SR,_R,CR,wR,kR,AR,LR,IR,RR,OR,PR,zR,VR,BR,UR,FR,jR,$R];function kE(e,t){return t.length===0?e:e.replace("</svg>",`
1778
1778
  ${t.join(`
1779
1779
  `)}
1780
- </svg>`)}const ES=kE(TE,qR),WR={minimal:TE,standard:ES,complete:kE(ES,GR)},KR={".babelrc":"babel",".babelrc.json":"babel",".bash_profile":"bash",".bashrc":"bash",".browserslistrc":"browserslist",".dockerignore":"docker",".eslintignore":"eslint",".eslintrc":"eslint",".eslintrc.cjs":"eslint",".eslintrc.js":"eslint",".eslintrc.json":"eslint",".eslintrc.yaml":"eslint",".eslintrc.yml":"eslint",".gitattributes":"git",".gitignore":"git",".gitkeep":"git",".gitmodules":"git",".oxlintrc.json":"oxc",".postcssrc":"postcss",".postcssrc.json":"postcss",".postcssrc.yaml":"postcss",".postcssrc.yml":"postcss",".prettierignore":"prettier",".prettierrc":"prettier",".prettierrc.cjs":"prettier",".prettierrc.js":"prettier",".prettierrc.json":"prettier",".prettierrc.mjs":"prettier",".prettierrc.toml":"prettier",".prettierrc.yaml":"prettier",".prettierrc.yml":"prettier",".stylelintignore":"stylelint",".stylelintrc":"stylelint",".stylelintrc.cjs":"stylelint",".stylelintrc.js":"stylelint",".stylelintrc.json":"stylelint",".stylelintrc.mjs":"stylelint",".stylelintrc.yaml":"stylelint",".stylelintrc.yml":"stylelint",".terraform.lock.hcl":"terraform",".zprofile":"bash",".zshenv":"bash",".zshrc":"bash","babel.config.cjs":"babel","babel.config.js":"babel","babel.config.json":"babel","babel.config.mjs":"babel","biome.json":"biome","biome.jsonc":"biome","bootstrap.bundle.js":"bootstrap","bootstrap.bundle.min.js":"bootstrap","bootstrap.css":"bootstrap","bootstrap.js":"bootstrap","bootstrap.min.css":"bootstrap","bootstrap.min.js":"bootstrap","bun.lock":"bun","bun.lockb":"bun","bunfig.toml":"bun","claude.md":"claude","compose.yaml":"docker","compose.yml":"docker","docker-compose.override.yml":"docker","docker-compose.yaml":"docker","docker-compose.yml":"docker",dockerfile:"docker","eslint.config.cjs":"eslint","eslint.config.js":"eslint","eslint.config.mjs":"eslint","eslint.config.mts":"eslint","eslint.config.ts":"eslint",gemfile:"ruby","next.config.js":"nextjs","next.config.mjs":"nextjs","next.config.mts":"nextjs","next.config.ts":"nextjs","postcss.config.cjs":"postcss","postcss.config.js":"postcss","postcss.config.mjs":"postcss","postcss.config.ts":"postcss","prettier.config.cjs":"prettier","prettier.config.js":"prettier","prettier.config.mjs":"prettier",rakefile:"ruby","readme.md":"markdown","stylelint.config.cjs":"stylelint","stylelint.config.js":"stylelint","stylelint.config.mjs":"stylelint","svgo.config.cjs":"svgo","svgo.config.js":"svgo","svgo.config.mjs":"svgo","svgo.config.ts":"svgo","tailwind.config.cjs":"tailwind","tailwind.config.js":"tailwind","tailwind.config.mjs":"tailwind","tailwind.config.ts":"tailwind","vite.config.js":"vite","vite.config.mjs":"vite","vite.config.mts":"vite","vite.config.ts":"vite","webpack.config.babel.js":"webpack","webpack.config.cjs":"webpack","webpack.config.js":"webpack","webpack.config.mjs":"webpack","webpack.config.ts":"webpack"},YR={"7z":"zip",astro:"astro",AUTHORS:"text",avif:"image",bash:"bash",bmp:"image",bz2:"zip",c:"c",cc:"cpp",cfg:"text",CHANGELOG:"text",cjs:"javascript","code-workspace":"vscode",conf:"text",CONTRIBUTORS:"text",cpp:"cpp",csh:"bash",css:"css",csv:"table",cts:"typescript",cxx:"cpp",db:"database",editorconfig:"text",env:"text","env.development":"text","env.local":"text","env.production":"text",eot:"font",erb:"ruby",fish:"bash",gemspec:"ruby",gif:"image",go:"go",gql:"graphql",graphql:"graphql",gz:"zip",h:"c",hh:"cpp",hpp:"cpp",htm:"html",html:"html",hxx:"cpp",icns:"image",ico:"image",ini:"text",inl:"cpp",jar:"zip",jpeg:"image",jpg:"image",js:"javascript",json:"json",json5:"json",jsonc:"json",jsonl:"json",jsx:"javascript",ksh:"bash",less:"css",LICENSE:"text",log:"text",markdown:"markdown",mcp:"mcp",md:"markdown",mdx:"markdown","mdx.tsx":"markdown",mjs:"javascript",mm:"cpp",mts:"typescript",ods:"table",otf:"font",png:"image",postcss:"css",py:"python",pyi:"python",pyw:"python",pyx:"python",rake:"ruby",rar:"zip",rb:"ruby",rs:"rust",rst:"text",rtf:"text",sass:"css",scss:"css",sh:"bash",sql:"database",sqlite:"database",sqlite3:"database",styl:"css",svelte:"svelte",svg:"svg",swift:"swift",tar:"zip",tf:"terraform",tfstate:"terraform",tfvars:"terraform",tgz:"zip",tif:"image",tiff:"image",ts:"typescript",tsv:"table",tsx:"typescript",ttf:"font",txt:"text",vue:"vue",war:"zip",wasm:"wasm",wast:"wasm",wat:"wasm",webp:"image",woff:"font",woff2:"font",xhtml:"html",xls:"table",xlsx:"table",xz:"zip",yaml:"yml",yml:"yml",zig:"zig",zip:"zip",zsh:"bash"},XR={jsx:"react",sass:"sass",scss:"sass",tsx:"react"},wS=new Set(["bash","c","cpp","css","database","default","font","git","go","html","image","javascript","json","markdown","mcp","python","ruby","rust","swift","table","text","typescript","zip"]),QR=new Set(["complete"]);function ZR(e){return WR[e==="none"?"minimal":e]}function JR(e){return`file-tree-builtin-${e}`}function e7(e){return e!=="none"&&QR.has(e)}function t7(e,t,n){if(e==="minimal"||e==="none")return;const i=e==="complete",a=KR[t.toLowerCase()];if(a!=null&&(i||wS.has(a)))return a;for(const s of n){if(i){const d=XR[s];if(d!=null)return d}const c=YR[s];if(c!=null&&(i||wS.has(c)))return c}return"default"}const Jm="file-tree-container",xS="data-file-tree-style",TS="data-file-tree-unsafe-css",n7="data-file-tree-scrollbar-measure",kS="data-file-tree-scrollbar-gutter-measured",i7="--trees-scrollbar-gutter-measured",Wd="header",ql="context-menu",r7="context-menu-trigger";function o7(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function _d(e){return e==null?{set:"complete",colored:!0}:typeof e=="string"?{set:e,colored:!0}:{...e,set:e.set??(o7(e)?"none":"complete"),colored:e.colored??!0}}const a7=e=>e.trim().toLowerCase(),s7=e=>e.split("/").at(-1)??e,l7=e=>{const t=e.toLowerCase().split("."),n=[];for(let i=1;i<t.length;i+=1)n.push(t.slice(i).join("."));return n};function Pl(e,t){return typeof e=="string"?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function c7(e){const t=_d(e),n=t.remap,i=new Map;for(const[d,f]of Object.entries(t.byFileName??{}))i.set(d.toLowerCase(),f);const a=new Map;for(const[d,f]of Object.entries(t.byFileExtension??{}))a.set(a7(d),f);const s=Object.entries(t.byFileNameContains??{}).map(([d,f])=>[d.toLowerCase(),f]);return{resolveIcon:(d,f)=>{if(d==="file-tree-icon-file"&&f!=null){const m=s7(f),g=m.toLowerCase(),y=i.get(g);if(y!=null)return Pl(y,d);for(const[w,A]of s)if(g.includes(w))return Pl(A,d);const b=l7(m);for(const w of b){const A=a.get(w);if(A!=null)return Pl(A,d)}const S=t7(t.set,m,b);if(S!=null&&t.set!=="none"){if(S==="default"){const w=n?.[d];if(w!=null)return Pl(w,d)}return{name:JR(S),remappedFrom:d,token:S}}}const h=n?.[d];return h==null?{name:d}:Pl(h,d)}}}const mc=5,vf=1<<mc,u7=vf*4;function Gl(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function AS(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function fa(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;const n=new Map;for(const i of t.childIds){const a=e[i];a!=null&&n.set(a.nameId,i)}return t.childIdByNameId=n,n}function yf(e){if(e.childPositionById!=null)return e.childPositionById;const t=new Map;for(let n=0;n<e.childIds.length;n++){const i=e.childIds[n];i!=null&&t.set(i,n)}return e.childPositionById=t,t}function Nl(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function AE(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){const i=e.childIds[n];i!=null&&e.childPositionById.set(i,n)}}function Kd(e,t){let n=0,i=0;for(const a of t.childIds){const s=e[a];s!=null&&(n+=s.subtreeNodeCount,i+=s.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=i,gc(e,t)}function jg(e,t,n,i){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=i,e.childVisibleChunkSums==null||i===0)return;const a=yf(e).get(t);if(a===void 0)return;const s=a>>mc;e.childVisibleChunkSums[s]+=i}function eg(e,t,n){const i=t.childVisibleChunkSums;if(i!=null){let s=n,c=0;for(const d of i){if(s<d){const f=f7(e,t,c,s);return{...f,childVisibleIndex:n-f.localVisibleIndex}}s-=d,c+=vf}throw new Error(`Visible child index ${String(n)} is out of range`)}let a=n;for(let s=0;s<t.childIds.length;s++){const c=t.childIds[s];if(c==null)continue;const d=e[c];if(d!=null){if(a<d.visibleSubtreeCount)return{childIndex:s,childVisibleIndex:n-a,localVisibleIndex:a};a-=d.visibleSubtreeCount}}throw new Error(`Visible child index ${String(n)} is out of range`)}function d7(e,t,n){let i=0;const a=t.childVisibleChunkSums;let s=0;if(a!=null){const c=n>>mc;for(let d=0;d<c;d+=1)i+=a[d]??0;s=c<<mc}for(let c=s;c<n;c+=1){const d=t.childIds[c];if(d==null)continue;const f=e[d];f!=null&&(i+=f.visibleSubtreeCount)}return i}function gc(e,t){if(t.childIds.length<u7){t.childVisibleChunkSums=null;return}const n=Math.ceil(t.childIds.length/vf),i=new Int32Array(n);for(let a=0;a<t.childIds.length;a++){const s=t.childIds[a];if(s==null)continue;const c=e[s];c!=null&&(i[a>>mc]+=c.visibleSubtreeCount)}t.childVisibleChunkSums=i}function f7(e,t,n,i){const a=Math.min(t.childIds.length,n+vf);let s=i;for(let c=n;c<a;c++){const d=t.childIds[c];if(d==null)continue;const f=e[d];if(f!=null){if(s<f.visibleSubtreeCount)return{childIndex:c,localVisibleIndex:s};s-=f.visibleSubtreeCount}}throw new Error(`Visible child index ${String(i)} is out of range`)}const h7=7,$g=3,LE=1<<$g,IE=4;function Kn(e,t,n=0){return e<<IE|n<<$g|t}function $i(e){return e.depthAndFlags>>>IE}function bf(e){return(e.depthAndFlags&LE)>>$g}function Te(e){return(e.depthAndFlags&LE)!==0}function RE(e){return e.depthAndFlags&h7}function Ut(e,t){return(RE(e)&t)!==0}function Sf(e,t){e.depthAndFlags|=t}function p7(e,t){e.depthAndFlags=Kn(t,RE(e),bf(e))}const DE=Symbol("benchmarkInstrumentation");function m7(e,t){return t==null||Object.defineProperty(e,DE,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function qg(e){return e==null?null:e[DE]??null}function ve(e,t,n){return e==null?n():e.measurePhase(t,n)}function Cd(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function LS(e){return e>=48&&e<=57}function g7(e){const t=[];let n=0,i=0;for(;i<e.length;){for(;i<e.length&&!LS(e.charCodeAt(i));)i+=1;if(i>=e.length)break;i>n&&t.push(e.slice(n,i));let a=0;for(;i<e.length&&LS(e.charCodeAt(i));)a=a*10+(e.charCodeAt(i)-48),i+=1;t.push(a),n=i}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function kc(e){const t=e.toLowerCase();return{lowerValue:t,tokens:g7(t)}}function v7(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const a=e[i],s=t[i];if(a===s)continue;if(typeof a=="number"&&typeof s=="number")return a<s?-1:1;const c=String(a),d=String(s);if(c!==d)return c<d?-1:1}return e.length!==t.length?e.length<t.length?-1:1:0}function Gg(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]=="string"&&typeof t.tokens[0]=="string")return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;const n=v7(e.tokens,t.tokens);return n!==0?n:e.lowerValue!==t.lowerValue?e.lowerValue<t.lowerValue?-1:1:0}function ME(e,t,n){const i=Gg(n(e),n(t));return i!==0?i:e===t?0:e<t?-1:1}function y7(e,t){return ME(e,t,kc)}function Yd(e,t){return t!==e.segments.length-1||e.isDirectory?1:0}function b7(e,t){const n=Math.min(e.segments.length,t.segments.length);for(let i=0;i<n;i++){const a=e.segments[i],s=t.segments[i];if(a===s)continue;const c=Yd(e,i);return c!==Yd(t,i)?c===1?-1:1:y7(a,s)}return e.segments.length!==t.segments.length?e.segments.length<t.segments.length?-1:1:e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1}function S7(e,t){return b7(e,t)}function _7(e,t,n){const i=s=>{const c=n.get(s);if(c!=null)return c;const d=kc(s);return n.set(s,d),d},a=Math.min(e.segments.length,t.segments.length);for(let s=0;s<a;s++){const c=e.segments[s],d=t.segments[s];if(c===d)continue;const f=Yd(e,s);return f!==Yd(t,s)?f===1?-1:1:ME(c,d,i)}return e.segments.length!==t.segments.length?e.segments.length<t.segments.length?-1:1:e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1}function tg(e,t){const n=e.sortKeyById[t];if(n!==void 0)return n;const i=e.valueById[t],a=kc(i);return e.sortKeyById[t]=a,a}function OE(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??"default"}}function PE(e){const t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,i=[];let a=0;for(let s=0;s<n;s++)e.charCodeAt(s)===47&&(i.push(e.slice(a,s)),a=s+1);return i.push(e.slice(a,n)),{hasTrailingSlash:t,segments:i}}function Jl(e){const{hasTrailingSlash:t,segments:n}=PE(e);return{basename:n[n.length-1]??"",isDirectory:t,path:e,segments:n}}function ng(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};const{hasTrailingSlash:t,segments:n}=PE(e);return{requiresDirectory:t,segments:n}}function NE(){const e=new Map;return e.set("",0),{idByValue:e,valueById:[""],sortKeyById:[kc("")]}}function yo(e,t){const n=e.idByValue.get(t);if(n!==void 0)return n;const i=e.valueById.length;return e.idByValue.set(t,i),e.valueById.push(t),i}function Wi(e,t){const n=e.valueById[t];if(n===void 0)throw new Error(`Unknown segment ID: ${String(t)}`);return n}const Wg=Symbol("pathStorePreparedInputKind");function HE(e,t){return e[Wg]=t,e}function IS(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function zE(e,t,n){return n==="default"?S7(e,t):n(IS(e),IS(t))}function C7(){return{depthAndFlags:Kn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function E7(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!==t[i])return i;return n}function RS(e){return e.isDirectory?e.segments.length:e.segments.length-1}function w7(e){return Array.isArray(e)&&e.every(t=>t!=null&&typeof t=="object"&&typeof t.path=="string"&&Array.isArray(t.segments)&&typeof t.basename=="string"&&typeof t.isDirectory=="boolean")}function x7(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function T7(e,t={}){return Kg(e,t).map(n=>n.path)}function k7(e,t={}){const n=Kg(e,t);return HE({paths:n.map(i=>i.path),preparedPaths:n},"prepared")}function A7(e){const t=e.length;let n=!1;for(let i=0;i<t;i+=1){const a=e[i];if(a.length>0&&a.charCodeAt(a.length-1)===47){n=!0;break}}return HE({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},"presorted")}function L7(e){const t=e,n=t.preparedPaths;if(t[Wg]==="prepared"&&n!=null)return n;if(!w7(n))throw new Error("preparedInput must come from PathStore.prepareInput()");return n}function I7(e){const t=e;return t[Wg]==="presorted"&&t.presortedPaths!=null||x7(t.presortedPaths)?t.presortedPaths:null}function R7(e){const t=e;return typeof t.presortedPathsContainDirectories=="boolean"?t.presortedPathsContainDirectories:null}function Kg(e,t={}){const n=OE(t),i=qg(t);Cd(i,"workload.inputFiles",e.length);const a=ve(i,"store.preparePathEntries.parse",()=>e.map(s=>Jl(s)));return ve(i,"store.preparePathEntries.sort",()=>a.sort((s,c)=>zE(s,c,n.sort))),a}var VE=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[C7()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=NE();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=qg(e),this.options=OE(e);const t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{const n=new Set,i=t.length;for(let a=0;a<i;a+=1){const s=t[a],c=s.length;n.add(c>0&&s.charCodeAt(c-1)===47?s.slice(0,c-1):s)}this.initialExpandedPathSet=n,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,Gl())}appendPaths(e){return ve(this.instrumentation,"store.builder.appendPaths.parse",()=>this.appendPreparedPaths(e.map(t=>Jl(t))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,ve(this.instrumentation,"store.builder.appendPreparedPaths",()=>{for(const n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return ve(this.instrumentation,"store.builder.appendPresortedPaths",()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,i=0;const a=this.nodes,s=this.segmentTable,c=s.idByValue,d=s.valueById,f=this.directoryStack;let h=0,m="",g=0;for(const y of e){if(n===y)throw new Error(`Duplicate path: "${y}"`);const b=y.length>0&&y.charCodeAt(y.length-1)===47,S=b?y.length-1:y.length;let w=0,A=0;if(n!=null)if(m.length>0&&y.length>m.length&&y.startsWith(m))w=g,A=m.length;else{const T=Math.min(S,n.length);let L=!0;for(let O=0;O<T;O++){const D=y.charCodeAt(O);if(D!==n.charCodeAt(O)){L=!1;break}D===47&&(w++,A=O+1)}L&&b&&T===S&&n.length>S&&n.charCodeAt(S)===47&&(w++,A=S+1)}h=w,i=w;let k=A,E=y.indexOf("/",k);for(;E>=0&&E<S;){const T=f[h];if(T===void 0)throw new Error("Directory stack underflow while building the path store");i++;const L=y.slice(k,E);let O=c.get(L);O===void 0&&(O=d.length,c.set(L,O),d.push(L));const D=a.length;a.push({depthAndFlags:Kn(i,0,1),nameId:O,parentId:T,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(y.slice(0,E)),h++,f[h]=D,k=E+1,E=y.indexOf("/",k)}if(b){if(k<S){const L=f[h];if(L===void 0)throw new Error(`Unable to resolve directory parent for "${y}"`);i++;const O=y.slice(k,S);let D=c.get(O);D===void 0&&(D=d.length,c.set(O,D),d.push(O));const N=a.length;a.push({depthAndFlags:Kn(i,0,1),nameId:D,parentId:L,subtreeNodeCount:1,visibleSubtreeCount:1}),h++,f[h]=N}const T=f[h];if(T===void 0)throw new Error(`Unable to resolve directory node for "${y}"`);this.promoteDirectoryToExplicit(T,y)}else{const T=f[h];if(T===void 0)throw new Error(`Unable to resolve file parent for "${y}"`);const L=y.slice(k);let O=c.get(L);O===void 0&&(O=d.length,c.set(L,O),d.push(L)),a.push({depthAndFlags:Kn(i+1,0),nameId:O,parentId:T,subtreeNodeCount:1,visibleSubtreeCount:1})}k!==m.length&&(m=y.substring(0,k),g=i),n=y}f.length=h+1,n!=null&&(this.lastPreparedPath=Jl(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0;const i=this.nodes,a=this.segmentTable,s=a.idByValue,c=a.valueById,d=this.directoryStack;let f=0,h="",m=0;for(const g of e){if(t===g)throw new Error(`Duplicate path: "${g}"`);const y=g.length;let b=0,S=0;if(t!=null)if(h.length>0&&g.length>h.length&&g.startsWith(h))b=m,S=h.length;else{const L=Math.min(y,t.length);for(let O=0;O<L;O++){const D=g.charCodeAt(O);if(D!==t.charCodeAt(O))break;D===47&&(b++,S=O+1)}}f=b,n=b;let w=S,A=g.indexOf("/",w);for(;A>=0;){const L=d[f];if(L===void 0)throw new Error("Directory stack underflow while building the path store");n++;const O=g.slice(w,A);let D=s.get(O);D===void 0&&(D=c.length,s.set(O,D),c.push(O));const N=i.length;i.push({depthAndFlags:Kn(n,0,1),nameId:D,parentId:L,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(g.slice(0,A)),this.presortedDirectoryNodeIds.push(N),f++,d[f]=N,w=A+1,A=g.indexOf("/",w)}const k=d[f];if(k===void 0)throw new Error(`Unable to resolve file parent for "${g}"`);const E=g.slice(w);let T=s.get(E);T===void 0&&(T=c.length,s.set(E,T),c.push(E)),i.push({depthAndFlags:Kn(n+1,0),nameId:T,parentId:k,subtreeNodeCount:1,visibleSubtreeCount:1}),w!==h.length&&(h=g.substring(0,w),m=n),t=g}d.length=f+1,t!=null&&(this.lastPreparedPath=Jl(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){const t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(ve(this.instrumentation,"store.builder.buildDirectoryIndexes",()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||ve(this.instrumentation,"store.builder.computeSubtreeCounts",()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&(this.buildDirectoryIndexes(),this.hasDeferredDirectoryIndexes=!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw new Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?_7(this.lastPreparedPath,e,this.segmentSortKeyCache):zE(this.lastPreparedPath,e,this.options.sort))>0)throw new Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}const n=this.lastPreparedPath,i=RS(e),a=n==null?0:RS(n),s=n==null?0:E7(n.segments,e.segments),c=Math.min(s,i,a);this.directoryStack.length=c+1;for(let f=c;f<i;f++){const h=this.directoryStack[this.directoryStack.length-1];if(h===void 0)throw new Error("Directory stack underflow while building the path store");const m=t?this.getOrCreateDirectoryChild(h,e.segments[f]):this.createDirectoryChild(h,e.segments[f]);this.directoryStack.push(m)}if(e.isDirectory){const f=this.directoryStack[this.directoryStack.length-1];if(f===void 0)throw new Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(f,e.path),this.lastPreparedPath=e;return}const d=this.directoryStack[this.directoryStack.length-1];if(d===void 0)throw new Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(d,e.basename,e.path):this.createFileChildUnchecked(d,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){const i=yo(this.segmentTable,t),a=this.getDirectoryIndex(e),s=a.childIdByNameId;if(s!=null&&s.get(i)!==void 0)throw new Error(`Path collides with an existing entry: "${n}"`);const c=this.nodes[e];if(c===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const d=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(c)+1,0),nameId:i,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),s?.set(i,d),Nl(a,d),d}createFileChildUnchecked(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e),a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),s}getOrCreateDirectoryChild(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e);if(i.childIdByNameId!=null){const c=i.childIdByNameId.get(n);if(c!==void 0){const d=this.nodes[c];if(d!=null&&!Te(d))throw new Error(`Path collides with an existing file while creating directory "${t}"`);return c}}const a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),this.directories.set(s,Gl()),s}createDirectoryChild(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e),a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),this.directories.set(s,Gl()),s}promoteDirectoryToExplicit(e,t){const n=this.nodes[e];if(n===void 0)throw new Error(`Unknown directory node ID: ${String(e)}`);if(!Te(n))throw new Error(`Path is not a directory: "${t}"`);if(Ut(n,1))throw new Error(`Duplicate path: "${t}"`);Sf(n,1)}getDirectoryIndex(e){const t=this.directories.get(e);if(t!==void 0)return t;throw new Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){const t=this.nodes,n=this.directories;n.set(0,AS());let i=-1,a=null;for(let s=1;s<t.length;s++){const c=t[s];if(c==null)continue;if(Te(c)){const f=AS();n.set(s,f),i=s,a=f}let d;c.parentId===i?d=a:(d=n.get(c.parentId),i=c.parentId,a=d??null),d?.childIds.push(s)}if(!e)for(let s=t.length-1;s>=1;s--){const c=t[s];if(c==null)continue;const d=t[c.parentId];d!=null&&(d.subtreeNodeCount+=c.subtreeNodeCount,d.visibleSubtreeCount+=c.visibleSubtreeCount)}}buildDirectoryIndexes(){const e=this.nodes;for(let t=1;t<e.length;t++){const n=e[t];if(n==null)continue;Te(n)&&this.directories.set(t,Gl());const i=this.directories.get(n.parentId);i!=null&&(i.childIdByNameId!=null&&i.childIdByNameId.set(n.nameId,t),Nl(i,t))}}computeSubtreeCounts(e){const t=this.nodes[e];if(t===void 0)throw new Error(`Unknown node ID: ${String(e)}`);if(!Te(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;const n=this.getDirectoryIndex(e);let i=1;for(const a of n.childIds)i+=this.computeSubtreeCounts(a);return Kd(this.nodes,n),t.subtreeNodeCount=i,t.visibleSubtreeCount=i,i}};function D7(e,t="closed",n=null){const i=O7(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:i,directoriesOpenByDefault:i==="open",hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:"",version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function M7(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function O7(e){if(typeof e!="number")return e;if(!Number.isInteger(e)||e<0)throw new Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function BE(e,t){return Ut(t,2)||e.defaultExpansion==="open"?!0:e.defaultExpansion==="closed"?!1:$i(t)<=e.defaultExpansion}function wn(e,t,n=e.snapshot.nodes[t]){return n==null||!Te(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:BE(e,n)}function vc(e,t,n,i=e.snapshot.nodes[t]){if(i==null||!Te(i))return;const a=BE(e,i);if(n){if(a){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(a){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function UE(e,t){const n=e.directoryLoadInfoById.get(t);if(n!=null)return n;const i={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:"loaded"};return e.directoryLoadInfoById.set(t,i),i}function yc(e,t){return e.directoryLoadInfoById.get(t)?.state??"loaded"}function P7(e,t){const n=UE(e,t);if(n.state==="loading"&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};const i=n.nextAttemptId;return n.activeAttemptId=i,n.errorMessage=null,n.nextAttemptId+=1,n.state="loading",{attemptId:i,nodeId:t,reused:!1}}function N7(e,t){const n=UE(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state="unloaded"}function H7(e,t,n){const i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=null,i.state="loaded",!0)}function z7(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function V7(e,t,n,i){const a=e.directoryLoadInfoById.get(t);return a==null||a.activeAttemptId!==n?!1:(a.activeAttemptId=null,a.errorMessage=i??null,a.state="error",!0)}function B7(e,t){e.directoryLoadInfoById.delete(t)}function U7(e,t,n){const i=n,a=e.listeners.get(t);return a!=null?a.add(i):e.listeners.set(t,new Set([i])),()=>{const s=e.listeners.get(t);s!=null&&(s.delete(i),s.size===0&&e.listeners.delete(t))}}function F7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:"add",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function j7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:"remove",path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function $7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:"move",projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function q7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"expand",path:e.path,projectionChanged:!0,visibleCountDelta:null}}function G7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"collapse",path:e.path,projectionChanged:!0,visibleCountDelta:null}}function W7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"mark-directory-unloaded",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function K7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:"begin-child-load",path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Y7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(t=>t.canonicalChanged),childEvents:e.childEvents,operation:"apply-child-patch",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function X7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:"complete-child-load",path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Q7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:"fail-child-load",path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Z7(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:"cleanup",projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function On(e,t,n){return{...n,visibleCountDelta:rg(e)-t}}function J7(e,t){const n=rg(e),i=M7();e.transactionStack.push(i);try{t()}catch(a){throw MS(e,i,!1),a}MS(e,i,!0,rg(e)-n)}function Ci(e,t){const n=e.instrumentation;if(n==null){DS(e,t);return}ve(n,"store.events.record",()=>DS(e,t))}function DS(e,t){const n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){ig(e,t);return}n.events.push(t),nD(n,t)}function MS(e,t,n,i=null){if(e.transactionStack.pop()!==t)throw new Error("Transaction stack underflow");if(!n)return;const a=e.transactionStack[e.transactionStack.length-1]??null;if(a!=null){const d=e.instrumentation;d==null?OS(a,t):ve(d,"store.events.batch.merge",()=>OS(a,t));return}const s=eD(t,i),c=e.instrumentation;if(c==null){ig(e,s);return}ve(c,"store.events.batch.commit",()=>ig(e,s))}function eD(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(n=>n.canonicalChanged),events:[...e.events],operation:"batch",projectionChanged:e.events.some(n=>n.projectionChanged),visibleCountDelta:t}}function tD(e,t){for(const n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(const n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function OS(e,t){for(const n of t.events)e.events.push(n);tD(e,t)}function nD(e,t){for(const n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(const n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function ig(e,t){const n=e.instrumentation;if(n==null){PS(e,t);return}ve(n,"store.events.emit",()=>PS(e,t))}function PS(e,t){e.listeners.get(t.operation)?.forEach(n=>n(t)),e.listeners.get("*")?.forEach(n=>n(t))}function rg(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function ws(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;const n=e.snapshot.nodes[t];if(n==null||!Te(n)||Ut(n,2))return null;const i=e.snapshot.directories.get(t);if(i==null||i.childIds.length!==1)return null;const a=i.childIds[0];if(a==null)return null;const s=e.snapshot.nodes[a];return s==null||!Te(s)?null:a}function la(e,t){let n=t;for(;;){const i=ws(e,n);if(i==null)return n;n=i}}function Xd(e,t){const n=[t];let i=t;for(;;){const a=ws(e,i);if(a==null)return n;n.push(a),i=a}}function FE(e,t){const n=t==null?e.snapshot.rootId:hi(e,t);return n==null?[]:rD(e,n)}function NS(e,t){const n=Jl(t),i=n.isDirectory?n.segments:n.segments.slice(0,-1),a=bo(e,hD(e,i)),{createdNodeIds:s,directoryId:c}=oD(e,i),d=new Set(s);let f=c;if(n.isDirectory){const m=we(e,c);if(Ut(m,1))throw new Error(`Path already exists: "${t}"`);Sf(m,1),e.pathCacheByNodeId.set(c,{path:t,version:e.pathCacheVersion}),d.add(c)}else f=sD(e,c,n.basename),d.add(f);ca(e,c);const h=bo(e,c);return F7({affectedAncestorIds:wi(e,f),affectedNodeIds:[...d],path:t,projectionChanged:qE(a,h)})}function HS(e,t,n){const i=hi(e,t);if(i==null)throw new Error(`Path does not exist: "${t}"`);const a=we(e,i);if(Ut(a,2))throw new Error("The root node cannot be removed");if(Te(a)&&_t(e,i).childIds.length>0&&n.recursive!==!0)throw new Error(`Cannot remove a non-empty directory without recursive: "${t}"`);const s=a.parentId,c=bo(e,s),d=$E(e,i);Qg(e,s,i,a.nameId),Zg(e,s),ca(e,s);const f=bo(e,s);return j7({affectedAncestorIds:wi(e,s),affectedNodeIds:d,path:t,projectionChanged:qE(c,f),recursive:n.recursive===!0})}function zS(e,t,n,i){const a=hi(e,t);if(a==null)throw new Error(`Source path does not exist: "${t}"`);const s=we(e,a);if(Ut(s,2))throw new Error("The root node cannot be moved");const c=i.collision??"error",d=dD(e,a,n),f=bo(e,s.parentId),h=bo(e,d.parentId),m=Wi(e.snapshot.segmentTable,s.nameId),g=yo(e.snapshot.segmentTable,d.basename);if(d.parentId===s.parentId&&m===d.basename)return null;if(Te(s)&&mD(e,a,d.parentId))throw new Error("Cannot move a directory into one of its descendants");const y=fa(e.snapshot.nodes,_t(e,d.parentId)).get(g),b=d.existingNodeId??y??null;if(b!=null&&b!==a&&fD(e,b,c,bf(s))==="skip")return null;const S=s.parentId;Qg(e,S,a,s.nameId),s.parentId=d.parentId,s.nameId=g,e.pathCacheByNodeId.delete(a),WE(e,a),Xg(e,d.parentId,a),Zg(e,S),e.pathCacheVersion++,ca(e,S),d.parentId!==S&&ca(e,d.parentId);const w=bo(e,S),A=bo(e,d.parentId);return $7({affectedAncestorIds:[...new Set([...wi(e,S),...wi(e,d.parentId)])],affectedNodeIds:[a],from:t,projectionChanged:GE([f,h],[w,A]),to:St(e,a)})}function iD(e,t){const n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function VS(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function St(e,t){const n=we(e,t),i=iD(e,t);if(i!=null)return i;if(Ut(n,2))return VS(e,t,"");const a=St(e,n.parentId),s=Wi(e.snapshot.segmentTable,n.nameId),c=a.length===0?s:`${a}${s}`;return VS(e,t,Te(n)?`${c}/`:c)}function ca(e,t){const n=e.instrumentation;if(n==null){US(e,t);return}ve(n,"store.recomputeCountsUpwardFrom",()=>US(e,t))}function Yg(e,t){const n=[[t,0]],{nodes:i,directories:a}=e.snapshot;for(;n.length>0;){const s=n[n.length-1],c=s[0],d=i[c];if(d==null||!Te(d)){og(e,c,d,!0),n.pop();continue}const f=a.get(c);if(f==null||s[1]>=f.childIds.length){og(e,c,d,!0),n.pop();continue}const h=f.childIds[s[1]++];n.push([h,0])}}function wi(e,t){const n=[];let i=t;for(;i!=null;){const a=we(e,i);if(n.push(i),i===e.snapshot.rootId)break;i=a.parentId}return n}function hi(e,t){if(t.length===0)return e.snapshot.rootId;const n=ng(t);return jE(e,n.segments,n.requiresDirectory)}function jE(e,t,n){let i=e.snapshot.rootId;for(const s of t){const c=e.snapshot.segmentTable.idByValue.get(s);if(c===void 0)return null;const d=_t(e,i),f=fa(e.snapshot.nodes,d).get(c);if(f===void 0)return null;i=f}const a=we(e,i);return n&&!Te(a)?null:i}function _t(e,t){const n=e.snapshot.directories.get(t);if(n===void 0)throw new Error(`Unknown directory child index for node ${String(t)}`);return n}function we(e,t){const n=e.snapshot.nodes[t];if(n===void 0||Ut(n,4))throw new Error(`Unknown node ID: ${String(t)}`);return n}function rD(e,t){const n=e.snapshot.nodes[t];if(n===void 0||Ut(n,4))return[];if(!Te(n))return[St(e,t)];if(_t(e,t).childIds.length===0)return Ut(n,1)&&!Ut(n,2)?[St(e,t)]:[];const i=[],a=[{childIndex:0,nodeId:t}];for(;a.length>0;){const s=a[a.length-1];if(s==null)break;const c=e.snapshot.nodes[s.nodeId];if(c===void 0||Ut(c,4)){a.pop();continue}if(!Te(c)){i.push(St(e,s.nodeId)),a.pop();continue}const d=_t(e,s.nodeId);if(d.childIds.length===0){Ut(c,1)&&!Ut(c,2)&&i.push(St(e,s.nodeId)),a.pop();continue}const f=d.childIds[s.childIndex];if(f==null){a.pop();continue}s.childIndex++,a.push({childIndex:0,nodeId:f})}return i}function oD(e,t){const n=[];let i=e.snapshot.rootId;for(const a of t){const s=yo(e.snapshot.segmentTable,a),c=_t(e,i),d=fa(e.snapshot.nodes,c).get(s);if(d!==void 0){if(!Te(we(e,d)))throw new Error(`Cannot create a directory that collides with an existing file: "${a}"`);i=d;continue}i=aD(e,i,s),n.push(i)}return{createdNodeIds:n,directoryId:i}}function aD(e,t,n){const i=we(e,t),a=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kn($i(i)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(a,Gl()),Xg(e,t,a),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(a),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,a}function sD(e,t,n){const i=yo(e.snapshot.segmentTable,n),a=_t(e,t);if(fa(e.snapshot.nodes,a).has(i))throw new Error(`Path already exists: "${gD(e,t,n)}"`);const s=we(e,t),c=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kn($i(s)+1,0),nameId:i,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Xg(e,t,c),e.activeNodeCount++,c}function lD(e,t,n){let i=0,a=t.childIds.length;for(;i<a;){const s=i+a>>>1,c=t.childIds[s];if(c==null){a=s;continue}cD(e,n,c)<0?a=s:i=s+1}return i}function Xg(e,t,n){const i=_t(e,t),a=we(e,n);fa(e.snapshot.nodes,i).set(a.nameId,n),jg(i,n,a.subtreeNodeCount,a.visibleSubtreeCount);const s=lD(e,i,n);i.childIds.splice(s,0,n),AE(i,s),gc(e.snapshot.nodes,i)}function Qg(e,t,n,i){const a=_t(e,t),s=yf(a),c=s.get(n)??-1;fa(e.snapshot.nodes,a).delete(i),s.delete(n);const d=e.snapshot.nodes[n];d!=null&&jg(a,n,-d.subtreeNodeCount,-d.visibleSubtreeCount),c>=0&&(a.childIds.splice(c,1),AE(a,c),gc(e.snapshot.nodes,a))}function cD(e,t,n){const i=e.snapshot.options.sort;return i==="default"?uD(e,t,n):i(BS(e,t),BS(e,n))}function uD(e,t,n){const i=we(e,t),a=we(e,n),s=Te(i);if(s!==Te(a))return s?-1:1;const c=Gg(tg(e.snapshot.segmentTable,i.nameId),tg(e.snapshot.segmentTable,a.nameId));if(c!==0)return c;const d=Wi(e.snapshot.segmentTable,i.nameId),f=Wi(e.snapshot.segmentTable,a.nameId);return d!==f?d<f?-1:1:t<n?-1:1}function BS(e,t){const n=we(e,t),i=St(e,t),a=Te(n),s=a?i.slice(0,-1):i;return{basename:Wi(e.snapshot.segmentTable,n.nameId),depth:$i(n),isDirectory:a,path:i,segments:s.length===0?[]:s.split("/")}}function dD(e,t,n){const i=we(e,t),a=hi(e,n);if(a!=null){const h=we(e,a);if(Te(h))return{basename:Wi(e.snapshot.segmentTable,i.nameId),existingNodeId:null,parentId:a};const m=ng(n).segments;return{basename:m[m.length-1]??"",existingNodeId:a,parentId:h.parentId}}const s=ng(n),c=s.segments[s.segments.length-1]??"",d=s.segments.slice(0,-1),f=d.length===0?e.snapshot.rootId:jE(e,d,!0);if(f==null)throw new Error(`Destination parent does not exist: "${n}"`);return{basename:c,existingNodeId:null,parentId:f}}function fD(e,t,n,i){if(n==="skip")return"skip";if(n==="error")throw new Error(`Destination already exists: "${St(e,t)}"`);const a=we(e,t);if(bf(a)!==i)throw new Error("replace collision requires the same source and destination kinds");if(Te(a)&&_t(e,t).childIds.length>0)throw new Error("replace collision does not support non-empty directories");const s=a.parentId,c=a.nameId;return $E(e,t),Qg(e,s,t,c),Zg(e,s),ca(e,s),"handled"}function $E(e,t){const n=[],i=[{nodeId:t,visitedChildren:!1}];for(;i.length>0;){const a=i.pop();if(a==null)break;const s=we(e,a.nodeId);if(a.visitedChildren||!Te(s)){Te(s)&&e.snapshot.directories.delete(a.nodeId),Sf(s,4),e.pathCacheByNodeId.delete(a.nodeId),e.collapsedDirectoryIds.delete(a.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(a.nodeId),B7(e,a.nodeId),e.activeNodeCount--,n.push(a.nodeId);continue}i.push({nodeId:a.nodeId,visitedChildren:!0});const c=_t(e,a.nodeId);for(let d=c.childIds.length-1;d>=0;d--){const f=c.childIds[d];f!=null&&i.push({nodeId:f,visitedChildren:!1})}}return n}function Zg(e,t){let n=t;for(;n!=null;){const i=we(e,n);if(!Te(i)||Ut(i,2)||_t(e,n).childIds.length>0)return;Sf(i,1),n=i.parentId===n?null:i.parentId}}function hD(e,t){let n=e.snapshot.rootId;for(const i of t){const a=e.snapshot.segmentTable.idByValue.get(i);if(a==null)break;const s=fa(e.snapshot.nodes,_t(e,n)).get(a);if(s==null||!Te(we(e,s)))break;n=s}return n}function bo(e,t){const n=pD(e,t);if(n==null)return null;const i=la(e,n),a=we(e,i),s=n===i?null:Xd(e,n).map(c=>St(e,c));return JSON.stringify({flattenedSegmentPaths:s,hasChildren:_t(e,i).childIds.length>0,path:St(e,i),terminalKind:bf(a)})}function qE(e,t){return GE([e],[t])}function GE(e,t){for(let n=0;n<e.length;n+=1){const i=e[n],a=t[n];if(i==null||a==null||i!==a)return!0}return!1}function pD(e,t){let n=t;for(;n!=null;){const i=we(e,n);if(!Te(i)||Ut(i,2))return null;if(!wn(e,n,i))return n;n=i.parentId}return null}function WE(e,t){const n=we(e,t);if(p7(n,(t===e.snapshot.rootId?-1:$i(we(e,n.parentId)))+1),!Te(n))return;const i=_t(e,t);for(const a of i.childIds)WE(e,a)}function mD(e,t,n){let i=n;for(;i!=null;){if(i===t)return!0;const a=we(e,i);if(i===e.snapshot.rootId)return!1;i=a.parentId}return!1}function og(e,t,n=we(e,t),i=!1){const a=e.instrumentation;if(a==null){FS(e,t,n,i);return}ve(a,"store.recomputeNodeCounts",()=>FS(e,t,n,i))}function US(e,t){let n=t;for(;n!=null;){const i=we(e,n),a=i.subtreeNodeCount,s=i.visibleSubtreeCount;if(og(e,n,i),n===e.snapshot.rootId)return;const c=i.subtreeNodeCount-a,d=i.visibleSubtreeCount-s,f=i.parentId;(c!==0||d!==0)&&jg(_t(e,f),n,c,d),n=f}}function FS(e,t,n,i){if(!Te(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}const a=_t(e,t);if(i){const d=e.instrumentation;d==null?Kd(e.snapshot.nodes,a):ve(d,"store.recomputeNodeCounts.rebuildChildAggregates",()=>Kd(e.snapshot.nodes,a))}const s=1+a.totalChildSubtreeNodeCount,c=a.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=s,Ut(n,2)){n.visibleSubtreeCount=c;return}n.visibleSubtreeCount=ws(e,t)!=null?c:wn(e,t,n)?1+c:1}function gD(e,t,n){const i=St(e,t);return i.length===0?n:`${i}${n}`}function ys(e){return e!=null&&!Ut(e,4)}function Qd(e,t){const n=e.snapshot.nodes[t];return!ys(n)||!Te(n)||Ut(n,2)?null:n}function vD(e){let t=0;for(const[n,i]of e.pathCacheByNodeId)i.version===e.pathCacheVersion&&ys(e.snapshot.nodes[n])&&(t+=1);return t}function yD(e){return Math.max(0,e.valueById.length-1)}function jS(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:vD(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:yD(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function bD(e,t,n,i){return{activeNodeCountAfter:i.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:i.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:i.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-i.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-i.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-i.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-i.segmentCount,segmentCountAfter:i.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:i.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function KE(e){const t=[],n=[];for(const i of e.collapsedDirectoryIds)Qd(e,i)!=null&&t.push(St(e,i));for(const i of e.expandedDirectoryIds)Qd(e,i)!=null&&n.push(St(e,i));return{collapsedPaths:t,expandedPaths:n}}function YE(e){const t=[];for(const[n,i]of e.directoryLoadInfoById)Qd(e,n)==null||yc(e,n)==="loaded"||t.push({info:{activeAttemptId:null,errorMessage:i.errorMessage,nextAttemptId:i.nextAttemptId,state:i.state},path:St(e,n)});return t}function XE(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(const n of t.expandedPaths){const i=hi(e,n);i!=null&&vc(e,i,!0,we(e,i))}for(const n of t.collapsedPaths){const i=hi(e,n);i!=null&&vc(e,i,!1,we(e,i))}}function QE(e,t){e.directoryLoadInfoById.clear();for(const n of t){const i=hi(e,n.path);i!=null&&Qd(e,i)!=null&&e.directoryLoadInfoById.set(i,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function SD(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:"",version:e.pathCacheVersion})}function _D(e){const t=e.snapshot.segmentTable,n=NE();for(const i of e.snapshot.nodes)if(ys(i)){if(Ut(i,2)){i.nameId=0;continue}i.nameId=yo(n,Wi(t,i.nameId))}e.snapshot.segmentTable=n}function CD(e){for(const[t,n]of e.snapshot.directories){const i=e.snapshot.nodes[t];if(!ys(i)||!Te(i)){e.snapshot.directories.delete(t);continue}const a=n.childIds.filter(s=>{const c=e.snapshot.nodes[s];return ys(c)&&c.parentId===t});n.childIds=a,n.childIdByNameId=new Map(a.map(s=>[we(e,s).nameId,s])),n.childPositionById=new Map(a.map((s,c)=>[s,c])),Kd(e.snapshot.nodes,n)}}function ED(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){const n=e.snapshot.nodes[t];if(ys(n))break;t-=1}e.snapshot.nodes.length=t+1}function wD(e){const t=KE(e),n=YE(e);ve(e.instrumentation,"store.cleanup.stable.clearPathCaches",()=>SD(e)),ve(e.instrumentation,"store.cleanup.stable.rebuildSegmentTable",()=>_D(e)),ve(e.instrumentation,"store.cleanup.stable.rebuildDirectoryIndexes",()=>CD(e)),ve(e.instrumentation,"store.cleanup.stable.trimTrailingRemovedNodeSlots",()=>ED(e)),ve(e.instrumentation,"store.cleanup.stable.restoreExpansionOverrides",()=>XE(e,t)),ve(e.instrumentation,"store.cleanup.stable.restoreDirectoryLoadInfos",()=>QE(e,n)),ve(e.instrumentation,"store.cleanup.stable.recomputeCounts",()=>Yg(e,e.snapshot.rootId))}function xD(e){const t=KE(e),n=YE(e),i=ve(e.instrumentation,"store.cleanup.aggressive.listPaths",()=>FE(e)),a=m7({...e.snapshot.options},e.instrumentation),s=ve(e.instrumentation,"store.cleanup.aggressive.rebuildSnapshot",()=>{const c=new VE(a);return c.appendPaths(i),c.finish()});e.snapshot=s,e.activeNodeCount=s.nodes.length-1,e.pathCacheByNodeId=new Map([[s.rootId,{path:"",version:0}]]),e.pathCacheVersion=0,ve(e.instrumentation,"store.cleanup.aggressive.restoreExpansionOverrides",()=>XE(e,t)),ve(e.instrumentation,"store.cleanup.aggressive.restoreDirectoryLoadInfos",()=>QE(e,n)),ve(e.instrumentation,"store.cleanup.aggressive.recomputeCounts",()=>Yg(e,e.snapshot.rootId))}function TD(e){for(const t of e.directoryLoadInfoById.values())if(t.state==="loading"&&t.activeAttemptId!=null)return!0;return!1}function kD(e,t){const n=jS(e);t==="stable"?ve(e.instrumentation,"store.cleanup.stable",()=>wD(e)):ve(e.instrumentation,"store.cleanup.aggressive",()=>xD(e));const i=jS(e);return bD(t,t==="stable",n,i)}const AD=64;function LD(e,t){const n=t+2;if(n<=e.length)return e;let i=e.length;for(;i<n;)i*=2;const a=new Int32Array(i);return a.fill(-1),a.set(e),a}function un(e){return we(e,e.snapshot.rootId).visibleSubtreeCount}function ZE(e,t,n,i){const a=we(e,t.terminalNodeId),s=Math.max(1,a.visibleSubtreeCount);return Math.min(i-1,n+s-1)}function ID(e,t,n,i){return{ancestorPaths:i,index:t.index,posInSet:t.posInSet,row:bc(e,t.cursor),setSize:t.setSize,subtreeEndIndex:ZE(e,t.cursor,t.index,n)}}function JE(e,t,n,i,a,s){const c=_t(e,t),{childIndex:d,childVisibleIndex:f,localVisibleIndex:h}=eg(e.snapshot.nodes,c,n),m=c.childIds[d];if(m==null)throw new Error(`Visible index ${String(n)} is out of range`);return RD(e,m,h,i+f,a+1,d,c.childIds.length,s)}function RD(e,t,n,i,a,s,c,d){if(!Te(we(e,t))){if(n===0)return{ancestors:d,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:a},index:i,posInSet:s,setSize:c};throw new Error(`Visible index ${String(n)} is out of range for file`)}const f=n5(e,t,a);if(n===0)return{ancestors:d,cursor:f,index:i,posInSet:s,setSize:c};const h=we(e,f.terminalNodeId);if(!Te(h)||!wn(e,f.terminalNodeId,h))throw new Error(`Visible index ${String(n)} is out of range for collapsed directory`);return JE(e,f.terminalNodeId,n-1,i+1,f.visibleDepth,[...d,{cursor:f,index:i,posInSet:s,setSize:c}])}function DD(e,t){const n=un(e);if(t<0||t>=n)return null;const i=JE(e,e.snapshot.rootId,t,0,-1,[]),a=i.ancestors.map(c=>St(e,c.cursor.terminalNodeId));let s=null;return{ancestorPaths:a,get ancestorRows(){if(s!=null)return s;const c=[],d=[];for(const f of i.ancestors){const h=ID(e,f,n,[...d]);c.push(h),d.push(h.row.path)}return s=c,s},index:i.index,posInSet:i.posInSet,row:bc(e,i.cursor),setSize:i.setSize,subtreeEndIndex:ZE(e,i.cursor,i.index,n)}}function MD(e,t,n){const i=e.instrumentation,a=un(e);if(a<=0||n<t)return[];const s=Math.max(0,Math.min(t,a-1)),c=Math.max(s,Math.min(n,a-1));if(i==null){if(s===0)return BD(e,c+1);const g=[];let y=$S(e,s);for(let b=s;b<=c&&y!=null;b++){const S=bc(e,y);g.push(S),y=qS(e,y)}return g}const d=[];let f=0,h=0,m=ve(i,"store.getVisibleSlice.selectFirstRow",()=>$S(e,s));for(let g=s;g<=c&&m!=null;g++){const y=ve(i,"store.getVisibleSlice.materializeRow",()=>bc(e,m));d.push(y),y.isFlattened&&(f++,h+=y.flattenedSegments?.length??0),m=ve(i,"store.getVisibleSlice.advanceCursor",()=>qS(e,m))}return Cd(i,"workload.visibleRowsRead",d.length),Cd(i,"workload.flattenedRowsRead",f),Cd(i,"workload.flattenedSegmentsRead",h),d}function e5(e,t=un(e)){const n=e.instrumentation;return n==null?GS(e,t):ve(n,"store.getVisibleTreeProjection",()=>GS(e,t))}function OD(e){return VD(e5(e))}function PD(e,t){const n=hi(e,t);if(n==null||n===e.snapshot.rootId||Te(we(e,n))&&la(e,n)!==n)return null;let i=0,a=n;const{nodes:s,rootId:c}=e.snapshot;for(;a!==c;){const d=we(e,a).parentId,f=_t(e,d),h=yf(f).get(a);if(h==null)throw new Error(`Child ${String(a)} was not found in its parent index`);if(i+=d7(s,f,h),d!==c){const m=we(e,d),g=ws(e,d);if(!wn(e,d,m)&&g!==a)return null;la(e,d)===d&&(i+=1)}a=d}return i}function ND(e,t){const n=hi(e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);const i=we(e,n);if(!Te(i))throw new Error(`Path is not a directory: "${t}"`);return wn(e,n,i)?null:(vc(e,n,!0,i),ca(e,n),q7({affectedAncestorIds:wi(e,n),affectedNodeIds:[n],path:t}))}function HD(e,t){const n=hi(e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);const i=we(e,n);if(!Te(i))throw new Error(`Path is not a directory: "${t}"`);return wn(e,n,i)?(vc(e,n,!1,i),ca(e,n),G7({affectedAncestorIds:wi(e,n),affectedNodeIds:[n],path:t})):null}function $S(e,t){return t<0||t>=un(e)?null:t5(e,e.snapshot.rootId,t,-1)}function t5(e,t,n,i){const a=_t(e,t),s=e.instrumentation,{childIndex:c,localVisibleIndex:d}=s==null?eg(e.snapshot.nodes,a,n):ve(s,"store.getVisibleSlice.selectChildIndex",()=>eg(e.snapshot.nodes,a,n)),f=a.childIds[c];if(f!=null)return ag(e,f,d,i+1);throw new Error(`Visible index ${String(n)} is out of range`)}function ag(e,t,n,i){if(!Te(we(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:i};throw new Error(`Visible index ${String(n)} is out of range for file`)}const a=n5(e,t,i);if(n===0)return a;const s=we(e,a.terminalNodeId);if(!Te(s)||!wn(e,a.terminalNodeId,s))throw new Error(`Visible index ${String(n)} is out of range for collapsed directory`);return t5(e,a.terminalNodeId,n-1,a.visibleDepth)}function n5(e,t,n){return Te(we(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:la(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:ve(e.instrumentation,"store.getVisibleSlice.flatten.resolveTerminalDirectory",()=>la(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function zD(e,t){const n=we(e,t);if(!Te(n))return!0;const i=n.parentId;return i===e.snapshot.rootId?!0:ws(e,i)!==t}function qS(e,t){const n=we(e,t.terminalNodeId);if(Te(n)){const s=_t(e,t.terminalNodeId);if(wn(e,t.terminalNodeId,n)&&s.childIds.length>0){const c=s.childIds[0];return c==null?null:ag(e,c,0,t.visibleDepth+1)}}let i=t.terminalNodeId,a=t.visibleDepth;for(;;){const s=we(e,i);if(i===e.snapshot.rootId)return null;const c=s.parentId,d=_t(e,c),f=yf(d).get(i)??-1;if(f<0)throw new Error(`Child ${String(i)} was not found in its parent index`);const h=d.childIds[f+1]??null;if(h!=null)return ag(e,h,0,a);zD(e,i)&&a--,i=c}}function VD(e){const t=e.paths.length,n=new Array(t);for(let i=0;i<t;i+=1){const a=e.getParentIndex(i);n[i]={index:i,parentPath:a>=0?e.paths[a]??null:null,path:e.paths[i]??"",posInSet:e.posInSetByIndex[i]??0,setSize:e.setSizeByIndex[i]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function GS(e,t){const n=new Array(t),i=new Int32Array(t),a=new Int32Array(t),s=new Int32Array(t);let c=new Int32Array(AD);c.fill(-1);let d=0;const{nodes:f,directories:h,segmentTable:m}=e.snapshot,g=[[h.get(e.snapshot.rootId),0,-1,""]],y=e.snapshot.options.flattenEmptyDirectories,b=e.pathCacheByNodeId,S=e.pathCacheVersion,w=m.valueById;for(;g.length>0&&d<t;){const L=g[g.length-1],O=L[0];if(L[1]>=O.childIds.length){g.pop();continue}const D=L[1],N=O.childIds[L[1]++],W=f[N],G=L[2]+1,se=L[3];c=LD(c,G);let ie,ee=N;if(Te(W))ee=y?la(e,N):N,ie=ee===N?`${se}${w[W.nameId]}/`:St(e,ee);else{const le=b.get(N);ie=le!=null&&le.version===S?le.path:`${se}${w[W.nameId]}`}i[d]=c[G],n[d]=ie,a[d]=D,s[d]=O.childIds.length,c[G+1]=d,d+=1;const te=f[ee];te!=null&&Te(te)&&wn(e,ee,te)&&g.push([h.get(ee),0,G,ie])}d<t&&(n.length=d);const A=i.subarray(0,d),k=a.subarray(0,d),E=s.subarray(0,d);let T=null;return{getParentIndex(L){return L<0||L>=d?-1:A[L]??-1},paths:n,posInSetByIndex:k,setSizeByIndex:E,get visibleIndexByPath(){if(T==null){T=new Map;for(let L=0;L<d;L+=1)T.set(n[L]??"",L)}return T}}}function BD(e,t){const n=new Array(t);let i=0;const{nodes:a,directories:s,segmentTable:c}=e.snapshot,d=[[s.get(e.snapshot.rootId),0,-1]],f=c.valueById,h=e.snapshot.options.flattenEmptyDirectories,m=e.pathCacheByNodeId,g=e.pathCacheVersion;for(;d.length>0&&i<t;){const y=d[d.length-1],b=y[0];if(y[1]>=b.childIds.length){d.pop();continue}const S=b.childIds[y[1]++],w=a[S],A=y[2]+1;if(!Te(w)){const L=m.get(S);n[i++]={depth:A,flattenedSegments:void 0,hasChildren:!1,id:S,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:"file",loadState:void 0,name:f[w.nameId],path:L!=null&&L.version===g?L.path:St(e,S)};continue}const k=h?la(e,S):S,E={headNodeId:S,terminalNodeId:k,visibleDepth:A};n[i++]=bc(e,E);const T=a[k];T!=null&&Te(T)&&wn(e,k,T)&&d.push([s.get(k),0,A])}return i<t&&(n.length=i),n}function bc(e,t){const n=we(e,t.terminalNodeId),i=Te(n)?UD(e,t):null,a=St(e,t.terminalNodeId),s=Wi(e.snapshot.segmentTable,n.nameId),c=Te(n)&&_t(e,t.terminalNodeId).childIds.length>0,d=t.headNodeId!==t.terminalNodeId,f=e.instrumentation,h=d?f==null?Xd(e,t.headNodeId).map(m=>{const g=we(e,m);return{isTerminal:m===t.terminalNodeId,name:Wi(e.snapshot.segmentTable,g.nameId),nodeId:m,path:St(e,m)}}):ve(f,"store.getVisibleSlice.flatten.collectSegments",()=>Xd(e,t.headNodeId).map(m=>{const g=we(e,m);return{isTerminal:m===t.terminalNodeId,name:Wi(e.snapshot.segmentTable,g.nameId),nodeId:m,path:St(e,m)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:h,hasChildren:c,id:t.terminalNodeId,isExpanded:Te(n)&&wn(e,t.terminalNodeId,n),isFlattened:d,isLoading:i==="loading",kind:Te(n)?"directory":"file",loadState:i==null||i==="loaded"?void 0:i,name:s,path:a}}function UD(e,t){if(t.headNodeId===t.terminalNodeId)return yc(e,t.terminalNodeId);const n=Xd(e,t.headNodeId);let i=!1,a=!1;for(const s of n){const c=yc(e,s);if(c==="loading")return"loading";if(c==="error"){a=!0;continue}c==="unloaded"&&(i=!0)}return a?"error":i?"unloaded":"loaded"}function FD(e){const{directories:t,nodes:n,options:i,rootId:a,presortedDirectoryNodeIds:s}=e.snapshot,c=i.flattenEmptyDirectories===!0,d=b=>{const S=n[b];if(S==null||!Te(S))return;const w=t.get(b);if(w==null)throw new Error(`Unknown directory child index for node ${String(b)}`);const A=w.childIds,k=A.length;let E=0,T=0;for(let O=0;O<k;O++){const D=A[O];if(D==null)continue;const N=n[D];E+=N.subtreeNodeCount,T+=N.visibleSubtreeCount}w.totalChildSubtreeNodeCount=E,w.totalChildVisibleSubtreeCount=T,k>=128&&gc(n,w),S.subtreeNodeCount=1+E;let L;if(c&&k===1){const O=n[A[0]];L=O!=null&&Te(O)?T:1+T}else L=1+T;S.visibleSubtreeCount=L};if(s!=null)for(let b=s.length-1;b>=0;b--)d(s[b]);else for(let b=n.length-1;b>=1;b--)d(b);const f=n[a],h=t.get(a);if(f==null||h==null)return;const m=h.childIds;let g=0,y=0;for(let b=0;b<m.length;b++){const S=m[b];if(S==null)continue;const w=n[S];g+=w.subtreeNodeCount,y+=w.visibleSubtreeCount}h.totalChildSubtreeNodeCount=g,h.totalChildVisibleSubtreeCount=y,gc(n,h),f.subtreeNodeCount=1+g,f.visibleSubtreeCount=y}function jD(e){return e.initialExpansion==="open"&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Jg=class i5{#e;constructor(t={}){const n=qg(t),i=ve(n,"store.builder.create",()=>new VE(t));if(t.preparedInput!=null){const d=I7(t.preparedInput);d!=null?i.appendPresortedPaths(d,R7(t.preparedInput)):i.appendPreparedPaths(L7(t.preparedInput),!1)}else{const d=t.paths??[];t.presorted===!0?i.appendPaths(d):i.appendPreparedPaths(ve(n,"store.preparePathEntries",()=>Kg(d,t)))}const a=ve(n,"store.builder.finish",()=>i.finish({skipSubtreeCountPass:!0})),s=ve(n,"store.state.detectAllDirectoriesExpanded",()=>(t.initialExpansion??"closed")==="closed"&&i.didMatchAllInitialExpandedPaths());this.#e=ve(n,"store.state.create",()=>D7(a,s?"open":t.initialExpansion??"closed",n)),s&&(this.#e.collapseNewDirectoriesByDefault=!0);const c=s?this.#e.snapshot.directories.size-1:ve(n,"store.state.initializeExpandedPaths",()=>this.initializeExpandedPaths(t.initialExpandedPaths));s||jD(t)||(t.initialExpansion??"closed")==="closed"&&c===this.#e.snapshot.directories.size-1||(t.initialExpandedPaths?.length??0)>0&&ve(n,"store.state.checkAllDirectoriesExpanded",()=>this.hasAllDirectoriesExpanded())?ve(n,"store.state.initializeOpenVisibleCounts",()=>FD(this.#e)):ve(n,"store.state.recomputeCounts",()=>Yg(this.#e,this.#e.snapshot.rootId))}static preparePaths(t,n={}){return T7(t,n)}static prepareInput(t,n={}){return k7(t,n)}static preparePresortedInput(t){return A7(t)}list(t){return ve(this.#e.instrumentation,"store.list",()=>FE(this.#e,t))}add(t){ve(this.#e.instrumentation,"store.add",()=>{const n=un(this.#e);Ci(this.#e,On(this.#e,n,NS(this.#e,t)))})}remove(t,n={}){ve(this.#e.instrumentation,"store.remove",()=>{const i=un(this.#e);Ci(this.#e,On(this.#e,i,HS(this.#e,t,n)))})}move(t,n,i={}){ve(this.#e.instrumentation,"store.move",()=>{const a=un(this.#e),s=zS(this.#e,t,n,i);s!=null&&Ci(this.#e,On(this.#e,a,s))})}batch(t){J7(this.#e,()=>{if(typeof t=="function"){t(this);return}for(const n of t)switch(n.type){case"add":this.add(n.path);break;case"remove":this.remove(n.path,{recursive:n.recursive});break;case"move":this.move(n.from,n.to,{collision:n.collision});break}})}getVisibleCount(){return ve(this.#e.instrumentation,"store.getVisibleCount",()=>un(this.#e))}getVisibleSlice(t,n){return ve(this.#e.instrumentation,"store.getVisibleSlice",()=>MD(this.#e,t,n))}getVisibleRowContext(t){return ve(this.#e.instrumentation,"store.getVisibleRowContext",()=>DD(this.#e,t))}getVisibleTreeProjection(){return OD(this.#e)}getVisibleTreeProjectionData(t){return e5(this.#e,t)}getVisibleIndex(t){return ve(this.#e.instrumentation,"store.getVisibleIndex",()=>PD(this.#e,t))}getPathInfo(t){return ve(this.#e.instrumentation,"store.getPathInfo",()=>{const n=hi(this.#e,t);if(n==null)return null;const i=we(this.#e,n);return{depth:$i(i),kind:Te(i)?"directory":"file",path:St(this.#e,n)}})}isExpanded(t){return ve(this.#e.instrumentation,"store.isExpanded",()=>{const n=this.requireDirectoryNodeId(t),i=we(this.#e,n);return wn(this.#e,n,i)})}expand(t){ve(this.#e.instrumentation,"store.expand",()=>{const n=un(this.#e),i=ND(this.#e,t);i!=null&&Ci(this.#e,On(this.#e,n,i))})}collapse(t){ve(this.#e.instrumentation,"store.collapse",()=>{const n=un(this.#e),i=HD(this.#e,t);i!=null&&Ci(this.#e,On(this.#e,n,i))})}on(t,n){return U7(this.#e,t,n)}getDirectoryLoadState(t){const n=this.requireDirectoryNodeId(t);return yc(this.#e,n)}markDirectoryUnloaded(t){ve(this.#e.instrumentation,"store.markDirectoryUnloaded",()=>{const n=this.requireDirectoryNodeId(t);if(_t(this.#e,n).childIds.length>0)throw new Error(`Cannot mark a directory with known children as unloaded: "${t}"`);const i=un(this.#e);N7(this.#e,n),Ci(this.#e,On(this.#e,i,W7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],path:t,projectionChanged:this.isDirectoryProjectionVisible(n)})))})}beginChildLoad(t){return ve(this.#e.instrumentation,"store.beginChildLoad",()=>{const n=this.requireDirectoryNodeId(t),i=un(this.#e),a=P7(this.#e,n);return Ci(this.#e,On(this.#e,i,K7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],attemptId:a.attemptId,path:t,projectionChanged:this.isDirectoryProjectionVisible(n),reused:a.reused}))),a})}applyChildPatch(t,n){return ve(this.#e.instrumentation,"store.applyChildPatch",()=>{const i=this.resolveActiveDirectoryNodeId(t.nodeId);if(i==null||yc(this.#e,i)!=="loading"||!z7(this.#e,i,t.attemptId))return!1;const a=St(this.#e,i);this.validateChildPatch(a,n);const s=un(this.#e),c=[];for(const f of n.operations){$D(a,f);const h=un(this.#e);switch(f.type){case"add":c.push(On(this.#e,h,NS(this.#e,f.path)));break;case"remove":c.push(On(this.#e,h,HS(this.#e,f.path,{recursive:f.recursive})));break;case"move":{const m=zS(this.#e,f.from,f.to,{collision:f.collision});m!=null&&c.push(On(this.#e,h,m));break}}}const d=c.some(f=>f.projectionChanged)||this.isDirectoryProjectionVisible(i);return Ci(this.#e,On(this.#e,s,Y7({affectedAncestorIds:wi(this.#e,i),affectedNodeIds:[i],attemptId:t.attemptId,childEvents:c,path:St(this.#e,i),projectionChanged:d}))),!0})}completeChildLoad(t){return ve(this.#e.instrumentation,"store.completeChildLoad",()=>{const n=this.resolveActiveDirectoryNodeId(t.nodeId);if(n==null)return!1;const i=un(this.#e),a=H7(this.#e,n,t.attemptId);return Ci(this.#e,On(this.#e,i,X7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],attemptId:t.attemptId,path:St(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!a}))),a})}failChildLoad(t,n){return ve(this.#e.instrumentation,"store.failChildLoad",()=>{const i=this.resolveActiveDirectoryNodeId(t.nodeId);if(i==null)return!1;const a=un(this.#e),s=V7(this.#e,i,t.attemptId,n);return Ci(this.#e,On(this.#e,a,Q7({affectedAncestorIds:wi(this.#e,i),affectedNodeIds:[i],attemptId:t.attemptId,errorMessage:n,path:St(this.#e,i),projectionChanged:this.isDirectoryProjectionVisible(i),stale:!s}))),s})}cleanup(t={}){return ve(this.#e.instrumentation,"store.cleanup",()=>{if(this.#e.transactionStack.length>0)throw new Error("Cleanup cannot run during an open batch or transaction.");if(TD(this.#e))throw new Error("Cleanup cannot run while directory loads are active.");const n=un(this.#e),i=kD(this.#e,t.mode??"stable");return Ci(this.#e,On(this.#e,n,Z7({...i,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:i.idsPreserved===!1}))),i})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(t){if(t==null||t.length===0)return 0;let n=0;const i=[],a=[];let s=0,c=null;const d=this.#e.snapshot.segmentTable,f=d.valueById,h=this.#e.snapshot.nodes,m=new Map;for(const g of t){c!=null&&g<c&&(c=null,s=0,i.length=0,a.length=0);const y=g.length>0&&g.charCodeAt(g.length-1)===47?g.length-1:g.length;if(y===0){c=g,s=y,i.length=0,a.length=0;continue}let b=0,S=0;if(c!=null){const T=Math.min(y,s);let L=!0;for(let O=0;O<T;O+=1){const D=g.charCodeAt(O);if(D!==c.charCodeAt(O)){L=!1;break}D===47&&(b+=1,S=O+1)}L&&(T===s&&y>T&&g.charCodeAt(T)===47?(b+=1,S=T+1):T===y&&s>T&&c.charCodeAt(T)===47&&(b+=1,S=y+1)),b=Math.min(b,a.length)}let w=b===0?this.#e.snapshot.rootId:a[b-1]??this.#e.snapshot.rootId,A=b,k=!0,E=S;for(;E<=y;){const T=g.indexOf("/",E),L=T===-1||T>y?y:T,O=g.slice(E,L),D=_t(this.#e,w).childIds,N=A===b?i[A]??0:0;let W=N,G;const se=m.get(O)??kc(O);m.set(O,se);const ie=(ee,te)=>{for(W=ee;W<te;W+=1){const le=D[W],me=h[le],H=f[me.nameId];if(H===O)return G=le,!0;const z=Gg(tg(d,me.nameId),se);if(z>0||z===0&&H>O)return!1}return!1};if(!ie(N,D.length)&&N>0&&ie(0,N),G===void 0){k=!1;break}if(!Te(we(this.#e,G))){k=!1;break}if(i[A]=W,a[A]=G,w=G,A+=1,L===y)break;E=L+1}if(c=g,s=y,i.length=A,a.length=A,!k){c=null,s=0,i.length=0,a.length=0;continue}for(let T=b;T<A;T+=1){const L=a[T];if(L==null)continue;const O=we(this.#e,L);wn(this.#e,L,O)||(vc(this.#e,L,!0,O),n+=1)}}return n}hasAllDirectoriesExpanded(){for(const t of this.#e.snapshot.directories.keys()){if(t===this.#e.snapshot.rootId)continue;const n=we(this.#e,t);if(!wn(this.#e,t,n))return!1}return!0}requireDirectoryNodeId(t){const n=hi(this.#e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);if(!Te(we(this.#e,n)))throw new Error(`Path is not a directory: "${t}"`);return n}resolveActiveDirectoryNodeId(t){try{if(!Te(we(this.#e,t)))throw new Error(`Node is not a directory: ${String(t)}`);return t}catch{return null}}isDirectoryProjectionVisible(t){let n=t;for(;n!==this.#e.snapshot.rootId;){const i=we(this.#e,n).parentId;if(i!==this.#e.snapshot.rootId){const a=we(this.#e,i),s=ws(this.#e,i);if(!wn(this.#e,i,a)&&s!==n)return!1}n=i}return!0}validateChildPatch(t,n){new i5({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function $D(e,t){switch(t.type){case"add":case"remove":if(!t.path.startsWith(e)||t.path===e)throw new Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case"move":if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw new Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}function qD(e){return Jg.preparePresortedInput(e)}const sg={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function GD(e,t){if(typeof e=="number")return{itemHeight:t??sg.default.itemHeight,factor:e};const n=sg[e??"default"];return{itemHeight:t??n.itemHeight,factor:n.factor}}const r5=sg.default.itemHeight;var WS=`@layer base {
1780
+ </svg>`)}const ES=kE(TE,qR),WR={minimal:TE,standard:ES,complete:kE(ES,GR)},KR={".babelrc":"babel",".babelrc.json":"babel",".bash_profile":"bash",".bashrc":"bash",".browserslistrc":"browserslist",".dockerignore":"docker",".eslintignore":"eslint",".eslintrc":"eslint",".eslintrc.cjs":"eslint",".eslintrc.js":"eslint",".eslintrc.json":"eslint",".eslintrc.yaml":"eslint",".eslintrc.yml":"eslint",".gitattributes":"git",".gitignore":"git",".gitkeep":"git",".gitmodules":"git",".oxlintrc.json":"oxc",".postcssrc":"postcss",".postcssrc.json":"postcss",".postcssrc.yaml":"postcss",".postcssrc.yml":"postcss",".prettierignore":"prettier",".prettierrc":"prettier",".prettierrc.cjs":"prettier",".prettierrc.js":"prettier",".prettierrc.json":"prettier",".prettierrc.mjs":"prettier",".prettierrc.toml":"prettier",".prettierrc.yaml":"prettier",".prettierrc.yml":"prettier",".stylelintignore":"stylelint",".stylelintrc":"stylelint",".stylelintrc.cjs":"stylelint",".stylelintrc.js":"stylelint",".stylelintrc.json":"stylelint",".stylelintrc.mjs":"stylelint",".stylelintrc.yaml":"stylelint",".stylelintrc.yml":"stylelint",".terraform.lock.hcl":"terraform",".zprofile":"bash",".zshenv":"bash",".zshrc":"bash","babel.config.cjs":"babel","babel.config.js":"babel","babel.config.json":"babel","babel.config.mjs":"babel","biome.json":"biome","biome.jsonc":"biome","bootstrap.bundle.js":"bootstrap","bootstrap.bundle.min.js":"bootstrap","bootstrap.css":"bootstrap","bootstrap.js":"bootstrap","bootstrap.min.css":"bootstrap","bootstrap.min.js":"bootstrap","bun.lock":"bun","bun.lockb":"bun","bunfig.toml":"bun","claude.md":"claude","compose.yaml":"docker","compose.yml":"docker","docker-compose.override.yml":"docker","docker-compose.yaml":"docker","docker-compose.yml":"docker",dockerfile:"docker","eslint.config.cjs":"eslint","eslint.config.js":"eslint","eslint.config.mjs":"eslint","eslint.config.mts":"eslint","eslint.config.ts":"eslint",gemfile:"ruby","next.config.js":"nextjs","next.config.mjs":"nextjs","next.config.mts":"nextjs","next.config.ts":"nextjs","postcss.config.cjs":"postcss","postcss.config.js":"postcss","postcss.config.mjs":"postcss","postcss.config.ts":"postcss","prettier.config.cjs":"prettier","prettier.config.js":"prettier","prettier.config.mjs":"prettier",rakefile:"ruby","readme.md":"markdown","stylelint.config.cjs":"stylelint","stylelint.config.js":"stylelint","stylelint.config.mjs":"stylelint","svgo.config.cjs":"svgo","svgo.config.js":"svgo","svgo.config.mjs":"svgo","svgo.config.ts":"svgo","tailwind.config.cjs":"tailwind","tailwind.config.js":"tailwind","tailwind.config.mjs":"tailwind","tailwind.config.ts":"tailwind","vite.config.js":"vite","vite.config.mjs":"vite","vite.config.mts":"vite","vite.config.ts":"vite","webpack.config.babel.js":"webpack","webpack.config.cjs":"webpack","webpack.config.js":"webpack","webpack.config.mjs":"webpack","webpack.config.ts":"webpack"},YR={"7z":"zip",astro:"astro",AUTHORS:"text",avif:"image",bash:"bash",bmp:"image",bz2:"zip",c:"c",cc:"cpp",cfg:"text",CHANGELOG:"text",cjs:"javascript","code-workspace":"vscode",conf:"text",CONTRIBUTORS:"text",cpp:"cpp",csh:"bash",css:"css",csv:"table",cts:"typescript",cxx:"cpp",db:"database",editorconfig:"text",env:"text","env.development":"text","env.local":"text","env.production":"text",eot:"font",erb:"ruby",fish:"bash",gemspec:"ruby",gif:"image",go:"go",gql:"graphql",graphql:"graphql",gz:"zip",h:"c",hh:"cpp",hpp:"cpp",htm:"html",html:"html",hxx:"cpp",icns:"image",ico:"image",ini:"text",inl:"cpp",jar:"zip",jpeg:"image",jpg:"image",js:"javascript",json:"json",json5:"json",jsonc:"json",jsonl:"json",jsx:"javascript",ksh:"bash",less:"css",LICENSE:"text",log:"text",markdown:"markdown",mcp:"mcp",md:"markdown",mdx:"markdown","mdx.tsx":"markdown",mjs:"javascript",mm:"cpp",mts:"typescript",ods:"table",otf:"font",png:"image",postcss:"css",py:"python",pyi:"python",pyw:"python",pyx:"python",rake:"ruby",rar:"zip",rb:"ruby",rs:"rust",rst:"text",rtf:"text",sass:"css",scss:"css",sh:"bash",sql:"database",sqlite:"database",sqlite3:"database",styl:"css",svelte:"svelte",svg:"svg",swift:"swift",tar:"zip",tf:"terraform",tfstate:"terraform",tfvars:"terraform",tgz:"zip",tif:"image",tiff:"image",ts:"typescript",tsv:"table",tsx:"typescript",ttf:"font",txt:"text",vue:"vue",war:"zip",wasm:"wasm",wast:"wasm",wat:"wasm",webp:"image",woff:"font",woff2:"font",xhtml:"html",xls:"table",xlsx:"table",xz:"zip",yaml:"yml",yml:"yml",zig:"zig",zip:"zip",zsh:"bash"},XR={jsx:"react",sass:"sass",scss:"sass",tsx:"react"},wS=new Set(["bash","c","cpp","css","database","default","font","git","go","html","image","javascript","json","markdown","mcp","python","ruby","rust","swift","table","text","typescript","zip"]),QR=new Set(["complete"]);function ZR(e){return WR[e==="none"?"minimal":e]}function JR(e){return`file-tree-builtin-${e}`}function e7(e){return e!=="none"&&QR.has(e)}function t7(e,t,n){if(e==="minimal"||e==="none")return;const i=e==="complete",a=KR[t.toLowerCase()];if(a!=null&&(i||wS.has(a)))return a;for(const s of n){if(i){const d=XR[s];if(d!=null)return d}const c=YR[s];if(c!=null&&(i||wS.has(c)))return c}return"default"}const Jm="file-tree-container",xS="data-file-tree-style",TS="data-file-tree-unsafe-css",n7="data-file-tree-scrollbar-measure",kS="data-file-tree-scrollbar-gutter-measured",i7="--trees-scrollbar-gutter-measured",Wd="header",ql="context-menu",r7="context-menu-trigger";function o7(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function _d(e){return e==null?{set:"complete",colored:!0}:typeof e=="string"?{set:e,colored:!0}:{...e,set:e.set??(o7(e)?"none":"complete"),colored:e.colored??!0}}const a7=e=>e.trim().toLowerCase(),s7=e=>e.split("/").at(-1)??e,l7=e=>{const t=e.toLowerCase().split("."),n=[];for(let i=1;i<t.length;i+=1)n.push(t.slice(i).join("."));return n};function Pl(e,t){return typeof e=="string"?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function c7(e){const t=_d(e),n=t.remap,i=new Map;for(const[d,f]of Object.entries(t.byFileName??{}))i.set(d.toLowerCase(),f);const a=new Map;for(const[d,f]of Object.entries(t.byFileExtension??{}))a.set(a7(d),f);const s=Object.entries(t.byFileNameContains??{}).map(([d,f])=>[d.toLowerCase(),f]);return{resolveIcon:(d,f)=>{if(d==="file-tree-icon-file"&&f!=null){const m=s7(f),g=m.toLowerCase(),y=i.get(g);if(y!=null)return Pl(y,d);for(const[w,A]of s)if(g.includes(w))return Pl(A,d);const b=l7(m);for(const w of b){const A=a.get(w);if(A!=null)return Pl(A,d)}const S=t7(t.set,m,b);if(S!=null&&t.set!=="none"){if(S==="default"){const w=n?.[d];if(w!=null)return Pl(w,d)}return{name:JR(S),remappedFrom:d,token:S}}}const h=n?.[d];return h==null?{name:d}:Pl(h,d)}}}const mc=5,vf=1<<mc,u7=vf*4;function Gl(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function AS(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function fa(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;const n=new Map;for(const i of t.childIds){const a=e[i];a!=null&&n.set(a.nameId,i)}return t.childIdByNameId=n,n}function yf(e){if(e.childPositionById!=null)return e.childPositionById;const t=new Map;for(let n=0;n<e.childIds.length;n++){const i=e.childIds[n];i!=null&&t.set(i,n)}return e.childPositionById=t,t}function Nl(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function AE(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){const i=e.childIds[n];i!=null&&e.childPositionById.set(i,n)}}function Kd(e,t){let n=0,i=0;for(const a of t.childIds){const s=e[a];s!=null&&(n+=s.subtreeNodeCount,i+=s.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=i,gc(e,t)}function jg(e,t,n,i){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=i,e.childVisibleChunkSums==null||i===0)return;const a=yf(e).get(t);if(a===void 0)return;const s=a>>mc;e.childVisibleChunkSums[s]+=i}function eg(e,t,n){const i=t.childVisibleChunkSums;if(i!=null){let s=n,c=0;for(const d of i){if(s<d){const f=f7(e,t,c,s);return{...f,childVisibleIndex:n-f.localVisibleIndex}}s-=d,c+=vf}throw new Error(`Visible child index ${String(n)} is out of range`)}let a=n;for(let s=0;s<t.childIds.length;s++){const c=t.childIds[s];if(c==null)continue;const d=e[c];if(d!=null){if(a<d.visibleSubtreeCount)return{childIndex:s,childVisibleIndex:n-a,localVisibleIndex:a};a-=d.visibleSubtreeCount}}throw new Error(`Visible child index ${String(n)} is out of range`)}function d7(e,t,n){let i=0;const a=t.childVisibleChunkSums;let s=0;if(a!=null){const c=n>>mc;for(let d=0;d<c;d+=1)i+=a[d]??0;s=c<<mc}for(let c=s;c<n;c+=1){const d=t.childIds[c];if(d==null)continue;const f=e[d];f!=null&&(i+=f.visibleSubtreeCount)}return i}function gc(e,t){if(t.childIds.length<u7){t.childVisibleChunkSums=null;return}const n=Math.ceil(t.childIds.length/vf),i=new Int32Array(n);for(let a=0;a<t.childIds.length;a++){const s=t.childIds[a];if(s==null)continue;const c=e[s];c!=null&&(i[a>>mc]+=c.visibleSubtreeCount)}t.childVisibleChunkSums=i}function f7(e,t,n,i){const a=Math.min(t.childIds.length,n+vf);let s=i;for(let c=n;c<a;c++){const d=t.childIds[c];if(d==null)continue;const f=e[d];if(f!=null){if(s<f.visibleSubtreeCount)return{childIndex:c,localVisibleIndex:s};s-=f.visibleSubtreeCount}}throw new Error(`Visible child index ${String(i)} is out of range`)}const h7=7,$g=3,LE=1<<$g,IE=4;function Kn(e,t,n=0){return e<<IE|n<<$g|t}function $i(e){return e.depthAndFlags>>>IE}function bf(e){return(e.depthAndFlags&LE)>>$g}function Te(e){return(e.depthAndFlags&LE)!==0}function RE(e){return e.depthAndFlags&h7}function Ut(e,t){return(RE(e)&t)!==0}function Sf(e,t){e.depthAndFlags|=t}function p7(e,t){e.depthAndFlags=Kn(t,RE(e),bf(e))}const DE=Symbol("benchmarkInstrumentation");function m7(e,t){return t==null||Object.defineProperty(e,DE,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function qg(e){return e==null?null:e[DE]??null}function ve(e,t,n){return e==null?n():e.measurePhase(t,n)}function Cd(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function LS(e){return e>=48&&e<=57}function g7(e){const t=[];let n=0,i=0;for(;i<e.length;){for(;i<e.length&&!LS(e.charCodeAt(i));)i+=1;if(i>=e.length)break;i>n&&t.push(e.slice(n,i));let a=0;for(;i<e.length&&LS(e.charCodeAt(i));)a=a*10+(e.charCodeAt(i)-48),i+=1;t.push(a),n=i}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function kc(e){const t=e.toLowerCase();return{lowerValue:t,tokens:g7(t)}}function v7(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const a=e[i],s=t[i];if(a===s)continue;if(typeof a=="number"&&typeof s=="number")return a<s?-1:1;const c=String(a),d=String(s);if(c!==d)return c<d?-1:1}return e.length!==t.length?e.length<t.length?-1:1:0}function Gg(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]=="string"&&typeof t.tokens[0]=="string")return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;const n=v7(e.tokens,t.tokens);return n!==0?n:e.lowerValue!==t.lowerValue?e.lowerValue<t.lowerValue?-1:1:0}function ME(e,t,n){const i=Gg(n(e),n(t));return i!==0?i:e===t?0:e<t?-1:1}function y7(e,t){return ME(e,t,kc)}function Yd(e,t){return t!==e.segments.length-1||e.isDirectory?1:0}function b7(e,t){const n=Math.min(e.segments.length,t.segments.length);for(let i=0;i<n;i++){const a=e.segments[i],s=t.segments[i];if(a===s)continue;const c=Yd(e,i);return c!==Yd(t,i)?c===1?-1:1:y7(a,s)}return e.segments.length!==t.segments.length?e.segments.length<t.segments.length?-1:1:e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1}function S7(e,t){return b7(e,t)}function _7(e,t,n){const i=s=>{const c=n.get(s);if(c!=null)return c;const d=kc(s);return n.set(s,d),d},a=Math.min(e.segments.length,t.segments.length);for(let s=0;s<a;s++){const c=e.segments[s],d=t.segments[s];if(c===d)continue;const f=Yd(e,s);return f!==Yd(t,s)?f===1?-1:1:ME(c,d,i)}return e.segments.length!==t.segments.length?e.segments.length<t.segments.length?-1:1:e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1}function tg(e,t){const n=e.sortKeyById[t];if(n!==void 0)return n;const i=e.valueById[t],a=kc(i);return e.sortKeyById[t]=a,a}function OE(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??"default"}}function PE(e){const t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,i=[];let a=0;for(let s=0;s<n;s++)e.charCodeAt(s)===47&&(i.push(e.slice(a,s)),a=s+1);return i.push(e.slice(a,n)),{hasTrailingSlash:t,segments:i}}function Jl(e){const{hasTrailingSlash:t,segments:n}=PE(e);return{basename:n[n.length-1]??"",isDirectory:t,path:e,segments:n}}function ng(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};const{hasTrailingSlash:t,segments:n}=PE(e);return{requiresDirectory:t,segments:n}}function NE(){const e=new Map;return e.set("",0),{idByValue:e,valueById:[""],sortKeyById:[kc("")]}}function yo(e,t){const n=e.idByValue.get(t);if(n!==void 0)return n;const i=e.valueById.length;return e.idByValue.set(t,i),e.valueById.push(t),i}function Wi(e,t){const n=e.valueById[t];if(n===void 0)throw new Error(`Unknown segment ID: ${String(t)}`);return n}const Wg=Symbol("pathStorePreparedInputKind");function HE(e,t){return e[Wg]=t,e}function IS(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function zE(e,t,n){return n==="default"?S7(e,t):n(IS(e),IS(t))}function C7(){return{depthAndFlags:Kn(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function E7(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++)if(e[i]!==t[i])return i;return n}function RS(e){return e.isDirectory?e.segments.length:e.segments.length-1}function w7(e){return Array.isArray(e)&&e.every(t=>t!=null&&typeof t=="object"&&typeof t.path=="string"&&Array.isArray(t.segments)&&typeof t.basename=="string"&&typeof t.isDirectory=="boolean")}function x7(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function T7(e,t={}){return Kg(e,t).map(n=>n.path)}function k7(e,t={}){const n=Kg(e,t);return HE({paths:n.map(i=>i.path),preparedPaths:n},"prepared")}function A7(e){const t=e.length;let n=!1;for(let i=0;i<t;i+=1){const a=e[i];if(a.length>0&&a.charCodeAt(a.length-1)===47){n=!0;break}}return HE({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},"presorted")}function L7(e){const t=e,n=t.preparedPaths;if(t[Wg]==="prepared"&&n!=null)return n;if(!w7(n))throw new Error("preparedInput must come from PathStore.prepareInput()");return n}function I7(e){const t=e;return t[Wg]==="presorted"&&t.presortedPaths!=null||x7(t.presortedPaths)?t.presortedPaths:null}function R7(e){const t=e;return typeof t.presortedPathsContainDirectories=="boolean"?t.presortedPathsContainDirectories:null}function Kg(e,t={}){const n=OE(t),i=qg(t);Cd(i,"workload.inputFiles",e.length);const a=ve(i,"store.preparePathEntries.parse",()=>e.map(s=>Jl(s)));return ve(i,"store.preparePathEntries.sort",()=>a.sort((s,c)=>zE(s,c,n.sort))),a}var VE=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[C7()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=NE();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=qg(e),this.options=OE(e);const t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{const n=new Set,i=t.length;for(let a=0;a<i;a+=1){const s=t[a],c=s.length;n.add(c>0&&s.charCodeAt(c-1)===47?s.slice(0,c-1):s)}this.initialExpandedPathSet=n,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,Gl())}appendPaths(e){return ve(this.instrumentation,"store.builder.appendPaths.parse",()=>this.appendPreparedPaths(e.map(t=>Jl(t))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,ve(this.instrumentation,"store.builder.appendPreparedPaths",()=>{for(const n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return ve(this.instrumentation,"store.builder.appendPresortedPaths",()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,i=0;const a=this.nodes,s=this.segmentTable,c=s.idByValue,d=s.valueById,f=this.directoryStack;let h=0,m="",g=0;for(const y of e){if(n===y)throw new Error(`Duplicate path: "${y}"`);const b=y.length>0&&y.charCodeAt(y.length-1)===47,S=b?y.length-1:y.length;let w=0,A=0;if(n!=null)if(m.length>0&&y.length>m.length&&y.startsWith(m))w=g,A=m.length;else{const T=Math.min(S,n.length);let L=!0;for(let O=0;O<T;O++){const D=y.charCodeAt(O);if(D!==n.charCodeAt(O)){L=!1;break}D===47&&(w++,A=O+1)}L&&b&&T===S&&n.length>S&&n.charCodeAt(S)===47&&(w++,A=S+1)}h=w,i=w;let k=A,E=y.indexOf("/",k);for(;E>=0&&E<S;){const T=f[h];if(T===void 0)throw new Error("Directory stack underflow while building the path store");i++;const L=y.slice(k,E);let O=c.get(L);O===void 0&&(O=d.length,c.set(L,O),d.push(L));const D=a.length;a.push({depthAndFlags:Kn(i,0,1),nameId:O,parentId:T,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(y.slice(0,E)),h++,f[h]=D,k=E+1,E=y.indexOf("/",k)}if(b){if(k<S){const L=f[h];if(L===void 0)throw new Error(`Unable to resolve directory parent for "${y}"`);i++;const O=y.slice(k,S);let D=c.get(O);D===void 0&&(D=d.length,c.set(O,D),d.push(O));const N=a.length;a.push({depthAndFlags:Kn(i,0,1),nameId:D,parentId:L,subtreeNodeCount:1,visibleSubtreeCount:1}),h++,f[h]=N}const T=f[h];if(T===void 0)throw new Error(`Unable to resolve directory node for "${y}"`);this.promoteDirectoryToExplicit(T,y)}else{const T=f[h];if(T===void 0)throw new Error(`Unable to resolve file parent for "${y}"`);const L=y.slice(k);let O=c.get(L);O===void 0&&(O=d.length,c.set(L,O),d.push(L)),a.push({depthAndFlags:Kn(i+1,0),nameId:O,parentId:T,subtreeNodeCount:1,visibleSubtreeCount:1})}k!==m.length&&(m=y.substring(0,k),g=i),n=y}f.length=h+1,n!=null&&(this.lastPreparedPath=Jl(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0;const i=this.nodes,a=this.segmentTable,s=a.idByValue,c=a.valueById,d=this.directoryStack;let f=0,h="",m=0;for(const g of e){if(t===g)throw new Error(`Duplicate path: "${g}"`);const y=g.length;let b=0,S=0;if(t!=null)if(h.length>0&&g.length>h.length&&g.startsWith(h))b=m,S=h.length;else{const L=Math.min(y,t.length);for(let O=0;O<L;O++){const D=g.charCodeAt(O);if(D!==t.charCodeAt(O))break;D===47&&(b++,S=O+1)}}f=b,n=b;let w=S,A=g.indexOf("/",w);for(;A>=0;){const L=d[f];if(L===void 0)throw new Error("Directory stack underflow while building the path store");n++;const O=g.slice(w,A);let D=s.get(O);D===void 0&&(D=c.length,s.set(O,D),c.push(O));const N=i.length;i.push({depthAndFlags:Kn(n,0,1),nameId:D,parentId:L,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(g.slice(0,A)),this.presortedDirectoryNodeIds.push(N),f++,d[f]=N,w=A+1,A=g.indexOf("/",w)}const k=d[f];if(k===void 0)throw new Error(`Unable to resolve file parent for "${g}"`);const E=g.slice(w);let T=s.get(E);T===void 0&&(T=c.length,s.set(E,T),c.push(E)),i.push({depthAndFlags:Kn(n+1,0),nameId:T,parentId:k,subtreeNodeCount:1,visibleSubtreeCount:1}),w!==h.length&&(h=g.substring(0,w),m=n),t=g}d.length=f+1,t!=null&&(this.lastPreparedPath=Jl(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){const t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(ve(this.instrumentation,"store.builder.buildDirectoryIndexes",()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||ve(this.instrumentation,"store.builder.computeSubtreeCounts",()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&(this.buildDirectoryIndexes(),this.hasDeferredDirectoryIndexes=!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw new Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort==="default"?_7(this.lastPreparedPath,e,this.segmentSortKeyCache):zE(this.lastPreparedPath,e,this.options.sort))>0)throw new Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}const n=this.lastPreparedPath,i=RS(e),a=n==null?0:RS(n),s=n==null?0:E7(n.segments,e.segments),c=Math.min(s,i,a);this.directoryStack.length=c+1;for(let f=c;f<i;f++){const h=this.directoryStack[this.directoryStack.length-1];if(h===void 0)throw new Error("Directory stack underflow while building the path store");const m=t?this.getOrCreateDirectoryChild(h,e.segments[f]):this.createDirectoryChild(h,e.segments[f]);this.directoryStack.push(m)}if(e.isDirectory){const f=this.directoryStack[this.directoryStack.length-1];if(f===void 0)throw new Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(f,e.path),this.lastPreparedPath=e;return}const d=this.directoryStack[this.directoryStack.length-1];if(d===void 0)throw new Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(d,e.basename,e.path):this.createFileChildUnchecked(d,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){const i=yo(this.segmentTable,t),a=this.getDirectoryIndex(e),s=a.childIdByNameId;if(s!=null&&s.get(i)!==void 0)throw new Error(`Path collides with an existing entry: "${n}"`);const c=this.nodes[e];if(c===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const d=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(c)+1,0),nameId:i,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),s?.set(i,d),Nl(a,d),d}createFileChildUnchecked(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e),a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),s}getOrCreateDirectoryChild(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e);if(i.childIdByNameId!=null){const c=i.childIdByNameId.get(n);if(c!==void 0){const d=this.nodes[c];if(d!=null&&!Te(d))throw new Error(`Path collides with an existing file while creating directory "${t}"`);return c}}const a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),this.directories.set(s,Gl()),s}createDirectoryChild(e,t){const n=yo(this.segmentTable,t),i=this.getDirectoryIndex(e),a=this.nodes[e];if(a===void 0)throw new Error(`Unknown parent node ID: ${String(e)}`);const s=this.nodes.length;return this.nodes.push({depthAndFlags:Kn($i(a)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),i.childIdByNameId!=null&&i.childIdByNameId.set(n,s),Nl(i,s),this.directories.set(s,Gl()),s}promoteDirectoryToExplicit(e,t){const n=this.nodes[e];if(n===void 0)throw new Error(`Unknown directory node ID: ${String(e)}`);if(!Te(n))throw new Error(`Path is not a directory: "${t}"`);if(Ut(n,1))throw new Error(`Duplicate path: "${t}"`);Sf(n,1)}getDirectoryIndex(e){const t=this.directories.get(e);if(t!==void 0)return t;throw new Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){const t=this.nodes,n=this.directories;n.set(0,AS());let i=-1,a=null;for(let s=1;s<t.length;s++){const c=t[s];if(c==null)continue;if(Te(c)){const f=AS();n.set(s,f),i=s,a=f}let d;c.parentId===i?d=a:(d=n.get(c.parentId),i=c.parentId,a=d??null),d?.childIds.push(s)}if(!e)for(let s=t.length-1;s>=1;s--){const c=t[s];if(c==null)continue;const d=t[c.parentId];d!=null&&(d.subtreeNodeCount+=c.subtreeNodeCount,d.visibleSubtreeCount+=c.visibleSubtreeCount)}}buildDirectoryIndexes(){const e=this.nodes;for(let t=1;t<e.length;t++){const n=e[t];if(n==null)continue;Te(n)&&this.directories.set(t,Gl());const i=this.directories.get(n.parentId);i!=null&&(i.childIdByNameId!=null&&i.childIdByNameId.set(n.nameId,t),Nl(i,t))}}computeSubtreeCounts(e){const t=this.nodes[e];if(t===void 0)throw new Error(`Unknown node ID: ${String(e)}`);if(!Te(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;const n=this.getDirectoryIndex(e);let i=1;for(const a of n.childIds)i+=this.computeSubtreeCounts(a);return Kd(this.nodes,n),t.subtreeNodeCount=i,t.visibleSubtreeCount=i,i}};function D7(e,t="closed",n=null){const i=O7(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:i,directoriesOpenByDefault:i==="open",hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:"",version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function M7(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function O7(e){if(typeof e!="number")return e;if(!Number.isInteger(e)||e<0)throw new Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function BE(e,t){return Ut(t,2)||e.defaultExpansion==="open"?!0:e.defaultExpansion==="closed"?!1:$i(t)<=e.defaultExpansion}function wn(e,t,n=e.snapshot.nodes[t]){return n==null||!Te(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:BE(e,n)}function vc(e,t,n,i=e.snapshot.nodes[t]){if(i==null||!Te(i))return;const a=BE(e,i);if(n){if(a){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(a){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function UE(e,t){const n=e.directoryLoadInfoById.get(t);if(n!=null)return n;const i={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:"loaded"};return e.directoryLoadInfoById.set(t,i),i}function yc(e,t){return e.directoryLoadInfoById.get(t)?.state??"loaded"}function P7(e,t){const n=UE(e,t);if(n.state==="loading"&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};const i=n.nextAttemptId;return n.activeAttemptId=i,n.errorMessage=null,n.nextAttemptId+=1,n.state="loading",{attemptId:i,nodeId:t,reused:!1}}function N7(e,t){const n=UE(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state="unloaded"}function H7(e,t,n){const i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=null,i.state="loaded",!0)}function z7(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function V7(e,t,n,i){const a=e.directoryLoadInfoById.get(t);return a==null||a.activeAttemptId!==n?!1:(a.activeAttemptId=null,a.errorMessage=i??null,a.state="error",!0)}function B7(e,t){e.directoryLoadInfoById.delete(t)}function U7(e,t,n){const i=n,a=e.listeners.get(t);return a!=null?a.add(i):e.listeners.set(t,new Set([i])),()=>{const s=e.listeners.get(t);s!=null&&(s.delete(i),s.size===0&&e.listeners.delete(t))}}function F7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:"add",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function j7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:"remove",path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function $7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:"move",projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function q7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"expand",path:e.path,projectionChanged:!0,visibleCountDelta:null}}function G7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"collapse",path:e.path,projectionChanged:!0,visibleCountDelta:null}}function W7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:"mark-directory-unloaded",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function K7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:"begin-child-load",path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function Y7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(t=>t.canonicalChanged),childEvents:e.childEvents,operation:"apply-child-patch",path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function X7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:"complete-child-load",path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Q7(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:"fail-child-load",path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Z7(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:"cleanup",projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function On(e,t,n){return{...n,visibleCountDelta:rg(e)-t}}function J7(e,t){const n=rg(e),i=M7();e.transactionStack.push(i);try{t()}catch(a){throw MS(e,i,!1),a}MS(e,i,!0,rg(e)-n)}function Ci(e,t){const n=e.instrumentation;if(n==null){DS(e,t);return}ve(n,"store.events.record",()=>DS(e,t))}function DS(e,t){const n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){ig(e,t);return}n.events.push(t),nD(n,t)}function MS(e,t,n,i=null){if(e.transactionStack.pop()!==t)throw new Error("Transaction stack underflow");if(!n)return;const a=e.transactionStack[e.transactionStack.length-1]??null;if(a!=null){const d=e.instrumentation;d==null?OS(a,t):ve(d,"store.events.batch.merge",()=>OS(a,t));return}const s=eD(t,i),c=e.instrumentation;if(c==null){ig(e,s);return}ve(c,"store.events.batch.commit",()=>ig(e,s))}function eD(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(n=>n.canonicalChanged),events:[...e.events],operation:"batch",projectionChanged:e.events.some(n=>n.projectionChanged),visibleCountDelta:t}}function tD(e,t){for(const n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(const n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function OS(e,t){for(const n of t.events)e.events.push(n);tD(e,t)}function nD(e,t){for(const n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(const n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function ig(e,t){const n=e.instrumentation;if(n==null){PS(e,t);return}ve(n,"store.events.emit",()=>PS(e,t))}function PS(e,t){e.listeners.get(t.operation)?.forEach(n=>n(t)),e.listeners.get("*")?.forEach(n=>n(t))}function rg(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function ws(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;const n=e.snapshot.nodes[t];if(n==null||!Te(n)||Ut(n,2))return null;const i=e.snapshot.directories.get(t);if(i==null||i.childIds.length!==1)return null;const a=i.childIds[0];if(a==null)return null;const s=e.snapshot.nodes[a];return s==null||!Te(s)?null:a}function la(e,t){let n=t;for(;;){const i=ws(e,n);if(i==null)return n;n=i}}function Xd(e,t){const n=[t];let i=t;for(;;){const a=ws(e,i);if(a==null)return n;n.push(a),i=a}}function FE(e,t){const n=t==null?e.snapshot.rootId:hi(e,t);return n==null?[]:rD(e,n)}function NS(e,t){const n=Jl(t),i=n.isDirectory?n.segments:n.segments.slice(0,-1),a=bo(e,hD(e,i)),{createdNodeIds:s,directoryId:c}=oD(e,i),d=new Set(s);let f=c;if(n.isDirectory){const m=we(e,c);if(Ut(m,1))throw new Error(`Path already exists: "${t}"`);Sf(m,1),e.pathCacheByNodeId.set(c,{path:t,version:e.pathCacheVersion}),d.add(c)}else f=sD(e,c,n.basename),d.add(f);ca(e,c);const h=bo(e,c);return F7({affectedAncestorIds:wi(e,f),affectedNodeIds:[...d],path:t,projectionChanged:qE(a,h)})}function HS(e,t,n){const i=hi(e,t);if(i==null)throw new Error(`Path does not exist: "${t}"`);const a=we(e,i);if(Ut(a,2))throw new Error("The root node cannot be removed");if(Te(a)&&_t(e,i).childIds.length>0&&n.recursive!==!0)throw new Error(`Cannot remove a non-empty directory without recursive: "${t}"`);const s=a.parentId,c=bo(e,s),d=$E(e,i);Qg(e,s,i,a.nameId),Zg(e,s),ca(e,s);const f=bo(e,s);return j7({affectedAncestorIds:wi(e,s),affectedNodeIds:d,path:t,projectionChanged:qE(c,f),recursive:n.recursive===!0})}function zS(e,t,n,i){const a=hi(e,t);if(a==null)throw new Error(`Source path does not exist: "${t}"`);const s=we(e,a);if(Ut(s,2))throw new Error("The root node cannot be moved");const c=i.collision??"error",d=dD(e,a,n),f=bo(e,s.parentId),h=bo(e,d.parentId),m=Wi(e.snapshot.segmentTable,s.nameId),g=yo(e.snapshot.segmentTable,d.basename);if(d.parentId===s.parentId&&m===d.basename)return null;if(Te(s)&&mD(e,a,d.parentId))throw new Error("Cannot move a directory into one of its descendants");const y=fa(e.snapshot.nodes,_t(e,d.parentId)).get(g),b=d.existingNodeId??y??null;if(b!=null&&b!==a&&fD(e,b,c,bf(s))==="skip")return null;const S=s.parentId;Qg(e,S,a,s.nameId),s.parentId=d.parentId,s.nameId=g,e.pathCacheByNodeId.delete(a),WE(e,a),Xg(e,d.parentId,a),Zg(e,S),e.pathCacheVersion++,ca(e,S),d.parentId!==S&&ca(e,d.parentId);const w=bo(e,S),A=bo(e,d.parentId);return $7({affectedAncestorIds:[...new Set([...wi(e,S),...wi(e,d.parentId)])],affectedNodeIds:[a],from:t,projectionChanged:GE([f,h],[w,A]),to:St(e,a)})}function iD(e,t){const n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function VS(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function St(e,t){const n=we(e,t),i=iD(e,t);if(i!=null)return i;if(Ut(n,2))return VS(e,t,"");const a=St(e,n.parentId),s=Wi(e.snapshot.segmentTable,n.nameId),c=a.length===0?s:`${a}${s}`;return VS(e,t,Te(n)?`${c}/`:c)}function ca(e,t){const n=e.instrumentation;if(n==null){US(e,t);return}ve(n,"store.recomputeCountsUpwardFrom",()=>US(e,t))}function Yg(e,t){const n=[[t,0]],{nodes:i,directories:a}=e.snapshot;for(;n.length>0;){const s=n[n.length-1],c=s[0],d=i[c];if(d==null||!Te(d)){og(e,c,d,!0),n.pop();continue}const f=a.get(c);if(f==null||s[1]>=f.childIds.length){og(e,c,d,!0),n.pop();continue}const h=f.childIds[s[1]++];n.push([h,0])}}function wi(e,t){const n=[];let i=t;for(;i!=null;){const a=we(e,i);if(n.push(i),i===e.snapshot.rootId)break;i=a.parentId}return n}function hi(e,t){if(t.length===0)return e.snapshot.rootId;const n=ng(t);return jE(e,n.segments,n.requiresDirectory)}function jE(e,t,n){let i=e.snapshot.rootId;for(const s of t){const c=e.snapshot.segmentTable.idByValue.get(s);if(c===void 0)return null;const d=_t(e,i),f=fa(e.snapshot.nodes,d).get(c);if(f===void 0)return null;i=f}const a=we(e,i);return n&&!Te(a)?null:i}function _t(e,t){const n=e.snapshot.directories.get(t);if(n===void 0)throw new Error(`Unknown directory child index for node ${String(t)}`);return n}function we(e,t){const n=e.snapshot.nodes[t];if(n===void 0||Ut(n,4))throw new Error(`Unknown node ID: ${String(t)}`);return n}function rD(e,t){const n=e.snapshot.nodes[t];if(n===void 0||Ut(n,4))return[];if(!Te(n))return[St(e,t)];if(_t(e,t).childIds.length===0)return Ut(n,1)&&!Ut(n,2)?[St(e,t)]:[];const i=[],a=[{childIndex:0,nodeId:t}];for(;a.length>0;){const s=a[a.length-1];if(s==null)break;const c=e.snapshot.nodes[s.nodeId];if(c===void 0||Ut(c,4)){a.pop();continue}if(!Te(c)){i.push(St(e,s.nodeId)),a.pop();continue}const d=_t(e,s.nodeId);if(d.childIds.length===0){Ut(c,1)&&!Ut(c,2)&&i.push(St(e,s.nodeId)),a.pop();continue}const f=d.childIds[s.childIndex];if(f==null){a.pop();continue}s.childIndex++,a.push({childIndex:0,nodeId:f})}return i}function oD(e,t){const n=[];let i=e.snapshot.rootId;for(const a of t){const s=yo(e.snapshot.segmentTable,a),c=_t(e,i),d=fa(e.snapshot.nodes,c).get(s);if(d!==void 0){if(!Te(we(e,d)))throw new Error(`Cannot create a directory that collides with an existing file: "${a}"`);i=d;continue}i=aD(e,i,s),n.push(i)}return{createdNodeIds:n,directoryId:i}}function aD(e,t,n){const i=we(e,t),a=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kn($i(i)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(a,Gl()),Xg(e,t,a),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(a),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,a}function sD(e,t,n){const i=yo(e.snapshot.segmentTable,n),a=_t(e,t);if(fa(e.snapshot.nodes,a).has(i))throw new Error(`Path already exists: "${gD(e,t,n)}"`);const s=we(e,t),c=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:Kn($i(s)+1,0),nameId:i,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),Xg(e,t,c),e.activeNodeCount++,c}function lD(e,t,n){let i=0,a=t.childIds.length;for(;i<a;){const s=i+a>>>1,c=t.childIds[s];if(c==null){a=s;continue}cD(e,n,c)<0?a=s:i=s+1}return i}function Xg(e,t,n){const i=_t(e,t),a=we(e,n);fa(e.snapshot.nodes,i).set(a.nameId,n),jg(i,n,a.subtreeNodeCount,a.visibleSubtreeCount);const s=lD(e,i,n);i.childIds.splice(s,0,n),AE(i,s),gc(e.snapshot.nodes,i)}function Qg(e,t,n,i){const a=_t(e,t),s=yf(a),c=s.get(n)??-1;fa(e.snapshot.nodes,a).delete(i),s.delete(n);const d=e.snapshot.nodes[n];d!=null&&jg(a,n,-d.subtreeNodeCount,-d.visibleSubtreeCount),c>=0&&(a.childIds.splice(c,1),AE(a,c),gc(e.snapshot.nodes,a))}function cD(e,t,n){const i=e.snapshot.options.sort;return i==="default"?uD(e,t,n):i(BS(e,t),BS(e,n))}function uD(e,t,n){const i=we(e,t),a=we(e,n),s=Te(i);if(s!==Te(a))return s?-1:1;const c=Gg(tg(e.snapshot.segmentTable,i.nameId),tg(e.snapshot.segmentTable,a.nameId));if(c!==0)return c;const d=Wi(e.snapshot.segmentTable,i.nameId),f=Wi(e.snapshot.segmentTable,a.nameId);return d!==f?d<f?-1:1:t<n?-1:1}function BS(e,t){const n=we(e,t),i=St(e,t),a=Te(n),s=a?i.slice(0,-1):i;return{basename:Wi(e.snapshot.segmentTable,n.nameId),depth:$i(n),isDirectory:a,path:i,segments:s.length===0?[]:s.split("/")}}function dD(e,t,n){const i=we(e,t),a=hi(e,n);if(a!=null){const h=we(e,a);if(Te(h))return{basename:Wi(e.snapshot.segmentTable,i.nameId),existingNodeId:null,parentId:a};const m=ng(n).segments;return{basename:m[m.length-1]??"",existingNodeId:a,parentId:h.parentId}}const s=ng(n),c=s.segments[s.segments.length-1]??"",d=s.segments.slice(0,-1),f=d.length===0?e.snapshot.rootId:jE(e,d,!0);if(f==null)throw new Error(`Destination parent does not exist: "${n}"`);return{basename:c,existingNodeId:null,parentId:f}}function fD(e,t,n,i){if(n==="skip")return"skip";if(n==="error")throw new Error(`Destination already exists: "${St(e,t)}"`);const a=we(e,t);if(bf(a)!==i)throw new Error("replace collision requires the same source and destination kinds");if(Te(a)&&_t(e,t).childIds.length>0)throw new Error("replace collision does not support non-empty directories");const s=a.parentId,c=a.nameId;return $E(e,t),Qg(e,s,t,c),Zg(e,s),ca(e,s),"handled"}function $E(e,t){const n=[],i=[{nodeId:t,visitedChildren:!1}];for(;i.length>0;){const a=i.pop();if(a==null)break;const s=we(e,a.nodeId);if(a.visitedChildren||!Te(s)){Te(s)&&e.snapshot.directories.delete(a.nodeId),Sf(s,4),e.pathCacheByNodeId.delete(a.nodeId),e.collapsedDirectoryIds.delete(a.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(a.nodeId),B7(e,a.nodeId),e.activeNodeCount--,n.push(a.nodeId);continue}i.push({nodeId:a.nodeId,visitedChildren:!0});const c=_t(e,a.nodeId);for(let d=c.childIds.length-1;d>=0;d--){const f=c.childIds[d];f!=null&&i.push({nodeId:f,visitedChildren:!1})}}return n}function Zg(e,t){let n=t;for(;n!=null;){const i=we(e,n);if(!Te(i)||Ut(i,2)||_t(e,n).childIds.length>0)return;Sf(i,1),n=i.parentId===n?null:i.parentId}}function hD(e,t){let n=e.snapshot.rootId;for(const i of t){const a=e.snapshot.segmentTable.idByValue.get(i);if(a==null)break;const s=fa(e.snapshot.nodes,_t(e,n)).get(a);if(s==null||!Te(we(e,s)))break;n=s}return n}function bo(e,t){const n=pD(e,t);if(n==null)return null;const i=la(e,n),a=we(e,i),s=n===i?null:Xd(e,n).map(c=>St(e,c));return JSON.stringify({flattenedSegmentPaths:s,hasChildren:_t(e,i).childIds.length>0,path:St(e,i),terminalKind:bf(a)})}function qE(e,t){return GE([e],[t])}function GE(e,t){for(let n=0;n<e.length;n+=1){const i=e[n],a=t[n];if(i==null||a==null||i!==a)return!0}return!1}function pD(e,t){let n=t;for(;n!=null;){const i=we(e,n);if(!Te(i)||Ut(i,2))return null;if(!wn(e,n,i))return n;n=i.parentId}return null}function WE(e,t){const n=we(e,t);if(p7(n,(t===e.snapshot.rootId?-1:$i(we(e,n.parentId)))+1),!Te(n))return;const i=_t(e,t);for(const a of i.childIds)WE(e,a)}function mD(e,t,n){let i=n;for(;i!=null;){if(i===t)return!0;const a=we(e,i);if(i===e.snapshot.rootId)return!1;i=a.parentId}return!1}function og(e,t,n=we(e,t),i=!1){const a=e.instrumentation;if(a==null){FS(e,t,n,i);return}ve(a,"store.recomputeNodeCounts",()=>FS(e,t,n,i))}function US(e,t){let n=t;for(;n!=null;){const i=we(e,n),a=i.subtreeNodeCount,s=i.visibleSubtreeCount;if(og(e,n,i),n===e.snapshot.rootId)return;const c=i.subtreeNodeCount-a,d=i.visibleSubtreeCount-s,f=i.parentId;(c!==0||d!==0)&&jg(_t(e,f),n,c,d),n=f}}function FS(e,t,n,i){if(!Te(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}const a=_t(e,t);if(i){const d=e.instrumentation;d==null?Kd(e.snapshot.nodes,a):ve(d,"store.recomputeNodeCounts.rebuildChildAggregates",()=>Kd(e.snapshot.nodes,a))}const s=1+a.totalChildSubtreeNodeCount,c=a.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=s,Ut(n,2)){n.visibleSubtreeCount=c;return}n.visibleSubtreeCount=ws(e,t)!=null?c:wn(e,t,n)?1+c:1}function gD(e,t,n){const i=St(e,t);return i.length===0?n:`${i}${n}`}function ys(e){return e!=null&&!Ut(e,4)}function Qd(e,t){const n=e.snapshot.nodes[t];return!ys(n)||!Te(n)||Ut(n,2)?null:n}function vD(e){let t=0;for(const[n,i]of e.pathCacheByNodeId)i.version===e.pathCacheVersion&&ys(e.snapshot.nodes[n])&&(t+=1);return t}function yD(e){return Math.max(0,e.valueById.length-1)}function jS(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:vD(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:yD(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function bD(e,t,n,i){return{activeNodeCountAfter:i.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:i.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:i.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-i.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-i.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-i.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-i.segmentCount,segmentCountAfter:i.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:i.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function KE(e){const t=[],n=[];for(const i of e.collapsedDirectoryIds)Qd(e,i)!=null&&t.push(St(e,i));for(const i of e.expandedDirectoryIds)Qd(e,i)!=null&&n.push(St(e,i));return{collapsedPaths:t,expandedPaths:n}}function YE(e){const t=[];for(const[n,i]of e.directoryLoadInfoById)Qd(e,n)==null||yc(e,n)==="loaded"||t.push({info:{activeAttemptId:null,errorMessage:i.errorMessage,nextAttemptId:i.nextAttemptId,state:i.state},path:St(e,n)});return t}function XE(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(const n of t.expandedPaths){const i=hi(e,n);i!=null&&vc(e,i,!0,we(e,i))}for(const n of t.collapsedPaths){const i=hi(e,n);i!=null&&vc(e,i,!1,we(e,i))}}function QE(e,t){e.directoryLoadInfoById.clear();for(const n of t){const i=hi(e,n.path);i!=null&&Qd(e,i)!=null&&e.directoryLoadInfoById.set(i,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function SD(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:"",version:e.pathCacheVersion})}function _D(e){const t=e.snapshot.segmentTable,n=NE();for(const i of e.snapshot.nodes)if(ys(i)){if(Ut(i,2)){i.nameId=0;continue}i.nameId=yo(n,Wi(t,i.nameId))}e.snapshot.segmentTable=n}function CD(e){for(const[t,n]of e.snapshot.directories){const i=e.snapshot.nodes[t];if(!ys(i)||!Te(i)){e.snapshot.directories.delete(t);continue}const a=n.childIds.filter(s=>{const c=e.snapshot.nodes[s];return ys(c)&&c.parentId===t});n.childIds=a,n.childIdByNameId=new Map(a.map(s=>[we(e,s).nameId,s])),n.childPositionById=new Map(a.map((s,c)=>[s,c])),Kd(e.snapshot.nodes,n)}}function ED(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){const n=e.snapshot.nodes[t];if(ys(n))break;t-=1}e.snapshot.nodes.length=t+1}function wD(e){const t=KE(e),n=YE(e);ve(e.instrumentation,"store.cleanup.stable.clearPathCaches",()=>SD(e)),ve(e.instrumentation,"store.cleanup.stable.rebuildSegmentTable",()=>_D(e)),ve(e.instrumentation,"store.cleanup.stable.rebuildDirectoryIndexes",()=>CD(e)),ve(e.instrumentation,"store.cleanup.stable.trimTrailingRemovedNodeSlots",()=>ED(e)),ve(e.instrumentation,"store.cleanup.stable.restoreExpansionOverrides",()=>XE(e,t)),ve(e.instrumentation,"store.cleanup.stable.restoreDirectoryLoadInfos",()=>QE(e,n)),ve(e.instrumentation,"store.cleanup.stable.recomputeCounts",()=>Yg(e,e.snapshot.rootId))}function xD(e){const t=KE(e),n=YE(e),i=ve(e.instrumentation,"store.cleanup.aggressive.listPaths",()=>FE(e)),a=m7({...e.snapshot.options},e.instrumentation),s=ve(e.instrumentation,"store.cleanup.aggressive.rebuildSnapshot",()=>{const c=new VE(a);return c.appendPaths(i),c.finish()});e.snapshot=s,e.activeNodeCount=s.nodes.length-1,e.pathCacheByNodeId=new Map([[s.rootId,{path:"",version:0}]]),e.pathCacheVersion=0,ve(e.instrumentation,"store.cleanup.aggressive.restoreExpansionOverrides",()=>XE(e,t)),ve(e.instrumentation,"store.cleanup.aggressive.restoreDirectoryLoadInfos",()=>QE(e,n)),ve(e.instrumentation,"store.cleanup.aggressive.recomputeCounts",()=>Yg(e,e.snapshot.rootId))}function TD(e){for(const t of e.directoryLoadInfoById.values())if(t.state==="loading"&&t.activeAttemptId!=null)return!0;return!1}function kD(e,t){const n=jS(e);t==="stable"?ve(e.instrumentation,"store.cleanup.stable",()=>wD(e)):ve(e.instrumentation,"store.cleanup.aggressive",()=>xD(e));const i=jS(e);return bD(t,t==="stable",n,i)}const AD=64;function LD(e,t){const n=t+2;if(n<=e.length)return e;let i=e.length;for(;i<n;)i*=2;const a=new Int32Array(i);return a.fill(-1),a.set(e),a}function un(e){return we(e,e.snapshot.rootId).visibleSubtreeCount}function ZE(e,t,n,i){const a=we(e,t.terminalNodeId),s=Math.max(1,a.visibleSubtreeCount);return Math.min(i-1,n+s-1)}function ID(e,t,n,i){return{ancestorPaths:i,index:t.index,posInSet:t.posInSet,row:bc(e,t.cursor),setSize:t.setSize,subtreeEndIndex:ZE(e,t.cursor,t.index,n)}}function JE(e,t,n,i,a,s){const c=_t(e,t),{childIndex:d,childVisibleIndex:f,localVisibleIndex:h}=eg(e.snapshot.nodes,c,n),m=c.childIds[d];if(m==null)throw new Error(`Visible index ${String(n)} is out of range`);return RD(e,m,h,i+f,a+1,d,c.childIds.length,s)}function RD(e,t,n,i,a,s,c,d){if(!Te(we(e,t))){if(n===0)return{ancestors:d,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:a},index:i,posInSet:s,setSize:c};throw new Error(`Visible index ${String(n)} is out of range for file`)}const f=n5(e,t,a);if(n===0)return{ancestors:d,cursor:f,index:i,posInSet:s,setSize:c};const h=we(e,f.terminalNodeId);if(!Te(h)||!wn(e,f.terminalNodeId,h))throw new Error(`Visible index ${String(n)} is out of range for collapsed directory`);return JE(e,f.terminalNodeId,n-1,i+1,f.visibleDepth,[...d,{cursor:f,index:i,posInSet:s,setSize:c}])}function DD(e,t){const n=un(e);if(t<0||t>=n)return null;const i=JE(e,e.snapshot.rootId,t,0,-1,[]),a=i.ancestors.map(c=>St(e,c.cursor.terminalNodeId));let s=null;return{ancestorPaths:a,get ancestorRows(){if(s!=null)return s;const c=[],d=[];for(const f of i.ancestors){const h=ID(e,f,n,[...d]);c.push(h),d.push(h.row.path)}return s=c,s},index:i.index,posInSet:i.posInSet,row:bc(e,i.cursor),setSize:i.setSize,subtreeEndIndex:ZE(e,i.cursor,i.index,n)}}function MD(e,t,n){const i=e.instrumentation,a=un(e);if(a<=0||n<t)return[];const s=Math.max(0,Math.min(t,a-1)),c=Math.max(s,Math.min(n,a-1));if(i==null){if(s===0)return BD(e,c+1);const g=[];let y=$S(e,s);for(let b=s;b<=c&&y!=null;b++){const S=bc(e,y);g.push(S),y=qS(e,y)}return g}const d=[];let f=0,h=0,m=ve(i,"store.getVisibleSlice.selectFirstRow",()=>$S(e,s));for(let g=s;g<=c&&m!=null;g++){const y=ve(i,"store.getVisibleSlice.materializeRow",()=>bc(e,m));d.push(y),y.isFlattened&&(f++,h+=y.flattenedSegments?.length??0),m=ve(i,"store.getVisibleSlice.advanceCursor",()=>qS(e,m))}return Cd(i,"workload.visibleRowsRead",d.length),Cd(i,"workload.flattenedRowsRead",f),Cd(i,"workload.flattenedSegmentsRead",h),d}function e5(e,t=un(e)){const n=e.instrumentation;return n==null?GS(e,t):ve(n,"store.getVisibleTreeProjection",()=>GS(e,t))}function OD(e){return VD(e5(e))}function PD(e,t){const n=hi(e,t);if(n==null||n===e.snapshot.rootId||Te(we(e,n))&&la(e,n)!==n)return null;let i=0,a=n;const{nodes:s,rootId:c}=e.snapshot;for(;a!==c;){const d=we(e,a).parentId,f=_t(e,d),h=yf(f).get(a);if(h==null)throw new Error(`Child ${String(a)} was not found in its parent index`);if(i+=d7(s,f,h),d!==c){const m=we(e,d),g=ws(e,d);if(!wn(e,d,m)&&g!==a)return null;la(e,d)===d&&(i+=1)}a=d}return i}function ND(e,t){const n=hi(e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);const i=we(e,n);if(!Te(i))throw new Error(`Path is not a directory: "${t}"`);return wn(e,n,i)?null:(vc(e,n,!0,i),ca(e,n),q7({affectedAncestorIds:wi(e,n),affectedNodeIds:[n],path:t}))}function HD(e,t){const n=hi(e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);const i=we(e,n);if(!Te(i))throw new Error(`Path is not a directory: "${t}"`);return wn(e,n,i)?(vc(e,n,!1,i),ca(e,n),G7({affectedAncestorIds:wi(e,n),affectedNodeIds:[n],path:t})):null}function $S(e,t){return t<0||t>=un(e)?null:t5(e,e.snapshot.rootId,t,-1)}function t5(e,t,n,i){const a=_t(e,t),s=e.instrumentation,{childIndex:c,localVisibleIndex:d}=s==null?eg(e.snapshot.nodes,a,n):ve(s,"store.getVisibleSlice.selectChildIndex",()=>eg(e.snapshot.nodes,a,n)),f=a.childIds[c];if(f!=null)return ag(e,f,d,i+1);throw new Error(`Visible index ${String(n)} is out of range`)}function ag(e,t,n,i){if(!Te(we(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:i};throw new Error(`Visible index ${String(n)} is out of range for file`)}const a=n5(e,t,i);if(n===0)return a;const s=we(e,a.terminalNodeId);if(!Te(s)||!wn(e,a.terminalNodeId,s))throw new Error(`Visible index ${String(n)} is out of range for collapsed directory`);return t5(e,a.terminalNodeId,n-1,a.visibleDepth)}function n5(e,t,n){return Te(we(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:la(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:ve(e.instrumentation,"store.getVisibleSlice.flatten.resolveTerminalDirectory",()=>la(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function zD(e,t){const n=we(e,t);if(!Te(n))return!0;const i=n.parentId;return i===e.snapshot.rootId?!0:ws(e,i)!==t}function qS(e,t){const n=we(e,t.terminalNodeId);if(Te(n)){const s=_t(e,t.terminalNodeId);if(wn(e,t.terminalNodeId,n)&&s.childIds.length>0){const c=s.childIds[0];return c==null?null:ag(e,c,0,t.visibleDepth+1)}}let i=t.terminalNodeId,a=t.visibleDepth;for(;;){const s=we(e,i);if(i===e.snapshot.rootId)return null;const c=s.parentId,d=_t(e,c),f=yf(d).get(i)??-1;if(f<0)throw new Error(`Child ${String(i)} was not found in its parent index`);const h=d.childIds[f+1]??null;if(h!=null)return ag(e,h,0,a);zD(e,i)&&a--,i=c}}function VD(e){const t=e.paths.length,n=new Array(t);for(let i=0;i<t;i+=1){const a=e.getParentIndex(i);n[i]={index:i,parentPath:a>=0?e.paths[a]??null:null,path:e.paths[i]??"",posInSet:e.posInSetByIndex[i]??0,setSize:e.setSizeByIndex[i]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function GS(e,t){const n=new Array(t),i=new Int32Array(t),a=new Int32Array(t),s=new Int32Array(t);let c=new Int32Array(AD);c.fill(-1);let d=0;const{nodes:f,directories:h,segmentTable:m}=e.snapshot,g=[[h.get(e.snapshot.rootId),0,-1,""]],y=e.snapshot.options.flattenEmptyDirectories,b=e.pathCacheByNodeId,S=e.pathCacheVersion,w=m.valueById;for(;g.length>0&&d<t;){const L=g[g.length-1],O=L[0];if(L[1]>=O.childIds.length){g.pop();continue}const D=L[1],N=O.childIds[L[1]++],K=f[N],G=L[2]+1,se=L[3];c=LD(c,G);let ie,ee=N;if(Te(K))ee=y?la(e,N):N,ie=ee===N?`${se}${w[K.nameId]}/`:St(e,ee);else{const le=b.get(N);ie=le!=null&&le.version===S?le.path:`${se}${w[K.nameId]}`}i[d]=c[G],n[d]=ie,a[d]=D,s[d]=O.childIds.length,c[G+1]=d,d+=1;const te=f[ee];te!=null&&Te(te)&&wn(e,ee,te)&&g.push([h.get(ee),0,G,ie])}d<t&&(n.length=d);const A=i.subarray(0,d),k=a.subarray(0,d),E=s.subarray(0,d);let T=null;return{getParentIndex(L){return L<0||L>=d?-1:A[L]??-1},paths:n,posInSetByIndex:k,setSizeByIndex:E,get visibleIndexByPath(){if(T==null){T=new Map;for(let L=0;L<d;L+=1)T.set(n[L]??"",L)}return T}}}function BD(e,t){const n=new Array(t);let i=0;const{nodes:a,directories:s,segmentTable:c}=e.snapshot,d=[[s.get(e.snapshot.rootId),0,-1]],f=c.valueById,h=e.snapshot.options.flattenEmptyDirectories,m=e.pathCacheByNodeId,g=e.pathCacheVersion;for(;d.length>0&&i<t;){const y=d[d.length-1],b=y[0];if(y[1]>=b.childIds.length){d.pop();continue}const S=b.childIds[y[1]++],w=a[S],A=y[2]+1;if(!Te(w)){const L=m.get(S);n[i++]={depth:A,flattenedSegments:void 0,hasChildren:!1,id:S,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:"file",loadState:void 0,name:f[w.nameId],path:L!=null&&L.version===g?L.path:St(e,S)};continue}const k=h?la(e,S):S,E={headNodeId:S,terminalNodeId:k,visibleDepth:A};n[i++]=bc(e,E);const T=a[k];T!=null&&Te(T)&&wn(e,k,T)&&d.push([s.get(k),0,A])}return i<t&&(n.length=i),n}function bc(e,t){const n=we(e,t.terminalNodeId),i=Te(n)?UD(e,t):null,a=St(e,t.terminalNodeId),s=Wi(e.snapshot.segmentTable,n.nameId),c=Te(n)&&_t(e,t.terminalNodeId).childIds.length>0,d=t.headNodeId!==t.terminalNodeId,f=e.instrumentation,h=d?f==null?Xd(e,t.headNodeId).map(m=>{const g=we(e,m);return{isTerminal:m===t.terminalNodeId,name:Wi(e.snapshot.segmentTable,g.nameId),nodeId:m,path:St(e,m)}}):ve(f,"store.getVisibleSlice.flatten.collectSegments",()=>Xd(e,t.headNodeId).map(m=>{const g=we(e,m);return{isTerminal:m===t.terminalNodeId,name:Wi(e.snapshot.segmentTable,g.nameId),nodeId:m,path:St(e,m)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:h,hasChildren:c,id:t.terminalNodeId,isExpanded:Te(n)&&wn(e,t.terminalNodeId,n),isFlattened:d,isLoading:i==="loading",kind:Te(n)?"directory":"file",loadState:i==null||i==="loaded"?void 0:i,name:s,path:a}}function UD(e,t){if(t.headNodeId===t.terminalNodeId)return yc(e,t.terminalNodeId);const n=Xd(e,t.headNodeId);let i=!1,a=!1;for(const s of n){const c=yc(e,s);if(c==="loading")return"loading";if(c==="error"){a=!0;continue}c==="unloaded"&&(i=!0)}return a?"error":i?"unloaded":"loaded"}function FD(e){const{directories:t,nodes:n,options:i,rootId:a,presortedDirectoryNodeIds:s}=e.snapshot,c=i.flattenEmptyDirectories===!0,d=b=>{const S=n[b];if(S==null||!Te(S))return;const w=t.get(b);if(w==null)throw new Error(`Unknown directory child index for node ${String(b)}`);const A=w.childIds,k=A.length;let E=0,T=0;for(let O=0;O<k;O++){const D=A[O];if(D==null)continue;const N=n[D];E+=N.subtreeNodeCount,T+=N.visibleSubtreeCount}w.totalChildSubtreeNodeCount=E,w.totalChildVisibleSubtreeCount=T,k>=128&&gc(n,w),S.subtreeNodeCount=1+E;let L;if(c&&k===1){const O=n[A[0]];L=O!=null&&Te(O)?T:1+T}else L=1+T;S.visibleSubtreeCount=L};if(s!=null)for(let b=s.length-1;b>=0;b--)d(s[b]);else for(let b=n.length-1;b>=1;b--)d(b);const f=n[a],h=t.get(a);if(f==null||h==null)return;const m=h.childIds;let g=0,y=0;for(let b=0;b<m.length;b++){const S=m[b];if(S==null)continue;const w=n[S];g+=w.subtreeNodeCount,y+=w.visibleSubtreeCount}h.totalChildSubtreeNodeCount=g,h.totalChildVisibleSubtreeCount=y,gc(n,h),f.subtreeNodeCount=1+g,f.visibleSubtreeCount=y}function jD(e){return e.initialExpansion==="open"&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var Jg=class i5{#e;constructor(t={}){const n=qg(t),i=ve(n,"store.builder.create",()=>new VE(t));if(t.preparedInput!=null){const d=I7(t.preparedInput);d!=null?i.appendPresortedPaths(d,R7(t.preparedInput)):i.appendPreparedPaths(L7(t.preparedInput),!1)}else{const d=t.paths??[];t.presorted===!0?i.appendPaths(d):i.appendPreparedPaths(ve(n,"store.preparePathEntries",()=>Kg(d,t)))}const a=ve(n,"store.builder.finish",()=>i.finish({skipSubtreeCountPass:!0})),s=ve(n,"store.state.detectAllDirectoriesExpanded",()=>(t.initialExpansion??"closed")==="closed"&&i.didMatchAllInitialExpandedPaths());this.#e=ve(n,"store.state.create",()=>D7(a,s?"open":t.initialExpansion??"closed",n)),s&&(this.#e.collapseNewDirectoriesByDefault=!0);const c=s?this.#e.snapshot.directories.size-1:ve(n,"store.state.initializeExpandedPaths",()=>this.initializeExpandedPaths(t.initialExpandedPaths));s||jD(t)||(t.initialExpansion??"closed")==="closed"&&c===this.#e.snapshot.directories.size-1||(t.initialExpandedPaths?.length??0)>0&&ve(n,"store.state.checkAllDirectoriesExpanded",()=>this.hasAllDirectoriesExpanded())?ve(n,"store.state.initializeOpenVisibleCounts",()=>FD(this.#e)):ve(n,"store.state.recomputeCounts",()=>Yg(this.#e,this.#e.snapshot.rootId))}static preparePaths(t,n={}){return T7(t,n)}static prepareInput(t,n={}){return k7(t,n)}static preparePresortedInput(t){return A7(t)}list(t){return ve(this.#e.instrumentation,"store.list",()=>FE(this.#e,t))}add(t){ve(this.#e.instrumentation,"store.add",()=>{const n=un(this.#e);Ci(this.#e,On(this.#e,n,NS(this.#e,t)))})}remove(t,n={}){ve(this.#e.instrumentation,"store.remove",()=>{const i=un(this.#e);Ci(this.#e,On(this.#e,i,HS(this.#e,t,n)))})}move(t,n,i={}){ve(this.#e.instrumentation,"store.move",()=>{const a=un(this.#e),s=zS(this.#e,t,n,i);s!=null&&Ci(this.#e,On(this.#e,a,s))})}batch(t){J7(this.#e,()=>{if(typeof t=="function"){t(this);return}for(const n of t)switch(n.type){case"add":this.add(n.path);break;case"remove":this.remove(n.path,{recursive:n.recursive});break;case"move":this.move(n.from,n.to,{collision:n.collision});break}})}getVisibleCount(){return ve(this.#e.instrumentation,"store.getVisibleCount",()=>un(this.#e))}getVisibleSlice(t,n){return ve(this.#e.instrumentation,"store.getVisibleSlice",()=>MD(this.#e,t,n))}getVisibleRowContext(t){return ve(this.#e.instrumentation,"store.getVisibleRowContext",()=>DD(this.#e,t))}getVisibleTreeProjection(){return OD(this.#e)}getVisibleTreeProjectionData(t){return e5(this.#e,t)}getVisibleIndex(t){return ve(this.#e.instrumentation,"store.getVisibleIndex",()=>PD(this.#e,t))}getPathInfo(t){return ve(this.#e.instrumentation,"store.getPathInfo",()=>{const n=hi(this.#e,t);if(n==null)return null;const i=we(this.#e,n);return{depth:$i(i),kind:Te(i)?"directory":"file",path:St(this.#e,n)}})}isExpanded(t){return ve(this.#e.instrumentation,"store.isExpanded",()=>{const n=this.requireDirectoryNodeId(t),i=we(this.#e,n);return wn(this.#e,n,i)})}expand(t){ve(this.#e.instrumentation,"store.expand",()=>{const n=un(this.#e),i=ND(this.#e,t);i!=null&&Ci(this.#e,On(this.#e,n,i))})}collapse(t){ve(this.#e.instrumentation,"store.collapse",()=>{const n=un(this.#e),i=HD(this.#e,t);i!=null&&Ci(this.#e,On(this.#e,n,i))})}on(t,n){return U7(this.#e,t,n)}getDirectoryLoadState(t){const n=this.requireDirectoryNodeId(t);return yc(this.#e,n)}markDirectoryUnloaded(t){ve(this.#e.instrumentation,"store.markDirectoryUnloaded",()=>{const n=this.requireDirectoryNodeId(t);if(_t(this.#e,n).childIds.length>0)throw new Error(`Cannot mark a directory with known children as unloaded: "${t}"`);const i=un(this.#e);N7(this.#e,n),Ci(this.#e,On(this.#e,i,W7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],path:t,projectionChanged:this.isDirectoryProjectionVisible(n)})))})}beginChildLoad(t){return ve(this.#e.instrumentation,"store.beginChildLoad",()=>{const n=this.requireDirectoryNodeId(t),i=un(this.#e),a=P7(this.#e,n);return Ci(this.#e,On(this.#e,i,K7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],attemptId:a.attemptId,path:t,projectionChanged:this.isDirectoryProjectionVisible(n),reused:a.reused}))),a})}applyChildPatch(t,n){return ve(this.#e.instrumentation,"store.applyChildPatch",()=>{const i=this.resolveActiveDirectoryNodeId(t.nodeId);if(i==null||yc(this.#e,i)!=="loading"||!z7(this.#e,i,t.attemptId))return!1;const a=St(this.#e,i);this.validateChildPatch(a,n);const s=un(this.#e),c=[];for(const f of n.operations){$D(a,f);const h=un(this.#e);switch(f.type){case"add":c.push(On(this.#e,h,NS(this.#e,f.path)));break;case"remove":c.push(On(this.#e,h,HS(this.#e,f.path,{recursive:f.recursive})));break;case"move":{const m=zS(this.#e,f.from,f.to,{collision:f.collision});m!=null&&c.push(On(this.#e,h,m));break}}}const d=c.some(f=>f.projectionChanged)||this.isDirectoryProjectionVisible(i);return Ci(this.#e,On(this.#e,s,Y7({affectedAncestorIds:wi(this.#e,i),affectedNodeIds:[i],attemptId:t.attemptId,childEvents:c,path:St(this.#e,i),projectionChanged:d}))),!0})}completeChildLoad(t){return ve(this.#e.instrumentation,"store.completeChildLoad",()=>{const n=this.resolveActiveDirectoryNodeId(t.nodeId);if(n==null)return!1;const i=un(this.#e),a=H7(this.#e,n,t.attemptId);return Ci(this.#e,On(this.#e,i,X7({affectedAncestorIds:wi(this.#e,n),affectedNodeIds:[n],attemptId:t.attemptId,path:St(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!a}))),a})}failChildLoad(t,n){return ve(this.#e.instrumentation,"store.failChildLoad",()=>{const i=this.resolveActiveDirectoryNodeId(t.nodeId);if(i==null)return!1;const a=un(this.#e),s=V7(this.#e,i,t.attemptId,n);return Ci(this.#e,On(this.#e,a,Q7({affectedAncestorIds:wi(this.#e,i),affectedNodeIds:[i],attemptId:t.attemptId,errorMessage:n,path:St(this.#e,i),projectionChanged:this.isDirectoryProjectionVisible(i),stale:!s}))),s})}cleanup(t={}){return ve(this.#e.instrumentation,"store.cleanup",()=>{if(this.#e.transactionStack.length>0)throw new Error("Cleanup cannot run during an open batch or transaction.");if(TD(this.#e))throw new Error("Cleanup cannot run while directory loads are active.");const n=un(this.#e),i=kD(this.#e,t.mode??"stable");return Ci(this.#e,On(this.#e,n,Z7({...i,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:i.idsPreserved===!1}))),i})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(t){if(t==null||t.length===0)return 0;let n=0;const i=[],a=[];let s=0,c=null;const d=this.#e.snapshot.segmentTable,f=d.valueById,h=this.#e.snapshot.nodes,m=new Map;for(const g of t){c!=null&&g<c&&(c=null,s=0,i.length=0,a.length=0);const y=g.length>0&&g.charCodeAt(g.length-1)===47?g.length-1:g.length;if(y===0){c=g,s=y,i.length=0,a.length=0;continue}let b=0,S=0;if(c!=null){const T=Math.min(y,s);let L=!0;for(let O=0;O<T;O+=1){const D=g.charCodeAt(O);if(D!==c.charCodeAt(O)){L=!1;break}D===47&&(b+=1,S=O+1)}L&&(T===s&&y>T&&g.charCodeAt(T)===47?(b+=1,S=T+1):T===y&&s>T&&c.charCodeAt(T)===47&&(b+=1,S=y+1)),b=Math.min(b,a.length)}let w=b===0?this.#e.snapshot.rootId:a[b-1]??this.#e.snapshot.rootId,A=b,k=!0,E=S;for(;E<=y;){const T=g.indexOf("/",E),L=T===-1||T>y?y:T,O=g.slice(E,L),D=_t(this.#e,w).childIds,N=A===b?i[A]??0:0;let K=N,G;const se=m.get(O)??kc(O);m.set(O,se);const ie=(ee,te)=>{for(K=ee;K<te;K+=1){const le=D[K],me=h[le],H=f[me.nameId];if(H===O)return G=le,!0;const z=Gg(tg(d,me.nameId),se);if(z>0||z===0&&H>O)return!1}return!1};if(!ie(N,D.length)&&N>0&&ie(0,N),G===void 0){k=!1;break}if(!Te(we(this.#e,G))){k=!1;break}if(i[A]=K,a[A]=G,w=G,A+=1,L===y)break;E=L+1}if(c=g,s=y,i.length=A,a.length=A,!k){c=null,s=0,i.length=0,a.length=0;continue}for(let T=b;T<A;T+=1){const L=a[T];if(L==null)continue;const O=we(this.#e,L);wn(this.#e,L,O)||(vc(this.#e,L,!0,O),n+=1)}}return n}hasAllDirectoriesExpanded(){for(const t of this.#e.snapshot.directories.keys()){if(t===this.#e.snapshot.rootId)continue;const n=we(this.#e,t);if(!wn(this.#e,t,n))return!1}return!0}requireDirectoryNodeId(t){const n=hi(this.#e,t);if(n==null)throw new Error(`Path does not exist: "${t}"`);if(!Te(we(this.#e,n)))throw new Error(`Path is not a directory: "${t}"`);return n}resolveActiveDirectoryNodeId(t){try{if(!Te(we(this.#e,t)))throw new Error(`Node is not a directory: ${String(t)}`);return t}catch{return null}}isDirectoryProjectionVisible(t){let n=t;for(;n!==this.#e.snapshot.rootId;){const i=we(this.#e,n).parentId;if(i!==this.#e.snapshot.rootId){const a=we(this.#e,i),s=ws(this.#e,i);if(!wn(this.#e,i,a)&&s!==n)return!1}n=i}return!0}validateChildPatch(t,n){new i5({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function $D(e,t){switch(t.type){case"add":case"remove":if(!t.path.startsWith(e)||t.path===e)throw new Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case"move":if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw new Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}function qD(e){return Jg.preparePresortedInput(e)}const sg={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function GD(e,t){if(typeof e=="number")return{itemHeight:t??sg.default.itemHeight,factor:e};const n=sg[e??"default"];return{itemHeight:t??n.itemHeight,factor:n.factor}}const r5=sg.default.itemHeight;var WS=`@layer base {
1781
1781
  :host {
1782
1782
  --trees-accent: var(--trees-accent-override, #009fff);
1783
1783
  --trees-fg: var(--trees-fg-override, var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1)));
@@ -2875,7 +2875,7 @@ Error generating stack: `+u.message+`
2875
2875
  }`}function WD(e){return`${o5}
2876
2876
  @layer unsafe {
2877
2877
  ${e}
2878
- }`}const YS=new WeakMap;function KD(e){const t=YS.get(e);if(t!=null)return t;const n=document.createElement("div");n.setAttribute(n7,"true");const i=document.createElement("div");i.style.position="relative",i.style.height="200%",n.appendChild(i),e.appendChild(n);const a=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),YS.set(e,a),a}function YD(e,t){if(!e.isConnected)return;const n=KD(t);if(n==null)return;const i=t.querySelector(`style[${kS}]`),a=i instanceof HTMLStyleElement?i:document.createElement("style");i instanceof HTMLStyleElement||(a.setAttribute(kS,""),t.appendChild(a)),a.textContent=`:host { ${i7}: ${n}px; }`}let ud;function XD(e){if(typeof CSSStyleSheet<"u"&&typeof CSSStyleSheet.prototype.replaceSync=="function"&&"adoptedStyleSheets"in e){ud==null&&(ud=new CSSStyleSheet,ud.replaceSync(KS(WS)));let t=!1;try{e.adoptedStyleSheets=[ud],t=!0}catch{}if(t){e.querySelector(`style[${xS}]`)?.remove();return}}if(e.querySelector("style[data-file-tree-style]")==null){const t=document.createElement("style");t.setAttribute(xS,""),t.textContent=KS(WS),e.prepend(t)}}function lg(e,t){QD(e,t),XD(t),YD(e,t)}function QD(e,t){const n=e.querySelector('template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]');n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute("shadowrootmode")&&n.remove()))}if(typeof HTMLElement<"u"&&customElements.get("file-tree-container")==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){const n=this.shadowRoot??this.attachShadow({mode:"open"});lg(this,n)}}if(customElements.define(Jm,e),typeof document<"u")for(const t of Array.from(document.querySelectorAll(Jm)))t instanceof HTMLElement&&lg(t,t.shadowRoot??t.attachShadow({mode:"open"}))}const ZD=e=>e.startsWith("f::")?e.slice(3):e;function JD(e){const t=e.lastIndexOf("/");return t<0?{parentPath:"",baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function eM(e,t){return e===""?t:`${e}/${t}`}function tM({files:e,path:t,isFolder:n,nextBasename:i}){const a=ZD(t),s=i.trim();if(s.length===0)return{error:"Name cannot be empty."};if(s.includes("/"))return{error:'Name cannot include "/".'};const{parentPath:c,baseName:d}=JD(a);if(s===d)return{nextFiles:e,sourcePath:a,destinationPath:a,isFolder:n};const f=eM(c,s),h=new Array(e.length),m=new Set;if(!n){const S=`${f}/`;let w=!1;for(let A=0;A<e.length;A++){const k=e[A];if(k!==a&&k.startsWith(S))return{error:`"${f}" already exists.`};const E=k===a?f:k;if(m.has(E))return{error:`"${f}" already exists.`};m.add(E),h[A]=E,k===a&&(w=!0)}return w?{nextFiles:h,sourcePath:a,destinationPath:f,isFolder:n}:{error:"Could not find the selected file to rename."}}const g=`${a}/`,y=`${f}/`;let b=0;for(let S=0;S<e.length;S++){const w=e[S],A=w===a||w.startsWith(g);if(!A&&(w===f||w.startsWith(y)))return{error:`"${f}" already exists.`};const k=A?`${f}${w.slice(a.length)}`:w;if(m.has(k))return{error:`"${f}" already exists.`};m.add(k),h[S]=k,A&&b++}return b===0?{error:"Could not find the selected folder to rename."}:{nextFiles:h,sourcePath:a,destinationPath:f,isFolder:n}}function nM(e){return e.endsWith("/")}function iM(e){const t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/"),i=n<0?t:t.slice(n+1);return e.endsWith("/")?`${i}/`:i}function rM(e){const t=[],n=new Set;for(const a of e)n.has(a)||(n.add(a),t.push(a));const i=new Set;for(const a of t.toSorted((s,c)=>s.length!==c.length?s.length-c.length:s.localeCompare(c))){const s=(a.endsWith("/")?a.slice(0,-1):a).split("/");let c=!1;for(let d=0;d<s.length-1;d+=1){const f=`${s.slice(0,d+1).join("/")}/`;if(i.has(f)){c=!0;break}}c||i.add(a)}return t.filter(a=>i.has(a))}function oM(e,t){return t.includes(e)?rM(t):[e]}function aM(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function XS(e,t){return{draggedPaths:e,target:t}}function QS(e,t){if(t.kind!=="directory"||t.directoryPath==null)return!1;for(const n of e)if(nM(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function sM(e,t){return t.kind==="root"||t.directoryPath==null?iM(e):t.directoryPath}function lM(e,t){const n=e.map(i=>{const a=sM(i,t);return a===i?null:{from:i,to:a,type:"move"}}).filter(i=>i!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?"move":"batch",target:t}}}function cM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ZS(e,t,n){const{paths:i,preparedInput:a}=e;if(a==null){if(i==null)throw new Error("FileTree requires paths or preparedInput");return{paths:i,preparedInput:void 0}}const s=a.paths;if(i==null)return{paths:s,preparedInput:a};if(!cM(Jg.preparePaths(i,n==null?{}:{sort:n}),s))throw new Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:s,preparedInput:a}}function JS(e){return e.operation==="add"||e.operation==="remove"||e.operation==="move"||e.operation==="batch"}function uM(e,t,n){if(e===t)return n;const i=t.endsWith("/")?t:`${t}/`;return e.startsWith(i)?`${n.endsWith("/")?n:`${n}/`}${e.slice(i.length)}`:e}function dM(e,t){if(e===t)return!0;const n=t.endsWith("/")?t:`${t}/`;return e.startsWith(n)}function Wl(e,t,n=!1){if(e==null)return null;switch(t.operation){case"add":case"expand":case"collapse":case"mark-directory-unloaded":case"begin-child-load":case"apply-child-patch":case"complete-child-load":case"fail-child-load":case"cleanup":return e;case"remove":return dM(e,t.path)?n?e:null:e;case"move":return uM(e,t.from,t.to);case"batch":{let i=e;for(const a of t.events)if(i=Wl(i,a,n),i==null)return null;return i}}}function Ed(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function a5(e){switch(e.operation){case"add":return{...Ed(e),operation:"add",path:e.path};case"remove":return{...Ed(e),operation:"remove",path:e.path,recursive:e.recursive};case"move":return{...Ed(e),from:e.from,operation:"move",to:e.to}}}function fM(e){return{...Ed(e),events:e.events.filter(t=>t.operation==="add"||t.operation==="remove"||t.operation==="move").map(t=>a5(t)),operation:"batch"}}function hM(e){switch(e.operation){case"add":case"remove":case"move":return a5(e);case"batch":return fM(e);default:return null}}function fm(e,t){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function po(e){const t=e.endsWith("/")?e.slice(0,-1):e;if(t.length===0)return[];const n=t.split("/");return n.slice(0,-1).map((i,a)=>`${n.slice(0,a+1).join("/")}/`)}function hm(e){return po(e).at(-1)??null}function e_(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function dd(e){return e.endsWith("/")}const t_=e=>e.toLowerCase();function pM(e){const t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n<0?t:t.slice(n+1)}function n_(e){return e.endsWith("/")?e.slice(0,-1):e}function i_(e,t){return t&&!e.endsWith("/")?`${e}/`:e}const mM=e=>{const t=e.trim();return t.length===0?"":(t.includes("\\")?t.replaceAll("\\","/"):t).toLowerCase()},s5=Symbol("FILE_TREE_RENAME_VIEW"),gM=512,vM=512;function yM(e){return e==="top"||e==="center"?e:"nearest"}function bM(e,t,n){if(e===0)return-1;if(n!=null){const i=t(n);if(i!=null)return i;const a=po(n);for(let s=a.length-1;s>=0;s-=1){const c=a[s];if(c==null)continue;const d=t(c);if(d!=null)return d}}return 0}function SM(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};const i=n??(a=>e.visibleIndexByPath.get(a)??null);return{focusedIndex:bM(e.paths.length,i,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var _M=class l5{static{Object.defineProperty(l5.prototype,s5,{configurable:!0,value(){return{cancel:()=>{this.#Te()},commit:()=>{this.#ke()},getPath:()=>this.#c,getValue:()=>this.#g,isActive:()=>this.#c!=null,setValue:t=>{this.#Ae(t)}}},writable:!0})}#e;#t=new Set;#l=new Map;#a=null;#r=null;#A=new Map;#B=new Map;#v=-1;#i=null;#y=!1;#L=t=>-1;#b=new Map;#m=null;#f=null;#S=null;#_=null;#h=null;#U;#F;#P;#o=[];#j=new Int32Array(0);#$=new Int32Array(0);#Z=void 0;#I=!1;#c=null;#g="";#R=!1;#x=new Set;#q=[];#G;#W=null;#u=null;#N=null;#M=null;#w=null;#H=null;#J=null;#xe=0;#C=null;#s=new Set;#K=0;#n;#ne=0;#ie=!1;#p=0;#Y;constructor(t){const{dragAndDrop:n,fileTreeSearchMode:i,initialSearchQuery:a,initialSelectedPaths:s,renaming:c,onSearchChange:d,paths:f,preparedInput:h,...m}=t,g=ZS({paths:f,preparedInput:h},"constructor",m.sort);this.#e=m,n!=null&&n!==!1&&(this.#a=n===!0?{}:n),this.#I=c!=null&&c!==!1,c!=null&&c!==!1&&c!==!0&&(this.#Z=c.canRename,this.#F=c.onError,this.#U=c.onRename),this.#P=d,this.#G=i??"hide-non-matches",this.#n=this.#oe(g.paths,g.preparedInput);const y=s?.map(S=>this.#O(S)).filter(S=>S!=null)??[],b=y.at(-1)??null;y.length>0&&(this.#s=new Set(y),this.#C=b,this.#K=1),this.#V(b,!1),a!=null&&this.#X(a,!1),this.#Y=this.#Ee()}destroy(){this.#Y?.(),this.#Y=null,this.#l.clear(),this.#t.clear(),this.#b.clear(),this.#r=null,this.#se()}focusFirstItem(){this.#T().length>0&&this.#k(0)}focusLastItem(){this.#p<=0||(this.#D(),this.#k(this.#p-1))}focusNextItem(){this.#Ce(1)}focusParentItem(){if(this.#i==null)return;const t=hm(this.#i);if(t==null)return;const n=this.#z(t);n>=0&&this.#k(n)}focusPath(t){const n=this.#n.getPathInfo(t)?.path??null;if(n==null)return;this.#D();const i=this.#z(n);i>=0&&this.#k(i)}scrollToPath(t,n){const i=this.#n.getPathInfo(t)?.path??null;if(i==null)return;this.#D();const a=this.#ze(i);a<0||this.#le(a)!=null&&(n?.focus!==!1&&this.#k(a,!1),this.#J={id:this.#xe+=1,offset:yM(n?.offset),visibleIndex:a},this.#d())}focusMountedPathFromInput(t){const n=this.#n.getPathInfo(t)?.path??null;if(n==null)return;const i=this.#z(n);i>=0&&this.#k(i)}focusNearestPath(t){const n=this.resolveNearestVisiblePath(t);if(n==null)return null;const i=this.#z(n);return i>=0?(this.#k(i),this.#T()[i]??n):null}focusPreviousItem(){this.#Ce(-1)}getFocusedIndex(){return this.#v}getFocusedItem(){return this.#i==null?null:this.#ce(this.#i)}getFocusedPath(){return this.#i}getScrollRequest(){return this.#J}clearScrollRequest(t){this.#J?.id===t&&(this.#J=null)}resolveNearestVisiblePath(t){const n=this.#T();if(this.#p===0)return null;if(t==null)return this.#i??n[0]??null;const i=this.#n.getPathInfo(t)?.path??t,a=this.#z(i);if(a>=0)return n[a]??i;const s=this.#Le(i);return s??this.#i??n[0]??null}getSelectedPaths(){return[...this.#s]}getSelectionVersion(){return this.#K}getVisibleCount(){return this.#p}getVisibleRows(t,n){if(n<t||this.#p===0)return[];const i=Math.max(0,t),a=Math.min(this.#p-1,n);if(a<i)return[];const s=a-i+1;if(this.#w==null&&!this.#y&&a>=this.#o.length&&s<=vM){const c=[];for(let d=i;d<=a;d+=1){const f=this.#n.getVisibleRowContext(d);if(f==null)break;c.push(this.#ue(f))}return c}if(!this.#y&&a>=this.#o.length&&this.#D(),this.#w!=null){const c=Array.from({length:a-i+1},(m,g)=>this.#ve(i+g)),d=new Map;let f=c[0]??-1,h=f;for(let m=1;m<=c.length;m+=1){const g=c[m];if(g!=null&&g===h+1){h=g;continue}if(f>=0&&this.#n.getVisibleSlice(f,h).forEach((y,b)=>{d.set(f+b,y)}),g==null){f=-1,h=-1;continue}f=g,h=g}return Array.from({length:a-i+1},(m,g)=>{const y=i+g,b=this.#ve(y),S=d.get(b),w=this.#o[b];if(S==null||w==null)throw new Error(`Missing projection row for filtered visible index ${String(y)}`);return this.#re(S,y,b,{ancestorPaths:this.#he(b),path:w})})}return this.#n.getVisibleSlice(i,a).map((c,d)=>{const f=i+d,h=this.#o[f];if(h==null)throw new Error(`Missing projection path for visible index ${String(f)}`);return this.#re(c,f,f,{ancestorPaths:this.#he(f),path:h})})}getStickyRowCandidates(t,n){if(this.#w!=null)return null;if(this.#p===0||t<=0||n<=0)return[];const i=[];for(let a=0;a<this.#p;a+=1){const s=t+a*n,c=Math.min(this.#p-1,Math.floor(s/n)),d=this.#de(c,a)??(c>0?this.#de(c-1,a):void 0);if(d==null)break;i.push({row:this.#ue(d),subtreeEndIndex:d.subtreeEndIndex})}return i}getItem(t){const n=this.#n.getPathInfo(t);return n==null?null:this.#ce(n.path,n)}resolveMountedDirectoryPathFromInput(t){const n=this.#n.getPathInfo(t);return n?.kind==="directory"?n.path:null}toggleMountedDirectoryFromInput(t){const n=this.resolveMountedDirectoryPathFromInput(t);n!=null&&this.#we(n)}selectAllVisiblePaths(){this.#D();const t=[...this.#T()];this.#E(t,this.#i??this.#C)}selectOnlyPath(t){const n=this.#O(t);n!=null&&this.#E([n],n)}selectOnlyMountedPathFromInput(t){this.#E([t],t)}selectPath(t){const n=this.#O(t);n==null||this.#s.has(n)||this.#E([...this.#s,n])}deselectPath(t){const n=this.#O(t);n==null||!this.#s.has(n)||this.#E([...this.#s].filter(i=>i!==n))}toggleFocusedSelection(){this.#i!=null&&this.togglePathSelectionFromInput(this.#i)}togglePathSelection(t){const n=this.#O(t);if(n!=null){if(this.#s.has(n)){this.deselectPath(n);return}this.selectPath(n)}}togglePathSelectionFromInput(t){const n=this.#O(t);if(n!=null){if(this.#s.has(n)){this.#E([...this.#s].filter(i=>i!==n),n);return}this.#E([...this.#s,n],n)}}selectPathRange(t,n){const i=this.#O(t);if(i==null)return;this.#D();const a=this.#C,s=a==null?-1:this.#te(a),c=this.#te(i);if(s===-1||c===-1){const g=n?[...this.#s,i]:[i];this.#E(g,i);return}const[d,f]=s<=c?[s,c]:[c,s],h=this.#T().slice(d,f+1),m=n?[...this.#s,...h]:h;this.#E(m,a)}extendSelectionFromFocused(t){if(this.#i==null)return;const n=this.#v;if(n===-1)return;const i=Math.min(this.#p-1,Math.max(0,n+t));if(i===n)return;!this.#y&&i>=this.#o.length&&this.#D();const a=this.#T(),s=a[n]??null,c=a[i]??null;if(s==null||c==null)return;const d=new Set(this.#s);d.has(s)&&d.has(c)?d.delete(s):d.add(c),this.#E([...d],this.#C??s,!1),this.#k(i)}getDragAndDropConfig(){return this.#a}isDragAndDropEnabled(){return this.#a!=null}getDragSession(){return this.#r==null?null:{draggedPaths:[...this.#r.draggedPaths],primaryPath:this.#r.primaryPath,target:this.#r.target==null?null:{...this.#r.target}}}startDrag(t){if(this.#a==null)return!1;const n=this.#O(t);if(n==null||this.#u!=null&&this.#u.length>0)return!1;const i=this.getSelectedPaths(),a=oM(n,i);return this.#a.canDrag?.(a)===!1?!1:(i.includes(n)||this.#E([n],n,!1),this.#Q(n),this.#r={draggedPaths:a,primaryPath:n,target:null},this.#d(),!0)}setDragTarget(t){const n=this.#r;if(n==null)return;let i=t;if(i!=null){const a=XS(n.draggedPaths,i);(QS(n.draggedPaths,i)||this.#a?.canDrop?.(a)===!1)&&(i=null)}aM(n.target,i)||(this.#r={...n,target:i},this.#d())}cancelDrag(){this.#r!=null&&(this.#r=null,this.#d())}completeDrag(){const t=this.#r;if(t==null)return!1;this.#r=null;const n=t.target==null?null:{...t.target};if(n==null)return this.#d(),!1;const i=XS(t.draggedPaths,n);if(QS(t.draggedPaths,n)||this.#a?.canDrop?.(i)===!1)return this.#d(),!1;const a=lM(t.draggedPaths,n);if(a==null)return this.#d(),!1;try{if(a.operations.length===1){const s=a.operations[0];if(s==null||s.type!=="move")throw new Error("Expected a single move operation for one-item drops");this.#n.move(s.from,s.to,{collision:s.collision})}else this.#De(a.operations),this.#n.batch(a.operations)}catch(s){return this.#d(),this.#a?.onDropError?.(s instanceof Error?s.message:String(s),i),!1}return this.#a?.onDropComplete?.(a.result),!0}subscribe(t){return this.#t.add(t),t(),()=>{this.#t.delete(t)}}add(t){this.#n.add(t)}remove(t,n={}){this.#n.remove(t,n)}move(t,n,i={}){this.#n.move(t,n,i)}batch(t){this.#n.batch(t)}onMutation(t,n){const i=t,a=n;let s=this.#l.get(i);return s==null&&(s=new Set,this.#l.set(i,s)),s.add(a),()=>{const c=this.#l.get(i);c?.delete(a),c?.size===0&&this.#l.delete(i)}}setSearch(t){this.#X(t,!0)}openSearch(t=""){this.#X(t,!0)}closeSearch(){this.#X(null,!0)}isSearchOpen(){return this.#u!==null}getSearchValue(){return this.#u??""}getSearchMatchingPaths(){return this.#q}focusNextSearchMatch(){this.#ye(1)}focusPreviousSearchMatch(){this.#ye(-1)}startRenaming(t=this.#i??"",n={}){if(!this.#I)return!1;const i=this.#n.getPathInfo(t);if(i==null)return!1;const a=i.path,s=dd(a),c=n_(a);if(this.#Z?.({isFolder:s,path:c})===!1)return!1;for(const d of po(a))this.#n.isExpanded(d)||this.#n.expand(d);return this.#E([a],a,!1),this.#u!=null&&(this.#X(null,!1),this.#P?.(this.#u)),this.#Q(a),this.#c=a,this.#g=pM(a),this.#R=n.removeIfCanceled??!1,this.#d(),!0}#Te(){if(this.#c==null)return;const t=this.#c,n=this.#R;if(this.#c=null,this.#g="",this.#R=!1,n){this.remove(t,dd(t)?{recursive:!0}:void 0);return}this.#Q(t),this.#d()}#ke(){const t=this.#c;if(t==null)return;if(this.#R&&this.#g.trim().length===0){this.#c=null,this.#g="",this.#R=!1,this.remove(t,dd(t)?{recursive:!0}:void 0);return}const n=dd(t),i=tM({files:this.#n.list(),isFolder:n,nextBasename:this.#g,path:n_(t)});if(this.#c=null,this.#g="",this.#R=!1,"error"in i){this.#Q(t),this.#F?.(i.error),this.#d();return}if(i.sourcePath===i.destinationPath){this.#Q(t),this.#d();return}this.#U?.({destinationPath:i.destinationPath,isFolder:i.isFolder,sourcePath:i.sourcePath}),this.move(i_(i.sourcePath,n),i_(i.destinationPath,n))}#Ae(t){this.#c==null||this.#g===t||(this.#g=t,this.#d())}resetPaths(t,n={}){const i=!Array.isArray(t),a=i?void 0:t,s=i?t:n,c=this.#n.list().length,d=this.#p,f=ZS({paths:a,preparedInput:s.preparedInput},"resetPaths",this.#e.sort),h=this.#oe(f.paths,f.preparedInput,s.initialExpandedPaths),m=this.#i,g=this.#c,y=this.getSelectedPaths(),b=this.#C;this.#Y?.(),this.#n=h,this.#b.clear(),this.#se();const S=y.map(A=>h.getPathInfo(A)?.path??null).filter(A=>A!=null),w=!fm(this.#s,S);this.#s=new Set(S),w&&(this.#K+=1),this.#C=b==null?null:h.getPathInfo(b)?.path??null,this.#c=g==null?null:h.getPathInfo(g)?.path??null,this.#c==null&&(this.#g="",this.#R=!1),this.#V(m,m!=null||S.length>0||this.#C!=null),this.#Y=this.#Ee(),this.#d(),this.#Se({canonicalChanged:!0,operation:"reset",pathCountAfter:f.paths.length,pathCountBefore:c,projectionChanged:!0,usedPreparedInput:s.preparedInput!=null,visibleCountDelta:this.#p-d})}#Le(t){this.#D();const n=hm(t),i=e_(t,n);let a=null,s=null;for(const c of this.#T()){if(hm(c)!==n)continue;const d=e_(c,n);if(d<i){a=c;continue}if(d>i){s=c;break}}return a??s}#z(t){const n=this.#te(t);if(n!==-1)return n;const i=po(t);for(let a=i.length-1;a>=0;a-=1){const s=i[a];if(s==null)continue;const c=this.#te(s);if(c!==-1)return c}return this.#T().length>0?0:-1}#ce(t,n){const i=this.#b.get(t);if(i!=null)return i;const a=n??this.#n.getPathInfo(t);if(a==null)return null;const s=a.kind==="directory"?this.#Ie(a.path):this.#Re(a.path);return this.#b.set(a.path,s),s}#re(t,n,i,a){return{ancestorPaths:a.ancestorPaths,depth:t.depth,flattenedSegments:t.flattenedSegments?.map(s=>({isTerminal:s.isTerminal,name:s.name,path:s.path})),hasChildren:t.hasChildren,index:n,isExpanded:t.isExpanded,isFlattened:t.isFlattened,isFocused:a.path===this.#i,isSelected:this.#s.has(a.path),kind:t.kind,level:t.depth,name:t.name,path:a.path,posInSet:a.posInSet??this.#j[i]??0,setSize:a.setSize??this.#$[i]??0}}#ue(t){return this.#re(t.row,t.index,t.index,{ancestorPaths:t.ancestorPaths,path:t.row.path,posInSet:t.posInSet,setSize:t.setSize})}#de(t,n){const i=this.#n.getVisibleRowContext(t);if(i==null)return;const a=i.ancestorRows[n];return a??(n===i.ancestorRows.length&&i.row.kind==="directory"&&i.row.isExpanded?i:void 0)}#fe(t){const n=this.#A.get(t);if(n!=null)return n;const i=this.#L(t),a=i<0?[]:[...this.#fe(i),i];return this.#A.set(t,a),a}#he(t){const n=this.#B.get(t);if(n!=null)return n;const i=this.#fe(t).map(a=>this.#o[a]??"").filter(a=>a!=="");return this.#B.set(t,i),i}#pe(t){this.#n.collapse(t)}#E(t,n=this.#C,i=!0){const a=[...new Set(t)],s=!fm(this.#s,a),c=this.#C!==n;!s&&!c||(this.#s=new Set(a),this.#C=n,s&&(this.#K+=1),i&&this.#d())}#Ie(t){return{collapse:()=>{this.#pe(t)},deselect:()=>{this.deselectPath(t)},expand:()=>{this.#_e(t)},focus:()=>{this.focusPath(t)},getPath:()=>t,isDirectory:()=>!0,isExpanded:()=>this.#n.isExpanded(t),isFocused:()=>this.#i===t,isSelected:()=>this.#s.has(t),select:()=>{this.selectPath(t)},toggleSelect:()=>{this.togglePathSelection(t)},toggle:()=>{this.#we(t)}}}#Re(t){return{deselect:()=>{this.deselectPath(t)},focus:()=>{this.focusPath(t)},getPath:()=>t,isDirectory:()=>!1,isFocused:()=>this.#i===t,isSelected:()=>this.#s.has(t),select:()=>{this.selectPath(t)},toggleSelect:()=>{this.togglePathSelection(t)}}}#De(t){const n=this.#n.list();this.#oe(n).batch(t)}#oe(t,n,i){return new Jg({...this.#e,paths:t,preparedInput:n??void 0,...i!==void 0?{initialExpandedPaths:i}:{}})}#ae(){return this.#_!=null?this.#_:(this.#_=this.#n.list(),this.#_)}#Me(){if(this.#S!=null)return this.#S;const t=new Set;for(const n of this.#ae()){t.add(n);for(const i of po(n))t.add(i)}return this.#S=[...t].sort(),this.#S}#Oe(){return this.#h!=null?this.#h:(this.#h=this.#ae().map(t_),this.#h)}#ee(){return this.#m!=null?this.#m:(this.#m=this.#Me().filter(t=>t.endsWith("/")),this.#m)}#Pe(){return this.#f!=null?this.#f:(this.#f=this.#ee().map(t_),this.#f)}#se(){this.#m=null,this.#f=null,this.#S=null,this.#_=null,this.#h=null}#Ne(){return this.#ee().filter(t=>this.#n.isExpanded(t))}#me(t){const n=new Set(this.#W??[]);if(t)for(const i of this.#s)for(const a of po(i))n.add(a);this.#ge(n)}#ge(t){this.#ie=!0;try{for(const n of this.#ee()){const i=t.has(n),a=this.#n.isExpanded(n);i&&!a?this.#n.expand(n):!i&&a&&this.#n.collapse(n)}}finally{this.#ie=!1}}#He(){if(this.#u==null||this.#u.length===0){this.#q=[],this.#w=null,this.#H=null,this.#M=null,this.#p=this.#ne;return}const t=this.#o;if(this.#q=t.filter(s=>this.#x.has(s)),this.#G!=="hide-non-matches"||this.#x.size===0){this.#w=null,this.#H=null,this.#M=null,this.#p=this.#ne;return}const n=[],i=[],a=new Map;for(const[s,c]of t.entries())this.#N?.has(c)===!0&&(a.set(c,i.length),n.push(s),i.push(c));this.#w=n,this.#H=i,this.#M=a,this.#p=i.length}#T(){return this.#H??this.#o}#ze(t){return this.#H!=null?this.#M?.get(t)??-1:this.#n.getVisibleIndex(t)??-1}#ve(t){return this.#w?.[t]??t}#te(t){const n=this.#M?.get(t);return n??this.#n.getVisibleIndex(t)??-1}#ye(t){const n=this.#q;if(n.length===0)return;const i=this.#i,a=i==null?-1:n.indexOf(i),s=n[a<0?t>0?0:n.length-1:Math.min(n.length-1,Math.max(0,a+t))];s!=null&&this.focusPath(s)}#X(t,n){const i=t==null?null:mM(t),a=this.#u;if(a!==i){if(a==null&&i!=null&&(this.#W=this.#Ne()),this.#u=i,i==null)this.#me(!0),this.#W=null,this.#x.clear(),this.#N=null,this.#V(this.#i,!0);else if(i.length===0)this.#me(!1),this.#x.clear(),this.#N=null,this.#V(this.#i,!0);else{const s=this.#be();this.#V(s,!0)}n&&(this.#P?.(this.#u),this.#d())}}#be(){if(this.#u==null||this.#u.length===0)return this.#x.clear(),this.#i;const t=this.#u,n=this.#ae(),i=this.#Oe(),a=[],s=new Set;let c=null;for(let g=0;g<n.length;g+=1){if(!i[g].includes(t))continue;const y=n[g];a.push(y),s.add(y),c??=y}const d=this.#ee(),f=this.#Pe();for(let g=0;g<d.length;g+=1){if(!f[g].includes(t))continue;const y=d[g];s.has(y)||(a.push(y),s.add(y),c??=y)}this.#x=s;const h=this.#G==="hide-non-matches"&&a.length>0?new Set:null;this.#N=h;const m=this.#G==="expand-matches"?new Set(this.#W??[]):new Set;for(const g of a){h?.add(g),g.endsWith("/")&&m.add(g);for(const y of po(g))m.add(y),h?.add(y)}return this.#ge(m),c??this.#i}#d(){for(const t of this.#t)t()}#Se(t){this.#l.get(t.operation)?.forEach(n=>{n(t)}),this.#l.get("*")?.forEach(n=>{n(t)})}#_e(t){for(const n of po(t))this.#n.isExpanded(n)||this.#n.expand(n);this.#n.isExpanded(t)||this.#n.expand(t)}#Ce(t){const n=this.#p;if(n===0)return;const i=this.#v===-1?0:this.#v,a=Math.min(n-1,Math.max(0,i+t));(a!==i||this.#v===-1)&&(!this.#y&&this.#w==null&&a>=this.#o.length&&this.#D(),this.#k(a))}#V(t,n=!0){const i=this.#n.getVisibleCount();this.#ne=i;const a=SM(this.#n.getVisibleTreeProjectionData(n?void 0:Math.min(i,gM)),t,n?s=>this.#n.getVisibleIndex(s):void 0);this.#A.clear(),this.#B.clear(),this.#y=a.paths.length>=i,this.#L=a.getParentIndex,this.#o=a.paths,this.#j=a.posInSetByIndex,this.#$=a.setSizeByIndex,this.#He(),this.#v=t==null?this.#T().length>0?0:-1:this.#z(t),this.#i=this.#v<0?null:this.#le(this.#v)}#le(t){const n=this.#T()[t];return n??(this.#w!=null?null:this.#n.getVisibleRowContext(t)?.row.path??null)}#O(t){return this.#n.getPathInfo(t)?.path??null}#Q(t){if(t==null)return;const n=this.#z(t);n>=0&&this.#k(n,!1)}#k(t,n=!0){const i=this.#le(t);i!=null&&(this.#v===t&&this.#i===i||(this.#v=t,this.#i=i,n&&this.#d()))}#D(){this.#y||this.#V(this.#i,!0)}#Ve(t){const n=Wl(this.#c,t);n==null&&this.#c!=null&&(this.#g=""),this.#c=n;const i=Wl(this.#i,t,!0),a=[...this.#s].map(f=>Wl(f,t)).filter(f=>f!=null).map(f=>this.#n.getPathInfo(f)?.path??null).filter(f=>f!=null),s=Wl(this.#C,t),c=s==null?null:this.#n.getPathInfo(s)?.path??null,d=[...new Set(a)];return fm(this.#s,d)||(this.#s=new Set(d),this.#K+=1),this.#C=c,i}#Ee(){return this.#n.on("*",t=>{if(this.#ie)return;t.canonicalChanged&&(this.#b.clear(),this.#se()),this.#r!=null&&JS(t)&&(this.#r=null);const n=JS(t)?this.#Ve(t):this.#i,i=this.#u!=null&&this.#u.length>0?this.#be():this.#u===""?this.#i:n,a=this.#u!=null||t.operation!=="expand"&&t.operation!=="collapse";this.#V(i,a),this.#d();const s=hM(t);s!=null&&this.#Se(s)})}#we(t){if(this.#n.isExpanded(t)){this.#pe(t);return}this.#_e(t)}};const CM=e=>{if(e==null||e.length===0)return"0";let t=`${e.length}`;for(const n of e)t+=`\0${n.path}\0${n.status}`;return t};function EM(e){const t=e.endsWith("/");let n="",i=-1;for(let a=0;a<=e.length;a+=1){if(!(e[a]==="/"||a===e.length)){i===-1&&(i=a);continue}i!==-1&&(n!==""&&(n+="/"),n+=e.slice(i,a),i=-1)}return n===""?null:{isDirectory:t,path:n}}function c5(e){const t=e.endsWith("/")?e.slice(0,-1):e;if(t.length===0)return[];const n=[];let i=0;for(;;){const a=t.indexOf("/",i);if(a===-1)break;n.push(t.slice(0,a+1)),i=a+1}return n}function wM(e,t){return t?`${e}/`:e}function r_(e,t=null){const n=CM(e==null?void 0:[...e]);if(n==="0")return null;if(t?.signature===n)return t;const i=new Map,a=new Set,s=new Set,c=new Map;for(const d of e??[]){const f=u5(d);f!=null&&f5({canonicalPath:f.canonicalPath,changeCountByDirectoryPath:c,directoriesWithChanges:a,ignoredDirectoryPaths:s,isDirectory:f.isDirectory,status:d.status,statusByPath:i})}return i.size===0?null:{changeCountByDirectoryPath:c,directoriesWithChanges:a,ignoredDirectoryPaths:s,signature:n,statusByPath:i}}function xM(e,t){const n=t?.remove??[],i=t?.set??[];if(n.length===0&&i.length===0)return e;const a=new Map(e?.statusByPath),s=new Set(e?.directoriesWithChanges),c=new Set(e?.ignoredDirectoryPaths),d=new Map(e?.changeCountByDirectoryPath);let f=!1;for(const h of n){const m=d5(h);m!=null&&(f=TM({canonicalPath:m.canonicalPath,changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,statusByPath:a})||f)}for(const h of i){const m=u5(h);m!=null&&(f=f5({canonicalPath:m.canonicalPath,changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,isDirectory:m.isDirectory,status:h.status,statusByPath:a})||f)}return f?a.size===0?null:{changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,signature:LM(a),statusByPath:a}:e}function u5(e){return d5(e.path)}function d5(e){const t=EM(e);if(t!=null)return{canonicalPath:wM(t.path,t.isDirectory),isDirectory:t.isDirectory}}function TM({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:i,statusByPath:a}){const s=a.get(e);return s==null?!1:(a.delete(e),s==="ignored"&&e.endsWith("/")&&i.delete(e),AM(t,n,e),!0)}function f5({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:i,isDirectory:a,status:s,statusByPath:c}){const d=c.get(e);return d===s?!1:(d==null&&kM(t,n,e),c.set(e,s),s==="ignored"&&a?i.add(e):a&&i.delete(e),!0)}function kM(e,t,n){for(const i of c5(n))e.set(i,(e.get(i)??0)+1),t.add(i)}function AM(e,t,n){for(const i of c5(n)){const a=(e.get(i)??0)-1;a>0?e.set(i,a):(e.delete(i),t.delete(i))}}function LM(e){let t=`${e.size}`;for(const[n,i]of e)t+=`\0${n}\0${i}`;return t}var ft,h5,ea,o_,Zd,p5,m5,e0,cg,ug,Sc={},g5=[],_f=Array.isArray,t0=g5.slice,_o=Object.assign;function n0(e){e&&e.parentNode&&e.remove()}function dg(e,t,n){var i,a,s,c={};for(s in t)s=="key"?i=t[s]:s=="ref"&&typeof e!="function"?a=t[s]:c[s]=t[s];return arguments.length>2&&(c.children=arguments.length>3?t0.call(arguments,2):n),wd(e,c,i,a,null)}function wd(e,t,n,i,a){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++h5,__i:-1,__u:0};return a==null&&ft.vnode!=null&&ft.vnode(s),s}function xs(e){return e.children}function xd(e,t){this.props=e,this.context=t,this.__g=0}function bs(e,t){if(t==null)return e.__?bs(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?bs(e):null}function v5(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return v5(e)}}function a_(e){(8&e.__g||!(e.__g|=8)||!ea.push(e)||Zd++)&&o_==ft.debounceRendering||((o_=ft.debounceRendering)||queueMicrotask)(IM)}function IM(){for(var e,t,n,i,a,s,c,d,f=1;ea.length;)ea.length>f&&ea.sort(p5),e=ea.shift(),f=ea.length,8&e.__g&&(n=void 0,a=(i=(t=e).__v).__e,s=[],c=[],(d=t.__P)&&((n=_o({},i)).__v=i.__v+1,ft.vnode&&ft.vnode(n),i0(d,n,i,t.__n,d.namespaceURI,32&i.__u?[a]:null,s,a??bs(i),!!(32&i.__u),c,d.ownerDocument),n.__v=i.__v,n.__.__k[n.__i]=n,S5(s,n,c),n.__e!=a&&v5(n)));Zd=0}function y5(e,t,n,i,a,s,c,d,f,h,m,g){var y,b,S,w,A,k,E,T=i&&i.__k||g5,L=t.length;for(f=RM(n,t,T,f,L),y=0;y<L;y++)(S=n.__k[y])!=null&&(b=S.__i==-1?Sc:T[S.__i]||Sc,S.__i=y,k=i0(e,S,b,a,s,c,d,f,h,m,g),w=S.__e,S.ref&&b.ref!=S.ref&&(b.ref&&r0(b.ref,null,S),m.push(S.ref,S.__c||w,S)),A==null&&w!=null&&(A=w),(E=!!(4&S.__u))||b.__k===S.__k?f=b5(S,f,e,E):typeof S.type=="function"&&k!==void 0?f=k:w&&(f=w.nextSibling),S.__u&=-7);return n.__e=A,f}function RM(e,t,n,i,a){var s,c,d,f,h,m=n.length,g=m,y=0;for(e.__k=new Array(a),s=0;s<a;s++)(c=t[s])!=null&&typeof c!="boolean"&&typeof c!="function"?(f=s+y,(c=e.__k[s]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?wd(null,c,null,null,null):_f(c)?wd(xs,{children:c},null,null,null):c.constructor==null&&c.__b>0?wd(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=e,c.__b=e.__b+1,d=null,(h=c.__i=DM(c,n,f,g))!=-1&&(g--,(d=n[h])&&(d.__u|=2)),d==null||d.__v==null?(h==-1&&(a>m?y--:a<m&&y++),typeof c.type!="function"&&(c.__u|=4)):h!=f&&(h==f-1?y--:h==f+1?y++:(h>f?y--:y++,c.__u|=4))):e.__k[s]=null;if(g)for(s=0;s<m;s++)(d=n[s])!=null&&(2&d.__u)==0&&(d.__e==i&&(i=bs(d)),C5(d,d));return i}function b5(e,t,n,i){var a,s;if(typeof e.type=="function"){for(a=e.__k,s=0;a&&s<a.length;s++)a[s]&&(a[s].__=e,t=b5(a[s],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=bs(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function DM(e,t,n,i){var a,s,c,d=e.key,f=e.type,h=t[n],m=h!=null&&(2&h.__u)==0;if(h===null&&e.key==null||m&&d==h.key&&f==h.type)return n;if(i>(m?1:0)){for(a=n-1,s=n+1;a>=0||s<t.length;)if((h=t[c=a>=0?a--:s++])!=null&&(2&h.__u)==0&&d==h.key&&f==h.type)return c}return-1}function s_(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n??""}function fd(e,t,n,i,a){var s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||s_(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||s_(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(m5,"$1")),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||(e.__l={}),e.__l[t+s]=n,n?i?n.l=i.l:(n.l=e0,e.addEventListener(t,s?ug:cg,s)):e.removeEventListener(t,s?ug:cg,s);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function l_(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=e0++;else if(t.u<n.l)return;return n(ft.event?ft.event(t):t)}}}function i0(e,t,n,i,a,s,c,d,f,h,m){var g,y,b,S,w,A,k,E,T,L,O,D,N,W,G,se,ie,ee,te,le,me,H=t.type;if(t.constructor!=null)return null;128&n.__u&&(f=!!(32&n.__u),n.__c.__z&&(d=t.__e=n.__e=(s=n.__c.__z)[0],n.__c.__z=null)),(g=ft.__b)&&g(t);e:if(typeof H=="function")try{if(E=t.props,T="prototype"in H&&H.prototype.render,L=(g=H.contextType)&&i[g.__c],O=g?L?L.props.value:g.__:i,n.__c?2&(y=t.__c=n.__c).__g&&(y.__g|=1,k=!0):(T?t.__c=y=new H(E,O):(t.__c=y=new xd(E,O),y.constructor=H,y.render=OM),L&&L.sub(y),y.props=E,y.state||(y.state={}),y.context=O,y.__n=i,b=!0,y.__g|=8,y.__h=[],y._sb=[]),T&&y.__s==null&&(y.__s=y.state),T&&H.getDerivedStateFromProps!=null&&(y.__s==y.state&&(y.__s=_o({},y.__s)),_o(y.__s,H.getDerivedStateFromProps(E,y.__s))),S=y.props,w=y.state,y.__v=t,b)T&&H.getDerivedStateFromProps==null&&y.componentWillMount!=null&&y.componentWillMount(),T&&y.componentDidMount!=null&&y.__h.push(y.componentDidMount);else{if(T&&H.getDerivedStateFromProps==null&&E!==S&&y.componentWillReceiveProps!=null&&y.componentWillReceiveProps(E,O),!(4&y.__g)&&y.shouldComponentUpdate!=null&&y.shouldComponentUpdate(E,y.__s,O)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(y.props=E,y.state=y.__s,y.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),D=0;D<y._sb.length;D++)y.__h.push(y._sb[D]);y._sb=[],y.__h.length&&c.push(y);break e}y.componentWillUpdate!=null&&y.componentWillUpdate(E,y.__s,O),T&&y.componentDidUpdate!=null&&y.__h.push(function(){y.componentDidUpdate(S,w,A)})}if(y.context=O,y.props=E,y.__P=e,y.__g&=-5,N=ft.__r,W=0,T){for(y.state=y.__s,y.__g&=-9,N&&N(t),g=y.render(y.props,y.state,y.context),G=0;G<y._sb.length;G++)y.__h.push(y._sb[G]);y._sb=[]}else do y.__g&=-9,N&&N(t),g=y.render(y.props,y.state,y.context),y.state=y.__s;while(8&y.__g&&++W<25);y.state=y.__s,y.getChildContext!=null&&(i=_o({},i,y.getChildContext())),T&&!b&&y.getSnapshotBeforeUpdate!=null&&(A=y.getSnapshotBeforeUpdate(S,w)),se=g,g!=null&&g.type===xs&&g.key==null&&(se=_5(g.props.children)),d=y5(e,_f(se)?se:[se],t,n,i,a,s,c,d,f,h,m),t.__u&=-161,y.__h.length&&c.push(y),k&&(y.__g&=-4)}catch(z){if(t.__v=null,f||s!=null)if(z.then){for(ie=0,ee=!1,t.__u|=f?160:128,t.__c.__z=[],te=0;te<s.length;te++)(le=s[te])==null||ee||(le.nodeType==8&&le.data=="$s"?(ie>0&&t.__c.__z.push(le),ie++,s[te]=null):le.nodeType==8&&le.data=="/$s"?(--ie>0&&t.__c.__z.push(le),ee=ie===0,d=s[te],s[te]=null):ie>0&&(t.__c.__z.push(le),s[te]=null));if(!ee){for(;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;s[s.indexOf(d)]=null,t.__c.__z=[d]}t.__e=d}else{for(me=s.length;me--;)n0(s[me]);fg(t)}else t.__e=n.__e,t.__k=n.__k,z.then||fg(t);ft.__e(z,t,n)}else d=t.__e=MM(n.__e,t,n,i,a,s,c,f,h,m);return(g=ft.diffed)&&g(t),128&t.__u?void 0:d}function fg(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(fg)}function S5(e,t,n){for(var i=0;i<n.length;i++)r0(n[i],n[++i],n[++i]);ft.__c&&ft.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(s){s.call(a)})}catch(s){ft.__e(s,a.__v)}})}function _5(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:_f(e)?e.map(_5):_o({},e)}function MM(e,t,n,i,a,s,c,d,f,h){var m,g,y,b,S,w,A,k,E=n.props,T=t.props,L=t.type;if(L=="svg"?a="http://www.w3.org/2000/svg":L=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),s!=null){for(m=0;m<s.length;m++)if((S=s[m])&&"setAttribute"in S==!!L&&(L?S.localName==L:S.nodeType==3)){e=S,s[m]=null;break}}if(e==null){if(L==null)return h.createTextNode(T);e=h.createElementNS(a,L,T.is&&T),d&&(ft.__m&&ft.__m(t,s),d=!1),s=null}if(L==null)E===T||d&&e.data==T||(e.data=T);else{if(s=s&&t0.call(e.childNodes),E=n.props||Sc,!d&&s!=null)for(E={},m=0;m<e.attributes.length;m++)E[(S=e.attributes[m]).name]=S.value;for(m in E)if(S=E[m],m!="children"){if(m=="dangerouslySetInnerHTML")y=S;else if(!(m in T)){if(m=="value"&&"defaultValue"in T||m=="checked"&&"defaultChecked"in T)continue;fd(e,m,null,S,a)}}for(m in k=1&n.__u,T)S=T[m],m=="children"?b=S:m=="dangerouslySetInnerHTML"?g=S:m=="value"?w=S:m=="checked"?A=S:d&&typeof S!="function"||E[m]===S&&!k||fd(e,m,S,E[m],a);if(g)d||y&&(g.__html==y.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(y&&(e.innerHTML=""),y5(L=="template"?e.content:e,_f(b)?b:[b],t,n,i,L=="foreignObject"?"http://www.w3.org/1999/xhtml":a,s,c,s?s[0]:n.__k&&bs(n,0),d,f,h),s!=null)for(m=s.length;m--;)n0(s[m]);d||(m="value",L=="progress"&&w==null?e.removeAttribute("value"):w==null||w===e[m]&&(L!=="progress"||w)||fd(e,m,w,E[m],a),m="checked",A!=null&&A!=e[m]&&fd(e,m,A,E[m],a))}return e}function r0(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(a){ft.__e(a,n)}}function C5(e,t,n){var i,a;if(ft.unmount&&ft.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||r0(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){ft.__e(s,t)}i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&C5(i[a],t,n||typeof e.type!="function");n||n0(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function OM(e,t,n){return this.constructor(e,n)}function hg(e,t){var n,i,a,s;t==document&&(t=document.documentElement),ft.__&&ft.__(e,t),i=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=dg(xs,null,[e]),a=[],s=[],i0(t,e,i||Sc,Sc,t.namespaceURI,i?null:t.firstChild?t0.call(t.childNodes):null,a,i?i.__e:t.firstChild,n,s,t.ownerDocument),S5(a,e,s)}function PM(e,t){e.__u|=32,hg(e,t)}ft={__e:function(e,t,n,i){for(var a,s,c;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=a.constructor)&&s.getDerivedStateFromError!=null&&(a.setState(s.getDerivedStateFromError(e)),c=8&a.__g),a.componentDidCatch!=null&&(a.componentDidCatch(e,i||{}),c=8&a.__g),c)return void(a.__g|=2)}catch(d){e=d}}throw Zd=0,e}},h5=0,xd.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=_o({},this.state),typeof e=="function"&&(e=e(_o({},n),this.props)),e&&_o(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),a_(this))},xd.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),a_(this))},xd.prototype.render=xs,ea=[],Zd=0,p5=function(e,t){return e.__v.__b-t.__v.__b},m5=/(PointerCapture)$|Capture$/i,e0=0,cg=l_(!1),ug=l_(!0);var NM=0;function pe(e,t,n,i,a,s){t||(t={});var c,d,f=t;if("ref"in f&&typeof e!="function")for(d in f={},t)d=="ref"?c=t[d]:f[d]=t[d];var h={type:e,props:f,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--NM,__i:-1,__u:0,__source:a,__self:s};return ft.vnode&&ft.vnode(h),h}const HM=16,zM=16,VM={};function ec({name:e,remappedFrom:t,token:n,width:i,height:a,viewBox:s,label:c,alignCapitals:d=!1}){"use no memo";const f=`#${e.replace(/^#/,"")}`,{width:h,height:m,viewBox:g}=VM[e]??{width:HM,height:zM},y=i??h,b=a??m,S=s??g??`0 0 ${h} ${m}`;return pe("svg",{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":d,...c!=null?{"aria-label":c,role:"img"}:{"aria-hidden":!0},viewBox:S,width:y,height:b,children:pe("use",{href:f})})}const c_=e=>e!==void 0&&/\s/.test(e),BM=(e,t)=>{const n=i=>c_(e[i-1])||c_(e[i]);if(!n(t))return t;for(let i=1;i<e.length;i++){const a=t-i;if(a>0&&!n(a))return a;const s=t+i;if(s<e.length&&!n(s))return s}return t},E5=e=>BM(e,Math.ceil(e.length/2)),u_=e=>{if(e.length<2)return[e,""];const t=E5(e);return[e.slice(0,t),e.slice(t)]},UM=e=>{if(e.length<4)return[e,""];const t=e.lastIndexOf(".")+1,n=e.length-t>10,i=t>=1&&!n?t:E5(e);return[e.slice(0,i),e.slice(i)]},FM=e=>{if(e.length<4)return[e,""];const t=e.lastIndexOf("/")+1,n=e.length-t>25,i=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]},jM=(e,{splitIndex:t}={})=>{if(typeof t!="number"){const n=Math.ceil(e.length/2);return[e.slice(0,n),e.slice(n)]}return[e.slice(0,t),e.slice(t)]},$M=(e,{splitOffset:t}={})=>{if(typeof t!="number"||t<=0||t>=e.length){const i=Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]}const n=e.length-t;return[e.slice(0,n),e.slice(n)]},qM=(e,{splitOffset:t}={})=>{if(typeof t!="number"||t<=0||t>=e.length){const i=Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]}const n=t;return[e.slice(0,n),e.slice(n)]};function GM({children:e,marker:t,variant:n="default"}){"use no memo";return pe("div",{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:pe("div",{"data-truncate-marker":!0,children:typeof t=="function"?t({children:e}):n==="fade"?pe("span",{"data-truncate-fade":!0}):t})})}function WM(e){"use no memo";const{mode:t,children:n}=e;return pe("div",{children:[pe("div",{"data-truncate-content":"visible",children:t==="fruncate"?pe("span",{children:n}):n}),pe("div",{"data-truncate-content":"overflow","aria-hidden":!0,children:t==="fruncate"?pe("span",{children:n}):n})]})}function w5({children:e,mode:t="truncate",marker:n="…",variant:i="default",...a}){"use no memo";const s=pe(WM,{mode:t,children:e},"content"),c=pe(GM,{marker:n,mode:t,variant:i},"marker");return pe("div",{"data-truncate-container":t,"data-truncate-variant":i,...a,children:pe("div",{"data-truncate-grid":!0,children:t==="truncate"?[s,c]:[c,s,pe("div",{"data-truncate-fill":!0},"fill")]})})}function Td({children:e,...t}){"use no memo";return pe(w5,{mode:"truncate",...t,children:e})}function pm({children:e,...t}){"use no memo";return pe(w5,{mode:"fruncate",...t,children:e})}function KM({children:e,contents:t,priority:n="end",split:i="center",minimumLength:a=12,className:s,style:c,...d}){"use no memo";let f=null,h=null;if(Array.isArray(t)){if(t.length!==2)return console.error("MiddleTruncate: contents must be an array of two items"),null;f=pe(Td,{...d,children:t[0]}),h=pe(pm,{...d,children:t[1]})}else{if(typeof e!="string")return console.error("MiddleTruncate: children must be a string"),null;if(e.length===0)return pe("div",{className:s,style:c});if(e.length<a)return n==="end"?pe(pm,{...d,className:s,style:c,children:e}):pe(Td,{...d,className:s,style:c,children:e});let m=null,g=null,y=null;if(typeof i=="string")i==="center"?m=u_:i==="extension"?m=UM:i==="leaf-path"&&(m=FM);else if(typeof i=="number")m=jM,g=i;else if(Array.isArray(i)){const[L,O]=i;y=O,L==="last"?m=$M:L==="first"&&(m=qM)}else typeof i=="function"&&(m=i);m??=u_;const[b,S]=m(e,{priority:n,variant:d.variant,splitIndex:typeof g=="number"?g:void 0,splitOffset:typeof y=="number"?y:void 0}),w=b.length>=S.length,A=n==="equal"&&!w,k=n==="equal"&&w,E={},T={};A&&(E.marker=""),k&&(T.marker=""),f=pe(Td,{...d,...E,children:b}),h=pe(pm,{...d,...T,children:S})}return pe("div",{"data-truncate-group-container":"middle",className:s,style:c,children:[pe("div",{"data-truncate-segment-priority":n==="start"||n==="equal"?"1":"2",children:f}),pe("div",{"data-truncate-segment-priority":n==="end"||n==="equal"?"1":"2",children:h})]})}const pg={endIndex:-1,startIndex:-1};function YM(e,t,n){return Math.min(Math.max(e,t),n)}function d_(e,t){return e<0||t<e?pg:{endIndex:t,startIndex:e}}function mg(e){return e.startIndex<0||e.endIndex<e.startIndex}function XM(e,t){return mg(e)?0:(e.endIndex-e.startIndex+1)*t}function f_(e,t,n){if(t<=0)return-1;const i=t*n;return e<=0?0:e>=i?t:Math.floor(e/n)}function QM(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function ZM(e){const t=new Map;return e.forEach((n,i)=>{if(n.kind!=="directory"||!n.isExpanded)return;const a=n.ancestorPaths.length,s=t.get(a);if(s==null){t.set(a,[i]);return}s.push(i)}),t}function JM(e,t){let n=0,i=e.length-1,a=-1;for(;n<=i;){const s=Math.floor((n+i)/2),c=e[s];if(c==null)break;if(c<=t){a=s,n=s+1;continue}i=s-1}return a}function eO(e){const t=new Map,n=[];for(let a=0;a<e.length;a+=1){const s=e[a];if(s==null)continue;const c=s.kind==="directory"&&s.isExpanded?[...s.ancestorPaths,s.path]:s.ancestorPaths;let d=0;for(;d<n.length&&d<c.length&&n[d]===c[d];)d+=1;for(let f=n.length-1;f>=d;f-=1){const h=n[f];h!=null&&t.set(h,a-1)}n.length=d;for(let f=d;f<c.length;f+=1){const h=c[f];h!=null&&n.push(h)}}const i=e.length-1;for(const a of n)t.set(a,i);return t}function x5(e,t,n){if(e.length===0||t<=0)return[];const i=eO(e),a=ZM(e),s=[];for(let c=0;c<e.length;c+=1){const d=a.get(c);if(d==null||d.length===0)break;const f=t+c*n;let h=JM(d,Math.min(e.length-1,Math.floor(f/n))),m=null;for(;h>=0;){const g=d[h],y=g==null?null:e[g]??null;if(y!=null&&(c===0||y.ancestorPaths[c-1]===s[c-1]?.path)){m=y;break}h-=1}if(m==null)break;s.push(m)}return s.map((c,d)=>{const f=d*n,h=(i.get(c.path)??e.length-1)+1;if(h>=e.length)return{row:c,top:f};const m=h*n-t;return{row:c,top:Math.min(f,m-n)}}).filter(c=>c.top+n>0)}function tO(e,t){const n=t.totalRowCount??e.length,i=n*t.itemHeight,a=Math.max(0,t.viewportHeight),s=Math.max(0,Math.floor(t.overscan)),c=Math.max(0,i-a),d=YM(t.scrollTop,0,c),f=t.stickyRows??x5(e,d,t.itemHeight),h=f.reduce((D,N)=>Math.max(D,N.top+t.itemHeight),0),m=Math.min(i,d+h),g=Math.max(0,a-h),y=Math.max(0,i-m),b=f_(d,n,t.itemHeight),S=f_(m,n,t.itemHeight),w=h<=0||b<0||b>=n?-1:b,A=w===-1?-1:Math.min(n-1,S-1),k=w===-1||A<w?0:A-w+1,E=g<=0||S>=n?pg:d_(S,QM(m+g,n,t.itemHeight)),T=A+1,L=mg(E)?pg:d_(Math.max(T,E.startIndex-s),Math.min(n-1,E.endIndex+s)),O=XM(L,t.itemHeight);return{occlusion:{firstOccludedIndex:w,lastOccludedIndex:A,occludedCount:k},physical:{itemHeight:t.itemHeight,maxScrollTop:c,overscan:s,scrollTop:d,totalHeight:i,totalRowCount:n,viewportHeight:a},projected:{contentHeight:y,paneHeight:g,paneTop:m},sticky:{height:h,rows:f},visible:E,window:{endIndex:L.endIndex,height:O,offsetTop:mg(L)?0:L.startIndex*t.itemHeight,startIndex:L.startIndex}}}const nO={added:"A",deleted:"D",ignored:null,modified:"M",renamed:"R",untracked:"U"},iO={added:"Git status: added",deleted:"Git status: deleted",ignored:"Git status: ignored",modified:"Git status: modified",renamed:"Git status: renamed",untracked:"Git status: untracked"},rO="Contains git status items";function oO(e){return e.current?!0:(e.current=!0,!1)}function T5(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,topInset:a=0,viewportHeight:s}=e;if(n<0)return null;const c=Math.max(0,a),d=n*i,f=d+i;if(d<t+c){const h=Math.max(0,d-c);return h===t?null:h}if(f>t+s){const h=f-s;return h===t?null:h}return null}function aO(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,offset:a,topInset:s=0,totalHeight:c,viewportHeight:d}=e;if(a==="nearest")return T5({currentScrollTop:t,focusedIndex:n,itemHeight:i,topInset:s,viewportHeight:d});if(n<0)return null;const f=Math.max(0,s),h=n*i,m=Math.max(0,d-f),g=a==="center"?f+Math.max(0,(m-i)/2):f,y=Math.max(0,c-d),b=Math.max(0,Math.min(h-g,y));return b===t?null:b}function sO(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,targetViewportOffset:a,totalHeight:s,viewportHeight:c}=e;if(n<0)return null;const d=Math.max(0,a),f=n*i,h=f+i,m=t+d,g=t+c;if(f>=m&&h<=g)return null;const y=Math.max(0,s-c),b=Math.max(0,Math.min(f-d,y));return b===t?null:b}function cs(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});const t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function hd(e){const t=e.getRootNode();if(t instanceof ShadowRoot){const i=t.activeElement;return i instanceof HTMLElement?i:null}const n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function Hl(e,t){if(e==null)return t;const n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function h_(e,t){return e!=null&&e>0?e:t}function lO(e){const t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function p_(e,t,n,i,a=0){const s=T5({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:a,viewportHeight:i});return s==null?!1:(e.scrollTop=s,!0)}function cO(e,t,n,i,a,s,c=0){const d=aO({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:s,topInset:c,totalHeight:a,viewportHeight:i});return d==null?!1:(e.scrollTop=d,!0)}function zl(e,t,n,i,a,s){const c=sO({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:s,totalHeight:a,viewportHeight:i});return c==null?!1:(e.scrollTop=c,!0)}function m_(e,t,n,i){return n.end<n.start?null:e<n.start?-t:e>n.end?i:null}function uO(e){const{renamingPath:t,previousRenamingPath:n,hasRenderedInput:i}=e;return t==null?"reset":i?n===t?"ignore":"focus-input":"reveal-canonical"}function dO({ariaLabel:e,isFlattened:t=!1,ref:n,value:i,onBlur:a,onInput:s}){return pe("input",{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:i,onBlur:a,onInput:s,onClick:c=>c.stopPropagation(),onMouseDown:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation()})}function fO(e){const{row:t,mode:n,targetPath:i,ariaLabel:a,domId:s,isParked:c,itemHeight:d,features:f,state:h,extraStyle:m}=e,g=n==="sticky",y=t.ancestorPaths.at(-1)??"",b={};return h.isFocusRinged&&(b["data-item-focused"]=!0),t.isSelected&&(b["data-item-selected"]=!0),h.isContextHovered&&(b["data-item-context-hover"]="true"),h.isDragTarget&&(b["data-item-drag-target"]=!0),h.isDragging&&(b["data-item-dragging"]=!0),h.effectiveGitStatus!=null&&(b["data-item-git-status"]=h.effectiveGitStatus),h.containsGitChange&&(b["data-item-contains-git-change"]="true"),{"aria-expanded":!g&&t.kind==="directory"?t.isExpanded:void 0,"aria-haspopup":f.contextMenuEnabled?"menu":void 0,"aria-label":a,"aria-level":g?void 0:t.level+1,"aria-posinset":g?void 0:t.posInSet+1,"aria-selected":g?void 0:t.isSelected?"true":"false","aria-setsize":g?void 0:t.setSize,"data-file-tree-sticky-path":g?i:void 0,"data-file-tree-sticky-row":g?"true":void 0,"data-item-context-menu-button-visibility":f.actionLaneEnabled?f.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":f.contextMenuEnabled?f.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":f.actionLaneEnabled?"true":void 0,"data-item-has-git-lane":f.gitLaneActive?"true":void 0,"data-item-parent-path":y.length>0?y:void 0,"data-item-parked":c?"true":void 0,"data-item-path":i,"data-item-type":t.kind==="directory"?"folder":"file","data-type":"item",id:g?void 0:s,role:g?void 0:"treeitem",style:{minHeight:`${d}px`,...m},tabIndex:!g&&t.isFocused?0:-1,...b}}function hO(e){const{event:t,mode:n,isSearchOpen:i,isDirectory:a}=e,s=t.ctrlKey||t.metaKey,c=t.shiftKey||s,d=t.shiftKey?{additive:s,kind:"range"}:s?{kind:"toggle"}:{kind:"single"};return{closeSearch:i,revealCanonical:n==="sticky",selection:d,toggleDirectory:!c&&a}}var Ss,Lt,mm,g_,gg=Object.is,_c=0,k5=[],Ot=ft,v_=Ot.__b,y_=Ot.__r,b_=Ot.diffed,S_=Ot.__c,__=Ot.unmount,C_=Ot.__;function Cf(e,t){Ot.__h&&Ot.__h(Lt,e,_c||t),_c=0;var n=Lt.__H||(Lt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Vi(e){return _c=1,pO(A5,e)}function pO(e,t,n){var i=Cf(Ss++,2);if(i.t=e,!i.__c&&(i.__=[A5(void 0,t),function(d){var f=i.__N?i.__N[0]:i.__[0],h=i.t(f,d);gg(f,h)||(i.__N=[h,i.__[1]],i.__c.setState({}))}],i.__c=Lt,!Lt.__f)){var a=function(d,f,h){if(!i.__c.__H)return!0;var m=i.__c.__H.__.filter(function(y){return!!y.__c});if(m.every(function(y){return!y.__N}))return!s||s.call(this,d,f,h);var g=i.__c.props!==d;return m.forEach(function(y){if(y.__N){var b=y.__[0];y.__=y.__N,y.__N=void 0,gg(b,y.__[0])||(g=!0)}}),s&&s.call(this,d,f,h)||g};Lt.__f=!0;var s=Lt.shouldComponentUpdate,c=Lt.componentWillUpdate;Lt.componentWillUpdate=function(d,f,h){if(4&this.__g){var m=s;s=void 0,a(d,f,h),s=m}c&&c.call(this,d,f,h)},Lt.shouldComponentUpdate=a}return i.__N||i.__}function E_(e,t){var n=Cf(Ss++,3);!Ot.__s&&o0(n.__H,t)&&(n.__=e,n.u=t,Lt.__H.__h.push(n))}function Gn(e,t){var n=Cf(Ss++,4);!Ot.__s&&o0(n.__H,t)&&(n.__=e,n.u=t,Lt.__h.push(n))}function Re(e){return _c=5,mo(function(){return{current:e}},[])}function mo(e,t){var n=Cf(Ss++,7);return o0(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function pn(e,t){return _c=8,mo(function(){return e},t)}function mO(){for(var e;e=k5.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kd),e.__H.__h.forEach(vg),e.__H.__h=[]}catch(t){e.__H.__h=[],Ot.__e(t,e.__v)}}Ot.__b=function(e){Lt=null,v_&&v_(e)},Ot.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),C_&&C_(e,t)},Ot.__r=function(e){y_&&y_(e),Ss=0;var t=(Lt=e.__c).__H;t&&(mm===Lt?(t.__h=[],Lt.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(kd),t.__h.forEach(vg),t.__h=[],Ss=0)),mm=Lt},Ot.diffed=function(e){b_&&b_(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(k5.push(t)!==1&&g_===Ot.requestAnimationFrame||((g_=Ot.requestAnimationFrame)||gO)(mO)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),mm=Lt=null},Ot.__c=function(e,t){t.some(function(n){try{n.__h.forEach(kd),n.__h=n.__h.filter(function(i){return!i.__||vg(i)})}catch(i){t.some(function(a){a.__h&&(a.__h=[])}),t=[],Ot.__e(i,n.__v)}}),S_&&S_(e,t)},Ot.unmount=function(e){__&&__(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{kd(i)}catch(a){t=a}}),n.__H=void 0,t&&Ot.__e(t,n.__v))};var w_=typeof requestAnimationFrame=="function";function gO(e){var t,n=function(){clearTimeout(i),w_&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);w_&&(t=requestAnimationFrame(n))}function kd(e){var t=Lt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Lt=t}function vg(e){var t=Lt;e.__c=e.__(),Lt=t}function o0(e,t){return!e||e.length!==t.length||t.some(function(n,i){return!gg(n,e[i])})}function A5(e,t){return typeof t=="function"?t(e):t}function vO(e,t=null,n=null){"use no memo";const i=e.flattenedSegments;return i==null||i.length===0?t??e.name:pe("span",{"data-item-flattened-subitems":!0,children:i.map((a,s)=>{const c=s===i.length-1;return pe(xs,{children:[pe("span",{"data-item-flattened-subitem":a.path,"data-item-flattened-subitem-drag-target":n===a.path?"true":void 0,children:c&&t!=null?t:pe(Td,{children:a.name})}),s<i.length-1?" / ":""]},a.path)})})}function gs(e){return e.isFlattened?e.flattenedSegments?.findLast(t=>t.isTerminal)?.path??e.path:e.path}function yg(e){const t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(n=>n.name).join(" / ")}function x_(e,t,n,i){return e.map((a,s)=>{const c=s*n,d=a.subtreeEndIndex+1;if(d>=i)return{row:a.row,top:c};const f=d*n-t;return{row:a.row,top:Math.min(c,f-n)}}).filter(a=>a.top+n>0)}function gm({controller:e,itemHeight:t,overscan:n,scrollTop:i,stickyFolders:a,viewportHeight:s}){const c=e.getVisibleCount(),d=a&&c>0?e.getStickyRowCandidates(i,t):[],f=d==null&&a&&c>0?e.getVisibleRows(0,c-1):[],h=tO(f,{itemHeight:t,overscan:n,scrollTop:i,stickyRows:d==null?void 0:x_(d,i,t,c),totalRowCount:c,viewportHeight:s}),m=a&&i<=0&&c>0?e.getStickyRowCandidates(1,t):[],g=m!=null&&i<=0?x_(m,1,t,c):a&&i<=0&&f.length>0?x5(f,1,t):h.sticky.rows;return{overlayHeight:g.reduce((y,b)=>Math.max(y,b.top+t),0),overlayRows:g,snapshot:h,visibleRows:f}}const yO=400,T_=10,as=40,k_=18;function bO(e,t,n){const i=e,a=document.elementFromPoint?.bind(document)??null,s=i.elementFromPoint?.(t,n)??a?.(t,n)??null;return e instanceof ShadowRoot&&(s==null||!e.contains(s))?SO(e,t,n):s instanceof HTMLElement?s:null}function SO(e,t,n){const i=Array.from(e.querySelectorAll('[data-type="item"], [data-item-flattened-subitem]'));for(let a=i.length-1;a>=0;a--){const s=i[a],c=s.getBoundingClientRect();if(t>=c.left&&t<=c.right&&n>=c.top&&n<=c.bottom)return s}return null}function A_(e){const t=e?.closest?.('[data-type="item"]');if(!(t instanceof HTMLElement))return null;const n=t.dataset.itemPath??null;if(n==null)return null;const i=e?.closest?.("[data-item-flattened-subitem]"),a=i instanceof HTMLElement?i.getAttribute("data-item-flattened-subitem")??null:null;if(a!=null&&a.endsWith("/"))return{directoryPath:a,flattenedSegmentPath:a,hoveredPath:n,kind:"directory"};if(t.dataset.itemType==="folder")return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:"directory"};const s=t.dataset.itemParentPath??null;return s==null||s.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:"root"}:{directoryPath:s,flattenedSegmentPath:null,hoveredPath:n,kind:"directory"}}function L_(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t.dataset.fileTreeDragPreview="true",t.setAttribute("aria-hidden","true"),t.tabIndex=-1,Object.assign(t.style,{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",left:"0px",margin:"0",pointerEvents:"none",position:"fixed",top:"0px",willChange:"transform",zIndex:"10000"}),t}function _O(){return navigator.vendor!=="Apple Computer, Inc."}function CO(e,t){const n=e-t.top;if(n<as)return-Math.ceil((as-Math.max(0,n))/as*k_);const i=t.bottom-e;return i<as?Math.ceil((as-Math.max(0,i))/as*k_):0}function EO(e,t){if(e!=null){const n=nO[e];return n==null?null:{text:n,title:iO[e]}}return t?{icon:{name:"file-tree-icon-dot",width:6,height:6},title:rO}:null}function wO(e,t,n){if(t==null||t.size===0)return null;const i=[];for(let a=e.length-1;a>=0;a-=1){const s=e[a],c=n.get(s);if(c!=null){for(const d of i)n.set(d,c);return c?"ignored":null}if(t.has(s)){n.set(s,!0);for(const d of i)n.set(d,!0);return"ignored"}i.push(s)}for(const a of i)n.set(a,!1);return null}function I_(e){return e!=null&&"toggle"in e}function L5(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function xO(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function TO(e){return e==null?"":`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"] { opacity: 1; }`}function I5(e){return e.shiftKey&&e.key==="F10"||e.key==="ContextMenu"}function kO(e,t){return t&&I5(e)||(e.ctrlKey||e.metaKey)&&L5(e)?!0:e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight"||e.key==="ArrowUp"}const AO=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp"]);function R_(e){for(const t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot==="true"||t.dataset.type==="context-menu-anchor"||t.dataset.type==="context-menu-trigger"||t.getAttribute("slot")==="context-menu"))return!0;return!1}function LO(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function IO(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function RO(e,t){if(e==null)return t.offsetTop;const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return n.top-i.top}function D_(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function M_(e,t,n){if(e==null)return null;const i=t.get(e)??null;if(i!=null)return i;const a=n.get(e)??null;return a?.dataset.itemParked==="true"?null:a}function DO(e){if(e==null)return[];const t=[];for(const n of e.querySelectorAll('button[data-file-tree-sticky-row="true"]')){if(!(n instanceof HTMLElement))continue;const i=n.dataset.fileTreeStickyPath;i!=null&&t.push(i)}return t}function MO(e,t){if(e==null||t==null)return null;for(const n of e.querySelectorAll('button[data-item-focused="true"][data-item-parked="true"]'))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function OO(e,t,n,i,a,s,c){const d=Math.max(0,s-a),f=t?.getBoundingClientRect()??null,h=f==null||n==null?null:n.getBoundingClientRect().top-f.top,m=MO(e,i),g=f==null||m==null?null:m.getBoundingClientRect().top-f.top;return Math.max(0,Math.min(g??Math.max(h??0,d),Math.max(0,c-a)))}function O_(e,t){return{kind:e.kind,name:yg(e),path:t}}function PO(e){return e==null?void 0:`${e}__tree`}function R5(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?"__parked":""}`}function P_(e){return e==="file-tree-icon-chevron"||e==="file-tree-icon-dot"||e==="file-tree-icon-file"||e==="file-tree-icon-lock"}function N_(e,t){if(e==null)return null;if("text"in e)return pe("span",{title:e.title,children:e.text});const n=typeof e.icon=="string"?P_(e.icon)?t(e.icon):{name:e.icon}:P_(e.icon.name)?(()=>{const i=t(e.icon.name),{name:a,...s}=e.icon;return{...i,...s}})():e.icon;return pe("span",{title:e.title,children:pe(ec,{...n})})}function H_(e){e!=null&&cs(e.querySelector(["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "))??e)}function NO(e,t,{actionLaneEnabled:n=!1,customDecoration:i=null,decorationLaneEnabled:a=!1,dragTargetFlattenedSegmentPath:s=null,gitDecoration:c=null,gitLaneActive:d=!1,renameInput:f=null,showDecorativeActionAffordance:h=!1}={}){const m=gs(e);return pe(xs,{children:[e.depth>0?pe("div",{"data-item-section":"spacing",children:Array.from({length:e.depth}).map((g,y)=>pe("div",{"data-item-section":"spacing-item","data-ancestor-path":e.ancestorPaths[y]},y))}):null,pe("div",{"data-item-section":"icon",children:e.kind==="directory"?pe(ec,{...t("file-tree-icon-chevron")}):pe(ec,{...t("file-tree-icon-file",m)})}),pe("div",{"data-item-section":"content",children:e.isFlattened?vO(e,f,s):f??pe(KM,{minimumLength:5,split:"extension",children:e.name})}),a?pe("div",{"data-item-section":"decoration",children:i!=null?N_(i,t):null}):null,d?pe("div",{"data-item-section":"git",children:N_(c,t)}):null,n?pe("div",{"data-item-section":"action",children:h?pe("span",{"aria-hidden":"true","data-item-action-affordance":"decorative",children:pe(ec,{...t("file-tree-icon-ellipsis")})}):null}):null]})}function Ad(e,t,n,i={}){const{controller:a,renameView:s,visualFocusPath:c,contextHoverPath:d,draggedPathSet:f,dragTarget:h,dragAndDropEnabled:m,shouldSuppressContextMenu:g,handleRowDragStart:y,handleRowDragEnd:b,handleRowTouchStart:S,instanceId:w,itemHeight:A,gitStatusByPath:k,ignoredGitDirectories:E,ignoredInheritanceCache:T,directoriesWithGitChanges:L,gitLaneActive:O,contextMenuEnabled:D,contextMenuTriggerMode:N,contextMenuButtonTriggerEnabled:W,contextMenuButtonVisibility:G,contextMenuRightClickEnabled:se,registerRenameInput:ie,registerButton:ee,resolveIcon:te,renderDecorationForRow:le,openContextMenuForRow:me,onRowClick:H,onKeyDown:z}=e,Q=gs(t),{isParked:ce=!1,mode:_e="flow",style:M}=i,q=_e==="sticky",re=k?.get(Q)??null??wO(t.ancestorPaths,E,T),ae=t.kind==="directory"&&(L?.has(Q)??!1),he=le(t,Q),Se=EO(re,ae),be=D&&W,Ue=he!=null||O||be,Ce=be&&G==="always",He=s.getPath()===Q,We=He?s.getValue():"",lt=q||!He?null:pe(dO,{ref:ie,ariaLabel:`Rename ${yg(t)}`,isFlattened:t.isFlattened,value:We,onBlur:()=>{s.commit()},onInput:Le=>{s.setValue(Le.currentTarget.value)}}),ne=NO(t,te,{actionLaneEnabled:be,customDecoration:he,decorationLaneEnabled:Ue,dragTargetFlattenedSegmentPath:h?.flattenedSegmentPath??null,gitDecoration:Se,gitLaneActive:O,renameInput:lt,showDecorativeActionAffordance:Ce}),de={...fO({ariaLabel:yg(t),domId:t.isFocused?R5(w,Q,ce):void 0,extraStyle:M,features:{actionLaneEnabled:be,contextMenuButtonVisibility:be?G:null,contextMenuEnabled:D,contextMenuTriggerMode:D?N:null,gitLaneActive:O},isParked:ce,itemHeight:A,mode:_e,row:t,state:{containsGitChange:ae,effectiveGitStatus:re,isContextHovered:d===Q,isDragTarget:h?.kind==="directory"&&h.directoryPath===Q,isDragging:f?.has(Q)===!0,isFocusRinged:t.isFocused&&c===Q},targetPath:Q}),key:n,onContextMenu:D||m?Le=>{if(g()){Le.preventDefault();return}D&&(Le.preventDefault(),se&&(a.focusMountedPathFromInput(Q),me(t,Q,{anchorRect:IO(Le.clientX,Le.clientY),source:"right-click"})))}:void 0,onFocus:q?void 0:()=>{a.focusMountedPathFromInput(Q)},onKeyDown:q?void 0:z,ref:Le=>{ee(Q,Le)}};return!q&&He?pe("div",{...de,children:ne}):pe("button",{...de,type:"button",draggable:m&&!ce,onDragEnd:m&&!ce?b:void 0,onDragStart:m&&!ce?Le=>{y(Le,t,Q)}:void 0,onMouseDown:Le=>{if(q){Le.preventDefault();return}a.isSearchOpen()&&Le.preventDefault()},onTouchStart:m&&!ce?Le=>{S(Le,t,Q)}:void 0,onClick:Le=>{H(Le,t,Q,_e)},children:ne})}function HO(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(i=>!n.has(gs(i))).map((i,a)=>Ad(e,i,t.start+a))}function z_({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:i,directoriesWithGitChanges:a,icons:s,instanceId:c,itemHeight:d=r5,overscan:f=10,renamingEnabled:h=!1,renderRowDecoration:m,searchBlurBehavior:g="close",searchEnabled:y=!1,searchFakeFocus:b=!1,slotHost:S,stickyFolders:w=!1,initialViewportHeight:A=420}){"use no memo";const k=Re(null),E=Re(null),T=Re(!1),L=Re(null),O=Re(null),D=Re(null),N=Re(null),W=Re(null),G=Re(new Map),se=Re(new Map),ie=Re(()=>{}),ee=Re(null),te=Re(0),le=Re(!1),me=Re(null);me.current!==t&&(le.current=!1,me.current=t);const H=Re(!1),z=Re(null),Q=Re(null),ce=Re(!1),_e=Re(null),M=Re(null),q=Re(null),re=Re(null),ae=Re(null),he=Re(null),Se=Re(null),be=Re(null),Ue=Re(!1),Ce=Re(null),He=Re(null),We=Re(null),lt=Re(null),ne=mo(()=>new Map,[]),[,de]=Vi(0),Le=Re(!1),[Ve,Tt]=Vi(null),[vn,yn]=Vi(null),[Qn,Ki]=Vi(null),[Ef,Yi]=Vi(null),[bn,wf]=Vi(0),[Ze,ha]=Vi(null),Ai=Re(Ze);Ai.current=Ze;const pa=Re(null),Lr=Re(null),Co=Re(null),Eo=Re(null),Ir=Re(null),Wt=Re(!1),Li=()=>{Lr.current=null,Co.current=null,Eo.current=null},tn=(I,Z)=>{Lr.current=I,Co.current=null,Eo.current=Z==null?null:{path:I,scrollTop:Z}},xf=(I,Z)=>{Lr.current=null,Co.current={path:I,viewportOffset:Z},Eo.current=null},Ac=Re(g==="retain"&&t.isSearchOpen()),[Tf,wo]=Vi(b);E_(()=>{b||wo(!1)},[b]);const xo=Re(!1),Rr=pn(()=>{xo.current=!0,wo(I=>I&&!1)},[]),[Xi,ma]=Vi(()=>gm({controller:t,itemHeight:d,overscan:f,scrollTop:0,stickyFolders:w,viewportHeight:A})),[To,kf]=Vi(!1);E_(()=>{kf(!0)},[]);const nn=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ii=e?.contextMenu?.triggerMode??(nn?"right-click":"both"),Zn=Ii==="both"||Ii==="button",Lc=e?.contextMenu?.buttonVisibility??"when-needed",Ic=Ii==="both"||Ii==="right-click";Gn(()=>{const I=D.current;if(I==null)return;const Z=ue=>{if(!(ue instanceof CustomEvent))return;const fe=ue.detail?.path??null;Ir.current=fe,yn(fe),Yi(fe==null?null:"pointer")},Ee=ue=>{ue instanceof CustomEvent&&(Wt.current=ue.detail?.disabled===!0)};return I.addEventListener("file-tree-debug-set-context-menu-trigger",Z),I.addEventListener("file-tree-debug-set-scroll-suppression",Ee),()=>{I.removeEventListener("file-tree-debug-set-context-menu-trigger",Z),I.removeEventListener("file-tree-debug-set-scroll-suppression",Ee)}},[]);const Rc=pn((I,Z)=>{D_(G.current,I,Z)},[]),Dc=pn((I,Z)=>{D_(se.current,I,Z)},[]),Ts=pn(I=>{O.current=I},[]),Qi=pn(I=>M_(I,se.current,G.current),[]),ks=n!=null||i!=null||a!=null,{resolveIcon:As}=mo(()=>c7(s),[s]),Tn=t[s5](),Ct=Tn.getPath(),Kt=Ct!=null,rn=t.isSearchOpen(),Ls=t.getSearchValue(),Be=t.getFocusedPath(),et=t.getFocusedIndex(),Ri=t.getScrollRequest(),Sn=t.isDragAndDropEnabled(),Zi=t.getDragSession(),Dr=mo(()=>Zi==null?null:new Set(Zi.draggedPaths),[Zi]),Mr=Zi?.target??null,mi=Zi?.primaryPath??null,Ji=PO(c),{overlayHeight:Pt,overlayRows:Mc,snapshot:It,visibleRows:Jn}=Xi,Et=It.physical.viewportHeight,Nn=mo(()=>({end:It.window.endIndex,start:It.window.startIndex}),[It.window.endIndex,It.window.startIndex]),Or=Mc,Is=It.sticky.rows,er=It.physical.totalHeight,gi=It.sticky.height,tr=mo(()=>new Set(Is.map(I=>gs(I.row))),[Is]),Hn=et>=0&&et>=Nn.start&&et<=Nn.end,kn=pn((I,Z)=>m?.({item:O_(I,Z),row:I})??null,[m]),Rs=pn(I=>cs(I==null?null:G.current.get(I)??null)?!0:cs(D.current),[]),ga=pn(I=>{Rs(t.focusNearestPath(I))},[t,Rs]),va=Re(ga);va.current=ga;const nr=Re(!0),Pr=Re(()=>{}),An=pn((I=!0)=>{const Z=Ai.current;Z!=null&&(nr.current=nr.current&&I,ha(null),e?.contextMenu?.onClose?.(),nr.current&&ga(Z.path))},[e?.contextMenu,ga]);Pr.current=An;const Yt=pn(I=>{const Z=I==null?null:RO(D.current,I);Ki(Ee=>Ee===Z?Ee:Z)},[]),ya=pn((I,Z,Ee)=>{const ue=t.getItem(Z);if(ue==null)return;const fe=Qi(Z);if(fe?.dataset.fileTreeStickyRow==="true"){const Ae=N.current;tn(Z,Ae?.scrollTop??null),H.current=!0,Tt(ct=>ct===Z?ct:Z)}ue.focus(),Yt(fe),nr.current=!0,ha({anchorRect:Ee?.anchorRect??null,item:O_(I,Z),path:Z,source:Ee?.source??"keyboard"})},[t,Qi,Yt]),Oc=pn(I=>{if(h){if(t.isSearchOpen()){const Z=N.current,Ee=Hl(Z,Et);_e.current=et<0||Z==null?null:Math.max(0,Math.min(et*d-Z.scrollTop,Math.max(0,Ee-d))),ce.current=!0}t.startRenaming(I)!==!1&&(Yi("focus"),de(Z=>Z+1))}},[t,et,d,h,Et]),Nr=pn((I,{restoreTreeFocus:Z=!0,targetOffset:Ee="live-overlay"}={})=>{const ue=N.current;if(ue==null)return!1;t.focusPath(I);const fe=t.getFocusedIndex();if(fe<0)return!1;const Ae=t.getVisibleRows(fe,fe)[0]??null;if(Ae==null)return!1;const ct=Hl(ue,Et),ke=t.getVisibleCount()*d,Je=Ee==="sticky-parents"?Ae.ancestorPaths.length*d:gm({controller:t,itemHeight:d,overscan:f,scrollTop:ue.scrollTop,stickyFolders:w,viewportHeight:ct}).snapshot.sticky.height;return H.current=!0,zl(ue,fe,d,ct,ke,Je),ie.current(),pa.current=Z?I:null,!0},[t,d,f,Et,w]),Hr=()=>T.current===!0||lt.current!=null||Ue.current===!0,Ds=I=>typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{I()}):window.setTimeout(I,16),Pc=I=>{if(I!=null){if(typeof window.cancelAnimationFrame=="function"){window.cancelAnimationFrame(I);return}window.clearTimeout(I)}},_n=()=>{re.current!=null&&(clearTimeout(re.current),re.current=null),q.current=null},ba=()=>{he.current?.remove(),he.current=null},zr=()=>{Pc(M.current),M.current=null,ae.current=null},Ms=I=>{const Z=D.current?.getRootNode();if(Z instanceof ShadowRoot){Z.append(I);return}document.body.append(I)},ir=()=>{be.current?.(),be.current=null,lt.current!=null&&(clearTimeout(lt.current),lt.current=null),Ue.current=!1,Ce.current=null,We.current=null,He.current!=null&&(He.current.setAttribute("draggable","true"),He.current.style.removeProperty("touch-action"),He.current=null),ba(),_n(),zr(),Se.current=null},Sa=(I,Z)=>{const Ee=D.current?.getRootNode(),ue=A_(bO(Ee instanceof ShadowRoot?Ee:document,I,Z));return t.setDragTarget(ue),t.getDragSession()?.target??null},Os=I=>{const Z=t.getDragAndDropConfig()?.openOnDropDelay??800;if(I==null||I.kind!=="directory"||I.directoryPath==null||Z<=0){_n();return}const Ee=t.getItem(I.directoryPath),ue=I_(Ee)?Ee:null;if(ue==null||ue.isExpanded()){_n();return}const fe=`${I.directoryPath}::${I.flattenedSegmentPath??""}`;q.current!==fe&&(_n(),q.current=fe,re.current=setTimeout(()=>{const Ae=t.getDragSession()?.target;Ae?.kind!=="directory"||Ae.directoryPath!==I.directoryPath||Ae.flattenedSegmentPath!==I.flattenedSegmentPath||ue.expand()},Z))},ko=()=>{M.current=null;const I=ae.current,Z=N.current;if(I==null||Z==null||t.getDragSession()==null)return;const Ee=Z.getBoundingClientRect(),ue=CO(I.clientY,Ee);if(ue===0)return;const fe=Math.max(0,Z.scrollHeight-Z.clientHeight),Ae=Math.max(0,Math.min(fe,Z.scrollTop+ue));Ae!==Z.scrollTop&&(Z.scrollTop=Ae,ie.current()),Os(Sa(I.clientX,I.clientY)),M.current=Ds(ko)},ei=(I,Z)=>{ae.current={clientX:I,clientY:Z},M.current??=Ds(ko)},Ps=(I,Z,Ee)=>{const ue=I.currentTarget;if(ue!=null){if(ir(),ba(),_n(),zr(),t.startDrag(Ee)===!1){I.preventDefault();return}if(Se.current=Z,I.dataTransfer!=null&&(I.dataTransfer.effectAllowed="move",I.dataTransfer.dropEffect="move",I.dataTransfer.setData("text/plain",Ee),_O())){const fe=L_(ue),Ae=ue.getBoundingClientRect();Object.assign(fe.style,{height:`${Ae.height}px`,opacity:"0.85",transform:"translate3d(-9999px, 0px, 0)",width:`${Ae.width}px`}),Ms(fe),he.current=fe,I.dataTransfer.setDragImage(fe,Math.max(0,I.clientX-Ae.left),Math.max(0,I.clientY-Ae.top))}}},Ns=()=>{ba(),_n(),zr(),Se.current=null,t.cancelDrag()},Vr=(I,Z,Ee)=>{if(lt.current!=null||Ue.current)return;const ue=I.touches[0],fe=I.currentTarget;if(ue==null||fe==null)return;We.current={clientX:ue.clientX,clientY:ue.clientY},He.current=fe,fe.setAttribute("draggable","false");const Ae=(Je={})=>{const rt=Je.restoreNativeDraggable??!Ue.current;lt.current!=null&&(clearTimeout(lt.current),lt.current=null),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",ke),document.removeEventListener("touchcancel",ke),be.current===Ae&&(be.current=null),rt&&(fe.setAttribute("draggable","true"),He.current===fe&&(He.current=null),We.current=null)},ct=Je=>{const rt=Je.touches[0],tt=We.current;if(rt==null||tt==null)return;const ht=rt.clientX-tt.clientX,Xt=rt.clientY-tt.clientY;ht*ht+Xt*Xt<=T_*T_||Ae()},ke=()=>{Ae()};document.addEventListener("touchmove",ct,{passive:!0}),document.addEventListener("touchend",ke),document.addEventListener("touchcancel",ke),be.current=Ae,lt.current=setTimeout(()=>{if(Ae({restoreNativeDraggable:!1}),t.startDrag(Ee)===!1){fe.setAttribute("draggable","true"),He.current===fe&&(He.current=null),We.current=null;return}Ue.current=!0,He.current=fe,fe.setAttribute("draggable","false"),fe.style.setProperty("touch-action","none"),Se.current=Z;const Je=fe.getBoundingClientRect(),rt=L_(fe);Object.assign(rt.style,{height:`${Je.height}px`,opacity:"0.85",transform:`translate3d(${Je.left}px, ${Je.top}px, 0)`,width:`${Je.width}px`}),Ms(rt),he.current=rt,Ce.current={x:ue.clientX-Je.left,y:ue.clientY-Je.top};const tt=Cn=>{const pt=Cn.touches[0];if(pt==null)return;Cn.preventDefault();const Xe=Ce.current;Xe!=null&&he.current!=null&&(he.current.style.transform=`translate3d(${pt.clientX-Xe.x}px, ${pt.clientY-Xe.y}px, 0)`),Os(Sa(pt.clientX,pt.clientY)),ei(pt.clientX,pt.clientY)},ht=Cn=>{const pt=Cn.changedTouches[0];pt!=null&&Sa(pt.clientX,pt.clientY),t.completeDrag(),ir()},Xt=()=>{t.cancelDrag(),ir()};be.current=()=>{document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",ht),document.removeEventListener("touchcancel",Xt)},document.addEventListener("touchmove",tt,{passive:!1}),document.addEventListener("touchend",ht),document.addEventListener("touchcancel",Xt)},yO)},rr=I=>{if(Ze!=null){if(I.key==="Escape"){An(),I.preventDefault(),I.stopPropagation();return}AO.has(I.key)&&(I.preventDefault(),I.stopPropagation());return}if(Tn.isActive()){if(I.key==="Escape")Tn.cancel();else if(I.key==="Enter")Tn.commit();else return;Yi("focus"),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}if(h&&I.key==="F2"){Oc(Be??void 0),I.preventDefault(),I.stopPropagation();return}if(rn){if(I.key==="Escape")ce.current=!1,_e.current=null,t.closeSearch();else if(I.key==="Enter"){const vt=t.getFocusedPath();vt!=null&&t.selectOnlyPath(vt);const on=N.current,Aa=Hl(on,Et);_e.current=et<0||on==null?null:Math.max(0,Math.min(et*d-on.scrollTop,Math.max(0,Aa-d))),ce.current=!0,t.closeSearch()}else if(I.key==="ArrowDown")t.focusNextSearchMatch();else if(I.key==="ArrowUp")t.focusPreviousSearchMatch();else return;Yi("focus"),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}if(y&&xO(I)){t.openSearch(I.key),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}const Z=nn&&I5(I),Ee=kO(I,nn),ue=Ee&&D.current!=null?hd(D.current):null,fe=Ee?new Set(DO(D.current)):new Set,Ae=ue?.dataset.fileTreeStickyPath??null,ct=ue?.dataset.fileTreeStickyRow==="true"&&Ae!=null;if(ct&&Ae!==Be&&fe.has(Ae)){const vt=N.current;tn(Ae,vt?.scrollTop??null),t.focusPath(Ae)}const ke=t.getFocusedPath(),Je=t.getFocusedIndex(),rt=t.getFocusedItem();if(rt==null)return;const tt=I_(rt)?rt:null,ht=ke!=null&&(tr.has(ke)||ct&&Ae===ke&&fe.has(ke)),Xt=I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="ArrowRight"&&tt!=null&&tt.isExpanded(),Cn=I.key==="ArrowLeft"&&ht&&tt!=null&&tt.isExpanded(),pt=N.current;let Xe=!0;if(I.shiftKey&&I.key==="ArrowDown")t.extendSelectionFromFocused(1);else if(I.shiftKey&&I.key==="ArrowUp")t.extendSelectionFromFocused(-1);else if(Z&&ke!=null&&Je>=0){const vt=t.getVisibleRows(Je,Je)[0]??null,on=M_(ke,se.current,G.current);vt==null||on==null?Xe=!1:ya(vt,ke)}else if((I.ctrlKey||I.metaKey)&&L5(I))t.toggleFocusedSelection();else if((I.ctrlKey||I.metaKey)&&I.key.toLowerCase()==="a")t.selectAllVisiblePaths();else switch(I.key){case"ArrowDown":t.focusNextItem();break;case"ArrowUp":t.focusPreviousItem();break;case"ArrowRight":tt==null||tt.isExpanded()?t.focusNextItem():tt.expand();break;case"ArrowLeft":tt!=null&&tt.isExpanded()?tt.collapse():t.focusParentItem();break;case"Home":t.focusFirstItem();break;case"End":t.focusLastItem();break;default:Xe=!1}if(!Xe)return;Yi("focus");const mt=t.getFocusedPath(),Qt=mt!=null&&(tr.has(mt)||fe.has(mt)),Do=Xt&&mt!==ke,Mo=Z&&ct&&Ae===ke&&mt===ke;if((ht||Mo)&&mt!=null&&(Do&&Qt||Mo))tn(mt,pt?.scrollTop??null),H.current=!0,Tt(vt=>vt===mt?vt:mt);else{const vt=I.key==="ArrowUp"&&ht&&mt!==ke;mt!=null&&(vt||Cn&&mt===ke)?(xf(mt,OO(D.current,pt,ue,ke,d,gi,Et)),H.current=!0,Tt(on=>on===mt?on:mt)):Li()}de(vt=>vt+1),I.preventDefault(),I.stopPropagation()};Gn(()=>{if(!(!y||!rn)){if(Ac.current){Ac.current=!1;return}cs(W.current)}},[rn,y]),Gn(()=>{const I=O.current;switch(uO({hasRenderedInput:I!=null,previousRenamingPath:Q.current,renamingPath:Ct})){case"reset":Q.current=null;return;case"reveal-canonical":Ct!=null&&Nr(Ct,{restoreTreeFocus:!1,targetOffset:"live-overlay"});return;case"ignore":return;case"focus-input":I!=null&&(pa.current=null,Q.current=Ct,cs(I),I.select());return}},[Nn.end,Nn.start,Ct,Nr,tr]),Gn(()=>{const I=D.current;if(I==null)return;let Z=null;const Ee=()=>{Z!=null&&(clearTimeout(Z),Z=null)},ue=()=>{const ct=hd(I)?.dataset.itemPath??null;Tt(ke=>ke===ct?ke:ct)},fe=()=>{Ee(),H.current=!0,ue()},Ae=ct=>{const ke=ct.relatedTarget;if(ke==null){Ee(),Z=setTimeout(()=>{if(Z=null,hd(I)!=null){ue();return}H.current=!1,Tt(null)},0);return}if(!(ke instanceof Node)||!I.contains(ke)){Ee(),H.current=!1,Tt(null);return}const Je=ke instanceof HTMLElement?ke.dataset.itemPath??null:null;Tt(rt=>rt===Je?rt:Je)};return I.addEventListener("focusin",fe),I.addEventListener("focusout",Ae),()=>{Ee(),I.removeEventListener("focusin",fe),I.removeEventListener("focusout",Ae)}},[]),Gn(()=>{const I=D.current;I!=null&&(It.physical.scrollTop<=0?I.dataset.scrollAtTop="true":delete I.dataset.scrollAtTop)},[It.physical.scrollTop]),Gn(()=>{let I=null;const Z=N.current,Ee=L.current,ue=D.current;if(Z==null)return;ee.current=Hl(Z,A);const fe=()=>{const Xe=t.getVisibleCount(),mt=h_(ee.current,A),Qt=Math.max(0,Xe*d-mt);Z.scrollTop>Qt&&(Z.scrollTop=Qt),ma(gm({controller:t,itemHeight:d,overscan:f,scrollTop:Math.min(Z.scrollTop,Qt),stickyFolders:w,viewportHeight:mt}))};if(!le.current){le.current=!0;const Xe=t.getFocusedIndex();if(Xe>=0){const mt=h_(ee.current,A),Qt=t.getVisibleRows(Xe,Xe)[0]??null;p_(Z,Xe,d,mt,w&&Qt!=null?Math.max(0,Math.min(Qt.ancestorPaths.length*d,Math.max(0,mt-d))):0)}}ie.current=fe;const Ae=t.subscribe(()=>{oO(Le)&&de(Xe=>Xe+1),fe()}),ct=()=>{Wt.current!==!0&&(Ee!=null&&(Ee.dataset.isScrolling??=""),ue!=null&&(ue.dataset.isScrolling??=""),T.current=!0,I!=null&&clearTimeout(I),I=setTimeout(()=>{Ee!=null&&delete Ee.dataset.isScrolling,ue!=null&&delete ue.dataset.isScrolling,T.current=!1,wf(Xe=>Xe+1),I=null},50))};let ke=null;const Je=()=>{ue!=null&&delete ue.dataset.overlayReveal,ke!=null&&(clearTimeout(ke),ke=null)},rt=()=>{ue==null||Wt.current===!0||Z.scrollTop>0||(ue.dataset.overlayReveal="true",ke!=null&&clearTimeout(ke),ke=setTimeout(()=>{Je()},200))},tt=()=>{if(fe(),Z.scrollTop>0&&Je(),Ai.current!=null&&T.current&&Pr.current(),Wt.current===!0){T.current=!1;return}yn(Xe=>Xe==null?Xe:null),ct()},ht=()=>{ct(),rt()},Xt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"," ","Spacebar"]),Cn=Xe=>{Xt.has(Xe.key)&&ht()};Z.addEventListener("scroll",tt,{passive:!0}),Z.addEventListener("wheel",ht,{passive:!0}),Z.addEventListener("touchmove",ht,{passive:!0}),Z.addEventListener("keydown",Cn);const pt=typeof ResizeObserver<"u"?new ResizeObserver(Xe=>{ee.current=(Xe[0]==null?null:lO(Xe[0]))??Hl(Z,A),fe()}):null;return pt?.observe(Z),()=>{ie.current=()=>{},Ae(),Z.removeEventListener("scroll",tt),Z.removeEventListener("wheel",ht),Z.removeEventListener("touchmove",ht),Z.removeEventListener("keydown",Cn),I!=null&&clearTimeout(I),ke!=null&&clearTimeout(ke),Ee!=null&&delete Ee.dataset.isScrolling,ue!=null&&(delete ue.dataset.isScrolling,delete ue.dataset.overlayReveal),T.current=!1,ee.current=null,pt?.disconnect()}},[t,A,d,f,w]),Gn(()=>{nn||Ze==null||An(!1)},[An,nn,Ze]);const Hs=mo(()=>Ze==null?null:`${Ze.path}::${Ze.source}`,[Ze]);Gn(()=>{if(Hs==null){S?.clearSlotContent(ql);return}const I=Ai.current;if(I==null)return;const Z=E.current??k.current;if(Z==null)return;const Ee={anchorElement:Z,anchorRect:I.anchorRect??LO(Z.getBoundingClientRect()),close:fe=>{Pr.current(fe?.restoreFocus??!0)},restoreFocus:()=>{nr.current&&va.current(Ai.current?.path??null)}},ue=e?.contextMenu?.render?.(I.item,Ee)??null;return S?.setSlotContent(ql,ue),e?.contextMenu?.onOpen?.(I.item,Ee),H_(ue),queueMicrotask(()=>{ue==null||!ue.isConnected||document.activeElement===ue&&H_(ue)}),()=>{S?.clearSlotContent(ql)}},[Hs,e?.contextMenu,S]),Gn(()=>{Ze!=null&&t.getItem(Ze.path)==null&&An()},[An,Ze,t]),Gn(()=>{if(Ze==null)return;const I=D.current?.getRootNode(),Z=I instanceof ShadowRoot?I.host:D.current,Ee=fe=>{const Ae=fe.target;Ae instanceof Node&&(R_(fe)||k.current?.contains(Ae)!==!0&&Z?.contains(Ae)!==!0&&An())},ue=fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),An())};return document.addEventListener("mousedown",Ee,!0),document.addEventListener("keydown",ue,!0),()=>{document.removeEventListener("mousedown",Ee,!0),document.removeEventListener("keydown",ue,!0)}},[An,Ze]),Gn(()=>{const I=N.current,Z=D.current;if(I==null||Z==null){z.current=Be;return}const Ee=Be==null?null:G.current.get(Be)??null,ue=hd(Z),fe=ue?.dataset.itemPath??null,Ae=Kt&&O.current===ue,ct=y&&W.current===ue,ke=ce.current&&!rn,Je=_e.current??0,rt=pa.current,tt=Lr.current,ht=Co.current,Xt=Eo.current,Cn=ue!=null,pt=H.current||Cn,Xe=z.current!==Be,mt=tt!=null&&tt===Be&&Be!=null;let Qt=!1,Do=!1;if(Ri!=null&&Ri.id!==te.current){te.current=Ri.id;const qs=Ri.visibleIndex,Bc=t.getVisibleRows(qs,qs)[0]??null;if(Bc!=null){const Uc=w?Math.max(0,Math.min(Bc.ancestorPaths.length*d,Math.max(0,Et-d))):gi;Qt=!0,Do=cO(I,qs,d,Et,er,Ri.offset,Uc)}t.clearScrollRequest(Ri.id)}const Mo=!Qt&&ke&&zl(I,et,d,Et,er,Je),vt=!Qt&&rt!=null&&rt===Be&&zl(I,et,d,Et,er,gi),on=!Qt&&ht!=null&&ht.path===Be&&zl(I,et,d,Et,er,ht.viewportOffset),Aa=!Qt&&Xt!=null&&Xt.path===Be&&I.scrollTop!==Xt.scrollTop;if(Aa&&(I.scrollTop=Xt.scrollTop),(Aa||Do||vt||on||Mo||pt&&Xe&&rt!==Be&&!mt&&p_(I,et,d,Et,gi))&&ie.current(),Qt){z.current=Be;return}if(!pt){z.current=Be;return}if(Ae){z.current=Be;return}if(ct&&!ke){z.current=Be;return}if(Ee==null){ke&&et>=0&&(zl(I,et,d,Et,er,Je),ie.current()),z.current=Be;return}(Xe||ke||rt===Be||tt===Be||ht?.path===Be||Xt?.path===Be||fe==null||fe!==Be)&&(cs(Ee),rt===Be&&(pa.current=null),tt===Be&&(Lr.current=null),ht?.path===Be&&(Co.current=null),Xt?.path===Be&&(Eo.current=null),ce.current=!1,_e.current=null),z.current=Be},[t,et,Be,Hn,d,Kt,rn,Nn,Et,y,Ri,w,gi,er,Jn]);const zs=et>=0&&et>=It.visible.startIndex&&et<=It.visible.endIndex,Nc=Be!=null&&Or.some(I=>gs(I.row)===Be),Ao=zs||Nc,vi=Zn&&H.current===!0&&Ao?Be:null,Vs=Ef==="pointer"?vn:null,zn=Ze?.path??Ir.current??Vs??vi??vn,yi=Ze?.source==="right-click";Gn(()=>{T.current&&Ze==null||Yt(Qi(zn))},[Ze,Qi,Nn,Et,bn,Or,zn,Yt,Jn]);const Bs=pn(I=>{if(T.current||R_(I))return;const Z=I.target;if(!(Z instanceof HTMLElement)||Z.closest?.('[data-type="context-menu-trigger"]')!=null)return;const Ee=Z.closest?.('[data-file-tree-sticky-row="true"]'),ue=Z.closest?.('[data-type="item"]'),fe=Ee instanceof HTMLElement?Ee.dataset.fileTreeStickyPath??null:ue instanceof HTMLElement?ue.dataset.itemPath??null:null;fe!=null&&Yi(Ae=>Ae==="pointer"?Ae:"pointer"),yn(Ae=>Ae===fe?Ae:fe)},[]),_a=pn(()=>{yn(null)},[]);Gn(()=>{if(!Sn)return;const I=()=>{ir(),t.cancelDrag()};return window.addEventListener("dragend",I),()=>{window.removeEventListener("dragend",I),ir(),t.cancelDrag()}},[t,Sn]);const Hc=I=>{if(!Sn||t.getDragSession()==null||Ue.current)return;const Z=A_(I.target instanceof HTMLElement?I.target:null);t.setDragTarget(Z),Os(t.getDragSession()?.target??null),ei(I.clientX,I.clientY),I.dataTransfer!=null&&(I.dataTransfer.dropEffect="move"),I.preventDefault()},Ca=I=>{if(!Sn||t.getDragSession()==null||Ue.current)return;const Z=I.relatedTarget;Z instanceof Node&&D.current?.contains(Z)===!0||(_n(),zr(),t.setDragTarget(null))},Ea=I=>{!Sn||t.getDragSession()==null||Ue.current||(I.preventDefault(),Sa(I.clientX,I.clientY),t.completeDrag(),ba(),_n(),zr(),Se.current=null)},Br=It.window.height,fn=It.window.offsetTop,or=Math.min(0,Et-Br),wa=Math.min(0,Et-Br-gi),Lo=Ve===Be||ce.current,Ur=Be!=null&&Lo&&!Hn&&et>=0?Jn[et]??t.getVisibleRows(et,et)[0]??null:null,xa=Ur==null?null:m_(et,d,Nn,Br),ti=Se.current,Io=mi!=null&&ti!=null&&ti.path===mi&&ti.index>=Nn.start&&ti.index<=Nn.end,Di=mi!=null&&ti!=null&&ti.path===mi&&!Io&&ti.path!==Ur?.path?ti:null,Us=Di==null?null:m_(Di.index,d,Nn,Br),Af=TO((et>=0?Jn[et]??t.getVisibleRows(et,et)[0]??null:null)?.ancestorPaths.at(-1)??null),Lf=rn&&Be!=null?R5(c,Be,!Hn):void 0,If=Ze?.path??(rn?Be:Ve),Fs=Ze?.path??vn,Ro=Qi(zn),js=nn&&Zn&&!yi&&!Kt&&Ro!=null&&Qn!=null&&zn!=null,Rf=nn&&(js||Ze!=null),Ta=Ze?.anchorRect,zc=Ta==null&&Ro!=null&&Qn!=null&&(Ze!=null||js)?Qn:null,Vc=Ta!=null?{left:`${Ta.left}px`,position:"fixed",right:"auto",top:`${Ta.top}px`}:zc!=null?{top:`${zc}px`}:void 0,Df=yi?{opacity:"0"}:void 0,Mf=pn((I,Z,Ee,ue)=>{const fe=hO({event:{ctrlKey:I.ctrlKey,metaKey:I.metaKey,shiftKey:I.shiftKey},isDirectory:Z.kind==="directory",isSearchOpen:rn,mode:ue}),Ae=fe.toggleDirectory&&Z.kind==="directory",ct=Ae?t.resolveMountedDirectoryPathFromInput(Ee):null;if(Ae&&ct==null)return;const ke=ct??Ee;switch(fe.selection.kind){case"range":t.selectPathRange(ke,fe.selection.additive);break;case"toggle":t.togglePathSelectionFromInput(ke);break;case"single":t.selectOnlyMountedPathFromInput(ke);break}const Je=I.currentTarget instanceof HTMLElement?I.currentTarget:null,rt=Z.index>=It.visible.startIndex&&Z.index<=It.visible.endIndex,tt=ue==="flow"&&rt&&Je!=null&&Je.dataset.itemParked!=="true";t.focusMountedPathFromInput(ke),tt&&(H.current=!0,Tt(ht=>ht===ke?ht:ke),Yi("focus")),Ae&&t.toggleMountedDirectoryFromInput(ke),fe.closeSearch&&t.closeSearch(),fe.revealCanonical&&Nr(ke,{targetOffset:"sticky-parents"})},[t,rn,It.visible.endIndex,It.visible.startIndex,Nr]),Of=()=>{if(T.current||!Zn||zn==null||Ro==null)return;const I=t.getItem(zn);I!=null&&(Yt(Ro),nr.current=!0,ha({anchorRect:null,item:{kind:I.isDirectory()?"directory":"file",name:Ro.getAttribute("aria-label")??zn,path:I.getPath()},path:I.getPath(),source:"button"}))},ka={contextHoverPath:Fs,contextMenuButtonTriggerEnabled:Zn,contextMenuButtonVisibility:Lc,contextMenuEnabled:nn,contextMenuRightClickEnabled:Ic,contextMenuTriggerMode:Ii,controller:t,directoriesWithGitChanges:a,dragAndDropEnabled:Sn,draggedPathSet:Dr,dragTarget:Mr,gitLaneActive:ks,gitStatusByPath:n,handleRowDragEnd:Ns,handleRowDragStart:Ps,handleRowTouchStart:Vr,ignoredGitDirectories:i,ignoredInheritanceCache:ne,instanceId:c,itemHeight:d,onKeyDown:rr,onRowClick:Mf,openContextMenuForRow:ya,registerButton:Rc,registerRenameInput:Ts,renameView:Tn,renderDecorationForRow:kn,resolveIcon:As,shouldSuppressContextMenu:Hr,visualFocusPath:If},$s={...ka,registerButton:Dc};return pe("div",{ref:D,id:Ji,"data-file-tree-context-menu-button-visibility":nn&&Zn?Lc:void 0,"data-file-tree-context-menu-trigger-mode":nn?Ii:void 0,"data-file-tree-has-context-menu-action-lane":nn&&Zn?"true":void 0,"data-file-tree-has-git-lane":ks?"true":void 0,"data-file-tree-virtualized-root":"true",onDragLeave:Sn?Ca:void 0,onDragOver:Sn?Hc:void 0,onDrop:Sn?Ea:void 0,onKeyDown:rr,onPointerLeave:nn?_a:void 0,onPointerOver:nn?Bs:void 0,role:"tree",tabIndex:-1,style:{outline:"none",position:"relative"},children:[pe("style",{"data-file-tree-guide-style":"true",dangerouslySetInnerHTML:{__html:Af}}),pe("slot",{name:Wd,"data-type":"header-slot"}),y?pe("div",{"data-file-tree-search-container":!0,"data-open":rn?"true":"false",children:pe("input",{ref:W,"aria-activedescendant":Lf,"aria-controls":Ji,placeholder:"Search…","data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Tf?"true":void 0,value:Ls,onBlur:()=>{g==="retain"&&!xo.current||t.closeSearch()},onFocus:Rr,onPointerDown:Rr,onInput:I=>{Rr();const Z=I.currentTarget;t.setSearch(Z.value)}})}):null,pe("div",{ref:N,"data-file-tree-virtualized-scroll":"true",children:[w&&To&&Or.length>0?pe("div",{"aria-hidden":"true","data-file-tree-sticky-overlay":"true",children:pe("div",{"data-file-tree-sticky-overlay-content":"true",style:{height:`${Pt}px`},children:Or.map((I,Z)=>Ad($s,I.row,`sticky:${gs(I.row)}`,{mode:"sticky",style:{left:"0",position:"absolute",right:"0",top:`${I.top}px`,zIndex:`${Or.length-Z}`}}))})}):null,pe("div",{ref:L,"data-file-tree-virtualized-list":"true",style:{height:`${er}px`},children:[pe("div",{"data-file-tree-virtualized-sticky-offset":"true","aria-hidden":"true",style:{height:`${fn}px`}}),pe("div",{"data-file-tree-virtualized-sticky":"true",style:{height:`${Br}px`,top:`${or}px`,bottom:`${wa}px`},children:[HO(ka,Nn,tr),Ur!=null&&xa!=null?Ad(ka,Ur,`parked:${Ur.path}`,{isParked:!0,style:{left:"0",opacity:"0",pointerEvents:mi===Ur.path?"none":void 0,position:"absolute",right:"0",top:`${xa}px`}}):null,Di!=null&&Us!=null?Ad(ka,Di,`parked-drag:${Di.path}`,{isParked:!0,style:{left:"0",opacity:"0",pointerEvents:"none",position:"absolute",right:"0",top:`${Us}px`}}):null]})]})]}),nn?pe("div",{ref:k,"data-type":"context-menu-anchor","data-visible":Rf?"true":"false",style:Vc,children:[pe("button",{ref:E,type:"button","data-type":r7,"aria-label":"Options","aria-haspopup":"menu","aria-expanded":Ze!=null?"true":"false","data-visible":js?"true":"false",onMouseDown:I=>{I.preventDefault()},onClick:I=>{if(I.preventDefault(),I.stopPropagation(),Ze!=null){An();return}Of()},tabIndex:-1,style:Df,children:pe(ec,{...As("file-tree-icon-ellipsis")})}),Ze!=null?pe("slot",{name:ql}):null]}):null,Ze!=null?pe("div",{"data-type":"context-menu-wash","aria-hidden":"true",onMouseDownCapture:I=>{I.preventDefault(),An()},onTouchStartCapture:I=>{I.preventDefault(),I.stopPropagation(),An()},onTouchMoveCapture:I=>{I.preventDefault(),I.stopPropagation()},onWheelCapture:I=>{I.preventDefault(),I.stopPropagation()}}):null]})}const a0={hydrateRoot:(e,t)=>{PM(dg(z_,t),e)},renderRoot:(e,t)=>{hg(dg(z_,t),e)},unmountRoot:e=>{hg(null,e)}};function Vl(e,t){a0.renderRoot(e,t)}function zO(e,t){a0.hydrateRoot(e,t)}function VO(e){a0.unmountRoot(e)}var BO=class{#e=new Map;#t=null;clearAll(){for(const e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){const t=this.#l(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#r(e);for(const[t,n]of this.#e)this.#a(t,n)}}setSlotContent(e,t){const n=this.#l(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#a(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#a(e,t)}setSlotHtml(e,t){const n=t?.trim()??"";if(n.length===0){this.setSlotContent(e,null);return}const i=this.#l(e);if(i!=null&&i.innerHTML===n){this.#e.set(e,i),this.#a(e,i);return}const a=document.createElement("div");a.innerHTML=n,this.setSlotContent(e,a)}#l(e){const t=this.#e.get(e)??null;if(t!=null)return t;const n=this.#t;if(n==null)return null;for(const i of Array.from(n.children))if(i instanceof HTMLElement&&i.dataset.fileTreeManagedSlot===e)return i;return null}#a(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#r(e){for(const t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;const n=t.dataset.fileTreeManagedSlot;n==null||this.#e.has(n)||this.#e.set(n,t)}}};let V_=0;function UO(e){return e!=null&&e.length>0?e:(V_+=1,`pst_ft_${V_}`)}function FO({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??r5)}function B_(e){if(typeof document>"u")return;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("svg");return n instanceof SVGElement?n:void 0}function U_(e){return e.querySelector("#file-tree-icon-chevron")instanceof SVGElement&&e.querySelector("#file-tree-icon-file")instanceof SVGElement&&e.querySelector("#file-tree-icon-dot")instanceof SVGElement&&e.querySelector("#file-tree-icon-lock")instanceof SVGElement}function F_(e){return Array.from(e.children).filter(t=>t instanceof SVGElement)}var jO=class{static LoadedCustomComponent=!0;#e;#t;#l;#a;#r;#A;#B;#v;#i;#y=new BO;#L;#b;#m;#f;#S;#_;#h;#U;#F;#P=null;#o;#j=!1;#$=!1;constructor(t){const{composition:n,density:i,fileTreeSearchMode:a,gitStatus:s,id:c,initialSearchQuery:d,icons:f,itemHeight:h,onSearchChange:m,onSelectionChange:g,overscan:y,renderRowDecoration:b,renaming:S,search:w,searchBlurBehavior:A,searchFakeFocus:k,stickyFolders:E,unsafeCSS:T,initialVisibleRowCount:L,...O}=t;this.#e=n,this.#l=UO(c),this.#f=r_(s),this.#S=f,this.#_=T,this.#a=g,this.#r=b,this.#A=S!=null&&S!==!1,this.#B=A,this.#v=w===!0,this.#i=k===!0,this.#L=GD(i,h),this.#b={itemHeight:this.#L.itemHeight,overscan:y,stickyFolders:E,initialVisibleRowCount:L},this.#t=new _M({...O,fileTreeSearchMode:a,initialSearchQuery:d,onSearchChange:m,renaming:S}),this.#F=this.#t.getSelectionVersion(),this.#P=this.#a==null?null:this.subscribe(()=>{this.#R()})}unmount(){this.#o!=null&&(VO(this.#o),delete this.#o.dataset.fileTreeVirtualizedWrapper,this.#o=void 0),this.#y.clearAll(),this.#y.setHost(null),this.#m!=null&&(delete this.#m.dataset.fileTreeVirtualized,this.#H(this.#m),this.#m=void 0)}cleanUp(){this.unmount(),this.#P?.(),this.#P=null,this.#t.destroy()}getFileTreeContainer(){return this.#m}getItem(t){return this.#t.getItem(t)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#L.itemHeight}getDensityFactor(){return this.#L.factor}subscribe(t){let n=!1;return this.#t.subscribe(()=>{if(!n){n=!0;return}t()})}focusPath(t){this.#t.focusPath(t)}scrollToPath(t,n){this.#t.scrollToPath(t,n)}focusNearestPath(t){return this.#t.focusNearestPath(t)}add(t){this.#t.add(t)}batch(t){this.#t.batch(t)}applyGitStatusPatch(t){const n=xM(this.#f,t);if(n===this.#f)return;this.#f=n;const i=this.#c();i!=null&&Vl(i.wrapper,this.#I())}move(t,n,i){this.#t.move(t,n,i)}onMutation(t,n){return this.#t.onMutation(t,n)}setSearch(t){this.#t.setSearch(t)}openSearch(t){this.#t.openSearch(t)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(t,n){return this.#t.startRenaming(t,n)}remove(t,n){this.#t.remove(t,n)}resetPaths(t,n){Array.isArray(t)?this.#t.resetPaths(t,n):this.#t.resetPaths(t)}setComposition(t){this.#e=t;const n=this.#c();n!=null&&(this.#x(),Vl(n.wrapper,this.#I()))}setGitStatus(t){const n=r_(t,this.#f);if(n===this.#f)return;this.#f=n;const i=this.#c();i!=null&&Vl(i.wrapper,this.#I())}setIcons(t){this.#S=t;const n=this.#c();n!=null&&(this.#g(n.host,n.wrapper),Vl(n.wrapper,this.#I()))}hydrate({fileTreeContainer:t}){const n=this.#M(t),i=this.#N(n);this.#x(),zO(i,this.#I())}render({containerWrapper:t,fileTreeContainer:n}){const i=this.#M(n??this.#m,t),a=this.#N(i);this.#x(),Vl(a,this.#I())}#Z(){return{initialViewportHeight:FO({initialVisibleRowCount:this.#b.initialVisibleRowCount,itemHeight:this.#b.itemHeight}),itemHeight:this.#b.itemHeight,overscan:this.#b.overscan,stickyFolders:this.#b.stickyFolders}}#I(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#f?.statusByPath,ignoredGitDirectories:this.#f?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#f?.directoriesWithChanges,icons:this.#S,instanceId:this.#l,renamingEnabled:this.#A,renderRowDecoration:this.#r,searchBlurBehavior:this.#B,searchEnabled:this.#v,searchFakeFocus:this.#i,slotHost:this.#y,...this.#Z()}}#c(){const t=this.#m,n=this.#o;return t==null||n==null?null:{host:t,wrapper:n}}#g(t,n){const i=t.shadowRoot;i!=null&&(this.#q(i),this.#G(i)),this.#W(n)}#R(){const t=this.#a;if(t==null)return;const n=this.#t.getSelectionVersion();n!==this.#F&&(this.#F=n,t(this.#t.getSelectedPaths()))}#x(){const t=this.#e?.header?.render;if(t!=null){this.#y.setSlotContent(Wd,t());return}this.#y.setSlotHtml(Wd,this.#e?.header?.html??null)}#q(t){const n=F_(t).find(a=>U_(a)),i=B_(ZR(_d(this.#S).set));i!=null&&(n!=null&&n.outerHTML===i.outerHTML||(n!=null?n.replaceWith(i):t.prepend(i)))}#G(t){const n=F_(t),i=n.find(d=>U_(d)),a=n.filter(d=>d!==i),s=_d(this.#S).spriteSheet?.trim()??"";if(s.length===0){for(const d of a)d.remove();return}const c=B_(s);if(c==null){for(const d of a)d.remove();return}if(!(a.length===1&&a[0].outerHTML===c.outerHTML)){for(const d of a)d.remove();t.appendChild(c)}}#W(t){const n=_d(this.#S);n.colored&&e7(n.set)?t.dataset.fileTreeColoredIcons="true":delete t.dataset.fileTreeColoredIcons}#u(t){const n=t.querySelector(`style[${TS}]`);if(this.#h==null&&n instanceof HTMLStyleElement&&(this.#h=n),this.#_==null||this.#_===""){this.#h?.remove(),this.#h=void 0,this.#U=void 0;return}this.#h?.parentNode===t&&this.#U===this.#_||(this.#h??=document.createElement("style"),this.#h.setAttribute(TS,""),this.#h.parentNode!==t&&t.appendChild(this.#h),this.#h.textContent=WD(this.#_),this.#U=this.#_)}#N(t){if(this.#o!=null)return this.#o;const n=t.shadowRoot;if(n==null)throw new Error("FileTree requires a shadow root");const i=Array.from(n.children).filter(s=>s instanceof HTMLDivElement&&typeof s.dataset.fileTreeId=="string"&&s.dataset.fileTreeId.length>0),a=i.find(s=>s.dataset.fileTreeId===this.#l)??i[0];return a!=null&&(this.#l=a.dataset.fileTreeId??this.#l),this.#o=a??document.createElement("div"),this.#o.dataset.fileTreeId=this.#l,this.#o.dataset.fileTreeVirtualizedWrapper="true",this.#g(t,this.#o),this.#o.parentNode!==n&&n.appendChild(this.#o),this.#o}#M(t,n){const i=t??this.#m??document.createElement("file-tree-container");n!=null&&i.parentNode!==n&&n.appendChild(i);const a=i.shadowRoot??i.attachShadow({mode:"open"});return lg(i,a),this.#u(a),i.dataset.fileTreeVirtualized="true",i.style.display="flex",this.#w(i),this.#y.setHost(i),this.#m=i,i}#w(t){t.style.getPropertyValue("--trees-item-height")===""&&(t.style.setProperty("--trees-item-height",`${String(this.#L.itemHeight)}px`),this.#j=!0),t.style.getPropertyValue("--trees-density-override")===""&&(t.style.setProperty("--trees-density-override",String(this.#L.factor)),this.#$=!0)}#H(t){this.#j&&(t.style.removeProperty("--trees-item-height"),this.#j=!1),this.#$&&(t.style.removeProperty("--trees-density-override"),this.#$=!1)}};const j_=typeof window>"u"?Y.useEffect:Y.useLayoutEffect;function $O(e,t,n){const i=e!=null?U.jsx("div",{slot:Wd,children:e}):null,a=t!=null&&n!=null?U.jsx("div",{slot:ql,children:t(n.item,n.context)}):null;return i==null&&a==null?null:U.jsxs(U.Fragment,{children:[i,a]})}function qO(e,t){return typeof window>"u"&&t!=null?U.jsxs(U.Fragment,{children:[U.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):U.jsx(U.Fragment,{children:e})}function GO(e){const t=e.shadowRoot;return t?.querySelector("[data-file-tree-id]")instanceof HTMLElement||t?.querySelector("[data-file-tree-id]")instanceof SVGElement?!0:e.querySelector('template[shadowrootmode="open"]')instanceof HTMLTemplateElement}function WO(e,t,n,i,a){const s={...e??{}};if(t!=null&&delete s.header,n){const c=e?.contextMenu,d=c?.onClose,f=c?.onOpen;s.contextMenu={...c??{},enabled:!0,onClose:()=>{d?.(),i()},onOpen:(h,m)=>{a(h,m),f?.(h,m)}},delete s.contextMenu.render}return s.header!=null||s.contextMenu!=null?s:void 0}function KO({header:e,id:t,model:n,preloadedData:i,renderContextMenu:a,...s}){const[c,d]=Y.useState(null),[f,h]=Y.useState(null),m=Y.useRef(n.getComposition()),g=Y.useRef(n);g.current!==n&&(g.current=n,m.current=n.getComposition());const y=a!=null,b=Y.useCallback(()=>{d(null)},[]),S=Y.useCallback((O,D)=>{d({context:D,item:O})},[]),w=m.current,A=Y.useMemo(()=>WO(w,e,y,b,S),[w,b,S,y,e]),k=Y.useCallback(O=>{h(O)},[]);Y.useEffect(()=>{y||d(null)},[y]),j_(()=>{n.setComposition(A)},[A,n]),j_(()=>{if(f!=null)return i!=null&&GO(f)?n.hydrate({fileTreeContainer:f}):n.render({fileTreeContainer:f}),()=>{n.unmount(),n.setComposition(w)}},[w,f,n,i]);const E=qO($O(e,a,c),i),T=t??i?.id,L={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...s.style};return U.jsx(Jm,{...s,id:T,ref:k,style:L,suppressHydrationWarning:i!=null,children:E})}function YO(e){const[t]=Y.useState(()=>new jO(e)),n=Y.useRef({timeout:null,model:t});return Y.useEffect(()=>{const{current:i}=n;return i.timeout!=null&&(clearTimeout(i.timeout),i.timeout=null),()=>{i.timeout=setTimeout(()=>i.model.cleanUp(),1)}},[]),{model:t}}function XO(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Object.is(e[n],t[n]))return!1;return!0}function QO(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function ZO(e,t,n){const i=Y.useRef({hasValue:!1,model:null,selector:null,value:void 0}),a=Y.useCallback(c=>e.subscribe(c),[e]),s=Y.useCallback(()=>{const c=i.current,d=t(e);if(c.model!==e||c.selector!==t||!c.hasValue)return c.hasValue=!0,c.model=e,c.selector=t,c.value=d,d;const f=c.value;return QO(f,d,n)?f:(c.value=d,d)},[n,e,t]);return Y.useSyncExternalStore(a,s,s)}function JO(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&XO(e.matchingPaths,t.matchingPaths)}function eP(e){const t=ZO(e,n=>({isOpen:n.isSearchOpen(),matchingPaths:n.getSearchMatchingPaths(),value:n.getSearchValue()}),JO);return Y.useMemo(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:n=>{e.openSearch(n)},setValue:n=>{e.setSearch(n)}}),[e,t])}function tP(e){return[...e].sort((t,n)=>{const i=t.split("/"),a=n.split("/"),s=Math.min(i.length,a.length);for(let c=0;c<s;c++){const d=i[c],f=a[c],h=c<i.length-1,m=c<a.length-1;if(d===f&&h&&m)continue;if(h!==m)return h?-1:1;const g=d.localeCompare(f,void 0,{sensitivity:"base"});if(g!==0)return g;if(d!==f)return d<f?-1:1}return i.length-a.length})}const nP={added:"added",deleted:"deleted",modified:"modified",renamed:"renamed"},iP=`
2878
+ }`}const YS=new WeakMap;function KD(e){const t=YS.get(e);if(t!=null)return t;const n=document.createElement("div");n.setAttribute(n7,"true");const i=document.createElement("div");i.style.position="relative",i.style.height="200%",n.appendChild(i),e.appendChild(n);const a=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),YS.set(e,a),a}function YD(e,t){if(!e.isConnected)return;const n=KD(t);if(n==null)return;const i=t.querySelector(`style[${kS}]`),a=i instanceof HTMLStyleElement?i:document.createElement("style");i instanceof HTMLStyleElement||(a.setAttribute(kS,""),t.appendChild(a)),a.textContent=`:host { ${i7}: ${n}px; }`}let ud;function XD(e){if(typeof CSSStyleSheet<"u"&&typeof CSSStyleSheet.prototype.replaceSync=="function"&&"adoptedStyleSheets"in e){ud==null&&(ud=new CSSStyleSheet,ud.replaceSync(KS(WS)));let t=!1;try{e.adoptedStyleSheets=[ud],t=!0}catch{}if(t){e.querySelector(`style[${xS}]`)?.remove();return}}if(e.querySelector("style[data-file-tree-style]")==null){const t=document.createElement("style");t.setAttribute(xS,""),t.textContent=KS(WS),e.prepend(t)}}function lg(e,t){QD(e,t),XD(t),YD(e,t)}function QD(e,t){const n=e.querySelector('template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]');n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute("shadowrootmode")&&n.remove()))}if(typeof HTMLElement<"u"&&customElements.get("file-tree-container")==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){const n=this.shadowRoot??this.attachShadow({mode:"open"});lg(this,n)}}if(customElements.define(Jm,e),typeof document<"u")for(const t of Array.from(document.querySelectorAll(Jm)))t instanceof HTMLElement&&lg(t,t.shadowRoot??t.attachShadow({mode:"open"}))}const ZD=e=>e.startsWith("f::")?e.slice(3):e;function JD(e){const t=e.lastIndexOf("/");return t<0?{parentPath:"",baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function eM(e,t){return e===""?t:`${e}/${t}`}function tM({files:e,path:t,isFolder:n,nextBasename:i}){const a=ZD(t),s=i.trim();if(s.length===0)return{error:"Name cannot be empty."};if(s.includes("/"))return{error:'Name cannot include "/".'};const{parentPath:c,baseName:d}=JD(a);if(s===d)return{nextFiles:e,sourcePath:a,destinationPath:a,isFolder:n};const f=eM(c,s),h=new Array(e.length),m=new Set;if(!n){const S=`${f}/`;let w=!1;for(let A=0;A<e.length;A++){const k=e[A];if(k!==a&&k.startsWith(S))return{error:`"${f}" already exists.`};const E=k===a?f:k;if(m.has(E))return{error:`"${f}" already exists.`};m.add(E),h[A]=E,k===a&&(w=!0)}return w?{nextFiles:h,sourcePath:a,destinationPath:f,isFolder:n}:{error:"Could not find the selected file to rename."}}const g=`${a}/`,y=`${f}/`;let b=0;for(let S=0;S<e.length;S++){const w=e[S],A=w===a||w.startsWith(g);if(!A&&(w===f||w.startsWith(y)))return{error:`"${f}" already exists.`};const k=A?`${f}${w.slice(a.length)}`:w;if(m.has(k))return{error:`"${f}" already exists.`};m.add(k),h[S]=k,A&&b++}return b===0?{error:"Could not find the selected folder to rename."}:{nextFiles:h,sourcePath:a,destinationPath:f,isFolder:n}}function nM(e){return e.endsWith("/")}function iM(e){const t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/"),i=n<0?t:t.slice(n+1);return e.endsWith("/")?`${i}/`:i}function rM(e){const t=[],n=new Set;for(const a of e)n.has(a)||(n.add(a),t.push(a));const i=new Set;for(const a of t.toSorted((s,c)=>s.length!==c.length?s.length-c.length:s.localeCompare(c))){const s=(a.endsWith("/")?a.slice(0,-1):a).split("/");let c=!1;for(let d=0;d<s.length-1;d+=1){const f=`${s.slice(0,d+1).join("/")}/`;if(i.has(f)){c=!0;break}}c||i.add(a)}return t.filter(a=>i.has(a))}function oM(e,t){return t.includes(e)?rM(t):[e]}function aM(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function XS(e,t){return{draggedPaths:e,target:t}}function QS(e,t){if(t.kind!=="directory"||t.directoryPath==null)return!1;for(const n of e)if(nM(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function sM(e,t){return t.kind==="root"||t.directoryPath==null?iM(e):t.directoryPath}function lM(e,t){const n=e.map(i=>{const a=sM(i,t);return a===i?null:{from:i,to:a,type:"move"}}).filter(i=>i!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?"move":"batch",target:t}}}function cM(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function ZS(e,t,n){const{paths:i,preparedInput:a}=e;if(a==null){if(i==null)throw new Error("FileTree requires paths or preparedInput");return{paths:i,preparedInput:void 0}}const s=a.paths;if(i==null)return{paths:s,preparedInput:a};if(!cM(Jg.preparePaths(i,n==null?{}:{sort:n}),s))throw new Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:s,preparedInput:a}}function JS(e){return e.operation==="add"||e.operation==="remove"||e.operation==="move"||e.operation==="batch"}function uM(e,t,n){if(e===t)return n;const i=t.endsWith("/")?t:`${t}/`;return e.startsWith(i)?`${n.endsWith("/")?n:`${n}/`}${e.slice(i.length)}`:e}function dM(e,t){if(e===t)return!0;const n=t.endsWith("/")?t:`${t}/`;return e.startsWith(n)}function Wl(e,t,n=!1){if(e==null)return null;switch(t.operation){case"add":case"expand":case"collapse":case"mark-directory-unloaded":case"begin-child-load":case"apply-child-patch":case"complete-child-load":case"fail-child-load":case"cleanup":return e;case"remove":return dM(e,t.path)?n?e:null:e;case"move":return uM(e,t.from,t.to);case"batch":{let i=e;for(const a of t.events)if(i=Wl(i,a,n),i==null)return null;return i}}}function Ed(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function a5(e){switch(e.operation){case"add":return{...Ed(e),operation:"add",path:e.path};case"remove":return{...Ed(e),operation:"remove",path:e.path,recursive:e.recursive};case"move":return{...Ed(e),from:e.from,operation:"move",to:e.to}}}function fM(e){return{...Ed(e),events:e.events.filter(t=>t.operation==="add"||t.operation==="remove"||t.operation==="move").map(t=>a5(t)),operation:"batch"}}function hM(e){switch(e.operation){case"add":case"remove":case"move":return a5(e);case"batch":return fM(e);default:return null}}function fm(e,t){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function po(e){const t=e.endsWith("/")?e.slice(0,-1):e;if(t.length===0)return[];const n=t.split("/");return n.slice(0,-1).map((i,a)=>`${n.slice(0,a+1).join("/")}/`)}function hm(e){return po(e).at(-1)??null}function e_(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function dd(e){return e.endsWith("/")}const t_=e=>e.toLowerCase();function pM(e){const t=e.endsWith("/")?e.slice(0,-1):e,n=t.lastIndexOf("/");return n<0?t:t.slice(n+1)}function n_(e){return e.endsWith("/")?e.slice(0,-1):e}function i_(e,t){return t&&!e.endsWith("/")?`${e}/`:e}const mM=e=>{const t=e.trim();return t.length===0?"":(t.includes("\\")?t.replaceAll("\\","/"):t).toLowerCase()},s5=Symbol("FILE_TREE_RENAME_VIEW"),gM=512,vM=512;function yM(e){return e==="top"||e==="center"?e:"nearest"}function bM(e,t,n){if(e===0)return-1;if(n!=null){const i=t(n);if(i!=null)return i;const a=po(n);for(let s=a.length-1;s>=0;s-=1){const c=a[s];if(c==null)continue;const d=t(c);if(d!=null)return d}}return 0}function SM(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};const i=n??(a=>e.visibleIndexByPath.get(a)??null);return{focusedIndex:bM(e.paths.length,i,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var _M=class l5{static{Object.defineProperty(l5.prototype,s5,{configurable:!0,value(){return{cancel:()=>{this.#Te()},commit:()=>{this.#ke()},getPath:()=>this.#c,getValue:()=>this.#g,isActive:()=>this.#c!=null,setValue:t=>{this.#Ae(t)}}},writable:!0})}#e;#t=new Set;#l=new Map;#a=null;#r=null;#A=new Map;#B=new Map;#v=-1;#i=null;#y=!1;#L=t=>-1;#b=new Map;#m=null;#f=null;#S=null;#_=null;#h=null;#U;#F;#P;#o=[];#j=new Int32Array(0);#$=new Int32Array(0);#Z=void 0;#I=!1;#c=null;#g="";#R=!1;#x=new Set;#q=[];#G;#W=null;#u=null;#N=null;#M=null;#w=null;#H=null;#J=null;#xe=0;#C=null;#s=new Set;#K=0;#n;#ne=0;#ie=!1;#p=0;#Y;constructor(t){const{dragAndDrop:n,fileTreeSearchMode:i,initialSearchQuery:a,initialSelectedPaths:s,renaming:c,onSearchChange:d,paths:f,preparedInput:h,...m}=t,g=ZS({paths:f,preparedInput:h},"constructor",m.sort);this.#e=m,n!=null&&n!==!1&&(this.#a=n===!0?{}:n),this.#I=c!=null&&c!==!1,c!=null&&c!==!1&&c!==!0&&(this.#Z=c.canRename,this.#F=c.onError,this.#U=c.onRename),this.#P=d,this.#G=i??"hide-non-matches",this.#n=this.#oe(g.paths,g.preparedInput);const y=s?.map(S=>this.#O(S)).filter(S=>S!=null)??[],b=y.at(-1)??null;y.length>0&&(this.#s=new Set(y),this.#C=b,this.#K=1),this.#V(b,!1),a!=null&&this.#X(a,!1),this.#Y=this.#Ee()}destroy(){this.#Y?.(),this.#Y=null,this.#l.clear(),this.#t.clear(),this.#b.clear(),this.#r=null,this.#se()}focusFirstItem(){this.#T().length>0&&this.#k(0)}focusLastItem(){this.#p<=0||(this.#D(),this.#k(this.#p-1))}focusNextItem(){this.#Ce(1)}focusParentItem(){if(this.#i==null)return;const t=hm(this.#i);if(t==null)return;const n=this.#z(t);n>=0&&this.#k(n)}focusPath(t){const n=this.#n.getPathInfo(t)?.path??null;if(n==null)return;this.#D();const i=this.#z(n);i>=0&&this.#k(i)}scrollToPath(t,n){const i=this.#n.getPathInfo(t)?.path??null;if(i==null)return;this.#D();const a=this.#ze(i);a<0||this.#le(a)!=null&&(n?.focus!==!1&&this.#k(a,!1),this.#J={id:this.#xe+=1,offset:yM(n?.offset),visibleIndex:a},this.#d())}focusMountedPathFromInput(t){const n=this.#n.getPathInfo(t)?.path??null;if(n==null)return;const i=this.#z(n);i>=0&&this.#k(i)}focusNearestPath(t){const n=this.resolveNearestVisiblePath(t);if(n==null)return null;const i=this.#z(n);return i>=0?(this.#k(i),this.#T()[i]??n):null}focusPreviousItem(){this.#Ce(-1)}getFocusedIndex(){return this.#v}getFocusedItem(){return this.#i==null?null:this.#ce(this.#i)}getFocusedPath(){return this.#i}getScrollRequest(){return this.#J}clearScrollRequest(t){this.#J?.id===t&&(this.#J=null)}resolveNearestVisiblePath(t){const n=this.#T();if(this.#p===0)return null;if(t==null)return this.#i??n[0]??null;const i=this.#n.getPathInfo(t)?.path??t,a=this.#z(i);if(a>=0)return n[a]??i;const s=this.#Le(i);return s??this.#i??n[0]??null}getSelectedPaths(){return[...this.#s]}getSelectionVersion(){return this.#K}getVisibleCount(){return this.#p}getVisibleRows(t,n){if(n<t||this.#p===0)return[];const i=Math.max(0,t),a=Math.min(this.#p-1,n);if(a<i)return[];const s=a-i+1;if(this.#w==null&&!this.#y&&a>=this.#o.length&&s<=vM){const c=[];for(let d=i;d<=a;d+=1){const f=this.#n.getVisibleRowContext(d);if(f==null)break;c.push(this.#ue(f))}return c}if(!this.#y&&a>=this.#o.length&&this.#D(),this.#w!=null){const c=Array.from({length:a-i+1},(m,g)=>this.#ve(i+g)),d=new Map;let f=c[0]??-1,h=f;for(let m=1;m<=c.length;m+=1){const g=c[m];if(g!=null&&g===h+1){h=g;continue}if(f>=0&&this.#n.getVisibleSlice(f,h).forEach((y,b)=>{d.set(f+b,y)}),g==null){f=-1,h=-1;continue}f=g,h=g}return Array.from({length:a-i+1},(m,g)=>{const y=i+g,b=this.#ve(y),S=d.get(b),w=this.#o[b];if(S==null||w==null)throw new Error(`Missing projection row for filtered visible index ${String(y)}`);return this.#re(S,y,b,{ancestorPaths:this.#he(b),path:w})})}return this.#n.getVisibleSlice(i,a).map((c,d)=>{const f=i+d,h=this.#o[f];if(h==null)throw new Error(`Missing projection path for visible index ${String(f)}`);return this.#re(c,f,f,{ancestorPaths:this.#he(f),path:h})})}getStickyRowCandidates(t,n){if(this.#w!=null)return null;if(this.#p===0||t<=0||n<=0)return[];const i=[];for(let a=0;a<this.#p;a+=1){const s=t+a*n,c=Math.min(this.#p-1,Math.floor(s/n)),d=this.#de(c,a)??(c>0?this.#de(c-1,a):void 0);if(d==null)break;i.push({row:this.#ue(d),subtreeEndIndex:d.subtreeEndIndex})}return i}getItem(t){const n=this.#n.getPathInfo(t);return n==null?null:this.#ce(n.path,n)}resolveMountedDirectoryPathFromInput(t){const n=this.#n.getPathInfo(t);return n?.kind==="directory"?n.path:null}toggleMountedDirectoryFromInput(t){const n=this.resolveMountedDirectoryPathFromInput(t);n!=null&&this.#we(n)}selectAllVisiblePaths(){this.#D();const t=[...this.#T()];this.#E(t,this.#i??this.#C)}selectOnlyPath(t){const n=this.#O(t);n!=null&&this.#E([n],n)}selectOnlyMountedPathFromInput(t){this.#E([t],t)}selectPath(t){const n=this.#O(t);n==null||this.#s.has(n)||this.#E([...this.#s,n])}deselectPath(t){const n=this.#O(t);n==null||!this.#s.has(n)||this.#E([...this.#s].filter(i=>i!==n))}toggleFocusedSelection(){this.#i!=null&&this.togglePathSelectionFromInput(this.#i)}togglePathSelection(t){const n=this.#O(t);if(n!=null){if(this.#s.has(n)){this.deselectPath(n);return}this.selectPath(n)}}togglePathSelectionFromInput(t){const n=this.#O(t);if(n!=null){if(this.#s.has(n)){this.#E([...this.#s].filter(i=>i!==n),n);return}this.#E([...this.#s,n],n)}}selectPathRange(t,n){const i=this.#O(t);if(i==null)return;this.#D();const a=this.#C,s=a==null?-1:this.#te(a),c=this.#te(i);if(s===-1||c===-1){const g=n?[...this.#s,i]:[i];this.#E(g,i);return}const[d,f]=s<=c?[s,c]:[c,s],h=this.#T().slice(d,f+1),m=n?[...this.#s,...h]:h;this.#E(m,a)}extendSelectionFromFocused(t){if(this.#i==null)return;const n=this.#v;if(n===-1)return;const i=Math.min(this.#p-1,Math.max(0,n+t));if(i===n)return;!this.#y&&i>=this.#o.length&&this.#D();const a=this.#T(),s=a[n]??null,c=a[i]??null;if(s==null||c==null)return;const d=new Set(this.#s);d.has(s)&&d.has(c)?d.delete(s):d.add(c),this.#E([...d],this.#C??s,!1),this.#k(i)}getDragAndDropConfig(){return this.#a}isDragAndDropEnabled(){return this.#a!=null}getDragSession(){return this.#r==null?null:{draggedPaths:[...this.#r.draggedPaths],primaryPath:this.#r.primaryPath,target:this.#r.target==null?null:{...this.#r.target}}}startDrag(t){if(this.#a==null)return!1;const n=this.#O(t);if(n==null||this.#u!=null&&this.#u.length>0)return!1;const i=this.getSelectedPaths(),a=oM(n,i);return this.#a.canDrag?.(a)===!1?!1:(i.includes(n)||this.#E([n],n,!1),this.#Q(n),this.#r={draggedPaths:a,primaryPath:n,target:null},this.#d(),!0)}setDragTarget(t){const n=this.#r;if(n==null)return;let i=t;if(i!=null){const a=XS(n.draggedPaths,i);(QS(n.draggedPaths,i)||this.#a?.canDrop?.(a)===!1)&&(i=null)}aM(n.target,i)||(this.#r={...n,target:i},this.#d())}cancelDrag(){this.#r!=null&&(this.#r=null,this.#d())}completeDrag(){const t=this.#r;if(t==null)return!1;this.#r=null;const n=t.target==null?null:{...t.target};if(n==null)return this.#d(),!1;const i=XS(t.draggedPaths,n);if(QS(t.draggedPaths,n)||this.#a?.canDrop?.(i)===!1)return this.#d(),!1;const a=lM(t.draggedPaths,n);if(a==null)return this.#d(),!1;try{if(a.operations.length===1){const s=a.operations[0];if(s==null||s.type!=="move")throw new Error("Expected a single move operation for one-item drops");this.#n.move(s.from,s.to,{collision:s.collision})}else this.#De(a.operations),this.#n.batch(a.operations)}catch(s){return this.#d(),this.#a?.onDropError?.(s instanceof Error?s.message:String(s),i),!1}return this.#a?.onDropComplete?.(a.result),!0}subscribe(t){return this.#t.add(t),t(),()=>{this.#t.delete(t)}}add(t){this.#n.add(t)}remove(t,n={}){this.#n.remove(t,n)}move(t,n,i={}){this.#n.move(t,n,i)}batch(t){this.#n.batch(t)}onMutation(t,n){const i=t,a=n;let s=this.#l.get(i);return s==null&&(s=new Set,this.#l.set(i,s)),s.add(a),()=>{const c=this.#l.get(i);c?.delete(a),c?.size===0&&this.#l.delete(i)}}setSearch(t){this.#X(t,!0)}openSearch(t=""){this.#X(t,!0)}closeSearch(){this.#X(null,!0)}isSearchOpen(){return this.#u!==null}getSearchValue(){return this.#u??""}getSearchMatchingPaths(){return this.#q}focusNextSearchMatch(){this.#ye(1)}focusPreviousSearchMatch(){this.#ye(-1)}startRenaming(t=this.#i??"",n={}){if(!this.#I)return!1;const i=this.#n.getPathInfo(t);if(i==null)return!1;const a=i.path,s=dd(a),c=n_(a);if(this.#Z?.({isFolder:s,path:c})===!1)return!1;for(const d of po(a))this.#n.isExpanded(d)||this.#n.expand(d);return this.#E([a],a,!1),this.#u!=null&&(this.#X(null,!1),this.#P?.(this.#u)),this.#Q(a),this.#c=a,this.#g=pM(a),this.#R=n.removeIfCanceled??!1,this.#d(),!0}#Te(){if(this.#c==null)return;const t=this.#c,n=this.#R;if(this.#c=null,this.#g="",this.#R=!1,n){this.remove(t,dd(t)?{recursive:!0}:void 0);return}this.#Q(t),this.#d()}#ke(){const t=this.#c;if(t==null)return;if(this.#R&&this.#g.trim().length===0){this.#c=null,this.#g="",this.#R=!1,this.remove(t,dd(t)?{recursive:!0}:void 0);return}const n=dd(t),i=tM({files:this.#n.list(),isFolder:n,nextBasename:this.#g,path:n_(t)});if(this.#c=null,this.#g="",this.#R=!1,"error"in i){this.#Q(t),this.#F?.(i.error),this.#d();return}if(i.sourcePath===i.destinationPath){this.#Q(t),this.#d();return}this.#U?.({destinationPath:i.destinationPath,isFolder:i.isFolder,sourcePath:i.sourcePath}),this.move(i_(i.sourcePath,n),i_(i.destinationPath,n))}#Ae(t){this.#c==null||this.#g===t||(this.#g=t,this.#d())}resetPaths(t,n={}){const i=!Array.isArray(t),a=i?void 0:t,s=i?t:n,c=this.#n.list().length,d=this.#p,f=ZS({paths:a,preparedInput:s.preparedInput},"resetPaths",this.#e.sort),h=this.#oe(f.paths,f.preparedInput,s.initialExpandedPaths),m=this.#i,g=this.#c,y=this.getSelectedPaths(),b=this.#C;this.#Y?.(),this.#n=h,this.#b.clear(),this.#se();const S=y.map(A=>h.getPathInfo(A)?.path??null).filter(A=>A!=null),w=!fm(this.#s,S);this.#s=new Set(S),w&&(this.#K+=1),this.#C=b==null?null:h.getPathInfo(b)?.path??null,this.#c=g==null?null:h.getPathInfo(g)?.path??null,this.#c==null&&(this.#g="",this.#R=!1),this.#V(m,m!=null||S.length>0||this.#C!=null),this.#Y=this.#Ee(),this.#d(),this.#Se({canonicalChanged:!0,operation:"reset",pathCountAfter:f.paths.length,pathCountBefore:c,projectionChanged:!0,usedPreparedInput:s.preparedInput!=null,visibleCountDelta:this.#p-d})}#Le(t){this.#D();const n=hm(t),i=e_(t,n);let a=null,s=null;for(const c of this.#T()){if(hm(c)!==n)continue;const d=e_(c,n);if(d<i){a=c;continue}if(d>i){s=c;break}}return a??s}#z(t){const n=this.#te(t);if(n!==-1)return n;const i=po(t);for(let a=i.length-1;a>=0;a-=1){const s=i[a];if(s==null)continue;const c=this.#te(s);if(c!==-1)return c}return this.#T().length>0?0:-1}#ce(t,n){const i=this.#b.get(t);if(i!=null)return i;const a=n??this.#n.getPathInfo(t);if(a==null)return null;const s=a.kind==="directory"?this.#Ie(a.path):this.#Re(a.path);return this.#b.set(a.path,s),s}#re(t,n,i,a){return{ancestorPaths:a.ancestorPaths,depth:t.depth,flattenedSegments:t.flattenedSegments?.map(s=>({isTerminal:s.isTerminal,name:s.name,path:s.path})),hasChildren:t.hasChildren,index:n,isExpanded:t.isExpanded,isFlattened:t.isFlattened,isFocused:a.path===this.#i,isSelected:this.#s.has(a.path),kind:t.kind,level:t.depth,name:t.name,path:a.path,posInSet:a.posInSet??this.#j[i]??0,setSize:a.setSize??this.#$[i]??0}}#ue(t){return this.#re(t.row,t.index,t.index,{ancestorPaths:t.ancestorPaths,path:t.row.path,posInSet:t.posInSet,setSize:t.setSize})}#de(t,n){const i=this.#n.getVisibleRowContext(t);if(i==null)return;const a=i.ancestorRows[n];return a??(n===i.ancestorRows.length&&i.row.kind==="directory"&&i.row.isExpanded?i:void 0)}#fe(t){const n=this.#A.get(t);if(n!=null)return n;const i=this.#L(t),a=i<0?[]:[...this.#fe(i),i];return this.#A.set(t,a),a}#he(t){const n=this.#B.get(t);if(n!=null)return n;const i=this.#fe(t).map(a=>this.#o[a]??"").filter(a=>a!=="");return this.#B.set(t,i),i}#pe(t){this.#n.collapse(t)}#E(t,n=this.#C,i=!0){const a=[...new Set(t)],s=!fm(this.#s,a),c=this.#C!==n;!s&&!c||(this.#s=new Set(a),this.#C=n,s&&(this.#K+=1),i&&this.#d())}#Ie(t){return{collapse:()=>{this.#pe(t)},deselect:()=>{this.deselectPath(t)},expand:()=>{this.#_e(t)},focus:()=>{this.focusPath(t)},getPath:()=>t,isDirectory:()=>!0,isExpanded:()=>this.#n.isExpanded(t),isFocused:()=>this.#i===t,isSelected:()=>this.#s.has(t),select:()=>{this.selectPath(t)},toggleSelect:()=>{this.togglePathSelection(t)},toggle:()=>{this.#we(t)}}}#Re(t){return{deselect:()=>{this.deselectPath(t)},focus:()=>{this.focusPath(t)},getPath:()=>t,isDirectory:()=>!1,isFocused:()=>this.#i===t,isSelected:()=>this.#s.has(t),select:()=>{this.selectPath(t)},toggleSelect:()=>{this.togglePathSelection(t)}}}#De(t){const n=this.#n.list();this.#oe(n).batch(t)}#oe(t,n,i){return new Jg({...this.#e,paths:t,preparedInput:n??void 0,...i!==void 0?{initialExpandedPaths:i}:{}})}#ae(){return this.#_!=null?this.#_:(this.#_=this.#n.list(),this.#_)}#Me(){if(this.#S!=null)return this.#S;const t=new Set;for(const n of this.#ae()){t.add(n);for(const i of po(n))t.add(i)}return this.#S=[...t].sort(),this.#S}#Oe(){return this.#h!=null?this.#h:(this.#h=this.#ae().map(t_),this.#h)}#ee(){return this.#m!=null?this.#m:(this.#m=this.#Me().filter(t=>t.endsWith("/")),this.#m)}#Pe(){return this.#f!=null?this.#f:(this.#f=this.#ee().map(t_),this.#f)}#se(){this.#m=null,this.#f=null,this.#S=null,this.#_=null,this.#h=null}#Ne(){return this.#ee().filter(t=>this.#n.isExpanded(t))}#me(t){const n=new Set(this.#W??[]);if(t)for(const i of this.#s)for(const a of po(i))n.add(a);this.#ge(n)}#ge(t){this.#ie=!0;try{for(const n of this.#ee()){const i=t.has(n),a=this.#n.isExpanded(n);i&&!a?this.#n.expand(n):!i&&a&&this.#n.collapse(n)}}finally{this.#ie=!1}}#He(){if(this.#u==null||this.#u.length===0){this.#q=[],this.#w=null,this.#H=null,this.#M=null,this.#p=this.#ne;return}const t=this.#o;if(this.#q=t.filter(s=>this.#x.has(s)),this.#G!=="hide-non-matches"||this.#x.size===0){this.#w=null,this.#H=null,this.#M=null,this.#p=this.#ne;return}const n=[],i=[],a=new Map;for(const[s,c]of t.entries())this.#N?.has(c)===!0&&(a.set(c,i.length),n.push(s),i.push(c));this.#w=n,this.#H=i,this.#M=a,this.#p=i.length}#T(){return this.#H??this.#o}#ze(t){return this.#H!=null?this.#M?.get(t)??-1:this.#n.getVisibleIndex(t)??-1}#ve(t){return this.#w?.[t]??t}#te(t){const n=this.#M?.get(t);return n??this.#n.getVisibleIndex(t)??-1}#ye(t){const n=this.#q;if(n.length===0)return;const i=this.#i,a=i==null?-1:n.indexOf(i),s=n[a<0?t>0?0:n.length-1:Math.min(n.length-1,Math.max(0,a+t))];s!=null&&this.focusPath(s)}#X(t,n){const i=t==null?null:mM(t),a=this.#u;if(a!==i){if(a==null&&i!=null&&(this.#W=this.#Ne()),this.#u=i,i==null)this.#me(!0),this.#W=null,this.#x.clear(),this.#N=null,this.#V(this.#i,!0);else if(i.length===0)this.#me(!1),this.#x.clear(),this.#N=null,this.#V(this.#i,!0);else{const s=this.#be();this.#V(s,!0)}n&&(this.#P?.(this.#u),this.#d())}}#be(){if(this.#u==null||this.#u.length===0)return this.#x.clear(),this.#i;const t=this.#u,n=this.#ae(),i=this.#Oe(),a=[],s=new Set;let c=null;for(let g=0;g<n.length;g+=1){if(!i[g].includes(t))continue;const y=n[g];a.push(y),s.add(y),c??=y}const d=this.#ee(),f=this.#Pe();for(let g=0;g<d.length;g+=1){if(!f[g].includes(t))continue;const y=d[g];s.has(y)||(a.push(y),s.add(y),c??=y)}this.#x=s;const h=this.#G==="hide-non-matches"&&a.length>0?new Set:null;this.#N=h;const m=this.#G==="expand-matches"?new Set(this.#W??[]):new Set;for(const g of a){h?.add(g),g.endsWith("/")&&m.add(g);for(const y of po(g))m.add(y),h?.add(y)}return this.#ge(m),c??this.#i}#d(){for(const t of this.#t)t()}#Se(t){this.#l.get(t.operation)?.forEach(n=>{n(t)}),this.#l.get("*")?.forEach(n=>{n(t)})}#_e(t){for(const n of po(t))this.#n.isExpanded(n)||this.#n.expand(n);this.#n.isExpanded(t)||this.#n.expand(t)}#Ce(t){const n=this.#p;if(n===0)return;const i=this.#v===-1?0:this.#v,a=Math.min(n-1,Math.max(0,i+t));(a!==i||this.#v===-1)&&(!this.#y&&this.#w==null&&a>=this.#o.length&&this.#D(),this.#k(a))}#V(t,n=!0){const i=this.#n.getVisibleCount();this.#ne=i;const a=SM(this.#n.getVisibleTreeProjectionData(n?void 0:Math.min(i,gM)),t,n?s=>this.#n.getVisibleIndex(s):void 0);this.#A.clear(),this.#B.clear(),this.#y=a.paths.length>=i,this.#L=a.getParentIndex,this.#o=a.paths,this.#j=a.posInSetByIndex,this.#$=a.setSizeByIndex,this.#He(),this.#v=t==null?this.#T().length>0?0:-1:this.#z(t),this.#i=this.#v<0?null:this.#le(this.#v)}#le(t){const n=this.#T()[t];return n??(this.#w!=null?null:this.#n.getVisibleRowContext(t)?.row.path??null)}#O(t){return this.#n.getPathInfo(t)?.path??null}#Q(t){if(t==null)return;const n=this.#z(t);n>=0&&this.#k(n,!1)}#k(t,n=!0){const i=this.#le(t);i!=null&&(this.#v===t&&this.#i===i||(this.#v=t,this.#i=i,n&&this.#d()))}#D(){this.#y||this.#V(this.#i,!0)}#Ve(t){const n=Wl(this.#c,t);n==null&&this.#c!=null&&(this.#g=""),this.#c=n;const i=Wl(this.#i,t,!0),a=[...this.#s].map(f=>Wl(f,t)).filter(f=>f!=null).map(f=>this.#n.getPathInfo(f)?.path??null).filter(f=>f!=null),s=Wl(this.#C,t),c=s==null?null:this.#n.getPathInfo(s)?.path??null,d=[...new Set(a)];return fm(this.#s,d)||(this.#s=new Set(d),this.#K+=1),this.#C=c,i}#Ee(){return this.#n.on("*",t=>{if(this.#ie)return;t.canonicalChanged&&(this.#b.clear(),this.#se()),this.#r!=null&&JS(t)&&(this.#r=null);const n=JS(t)?this.#Ve(t):this.#i,i=this.#u!=null&&this.#u.length>0?this.#be():this.#u===""?this.#i:n,a=this.#u!=null||t.operation!=="expand"&&t.operation!=="collapse";this.#V(i,a),this.#d();const s=hM(t);s!=null&&this.#Se(s)})}#we(t){if(this.#n.isExpanded(t)){this.#pe(t);return}this.#_e(t)}};const CM=e=>{if(e==null||e.length===0)return"0";let t=`${e.length}`;for(const n of e)t+=`\0${n.path}\0${n.status}`;return t};function EM(e){const t=e.endsWith("/");let n="",i=-1;for(let a=0;a<=e.length;a+=1){if(!(e[a]==="/"||a===e.length)){i===-1&&(i=a);continue}i!==-1&&(n!==""&&(n+="/"),n+=e.slice(i,a),i=-1)}return n===""?null:{isDirectory:t,path:n}}function c5(e){const t=e.endsWith("/")?e.slice(0,-1):e;if(t.length===0)return[];const n=[];let i=0;for(;;){const a=t.indexOf("/",i);if(a===-1)break;n.push(t.slice(0,a+1)),i=a+1}return n}function wM(e,t){return t?`${e}/`:e}function r_(e,t=null){const n=CM(e==null?void 0:[...e]);if(n==="0")return null;if(t?.signature===n)return t;const i=new Map,a=new Set,s=new Set,c=new Map;for(const d of e??[]){const f=u5(d);f!=null&&f5({canonicalPath:f.canonicalPath,changeCountByDirectoryPath:c,directoriesWithChanges:a,ignoredDirectoryPaths:s,isDirectory:f.isDirectory,status:d.status,statusByPath:i})}return i.size===0?null:{changeCountByDirectoryPath:c,directoriesWithChanges:a,ignoredDirectoryPaths:s,signature:n,statusByPath:i}}function xM(e,t){const n=t?.remove??[],i=t?.set??[];if(n.length===0&&i.length===0)return e;const a=new Map(e?.statusByPath),s=new Set(e?.directoriesWithChanges),c=new Set(e?.ignoredDirectoryPaths),d=new Map(e?.changeCountByDirectoryPath);let f=!1;for(const h of n){const m=d5(h);m!=null&&(f=TM({canonicalPath:m.canonicalPath,changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,statusByPath:a})||f)}for(const h of i){const m=u5(h);m!=null&&(f=f5({canonicalPath:m.canonicalPath,changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,isDirectory:m.isDirectory,status:h.status,statusByPath:a})||f)}return f?a.size===0?null:{changeCountByDirectoryPath:d,directoriesWithChanges:s,ignoredDirectoryPaths:c,signature:LM(a),statusByPath:a}:e}function u5(e){return d5(e.path)}function d5(e){const t=EM(e);if(t!=null)return{canonicalPath:wM(t.path,t.isDirectory),isDirectory:t.isDirectory}}function TM({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:i,statusByPath:a}){const s=a.get(e);return s==null?!1:(a.delete(e),s==="ignored"&&e.endsWith("/")&&i.delete(e),AM(t,n,e),!0)}function f5({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:i,isDirectory:a,status:s,statusByPath:c}){const d=c.get(e);return d===s?!1:(d==null&&kM(t,n,e),c.set(e,s),s==="ignored"&&a?i.add(e):a&&i.delete(e),!0)}function kM(e,t,n){for(const i of c5(n))e.set(i,(e.get(i)??0)+1),t.add(i)}function AM(e,t,n){for(const i of c5(n)){const a=(e.get(i)??0)-1;a>0?e.set(i,a):(e.delete(i),t.delete(i))}}function LM(e){let t=`${e.size}`;for(const[n,i]of e)t+=`\0${n}\0${i}`;return t}var ft,h5,ea,o_,Zd,p5,m5,e0,cg,ug,Sc={},g5=[],_f=Array.isArray,t0=g5.slice,_o=Object.assign;function n0(e){e&&e.parentNode&&e.remove()}function dg(e,t,n){var i,a,s,c={};for(s in t)s=="key"?i=t[s]:s=="ref"&&typeof e!="function"?a=t[s]:c[s]=t[s];return arguments.length>2&&(c.children=arguments.length>3?t0.call(arguments,2):n),wd(e,c,i,a,null)}function wd(e,t,n,i,a){var s={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++h5,__i:-1,__u:0};return a==null&&ft.vnode!=null&&ft.vnode(s),s}function xs(e){return e.children}function xd(e,t){this.props=e,this.context=t,this.__g=0}function bs(e,t){if(t==null)return e.__?bs(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?bs(e):null}function v5(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return v5(e)}}function a_(e){(8&e.__g||!(e.__g|=8)||!ea.push(e)||Zd++)&&o_==ft.debounceRendering||((o_=ft.debounceRendering)||queueMicrotask)(IM)}function IM(){for(var e,t,n,i,a,s,c,d,f=1;ea.length;)ea.length>f&&ea.sort(p5),e=ea.shift(),f=ea.length,8&e.__g&&(n=void 0,a=(i=(t=e).__v).__e,s=[],c=[],(d=t.__P)&&((n=_o({},i)).__v=i.__v+1,ft.vnode&&ft.vnode(n),i0(d,n,i,t.__n,d.namespaceURI,32&i.__u?[a]:null,s,a??bs(i),!!(32&i.__u),c,d.ownerDocument),n.__v=i.__v,n.__.__k[n.__i]=n,S5(s,n,c),n.__e!=a&&v5(n)));Zd=0}function y5(e,t,n,i,a,s,c,d,f,h,m,g){var y,b,S,w,A,k,E,T=i&&i.__k||g5,L=t.length;for(f=RM(n,t,T,f,L),y=0;y<L;y++)(S=n.__k[y])!=null&&(b=S.__i==-1?Sc:T[S.__i]||Sc,S.__i=y,k=i0(e,S,b,a,s,c,d,f,h,m,g),w=S.__e,S.ref&&b.ref!=S.ref&&(b.ref&&r0(b.ref,null,S),m.push(S.ref,S.__c||w,S)),A==null&&w!=null&&(A=w),(E=!!(4&S.__u))||b.__k===S.__k?f=b5(S,f,e,E):typeof S.type=="function"&&k!==void 0?f=k:w&&(f=w.nextSibling),S.__u&=-7);return n.__e=A,f}function RM(e,t,n,i,a){var s,c,d,f,h,m=n.length,g=m,y=0;for(e.__k=new Array(a),s=0;s<a;s++)(c=t[s])!=null&&typeof c!="boolean"&&typeof c!="function"?(f=s+y,(c=e.__k[s]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?wd(null,c,null,null,null):_f(c)?wd(xs,{children:c},null,null,null):c.constructor==null&&c.__b>0?wd(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=e,c.__b=e.__b+1,d=null,(h=c.__i=DM(c,n,f,g))!=-1&&(g--,(d=n[h])&&(d.__u|=2)),d==null||d.__v==null?(h==-1&&(a>m?y--:a<m&&y++),typeof c.type!="function"&&(c.__u|=4)):h!=f&&(h==f-1?y--:h==f+1?y++:(h>f?y--:y++,c.__u|=4))):e.__k[s]=null;if(g)for(s=0;s<m;s++)(d=n[s])!=null&&(2&d.__u)==0&&(d.__e==i&&(i=bs(d)),C5(d,d));return i}function b5(e,t,n,i){var a,s;if(typeof e.type=="function"){for(a=e.__k,s=0;a&&s<a.length;s++)a[s]&&(a[s].__=e,t=b5(a[s],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=bs(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function DM(e,t,n,i){var a,s,c,d=e.key,f=e.type,h=t[n],m=h!=null&&(2&h.__u)==0;if(h===null&&e.key==null||m&&d==h.key&&f==h.type)return n;if(i>(m?1:0)){for(a=n-1,s=n+1;a>=0||s<t.length;)if((h=t[c=a>=0?a--:s++])!=null&&(2&h.__u)==0&&d==h.key&&f==h.type)return c}return-1}function s_(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n??""}function fd(e,t,n,i,a){var s;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||s_(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||s_(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(m5,"$1")),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||(e.__l={}),e.__l[t+s]=n,n?i?n.l=i.l:(n.l=e0,e.addEventListener(t,s?ug:cg,s)):e.removeEventListener(t,s?ug:cg,s);else{if(a=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function l_(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=e0++;else if(t.u<n.l)return;return n(ft.event?ft.event(t):t)}}}function i0(e,t,n,i,a,s,c,d,f,h,m){var g,y,b,S,w,A,k,E,T,L,O,D,N,K,G,se,ie,ee,te,le,me,H=t.type;if(t.constructor!=null)return null;128&n.__u&&(f=!!(32&n.__u),n.__c.__z&&(d=t.__e=n.__e=(s=n.__c.__z)[0],n.__c.__z=null)),(g=ft.__b)&&g(t);e:if(typeof H=="function")try{if(E=t.props,T="prototype"in H&&H.prototype.render,L=(g=H.contextType)&&i[g.__c],O=g?L?L.props.value:g.__:i,n.__c?2&(y=t.__c=n.__c).__g&&(y.__g|=1,k=!0):(T?t.__c=y=new H(E,O):(t.__c=y=new xd(E,O),y.constructor=H,y.render=OM),L&&L.sub(y),y.props=E,y.state||(y.state={}),y.context=O,y.__n=i,b=!0,y.__g|=8,y.__h=[],y._sb=[]),T&&y.__s==null&&(y.__s=y.state),T&&H.getDerivedStateFromProps!=null&&(y.__s==y.state&&(y.__s=_o({},y.__s)),_o(y.__s,H.getDerivedStateFromProps(E,y.__s))),S=y.props,w=y.state,y.__v=t,b)T&&H.getDerivedStateFromProps==null&&y.componentWillMount!=null&&y.componentWillMount(),T&&y.componentDidMount!=null&&y.__h.push(y.componentDidMount);else{if(T&&H.getDerivedStateFromProps==null&&E!==S&&y.componentWillReceiveProps!=null&&y.componentWillReceiveProps(E,O),!(4&y.__g)&&y.shouldComponentUpdate!=null&&y.shouldComponentUpdate(E,y.__s,O)===!1||t.__v==n.__v){for(t.__v!=n.__v&&(y.props=E,y.state=y.__s,y.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(z){z&&(z.__=t)}),D=0;D<y._sb.length;D++)y.__h.push(y._sb[D]);y._sb=[],y.__h.length&&c.push(y);break e}y.componentWillUpdate!=null&&y.componentWillUpdate(E,y.__s,O),T&&y.componentDidUpdate!=null&&y.__h.push(function(){y.componentDidUpdate(S,w,A)})}if(y.context=O,y.props=E,y.__P=e,y.__g&=-5,N=ft.__r,K=0,T){for(y.state=y.__s,y.__g&=-9,N&&N(t),g=y.render(y.props,y.state,y.context),G=0;G<y._sb.length;G++)y.__h.push(y._sb[G]);y._sb=[]}else do y.__g&=-9,N&&N(t),g=y.render(y.props,y.state,y.context),y.state=y.__s;while(8&y.__g&&++K<25);y.state=y.__s,y.getChildContext!=null&&(i=_o({},i,y.getChildContext())),T&&!b&&y.getSnapshotBeforeUpdate!=null&&(A=y.getSnapshotBeforeUpdate(S,w)),se=g,g!=null&&g.type===xs&&g.key==null&&(se=_5(g.props.children)),d=y5(e,_f(se)?se:[se],t,n,i,a,s,c,d,f,h,m),t.__u&=-161,y.__h.length&&c.push(y),k&&(y.__g&=-4)}catch(z){if(t.__v=null,f||s!=null)if(z.then){for(ie=0,ee=!1,t.__u|=f?160:128,t.__c.__z=[],te=0;te<s.length;te++)(le=s[te])==null||ee||(le.nodeType==8&&le.data=="$s"?(ie>0&&t.__c.__z.push(le),ie++,s[te]=null):le.nodeType==8&&le.data=="/$s"?(--ie>0&&t.__c.__z.push(le),ee=ie===0,d=s[te],s[te]=null):ie>0&&(t.__c.__z.push(le),s[te]=null));if(!ee){for(;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;s[s.indexOf(d)]=null,t.__c.__z=[d]}t.__e=d}else{for(me=s.length;me--;)n0(s[me]);fg(t)}else t.__e=n.__e,t.__k=n.__k,z.then||fg(t);ft.__e(z,t,n)}else d=t.__e=MM(n.__e,t,n,i,a,s,c,f,h,m);return(g=ft.diffed)&&g(t),128&t.__u?void 0:d}function fg(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(fg)}function S5(e,t,n){for(var i=0;i<n.length;i++)r0(n[i],n[++i],n[++i]);ft.__c&&ft.__c(t,e),e.some(function(a){try{e=a.__h,a.__h=[],e.some(function(s){s.call(a)})}catch(s){ft.__e(s,a.__v)}})}function _5(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:_f(e)?e.map(_5):_o({},e)}function MM(e,t,n,i,a,s,c,d,f,h){var m,g,y,b,S,w,A,k,E=n.props,T=t.props,L=t.type;if(L=="svg"?a="http://www.w3.org/2000/svg":L=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),s!=null){for(m=0;m<s.length;m++)if((S=s[m])&&"setAttribute"in S==!!L&&(L?S.localName==L:S.nodeType==3)){e=S,s[m]=null;break}}if(e==null){if(L==null)return h.createTextNode(T);e=h.createElementNS(a,L,T.is&&T),d&&(ft.__m&&ft.__m(t,s),d=!1),s=null}if(L==null)E===T||d&&e.data==T||(e.data=T);else{if(s=s&&t0.call(e.childNodes),E=n.props||Sc,!d&&s!=null)for(E={},m=0;m<e.attributes.length;m++)E[(S=e.attributes[m]).name]=S.value;for(m in E)if(S=E[m],m!="children"){if(m=="dangerouslySetInnerHTML")y=S;else if(!(m in T)){if(m=="value"&&"defaultValue"in T||m=="checked"&&"defaultChecked"in T)continue;fd(e,m,null,S,a)}}for(m in k=1&n.__u,T)S=T[m],m=="children"?b=S:m=="dangerouslySetInnerHTML"?g=S:m=="value"?w=S:m=="checked"?A=S:d&&typeof S!="function"||E[m]===S&&!k||fd(e,m,S,E[m],a);if(g)d||y&&(g.__html==y.__html||g.__html==e.innerHTML)||(e.innerHTML=g.__html),t.__k=[];else if(y&&(e.innerHTML=""),y5(L=="template"?e.content:e,_f(b)?b:[b],t,n,i,L=="foreignObject"?"http://www.w3.org/1999/xhtml":a,s,c,s?s[0]:n.__k&&bs(n,0),d,f,h),s!=null)for(m=s.length;m--;)n0(s[m]);d||(m="value",L=="progress"&&w==null?e.removeAttribute("value"):w==null||w===e[m]&&(L!=="progress"||w)||fd(e,m,w,E[m],a),m="checked",A!=null&&A!=e[m]&&fd(e,m,A,E[m],a))}return e}function r0(e,t,n){try{if(typeof e=="function"){var i=typeof e.__u=="function";i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(a){ft.__e(a,n)}}function C5(e,t,n){var i,a;if(ft.unmount&&ft.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||r0(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){ft.__e(s,t)}i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&C5(i[a],t,n||typeof e.type!="function");n||n0(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function OM(e,t,n){return this.constructor(e,n)}function hg(e,t){var n,i,a,s;t==document&&(t=document.documentElement),ft.__&&ft.__(e,t),i=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=dg(xs,null,[e]),a=[],s=[],i0(t,e,i||Sc,Sc,t.namespaceURI,i?null:t.firstChild?t0.call(t.childNodes):null,a,i?i.__e:t.firstChild,n,s,t.ownerDocument),S5(a,e,s)}function PM(e,t){e.__u|=32,hg(e,t)}ft={__e:function(e,t,n,i){for(var a,s,c;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=a.constructor)&&s.getDerivedStateFromError!=null&&(a.setState(s.getDerivedStateFromError(e)),c=8&a.__g),a.componentDidCatch!=null&&(a.componentDidCatch(e,i||{}),c=8&a.__g),c)return void(a.__g|=2)}catch(d){e=d}}throw Zd=0,e}},h5=0,xd.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=_o({},this.state),typeof e=="function"&&(e=e(_o({},n),this.props)),e&&_o(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),a_(this))},xd.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),a_(this))},xd.prototype.render=xs,ea=[],Zd=0,p5=function(e,t){return e.__v.__b-t.__v.__b},m5=/(PointerCapture)$|Capture$/i,e0=0,cg=l_(!1),ug=l_(!0);var NM=0;function pe(e,t,n,i,a,s){t||(t={});var c,d,f=t;if("ref"in f&&typeof e!="function")for(d in f={},t)d=="ref"?c=t[d]:f[d]=t[d];var h={type:e,props:f,key:n,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--NM,__i:-1,__u:0,__source:a,__self:s};return ft.vnode&&ft.vnode(h),h}const HM=16,zM=16,VM={};function ec({name:e,remappedFrom:t,token:n,width:i,height:a,viewBox:s,label:c,alignCapitals:d=!1}){"use no memo";const f=`#${e.replace(/^#/,"")}`,{width:h,height:m,viewBox:g}=VM[e]??{width:HM,height:zM},y=i??h,b=a??m,S=s??g??`0 0 ${h} ${m}`;return pe("svg",{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":d,...c!=null?{"aria-label":c,role:"img"}:{"aria-hidden":!0},viewBox:S,width:y,height:b,children:pe("use",{href:f})})}const c_=e=>e!==void 0&&/\s/.test(e),BM=(e,t)=>{const n=i=>c_(e[i-1])||c_(e[i]);if(!n(t))return t;for(let i=1;i<e.length;i++){const a=t-i;if(a>0&&!n(a))return a;const s=t+i;if(s<e.length&&!n(s))return s}return t},E5=e=>BM(e,Math.ceil(e.length/2)),u_=e=>{if(e.length<2)return[e,""];const t=E5(e);return[e.slice(0,t),e.slice(t)]},UM=e=>{if(e.length<4)return[e,""];const t=e.lastIndexOf(".")+1,n=e.length-t>10,i=t>=1&&!n?t:E5(e);return[e.slice(0,i),e.slice(i)]},FM=e=>{if(e.length<4)return[e,""];const t=e.lastIndexOf("/")+1,n=e.length-t>25,i=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]},jM=(e,{splitIndex:t}={})=>{if(typeof t!="number"){const n=Math.ceil(e.length/2);return[e.slice(0,n),e.slice(n)]}return[e.slice(0,t),e.slice(t)]},$M=(e,{splitOffset:t}={})=>{if(typeof t!="number"||t<=0||t>=e.length){const i=Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]}const n=e.length-t;return[e.slice(0,n),e.slice(n)]},qM=(e,{splitOffset:t}={})=>{if(typeof t!="number"||t<=0||t>=e.length){const i=Math.ceil(e.length/2);return[e.slice(0,i),e.slice(i)]}const n=t;return[e.slice(0,n),e.slice(n)]};function GM({children:e,marker:t,variant:n="default"}){"use no memo";return pe("div",{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:pe("div",{"data-truncate-marker":!0,children:typeof t=="function"?t({children:e}):n==="fade"?pe("span",{"data-truncate-fade":!0}):t})})}function WM(e){"use no memo";const{mode:t,children:n}=e;return pe("div",{children:[pe("div",{"data-truncate-content":"visible",children:t==="fruncate"?pe("span",{children:n}):n}),pe("div",{"data-truncate-content":"overflow","aria-hidden":!0,children:t==="fruncate"?pe("span",{children:n}):n})]})}function w5({children:e,mode:t="truncate",marker:n="…",variant:i="default",...a}){"use no memo";const s=pe(WM,{mode:t,children:e},"content"),c=pe(GM,{marker:n,mode:t,variant:i},"marker");return pe("div",{"data-truncate-container":t,"data-truncate-variant":i,...a,children:pe("div",{"data-truncate-grid":!0,children:t==="truncate"?[s,c]:[c,s,pe("div",{"data-truncate-fill":!0},"fill")]})})}function Td({children:e,...t}){"use no memo";return pe(w5,{mode:"truncate",...t,children:e})}function pm({children:e,...t}){"use no memo";return pe(w5,{mode:"fruncate",...t,children:e})}function KM({children:e,contents:t,priority:n="end",split:i="center",minimumLength:a=12,className:s,style:c,...d}){"use no memo";let f=null,h=null;if(Array.isArray(t)){if(t.length!==2)return console.error("MiddleTruncate: contents must be an array of two items"),null;f=pe(Td,{...d,children:t[0]}),h=pe(pm,{...d,children:t[1]})}else{if(typeof e!="string")return console.error("MiddleTruncate: children must be a string"),null;if(e.length===0)return pe("div",{className:s,style:c});if(e.length<a)return n==="end"?pe(pm,{...d,className:s,style:c,children:e}):pe(Td,{...d,className:s,style:c,children:e});let m=null,g=null,y=null;if(typeof i=="string")i==="center"?m=u_:i==="extension"?m=UM:i==="leaf-path"&&(m=FM);else if(typeof i=="number")m=jM,g=i;else if(Array.isArray(i)){const[L,O]=i;y=O,L==="last"?m=$M:L==="first"&&(m=qM)}else typeof i=="function"&&(m=i);m??=u_;const[b,S]=m(e,{priority:n,variant:d.variant,splitIndex:typeof g=="number"?g:void 0,splitOffset:typeof y=="number"?y:void 0}),w=b.length>=S.length,A=n==="equal"&&!w,k=n==="equal"&&w,E={},T={};A&&(E.marker=""),k&&(T.marker=""),f=pe(Td,{...d,...E,children:b}),h=pe(pm,{...d,...T,children:S})}return pe("div",{"data-truncate-group-container":"middle",className:s,style:c,children:[pe("div",{"data-truncate-segment-priority":n==="start"||n==="equal"?"1":"2",children:f}),pe("div",{"data-truncate-segment-priority":n==="end"||n==="equal"?"1":"2",children:h})]})}const pg={endIndex:-1,startIndex:-1};function YM(e,t,n){return Math.min(Math.max(e,t),n)}function d_(e,t){return e<0||t<e?pg:{endIndex:t,startIndex:e}}function mg(e){return e.startIndex<0||e.endIndex<e.startIndex}function XM(e,t){return mg(e)?0:(e.endIndex-e.startIndex+1)*t}function f_(e,t,n){if(t<=0)return-1;const i=t*n;return e<=0?0:e>=i?t:Math.floor(e/n)}function QM(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function ZM(e){const t=new Map;return e.forEach((n,i)=>{if(n.kind!=="directory"||!n.isExpanded)return;const a=n.ancestorPaths.length,s=t.get(a);if(s==null){t.set(a,[i]);return}s.push(i)}),t}function JM(e,t){let n=0,i=e.length-1,a=-1;for(;n<=i;){const s=Math.floor((n+i)/2),c=e[s];if(c==null)break;if(c<=t){a=s,n=s+1;continue}i=s-1}return a}function eO(e){const t=new Map,n=[];for(let a=0;a<e.length;a+=1){const s=e[a];if(s==null)continue;const c=s.kind==="directory"&&s.isExpanded?[...s.ancestorPaths,s.path]:s.ancestorPaths;let d=0;for(;d<n.length&&d<c.length&&n[d]===c[d];)d+=1;for(let f=n.length-1;f>=d;f-=1){const h=n[f];h!=null&&t.set(h,a-1)}n.length=d;for(let f=d;f<c.length;f+=1){const h=c[f];h!=null&&n.push(h)}}const i=e.length-1;for(const a of n)t.set(a,i);return t}function x5(e,t,n){if(e.length===0||t<=0)return[];const i=eO(e),a=ZM(e),s=[];for(let c=0;c<e.length;c+=1){const d=a.get(c);if(d==null||d.length===0)break;const f=t+c*n;let h=JM(d,Math.min(e.length-1,Math.floor(f/n))),m=null;for(;h>=0;){const g=d[h],y=g==null?null:e[g]??null;if(y!=null&&(c===0||y.ancestorPaths[c-1]===s[c-1]?.path)){m=y;break}h-=1}if(m==null)break;s.push(m)}return s.map((c,d)=>{const f=d*n,h=(i.get(c.path)??e.length-1)+1;if(h>=e.length)return{row:c,top:f};const m=h*n-t;return{row:c,top:Math.min(f,m-n)}}).filter(c=>c.top+n>0)}function tO(e,t){const n=t.totalRowCount??e.length,i=n*t.itemHeight,a=Math.max(0,t.viewportHeight),s=Math.max(0,Math.floor(t.overscan)),c=Math.max(0,i-a),d=YM(t.scrollTop,0,c),f=t.stickyRows??x5(e,d,t.itemHeight),h=f.reduce((D,N)=>Math.max(D,N.top+t.itemHeight),0),m=Math.min(i,d+h),g=Math.max(0,a-h),y=Math.max(0,i-m),b=f_(d,n,t.itemHeight),S=f_(m,n,t.itemHeight),w=h<=0||b<0||b>=n?-1:b,A=w===-1?-1:Math.min(n-1,S-1),k=w===-1||A<w?0:A-w+1,E=g<=0||S>=n?pg:d_(S,QM(m+g,n,t.itemHeight)),T=A+1,L=mg(E)?pg:d_(Math.max(T,E.startIndex-s),Math.min(n-1,E.endIndex+s)),O=XM(L,t.itemHeight);return{occlusion:{firstOccludedIndex:w,lastOccludedIndex:A,occludedCount:k},physical:{itemHeight:t.itemHeight,maxScrollTop:c,overscan:s,scrollTop:d,totalHeight:i,totalRowCount:n,viewportHeight:a},projected:{contentHeight:y,paneHeight:g,paneTop:m},sticky:{height:h,rows:f},visible:E,window:{endIndex:L.endIndex,height:O,offsetTop:mg(L)?0:L.startIndex*t.itemHeight,startIndex:L.startIndex}}}const nO={added:"A",deleted:"D",ignored:null,modified:"M",renamed:"R",untracked:"U"},iO={added:"Git status: added",deleted:"Git status: deleted",ignored:"Git status: ignored",modified:"Git status: modified",renamed:"Git status: renamed",untracked:"Git status: untracked"},rO="Contains git status items";function oO(e){return e.current?!0:(e.current=!0,!1)}function T5(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,topInset:a=0,viewportHeight:s}=e;if(n<0)return null;const c=Math.max(0,a),d=n*i,f=d+i;if(d<t+c){const h=Math.max(0,d-c);return h===t?null:h}if(f>t+s){const h=f-s;return h===t?null:h}return null}function aO(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,offset:a,topInset:s=0,totalHeight:c,viewportHeight:d}=e;if(a==="nearest")return T5({currentScrollTop:t,focusedIndex:n,itemHeight:i,topInset:s,viewportHeight:d});if(n<0)return null;const f=Math.max(0,s),h=n*i,m=Math.max(0,d-f),g=a==="center"?f+Math.max(0,(m-i)/2):f,y=Math.max(0,c-d),b=Math.max(0,Math.min(h-g,y));return b===t?null:b}function sO(e){const{currentScrollTop:t,focusedIndex:n,itemHeight:i,targetViewportOffset:a,totalHeight:s,viewportHeight:c}=e;if(n<0)return null;const d=Math.max(0,a),f=n*i,h=f+i,m=t+d,g=t+c;if(f>=m&&h<=g)return null;const y=Math.max(0,s-c),b=Math.max(0,Math.min(f-d,y));return b===t?null:b}function cs(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});const t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function hd(e){const t=e.getRootNode();if(t instanceof ShadowRoot){const i=t.activeElement;return i instanceof HTMLElement?i:null}const n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function Hl(e,t){if(e==null)return t;const n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function h_(e,t){return e!=null&&e>0?e:t}function lO(e){const t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function p_(e,t,n,i,a=0){const s=T5({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:a,viewportHeight:i});return s==null?!1:(e.scrollTop=s,!0)}function cO(e,t,n,i,a,s,c=0){const d=aO({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:s,topInset:c,totalHeight:a,viewportHeight:i});return d==null?!1:(e.scrollTop=d,!0)}function zl(e,t,n,i,a,s){const c=sO({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:s,totalHeight:a,viewportHeight:i});return c==null?!1:(e.scrollTop=c,!0)}function m_(e,t,n,i){return n.end<n.start?null:e<n.start?-t:e>n.end?i:null}function uO(e){const{renamingPath:t,previousRenamingPath:n,hasRenderedInput:i}=e;return t==null?"reset":i?n===t?"ignore":"focus-input":"reveal-canonical"}function dO({ariaLabel:e,isFlattened:t=!1,ref:n,value:i,onBlur:a,onInput:s}){return pe("input",{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:i,onBlur:a,onInput:s,onClick:c=>c.stopPropagation(),onMouseDown:c=>c.stopPropagation(),onPointerDown:c=>c.stopPropagation()})}function fO(e){const{row:t,mode:n,targetPath:i,ariaLabel:a,domId:s,isParked:c,itemHeight:d,features:f,state:h,extraStyle:m}=e,g=n==="sticky",y=t.ancestorPaths.at(-1)??"",b={};return h.isFocusRinged&&(b["data-item-focused"]=!0),t.isSelected&&(b["data-item-selected"]=!0),h.isContextHovered&&(b["data-item-context-hover"]="true"),h.isDragTarget&&(b["data-item-drag-target"]=!0),h.isDragging&&(b["data-item-dragging"]=!0),h.effectiveGitStatus!=null&&(b["data-item-git-status"]=h.effectiveGitStatus),h.containsGitChange&&(b["data-item-contains-git-change"]="true"),{"aria-expanded":!g&&t.kind==="directory"?t.isExpanded:void 0,"aria-haspopup":f.contextMenuEnabled?"menu":void 0,"aria-label":a,"aria-level":g?void 0:t.level+1,"aria-posinset":g?void 0:t.posInSet+1,"aria-selected":g?void 0:t.isSelected?"true":"false","aria-setsize":g?void 0:t.setSize,"data-file-tree-sticky-path":g?i:void 0,"data-file-tree-sticky-row":g?"true":void 0,"data-item-context-menu-button-visibility":f.actionLaneEnabled?f.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":f.contextMenuEnabled?f.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":f.actionLaneEnabled?"true":void 0,"data-item-has-git-lane":f.gitLaneActive?"true":void 0,"data-item-parent-path":y.length>0?y:void 0,"data-item-parked":c?"true":void 0,"data-item-path":i,"data-item-type":t.kind==="directory"?"folder":"file","data-type":"item",id:g?void 0:s,role:g?void 0:"treeitem",style:{minHeight:`${d}px`,...m},tabIndex:!g&&t.isFocused?0:-1,...b}}function hO(e){const{event:t,mode:n,isSearchOpen:i,isDirectory:a}=e,s=t.ctrlKey||t.metaKey,c=t.shiftKey||s,d=t.shiftKey?{additive:s,kind:"range"}:s?{kind:"toggle"}:{kind:"single"};return{closeSearch:i,revealCanonical:n==="sticky",selection:d,toggleDirectory:!c&&a}}var Ss,Lt,mm,g_,gg=Object.is,_c=0,k5=[],Ot=ft,v_=Ot.__b,y_=Ot.__r,b_=Ot.diffed,S_=Ot.__c,__=Ot.unmount,C_=Ot.__;function Cf(e,t){Ot.__h&&Ot.__h(Lt,e,_c||t),_c=0;var n=Lt.__H||(Lt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Vi(e){return _c=1,pO(A5,e)}function pO(e,t,n){var i=Cf(Ss++,2);if(i.t=e,!i.__c&&(i.__=[A5(void 0,t),function(d){var f=i.__N?i.__N[0]:i.__[0],h=i.t(f,d);gg(f,h)||(i.__N=[h,i.__[1]],i.__c.setState({}))}],i.__c=Lt,!Lt.__f)){var a=function(d,f,h){if(!i.__c.__H)return!0;var m=i.__c.__H.__.filter(function(y){return!!y.__c});if(m.every(function(y){return!y.__N}))return!s||s.call(this,d,f,h);var g=i.__c.props!==d;return m.forEach(function(y){if(y.__N){var b=y.__[0];y.__=y.__N,y.__N=void 0,gg(b,y.__[0])||(g=!0)}}),s&&s.call(this,d,f,h)||g};Lt.__f=!0;var s=Lt.shouldComponentUpdate,c=Lt.componentWillUpdate;Lt.componentWillUpdate=function(d,f,h){if(4&this.__g){var m=s;s=void 0,a(d,f,h),s=m}c&&c.call(this,d,f,h)},Lt.shouldComponentUpdate=a}return i.__N||i.__}function E_(e,t){var n=Cf(Ss++,3);!Ot.__s&&o0(n.__H,t)&&(n.__=e,n.u=t,Lt.__H.__h.push(n))}function Gn(e,t){var n=Cf(Ss++,4);!Ot.__s&&o0(n.__H,t)&&(n.__=e,n.u=t,Lt.__h.push(n))}function Re(e){return _c=5,mo(function(){return{current:e}},[])}function mo(e,t){var n=Cf(Ss++,7);return o0(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function pn(e,t){return _c=8,mo(function(){return e},t)}function mO(){for(var e;e=k5.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kd),e.__H.__h.forEach(vg),e.__H.__h=[]}catch(t){e.__H.__h=[],Ot.__e(t,e.__v)}}Ot.__b=function(e){Lt=null,v_&&v_(e)},Ot.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),C_&&C_(e,t)},Ot.__r=function(e){y_&&y_(e),Ss=0;var t=(Lt=e.__c).__H;t&&(mm===Lt?(t.__h=[],Lt.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(kd),t.__h.forEach(vg),t.__h=[],Ss=0)),mm=Lt},Ot.diffed=function(e){b_&&b_(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(k5.push(t)!==1&&g_===Ot.requestAnimationFrame||((g_=Ot.requestAnimationFrame)||gO)(mO)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),mm=Lt=null},Ot.__c=function(e,t){t.some(function(n){try{n.__h.forEach(kd),n.__h=n.__h.filter(function(i){return!i.__||vg(i)})}catch(i){t.some(function(a){a.__h&&(a.__h=[])}),t=[],Ot.__e(i,n.__v)}}),S_&&S_(e,t)},Ot.unmount=function(e){__&&__(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(i){try{kd(i)}catch(a){t=a}}),n.__H=void 0,t&&Ot.__e(t,n.__v))};var w_=typeof requestAnimationFrame=="function";function gO(e){var t,n=function(){clearTimeout(i),w_&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);w_&&(t=requestAnimationFrame(n))}function kd(e){var t=Lt,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Lt=t}function vg(e){var t=Lt;e.__c=e.__(),Lt=t}function o0(e,t){return!e||e.length!==t.length||t.some(function(n,i){return!gg(n,e[i])})}function A5(e,t){return typeof t=="function"?t(e):t}function vO(e,t=null,n=null){"use no memo";const i=e.flattenedSegments;return i==null||i.length===0?t??e.name:pe("span",{"data-item-flattened-subitems":!0,children:i.map((a,s)=>{const c=s===i.length-1;return pe(xs,{children:[pe("span",{"data-item-flattened-subitem":a.path,"data-item-flattened-subitem-drag-target":n===a.path?"true":void 0,children:c&&t!=null?t:pe(Td,{children:a.name})}),s<i.length-1?" / ":""]},a.path)})})}function gs(e){return e.isFlattened?e.flattenedSegments?.findLast(t=>t.isTerminal)?.path??e.path:e.path}function yg(e){const t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(n=>n.name).join(" / ")}function x_(e,t,n,i){return e.map((a,s)=>{const c=s*n,d=a.subtreeEndIndex+1;if(d>=i)return{row:a.row,top:c};const f=d*n-t;return{row:a.row,top:Math.min(c,f-n)}}).filter(a=>a.top+n>0)}function gm({controller:e,itemHeight:t,overscan:n,scrollTop:i,stickyFolders:a,viewportHeight:s}){const c=e.getVisibleCount(),d=a&&c>0?e.getStickyRowCandidates(i,t):[],f=d==null&&a&&c>0?e.getVisibleRows(0,c-1):[],h=tO(f,{itemHeight:t,overscan:n,scrollTop:i,stickyRows:d==null?void 0:x_(d,i,t,c),totalRowCount:c,viewportHeight:s}),m=a&&i<=0&&c>0?e.getStickyRowCandidates(1,t):[],g=m!=null&&i<=0?x_(m,1,t,c):a&&i<=0&&f.length>0?x5(f,1,t):h.sticky.rows;return{overlayHeight:g.reduce((y,b)=>Math.max(y,b.top+t),0),overlayRows:g,snapshot:h,visibleRows:f}}const yO=400,T_=10,as=40,k_=18;function bO(e,t,n){const i=e,a=document.elementFromPoint?.bind(document)??null,s=i.elementFromPoint?.(t,n)??a?.(t,n)??null;return e instanceof ShadowRoot&&(s==null||!e.contains(s))?SO(e,t,n):s instanceof HTMLElement?s:null}function SO(e,t,n){const i=Array.from(e.querySelectorAll('[data-type="item"], [data-item-flattened-subitem]'));for(let a=i.length-1;a>=0;a--){const s=i[a],c=s.getBoundingClientRect();if(t>=c.left&&t<=c.right&&n>=c.top&&n<=c.bottom)return s}return null}function A_(e){const t=e?.closest?.('[data-type="item"]');if(!(t instanceof HTMLElement))return null;const n=t.dataset.itemPath??null;if(n==null)return null;const i=e?.closest?.("[data-item-flattened-subitem]"),a=i instanceof HTMLElement?i.getAttribute("data-item-flattened-subitem")??null:null;if(a!=null&&a.endsWith("/"))return{directoryPath:a,flattenedSegmentPath:a,hoveredPath:n,kind:"directory"};if(t.dataset.itemType==="folder")return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:"directory"};const s=t.dataset.itemParentPath??null;return s==null||s.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:"root"}:{directoryPath:s,flattenedSegmentPath:null,hoveredPath:n,kind:"directory"}}function L_(e){const t=e.cloneNode(!0);return t.removeAttribute("id"),t.dataset.fileTreeDragPreview="true",t.setAttribute("aria-hidden","true"),t.tabIndex=-1,Object.assign(t.style,{boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",left:"0px",margin:"0",pointerEvents:"none",position:"fixed",top:"0px",willChange:"transform",zIndex:"10000"}),t}function _O(){return navigator.vendor!=="Apple Computer, Inc."}function CO(e,t){const n=e-t.top;if(n<as)return-Math.ceil((as-Math.max(0,n))/as*k_);const i=t.bottom-e;return i<as?Math.ceil((as-Math.max(0,i))/as*k_):0}function EO(e,t){if(e!=null){const n=nO[e];return n==null?null:{text:n,title:iO[e]}}return t?{icon:{name:"file-tree-icon-dot",width:6,height:6},title:rO}:null}function wO(e,t,n){if(t==null||t.size===0)return null;const i=[];for(let a=e.length-1;a>=0;a-=1){const s=e[a],c=n.get(s);if(c!=null){for(const d of i)n.set(d,c);return c?"ignored":null}if(t.has(s)){n.set(s,!0);for(const d of i)n.set(d,!0);return"ignored"}i.push(s)}for(const a of i)n.set(a,!1);return null}function I_(e){return e!=null&&"toggle"in e}function L5(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function xO(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function TO(e){return e==null?"":`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"] { opacity: 1; }`}function I5(e){return e.shiftKey&&e.key==="F10"||e.key==="ContextMenu"}function kO(e,t){return t&&I5(e)||(e.ctrlKey||e.metaKey)&&L5(e)?!0:e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight"||e.key==="ArrowUp"}const AO=new Set(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp"]);function R_(e){for(const t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot==="true"||t.dataset.type==="context-menu-anchor"||t.dataset.type==="context-menu-trigger"||t.getAttribute("slot")==="context-menu"))return!0;return!1}function LO(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function IO(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function RO(e,t){if(e==null)return t.offsetTop;const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return n.top-i.top}function D_(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function M_(e,t,n){if(e==null)return null;const i=t.get(e)??null;if(i!=null)return i;const a=n.get(e)??null;return a?.dataset.itemParked==="true"?null:a}function DO(e){if(e==null)return[];const t=[];for(const n of e.querySelectorAll('button[data-file-tree-sticky-row="true"]')){if(!(n instanceof HTMLElement))continue;const i=n.dataset.fileTreeStickyPath;i!=null&&t.push(i)}return t}function MO(e,t){if(e==null||t==null)return null;for(const n of e.querySelectorAll('button[data-item-focused="true"][data-item-parked="true"]'))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function OO(e,t,n,i,a,s,c){const d=Math.max(0,s-a),f=t?.getBoundingClientRect()??null,h=f==null||n==null?null:n.getBoundingClientRect().top-f.top,m=MO(e,i),g=f==null||m==null?null:m.getBoundingClientRect().top-f.top;return Math.max(0,Math.min(g??Math.max(h??0,d),Math.max(0,c-a)))}function O_(e,t){return{kind:e.kind,name:yg(e),path:t}}function PO(e){return e==null?void 0:`${e}__tree`}function R5(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?"__parked":""}`}function P_(e){return e==="file-tree-icon-chevron"||e==="file-tree-icon-dot"||e==="file-tree-icon-file"||e==="file-tree-icon-lock"}function N_(e,t){if(e==null)return null;if("text"in e)return pe("span",{title:e.title,children:e.text});const n=typeof e.icon=="string"?P_(e.icon)?t(e.icon):{name:e.icon}:P_(e.icon.name)?(()=>{const i=t(e.icon.name),{name:a,...s}=e.icon;return{...i,...s}})():e.icon;return pe("span",{title:e.title,children:pe(ec,{...n})})}function H_(e){e!=null&&cs(e.querySelector(["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "))??e)}function NO(e,t,{actionLaneEnabled:n=!1,customDecoration:i=null,decorationLaneEnabled:a=!1,dragTargetFlattenedSegmentPath:s=null,gitDecoration:c=null,gitLaneActive:d=!1,renameInput:f=null,showDecorativeActionAffordance:h=!1}={}){const m=gs(e);return pe(xs,{children:[e.depth>0?pe("div",{"data-item-section":"spacing",children:Array.from({length:e.depth}).map((g,y)=>pe("div",{"data-item-section":"spacing-item","data-ancestor-path":e.ancestorPaths[y]},y))}):null,pe("div",{"data-item-section":"icon",children:e.kind==="directory"?pe(ec,{...t("file-tree-icon-chevron")}):pe(ec,{...t("file-tree-icon-file",m)})}),pe("div",{"data-item-section":"content",children:e.isFlattened?vO(e,f,s):f??pe(KM,{minimumLength:5,split:"extension",children:e.name})}),a?pe("div",{"data-item-section":"decoration",children:i!=null?N_(i,t):null}):null,d?pe("div",{"data-item-section":"git",children:N_(c,t)}):null,n?pe("div",{"data-item-section":"action",children:h?pe("span",{"aria-hidden":"true","data-item-action-affordance":"decorative",children:pe(ec,{...t("file-tree-icon-ellipsis")})}):null}):null]})}function Ad(e,t,n,i={}){const{controller:a,renameView:s,visualFocusPath:c,contextHoverPath:d,draggedPathSet:f,dragTarget:h,dragAndDropEnabled:m,shouldSuppressContextMenu:g,handleRowDragStart:y,handleRowDragEnd:b,handleRowTouchStart:S,instanceId:w,itemHeight:A,gitStatusByPath:k,ignoredGitDirectories:E,ignoredInheritanceCache:T,directoriesWithGitChanges:L,gitLaneActive:O,contextMenuEnabled:D,contextMenuTriggerMode:N,contextMenuButtonTriggerEnabled:K,contextMenuButtonVisibility:G,contextMenuRightClickEnabled:se,registerRenameInput:ie,registerButton:ee,resolveIcon:te,renderDecorationForRow:le,openContextMenuForRow:me,onRowClick:H,onKeyDown:z}=e,Q=gs(t),{isParked:ce=!1,mode:_e="flow",style:M}=i,q=_e==="sticky",re=k?.get(Q)??null??wO(t.ancestorPaths,E,T),ae=t.kind==="directory"&&(L?.has(Q)??!1),he=le(t,Q),Se=EO(re,ae),be=D&&K,Ue=he!=null||O||be,Ce=be&&G==="always",He=s.getPath()===Q,We=He?s.getValue():"",lt=q||!He?null:pe(dO,{ref:ie,ariaLabel:`Rename ${yg(t)}`,isFlattened:t.isFlattened,value:We,onBlur:()=>{s.commit()},onInput:Le=>{s.setValue(Le.currentTarget.value)}}),ne=NO(t,te,{actionLaneEnabled:be,customDecoration:he,decorationLaneEnabled:Ue,dragTargetFlattenedSegmentPath:h?.flattenedSegmentPath??null,gitDecoration:Se,gitLaneActive:O,renameInput:lt,showDecorativeActionAffordance:Ce}),de={...fO({ariaLabel:yg(t),domId:t.isFocused?R5(w,Q,ce):void 0,extraStyle:M,features:{actionLaneEnabled:be,contextMenuButtonVisibility:be?G:null,contextMenuEnabled:D,contextMenuTriggerMode:D?N:null,gitLaneActive:O},isParked:ce,itemHeight:A,mode:_e,row:t,state:{containsGitChange:ae,effectiveGitStatus:re,isContextHovered:d===Q,isDragTarget:h?.kind==="directory"&&h.directoryPath===Q,isDragging:f?.has(Q)===!0,isFocusRinged:t.isFocused&&c===Q},targetPath:Q}),key:n,onContextMenu:D||m?Le=>{if(g()){Le.preventDefault();return}D&&(Le.preventDefault(),se&&(a.focusMountedPathFromInput(Q),me(t,Q,{anchorRect:IO(Le.clientX,Le.clientY),source:"right-click"})))}:void 0,onFocus:q?void 0:()=>{a.focusMountedPathFromInput(Q)},onKeyDown:q?void 0:z,ref:Le=>{ee(Q,Le)}};return!q&&He?pe("div",{...de,children:ne}):pe("button",{...de,type:"button",draggable:m&&!ce,onDragEnd:m&&!ce?b:void 0,onDragStart:m&&!ce?Le=>{y(Le,t,Q)}:void 0,onMouseDown:Le=>{if(q){Le.preventDefault();return}a.isSearchOpen()&&Le.preventDefault()},onTouchStart:m&&!ce?Le=>{S(Le,t,Q)}:void 0,onClick:Le=>{H(Le,t,Q,_e)},children:ne})}function HO(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(i=>!n.has(gs(i))).map((i,a)=>Ad(e,i,t.start+a))}function z_({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:i,directoriesWithGitChanges:a,icons:s,instanceId:c,itemHeight:d=r5,overscan:f=10,renamingEnabled:h=!1,renderRowDecoration:m,searchBlurBehavior:g="close",searchEnabled:y=!1,searchFakeFocus:b=!1,slotHost:S,stickyFolders:w=!1,initialViewportHeight:A=420}){"use no memo";const k=Re(null),E=Re(null),T=Re(!1),L=Re(null),O=Re(null),D=Re(null),N=Re(null),K=Re(null),G=Re(new Map),se=Re(new Map),ie=Re(()=>{}),ee=Re(null),te=Re(0),le=Re(!1),me=Re(null);me.current!==t&&(le.current=!1,me.current=t);const H=Re(!1),z=Re(null),Q=Re(null),ce=Re(!1),_e=Re(null),M=Re(null),q=Re(null),re=Re(null),ae=Re(null),he=Re(null),Se=Re(null),be=Re(null),Ue=Re(!1),Ce=Re(null),He=Re(null),We=Re(null),lt=Re(null),ne=mo(()=>new Map,[]),[,de]=Vi(0),Le=Re(!1),[Ve,Tt]=Vi(null),[vn,yn]=Vi(null),[Qn,Ki]=Vi(null),[Ef,Yi]=Vi(null),[bn,wf]=Vi(0),[Ze,ha]=Vi(null),Ai=Re(Ze);Ai.current=Ze;const pa=Re(null),Lr=Re(null),Co=Re(null),Eo=Re(null),Ir=Re(null),Wt=Re(!1),Li=()=>{Lr.current=null,Co.current=null,Eo.current=null},tn=(I,Z)=>{Lr.current=I,Co.current=null,Eo.current=Z==null?null:{path:I,scrollTop:Z}},xf=(I,Z)=>{Lr.current=null,Co.current={path:I,viewportOffset:Z},Eo.current=null},Ac=Re(g==="retain"&&t.isSearchOpen()),[Tf,wo]=Vi(b);E_(()=>{b||wo(!1)},[b]);const xo=Re(!1),Rr=pn(()=>{xo.current=!0,wo(I=>I&&!1)},[]),[Xi,ma]=Vi(()=>gm({controller:t,itemHeight:d,overscan:f,scrollTop:0,stickyFolders:w,viewportHeight:A})),[To,kf]=Vi(!1);E_(()=>{kf(!0)},[]);const nn=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ii=e?.contextMenu?.triggerMode??(nn?"right-click":"both"),Zn=Ii==="both"||Ii==="button",Lc=e?.contextMenu?.buttonVisibility??"when-needed",Ic=Ii==="both"||Ii==="right-click";Gn(()=>{const I=D.current;if(I==null)return;const Z=ue=>{if(!(ue instanceof CustomEvent))return;const fe=ue.detail?.path??null;Ir.current=fe,yn(fe),Yi(fe==null?null:"pointer")},Ee=ue=>{ue instanceof CustomEvent&&(Wt.current=ue.detail?.disabled===!0)};return I.addEventListener("file-tree-debug-set-context-menu-trigger",Z),I.addEventListener("file-tree-debug-set-scroll-suppression",Ee),()=>{I.removeEventListener("file-tree-debug-set-context-menu-trigger",Z),I.removeEventListener("file-tree-debug-set-scroll-suppression",Ee)}},[]);const Rc=pn((I,Z)=>{D_(G.current,I,Z)},[]),Dc=pn((I,Z)=>{D_(se.current,I,Z)},[]),Ts=pn(I=>{O.current=I},[]),Qi=pn(I=>M_(I,se.current,G.current),[]),ks=n!=null||i!=null||a!=null,{resolveIcon:As}=mo(()=>c7(s),[s]),Tn=t[s5](),Ct=Tn.getPath(),Kt=Ct!=null,rn=t.isSearchOpen(),Ls=t.getSearchValue(),Be=t.getFocusedPath(),et=t.getFocusedIndex(),Ri=t.getScrollRequest(),Sn=t.isDragAndDropEnabled(),Zi=t.getDragSession(),Dr=mo(()=>Zi==null?null:new Set(Zi.draggedPaths),[Zi]),Mr=Zi?.target??null,mi=Zi?.primaryPath??null,Ji=PO(c),{overlayHeight:Pt,overlayRows:Mc,snapshot:It,visibleRows:Jn}=Xi,Et=It.physical.viewportHeight,Nn=mo(()=>({end:It.window.endIndex,start:It.window.startIndex}),[It.window.endIndex,It.window.startIndex]),Or=Mc,Is=It.sticky.rows,er=It.physical.totalHeight,gi=It.sticky.height,tr=mo(()=>new Set(Is.map(I=>gs(I.row))),[Is]),Hn=et>=0&&et>=Nn.start&&et<=Nn.end,kn=pn((I,Z)=>m?.({item:O_(I,Z),row:I})??null,[m]),Rs=pn(I=>cs(I==null?null:G.current.get(I)??null)?!0:cs(D.current),[]),ga=pn(I=>{Rs(t.focusNearestPath(I))},[t,Rs]),va=Re(ga);va.current=ga;const nr=Re(!0),Pr=Re(()=>{}),An=pn((I=!0)=>{const Z=Ai.current;Z!=null&&(nr.current=nr.current&&I,ha(null),e?.contextMenu?.onClose?.(),nr.current&&ga(Z.path))},[e?.contextMenu,ga]);Pr.current=An;const Yt=pn(I=>{const Z=I==null?null:RO(D.current,I);Ki(Ee=>Ee===Z?Ee:Z)},[]),ya=pn((I,Z,Ee)=>{const ue=t.getItem(Z);if(ue==null)return;const fe=Qi(Z);if(fe?.dataset.fileTreeStickyRow==="true"){const Ae=N.current;tn(Z,Ae?.scrollTop??null),H.current=!0,Tt(ct=>ct===Z?ct:Z)}ue.focus(),Yt(fe),nr.current=!0,ha({anchorRect:Ee?.anchorRect??null,item:O_(I,Z),path:Z,source:Ee?.source??"keyboard"})},[t,Qi,Yt]),Oc=pn(I=>{if(h){if(t.isSearchOpen()){const Z=N.current,Ee=Hl(Z,Et);_e.current=et<0||Z==null?null:Math.max(0,Math.min(et*d-Z.scrollTop,Math.max(0,Ee-d))),ce.current=!0}t.startRenaming(I)!==!1&&(Yi("focus"),de(Z=>Z+1))}},[t,et,d,h,Et]),Nr=pn((I,{restoreTreeFocus:Z=!0,targetOffset:Ee="live-overlay"}={})=>{const ue=N.current;if(ue==null)return!1;t.focusPath(I);const fe=t.getFocusedIndex();if(fe<0)return!1;const Ae=t.getVisibleRows(fe,fe)[0]??null;if(Ae==null)return!1;const ct=Hl(ue,Et),ke=t.getVisibleCount()*d,Je=Ee==="sticky-parents"?Ae.ancestorPaths.length*d:gm({controller:t,itemHeight:d,overscan:f,scrollTop:ue.scrollTop,stickyFolders:w,viewportHeight:ct}).snapshot.sticky.height;return H.current=!0,zl(ue,fe,d,ct,ke,Je),ie.current(),pa.current=Z?I:null,!0},[t,d,f,Et,w]),Hr=()=>T.current===!0||lt.current!=null||Ue.current===!0,Ds=I=>typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{I()}):window.setTimeout(I,16),Pc=I=>{if(I!=null){if(typeof window.cancelAnimationFrame=="function"){window.cancelAnimationFrame(I);return}window.clearTimeout(I)}},_n=()=>{re.current!=null&&(clearTimeout(re.current),re.current=null),q.current=null},ba=()=>{he.current?.remove(),he.current=null},zr=()=>{Pc(M.current),M.current=null,ae.current=null},Ms=I=>{const Z=D.current?.getRootNode();if(Z instanceof ShadowRoot){Z.append(I);return}document.body.append(I)},ir=()=>{be.current?.(),be.current=null,lt.current!=null&&(clearTimeout(lt.current),lt.current=null),Ue.current=!1,Ce.current=null,We.current=null,He.current!=null&&(He.current.setAttribute("draggable","true"),He.current.style.removeProperty("touch-action"),He.current=null),ba(),_n(),zr(),Se.current=null},Sa=(I,Z)=>{const Ee=D.current?.getRootNode(),ue=A_(bO(Ee instanceof ShadowRoot?Ee:document,I,Z));return t.setDragTarget(ue),t.getDragSession()?.target??null},Os=I=>{const Z=t.getDragAndDropConfig()?.openOnDropDelay??800;if(I==null||I.kind!=="directory"||I.directoryPath==null||Z<=0){_n();return}const Ee=t.getItem(I.directoryPath),ue=I_(Ee)?Ee:null;if(ue==null||ue.isExpanded()){_n();return}const fe=`${I.directoryPath}::${I.flattenedSegmentPath??""}`;q.current!==fe&&(_n(),q.current=fe,re.current=setTimeout(()=>{const Ae=t.getDragSession()?.target;Ae?.kind!=="directory"||Ae.directoryPath!==I.directoryPath||Ae.flattenedSegmentPath!==I.flattenedSegmentPath||ue.expand()},Z))},ko=()=>{M.current=null;const I=ae.current,Z=N.current;if(I==null||Z==null||t.getDragSession()==null)return;const Ee=Z.getBoundingClientRect(),ue=CO(I.clientY,Ee);if(ue===0)return;const fe=Math.max(0,Z.scrollHeight-Z.clientHeight),Ae=Math.max(0,Math.min(fe,Z.scrollTop+ue));Ae!==Z.scrollTop&&(Z.scrollTop=Ae,ie.current()),Os(Sa(I.clientX,I.clientY)),M.current=Ds(ko)},ei=(I,Z)=>{ae.current={clientX:I,clientY:Z},M.current??=Ds(ko)},Ps=(I,Z,Ee)=>{const ue=I.currentTarget;if(ue!=null){if(ir(),ba(),_n(),zr(),t.startDrag(Ee)===!1){I.preventDefault();return}if(Se.current=Z,I.dataTransfer!=null&&(I.dataTransfer.effectAllowed="move",I.dataTransfer.dropEffect="move",I.dataTransfer.setData("text/plain",Ee),_O())){const fe=L_(ue),Ae=ue.getBoundingClientRect();Object.assign(fe.style,{height:`${Ae.height}px`,opacity:"0.85",transform:"translate3d(-9999px, 0px, 0)",width:`${Ae.width}px`}),Ms(fe),he.current=fe,I.dataTransfer.setDragImage(fe,Math.max(0,I.clientX-Ae.left),Math.max(0,I.clientY-Ae.top))}}},Ns=()=>{ba(),_n(),zr(),Se.current=null,t.cancelDrag()},Vr=(I,Z,Ee)=>{if(lt.current!=null||Ue.current)return;const ue=I.touches[0],fe=I.currentTarget;if(ue==null||fe==null)return;We.current={clientX:ue.clientX,clientY:ue.clientY},He.current=fe,fe.setAttribute("draggable","false");const Ae=(Je={})=>{const rt=Je.restoreNativeDraggable??!Ue.current;lt.current!=null&&(clearTimeout(lt.current),lt.current=null),document.removeEventListener("touchmove",ct),document.removeEventListener("touchend",ke),document.removeEventListener("touchcancel",ke),be.current===Ae&&(be.current=null),rt&&(fe.setAttribute("draggable","true"),He.current===fe&&(He.current=null),We.current=null)},ct=Je=>{const rt=Je.touches[0],tt=We.current;if(rt==null||tt==null)return;const ht=rt.clientX-tt.clientX,Xt=rt.clientY-tt.clientY;ht*ht+Xt*Xt<=T_*T_||Ae()},ke=()=>{Ae()};document.addEventListener("touchmove",ct,{passive:!0}),document.addEventListener("touchend",ke),document.addEventListener("touchcancel",ke),be.current=Ae,lt.current=setTimeout(()=>{if(Ae({restoreNativeDraggable:!1}),t.startDrag(Ee)===!1){fe.setAttribute("draggable","true"),He.current===fe&&(He.current=null),We.current=null;return}Ue.current=!0,He.current=fe,fe.setAttribute("draggable","false"),fe.style.setProperty("touch-action","none"),Se.current=Z;const Je=fe.getBoundingClientRect(),rt=L_(fe);Object.assign(rt.style,{height:`${Je.height}px`,opacity:"0.85",transform:`translate3d(${Je.left}px, ${Je.top}px, 0)`,width:`${Je.width}px`}),Ms(rt),he.current=rt,Ce.current={x:ue.clientX-Je.left,y:ue.clientY-Je.top};const tt=Cn=>{const pt=Cn.touches[0];if(pt==null)return;Cn.preventDefault();const Xe=Ce.current;Xe!=null&&he.current!=null&&(he.current.style.transform=`translate3d(${pt.clientX-Xe.x}px, ${pt.clientY-Xe.y}px, 0)`),Os(Sa(pt.clientX,pt.clientY)),ei(pt.clientX,pt.clientY)},ht=Cn=>{const pt=Cn.changedTouches[0];pt!=null&&Sa(pt.clientX,pt.clientY),t.completeDrag(),ir()},Xt=()=>{t.cancelDrag(),ir()};be.current=()=>{document.removeEventListener("touchmove",tt),document.removeEventListener("touchend",ht),document.removeEventListener("touchcancel",Xt)},document.addEventListener("touchmove",tt,{passive:!1}),document.addEventListener("touchend",ht),document.addEventListener("touchcancel",Xt)},yO)},rr=I=>{if(Ze!=null){if(I.key==="Escape"){An(),I.preventDefault(),I.stopPropagation();return}AO.has(I.key)&&(I.preventDefault(),I.stopPropagation());return}if(Tn.isActive()){if(I.key==="Escape")Tn.cancel();else if(I.key==="Enter")Tn.commit();else return;Yi("focus"),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}if(h&&I.key==="F2"){Oc(Be??void 0),I.preventDefault(),I.stopPropagation();return}if(rn){if(I.key==="Escape")ce.current=!1,_e.current=null,t.closeSearch();else if(I.key==="Enter"){const vt=t.getFocusedPath();vt!=null&&t.selectOnlyPath(vt);const on=N.current,Aa=Hl(on,Et);_e.current=et<0||on==null?null:Math.max(0,Math.min(et*d-on.scrollTop,Math.max(0,Aa-d))),ce.current=!0,t.closeSearch()}else if(I.key==="ArrowDown")t.focusNextSearchMatch();else if(I.key==="ArrowUp")t.focusPreviousSearchMatch();else return;Yi("focus"),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}if(y&&xO(I)){t.openSearch(I.key),de(vt=>vt+1),I.preventDefault(),I.stopPropagation();return}const Z=nn&&I5(I),Ee=kO(I,nn),ue=Ee&&D.current!=null?hd(D.current):null,fe=Ee?new Set(DO(D.current)):new Set,Ae=ue?.dataset.fileTreeStickyPath??null,ct=ue?.dataset.fileTreeStickyRow==="true"&&Ae!=null;if(ct&&Ae!==Be&&fe.has(Ae)){const vt=N.current;tn(Ae,vt?.scrollTop??null),t.focusPath(Ae)}const ke=t.getFocusedPath(),Je=t.getFocusedIndex(),rt=t.getFocusedItem();if(rt==null)return;const tt=I_(rt)?rt:null,ht=ke!=null&&(tr.has(ke)||ct&&Ae===ke&&fe.has(ke)),Xt=I.key==="ArrowDown"||I.key==="ArrowUp"||I.key==="ArrowRight"&&tt!=null&&tt.isExpanded(),Cn=I.key==="ArrowLeft"&&ht&&tt!=null&&tt.isExpanded(),pt=N.current;let Xe=!0;if(I.shiftKey&&I.key==="ArrowDown")t.extendSelectionFromFocused(1);else if(I.shiftKey&&I.key==="ArrowUp")t.extendSelectionFromFocused(-1);else if(Z&&ke!=null&&Je>=0){const vt=t.getVisibleRows(Je,Je)[0]??null,on=M_(ke,se.current,G.current);vt==null||on==null?Xe=!1:ya(vt,ke)}else if((I.ctrlKey||I.metaKey)&&L5(I))t.toggleFocusedSelection();else if((I.ctrlKey||I.metaKey)&&I.key.toLowerCase()==="a")t.selectAllVisiblePaths();else switch(I.key){case"ArrowDown":t.focusNextItem();break;case"ArrowUp":t.focusPreviousItem();break;case"ArrowRight":tt==null||tt.isExpanded()?t.focusNextItem():tt.expand();break;case"ArrowLeft":tt!=null&&tt.isExpanded()?tt.collapse():t.focusParentItem();break;case"Home":t.focusFirstItem();break;case"End":t.focusLastItem();break;default:Xe=!1}if(!Xe)return;Yi("focus");const mt=t.getFocusedPath(),Qt=mt!=null&&(tr.has(mt)||fe.has(mt)),Do=Xt&&mt!==ke,Mo=Z&&ct&&Ae===ke&&mt===ke;if((ht||Mo)&&mt!=null&&(Do&&Qt||Mo))tn(mt,pt?.scrollTop??null),H.current=!0,Tt(vt=>vt===mt?vt:mt);else{const vt=I.key==="ArrowUp"&&ht&&mt!==ke;mt!=null&&(vt||Cn&&mt===ke)?(xf(mt,OO(D.current,pt,ue,ke,d,gi,Et)),H.current=!0,Tt(on=>on===mt?on:mt)):Li()}de(vt=>vt+1),I.preventDefault(),I.stopPropagation()};Gn(()=>{if(!(!y||!rn)){if(Ac.current){Ac.current=!1;return}cs(K.current)}},[rn,y]),Gn(()=>{const I=O.current;switch(uO({hasRenderedInput:I!=null,previousRenamingPath:Q.current,renamingPath:Ct})){case"reset":Q.current=null;return;case"reveal-canonical":Ct!=null&&Nr(Ct,{restoreTreeFocus:!1,targetOffset:"live-overlay"});return;case"ignore":return;case"focus-input":I!=null&&(pa.current=null,Q.current=Ct,cs(I),I.select());return}},[Nn.end,Nn.start,Ct,Nr,tr]),Gn(()=>{const I=D.current;if(I==null)return;let Z=null;const Ee=()=>{Z!=null&&(clearTimeout(Z),Z=null)},ue=()=>{const ct=hd(I)?.dataset.itemPath??null;Tt(ke=>ke===ct?ke:ct)},fe=()=>{Ee(),H.current=!0,ue()},Ae=ct=>{const ke=ct.relatedTarget;if(ke==null){Ee(),Z=setTimeout(()=>{if(Z=null,hd(I)!=null){ue();return}H.current=!1,Tt(null)},0);return}if(!(ke instanceof Node)||!I.contains(ke)){Ee(),H.current=!1,Tt(null);return}const Je=ke instanceof HTMLElement?ke.dataset.itemPath??null:null;Tt(rt=>rt===Je?rt:Je)};return I.addEventListener("focusin",fe),I.addEventListener("focusout",Ae),()=>{Ee(),I.removeEventListener("focusin",fe),I.removeEventListener("focusout",Ae)}},[]),Gn(()=>{const I=D.current;I!=null&&(It.physical.scrollTop<=0?I.dataset.scrollAtTop="true":delete I.dataset.scrollAtTop)},[It.physical.scrollTop]),Gn(()=>{let I=null;const Z=N.current,Ee=L.current,ue=D.current;if(Z==null)return;ee.current=Hl(Z,A);const fe=()=>{const Xe=t.getVisibleCount(),mt=h_(ee.current,A),Qt=Math.max(0,Xe*d-mt);Z.scrollTop>Qt&&(Z.scrollTop=Qt),ma(gm({controller:t,itemHeight:d,overscan:f,scrollTop:Math.min(Z.scrollTop,Qt),stickyFolders:w,viewportHeight:mt}))};if(!le.current){le.current=!0;const Xe=t.getFocusedIndex();if(Xe>=0){const mt=h_(ee.current,A),Qt=t.getVisibleRows(Xe,Xe)[0]??null;p_(Z,Xe,d,mt,w&&Qt!=null?Math.max(0,Math.min(Qt.ancestorPaths.length*d,Math.max(0,mt-d))):0)}}ie.current=fe;const Ae=t.subscribe(()=>{oO(Le)&&de(Xe=>Xe+1),fe()}),ct=()=>{Wt.current!==!0&&(Ee!=null&&(Ee.dataset.isScrolling??=""),ue!=null&&(ue.dataset.isScrolling??=""),T.current=!0,I!=null&&clearTimeout(I),I=setTimeout(()=>{Ee!=null&&delete Ee.dataset.isScrolling,ue!=null&&delete ue.dataset.isScrolling,T.current=!1,wf(Xe=>Xe+1),I=null},50))};let ke=null;const Je=()=>{ue!=null&&delete ue.dataset.overlayReveal,ke!=null&&(clearTimeout(ke),ke=null)},rt=()=>{ue==null||Wt.current===!0||Z.scrollTop>0||(ue.dataset.overlayReveal="true",ke!=null&&clearTimeout(ke),ke=setTimeout(()=>{Je()},200))},tt=()=>{if(fe(),Z.scrollTop>0&&Je(),Ai.current!=null&&T.current&&Pr.current(),Wt.current===!0){T.current=!1;return}yn(Xe=>Xe==null?Xe:null),ct()},ht=()=>{ct(),rt()},Xt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"," ","Spacebar"]),Cn=Xe=>{Xt.has(Xe.key)&&ht()};Z.addEventListener("scroll",tt,{passive:!0}),Z.addEventListener("wheel",ht,{passive:!0}),Z.addEventListener("touchmove",ht,{passive:!0}),Z.addEventListener("keydown",Cn);const pt=typeof ResizeObserver<"u"?new ResizeObserver(Xe=>{ee.current=(Xe[0]==null?null:lO(Xe[0]))??Hl(Z,A),fe()}):null;return pt?.observe(Z),()=>{ie.current=()=>{},Ae(),Z.removeEventListener("scroll",tt),Z.removeEventListener("wheel",ht),Z.removeEventListener("touchmove",ht),Z.removeEventListener("keydown",Cn),I!=null&&clearTimeout(I),ke!=null&&clearTimeout(ke),Ee!=null&&delete Ee.dataset.isScrolling,ue!=null&&(delete ue.dataset.isScrolling,delete ue.dataset.overlayReveal),T.current=!1,ee.current=null,pt?.disconnect()}},[t,A,d,f,w]),Gn(()=>{nn||Ze==null||An(!1)},[An,nn,Ze]);const Hs=mo(()=>Ze==null?null:`${Ze.path}::${Ze.source}`,[Ze]);Gn(()=>{if(Hs==null){S?.clearSlotContent(ql);return}const I=Ai.current;if(I==null)return;const Z=E.current??k.current;if(Z==null)return;const Ee={anchorElement:Z,anchorRect:I.anchorRect??LO(Z.getBoundingClientRect()),close:fe=>{Pr.current(fe?.restoreFocus??!0)},restoreFocus:()=>{nr.current&&va.current(Ai.current?.path??null)}},ue=e?.contextMenu?.render?.(I.item,Ee)??null;return S?.setSlotContent(ql,ue),e?.contextMenu?.onOpen?.(I.item,Ee),H_(ue),queueMicrotask(()=>{ue==null||!ue.isConnected||document.activeElement===ue&&H_(ue)}),()=>{S?.clearSlotContent(ql)}},[Hs,e?.contextMenu,S]),Gn(()=>{Ze!=null&&t.getItem(Ze.path)==null&&An()},[An,Ze,t]),Gn(()=>{if(Ze==null)return;const I=D.current?.getRootNode(),Z=I instanceof ShadowRoot?I.host:D.current,Ee=fe=>{const Ae=fe.target;Ae instanceof Node&&(R_(fe)||k.current?.contains(Ae)!==!0&&Z?.contains(Ae)!==!0&&An())},ue=fe=>{fe.key==="Escape"&&(fe.preventDefault(),fe.stopPropagation(),An())};return document.addEventListener("mousedown",Ee,!0),document.addEventListener("keydown",ue,!0),()=>{document.removeEventListener("mousedown",Ee,!0),document.removeEventListener("keydown",ue,!0)}},[An,Ze]),Gn(()=>{const I=N.current,Z=D.current;if(I==null||Z==null){z.current=Be;return}const Ee=Be==null?null:G.current.get(Be)??null,ue=hd(Z),fe=ue?.dataset.itemPath??null,Ae=Kt&&O.current===ue,ct=y&&K.current===ue,ke=ce.current&&!rn,Je=_e.current??0,rt=pa.current,tt=Lr.current,ht=Co.current,Xt=Eo.current,Cn=ue!=null,pt=H.current||Cn,Xe=z.current!==Be,mt=tt!=null&&tt===Be&&Be!=null;let Qt=!1,Do=!1;if(Ri!=null&&Ri.id!==te.current){te.current=Ri.id;const qs=Ri.visibleIndex,Bc=t.getVisibleRows(qs,qs)[0]??null;if(Bc!=null){const Uc=w?Math.max(0,Math.min(Bc.ancestorPaths.length*d,Math.max(0,Et-d))):gi;Qt=!0,Do=cO(I,qs,d,Et,er,Ri.offset,Uc)}t.clearScrollRequest(Ri.id)}const Mo=!Qt&&ke&&zl(I,et,d,Et,er,Je),vt=!Qt&&rt!=null&&rt===Be&&zl(I,et,d,Et,er,gi),on=!Qt&&ht!=null&&ht.path===Be&&zl(I,et,d,Et,er,ht.viewportOffset),Aa=!Qt&&Xt!=null&&Xt.path===Be&&I.scrollTop!==Xt.scrollTop;if(Aa&&(I.scrollTop=Xt.scrollTop),(Aa||Do||vt||on||Mo||pt&&Xe&&rt!==Be&&!mt&&p_(I,et,d,Et,gi))&&ie.current(),Qt){z.current=Be;return}if(!pt){z.current=Be;return}if(Ae){z.current=Be;return}if(ct&&!ke){z.current=Be;return}if(Ee==null){ke&&et>=0&&(zl(I,et,d,Et,er,Je),ie.current()),z.current=Be;return}(Xe||ke||rt===Be||tt===Be||ht?.path===Be||Xt?.path===Be||fe==null||fe!==Be)&&(cs(Ee),rt===Be&&(pa.current=null),tt===Be&&(Lr.current=null),ht?.path===Be&&(Co.current=null),Xt?.path===Be&&(Eo.current=null),ce.current=!1,_e.current=null),z.current=Be},[t,et,Be,Hn,d,Kt,rn,Nn,Et,y,Ri,w,gi,er,Jn]);const zs=et>=0&&et>=It.visible.startIndex&&et<=It.visible.endIndex,Nc=Be!=null&&Or.some(I=>gs(I.row)===Be),Ao=zs||Nc,vi=Zn&&H.current===!0&&Ao?Be:null,Vs=Ef==="pointer"?vn:null,zn=Ze?.path??Ir.current??Vs??vi??vn,yi=Ze?.source==="right-click";Gn(()=>{T.current&&Ze==null||Yt(Qi(zn))},[Ze,Qi,Nn,Et,bn,Or,zn,Yt,Jn]);const Bs=pn(I=>{if(T.current||R_(I))return;const Z=I.target;if(!(Z instanceof HTMLElement)||Z.closest?.('[data-type="context-menu-trigger"]')!=null)return;const Ee=Z.closest?.('[data-file-tree-sticky-row="true"]'),ue=Z.closest?.('[data-type="item"]'),fe=Ee instanceof HTMLElement?Ee.dataset.fileTreeStickyPath??null:ue instanceof HTMLElement?ue.dataset.itemPath??null:null;fe!=null&&Yi(Ae=>Ae==="pointer"?Ae:"pointer"),yn(Ae=>Ae===fe?Ae:fe)},[]),_a=pn(()=>{yn(null)},[]);Gn(()=>{if(!Sn)return;const I=()=>{ir(),t.cancelDrag()};return window.addEventListener("dragend",I),()=>{window.removeEventListener("dragend",I),ir(),t.cancelDrag()}},[t,Sn]);const Hc=I=>{if(!Sn||t.getDragSession()==null||Ue.current)return;const Z=A_(I.target instanceof HTMLElement?I.target:null);t.setDragTarget(Z),Os(t.getDragSession()?.target??null),ei(I.clientX,I.clientY),I.dataTransfer!=null&&(I.dataTransfer.dropEffect="move"),I.preventDefault()},Ca=I=>{if(!Sn||t.getDragSession()==null||Ue.current)return;const Z=I.relatedTarget;Z instanceof Node&&D.current?.contains(Z)===!0||(_n(),zr(),t.setDragTarget(null))},Ea=I=>{!Sn||t.getDragSession()==null||Ue.current||(I.preventDefault(),Sa(I.clientX,I.clientY),t.completeDrag(),ba(),_n(),zr(),Se.current=null)},Br=It.window.height,fn=It.window.offsetTop,or=Math.min(0,Et-Br),wa=Math.min(0,Et-Br-gi),Lo=Ve===Be||ce.current,Ur=Be!=null&&Lo&&!Hn&&et>=0?Jn[et]??t.getVisibleRows(et,et)[0]??null:null,xa=Ur==null?null:m_(et,d,Nn,Br),ti=Se.current,Io=mi!=null&&ti!=null&&ti.path===mi&&ti.index>=Nn.start&&ti.index<=Nn.end,Di=mi!=null&&ti!=null&&ti.path===mi&&!Io&&ti.path!==Ur?.path?ti:null,Us=Di==null?null:m_(Di.index,d,Nn,Br),Af=TO((et>=0?Jn[et]??t.getVisibleRows(et,et)[0]??null:null)?.ancestorPaths.at(-1)??null),Lf=rn&&Be!=null?R5(c,Be,!Hn):void 0,If=Ze?.path??(rn?Be:Ve),Fs=Ze?.path??vn,Ro=Qi(zn),js=nn&&Zn&&!yi&&!Kt&&Ro!=null&&Qn!=null&&zn!=null,Rf=nn&&(js||Ze!=null),Ta=Ze?.anchorRect,zc=Ta==null&&Ro!=null&&Qn!=null&&(Ze!=null||js)?Qn:null,Vc=Ta!=null?{left:`${Ta.left}px`,position:"fixed",right:"auto",top:`${Ta.top}px`}:zc!=null?{top:`${zc}px`}:void 0,Df=yi?{opacity:"0"}:void 0,Mf=pn((I,Z,Ee,ue)=>{const fe=hO({event:{ctrlKey:I.ctrlKey,metaKey:I.metaKey,shiftKey:I.shiftKey},isDirectory:Z.kind==="directory",isSearchOpen:rn,mode:ue}),Ae=fe.toggleDirectory&&Z.kind==="directory",ct=Ae?t.resolveMountedDirectoryPathFromInput(Ee):null;if(Ae&&ct==null)return;const ke=ct??Ee;switch(fe.selection.kind){case"range":t.selectPathRange(ke,fe.selection.additive);break;case"toggle":t.togglePathSelectionFromInput(ke);break;case"single":t.selectOnlyMountedPathFromInput(ke);break}const Je=I.currentTarget instanceof HTMLElement?I.currentTarget:null,rt=Z.index>=It.visible.startIndex&&Z.index<=It.visible.endIndex,tt=ue==="flow"&&rt&&Je!=null&&Je.dataset.itemParked!=="true";t.focusMountedPathFromInput(ke),tt&&(H.current=!0,Tt(ht=>ht===ke?ht:ke),Yi("focus")),Ae&&t.toggleMountedDirectoryFromInput(ke),fe.closeSearch&&t.closeSearch(),fe.revealCanonical&&Nr(ke,{targetOffset:"sticky-parents"})},[t,rn,It.visible.endIndex,It.visible.startIndex,Nr]),Of=()=>{if(T.current||!Zn||zn==null||Ro==null)return;const I=t.getItem(zn);I!=null&&(Yt(Ro),nr.current=!0,ha({anchorRect:null,item:{kind:I.isDirectory()?"directory":"file",name:Ro.getAttribute("aria-label")??zn,path:I.getPath()},path:I.getPath(),source:"button"}))},ka={contextHoverPath:Fs,contextMenuButtonTriggerEnabled:Zn,contextMenuButtonVisibility:Lc,contextMenuEnabled:nn,contextMenuRightClickEnabled:Ic,contextMenuTriggerMode:Ii,controller:t,directoriesWithGitChanges:a,dragAndDropEnabled:Sn,draggedPathSet:Dr,dragTarget:Mr,gitLaneActive:ks,gitStatusByPath:n,handleRowDragEnd:Ns,handleRowDragStart:Ps,handleRowTouchStart:Vr,ignoredGitDirectories:i,ignoredInheritanceCache:ne,instanceId:c,itemHeight:d,onKeyDown:rr,onRowClick:Mf,openContextMenuForRow:ya,registerButton:Rc,registerRenameInput:Ts,renameView:Tn,renderDecorationForRow:kn,resolveIcon:As,shouldSuppressContextMenu:Hr,visualFocusPath:If},$s={...ka,registerButton:Dc};return pe("div",{ref:D,id:Ji,"data-file-tree-context-menu-button-visibility":nn&&Zn?Lc:void 0,"data-file-tree-context-menu-trigger-mode":nn?Ii:void 0,"data-file-tree-has-context-menu-action-lane":nn&&Zn?"true":void 0,"data-file-tree-has-git-lane":ks?"true":void 0,"data-file-tree-virtualized-root":"true",onDragLeave:Sn?Ca:void 0,onDragOver:Sn?Hc:void 0,onDrop:Sn?Ea:void 0,onKeyDown:rr,onPointerLeave:nn?_a:void 0,onPointerOver:nn?Bs:void 0,role:"tree",tabIndex:-1,style:{outline:"none",position:"relative"},children:[pe("style",{"data-file-tree-guide-style":"true",dangerouslySetInnerHTML:{__html:Af}}),pe("slot",{name:Wd,"data-type":"header-slot"}),y?pe("div",{"data-file-tree-search-container":!0,"data-open":rn?"true":"false",children:pe("input",{ref:K,"aria-activedescendant":Lf,"aria-controls":Ji,placeholder:"Search…","data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Tf?"true":void 0,value:Ls,onBlur:()=>{g==="retain"&&!xo.current||t.closeSearch()},onFocus:Rr,onPointerDown:Rr,onInput:I=>{Rr();const Z=I.currentTarget;t.setSearch(Z.value)}})}):null,pe("div",{ref:N,"data-file-tree-virtualized-scroll":"true",children:[w&&To&&Or.length>0?pe("div",{"aria-hidden":"true","data-file-tree-sticky-overlay":"true",children:pe("div",{"data-file-tree-sticky-overlay-content":"true",style:{height:`${Pt}px`},children:Or.map((I,Z)=>Ad($s,I.row,`sticky:${gs(I.row)}`,{mode:"sticky",style:{left:"0",position:"absolute",right:"0",top:`${I.top}px`,zIndex:`${Or.length-Z}`}}))})}):null,pe("div",{ref:L,"data-file-tree-virtualized-list":"true",style:{height:`${er}px`},children:[pe("div",{"data-file-tree-virtualized-sticky-offset":"true","aria-hidden":"true",style:{height:`${fn}px`}}),pe("div",{"data-file-tree-virtualized-sticky":"true",style:{height:`${Br}px`,top:`${or}px`,bottom:`${wa}px`},children:[HO(ka,Nn,tr),Ur!=null&&xa!=null?Ad(ka,Ur,`parked:${Ur.path}`,{isParked:!0,style:{left:"0",opacity:"0",pointerEvents:mi===Ur.path?"none":void 0,position:"absolute",right:"0",top:`${xa}px`}}):null,Di!=null&&Us!=null?Ad(ka,Di,`parked-drag:${Di.path}`,{isParked:!0,style:{left:"0",opacity:"0",pointerEvents:"none",position:"absolute",right:"0",top:`${Us}px`}}):null]})]})]}),nn?pe("div",{ref:k,"data-type":"context-menu-anchor","data-visible":Rf?"true":"false",style:Vc,children:[pe("button",{ref:E,type:"button","data-type":r7,"aria-label":"Options","aria-haspopup":"menu","aria-expanded":Ze!=null?"true":"false","data-visible":js?"true":"false",onMouseDown:I=>{I.preventDefault()},onClick:I=>{if(I.preventDefault(),I.stopPropagation(),Ze!=null){An();return}Of()},tabIndex:-1,style:Df,children:pe(ec,{...As("file-tree-icon-ellipsis")})}),Ze!=null?pe("slot",{name:ql}):null]}):null,Ze!=null?pe("div",{"data-type":"context-menu-wash","aria-hidden":"true",onMouseDownCapture:I=>{I.preventDefault(),An()},onTouchStartCapture:I=>{I.preventDefault(),I.stopPropagation(),An()},onTouchMoveCapture:I=>{I.preventDefault(),I.stopPropagation()},onWheelCapture:I=>{I.preventDefault(),I.stopPropagation()}}):null]})}const a0={hydrateRoot:(e,t)=>{PM(dg(z_,t),e)},renderRoot:(e,t)=>{hg(dg(z_,t),e)},unmountRoot:e=>{hg(null,e)}};function Vl(e,t){a0.renderRoot(e,t)}function zO(e,t){a0.hydrateRoot(e,t)}function VO(e){a0.unmountRoot(e)}var BO=class{#e=new Map;#t=null;clearAll(){for(const e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){const t=this.#l(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#r(e);for(const[t,n]of this.#e)this.#a(t,n)}}setSlotContent(e,t){const n=this.#l(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#a(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#a(e,t)}setSlotHtml(e,t){const n=t?.trim()??"";if(n.length===0){this.setSlotContent(e,null);return}const i=this.#l(e);if(i!=null&&i.innerHTML===n){this.#e.set(e,i),this.#a(e,i);return}const a=document.createElement("div");a.innerHTML=n,this.setSlotContent(e,a)}#l(e){const t=this.#e.get(e)??null;if(t!=null)return t;const n=this.#t;if(n==null)return null;for(const i of Array.from(n.children))if(i instanceof HTMLElement&&i.dataset.fileTreeManagedSlot===e)return i;return null}#a(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#r(e){for(const t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;const n=t.dataset.fileTreeManagedSlot;n==null||this.#e.has(n)||this.#e.set(n,t)}}};let V_=0;function UO(e){return e!=null&&e.length>0?e:(V_+=1,`pst_ft_${V_}`)}function FO({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??r5)}function B_(e){if(typeof document>"u")return;const t=document.createElement("div");t.innerHTML=e;const n=t.querySelector("svg");return n instanceof SVGElement?n:void 0}function U_(e){return e.querySelector("#file-tree-icon-chevron")instanceof SVGElement&&e.querySelector("#file-tree-icon-file")instanceof SVGElement&&e.querySelector("#file-tree-icon-dot")instanceof SVGElement&&e.querySelector("#file-tree-icon-lock")instanceof SVGElement}function F_(e){return Array.from(e.children).filter(t=>t instanceof SVGElement)}var jO=class{static LoadedCustomComponent=!0;#e;#t;#l;#a;#r;#A;#B;#v;#i;#y=new BO;#L;#b;#m;#f;#S;#_;#h;#U;#F;#P=null;#o;#j=!1;#$=!1;constructor(t){const{composition:n,density:i,fileTreeSearchMode:a,gitStatus:s,id:c,initialSearchQuery:d,icons:f,itemHeight:h,onSearchChange:m,onSelectionChange:g,overscan:y,renderRowDecoration:b,renaming:S,search:w,searchBlurBehavior:A,searchFakeFocus:k,stickyFolders:E,unsafeCSS:T,initialVisibleRowCount:L,...O}=t;this.#e=n,this.#l=UO(c),this.#f=r_(s),this.#S=f,this.#_=T,this.#a=g,this.#r=b,this.#A=S!=null&&S!==!1,this.#B=A,this.#v=w===!0,this.#i=k===!0,this.#L=GD(i,h),this.#b={itemHeight:this.#L.itemHeight,overscan:y,stickyFolders:E,initialVisibleRowCount:L},this.#t=new _M({...O,fileTreeSearchMode:a,initialSearchQuery:d,onSearchChange:m,renaming:S}),this.#F=this.#t.getSelectionVersion(),this.#P=this.#a==null?null:this.subscribe(()=>{this.#R()})}unmount(){this.#o!=null&&(VO(this.#o),delete this.#o.dataset.fileTreeVirtualizedWrapper,this.#o=void 0),this.#y.clearAll(),this.#y.setHost(null),this.#m!=null&&(delete this.#m.dataset.fileTreeVirtualized,this.#H(this.#m),this.#m=void 0)}cleanUp(){this.unmount(),this.#P?.(),this.#P=null,this.#t.destroy()}getFileTreeContainer(){return this.#m}getItem(t){return this.#t.getItem(t)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#L.itemHeight}getDensityFactor(){return this.#L.factor}subscribe(t){let n=!1;return this.#t.subscribe(()=>{if(!n){n=!0;return}t()})}focusPath(t){this.#t.focusPath(t)}scrollToPath(t,n){this.#t.scrollToPath(t,n)}focusNearestPath(t){return this.#t.focusNearestPath(t)}add(t){this.#t.add(t)}batch(t){this.#t.batch(t)}applyGitStatusPatch(t){const n=xM(this.#f,t);if(n===this.#f)return;this.#f=n;const i=this.#c();i!=null&&Vl(i.wrapper,this.#I())}move(t,n,i){this.#t.move(t,n,i)}onMutation(t,n){return this.#t.onMutation(t,n)}setSearch(t){this.#t.setSearch(t)}openSearch(t){this.#t.openSearch(t)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(t,n){return this.#t.startRenaming(t,n)}remove(t,n){this.#t.remove(t,n)}resetPaths(t,n){Array.isArray(t)?this.#t.resetPaths(t,n):this.#t.resetPaths(t)}setComposition(t){this.#e=t;const n=this.#c();n!=null&&(this.#x(),Vl(n.wrapper,this.#I()))}setGitStatus(t){const n=r_(t,this.#f);if(n===this.#f)return;this.#f=n;const i=this.#c();i!=null&&Vl(i.wrapper,this.#I())}setIcons(t){this.#S=t;const n=this.#c();n!=null&&(this.#g(n.host,n.wrapper),Vl(n.wrapper,this.#I()))}hydrate({fileTreeContainer:t}){const n=this.#M(t),i=this.#N(n);this.#x(),zO(i,this.#I())}render({containerWrapper:t,fileTreeContainer:n}){const i=this.#M(n??this.#m,t),a=this.#N(i);this.#x(),Vl(a,this.#I())}#Z(){return{initialViewportHeight:FO({initialVisibleRowCount:this.#b.initialVisibleRowCount,itemHeight:this.#b.itemHeight}),itemHeight:this.#b.itemHeight,overscan:this.#b.overscan,stickyFolders:this.#b.stickyFolders}}#I(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#f?.statusByPath,ignoredGitDirectories:this.#f?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#f?.directoriesWithChanges,icons:this.#S,instanceId:this.#l,renamingEnabled:this.#A,renderRowDecoration:this.#r,searchBlurBehavior:this.#B,searchEnabled:this.#v,searchFakeFocus:this.#i,slotHost:this.#y,...this.#Z()}}#c(){const t=this.#m,n=this.#o;return t==null||n==null?null:{host:t,wrapper:n}}#g(t,n){const i=t.shadowRoot;i!=null&&(this.#q(i),this.#G(i)),this.#W(n)}#R(){const t=this.#a;if(t==null)return;const n=this.#t.getSelectionVersion();n!==this.#F&&(this.#F=n,t(this.#t.getSelectedPaths()))}#x(){const t=this.#e?.header?.render;if(t!=null){this.#y.setSlotContent(Wd,t());return}this.#y.setSlotHtml(Wd,this.#e?.header?.html??null)}#q(t){const n=F_(t).find(a=>U_(a)),i=B_(ZR(_d(this.#S).set));i!=null&&(n!=null&&n.outerHTML===i.outerHTML||(n!=null?n.replaceWith(i):t.prepend(i)))}#G(t){const n=F_(t),i=n.find(d=>U_(d)),a=n.filter(d=>d!==i),s=_d(this.#S).spriteSheet?.trim()??"";if(s.length===0){for(const d of a)d.remove();return}const c=B_(s);if(c==null){for(const d of a)d.remove();return}if(!(a.length===1&&a[0].outerHTML===c.outerHTML)){for(const d of a)d.remove();t.appendChild(c)}}#W(t){const n=_d(this.#S);n.colored&&e7(n.set)?t.dataset.fileTreeColoredIcons="true":delete t.dataset.fileTreeColoredIcons}#u(t){const n=t.querySelector(`style[${TS}]`);if(this.#h==null&&n instanceof HTMLStyleElement&&(this.#h=n),this.#_==null||this.#_===""){this.#h?.remove(),this.#h=void 0,this.#U=void 0;return}this.#h?.parentNode===t&&this.#U===this.#_||(this.#h??=document.createElement("style"),this.#h.setAttribute(TS,""),this.#h.parentNode!==t&&t.appendChild(this.#h),this.#h.textContent=WD(this.#_),this.#U=this.#_)}#N(t){if(this.#o!=null)return this.#o;const n=t.shadowRoot;if(n==null)throw new Error("FileTree requires a shadow root");const i=Array.from(n.children).filter(s=>s instanceof HTMLDivElement&&typeof s.dataset.fileTreeId=="string"&&s.dataset.fileTreeId.length>0),a=i.find(s=>s.dataset.fileTreeId===this.#l)??i[0];return a!=null&&(this.#l=a.dataset.fileTreeId??this.#l),this.#o=a??document.createElement("div"),this.#o.dataset.fileTreeId=this.#l,this.#o.dataset.fileTreeVirtualizedWrapper="true",this.#g(t,this.#o),this.#o.parentNode!==n&&n.appendChild(this.#o),this.#o}#M(t,n){const i=t??this.#m??document.createElement("file-tree-container");n!=null&&i.parentNode!==n&&n.appendChild(i);const a=i.shadowRoot??i.attachShadow({mode:"open"});return lg(i,a),this.#u(a),i.dataset.fileTreeVirtualized="true",i.style.display="flex",this.#w(i),this.#y.setHost(i),this.#m=i,i}#w(t){t.style.getPropertyValue("--trees-item-height")===""&&(t.style.setProperty("--trees-item-height",`${String(this.#L.itemHeight)}px`),this.#j=!0),t.style.getPropertyValue("--trees-density-override")===""&&(t.style.setProperty("--trees-density-override",String(this.#L.factor)),this.#$=!0)}#H(t){this.#j&&(t.style.removeProperty("--trees-item-height"),this.#j=!1),this.#$&&(t.style.removeProperty("--trees-density-override"),this.#$=!1)}};const j_=typeof window>"u"?W.useEffect:W.useLayoutEffect;function $O(e,t,n){const i=e!=null?U.jsx("div",{slot:Wd,children:e}):null,a=t!=null&&n!=null?U.jsx("div",{slot:ql,children:t(n.item,n.context)}):null;return i==null&&a==null?null:U.jsxs(U.Fragment,{children:[i,a]})}function qO(e,t){return typeof window>"u"&&t!=null?U.jsxs(U.Fragment,{children:[U.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):U.jsx(U.Fragment,{children:e})}function GO(e){const t=e.shadowRoot;return t?.querySelector("[data-file-tree-id]")instanceof HTMLElement||t?.querySelector("[data-file-tree-id]")instanceof SVGElement?!0:e.querySelector('template[shadowrootmode="open"]')instanceof HTMLTemplateElement}function WO(e,t,n,i,a){const s={...e??{}};if(t!=null&&delete s.header,n){const c=e?.contextMenu,d=c?.onClose,f=c?.onOpen;s.contextMenu={...c??{},enabled:!0,onClose:()=>{d?.(),i()},onOpen:(h,m)=>{a(h,m),f?.(h,m)}},delete s.contextMenu.render}return s.header!=null||s.contextMenu!=null?s:void 0}function KO({header:e,id:t,model:n,preloadedData:i,renderContextMenu:a,...s}){const[c,d]=W.useState(null),[f,h]=W.useState(null),m=W.useRef(n.getComposition()),g=W.useRef(n);g.current!==n&&(g.current=n,m.current=n.getComposition());const y=a!=null,b=W.useCallback(()=>{d(null)},[]),S=W.useCallback((O,D)=>{d({context:D,item:O})},[]),w=m.current,A=W.useMemo(()=>WO(w,e,y,b,S),[w,b,S,y,e]),k=W.useCallback(O=>{h(O)},[]);W.useEffect(()=>{y||d(null)},[y]),j_(()=>{n.setComposition(A)},[A,n]),j_(()=>{if(f!=null)return i!=null&&GO(f)?n.hydrate({fileTreeContainer:f}):n.render({fileTreeContainer:f}),()=>{n.unmount(),n.setComposition(w)}},[w,f,n,i]);const E=qO($O(e,a,c),i),T=t??i?.id,L={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...s.style};return U.jsx(Jm,{...s,id:T,ref:k,style:L,suppressHydrationWarning:i!=null,children:E})}function YO(e){const[t]=W.useState(()=>new jO(e)),n=W.useRef({timeout:null,model:t});return W.useEffect(()=>{const{current:i}=n;return i.timeout!=null&&(clearTimeout(i.timeout),i.timeout=null),()=>{i.timeout=setTimeout(()=>i.model.cleanUp(),1)}},[]),{model:t}}function XO(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Object.is(e[n],t[n]))return!1;return!0}function QO(e,t,n){return Object.is(e,t)||n?.(e,t)===!0}function ZO(e,t,n){const i=W.useRef({hasValue:!1,model:null,selector:null,value:void 0}),a=W.useCallback(c=>e.subscribe(c),[e]),s=W.useCallback(()=>{const c=i.current,d=t(e);if(c.model!==e||c.selector!==t||!c.hasValue)return c.hasValue=!0,c.model=e,c.selector=t,c.value=d,d;const f=c.value;return QO(f,d,n)?f:(c.value=d,d)},[n,e,t]);return W.useSyncExternalStore(a,s,s)}function JO(e,t){return e.isOpen===t.isOpen&&e.value===t.value&&XO(e.matchingPaths,t.matchingPaths)}function eP(e){const t=ZO(e,n=>({isOpen:n.isSearchOpen(),matchingPaths:n.getSearchMatchingPaths(),value:n.getSearchValue()}),JO);return W.useMemo(()=>({...t,close:()=>{e.closeSearch()},focusNextMatch:()=>{e.focusNextSearchMatch()},focusPreviousMatch:()=>{e.focusPreviousSearchMatch()},open:n=>{e.openSearch(n)},setValue:n=>{e.setSearch(n)}}),[e,t])}function tP(e){return[...e].sort((t,n)=>{const i=t.split("/"),a=n.split("/"),s=Math.min(i.length,a.length);for(let c=0;c<s;c++){const d=i[c],f=a[c],h=c<i.length-1,m=c<a.length-1;if(d===f&&h&&m)continue;if(h!==m)return h?-1:1;const g=d.localeCompare(f,void 0,{sensitivity:"base"});if(g!==0)return g;if(d!==f)return d<f?-1:1}return i.length-a.length})}const nP={added:"added",deleted:"deleted",modified:"modified",renamed:"renamed"},iP=`
2879
2879
  [data-file-tree-search-container][data-open='false'] {
2880
2880
  display: none;
2881
2881
  }
@@ -2889,7 +2889,7 @@ Error generating stack: `+u.message+`
2889
2889
  color: color-mix(in lab, light-dark(#000, #fff) 25%, var(--trees-fg));
2890
2890
  font-weight: 500;
2891
2891
  }
2892
- `,rP={flattenEmptyDirectories:!0,initialExpansion:"open",search:!0,fileTreeSearchMode:"hide-non-matches",stickyFolders:!0,unsafeCSS:iP};function oP({files:e,comments:t,totalLines:n,onOpenFile:i,onOpenComment:a}){const[s,c]=Y.useState("files"),[d,f]=Y.useState(null);return U.jsxs("aside",{className:"sidebar",id:"diff-sidebar",children:[U.jsxs("div",{className:"sidebar-tabs",role:"tablist","aria-label":"Sidebar sections",children:[U.jsxs("button",{type:"button",role:"tab","aria-selected":s==="files",className:s==="files"?"tab active":"tab",onClick:()=>c("files"),children:[U.jsx(EI,{"aria-hidden":"true"}),"Files"]}),U.jsxs("button",{type:"button",role:"tab","aria-selected":s==="comments",className:s==="comments"?"tab active":"tab",onClick:()=>c("comments"),children:[U.jsx(gI,{"aria-hidden":"true"}),"Comments",t.length>0&&U.jsx("span",{className:"badge-count",children:t.length})]}),U.jsx("button",{type:"button",className:"icon-button sidebar-search-button","aria-pressed":d?.isOpen??!1,"aria-label":d?.isOpen?"Hide file search":"Search files",title:d?.isOpen?"Hide file search":"Search files",onPointerDown:h=>{h.preventDefault()},onClick:()=>{c("files"),d?.toggle()},children:U.jsx(xI,{"aria-hidden":"true"})})]}),U.jsx("div",{className:"sidebar-body",hidden:s!=="files",children:U.jsx(aP,{files:e,comments:t,onOpenFile:i,onSearchControlChange:f})}),U.jsx("div",{className:"sidebar-body",hidden:s!=="comments",children:U.jsx(sP,{comments:t,files:e,onOpenComment:a})}),U.jsx(cP,{files:e,totalLines:n})]})}function aP({files:e,comments:t,onOpenFile:n,onSearchControlChange:i}){const a=Y.useMemo(()=>tP(e.map(b=>b.path)),[e]),s=Y.useMemo(()=>qD(a),[a]),c=Y.useRef(new Set),d=Y.useRef(new Map);c.current=new Set(e.map(b=>b.path)),d.current=fP(t);const f=dn(b=>{const S=b[0];S!==void 0&&c.current.has(S)&&n(S)}),{model:h}=YO({...rP,preparedInput:s,itemHeight:24,onSelectionChange:f,renderRowDecoration:({item:b})=>{if(!c.current.has(b.path))return null;const S=d.current.get(b.path)??0;return S===0?null:{text:String(S),title:`${S} review comment${S===1?"":"s"}`}}}),m=eP(h),g=dn(()=>{m.isOpen?m.close():m.open()}),y=Y.useMemo(()=>({isOpen:m.isOpen,toggle:g}),[m.isOpen,g]);return Y.useEffect(()=>i(y),[i,y]),Y.useEffect(()=>{h.resetPaths({preparedInput:s})},[h,s]),Y.useEffect(()=>{const b=e.map(S=>({path:S.path,status:nP[S.kind]}));h.setGitStatus(void 0),h.setGitStatus(b)},[h,e,t]),e.length===0?U.jsx("div",{className:"sidebar-empty",children:"No changed files"}):U.jsx("div",{className:"tree-host",children:U.jsx(KO,{model:h,className:"file-tree"})})}function sP({comments:e,files:t,onOpenComment:n}){const i=Y.useMemo(()=>dP(e,t),[e,t]);return i.length===0?U.jsxs("div",{className:"sidebar-empty",children:[U.jsx("strong",{children:"No comments yet"}),U.jsxs("p",{children:["Hover a line number and click the ",U.jsx("span",{className:"hint-plus",children:"+"})," button to leave a review comment. Agents read them with ",U.jsx("code",{children:"dp reviews"}),"."]})]}):U.jsx("div",{className:"comments-list",children:i.map(a=>U.jsxs("section",{children:[U.jsx("h3",{className:"comments-section-path",children:a.path}),a.comments.map(s=>U.jsxs("button",{type:"button",className:"comment-link",onClick:()=>n(s),title:s.outdated?"Outdated: the commented lines changed":void 0,children:[U.jsx("span",{className:`comment-line ${s.outdated?"":s.side}`,children:uP(s)}),s.outdated&&U.jsx("span",{className:"badge",children:"outdated"}),U.jsx("span",{className:"comment-preview",children:s.body})]},s.id))]},a.path))})}const lP=new Intl.NumberFormat("en-US");function cP({files:e,totalLines:t}){const[n,i]=Y.useState(!1);let a=0,s=0;for(const c of e)a+=c.additions,s+=c.deletions;return U.jsxs("footer",{className:"diff-stats",children:[U.jsxs("button",{type:"button",className:"diff-stats-trigger","aria-expanded":n,onClick:()=>i(c=>!c),children:[U.jsx(pI,{"aria-hidden":"true"}),U.jsx("span",{children:"Diff Stats"})]}),n&&U.jsxs("div",{className:"diff-stats-details",children:[U.jsx(pd,{label:"Files",value:e.length}),U.jsx(pd,{label:"Additions",value:a,tone:"additions"}),U.jsx(pd,{label:"Deletions",value:s,tone:"deletions"}),U.jsx(pd,{label:"Lines of code",value:t})]})]})}function pd({label:e,value:t,tone:n}){return U.jsxs("div",{className:"diff-stat-row",children:[U.jsx("span",{children:e}),U.jsx("strong",{className:n,children:lP.format(t)})]})}function uP(e){const t=e.side==="additions"?"+":"−",n=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}–${e.endLine}`;return`Line ${t}${n}`}function dP(e,t){const n=new Map;for(const s of e){const c=n.get(s.path);c?c.push(s):n.set(s.path,[s])}const i=[],a=s=>{const c=n.get(s);c&&(n.delete(s),c.sort((d,f)=>d.startLine-f.startLine||d.createdAt.localeCompare(f.createdAt)),i.push({path:s,comments:c}))};for(const s of t)a(s.path);for(const s of[...n.keys()].sort())a(s);return i}function fP(e){const t=new Map;for(const n of e)t.set(n.path,(t.get(n.path)??0)+1);return t}function hP({session:e,filter:t,onFilterChange:n,view:i,onViewChange:a,unifiedOnly:s,sidebarOpen:c,onToggleSidebar:d,connection:f}){const h=e.root.replace(/\/+$/,"").split("/").pop()||e.root;return U.jsxs("header",{className:"toolbar",children:[U.jsx("button",{type:"button",className:"icon-button sidebar-toggle","aria-controls":"diff-sidebar","aria-expanded":c,"aria-label":c?"Hide sidebar":"Show sidebar",title:c?"Hide sidebar":"Show sidebar",onClick:d,children:U.jsx(PI,{"aria-hidden":"true"})}),U.jsxs("div",{className:"toolbar-title",title:e.root,children:[U.jsx("span",{className:"repo-name",children:h}),U.jsx("span",{className:"vcs-badge",children:e.vcs})]}),U.jsxs("label",{className:"source-select",children:[U.jsx("span",{className:"sr-only",children:"Diff source"}),U.jsxs("select",{value:t,onChange:m=>n(m.target.value),children:[U.jsx("option",{value:"turn",disabled:e.turn===null,children:"Last turn"}),U.jsx("option",{value:"unstaged",children:e.unstagedLabel}),U.jsx("option",{value:"branch",children:"Branch"})]}),U.jsx(EE,{"aria-hidden":"true"})]}),U.jsxs("div",{className:"toolbar-right",children:[f!=="connected"&&U.jsx("span",{className:`connection ${f}`,children:f==="ended"?"session ended":f==="reconnecting"?"reconnecting…":"connecting…"}),U.jsx(pP,{view:i,onViewChange:a,unifiedOnly:s})]})]})}function pP({view:e,onViewChange:t,unifiedOnly:n}){const[i,a]=Y.useState(!1),s=Y.useRef(null);return Y.useEffect(()=>{if(!i)return;const c=f=>{s.current?.contains(f.target)||a(!1)},d=f=>{f.key==="Escape"&&a(!1)};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",d)}},[i]),U.jsxs("div",{className:"display-options",ref:s,children:[U.jsx("button",{type:"button",className:"icon-button","aria-label":"Display options","aria-haspopup":"dialog","aria-expanded":i,title:"Display options",onClick:()=>a(c=>!c),children:U.jsx(kI,{"aria-hidden":"true"})}),i&&U.jsxs("div",{className:"display-options-menu",role:"dialog","aria-label":"Display options",children:[U.jsxs("div",{className:"display-layout",role:"group","aria-label":"Diff layout",children:[U.jsxs("button",{type:"button",className:e.diffStyle==="split"?"active":void 0,"aria-pressed":e.diffStyle==="split",disabled:n,title:n?"Split view is unavailable in narrow panes":void 0,onClick:()=>t({...e,diffStyle:"split"}),children:[U.jsx(bI,{"aria-hidden":"true"}),"Split"]}),U.jsxs("button",{type:"button",className:e.diffStyle==="unified"?"active":void 0,"aria-pressed":e.diffStyle==="unified",onClick:()=>t({...e,diffStyle:"unified"}),children:[U.jsx(RI,{"aria-hidden":"true"}),"Unified"]})]}),U.jsxs("button",{type:"button",className:"display-option-row",role:"switch","aria-checked":e.overflow==="wrap",onClick:()=>t({...e,overflow:e.overflow==="wrap"?"scroll":"wrap"}),children:[U.jsx("span",{children:"Wrap lines"}),U.jsx("span",{className:"switch","aria-hidden":"true",children:U.jsx("span",{})})]})]})]})}const mP=/^([AD])(\d+)$/;function $_(e){const t=e===null?null:mP.exec(e);if(!t)return null;const n=Number.parseInt(t[2],10);return!Number.isSafeInteger(n)||n<1?null:{lineNumber:n,side:t[1]==="D"?"deletions":"additions"}}function q_(e,t){return`${t==="deletions"?"D":"A"}${e}`}function gP(e){const t=e.startsWith("#")?e.slice(1):e;if(t==="")return null;const n=new URLSearchParams(t),i=n.get("target"),a=$_(n.get("start"));if(!i||!a)return null;const s=n.get("end")===null?a:$_(n.get("end"));if(!s)return null;const c={start:a.lineNumber,side:a.side,end:s.lineNumber,...a.side!==s.side?{endSide:s.side}:{}};return{id:i,range:c}}function vP(e){const{id:t,range:n}=e,i=[`target=${encodeURIComponent(t).replaceAll("%2F","/")}`,`start=${q_(n.start,n.side)}`],a=n.endSide??n.side;return(n.end!==n.start||a!==n.side)&&i.push(`end=${q_(n.end,a)}`),`#${i.join("&")}`}function yP(e){const t=new URL(window.location.href);t.hash=e===null?"":vP(e),window.history.replaceState(null,"",t)}const vm="(max-width: 767px)",bP={paddingTop:4,gap:1,paddingBottom:16},SP=`
2892
+ `,rP={flattenEmptyDirectories:!0,initialExpansion:"open",search:!0,fileTreeSearchMode:"hide-non-matches",stickyFolders:!0,unsafeCSS:iP};function oP({files:e,comments:t,totalLines:n,onOpenFile:i,onOpenComment:a}){const[s,c]=W.useState("files"),[d,f]=W.useState(null);return U.jsxs("aside",{className:"sidebar",id:"diff-sidebar",children:[U.jsxs("div",{className:"sidebar-tabs",role:"tablist","aria-label":"Sidebar sections",children:[U.jsxs("button",{type:"button",role:"tab","aria-selected":s==="files",className:s==="files"?"tab active":"tab",onClick:()=>c("files"),children:[U.jsx(EI,{"aria-hidden":"true"}),"Files"]}),U.jsxs("button",{type:"button",role:"tab","aria-selected":s==="comments",className:s==="comments"?"tab active":"tab",onClick:()=>c("comments"),children:[U.jsx(gI,{"aria-hidden":"true"}),"Comments",t.length>0&&U.jsx("span",{className:"badge-count",children:t.length})]}),U.jsx("button",{type:"button",className:"icon-button sidebar-search-button","aria-pressed":d?.isOpen??!1,"aria-label":d?.isOpen?"Hide file search":"Search files",title:d?.isOpen?"Hide file search":"Search files",onPointerDown:h=>{h.preventDefault()},onClick:()=>{c("files"),d?.toggle()},children:U.jsx(xI,{"aria-hidden":"true"})})]}),U.jsx("div",{className:"sidebar-body",hidden:s!=="files",children:U.jsx(aP,{files:e,comments:t,onOpenFile:i,onSearchControlChange:f})}),U.jsx("div",{className:"sidebar-body",hidden:s!=="comments",children:U.jsx(sP,{comments:t,files:e,onOpenComment:a})}),U.jsx(cP,{files:e,totalLines:n})]})}function aP({files:e,comments:t,onOpenFile:n,onSearchControlChange:i}){const a=W.useMemo(()=>tP(e.map(S=>S.path)),[e]),s=fP(a),c=W.useMemo(()=>qD(s),[s]),d=W.useRef(new Set),f=W.useRef(new Map);d.current=new Set(e.map(S=>S.path)),f.current=hP(t);const h=dn(S=>{const w=S[0];w!==void 0&&d.current.has(w)&&n(w)}),{model:m}=YO({...rP,preparedInput:c,itemHeight:24,onSelectionChange:h,renderRowDecoration:({item:S})=>{if(!d.current.has(S.path))return null;const w=f.current.get(S.path)??0;return w===0?null:{text:String(w),title:`${w} review comment${w===1?"":"s"}`}}}),g=eP(m),y=dn(()=>{g.isOpen?g.close():g.open()}),b=W.useMemo(()=>({isOpen:g.isOpen,toggle:y}),[g.isOpen,y]);return W.useEffect(()=>i(b),[i,b]),W.useEffect(()=>{m.resetPaths({preparedInput:c})},[m,c]),W.useEffect(()=>{const S=e.map(w=>({path:w.path,status:nP[w.kind]}));m.setGitStatus(S)},[m,e]),W.useEffect(()=>{m.setComposition()},[m,t]),e.length===0?U.jsx("div",{className:"sidebar-empty",children:"No changed files"}):U.jsx("div",{className:"tree-host",children:U.jsx(KO,{model:m,className:"file-tree"})})}function sP({comments:e,files:t,onOpenComment:n}){const i=W.useMemo(()=>dP(e,t),[e,t]);return i.length===0?U.jsxs("div",{className:"sidebar-empty",children:[U.jsx("strong",{children:"No comments yet"}),U.jsxs("p",{children:["Hover a line number and click the ",U.jsx("span",{className:"hint-plus",children:"+"})," button to leave a review comment. Agents read them with ",U.jsx("code",{children:"dp reviews"}),"."]})]}):U.jsx("div",{className:"comments-list",children:i.map(a=>U.jsxs("section",{children:[U.jsx("h3",{className:"comments-section-path",children:a.path}),a.comments.map(s=>U.jsxs("button",{type:"button",className:"comment-link",onClick:()=>n(s),title:s.outdated?"Outdated: the commented lines changed":void 0,children:[U.jsx("span",{className:`comment-line ${s.outdated?"":s.side}`,children:uP(s)}),s.outdated&&U.jsx("span",{className:"badge",children:"outdated"}),U.jsx("span",{className:"comment-preview",children:s.body})]},s.id))]},a.path))})}const lP=new Intl.NumberFormat("en-US");function cP({files:e,totalLines:t}){const[n,i]=W.useState(!1);let a=0,s=0;for(const c of e)a+=c.additions,s+=c.deletions;return U.jsxs("footer",{className:"diff-stats",children:[U.jsxs("button",{type:"button",className:"diff-stats-trigger","aria-expanded":n,onClick:()=>i(c=>!c),children:[U.jsx(pI,{"aria-hidden":"true"}),U.jsx("span",{children:"Diff Stats"})]}),n&&U.jsxs("div",{className:"diff-stats-details",children:[U.jsx(pd,{label:"Files",value:e.length}),U.jsx(pd,{label:"Additions",value:a,tone:"additions"}),U.jsx(pd,{label:"Deletions",value:s,tone:"deletions"}),U.jsx(pd,{label:"Lines of code",value:t})]})]})}function pd({label:e,value:t,tone:n}){return U.jsxs("div",{className:"diff-stat-row",children:[U.jsx("span",{children:e}),U.jsx("strong",{className:n,children:lP.format(t)})]})}function uP(e){const t=e.side==="additions"?"+":"−",n=e.startLine===e.endLine?`${e.startLine}`:`${e.startLine}–${e.endLine}`;return`Line ${t}${n}`}function dP(e,t){const n=new Map;for(const s of e){const c=n.get(s.path);c?c.push(s):n.set(s.path,[s])}const i=[],a=s=>{const c=n.get(s);c&&(n.delete(s),c.sort((d,f)=>d.startLine-f.startLine||d.createdAt.localeCompare(f.createdAt)),i.push({path:s,comments:c}))};for(const s of t)a(s.path);for(const s of[...n.keys()].sort())a(s);return i}function fP(e){const t=W.useRef(e);return(t.current.length!==e.length||t.current.some((n,i)=>n!==e[i]))&&(t.current=e),t.current}function hP(e){const t=new Map;for(const n of e)t.set(n.path,(t.get(n.path)??0)+1);return t}function pP({session:e,filter:t,onFilterChange:n,view:i,onViewChange:a,unifiedOnly:s,sidebarOpen:c,onToggleSidebar:d,connection:f}){const h=e.root.replace(/\/+$/,"").split("/").pop()||e.root;return U.jsxs("header",{className:"toolbar",children:[U.jsx("button",{type:"button",className:"icon-button sidebar-toggle","aria-controls":"diff-sidebar","aria-expanded":c,"aria-label":c?"Hide sidebar":"Show sidebar",title:c?"Hide sidebar":"Show sidebar",onClick:d,children:U.jsx(PI,{"aria-hidden":"true"})}),U.jsxs("div",{className:"toolbar-title",title:e.root,children:[U.jsx("span",{className:"repo-name",children:h}),U.jsx("span",{className:"vcs-badge",children:e.vcs})]}),U.jsxs("label",{className:"source-select",children:[U.jsx("span",{className:"sr-only",children:"Diff source"}),U.jsxs("select",{value:t,onChange:m=>n(m.target.value),children:[U.jsx("option",{value:"turn",disabled:e.turn===null,children:"Last turn"}),U.jsx("option",{value:"unstaged",children:e.unstagedLabel}),U.jsx("option",{value:"branch",children:"Branch"})]}),U.jsx(EE,{"aria-hidden":"true"})]}),U.jsxs("div",{className:"toolbar-right",children:[f!=="connected"&&U.jsx("span",{className:`connection ${f}`,children:f==="ended"?"session ended":f==="reconnecting"?"reconnecting…":"connecting…"}),U.jsx(mP,{view:i,onViewChange:a,unifiedOnly:s})]})]})}function mP({view:e,onViewChange:t,unifiedOnly:n}){const[i,a]=W.useState(!1),s=W.useRef(null);return W.useEffect(()=>{if(!i)return;const c=f=>{s.current?.contains(f.target)||a(!1)},d=f=>{f.key==="Escape"&&a(!1)};return document.addEventListener("pointerdown",c),document.addEventListener("keydown",d),()=>{document.removeEventListener("pointerdown",c),document.removeEventListener("keydown",d)}},[i]),U.jsxs("div",{className:"display-options",ref:s,children:[U.jsx("button",{type:"button",className:"icon-button","aria-label":"Display options","aria-haspopup":"dialog","aria-expanded":i,title:"Display options",onClick:()=>a(c=>!c),children:U.jsx(kI,{"aria-hidden":"true"})}),i&&U.jsxs("div",{className:"display-options-menu",role:"dialog","aria-label":"Display options",children:[U.jsxs("div",{className:"display-layout",role:"group","aria-label":"Diff layout",children:[U.jsxs("button",{type:"button",className:e.diffStyle==="split"?"active":void 0,"aria-pressed":e.diffStyle==="split",disabled:n,title:n?"Split view is unavailable in narrow panes":void 0,onClick:()=>t({...e,diffStyle:"split"}),children:[U.jsx(bI,{"aria-hidden":"true"}),"Split"]}),U.jsxs("button",{type:"button",className:e.diffStyle==="unified"?"active":void 0,"aria-pressed":e.diffStyle==="unified",onClick:()=>t({...e,diffStyle:"unified"}),children:[U.jsx(RI,{"aria-hidden":"true"}),"Unified"]})]}),U.jsxs("button",{type:"button",className:"display-option-row",role:"switch","aria-checked":e.overflow==="wrap",onClick:()=>t({...e,overflow:e.overflow==="wrap"?"scroll":"wrap"}),children:[U.jsx("span",{children:"Wrap lines"}),U.jsx("span",{className:"switch","aria-hidden":"true",children:U.jsx("span",{})})]})]})]})}const gP=/^([AD])(\d+)$/;function $_(e){const t=e===null?null:gP.exec(e);if(!t)return null;const n=Number.parseInt(t[2],10);return!Number.isSafeInteger(n)||n<1?null:{lineNumber:n,side:t[1]==="D"?"deletions":"additions"}}function q_(e,t){return`${t==="deletions"?"D":"A"}${e}`}function vP(e){const t=e.startsWith("#")?e.slice(1):e;if(t==="")return null;const n=new URLSearchParams(t),i=n.get("target"),a=$_(n.get("start"));if(!i||!a)return null;const s=n.get("end")===null?a:$_(n.get("end"));if(!s)return null;const c={start:a.lineNumber,side:a.side,end:s.lineNumber,...a.side!==s.side?{endSide:s.side}:{}};return{id:i,range:c}}function yP(e){const{id:t,range:n}=e,i=[`target=${encodeURIComponent(t).replaceAll("%2F","/")}`,`start=${q_(n.start,n.side)}`],a=n.endSide??n.side;return(n.end!==n.start||a!==n.side)&&i.push(`end=${q_(n.end,a)}`),`#${i.join("&")}`}function bP(e){const t=new URL(window.location.href);t.hash=e===null?"":yP(e),window.history.replaceState(null,"",t)}const vm="(max-width: 767px)",SP={paddingTop:4,gap:1,paddingBottom:16},_P=`
2893
2893
  [data-diffs-header][data-sticky] {
2894
2894
  top: 4px;
2895
2895
  }
@@ -2901,4 +2901,4 @@ Error generating stack: `+u.message+`
2901
2901
  background: var(--diffs-bg);
2902
2902
  pointer-events: none;
2903
2903
  }
2904
- `,_P={added:"A",modified:"M",deleted:"D",renamed:"R"};function CP(){const[e,t]=Y.useState(null),[n,i]=Y.useState(null),[a,s]=Y.useState(null),[c,d]=Y.useState(null),[f,h]=Y.useState([]),[m,g]=Y.useState(null),[y,b]=Y.useState("connecting"),[S,w]=Y.useState({diffStyle:"split",overflow:"scroll"}),[A,k]=Y.useState(()=>window.matchMedia(vm).matches),[E,T]=Y.useState(()=>!window.matchMedia(vm).matches),[L,O]=Y.useState(()=>new Set),[D,N]=Y.useState(null),W=Y.useRef(null),G=Y.useRef(null),se=Y.useRef(gP(window.location.hash)),ie=a??e?.defaultFilter??"branch",ee=A?"unified":S.diffStyle;Y.useEffect(()=>{const ne=window.matchMedia(vm),de=Ve=>{k(Ve),Ve&&T(!1)},Le=Ve=>de(Ve.matches);return de(ne.matches),ne.addEventListener("change",Le),()=>ne.removeEventListener("change",Le)},[]),Y.useEffect(()=>{if(!A||!E)return;const ne=de=>{de.key==="Escape"&&T(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[A,E]),Y.useEffect(()=>{let ne=!1;return(async()=>{try{const de=await NI();if(ne)return;t(de),s(Le=>Le??de.defaultFilter)}catch(de){ne||i(de instanceof Error?de.message:String(de))}})(),()=>{ne=!0}},[]);const te=Y.useCallback(async ne=>{try{const de=await HI(ne);G.current=de.patchHash,d(de)}catch(de){d({filter:ne,patchHash:"load-error",patch:"",files:[],error:de instanceof Error?de.message:String(de),generatedAt:new Date().toISOString()})}},[]),le=e!==null;Y.useEffect(()=>{if(!le||a===null)return;let ne=!1;return b("connecting"),G.current=null,te(a),UI(a,{onOpen:()=>{b("connected"),ne&&te(a),ne=!0},onDisconnect:()=>b("reconnecting"),onEnd:()=>b("ended"),onSession:t,onComments:h,onPatch:Le=>{Le.filter===a&&Le.patchHash!==G.current&&te(a)}})},[le,a,te]),Y.useEffect(()=>{g(null),N(null)},[ie]);const me=Y.useMemo(()=>!c||c.patch===""?[]:tL(c.patch,c.patchHash.slice(0,16)).flatMap(Le=>Le.files).map((Le,Ve)=>({path:c.files[Ve]?.path??Le.name,fileDiff:Le})),[c]),H=Y.useMemo(()=>new Map((c?.files??[]).map(ne=>[ne.path,ne])),[c?.files]),z=Y.useMemo(()=>me.reduce((ne,de)=>ne+de.fileDiff.unifiedLineCount,0),[me]),Q=Y.useMemo(()=>f.filter(ne=>ne.filter===ie),[f,ie]),ce=Y.useMemo(()=>FI(Q,m),[Q,m]),_e=Y.useRef(new Map),M=Y.useMemo(()=>{const ne=c?.patchHash??"";return me.map(({path:de,fileDiff:Le})=>{const Ve=`f:${de}`,Tt=ce.get(de)??[],vn=L.has(de),yn=`${ne}|${vn?1:0}|${jI(Tt)}`,Qn=_e.current.get(Ve);let Ki=Qn?.version??1;return(!Qn||Qn.key!==yn)&&(Ki=(Qn?.version??0)+1,_e.current.set(Ve,{version:Ki,key:yn})),{id:Ve,type:"diff",fileDiff:Le,annotations:Tt,collapsed:vn,version:Ki}})},[me,ce,L,c?.patchHash]);Y.useEffect(()=>{const ne=se.current;!ne||M.length===0||M.some(de=>de.id===ne.id)&&(se.current=null,N(ne),W.current?.scrollTo({type:"range",id:ne.id,range:ne.range,align:"center"}))},[M]);const q=dn(ne=>{N(ne),yP(ne)}),re=dn(ne=>{const Le=W.current?.getInstance(),Ve=Le?.getTopForItem(`f:${ne}`),Tt=Le?.getScrollTop();O(vn=>{const yn=new Set(vn);return yn.delete(ne)||yn.add(ne),yn}),Ve!==void 0&&Tt!==void 0&&Ve<Tt&&requestAnimationFrame(()=>{W.current?.scrollTo({type:"item",id:`f:${ne}`,align:"start"})})}),ae=dn((ne,de)=>{g({path:de.slice(2),side:ne.endSide??ne.side??"additions",startLine:Math.min(ne.start,ne.end),endLine:Math.max(ne.start,ne.end)})}),he=dn(async(ne,de)=>{await zI({filter:ie,path:ne.path,side:ne.side,startLine:ne.startLine,endLine:ne.endLine,body:de}),g(null)}),Se=dn(async(ne,de)=>{await VI(ne,de)}),be=dn(async ne=>{await BI(ne)}),Ue=dn(ne=>{A&&T(!1),O(de=>{if(!de.has(ne))return de;const Le=new Set(de);return Le.delete(ne),Le}),requestAnimationFrame(()=>{W.current?.scrollTo({type:"item",id:`f:${ne}`,align:"start"})})}),Ce=dn(ne=>{if(A&&T(!1),ne.outdated){Ue(ne.path);return}const de=`f:${ne.path}`,Le={start:ne.startLine,side:ne.side,end:ne.endLine,endSide:ne.side};q({id:de,range:Le}),O(Ve=>{if(!Ve.has(ne.path))return Ve;const Tt=new Set(Ve);return Tt.delete(ne.path),Tt}),requestAnimationFrame(()=>{W.current?.scrollTo({type:"line",id:de,lineNumber:ne.endLine,side:ne.side,align:"center",behavior:"smooth-auto"})})}),He=Y.useMemo(()=>({theme:{dark:"pierre-dark",light:"pierre-light"},diffStyle:ee,overflow:S.overflow,stickyHeaders:!0,enableLineSelection:!0,enableGutterUtility:!0,lineHoverHighlight:"number",hunkSeparators:"line-info-basic",layout:bP,unsafeCSS:SP,onGutterUtilityClick(ne,de){de.item.type==="diff"&&ae(ne,de.item.id)}}),[ee,S.overflow,ae]),We=dn(ne=>U.jsx(EP,{path:ne.id.slice(2),summary:H.get(ne.id.slice(2)),collapsed:ne.collapsed===!0,onToggleCollapsed:re})),lt=dn(ne=>U.jsx($I,{meta:ne.metadata,onCreate:he,onUpdate:Se,onDelete:be,onCancelDraft:()=>g(null)}));return n?U.jsxs("div",{className:"fullscreen-message error",children:[U.jsx("h1",{children:"diffs-pane"}),U.jsx("p",{children:n})]}):!e||!c?U.jsx("div",{className:"fullscreen-message",children:"Loading…"}):U.jsxs("div",{className:"app",children:[U.jsx(hP,{session:e,filter:ie,onFilterChange:s,view:{...S,diffStyle:ee},onViewChange:w,unifiedOnly:A,sidebarOpen:E,onToggleSidebar:()=>T(ne=>!ne),connection:y}),U.jsxs("div",{className:`content ${A?"narrow":""}`,children:[A&&E&&U.jsx("button",{type:"button",className:"sidebar-backdrop","aria-label":"Close sidebar",onClick:()=>T(!1)}),E&&U.jsx(oP,{files:c.files,comments:Q,totalLines:z,onOpenFile:Ue,onOpenComment:Ce}),U.jsx("main",{className:"diff-pane",children:c.error?U.jsx("div",{className:"banner error",children:c.error}):M.length===0?U.jsxs("div",{className:"fullscreen-message subtle",children:["No changes in the"," ",ie==="unstaged"?e.unstagedLabel.toLowerCase():ie," ","diff."]}):U.jsx(eI,{ref:W,items:M,className:"code-view",options:He,selectedLines:D,onSelectedLinesChange:q,renderCustomHeader:We,renderAnnotation:lt})})]})]})}function EP({path:e,summary:t,collapsed:n,onToggleCollapsed:i}){return U.jsxs("div",{className:"file-header",children:[U.jsx("button",{type:"button",className:"collapse-button","aria-expanded":!n,"aria-label":n?"Expand diff":"Collapse diff",onClick:a=>{a.preventDefault(),a.stopPropagation(),i(e)},children:U.jsx(EE,{"aria-hidden":"true",className:n?"chevron collapsed":"chevron"})}),t&&U.jsx("span",{className:`file-status ${t.kind}`,title:t.kind,children:_P[t.kind]}),U.jsx("span",{className:"file-path",children:t?.prevPath!==void 0?`${t.prevPath} → ${e}`:e}),t&&(t.binary?U.jsx("span",{className:"file-stats binary",children:"binary"}):U.jsxs("span",{className:"file-stats",children:[U.jsxs("span",{className:"add",children:["+",t.additions]}),U.jsxs("span",{className:"del",children:["−",t.deletions]})]}))]})}const wP=()=>new sI,D5=document.getElementById("root");if(!D5)throw new Error("missing #root");fI.createRoot(D5).render(U.jsx(Y.StrictMode,{children:U.jsx(a6,{poolOptions:{workerFactory:wP},highlighterOptions:{theme:{dark:"pierre-dark",light:"pierre-light"},langs:["typescript","javascript","tsx","jsx","json","css","html","python","rust","go","java","c","cpp","shellscript","yaml","markdown","toml","sql","ruby","php","swift","kotlin"]},children:U.jsx(CP,{})})}));
2904
+ `,CP={added:"A",modified:"M",deleted:"D",renamed:"R"};function EP(){const[e,t]=W.useState(null),[n,i]=W.useState(null),[a,s]=W.useState(null),[c,d]=W.useState(null),[f,h]=W.useState([]),[m,g]=W.useState(null),[y,b]=W.useState("connecting"),[S,w]=W.useState({diffStyle:"split",overflow:"scroll"}),[A,k]=W.useState(()=>window.matchMedia(vm).matches),[E,T]=W.useState(()=>!window.matchMedia(vm).matches),[L,O]=W.useState(()=>new Set),[D,N]=W.useState(null),K=W.useRef(null),G=W.useRef(null),se=W.useRef(vP(window.location.hash)),ie=a??e?.defaultFilter??"branch",ee=A?"unified":S.diffStyle;W.useEffect(()=>{const ne=window.matchMedia(vm),de=Ve=>{k(Ve),Ve&&T(!1)},Le=Ve=>de(Ve.matches);return de(ne.matches),ne.addEventListener("change",Le),()=>ne.removeEventListener("change",Le)},[]),W.useEffect(()=>{if(!A||!E)return;const ne=de=>{de.key==="Escape"&&T(!1)};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[A,E]),W.useEffect(()=>{let ne=!1;return(async()=>{try{const de=await NI();if(ne)return;t(de),s(Le=>Le??de.defaultFilter)}catch(de){ne||i(de instanceof Error?de.message:String(de))}})(),()=>{ne=!0}},[]);const te=W.useCallback(async ne=>{try{const de=await HI(ne);G.current=de.patchHash,d(de)}catch(de){d({filter:ne,patchHash:"load-error",patch:"",files:[],error:de instanceof Error?de.message:String(de),generatedAt:new Date().toISOString()})}},[]),le=e!==null;W.useEffect(()=>{if(!le||a===null)return;let ne=!1;return b("connecting"),G.current=null,te(a),UI(a,{onOpen:()=>{b("connected"),ne&&te(a),ne=!0},onDisconnect:()=>b("reconnecting"),onEnd:()=>b("ended"),onSession:t,onComments:h,onPatch:Le=>{Le.filter===a&&Le.patchHash!==G.current&&te(a)}})},[le,a,te]),W.useEffect(()=>{g(null),N(null)},[ie]);const me=W.useMemo(()=>!c||c.patch===""?[]:tL(c.patch,c.patchHash.slice(0,16)).flatMap(Le=>Le.files).map((Le,Ve)=>({path:c.files[Ve]?.path??Le.name,fileDiff:Le})),[c]),H=W.useMemo(()=>new Map((c?.files??[]).map(ne=>[ne.path,ne])),[c?.files]),z=W.useMemo(()=>me.reduce((ne,de)=>ne+de.fileDiff.unifiedLineCount,0),[me]),Q=W.useMemo(()=>f.filter(ne=>ne.filter===ie),[f,ie]),ce=W.useMemo(()=>FI(Q,m),[Q,m]),_e=W.useRef(new Map),M=W.useMemo(()=>{const ne=c?.patchHash??"";return me.map(({path:de,fileDiff:Le})=>{const Ve=`f:${de}`,Tt=ce.get(de)??[],vn=L.has(de),yn=`${ne}|${vn?1:0}|${jI(Tt)}`,Qn=_e.current.get(Ve);let Ki=Qn?.version??1;return(!Qn||Qn.key!==yn)&&(Ki=(Qn?.version??0)+1,_e.current.set(Ve,{version:Ki,key:yn})),{id:Ve,type:"diff",fileDiff:Le,annotations:Tt,collapsed:vn,version:Ki}})},[me,ce,L,c?.patchHash]);W.useEffect(()=>{const ne=se.current;!ne||M.length===0||M.some(de=>de.id===ne.id)&&(se.current=null,N(ne),K.current?.scrollTo({type:"range",id:ne.id,range:ne.range,align:"center"}))},[M]);const q=dn(ne=>{N(ne),bP(ne)}),re=dn(ne=>{const Le=K.current?.getInstance(),Ve=Le?.getTopForItem(`f:${ne}`),Tt=Le?.getScrollTop();O(vn=>{const yn=new Set(vn);return yn.delete(ne)||yn.add(ne),yn}),Ve!==void 0&&Tt!==void 0&&Ve<Tt&&requestAnimationFrame(()=>{K.current?.scrollTo({type:"item",id:`f:${ne}`,align:"start"})})}),ae=dn((ne,de)=>{g({path:de.slice(2),side:ne.endSide??ne.side??"additions",startLine:Math.min(ne.start,ne.end),endLine:Math.max(ne.start,ne.end)})}),he=dn(async(ne,de)=>{await zI({filter:ie,path:ne.path,side:ne.side,startLine:ne.startLine,endLine:ne.endLine,body:de}),g(null)}),Se=dn(async(ne,de)=>{await VI(ne,de)}),be=dn(async ne=>{await BI(ne)}),Ue=dn(ne=>{A&&T(!1),O(de=>{if(!de.has(ne))return de;const Le=new Set(de);return Le.delete(ne),Le}),requestAnimationFrame(()=>{K.current?.scrollTo({type:"item",id:`f:${ne}`,align:"start"})})}),Ce=dn(ne=>{if(A&&T(!1),ne.outdated){Ue(ne.path);return}const de=`f:${ne.path}`,Le={start:ne.startLine,side:ne.side,end:ne.endLine,endSide:ne.side};q({id:de,range:Le}),O(Ve=>{if(!Ve.has(ne.path))return Ve;const Tt=new Set(Ve);return Tt.delete(ne.path),Tt}),requestAnimationFrame(()=>{K.current?.scrollTo({type:"line",id:de,lineNumber:ne.endLine,side:ne.side,align:"center",behavior:"smooth-auto"})})}),He=W.useMemo(()=>({theme:{dark:"pierre-dark",light:"pierre-light"},diffStyle:ee,overflow:S.overflow,stickyHeaders:!0,enableLineSelection:!0,enableGutterUtility:!0,lineHoverHighlight:"number",hunkSeparators:"line-info-basic",layout:SP,unsafeCSS:_P,onGutterUtilityClick(ne,de){de.item.type==="diff"&&ae(ne,de.item.id)}}),[ee,S.overflow,ae]),We=dn(ne=>U.jsx(wP,{path:ne.id.slice(2),summary:H.get(ne.id.slice(2)),collapsed:ne.collapsed===!0,onToggleCollapsed:re})),lt=dn(ne=>U.jsx($I,{meta:ne.metadata,onCreate:he,onUpdate:Se,onDelete:be,onCancelDraft:()=>g(null)}));return n?U.jsxs("div",{className:"fullscreen-message error",children:[U.jsx("h1",{children:"diffs-pane"}),U.jsx("p",{children:n})]}):!e||!c?U.jsx("div",{className:"fullscreen-message",children:"Loading…"}):U.jsxs("div",{className:"app",children:[U.jsx(pP,{session:e,filter:ie,onFilterChange:s,view:{...S,diffStyle:ee},onViewChange:w,unifiedOnly:A,sidebarOpen:E,onToggleSidebar:()=>T(ne=>!ne),connection:y}),U.jsxs("div",{className:`content ${A?"narrow":""}`,children:[A&&E&&U.jsx("button",{type:"button",className:"sidebar-backdrop","aria-label":"Close sidebar",onClick:()=>T(!1)}),E&&U.jsx(oP,{files:c.files,comments:Q,totalLines:z,onOpenFile:Ue,onOpenComment:Ce}),U.jsx("main",{className:"diff-pane",children:c.error?U.jsx("div",{className:"banner error",children:c.error}):M.length===0?U.jsxs("div",{className:"fullscreen-message subtle",children:["No changes in the"," ",ie==="unstaged"?e.unstagedLabel.toLowerCase():ie," ","diff."]}):U.jsx(eI,{ref:K,items:M,className:"code-view",options:He,selectedLines:D,onSelectedLinesChange:q,renderCustomHeader:We,renderAnnotation:lt})})]})]})}function wP({path:e,summary:t,collapsed:n,onToggleCollapsed:i}){return U.jsxs("div",{className:"file-header",children:[U.jsx("button",{type:"button",className:"collapse-button","aria-expanded":!n,"aria-label":n?"Expand diff":"Collapse diff",onClick:a=>{a.preventDefault(),a.stopPropagation(),i(e)},children:U.jsx(EE,{"aria-hidden":"true",className:n?"chevron collapsed":"chevron"})}),t&&U.jsx("span",{className:`file-status ${t.kind}`,title:t.kind,children:CP[t.kind]}),U.jsx("span",{className:"file-path",children:t?.prevPath!==void 0?`${t.prevPath} → ${e}`:e}),t&&(t.binary?U.jsx("span",{className:"file-stats binary",children:"binary"}):U.jsxs("span",{className:"file-stats",children:[U.jsxs("span",{className:"add",children:["+",t.additions]}),U.jsxs("span",{className:"del",children:["−",t.deletions]})]}))]})}const xP=()=>new sI,D5=document.getElementById("root");if(!D5)throw new Error("missing #root");fI.createRoot(D5).render(U.jsx(W.StrictMode,{children:U.jsx(a6,{poolOptions:{workerFactory:xP},highlighterOptions:{theme:{dark:"pierre-dark",light:"pierre-light"},langs:["typescript","javascript","tsx","jsx","json","css","html","python","rust","go","java","c","cpp","shellscript","yaml","markdown","toml","sql","ruby","php","swift","kotlin"]},children:U.jsx(EP,{})})}));