const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/dialog-select-provider-Y4yhG6eH.js","assets/list-DjCtFiup.js","assets/provider-icon-CWRP2MCf.js","assets/dialog-connect-provider-BN1uenf1.js","assets/dialog-select-server-zIFNaq0H.js","assets/server-row-CVcn4HRs.js","assets/index-EBSKCvcR.js","assets/dialog-settings-Rx2SFQ1r.js","assets/select-CUF2vqF6.js","assets/switch-mjOqbKj6.js","assets/dialog-select-directory-Biw3Fplx.js","assets/file-icon-64imKaKk.js","assets/home-B5ojLxUQ.js","assets/session-request-tree-DSRqbH0d.js","assets/home-PVqYbUBE.css","assets/session-Dq7ZRNUY.js"])))=>i.map(i=>d[i]); (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Ae={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return r2(this.context.count)},getNextContextId(){return r2(this.context.count++)}};function r2(t){const e=String(t),n=e.length-1;return Ae.context.id+(n?String.fromCharCode(96+n):"")+e}function qi(t){Ae.context=t}const aw=!1,ML=(t,e)=>t===e,Xr=Symbol("solid-proxy"),lw=typeof Proxy=="function",mf=Symbol("solid-track"),gf={equals:ML};let cc=null,cw=hw;const Or=1,kc=2,uw={owned:null,cleanups:null,context:null,owner:null},ep={};var ze=null;let ke=null,IL=null,mt=null,Rn=null,hn=null,k0=0;function wn(t,e){const n=mt,r=ze,i=t.length===0,s=e===void 0?r:e,o=i?uw:{owned:null,cleanups:null,context:s?s.context:null,owner:s},a=i?t:()=>t(()=>ft(()=>$s(o)));ze=o,mt=null;try{return lr(a,!0)}finally{mt=n,ze=r}}function be(t,e){e=e?Object.assign({},gf,e):gf;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(ke&&ke.running&&ke.sources.has(n)?i=i(n.tValue):i=i(n.value)),fw(n,i));return[dw.bind(n),r]}function mi(t,e,n){const r=su(t,e,!0,Or);il(r)}function Ke(t,e,n){const r=su(t,e,!1,Or);il(r)}function re(t,e,n){cw=$L;const r=su(t,e,!1,Or),i=xo&&bt(xo);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),hn?hn.push(r):il(r)}function Y(t,e,n){n=n?Object.assign({},gf,n):gf;const r=su(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,il(r),dw.bind(r)}function OL(t){return t&&typeof t=="object"&&"then"in t}function as(t,e,n){let r,i,s;typeof e=="function"?(r=t,i=e,s=n||{}):(r=!0,i=t,s=e||{});let o=null,a=ep,l=null,c=!1,u=!1,d="initialValue"in s,f=typeof r=="function"&&Y(r);const h=new Set,[p,m]=(s.storage||be)(s.initialValue),[g,y]=be(void 0),[v,w]=be(void 0,{equals:!1}),[_,k]=be(d?"ready":"unresolved");Ae.context&&(l=Ae.getNextContextId(),s.ssrLoadFrom==="initial"?a=s.initialValue:Ae.load&&Ae.has(l)&&(a=Ae.load(l)));function S(R,F,T,D){return o===R&&(o=null,D!==void 0&&(d=!0),(R===a||F===a)&&s.onHydrated&&queueMicrotask(()=>s.onHydrated(D,{value:F})),a=ep,ke&&R&&c?(ke.promises.delete(R),c=!1,lr(()=>{ke.running=!0,L(F,T)},!1)):L(F,T)),F}function L(R,F){lr(()=>{F===void 0&&m(()=>R),k(F!==void 0?"errored":d?"ready":"unresolved"),y(F);for(const T of h.keys())T.decrement();h.clear()},!1)}function E(){const R=xo&&bt(xo),F=p(),T=g();if(T!==void 0&&!o)throw T;return mt&&!mt.user&&R&&mi(()=>{v(),o&&(R.resolved&&ke&&c?ke.promises.add(o):h.has(R)||(R.increment(),h.add(R)))}),F}function C(R=!0){if(R!==!1&&u)return;u=!1;const F=f?f():r;if(c=ke&&ke.running,F==null||F===!1){S(o,ft(p));return}ke&&o&&ke.promises.delete(o);let T;const D=a!==ep?a:ft(()=>{try{return i(F,{value:p(),refetching:R})}catch(M){T=M}});if(T!==void 0){S(o,void 0,Bd(T),F);return}else if(!OL(D))return S(o,D,void 0,F),D;return o=D,"v"in D?(D.s===1?S(o,D.v,void 0,F):S(o,void 0,Bd(D.v),F),D):(u=!0,queueMicrotask(()=>u=!1),lr(()=>{k(d?"refreshing":"pending"),w()},!1),D.then(M=>S(D,M,void 0,F),M=>S(D,void 0,Bd(M),F)))}Object.defineProperties(E,{state:{get:()=>_()},error:{get:()=>g()},loading:{get(){const R=_();return R==="pending"||R==="refreshing"}},latest:{get(){if(!d)return E();const R=g();if(R&&!o)throw R;return p()}}});let V=ze;return f?mi(()=>(V=ze,C(!1))):C(!1),[E,{refetch:R=>ji(V,()=>C(R)),mutate:m}]}function et(t){return lr(t,!1)}function ft(t){if(mt===null)return t();const e=mt;mt=null;try{return t()}finally{mt=e}}function Tt(t,e,n){const r=Array.isArray(t);let i,s=n&&n.defer;return o=>{let a;if(r){a=Array(t.length);for(let c=0;ce(a,i,o));return i=a,l}}function Vt(t){re(()=>ft(t))}function ae(t){return ze===null||(ze.cleanups===null?ze.cleanups=[t]:ze.cleanups.push(t)),t}function DL(t,e){cc||(cc=Symbol("error")),ze=su(void 0,void 0,!0),ze.context={...ze.context,[cc]:[e]},ke&&ke.running&&ke.sources.add(ze);try{return t()}catch(n){ou(n)}finally{ze=ze.owner}}function Km(){return mt}function Jr(){return ze}function ji(t,e){const n=ze,r=mt;ze=t,mt=null;try{return lr(e,!0)}catch(i){ou(i)}finally{ze=n,mt=r}}function hy(t){if(ke&&ke.running)return t(),ke.done;const e=mt,n=ze;return Promise.resolve().then(()=>{mt=e,ze=n;let r;return xo&&(r=ke||(ke={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),lr(t,!1),mt=ze=null,r?r.done:void 0})}const[vue,i2]=be(!1);function RL(t){hn.push.apply(hn,t),t.length=0}function vt(t,e){const n=Symbol("context");return{id:n,Provider:FL(n),defaultValue:t}}function bt(t){let e;return ze&&ze.context&&(e=ze.context[t.id])!==void 0?e:t.defaultValue}function x0(t){const e=Y(t),n=Y(()=>Zm(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let xo;function PL(){return xo||(xo=vt())}function dw(){const t=ke&&ke.running;if(this.sources&&(t?this.tState:this.state))if((t?this.tState:this.state)===Or)il(this);else{const e=Rn;Rn=null,lr(()=>vf(this),!1),Rn=e}if(mt){const e=this.observers?this.observers.length:0;mt.sources?(mt.sources.push(this),mt.sourceSlots.push(e)):(mt.sources=[this],mt.sourceSlots=[e]),this.observers?(this.observers.push(mt),this.observerSlots.push(mt.sources.length-1)):(this.observers=[mt],this.observerSlots=[mt.sources.length-1])}return t&&ke.sources.has(this)?this.tValue:this.value}function fw(t,e,n){let r=ke&&ke.running&&ke.sources.has(t)?t.tValue:t.value;if(!t.comparator||!t.comparator(r,e)){if(ke){const i=ke.running;(i||!n&&ke.sources.has(t))&&(ke.sources.add(t),t.tValue=e),i||(t.value=e)}else t.value=e;t.observers&&t.observers.length&&lr(()=>{for(let i=0;i1e6)throw Rn=[],new Error},!1)}return e}function il(t){if(!t.fn)return;$s(t);const e=k0;s2(t,ke&&ke.running&&ke.sources.has(t)?t.tValue:t.value,e),ke&&!ke.running&&ke.sources.has(t)&&queueMicrotask(()=>{lr(()=>{ke&&(ke.running=!0),mt=ze=t,s2(t,t.tValue,e),mt=ze=null},!1)})}function s2(t,e,n){let r;const i=ze,s=mt;mt=ze=t;try{r=t.fn(e)}catch(o){return t.pure&&(ke&&ke.running?(t.tState=Or,t.tOwned&&t.tOwned.forEach($s),t.tOwned=void 0):(t.state=Or,t.owned&&t.owned.forEach($s),t.owned=null)),t.updatedAt=n+1,ou(o)}finally{mt=s,ze=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?fw(t,r,!0):ke&&ke.running&&t.pure?(ke.sources.has(t)||(t.value=r),ke.sources.add(t),t.tValue=r):t.value=r,t.updatedAt=n)}function su(t,e,n,r=Or,i){const s={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:ze,context:ze?ze.context:null,pure:n};return ke&&ke.running&&(s.state=0,s.tState=r),ze===null||ze!==uw&&(ke&&ke.running&&ze.pure?ze.tOwned?ze.tOwned.push(s):ze.tOwned=[s]:ze.owned?ze.owned.push(s):ze.owned=[s]),s}function yf(t){const e=ke&&ke.running;if((e?t.tState:t.state)===0)return;if((e?t.tState:t.state)===kc)return vf(t);if(t.suspense&&ft(t.suspense.inFallback))return t.suspense.effects.push(t);const n=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt=0;r--){if(t=n[r],e){let i=t,s=n[r+1];for(;(i=i.owner)&&i!==s;)if(ke.disposed.has(i))return}if((e?t.tState:t.state)===Or)il(t);else if((e?t.tState:t.state)===kc){const i=Rn;Rn=null,lr(()=>vf(t,n[0]),!1),Rn=i}}}function lr(t,e){if(Rn)return t();let n=!1;e||(Rn=[]),hn?n=!0:hn=[],k0++;try{const r=t();return NL(n),r}catch(r){n||(hn=null),Rn=null,ou(r)}}function NL(t){if(Rn&&(hw(Rn),Rn=null),t)return;let e;if(ke){if(!ke.promises.size&&!ke.queue.size){const r=ke.sources,i=ke.disposed;hn.push.apply(hn,ke.effects),e=ke.resolve;for(const s of hn)"tState"in s&&(s.state=s.tState),delete s.tState;ke=null,lr(()=>{for(const s of i)$s(s);for(const s of r){if(s.value=s.tValue,s.owned)for(let o=0,a=s.owned.length;ocw(n),!1),e&&e()}function hw(t){for(let e=0;e=0;e--)$s(t.tOwned[e]);delete t.tOwned}if(ke&&ke.running&&t.pure)mw(t,!0);else if(t.owned){for(e=t.owned.length-1;e>=0;e--)$s(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}ke&&ke.running?t.tState=0:t.state=0}function mw(t,e){if(e||(t.tState=0,ke.disposed.add(t)),t.owned)for(let n=0;ni=ft(()=>(ze.context={...ze.context,[t]:r.value},x0(()=>r.children))),void 0),i}}const Ym=Symbol("fallback");function bf(t){for(let e=0;e1?[]:null;return ae(()=>bf(s)),()=>{let l=t()||[],c=l.length,u,d;return l[mf],ft(()=>{let h,p,m,g,y,v,w,_,k;if(c===0)o!==0&&(bf(s),s=[],r=[],i=[],o=0,a&&(a=[])),n.fallback&&(r=[Ym],i[0]=wn(S=>(s[0]=S,n.fallback())),o=1);else if(o===0){for(i=new Array(c),d=0;d=v&&_>=v&&r[w]===l[_];w--,_--)m[_]=i[w],g[_]=s[w],a&&(y[_]=a[w]);for(h=new Map,p=new Array(_+1),d=_;d>=v;d--)k=l[d],u=h.get(k),p[d]=u===void 0?-1:u,h.set(k,d);for(u=v;u<=w;u++)k=r[u],d=h.get(k),d!==void 0&&d!==-1?(m[d]=i[u],g[d]=s[u],a&&(y[d]=a[u]),d=p[d],h.set(k,d)):s[u]();for(d=v;dbf(s)),()=>{const c=t()||[],u=c.length;return c[mf],ft(()=>{if(u===0)return a!==0&&(bf(s),s=[],r=[],i=[],a=0,o=[]),n.fallback&&(r=[Ym],i[0]=wn(f=>(s[0]=f,n.fallback())),a=1),i;for(r[0]===Ym&&(s[0](),s=[],r=[],i=[],a=0),l=0;lc[l]):l>=r.length&&(i[l]=wn(d));for(;lt(e||{}))}function qu(){return!0}const Qm={get(t,e,n){return e===Xr?n:t.get(e)},has(t,e){return e===Xr?!0:t.has(e)},set:qu,deleteProperty:qu,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:qu,deleteProperty:qu}},ownKeys(t){return t.keys()}};function tp(t){return(t=typeof t=="function"?t():t)?t:{}}function VL(){for(let t=0,e=this.length;t=0;a--){const l=tp(t[a])[o];if(l!==void 0)return l}},has(o){for(let a=t.length-1;a>=0;a--)if(o in tp(t[a]))return!0;return!1},keys(){const o=[];for(let a=0;a=0;o--){const a=t[o];if(!a)continue;const l=Object.getOwnPropertyNames(a);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const d=Object.getOwnPropertyDescriptor(a,u);if(!r[u])r[u]=d.get?{enumerable:!0,configurable:!0,get:VL.bind(n[u]=[d.get.bind(a)])}:d.value!==void 0?d:void 0;else{const f=n[u];f&&(d.get?f.push(d.get.bind(a)):d.value!==void 0&&f.push(()=>d.value))}}}const i={},s=Object.keys(r);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r[a];l&&l.get?Object.defineProperty(i,a,l):i[a]=l?l.value:void 0}return i}function ue(t,...e){const n=e.length;if(lw&&Xr in t){const i=n>1?e.flat():e[0],s=e.map(o=>new Proxy({get(a){return o.includes(a)?t[a]:void 0},has(a){return o.includes(a)&&a in t},keys(){return o.filter(a=>a in t)}},Qm));return s.push(new Proxy({get(o){return i.includes(o)?void 0:t[o]},has(o){return i.includes(o)?!1:o in t},keys(){return Object.keys(t).filter(o=>!i.includes(o))}},Qm)),s}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(t)){let s=n;for(let l=0;l{const s=Ae.context;if(s){const[a,l]=be();Ae.count||(Ae.count=0),Ae.count++,(n||(n=t())).then(c=>{!Ae.done&&qi(s),Ae.count--,l(()=>c.default),qi()}),e=a}else if(!e){const[a]=as(()=>(n||(n=t())).then(l=>l.default));e=a}let o;return Y(()=>(o=e())?ft(()=>{if(!s||Ae.done)return o(i);const a=Ae.context;qi(s);const l=o(i);return qi(a),l}):"")};return r.preload=()=>n||((n=t()).then(i=>e=()=>i.default),n),r}let zL=0;function xn(){return Ae.context?Ae.getNextContextId():`cl-${zL++}`}const vw=t=>`Stale read from <${t}>.`;function S0(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Y(gw(()=>t.each,t.children,e||void 0))}function bue(t){const e="fallback"in t&&{fallback:()=>t.fallback};return Y(HL(()=>t.each,t.children,e||void 0))}function Me(t){const e=t.keyed,n=Y(()=>t.when,void 0,void 0),r=e?n:Y(n,void 0,{equals:(i,s)=>!i==!s});return Y(()=>{const i=r();if(i){const s=t.children;return typeof s=="function"&&s.length>0?ft(()=>s(e?i:()=>{if(!ft(r))throw vw("Show");return n()})):s}return t.fallback},void 0,void 0)}function _0(t){const e=x0(()=>t.children),n=Y(()=>{const r=e(),i=Array.isArray(r)?r:[r];let s=()=>{};for(let o=0;oc()?void 0:l.when,void 0,void 0),d=l.keyed?u:Y(u,void 0,{equals:(f,h)=>!f==!h});s=()=>c()||(d()?[a,u,l]:void 0)}return s});return Y(()=>{const r=n()();if(!r)return t.fallback;const[i,s,o]=r,a=o.children;return typeof a=="function"&&a.length>0?ft(()=>a(o.keyed?s():()=>{if(ft(n)()?.[0]!==i)throw vw("Match");return s()})):a},void 0,void 0)}function ui(t){return t}let ka;function BL(){ka&&[...ka].forEach(t=>t())}function qL(t){let e;Ae.context&&Ae.load&&(e=Ae.load(Ae.getContextId()));const[n,r]=be(e,void 0);return ka||(ka=new Set),ka.add(r),ae(()=>ka.delete(r)),Y(()=>{let i;if(i=n()){const s=t.fallback;return typeof s=="function"&&s.length?ft(()=>s(i,()=>r())):s}return DL(()=>t.children,r)},void 0,void 0)}const jL=vt();function UL(t){let e=0,n,r,i,s,o;const[a,l]=be(!1),c=PL(),u={increment:()=>{++e===1&&l(!0)},decrement:()=>{--e===0&&l(!1)},inFallback:a,effects:[],resolved:!1},d=Jr();if(Ae.context&&Ae.load){const p=Ae.getContextId();let m=Ae.load(p);if(m&&(typeof m!="object"||m.s!==1?i=m:Ae.gather(p)),i&&i!=="$$f"){const[g,y]=be(void 0,{equals:!1});s=g,i.then(()=>{if(Ae.done)return y();Ae.gather(p),qi(r),y(),qi()},v=>{o=v,y()})}}const f=bt(jL);f&&(n=f.register(u.inFallback));let h;return ae(()=>h&&h()),O(c.Provider,{value:u,get children(){return Y(()=>{if(o)throw o;if(r=Ae.context,s)return s(),s=void 0;r&&i==="$$f"&&qi();const p=Y(()=>t.children);return Y(m=>{const g=u.inFallback(),{showContent:y=!0,showFallback:v=!0}=n?n():{};if((!g||i&&i!=="$$f")&&y)return u.resolved=!0,h&&h(),h=r=i=void 0,RL(u.effects),p();if(v)return h?m:wn(w=>(h=w,r&&(qi({id:r.id+"F",count:0}),r=void 0),t.fallback),d)})})}})}const WL=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],GL=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...WL]),KL=new Set(["innerHTML","textContent","innerText","children"]),ZL=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),YL=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function QL(t,e){const n=YL[t];return typeof n=="object"?n[e]?n.$:void 0:n}const XL=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),JL=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),eA={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},Be=t=>Y(()=>t());function tA(t,e,n){let r=n.length,i=e.length,s=r,o=0,a=0,l=e[i-1].nextSibling,c=null;for(;ou-a){const p=e[o];for(;a{i=s,e===document?t():ie(e,t(),e.firstChild?null:void 0,n)},r.owner),()=>{i(),e.textContent=""}}function Te(t,e,n,r){let i;const s=()=>{const a=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return a.innerHTML=t,n?a.content.firstChild.firstChild:r?a.firstChild:a.content.firstChild},o=e?()=>ft(()=>document.importNode(i||(i=s()),!0)):()=>(i||(i=s())).cloneNode(!0);return o.cloneNode=o,o}function Nr(t,e=window.document){const n=e[a2]||(e[a2]=new Set);for(let r=0,i=t.length;ri.call(t,n[1],s))}else t.addEventListener(e,n,typeof n!="function"&&n)}function ir(t,e,n={}){const r=Object.keys(e||{}),i=Object.keys(n);let s,o;for(s=0,o=i.length;si.children=xc(t,e.children,i.children)),Ke(()=>typeof e.ref=="function"&&Ta(e.ref,t)),Ke(()=>sA(t,e,n,!0,i,!0)),i}function Ta(t,e,n){return ft(()=>t(e,n))}function ie(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return xc(t,e,r,n);Ke(i=>xc(t,e(),i,n),r)}function sA(t,e,n,r,i={},s=!1){e||(e={});for(const o in i)if(!(o in e)){if(o==="children")continue;i[o]=c2(t,o,null,i[o],n,s,e)}for(const o in e){if(o==="children")continue;const a=e[o];i[o]=c2(t,o,a,i[o],n,s,e)}}function oA(t){let e,n;return!No()||!(e=Ae.registry.get(n=cA()))?t():(Ae.completed&&Ae.completed.add(e),Ae.registry.delete(n),e)}function No(t){return!!Ae.context&&!Ae.done&&(!t||t.isConnected)}function aA(t){return t.toLowerCase().replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function l2(t,e,n){const r=e.trim().split(/\s+/);for(let i=0,s=r.length;i-1&&eA[e.split(":")[0]];f?rA(t,f,e,n):ot(t,ZL[e]||e,n)}return n}function lA(t){if(Ae.registry&&Ae.events&&Ae.events.find(([l,c])=>c===t))return;let e=t.target;const n=`$$${t.type}`,r=t.target,i=t.currentTarget,s=l=>Object.defineProperty(t,"target",{configurable:!0,value:l}),o=()=>{const l=e[n];if(l&&!e.disabled){const c=e[`${n}Data`];if(c!==void 0?l.call(e,c,t):l.call(e,t),t.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(t.target)&&s(e.host),!0},a=()=>{for(;o()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return e||document}}),Ae.registry&&!Ae.done&&(Ae.done=_$HY.done=!0),t.composedPath){const l=t.composedPath();s(l[0]);for(let c=0;c{let l=e();for(;typeof l=="function";)l=l();n=xc(t,l,n,r)}),()=>n;if(Array.isArray(e)){const l=[],c=n&&Array.isArray(n);if(Xm(l,e,n,i))return Ke(()=>n=xc(t,l,n,r,!0)),()=>n;if(s){if(!l.length)return n;if(r===void 0)return n=[...t.childNodes];let u=l[0];if(u.parentNode!==t)return n;const d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(l.length===0){if(n=Yo(t,n,r),a)return n}else c?n.length===0?u2(t,l,r):tA(t,n,l):(n&&Yo(t),u2(t,l));n=l}else if(e.nodeType){if(s&&e.parentNode)return n=a?[e]:e;if(Array.isArray(n)){if(a)return n=Yo(t,n,r,e);Yo(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function Xm(t,e,n,r){let i=!1;for(let s=0,o=e.length;s=0;o--){const a=e[o];if(i!==a){const l=a.parentNode===t;!s&&!o?l?t.replaceChild(i,a):t.insertBefore(i,n):l&&a.remove()}else s=!0}}else t.insertBefore(i,n);return[i]}function cA(){return Ae.getNextContextId()}const Jm=!1,uA="http://www.w3.org/2000/svg";function kw(t,e=!1,n=void 0){return e?document.createElementNS(uA,t):document.createElement(t,{is:n})}function au(t){const{useShadow:e}=t,n=document.createTextNode(""),r=()=>t.mount||document.body,i=Jr();let s,o=!!Ae.context;return re(()=>{o&&(Jr().user=o=!1),s||(s=ji(i,()=>Y(()=>t.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,c]=be(!1),u=()=>c(!0);wn(d=>ie(a,()=>l()?d():s(),null)),ae(u)}else{const l=kw(t.isSVG?"g":"div",t.isSVG),c=e&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ie(c,s),a.appendChild(l),t.ref&&t.ref(l),ae(()=>a.removeChild(l))}},void 0,{render:!o}),n}function dA(t,e){const n=Y(t);return Y(()=>{const r=n();switch(typeof r){case"function":return ft(()=>r(e));case"string":const i=JL.has(r),s=Ae.context?oA():kw(r,i,ft(()=>e.is));return ei(s,e,i),s}})}function xw(t){const[,e]=ue(t,["component"]);return dA(()=>t.component,e)}const We=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kt=globalThis,ko="10.36.0";function C0(){return E0(kt),kt}function E0(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ko,e[ko]=e[ko]||{}}function sl(t,e,n=kt){const r=n.__SENTRY__=n.__SENTRY__||{},i=r[ko]=r[ko]||{};return i[t]||(i[t]=e())}const fA=["debug","info","warn","error","log","assert","trace"],hA="Sentry Logger ",wf={};function ol(t){if(!("console"in kt))return t();const e=kt.console,n={},r=Object.keys(wf);r.forEach(i=>{const s=wf[i];n[i]=e[i],e[i]=s});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function pA(){my().enabled=!0}function mA(){my().enabled=!1}function Sw(){return my().enabled}function gA(...t){py("log",...t)}function yA(...t){py("warn",...t)}function vA(...t){py("error",...t)}function py(t,...e){We&&Sw()&&ol(()=>{kt.console[t](`${hA}[${t}]:`,...e)})}function my(){return We?sl("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const $e={enable:pA,disable:mA,isEnabled:Sw,log:gA,warn:yA,error:vA},_w=50,So="?",d2=/\(error: (.*)\)/,f2=/captureMessage|captureException/;function Cw(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{const s=[],o=n.split(` `);for(let a=r;a1024&&(l=l.slice(0,1024));const c=d2.test(l)?l.replace(d2,"$1"):l;if(!c.match(/\S*Error: /)){for(const u of e){const d=u(c);if(d){s.push(d);break}}if(s.length>=_w+i)break}}return wA(s.slice(i))}}function bA(t){return Array.isArray(t)?Cw(...t):t}function wA(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(ju(e).function||"")&&e.pop(),e.reverse(),f2.test(ju(e).function||"")&&(e.pop(),f2.test(ju(e).function||"")&&e.pop()),e.slice(0,_w).map(n=>({...n,filename:n.filename||ju(e).filename,function:n.function||So}))}function ju(t){return t[t.length-1]||{}}const np="";function Fs(t){try{return!t||typeof t!="function"?np:t.name||np}catch{return np}}function h2(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Ew(t){return"__v_isVNode"in t&&t.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const qd={},p2={};function $o(t,e){qd[t]=qd[t]||[],qd[t].push(e)}function Fo(t,e){if(!p2[t]){p2[t]=!0;try{e()}catch(n){We&&$e.error(`Error while instrumenting ${t}`,n)}}}function Zr(t,e){const n=t&&qd[t];if(n)for(const r of n)try{r(e)}catch(i){We&&$e.error(`Error while triggering instrumentation handler. Type: ${t} Name: ${Fs(r)} Error:`,i)}}let rp=null;function kA(t){const e="error";$o(e,t),Fo(e,xA)}function xA(){rp=kt.onerror,kt.onerror=function(t,e,n,r,i){return Zr("error",{column:r,error:i,line:n,msg:t,url:e}),rp?rp.apply(this,arguments):!1},kt.onerror.__SENTRY_INSTRUMENTED__=!0}let ip=null;function SA(t){const e="unhandledrejection";$o(e,t),Fo(e,_A)}function _A(){ip=kt.onunhandledrejection,kt.onunhandledrejection=function(t){return Zr("unhandledrejection",t),ip?ip.apply(this,arguments):!0},kt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Tw=Object.prototype.toString;function T0(t){switch(Tw.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Hs(t,Error)}}function al(t,e){return Tw.call(t)===`[object ${e}]`}function Lw(t){return al(t,"ErrorEvent")}function m2(t){return al(t,"DOMError")}function CA(t){return al(t,"DOMException")}function Ki(t){return al(t,"String")}function gy(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function L0(t){return t===null||gy(t)||typeof t!="object"&&typeof t!="function"}function Sc(t){return al(t,"Object")}function A0(t){return typeof Event<"u"&&Hs(t,Event)}function EA(t){return typeof Element<"u"&&Hs(t,Element)}function TA(t){return al(t,"RegExp")}function lu(t){return!!(t?.then&&typeof t.then=="function")}function LA(t){return Sc(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Hs(t,e){try{return t instanceof e}catch{return!1}}function Aw(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue||t.__v_isVNode))}function Mw(t){return typeof Request<"u"&&Hs(t,Request)}const yy=kt,AA=80;function Iw(t,e={}){if(!t)return"";try{let n=t;const r=5,i=[];let s=0,o=0;const a=" > ",l=a.length;let c;const u=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||AA;for(;n&&s++1&&o+i.length*l+c.length>=d));)i.push(c),o+=c.length,n=n.parentNode;return i.reverse().join(a)}catch{return""}}function MA(t,e){const n=t,r=[];if(!n?.tagName)return"";if(yy.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const i=e?.length?e.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(i?.length)i.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&Ki(o)){const a=o.split(/\s+/);for(const l of a)r.push(`.${l}`)}}const s=["aria-label","type","name","title","alt"];for(const o of s){const a=n.getAttribute(o);a&&r.push(`[${o}="${a}"]`)}return r.join("")}function vy(){try{return yy.document.location.href}catch{return""}}function IA(t){if(!yy.HTMLElement)return null;let e=t;const n=5;for(let r=0;r"}}function y2(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function OA(t){const e=Object.keys(Dw(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let Qo;function M0(t){if(Qo!==void 0)return Qo?Qo(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=kt;return e in n&&typeof n[e]=="function"?(Qo=n[e],Qo(t)):(Qo=null,t())}function kf(){return M0(()=>Math.random())}function I0(){return M0(()=>Date.now())}function eg(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function v2(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;rjd(t,r,n))}function DA(){const t=kt;return t.crypto||t.msCrypto}let sp;function RA(){return kf()*16}function Mr(t=DA()){try{if(t?.randomUUID)return M0(()=>t.randomUUID()).replace(/-/g,"")}catch{}return sp||(sp="10000000100040008000"+1e11),sp.replace(/[018]/g,e=>(e^(RA()&15)>>e/4).toString(16))}function Rw(t){return t.exception?.values?.[0]}function ho(t){const{message:e,event_id:n}=t;if(e)return e;const r=Rw(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"":n||""}function tg(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type="Error")}function za(t,e){const n=Rw(t);if(!n)return;const r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...e},e&&"data"in e){const s={...i?.data,...e.data};n.mechanism.data=s}}function b2(t){if(PA(t))return!0;try{Vs(t,"__sentry_captured__",!0)}catch{}return!1}function PA(t){try{return t.__sentry_captured__}catch{}}const Pw=1e3;function cu(){return I0()/Pw}function NA(){const{performance:t}=kt;if(!t?.now||!t.timeOrigin)return cu;const e=t.timeOrigin;return()=>(e+M0(()=>t.now()))/Pw}let w2;function Zi(){return(w2??(w2=NA()))()}function $A(t){const e=Zi(),n={sid:Mr(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>HA(n)};return t&&Ba(n,t),n}function Ba(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Zi(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Mr()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function FA(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Ba(t,n)}function HA(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function uu(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=uu(r[i],e[i],n-1));return r}function k2(){return Mr()}function Nw(){return Mr().substring(16)}const ng="_sentrySpan";function x2(t,e){e?Vs(t,ng,e):delete t[ng]}function S2(t){return t[ng]}const VA=100;class Ji{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:k2(),sampleRand:kf()}}clone(){const e=new Ji;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,x2(e,S2(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ba(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof Ji?n.getScopeData():Sc(n)?e:void 0,{tags:i,attributes:s,extra:o,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:d}=r||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...s},this._extra={...this._extra,...o},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),d&&(this._propagationContext=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,x2(this,void 0),this._attachments=[],this.setPropagationContext({traceId:k2(),sampleRand:kf()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:VA;if(r<=0)return this;const i={timestamp:cu(),...e,message:e.message?eg(e.message,2048):e.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:S2(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=uu(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n?.event_id||Mr();if(!this._client)return We&&$e.warn("No client configured on scope - will not capture exception!"),r;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){const i=r?.event_id||Mr();if(!this._client)return We&&$e.warn("No client configured on scope - will not capture message!"),i;const s=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:i},this),i}captureEvent(e,n){const r=n?.event_id||Mr();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(We&&$e.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function zA(){return sl("defaultCurrentScope",()=>new Ji)}function BA(){return sl("defaultIsolationScope",()=>new Ji)}class qA{constructor(e,n){let r;e?r=e:r=new Ji;let i;n?i=n:i=new Ji,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(i){throw this._popScope(),i}return lu(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function qa(){const t=C0(),e=E0(t);return e.stack=e.stack||new qA(zA(),BA())}function jA(t){return qa().withScope(t)}function UA(t,e){const n=qa();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function _2(t){return qa().withScope(()=>t(qa().getIsolationScope()))}function WA(){return{withIsolationScope:_2,withScope:jA,withSetScope:UA,withSetIsolationScope:(t,e)=>_2(e),getCurrentScope:()=>qa().getScope(),getIsolationScope:()=>qa().getIsolationScope()}}function wy(t){const e=E0(t);return e.acs?e.acs:WA()}function Zs(){const t=C0();return wy(t).getCurrentScope()}function du(){const t=C0();return wy(t).getIsolationScope()}function GA(){return sl("globalScope",()=>new Ji)}function KA(...t){const e=C0(),n=wy(e);if(t.length===2){const[r,i]=t;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(t[0])}function Sn(){return Zs().getClient()}function ZA(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:i}=e,s={trace_id:n,span_id:i||Nw()};return r&&(s.parent_span_id=r),s}const YA="sentry.source",QA="sentry.sample_rate",XA="sentry.previous_trace_sample_rate",JA="sentry.op",eM="sentry.origin",$w="sentry.profile_id",Fw="sentry.exclusive_time",tM=0,nM=1,rM="_sentryScope",iM="_sentryIsolationScope";function sM(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}function Hw(t){const e=t;return{scope:e[rM],isolationScope:sM(e[iM])}}const oM="sentry-",aM=/^sentry-/;function lM(t){const e=cM(t);if(!e)return;const n=Object.entries(e).reduce((r,[i,s])=>{if(i.match(aM)){const o=i.slice(oM.length);r[o]=s}return r},{});if(Object.keys(n).length>0)return n}function cM(t){if(!(!t||!Ki(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=C2(n);return Object.entries(r).forEach(([i,s])=>{e[i]=s}),e},{}):C2(t)}function C2(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),i=e.slice(n+1);return[r,i].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const uM=/^o(\d+)\./,dM=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function fM(t){return t==="http"||t==="https"}function fu(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:a,publicKey:l}=t;return`${a}://${l}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${o}`}function hM(t){const e=dM.exec(t);if(!e){ol(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,i="",s="",o="",a=""]=e.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const d=c.match(/^\d+/);d&&(c=d[0])}return Vw({host:s,pass:i,path:l,projectId:c,port:o,protocol:n,publicKey:r})}function Vw(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function pM(t){if(!We)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:($e.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?fM(r)?e&&isNaN(parseInt(e,10))?($e.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:($e.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):($e.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function mM(t){return t.match(uM)?.[1]}function gM(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=mM(n)),r}function yM(t){const e=typeof t=="string"?hM(t):Vw(t);if(!(!e||!pM(e)))return e}function vM(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const zw=1;let E2=!1;function bM(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),i=r?e:ky(t).parent_span_id,s=Hw(t).scope,o=r?s?.getPropagationContext().propagationSpanId||Nw():e;return{parent_span_id:i,span_id:o,trace_id:n}}function wM(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...i},attributes:s})=>({span_id:e,trace_id:n,sampled:r===zw,attributes:s,...i}))}function T2(t){return typeof t=="number"?L2(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?L2(t.getTime()):Zi()}function L2(t){return t>9999999999?t/1e3:t}function ky(t){if(xM(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(kM(t)){const{attributes:r,startTime:i,name:s,endTime:o,status:a,links:l}=t,c="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:s,parent_span_id:c,start_timestamp:T2(i),timestamp:T2(o)||void 0,status:_M(a),op:r[JA],origin:r[eM],links:wM(l)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function kM(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function xM(t){return typeof t.getSpanJSON=="function"}function SM(t){const{traceFlags:e}=t.spanContext();return e===zw}function _M(t){if(!(!t||t.code===tM))return t.code===nM?"ok":t.message||"internal_error"}const CM="_sentryRootSpan";function Bw(t){return t[CM]||t}function A2(){E2||(ol(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),E2=!0)}function EM(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Sn()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function M2(t){$e.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function I2(t,e){if(!e?.length||!t.description)return!1;for(const n of e){if(LM(n)){if(jd(t.description,n))return We&&M2(t),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?jd(t.description,n.name):!0,i=n.op?t.op&&jd(t.op,n.op):!0;if(r&&i)return We&&M2(t),!0}return!1}function TM(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const i of t)i.parent_span_id===r&&(i.parent_span_id=n)}function LM(t){return typeof t=="string"||t instanceof RegExp}const xy="production",AM="_frozenDsc";function qw(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},i={environment:n.environment||xy,release:n.release,public_key:r,trace_id:t,org_id:gM(e)};return e.emit("createDsc",i),i}function MM(t,e){const n=e.getPropagationContext();return n.dsc||qw(n.traceId,t)}function IM(t){const e=Sn();if(!e)return{};const n=Bw(t),r=ky(n),i=r.data,s=n.spanContext().traceState,o=s?.get("sentry.sample_rate")??i[QA]??i[XA];function a(p){return(typeof o=="number"||typeof o=="string")&&(p.sample_rate=`${o}`),p}const l=n[AM];if(l)return a(l);const c=s?.get("sentry.dsc"),u=c&&lM(c);if(u)return a(u);const d=qw(t.spanContext().traceId,e),f=i[YA],h=r.description;return f!=="url"&&h&&(d.transaction=h),EM()&&(d.sampled=String(SM(n)),d.sample_rand=s?.get("sentry.sample_rand")??Hw(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}function Hi(t,e=100,n=1/0){try{return rg("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function jw(t,e=3,n=100*1024){const r=Hi(t,e);return PM(r)>n?jw(t,e-1,n):r}function rg(t,e,n=1/0,r=1/0,i=NM()){const[s,o]=i;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=OM(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;const l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(l===0)return a.replace("object ","");if(s(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const h=c.toJSON();return rg("",h,l-1,r,i)}catch{}const u=Array.isArray(e)?[]:{};let d=0;const f=Dw(e);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(d>=r){u[h]="[MaxProperties ~]";break}const p=f[h];u[h]=rg(h,p,l-1,r,i),d++}return o(e),u}function OM(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Aw(e))return Ew(e);if(LA(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${Fs(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=DM(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function DM(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function RM(t){return~-encodeURI(t).split(/%..|./).length}function PM(t){return RM(JSON.stringify(t))}function NM(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function ll(t,e=[]){return[t,e]}function $M(t,e){const[n,r]=t;return[n,[...r,e]]}function ig(t,e){const n=t[1];for(const r of n){const i=r[0].type;if(e(r,i))return!0}return!1}function FM(t,e){return ig(t,(n,r)=>e.includes(r))}function sg(t){const e=E0(kt);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function HM(t){const[e,n]=t;let r=JSON.stringify(e);function i(s){typeof r=="string"?r=typeof s=="string"?r+s:[sg(r),s]:r.push(typeof s=="string"?sg(s):s)}for(const s of n){const[o,a]=s;if(i(` ${JSON.stringify(o)} `),typeof a=="string"||a instanceof Uint8Array)i(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(Hi(a))}i(l)}}return typeof r=="string"?r:VM(r)}function VM(t){const e=t.reduce((i,s)=>i+s.length,0),n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function zM(t){const e=typeof t.data=="string"?sg(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const BM={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function O2(t){return BM[t]}function Uw(t){if(!t?.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function qM(t,e,n,r){const i=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:fu(r)},...i&&{trace:i}}}function jM(t,e){if(!e)return t;const n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function UM(t,e,n,r){const i=Uw(n),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&e&&{dsn:fu(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return ll(s,[o])}function WM(t,e,n,r){const i=Uw(n),s=t.type&&t.type!=="replay_event"?t.type:"event";jM(t,n?.sdk);const o=qM(t,i,r,e);return delete t.sdkProcessingMetadata,ll(o,[[{type:s},t]])}const op=0,D2=1,R2=2;function D0(t){return new _c(e=>{e(t)})}function Sy(t){return new _c((e,n)=>{n(t)})}class _c{constructor(e){this._state=op,this._handlers=[],this._runExecutor(e)}then(e,n){return new _c((r,i)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(o){i(o)}},s=>{if(!n)i(s);else try{r(n(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new _c((n,r)=>{let i,s;return this.then(o=>{s=!1,i=o,e&&e()},o=>{s=!0,i=o,e&&e()}).then(()=>{if(s){r(i);return}n(i)})})}_executeHandlers(){if(this._state===op)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===D2&&n[1](this._value),this._state===R2&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(s,o)=>{if(this._state===op){if(lu(o)){o.then(r,i);return}this._state=s,this._value=o,this._executeHandlers()}},r=s=>{n(D2,s)},i=s=>{n(R2,s)};try{e(r,i)}catch(s){i(s)}}}function GM(t,e,n,r=0){try{const i=og(e,n,t,r);return lu(i)?i:D0(i)}catch(i){return Sy(i)}}function og(t,e,n,r){const i=n[r];if(!t||!i)return t;const s=i({...t},e);return We&&s===null&&$e.log(`Event processor "${i.id||"?"}" dropped event`),lu(s)?s.then(o=>og(o,e,n,r+1)):og(s,e,n,r+1)}let eo,P2,N2,ys;function KM(t){const e=kt._sentryDebugIds,n=kt._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],i=n?Object.keys(n):[];if(ys&&r.length===P2&&i.length===N2)return ys;P2=r.length,N2=i.length,ys={},eo||(eo={});const s=(o,a)=>{for(const l of o){const c=a[l],u=eo?.[l];if(u&&ys&&c)ys[u[0]]=c,eo&&(eo[l]=[u[0],c]);else if(c){const d=t(l);for(let f=d.length-1;f>=0;f--){const p=d[f]?.filename;if(p&&ys&&eo){ys[p]=c,eo[l]=[p,c];break}}}}};return e&&s(r,e),n&&s(i,n),ys}function ZM(t,e){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:s}=e;QM(t,e),r&&eI(t,r),tI(t,n),XM(t,i),JM(t,s)}function $2(t,e){const{extra:n,tags:r,attributes:i,user:s,contexts:o,level:a,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:h,transactionName:p,span:m}=e;Dl(t,"extra",n),Dl(t,"tags",r),Dl(t,"attributes",i),Dl(t,"user",s),Dl(t,"contexts",o),t.sdkProcessingMetadata=uu(t.sdkProcessingMetadata,l,2),a&&(t.level=a),p&&(t.transactionName=p),m&&(t.span=m),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),d.length&&(t.eventProcessors=[...t.eventProcessors,...d]),f.length&&(t.attachments=[...t.attachments,...f]),t.propagationContext={...t.propagationContext,...h}}function Dl(t,e,n){t[e]=uu(t[e],n,1)}function YM(t,e){const n=GA().getScopeData();return t&&$2(n,t.getScopeData()),e&&$2(n,e.getScopeData()),n}function QM(t,e){const{extra:n,tags:r,user:i,contexts:s,level:o,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(i).length&&(t.user={...i,...t.user}),Object.keys(s).length&&(t.contexts={...s,...t.contexts}),o&&(t.level=o),a&&t.type!=="transaction"&&(t.transaction=a)}function XM(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function JM(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function eI(t,e){t.contexts={trace:bM(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:IM(e),...t.sdkProcessingMetadata};const n=Bw(e),r=ky(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function tI(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function nI(t,e,n,r,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,l={...e,event_id:e.event_id||n.event_id||Mr(),timestamp:e.timestamp||cu()},c=n.integrations||t.integrations.map(g=>g.name);rI(l,t),oI(l,c),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&iI(l,t.stackParser);const u=lI(r,n.captureContext);n.mechanism&&za(l,n.mechanism);const d=i?i.getEventProcessors():[],f=YM(s,u),h=[...n.attachments||[],...f.attachments];h.length&&(n.attachments=h),ZM(l,f);const p=[...d,...f.eventProcessors];return GM(p,l,n).then(g=>(g&&sI(g),typeof o=="number"&&o>0?aI(g,o,a):g))}function rI(t,e){const{environment:n,release:r,dist:i,maxValueLength:s}=e;t.environment=t.environment||n||xy,!t.release&&r&&(t.release=r),!t.dist&&i&&(t.dist=i);const o=t.request;o?.url&&s&&(o.url=eg(o.url,s)),s&&t.exception?.values?.forEach(a=>{a.value&&(a.value=eg(a.value,s))})}function iI(t,e){const n=KM(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function sI(t){const e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([r,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function oI(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function aI(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:Hi(i.data,e,n)}}))},...t.user&&{user:Hi(t.user,e,n)},...t.contexts&&{contexts:Hi(t.contexts,e,n)},...t.extra&&{extra:Hi(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Hi(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>({...i,...i.data&&{data:Hi(i.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=Hi(t.contexts.flags,3,n)),r}function lI(t,e){if(!e)return t;const n=t?t.clone():new Ji;return n.update(e),n}function _y(t,e){return Zs().captureException(t,void 0)}function Ww(t,e){return Zs().captureEvent(t,e)}function cI(){const t=Sn();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function F2(t){const e=du(),n=Zs(),{userAgent:r}=kt.navigator||{},i=$A({user:n.getUser()||e.getUser(),...r&&{userAgent:r},...t}),s=e.getSession();return s?.status==="ok"&&Ba(s,{status:"exited"}),Gw(),e.setSession(i),i}function Gw(){const t=du(),n=Zs().getSession()||t.getSession();n&&FA(n),Kw(),t.setSession()}function Kw(){const t=du(),e=Sn(),n=t.getSession();n&&e&&e.captureSession(n)}function H2(t=!1){if(t){Gw();return}Kw()}const uI="7";function dI(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function fI(t){return`${dI(t)}${t.projectId}/envelope/`}function hI(t,e){const n={sentry_version:uI};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function pI(t,e,n){return e||`${fI(t)}?${hI(t,n)}`}const V2=[];function mI(t){const e={};return t.forEach(n=>{const{name:r}=n,i=e[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function gI(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(i=>{i.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const i=n(e);r=Array.isArray(i)?i:[i]}else r=e;return mI(r)}function yI(t,e){const n={};return e.forEach(r=>{r&&Zw(t,r,n)}),n}function z2(t,e){for(const n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function Zw(t,e,n){if(n[e.name]){We&&$e.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!V2.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),V2.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,s)=>r(i,s,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),i=Object.assign((s,o)=>r(s,o,t),{id:e.name});t.addEventProcessor(i)}We&&$e.log(`Integration installed: ${e.name}`)}function vI(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function bI(t,e,n,r){const i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=fu(r)),ll(i,[vI(t)])}function Yw(t,e){const n=e??wI(t)??[];if(n.length===0)return;const r=t.getOptions(),i=bI(n,r._metadata,r.tunnel,t.getDsn());Qw().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(i)}function wI(t){return Qw().get(t)}function Qw(){return sl("clientToLogBufferMap",()=>new WeakMap)}function kI(t){return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:t}]}function xI(t,e,n,r){const i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=fu(r)),ll(i,[kI(t)])}function Xw(t,e){const n=e??SI(t)??[];if(n.length===0)return;const r=t.getOptions(),i=xI(n,r._metadata,r.tunnel,t.getDsn());Jw().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(i)}function SI(t){return Jw().get(t)}function Jw(){return sl("clientToMetricBufferMap",()=>new WeakMap)}const Cy=Symbol.for("SentryBufferFullError");function Ey(t=100){const e=new Set;function n(){return e.sizer(a),()=>r(a)),a}function s(o){if(!e.size)return D0(!0);const a=Promise.allSettled(Array.from(e)).then(()=>!0);if(!o)return a;const l=[a,new Promise(c=>setTimeout(()=>c(!1),o))];return Promise.race(l)}return{get $(){return Array.from(e)},add:i,drain:s}}const _I=60*1e3;function CI(t,e=I0()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?_I:r-e}function EI(t,e){return t[e]||t.all||0}function TI(t,e,n=I0()){return EI(t,e)>n}function LI(t,{statusCode:e,headers:n},r=I0()){const i={...t},s=n?.["x-sentry-rate-limits"],o=n?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[l,c,,,u]=a.split(":",5),d=parseInt(l,10),f=(isNaN(d)?60:d)*1e3;if(!c)i.all=r+f;else for(const h of c.split(";"))h==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(i[h]=r+f):i[h]=r+f}else o?i.all=r+CI(o,r):e===429&&(i.all=r+60*1e3);return i}const e8=64;function AI(t,e,n=Ey(t.bufferSize||e8)){let r={};const i=o=>n.drain(o);function s(o){const a=[];if(ig(o,(d,f)=>{const h=O2(f);TI(r,h)?t.recordDroppedEvent("ratelimit_backoff",h):a.push(d)}),a.length===0)return Promise.resolve({});const l=ll(o[0],a),c=d=>{if(FM(l,["client_report"])){We&&$e.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}ig(l,(f,h)=>{t.recordDroppedEvent(d,O2(h))})},u=()=>e({body:HM(l)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&We&&$e.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=LI(r,d),d),d=>{throw c("network_error"),We&&$e.error("Encountered error running transport request:",d),d});return n.add(u).then(d=>d,d=>{if(d===Cy)return We&&$e.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:i}}function MI(t,e,n){const r=[{type:"client_report"},{timestamp:cu(),discarded_events:t}];return ll(e?{dsn:e}:{},[r])}function t8(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function II(t){const{trace_id:e,parent_span_id:n,span_id:r,status:i,origin:s,data:o,op:a}=t.contexts?.trace??{};return{data:o??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:i,timestamp:t.timestamp,trace_id:e??"",origin:s,profile_id:o?.[$w],exclusive_time:o?.[Fw],measurements:t.measurements,is_segment:!0}}function OI(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[$w]:t.profile_id},...t.exclusive_time&&{[Fw]:t.exclusive_time}}}},measurements:t.measurements}}const B2="Not capturing exception because it's already been captured.",q2="Discarded session because of missing or non-string release",n8=Symbol.for("SentryInternalError"),r8=Symbol.for("SentryDoNotSendEventError"),DI=5e3;function Ud(t){return{message:t,[n8]:!0}}function ap(t){return{message:t,[r8]:!0}}function j2(t){return!!t&&typeof t=="object"&&n8 in t}function U2(t){return!!t&&typeof t=="object"&&r8 in t}function W2(t,e,n,r,i){let s=0,o,a=!1;t.on(n,()=>{s=0,clearTimeout(o),a=!1}),t.on(e,l=>{s+=r(l),s>=8e5?i(t):a||(a=!0,o=setTimeout(()=>{i(t)},DI))}),t.on("flush",()=>{i(t)})}class RI{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ey(e.transportOptions?.bufferSize??e8),e.dsn?this._dsn=yM(e.dsn):We&&$e.warn("No DSN provided, client will not send events."),this._dsn){const r=pI(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&W2(this,"afterCaptureLog","flushLogs",FI,Yw),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&W2(this,"afterCaptureMetric","flushMetrics",$I,Xw)}captureException(e,n,r){const i=Mr();if(b2(e))return We&&$e.log(B2),i;const s={event_id:i,...n};return this._process(()=>this.eventFromException(e,s).then(o=>this._captureEvent(o,s,r)).then(o=>o),"error"),s.event_id}captureMessage(e,n,r,i){const s={event_id:Mr(),...r},o=gy(e)?e:String(e),a=L0(e),l=a?this.eventFromMessage(o,n,s):this.eventFromException(e,s);return this._process(()=>l.then(c=>this._captureEvent(c,s,i)),a?"unknown":"error"),s.event_id}captureEvent(e,n,r){const i=Mr();if(n?.originalException&&b2(n.originalException))return We&&$e.log(B2),i;const s={event_id:i,...n},o=e.sdkProcessingMetadata||{},a=o.capturedSpanScope,l=o.capturedSpanIsolationScope,c=G2(e.type);return this._process(()=>this._captureEvent(e,s,a||r,l),c),s.event_id}captureSession(e){this.sendSession(e),Ba(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(e),i=await n.flush(e);return r&&i}async close(e){const n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const n=this._integrations[e.name];Zw(this,e,this._integrations),n||z2(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=WM(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])r=$M(r,zM(i));this.sendEnvelope(r).then(i=>this.emit("afterSendEvent",e,i))}sendSession(e){const{release:n,environment:r=xy}=this._options;if("aggregates"in e){const s=e.attrs||{};if(!s.release&&!n){We&&$e.warn(q2);return}s.release=s.release||n,s.environment=s.environment||r,e.attrs=s}else{if(!e.release&&!n){We&&$e.warn(q2);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const i=UM(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const i=`${e}:${n}`;We&&$e.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||new Set,i=(...s)=>n(...s);return r.add(i),()=>{r.delete(i)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(i=>i(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(n){return We&&$e.error("Error while sending envelope:",n),{}}return We&&$e.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=yI(this,e),z2(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",i=!1;const s=n.exception?.values;if(s){i=!0,r=!1;for(const l of s)if(l.mechanism?.handled===!1){r=!0;break}}const o=e.status==="ok";(o&&e.errors===0||o&&r)&&(Ba(e,{...r&&{status:"crashed"},errors:e.errors||Number(i||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||nsetTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i){const s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o?.length&&(n.integrations=o),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),nI(s,e,n,r,this,i).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:ZA(r),...a.contexts};const l=MM(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:l,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=Zs(),i=du()){return We&&ag(e)&&$e.log(`Captured error event \`${t8(e)[0]||""}\``),this._processEvent(e,n,r,i).then(s=>s.event_id,s=>{We&&(U2(s)?$e.log(s.message):j2(s)?$e.warn(s.message):$e.warn(s))})}_processEvent(e,n,r,i){const s=this.getOptions(),{sampleRate:o}=s,a=i8(e),l=ag(e),u=`before send for type \`${e.type||"error"}\``,d=typeof o>"u"?void 0:vM(o);if(l&&typeof d=="number"&&kf()>d)return this.recordDroppedEvent("sample_rate","error"),Sy(ap(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=G2(e.type);return this._prepareEvent(e,n,r,i).then(h=>{if(h===null)throw this.recordDroppedEvent("event_processor",f),ap("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return h;const m=NI(this,s,h,n);return PI(m,u)}).then(h=>{if(h===null){if(this.recordDroppedEvent("before_send",f),a){const y=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",y)}throw ap(`${u} returned \`null\`, will not send event.`)}const p=r.getSession()||i.getSession();if(l&&p&&this._updateSessionFromEvent(p,h),a){const g=h.sdkProcessingMetadata?.spanCountBeforeProcessing||0,y=h.spans?h.spans.length:0,v=g-y;v>0&&this.recordDroppedEvent("before_send","span",v)}const m=h.transaction_info;if(a&&m&&h.transaction!==e.transaction){const g="custom";h.transaction_info={...m,source:g}}return this.sendEvent(h,n),h}).then(null,h=>{throw U2(h)||j2(h)?h:(this.captureException(h,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:h}),Ud(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event. Reason: ${h}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Cy&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[i,s]=n.split(":");return{reason:i,category:s,quantity:r}})}_flushOutcomes(){We&&$e.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){We&&$e.log("No outcomes to send");return}if(!this._dsn){We&&$e.log("No dsn provided, will not send outcomes");return}We&&$e.log("Sending outcomes:",e);const n=MI(e,this._options.tunnel&&fu(this._dsn));this.sendEnvelope(n)}}function G2(t){return t==="replay_event"?"replay":t||"error"}function PI(t,e){const n=`${e} must return \`null\` or a valid event.`;if(lu(t))return t.then(r=>{if(!Sc(r)&&r!==null)throw Ud(n);return r},r=>{throw Ud(`${e} rejected with ${r}`)});if(!Sc(t)&&t!==null)throw Ud(n);return t}function NI(t,e,n,r){const{beforeSend:i,beforeSendTransaction:s,beforeSendSpan:o,ignoreSpans:a}=e;let l=n;if(ag(l)&&i)return i(l,r);if(i8(l)){if(o||a){const c=II(l);if(a?.length&&I2(c,a))return null;if(o){const u=o(c);u?l=uu(n,OI(u)):A2()}if(l.spans){const u=[],d=l.spans;for(const h of d){if(a?.length&&I2(h,a)){TM(d,h);continue}if(o){const p=o(h);p?u.push(p):(A2(),u.push(h))}else u.push(h)}const f=l.spans.length-u.length;f&&t.recordDroppedEvent("before_send","span",f),l.spans=u}}if(s){if(l.spans){const c=l.spans.length;l.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(l,r)}}return l}function ag(t){return t.type===void 0}function i8(t){return t.type==="transaction"}function $I(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+s8(t.attributes)}function FI(t){let e=0;return t.message&&(e+=t.message.length*2),e+s8(t.attributes)}function s8(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*K2(n[0]):L0(n)?e+=K2(n):e+=100}),e}function K2(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function HI(t){return T0(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function Z2(t){return HI(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}function VI(t,e){e.debug===!0&&(We?$e.enable():ol(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Zs().update(e.initialScope);const r=new t(e);return zI(r),r.init(),r}function zI(t){Zs().setClient(t)}function lp(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function BI(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",i=t.includes(";base64,"),s=t.indexOf(",");let o="";if(e&&s!==-1){const a=t.slice(s+1);o=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${i?",base64":""}${o?`,${o}`:""}`}return t}function qI(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function o8(t,e,n=[e],r="npm"){const i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:ko})),version:ko}),t._metadata=i}const jI=100;function _o(t,e){const n=Sn(),r=du();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=jI}=n.getOptions();if(s<=0)return;const a={timestamp:cu(),...t},l=i?ol(()=>i(a,e)):a;l!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",l,e),r.addBreadcrumb(l,s))}let Y2;const UI="FunctionToString",Q2=new WeakMap,WI=(()=>({name:UI,setupOnce(){Y2=Function.prototype.toString;try{Function.prototype.toString=function(...t){const e=by(this),n=Q2.has(Sn())&&e!==void 0?e:this;return Y2.apply(n,t)}}catch{}},setup(t){Q2.set(t,!0)}})),GI=WI,KI=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],ZI="EventFilters",YI=(t={})=>{let e;return{name:ZI,setup(n){const r=n.getOptions();e=X2(t,r)},processEvent(n,r,i){if(!e){const s=i.getOptions();e=X2(t,s)}return XI(n,e)?null:n}}},QI=((t={})=>({...YI(t),name:"InboundFilters"}));function X2(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:KI],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function XI(t,e){if(t.type){if(t.type==="transaction"&&eO(t,e.ignoreTransactions))return We&&$e.warn(`Event dropped due to being matched by \`ignoreTransactions\` option. Event: ${ho(t)}`),!0}else{if(JI(t,e.ignoreErrors))return We&&$e.warn(`Event dropped due to being matched by \`ignoreErrors\` option. Event: ${ho(t)}`),!0;if(iO(t))return We&&$e.warn(`Event dropped due to not having an error message, error type or stacktrace. Event: ${ho(t)}`),!0;if(tO(t,e.denyUrls))return We&&$e.warn(`Event dropped due to being matched by \`denyUrls\` option. Event: ${ho(t)}. Url: ${xf(t)}`),!0;if(!nO(t,e.allowUrls))return We&&$e.warn(`Event dropped due to not being matched by \`allowUrls\` option. Event: ${ho(t)}. Url: ${xf(t)}`),!0}return!1}function JI(t,e){return e?.length?t8(t).some(n=>O0(n,e)):!1}function eO(t,e){if(!e?.length)return!1;const n=t.transaction;return n?O0(n,e):!1}function tO(t,e){if(!e?.length)return!1;const n=xf(t);return n?O0(n,e):!1}function nO(t,e){if(!e?.length)return!0;const n=xf(t);return n?O0(n,e):!0}function rO(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!==""&&n.filename!=="[native code]")return n.filename||null}return null}function xf(t){try{const n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?rO(n):null}catch{return We&&$e.error(`Cannot extract url for event ${ho(t)}`),null}}function iO(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function sO(t,e,n,r,i,s){if(!i.exception?.values||!s||!Hs(s.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=lg(t,e,r,s.originalException,n,i.exception.values,o,0))}function lg(t,e,n,r,i,s,o,a){if(s.length>=n+1)return s;let l=[...s];if(Hs(r[i],Error)){J2(o,a);const c=t(e,r[i]),u=l.length;e4(c,i,u,a),l=lg(t,e,n,r[i],i,[c,...l],c,u)}return Array.isArray(r.errors)&&r.errors.forEach((c,u)=>{if(Hs(c,Error)){J2(o,a);const d=t(e,c),f=l.length;e4(d,`errors[${u}]`,f,a),l=lg(t,e,n,c,i,[d,...l],d,f)}}),l}function J2(t,e){t.mechanism={handled:!0,type:"auto.core.linked_errors",...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function e4(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function oO(t){const e="console";$o(e,t),Fo(e,aO)}function aO(){"console"in kt&&fA.forEach(function(t){t in kt.console&&ar(kt.console,t,function(e){return wf[t]=e,function(...n){Zr("console",{args:n,level:t}),wf[t]?.apply(kt.console,n)}})})}function lO(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const cO="Dedupe",uO=(()=>{let t;return{name:cO,processEvent(e){if(e.type)return e;try{if(fO(e,t))return We&&$e.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),dO=uO;function fO(t,e){return e?!!(hO(t,e)||pO(t,e)):!1}function hO(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!l8(t,e)||!a8(t,e))}function pO(t,e){const n=t4(e),r=t4(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!l8(t,e)||!a8(t,e))}function a8(t,e){let n=h2(t),r=h2(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i=400&&t<500?"warning":t>=500?"error":void 0}const Cc=kt;function mO(){return"history"in Cc&&!!Cc.history}function gO(){if(!("fetch"in Cc))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function cg(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function yO(){if(typeof EdgeRuntime=="string")return!0;if(!gO())return!1;if(cg(Cc.fetch))return!0;let t=!1;const e=Cc.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=cg(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){We&&$e.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function vO(t,e){const n="fetch";$o(n,t),Fo(n,()=>bO(void 0,e))}function bO(t,e=!1){e&&!yO()||ar(kt,"fetch",function(n){return function(...r){const i=new Error,{method:s,url:o}=wO(r),a={args:r,fetchData:{method:s,url:o},startTimestamp:Zi()*1e3,virtualError:i,headers:kO(r)};return Zr("fetch",{...a}),n.apply(kt,r).then(async l=>(Zr("fetch",{...a,endTimestamp:Zi()*1e3,response:l}),l),l=>{Zr("fetch",{...a,endTimestamp:Zi()*1e3,error:l}),T0(l)&&l.stack===void 0&&(l.stack=i.stack,Vs(l,"framesToPop",1));const u=Sn()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{const h=new URL(a.fetchData.url).host;u==="always"?l.message=`${l.message} (${h})`:Vs(l,"__sentry_fetch_url_host__",h)}catch{}throw l})}})}function Wd(t,e){return!!t&&typeof t=="object"&&!!t[e]}function n4(t){return typeof t=="string"?t:t?Wd(t,"url")?t.url:t.toString?t.toString():"":""}function wO(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:n4(n),method:Wd(r,"method")?String(r.method).toUpperCase():Mw(n)&&Wd(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:n4(e),method:Wd(e,"method")?String(e.method).toUpperCase():"GET"}}function kO(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Mw(e))return new Headers(e.headers)}catch{}}function xO(){return"npm"}const qt=kt;let ug=0;function u8(){return ug>0}function SO(){ug++,setTimeout(()=>{ug--})}function ja(t,e={}){function n(i){return typeof i=="function"}if(!n(t))return t;try{const i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(by(t))return t}catch{return t}const r=function(...i){try{const s=i.map(o=>ja(o,e));return t.apply(this,s)}catch(s){throw SO(),KA(o=>{o.addEventProcessor(a=>(e.mechanism&&(tg(a,void 0),za(a,e.mechanism)),a.extra={...a.extra,arguments:i},a)),_y(s)}),s}};try{for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}Ow(r,t),Vs(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function _O(){const t=vy(),{referrer:e}=qt.document||{},{userAgent:n}=qt.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}function Ty(t,e){const n=Ly(t,e),r={type:AO(e),value:MO(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function CO(t,e,n,r){const s=Sn()?.getOptions().normalizeDepth,o=PO(e),a={__serialized__:jw(e,s)};if(o)return{exception:{values:[Ty(t,o)]},extra:a};const l={exception:{values:[{type:A0(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:DO(e,{isUnhandledRejection:r})}]},extra:a};if(n){const c=Ly(t,n);c.length&&(l.exception.values[0].stacktrace={frames:c})}return l}function cp(t,e){return{exception:{values:[Ty(t,e)]}}}function Ly(t,e){const n=e.stacktrace||e.stack||"",r=TO(e),i=LO(e);try{return t(n,r,i)}catch{}return[]}const EO=/Minified React error #\d+;/i;function TO(t){return t&&EO.test(t.message)?1:0}function LO(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function d8(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function AO(t){const e=t?.name;return!e&&d8(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function MO(t){const e=t?.message;return d8(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?Z2(e.error):Z2(t):"No error message"}function IO(t,e,n,r){const i=n?.syntheticException||void 0,s=Ay(t,e,i,r);return za(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),D0(s)}function OO(t,e,n="info",r,i){const s=r?.syntheticException||void 0,o=dg(t,e,s,i);return o.level=n,r?.event_id&&(o.event_id=r.event_id),D0(o)}function Ay(t,e,n,r,i){let s;if(Lw(e)&&e.error)return cp(t,e.error);if(m2(e)||CA(e)){const o=e;if("stack"in e)s=cp(t,e);else{const a=o.name||(m2(o)?"DOMError":"DOMException"),l=o.message?`${a}: ${o.message}`:a;s=dg(t,l,n,r),tg(s,l)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return T0(e)?cp(t,e):Sc(e)||A0(e)?(s=CO(t,e,n,i),za(s,{synthetic:!0}),s):(s=dg(t,e,n,r),tg(s,`${e}`),za(s,{synthetic:!0}),s)}function dg(t,e,n,r){const i={};if(r&&n){const s=Ly(t,n);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]}),za(i,{synthetic:!0})}if(gy(e)){const{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function DO(t,{isUnhandledRejection:e}){const n=OA(t),r=e?"promise rejection":"exception";return Lw(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:A0(t)?`Event \`${RO(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function RO(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function PO(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}class NO extends RI{constructor(e){const n=$O(e),r=qt.SENTRY_SDK_SOURCE||xO();o8(n,"browser",["browser"],r),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:s,enableLogs:o,_experiments:a,enableMetrics:l}=this._options,c=l??a?.enableMetrics??!0;qt.document&&(s||o||c)&&qt.document.addEventListener("visibilitychange",()=>{qt.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),o&&Yw(this),c&&Xw(this))}),i&&this.on("beforeSendSession",qI)}eventFromException(e,n){return IO(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return OO(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,i)}}function $O(t){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:qt.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}const FO=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Nn=kt,HO=1e3;let r4,fg,hg;function VO(t){$o("dom",t),Fo("dom",zO)}function zO(){if(!Nn.document)return;const t=Zr.bind(null,"dom"),e=i4(t,!0);Nn.document.addEventListener("click",e,!1),Nn.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const i=Nn[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(ar(i,"addEventListener",function(s){return function(o,a,l){if(o==="click"||o=="keypress")try{const c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[o]=c[o]||{refCount:0};if(!u.handler){const d=i4(t);u.handler=d,s.call(this,o,d,l)}u.refCount++}catch{}return s.call(this,o,a,l)}}),ar(i,"removeEventListener",function(s){return function(o,a,l){if(o==="click"||o=="keypress")try{const c=this.__sentry_instrumentation_handlers__||{},u=c[o];u&&(u.refCount--,u.refCount<=0&&(s.call(this,o,u.handler,l),u.handler=void 0,delete c[o]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,o,a,l)}}))})}function BO(t){if(t.type!==fg)return!1;try{if(!t.target||t.target._sentryId!==hg)return!1}catch{}return!0}function qO(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function i4(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=jO(n);if(qO(n.type,r))return;Vs(n,"_sentryCaptured",!0),r&&!r._sentryId&&Vs(r,"_sentryId",Mr());const i=n.type==="keypress"?"input":n.type;BO(n)||(t({event:n,name:i,global:e}),fg=n.type,hg=r?r._sentryId:void 0),clearTimeout(r4),r4=Nn.setTimeout(()=>{hg=void 0,fg=void 0},HO)}}function jO(t){try{return t.target}catch{return null}}let Uu;function f8(t){const e="history";$o(e,t),Fo(e,UO)}function UO(){if(Nn.addEventListener("popstate",()=>{const e=Nn.location.href,n=Uu;if(Uu=e,n===e)return;Zr("history",{from:n,to:e})}),!mO())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const i=Uu,s=WO(String(r));if(Uu=s,i===s)return e.apply(this,n);Zr("history",{from:i,to:s})}return e.apply(this,n)}}ar(Nn.history,"pushState",t),ar(Nn.history,"replaceState",t)}function WO(t){try{return new URL(t,Nn.location.origin).toString()}catch{return t}}const Gd={};function GO(t){const e=Gd[t];if(e)return e;let n=Nn[t];if(cg(n))return Gd[t]=n.bind(Nn);const r=Nn.document;if(r&&typeof r.createElement=="function")try{const i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i);const s=i.contentWindow;s?.[t]&&(n=s[t]),r.head.removeChild(i)}catch(i){FO&&$e.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return n&&(Gd[t]=n.bind(Nn))}function KO(t){Gd[t]=void 0}const Zl="__sentry_xhr_v3__";function ZO(t){$o("xhr",t),Fo("xhr",YO)}function YO(){if(!Nn.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const i=new Error,s=Zi()*1e3,o=Ki(r[0])?r[0].toUpperCase():void 0,a=QO(r[1]);if(!o||!a)return e.apply(n,r);n[Zl]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const l=()=>{const c=n[Zl];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:Zi()*1e3,startTimestamp:s,xhr:n,virtualError:i};Zr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return l(),c.apply(u,d)}}):n.addEventListener("readystatechange",l),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[f,h]=d,p=u[Zl];return p&&Ki(f)&&Ki(h)&&(p.request_headers[f.toLowerCase()]=h),c.apply(u,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const i=n[Zl];if(!i)return e.apply(n,r);r[0]!==void 0&&(i.body=r[0]);const s={startTimestamp:Zi()*1e3,xhr:n};return Zr("xhr",s),e.apply(n,r)}})}function QO(t){if(Ki(t))return t;try{return t.toString()}catch{}}const XO=40;function JO(t,e=GO("fetch")){let n=0,r=0;async function i(s){const o=s.body.length;n+=o,r++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{const l=await e(t.url,a);return{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}}catch(l){throw KO("fetch"),l}finally{n-=o,r--}}return AI(t,i,Ey(t.bufferSize||XO))}const R0=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,eD=30,tD=50;function pg(t,e,n,r){const i={filename:t,function:e===""?So:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}const nD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,rD=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,iD=/\((\S*)(?::(\d+))(?::(\d+))\)/,sD=/at (.+?) ?\(data:(.+?),/,oD=t=>{const e=t.match(sD);if(e)return{filename:``,function:e[1]};const n=nD.exec(t);if(n){const[,i,s,o]=n;return pg(i,So,+s,+o)}const r=rD.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){const a=iD.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[s,o]=h8(r[1]||So,r[2]);return pg(o,s,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},aD=[eD,oD],lD=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,cD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,uD=t=>{const e=lD.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const s=cD.exec(e[3]);s&&(e[1]=e[1]||"eval",e[3]=s[1],e[4]=s[2],e[5]="")}let r=e[3],i=e[1]||So;return[i,r]=h8(i,r),pg(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},dD=[tD,uD],fD=[aD,dD],hD=Cw(...fD),h8=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:So,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Wu=1024,pD="Breadcrumbs",mD=((t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:pD,setup(n){e.console&&oO(bD(n)),e.dom&&VO(vD(n,e.dom)),e.xhr&&ZO(wD(n)),e.fetch&&vO(kD(n)),e.history&&f8(xD(n)),e.sentry&&n.on("beforeSendEvent",yD(n))}}}),gD=mD;function yD(t){return function(n){Sn()===t&&_o({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:ho(n)},{event:n})}}function vD(t,e){return function(r){if(Sn()!==t)return;let i,s,o=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Wu&&(R0&&$e.warn(`\`dom.maxStringLength\` cannot exceed ${Wu}, but a value of ${a} was configured. Sentry will use ${Wu} instead.`),a=Wu),typeof o=="string"&&(o=[o]);try{const c=r.event,u=SD(c)?c.target:c;i=Iw(u,{keyAttrs:o,maxStringLength:a}),s=IA(u)}catch{i=""}if(i.length===0)return;const l={category:`ui.${r.name}`,message:i};s&&(l.data={"ui.component_name":s}),_o(l,{event:r.event,name:r.name,global:r.global})}}function bD(t){return function(n){if(Sn()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:lO(n.level),message:v2(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${v2(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;_o(r,{input:n.args,level:n.level})}}function wD(t){return function(n){if(Sn()!==t)return;const{startTimestamp:r,endTimestamp:i}=n,s=n.xhr[Zl];if(!r||!i||!s)return;const{method:o,url:a,status_code:l,body:c}=s,u={method:o,url:a,status_code:l},d={xhr:n.xhr,input:c,startTimestamp:r,endTimestamp:i},f={category:"xhr",data:u,type:"http",level:c8(l)};t.emit("beforeOutgoingRequestBreadcrumb",f,d),_o(f,d)}}function kD(t){return function(n){if(Sn()!==t)return;const{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const s=n.fetchData,o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i},a={category:"fetch",data:s,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,o),_o(a,o)}else{const s=n.response,o={...n.fetchData,status_code:s?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;const a={input:n.args,response:s,startTimestamp:r,endTimestamp:i},l={category:"fetch",data:o,type:"http",level:c8(o.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,a),_o(l,a)}}}function xD(t){return function(n){if(Sn()!==t)return;let r=n.from,i=n.to;const s=lp(qt.location.href);let o=r?lp(r):void 0;const a=lp(i);o?.path||(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(r=o.relative),_o({category:"navigation",data:{from:r,to:i}})}}function SD(t){return!!t&&!!t.target}const _D=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],CD="BrowserApiErrors",ED=((t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:CD,setupOnce(){e.setTimeout&&ar(qt,"setTimeout",s4),e.setInterval&&ar(qt,"setInterval",s4),e.requestAnimationFrame&&ar(qt,"requestAnimationFrame",LD),e.XMLHttpRequest&&"XMLHttpRequest"in qt&&ar(XMLHttpRequest.prototype,"send",AD);const n=e.eventTarget;n&&(Array.isArray(n)?n:_D).forEach(i=>MD(i,e))}}}),TD=ED;function s4(t){return function(...e){const n=e[0];return e[0]=ja(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Fs(t)}`}}),t.apply(this,e)}}function LD(t){return function(e){return t.apply(this,[ja(e,{mechanism:{data:{handler:Fs(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function AD(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&ar(n,i,function(s){const o={mechanism:{data:{handler:Fs(s)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},a=by(s);return a&&(o.mechanism.data.handler=Fs(a)),ja(s,o)})}),t.apply(this,e)}}function MD(t,e){const r=qt[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(ar(r,"addEventListener",function(i){return function(s,o,a){try{ID(o)&&(o.handleEvent=ja(o.handleEvent,{mechanism:{data:{handler:Fs(o),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&OD(this,s,o),i.apply(this,[s,ja(o,{mechanism:{data:{handler:Fs(o),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}}),ar(r,"removeEventListener",function(i){return function(s,o,a){try{const l=o.__sentry_wrapped__;l&&i.call(this,s,l,a)}catch{}return i.call(this,s,o,a)}}))}function ID(t){return typeof t.handleEvent=="function"}function OD(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}const DD=()=>({name:"BrowserSession",setupOnce(){if(typeof qt.document>"u"){R0&&$e.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}F2({ignoreDuration:!0}),H2(),f8(({from:t,to:e})=>{t!==void 0&&t!==e&&(F2({ignoreDuration:!0}),H2())})}}),RD="GlobalHandlers",PD=((t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:RD,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&($D(n),o4("onerror")),e.onunhandledrejection&&(FD(n),o4("onunhandledrejection"))}}}),ND=PD;function $D(t){kA(e=>{const{stackParser:n,attachStacktrace:r}=p8();if(Sn()!==t||u8())return;const{msg:i,url:s,line:o,column:a,error:l}=e,c=zD(Ay(n,l||i,void 0,r,!1),s,o,a);c.level="error",Ww(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function FD(t){SA(e=>{const{stackParser:n,attachStacktrace:r}=p8();if(Sn()!==t||u8())return;const i=HD(e),s=L0(i)?VD(i):Ay(n,i,void 0,r,!0);s.level="error",Ww(s,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function HD(t){if(L0(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function VD(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function zD(t,e,n,r){const i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},l=a.frames=a.frames||[],c=r,u=n,d=BD(e)??vy();return l.length===0&&l.push({colno:c,filename:d,function:So,in_app:!0,lineno:u}),t}function o4(t){R0&&$e.log(`Global Handler attached: ${t}`)}function p8(){return Sn()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function BD(t){if(!(!Ki(t)||t.length===0))return t.startsWith("data:")?`<${BI(t,!1)}>`:t}const qD=()=>({name:"HttpContext",preprocessEvent(t){if(!qt.navigator&&!qt.location&&!qt.document)return;const e=_O(),n={...e.headers,...t.request?.headers};t.request={...e,...t.request,headers:n}}}),jD="cause",UD=5,WD="LinkedErrors",GD=((t={})=>{const e=t.limit||UD,n=t.key||jD;return{name:WD,preprocessEvent(r,i,s){const o=s.getOptions();sO(Ty,o.stackParser,n,e,r,i)}}}),KD=GD;function ZD(){return YD()?(R0&&ol(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function YD(){if(typeof qt.window>"u")return!1;const t=qt;if(t.nw||!(t.chrome||t.browser)?.runtime?.id)return!1;const n=vy(),r=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(qt===qt.top&&r.some(s=>n.startsWith(`${s}://`)))}function QD(t){return[QI(),GI(),TD(),gD(),ND(),KD(),dO(),qD(),DD()]}function XD(t={}){const e=!t.skipBrowserExtensionCheck&&ZD();let n=t.defaultIntegrations==null?QD():t.defaultIntegrations;const r={...t,enabled:e?!1:t.enabled,stackParser:bA(t.stackParser||hD),integrations:gI({integrations:t.integrations,defaultIntegrations:n}),transport:t.transport||JO};return VI(NO,r)}function JD(t){const e={...t};return o8(e,"solid"),XD(e)}const eR="modulepreload",tR=function(t){return"/"+t},a4={},A=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=tR(c),c in a4)return;a4[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eR,u||(f.as="script"),f.crossOrigin="",f.href=c,a&&f.setAttribute("nonce",a),document.head.appendChild(f),u)return new Promise((h,p)=>{f.addEventListener("load",h),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})};function zt(t){const e=vt();return{provider:n=>{const r=t.init(n);if(!(t.gate??!0))return O(e.Provider,{value:r,get children(){return n.children}});const s=Y(()=>{const o=r.ready;return o===void 0||(typeof o=="function"?o():o)});return O(Me,{get when(){return s()},get children(){return O(e.Provider,{value:r,get children(){return n.children}})}})},use(){const n=bt(e);if(!n)throw new Error(`${t.name} context must be used within a context provider`);return n}}}const{use:wue,provider:nR}=zt({name:"Data",init:t=>({get store(){return t.data},get directory(){return t.directory},navigateToSession:t.onNavigateToSession,sessionHref:t.onSessionHref})}),m8=zt({name:"FileComponent",init:t=>t.component}),rR=m8.provider,kue=m8.use,iR=t=>t!=null,sR=t=>t.filter(iR);function oR(t){return(...e)=>{for(const n of t)n&&n(...e)}}const se=t=>typeof t=="function"&&!t.length?t():t,mg=t=>Array.isArray(t)?t:t?[t]:[];function aR(t,...e){return typeof t=="function"?t(...e):t}const My=ae;function lR(t,e,n){if(Ae.context){const[r,i]=be(t,n);return Vt(()=>i(()=>e())),[r,i]}return be(e(),n)}function cR(t,e,n,r){const i=t.length,s=e.length;let o=0;if(!s){for(;o{mg(se(t)).forEach(s=>{s&&mg(se(e)).forEach(o=>Rt(s,o,n,r))})};typeof t=="function"?re(i):Ke(i)}function dR(t,e=Jr()){let n=0,r,i;return()=>(n++,ae(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||wn(s=>r=t(i=s),e),r)}function fR(t){const e=Jr(),n=dR(t,e);return()=>Ae.context?wn(t,e):n()}function g8(t,e=!1){const n=window.matchMedia(t),[r,i]=lR(e,()=>n.matches);return Rt(n,"change",()=>i(n.matches)),r}function hR(t){return g8("(prefers-color-scheme: dark)",t)}hR.bind(void 0,!1);const pR=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function l4(t){const e={};let n;for(;n=pR.exec(t);)e[n[1]]=n[2];return e}function Si(t,e){if(typeof t=="string"){if(typeof e=="string")return`${t};${e}`;t=l4(t)}else typeof e=="string"&&(e=l4(e));return{...t,...e}}function Nt(...t){return oR(t)}function mR(t,e,n=-1){return n in t?[...t.slice(0,n),e,...t.slice(n)]:[...t,e]}function gg(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function gR(t){return typeof t=="number"}function ha(t){return Object.prototype.toString.call(t)==="[object String]"}function y8(t){return typeof t=="function"}function _i(t){return e=>`${t()}-${e}`}function gn(t,e){return t?t===e||t.contains(e):!1}function Yl(t,e=!1){const{activeElement:n}=Vn(t);if(!n?.nodeName)return null;if(v8(n)&&n.contentDocument)return Yl(n.contentDocument.body,e);if(e){const r=n.getAttribute("aria-activedescendant");if(r){const i=Vn(n).getElementById(r);if(i)return i}}return n}function Iy(t){return Vn(t).defaultView||window}function Vn(t){return t?t.ownerDocument||t:document}function v8(t){return t.tagName==="IFRAME"}var b8=(t=>(t.Escape="Escape",t.Enter="Enter",t.Tab="Tab",t.Space=" ",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.ArrowUp="ArrowUp",t.End="End",t.Home="Home",t.PageDown="PageDown",t.PageUp="PageUp",t))(b8||{});function w8(t){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(e=>t.test(e.brand))||t.test(window.navigator.userAgent)}function Oy(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function P0(){return Oy(/^Mac/i)}function yR(){return Oy(/^iPhone/i)}function vR(){return Oy(/^iPad/i)||P0()&&navigator.maxTouchPoints>1}function bR(){return yR()||vR()}function wR(){return P0()||bR()}function xue(){return w8(/AppleWebKit/i)&&!kR()}function kR(){return w8(/Chrome/i)}function Ge(t,e){return e&&(y8(e)?e(t):e[0](e[1],t)),t?.defaultPrevented}function Kt(t){return e=>{for(const n of t)Ge(e,n)}}function xR(t){return P0()?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey}function sn(t){if(t)if(SR())t.focus({preventScroll:!0});else{const e=_R(t);t.focus(),CR(e)}}var Gu=null;function SR(){if(Gu==null){Gu=!1;try{document.createElement("div").focus({get preventScroll(){return Gu=!0,!0}})}catch{}}return Gu}function _R(t){let e=t.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeight{if(v8(i)&&i.contentDocument){const o=i.contentDocument.body,a=x8(o,!1);r.splice(s,1,...a)}}),r}function c4(t){return S8(t)&&!LR(t)}function S8(t){return t.matches(Dy)&&Ry(t)}function LR(t){return Number.parseInt(t.getAttribute("tabindex")||"0",10)<0}function Ry(t,e){return t.nodeName!=="#comment"&&AR(t)&&MR(t,e)&&(!t.parentElement||Ry(t.parentElement,t))}function AR(t){if(!(t instanceof HTMLElement)&&!(t instanceof SVGElement))return!1;const{display:e,visibility:n}=t.style;let r=e!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!t.ownerDocument.defaultView)return r;const{getComputedStyle:i}=t.ownerDocument.defaultView,{display:s,visibility:o}=i(t);r=s!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function MR(t,e){return!t.hasAttribute("hidden")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function IR(t,e,n){const r=e?.tabbable?TR:Dy,i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return e?.from?.contains(s)?NodeFilter.FILTER_REJECT:s.matches(r)&&Ry(s)&&(!e?.accept||e.accept(s))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(i.currentNode=e.from),i}function u4(t){let e=t;for(;e&&!OR(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function OR(t){const e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function DR(){}function RR(t){return[t.clientX,t.clientY]}function _8(t,e){const[n,r]=t;let i=!1;const s=e.length;for(let o=s,a=0,l=o-1;a=f&&r0&&(r===f?r>h&&(i=!i):i=!i)}}else if(uu&&r<=f){if(p===0)return!0;p<0&&(r===f?r=d&&n<=c||n>=c&&n<=d))return!0}return i}function je(t,e){return ne(t,e)}var Rl=new Map,d4=new Set;function f4(){if(typeof window>"u")return;const t=n=>{if(!n.target)return;let r=Rl.get(n.target);r||(r=new Set,Rl.set(n.target,r),n.target.addEventListener("transitioncancel",e)),r.add(n.propertyName)},e=n=>{if(!n.target)return;const r=Rl.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",e),Rl.delete(n.target)),Rl.size===0)){for(const i of d4)i();d4.clear()}};document.body.addEventListener("transitionrun",t),document.body.addEventListener("transitionend",e)}typeof document<"u"&&(document.readyState!=="loading"?f4():document.addEventListener("DOMContentLoaded",f4));function yg(t,e){const n=h4(t,e,"left"),r=h4(t,e,"top"),i=e.offsetWidth,s=e.offsetHeight;let o=t.scrollLeft,a=t.scrollTop;const l=o+t.offsetWidth,c=a+t.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=a?a=r:r+s>c&&(a+=r+s-c),t.scrollLeft=o,t.scrollTop=a}function h4(t,e,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[r],e.offsetParent!==t);){if(e.offsetParent.contains(t)){i-=t[r];break}e=e.offsetParent}return i}function PR(t,e){if(document.contains(t)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=u4(t);for(;t&&i&&t!==n&&i!==n;)yg(i,t),t=i,i=u4(t)}else{const{left:i,top:s}=t.getBoundingClientRect();t?.scrollIntoView?.({block:"nearest"});const{left:o,top:a}=t.getBoundingClientRect();(Math.abs(i-o)>1||Math.abs(s-a)>1)&&t.scrollIntoView?.({block:"nearest"})}}}var NR={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},Ec="data-kb-top-layer",C8,vg=!1,es=[];function Tc(t){return es.findIndex(e=>e.node===t)}function $R(t){return es[Tc(t)]}function FR(t){return es[es.length-1].node===t}function E8(){return es.filter(t=>t.isPointerBlocking)}function HR(){return[...E8()].slice(-1)[0]}function Py(){return E8().length>0}function T8(t){const e=Tc(HR()?.node);return Tc(t)t.onMountAutoFocus?.(p),a=p=>t.onUnmountAutoFocus?.(p),l=()=>Vn(e()),c=()=>{const p=l().createElement("span");return p.setAttribute("data-focus-trap",""),p.tabIndex=0,Object.assign(p.style,NR),p},u=()=>{const p=e();return p?x8(p,!0).filter(m=>!m.hasAttribute("data-focus-trap")):[]},d=()=>{const p=u();return p.length>0?p[0]:null},f=()=>{const p=u();return p.length>0?p[p.length-1]:null},h=()=>{const p=e();if(!p)return!1;const m=Yl(p);return!m||gn(p,m)?!1:S8(m)};re(()=>{const p=e();if(!p)return;m4.add(i);const m=Yl(p);if(!gn(p,m)){const y=new CustomEvent(up,p4);p.addEventListener(up,o),p.dispatchEvent(y),y.defaultPrevented||setTimeout(()=>{sn(d()),Yl(p)===m&&sn(p)},0)}ae(()=>{p.removeEventListener(up,o),setTimeout(()=>{const y=new CustomEvent(dp,p4);h()&&y.preventDefault(),p.addEventListener(dp,a),p.dispatchEvent(y),y.defaultPrevented||sn(m??l().body),p.removeEventListener(dp,a),m4.remove(i)},0)})}),re(()=>{const p=e();if(!p||!se(t.trapFocus)||n())return;const m=y=>{const v=y.target;v?.closest(`[${Ec}]`)||(gn(p,v)?s=v:sn(s))},g=y=>{const w=y.relatedTarget??Yl(p);w?.closest(`[${Ec}]`)||gn(p,w)||sn(s)};l().addEventListener("focusin",m),l().addEventListener("focusout",g),ae(()=>{l().removeEventListener("focusin",m),l().removeEventListener("focusout",g)})}),re(()=>{const p=e();if(!p||!se(t.trapFocus)||n())return;const m=c();p.insertAdjacentElement("afterbegin",m);const g=c();p.insertAdjacentElement("beforeend",g);function y(w){const _=d(),k=f();w.relatedTarget===_?sn(k):sn(_)}m.addEventListener("focusin",y),g.addEventListener("focusin",y);const v=new MutationObserver(w=>{for(const _ of w)_.previousSibling===g&&(g.remove(),p.insertAdjacentElement("beforeend",g)),_.nextSibling===m&&(m.remove(),p.insertAdjacentElement("afterbegin",m))});v.observe(p,{childList:!0,subtree:!1}),ae(()=>{m.removeEventListener("focusin",y),g.removeEventListener("focusin",y),m.remove(),g.remove(),v.disconnect()})})}var UR="data-live-announcer";function A8(t){re(()=>{se(t.isDisabled)||ae(WR(se(t.targets),se(t.root)))})}var Pl=new WeakMap,yr=[];function WR(t,e=document.body){const n=new Set(t),r=new Set,i=l=>{for(const f of l.querySelectorAll(`[${UR}], [${Ec}]`))n.add(f);const c=f=>{if(n.has(f)||f.parentElement&&r.has(f.parentElement)&&f.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const h of n)if(f.contains(h))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),d=c(l);if(d===NodeFilter.FILTER_ACCEPT&&s(l),d!==NodeFilter.FILTER_REJECT){let f=u.nextNode();for(;f!=null;)s(f),f=u.nextNode()}},s=l=>{const c=Pl.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Pl.set(l,c+1))};yr.length&&yr[yr.length-1].disconnect(),i(e);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(e,{childList:!0,subtree:!0});const a={observe(){o.observe(e,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return yr.push(a),()=>{o.disconnect();for(const l of r){const c=Pl.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Pl.delete(l)):Pl.set(l,c-1)}a===yr[yr.length-1]?(yr.pop(),yr.length&&yr[yr.length-1].observe()):yr.splice(yr.indexOf(a),1)}}var g4="interactOutside.pointerDownOutside",y4="interactOutside.focusOutside";function GR(t,e){let n,r=DR;const i=()=>Vn(e()),s=d=>t.onPointerDownOutside?.(d),o=d=>t.onFocusOutside?.(d),a=d=>t.onInteractOutside?.(d),l=d=>{const f=d.target;return!(f instanceof Element)||f.closest(`[${Ec}]`)||!gn(i(),f)||gn(e(),f)?!1:!t.shouldExcludeElement?.(f)},c=d=>{function f(){const h=e(),p=d.target;if(!h||!p||!l(d))return;const m=Kt([s,a]);p.addEventListener(g4,m,{once:!0});const g=new CustomEvent(g4,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:d.button===2||xR(d)&&d.button===0}});p.dispatchEvent(g)}d.pointerType==="touch"?(i().removeEventListener("click",f),r=f,i().addEventListener("click",f,{once:!0})):f()},u=d=>{const f=e(),h=d.target;if(!f||!h||!l(d))return;const p=Kt([o,a]);h.addEventListener(y4,p,{once:!0});const m=new CustomEvent(y4,{bubbles:!1,cancelable:!0,detail:{originalEvent:d,isContextMenu:!1}});h.dispatchEvent(m)};re(()=>{se(t.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),ae(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function KR(t){const e=n=>{n.key===b8.Escape&&t.onEscapeKeyDown?.(n)};re(()=>{if(se(t.isDisabled))return;const n=t.ownerDocument?.()??Vn();n.addEventListener("keydown",e),ae(()=>{n.removeEventListener("keydown",e)})})}function ut(t){const[e,n]=ue(t,["as"]);if(!e.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return O(xw,ne(n,{get component(){return e.as}}))}var M8=vt();function ZR(){return bt(M8)}function Ny(t){let e;const n=ZR(),[r,i]=ue(t,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),s=new Set([]),o=d=>{s.add(d);const f=n?.registerNestedLayer(d);return()=>{s.delete(d),f?.()}};GR({shouldExcludeElement:d=>e?r.excludedElements?.some(f=>gn(f(),d))||[...s].some(f=>gn(f,d)):!1,onPointerDownOutside:d=>{!e||Xn.isBelowPointerBlockingLayer(e)||!r.bypassTopMostLayerCheck&&!Xn.isTopMostLayer(e)||(r.onPointerDownOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.())},onFocusOutside:d=>{r.onFocusOutside?.(d),r.onInteractOutside?.(d),d.defaultPrevented||r.onDismiss?.()}},()=>e),KR({ownerDocument:()=>Vn(e),onEscapeKeyDown:d=>{!e||!Xn.isTopMostLayer(e)||(r.onEscapeKeyDown?.(d),!d.defaultPrevented&&r.onDismiss&&(d.preventDefault(),r.onDismiss()))}}),Vt(()=>{if(!e)return;Xn.addLayer({node:e,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const d=n?.registerNestedLayer(e);Xn.assignPointerEventToLayers(),Xn.disableBodyPointerEvents(e),ae(()=>{e&&(Xn.removeLayer(e),d?.(),Xn.assignPointerEventToLayers(),Xn.restoreBodyPointerEvents(e))})}),re(Tt([()=>e,()=>r.disableOutsidePointerEvents],([d,f])=>{if(!d)return;const h=Xn.find(d);h&&h.isPointerBlocking!==f&&(h.isPointerBlocking=f,Xn.assignPointerEventToLayers()),f&&Xn.disableBodyPointerEvents(d),ae(()=>{Xn.restoreBodyPointerEvents(d)})},{defer:!0}));const u={registerNestedLayer:o};return O(M8.Provider,{value:u,get children(){return O(ut,ne({as:"div",ref(d){var f=Nt(h=>e=h,r.ref);typeof f=="function"&&f(d)}},i))}})}function hu(t){const[e,n]=be(t.defaultValue?.()),r=Y(()=>t.value?.()!==void 0),i=Y(()=>r()?t.value?.():e());return[i,o=>{ft(()=>{const a=aR(o,i());return Object.is(a,i())||(r()||n(a),t.onChange?.(a)),a})}]}function I8(t){const[e,n]=hu(t);return[()=>e()??!1,n]}function YR(t){const[e,n]=hu(t);return[()=>e()??[],n]}function cl(t={}){const[e,n]=I8({value:()=>se(t.open),defaultValue:()=>!!se(t.defaultOpen),onChange:o=>t.onOpenChange?.(o)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:e,setIsOpen:n,open:r,close:i,toggle:()=>{e()?i():r()}}}function N0(t,e){const[n,r]=be(v4(e?.()));return re(()=>{r(t()?.tagName.toLowerCase()||v4(e?.()))}),n}function v4(t){return ha(t)?t:void 0}var QR=Object.defineProperty,ls=(t,e)=>{for(var n in e)QR(t,n,{get:e[n],enumerable:!0})},XR={};ls(XR,{Button:()=>$0,Root:()=>Ho});var JR=["button","color","file","image","reset","submit"];function eP(t){const e=t.tagName.toLowerCase();return e==="button"?!0:e==="input"&&t.type?JR.indexOf(t.type)!==-1:!1}function Ho(t){let e;const n=je({type:"button"},t),[r,i]=ue(n,["ref","type","disabled"]),s=N0(()=>e,()=>"button"),o=Y(()=>{const c=s();return c==null?!1:eP({tagName:c,type:r.type})}),a=Y(()=>s()==="input"),l=Y(()=>s()==="a"&&e?.getAttribute("href")!=null);return O(ut,ne({as:"button",ref(c){var u=Nt(d=>e=d,r.ref);typeof u=="function"&&u(c)},get type(){return Be(()=>!!(o()||a()))()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return Be(()=>!!(o()||a()))()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!a()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var $0=Ho;function On(t){return e=>(t(e),()=>t(void 0))}var En=t=>typeof t=="function"?t():t,bg=(t,e)=>{if(t.contains(e))return!0;let n=e;for(;n;){if(n===t)return!0;n=n._$host??n.parentElement}return!1},Ku=new Map,tP=t=>{re(()=>{const e=En(t.style)??{},n=En(t.properties)??[],r={};for(const s in e)r[s]=t.element.style[s];const i=Ku.get(t.key);i?i.activeCount++:Ku.set(t.key,{activeCount:1,originalStyles:r,properties:n.map(s=>s.key)}),Object.assign(t.element.style,t.style);for(const s of n)t.element.style.setProperty(s.key,s.value);ae(()=>{const s=Ku.get(t.key);if(s){if(s.activeCount!==1){s.activeCount--;return}Ku.delete(t.key);for(const[o,a]of Object.entries(s.originalStyles))t.element.style[o]=a;for(const o of s.properties)t.element.style.removeProperty(o);t.element.style.length===0&&t.element.removeAttribute("style"),t.cleanup?.()}})})},b4=tP,nP=(t,e)=>{switch(e){case"x":return[t.clientWidth,t.scrollLeft,t.scrollWidth];case"y":return[t.clientHeight,t.scrollTop,t.scrollHeight]}},rP=(t,e)=>{const n=getComputedStyle(t),r=e==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||t.tagName==="HTML"&&r==="visible"},iP=(t,e,n)=>{const r=e==="x"&&window.getComputedStyle(t).direction==="rtl"?-1:1;let i=t,s=0,o=0,a=!1;do{const[l,c,u]=nP(i,e),d=u-l-r*c;(c!==0||d!==0)&&rP(i,e)&&(s+=d,o+=c),i===(n??document.documentElement)?a=!0:i=i._$host??i.parentElement}while(i&&!a);return[s,o]},[w4,k4]=be([]),sP=t=>w4().indexOf(t)===w4().length-1,oP=t=>{const e=ne({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},t),n=xn();let r=[0,0],i=null,s=null;re(()=>{En(e.enabled)&&(k4(c=>[...c,n]),ae(()=>{k4(c=>c.filter(u=>u!==n))}))}),re(()=>{if(!En(e.enabled)||!En(e.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(En(e.preventScrollbarShift)){const d={overflow:"hidden"},f=[];u>0&&(En(e.preventScrollbarShiftMode)==="padding"?d.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:d.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,f.push({key:"--scrollbar-width",value:`${u}px`}));const h=window.scrollY,p=window.scrollX;b4({key:"prevent-scroll",element:c,style:d,properties:f,cleanup:()=>{En(e.restoreScrollPosition)&&u>0&&window.scrollTo(p,h)}})}else b4({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),re(()=>{!sP(n)||!En(e.enabled)||(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),ae(()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=x4(c),i=null,s=null},a=c=>{const u=c.target,d=En(e.element),f=aP(c),h=Math.abs(f[0])>Math.abs(f[1])?"x":"y",p=h==="x"?f[0]:f[1],m=S4(u,h,p,d);let g;d&&bg(d,u)?g=!m:g=!0,g&&c.cancelable&&c.preventDefault()},l=c=>{const u=En(e.element),d=c.target;let f;if(c.touches.length===2)f=!En(e.allowPinchZoom);else{if(i==null||s===null){const h=x4(c).map((m,g)=>r[g]-m),p=Math.abs(h[0])>Math.abs(h[1])?"x":"y";i=p,s=p==="x"?h[0]:h[1]}if(d.type==="range")f=!1;else{const h=S4(d,i,s,u);u&&bg(u,d)?f=!h:f=!0}}f&&c.cancelable&&c.preventDefault()}},aP=t=>[t.deltaX,t.deltaY],x4=t=>t.changedTouches[0]?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0],S4=(t,e,n,r)=>{const i=r!==null&&bg(r,t),[s,o]=iP(t,e,i?r:void 0);return!(n>0&&Math.abs(s)<=1||n<0&&Math.abs(o)<1)},lP=oP,O8=lP,cP=t=>{const e=Y(()=>{const o=En(t.element);if(o)return getComputedStyle(o)}),n=()=>e()?.animationName??"none",[r,i]=be(En(t.show)?"present":"hidden");let s="none";return re(o=>{const a=En(t.show);return ft(()=>{if(o===a)return a;const l=s,c=n();a?i("present"):c==="none"||e()?.display==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),a}),re(()=>{const o=En(t.element);if(!o)return;const a=c=>{c.target===o&&(s=n())},l=c=>{const d=n().includes(c.animationName);c.target===o&&d&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",a),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),ae(()=>{o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},uP=cP,Ua=uP,dP={};ls(dP,{CloseButton:()=>R8,Content:()=>P8,Description:()=>N8,Dialog:()=>As,Overlay:()=>$8,Portal:()=>F8,Root:()=>H8,Title:()=>V8,Trigger:()=>z8,useDialogContext:()=>Ys});var D8=vt();function Ys(){const t=bt(D8);if(t===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return t}function R8(t){const e=Ys(),[n,r]=ue(t,["aria-label","onClick"]);return O(Ho,ne({get"aria-label"(){return n["aria-label"]||e.translations().dismiss},onClick:s=>{Ge(s,n.onClick),e.close()}},r))}function P8(t){let e;const n=Ys(),r=je({id:n.generateId("content")},t),[i,s]=ue(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,a=!1;const l=f=>{i.onPointerDownOutside?.(f),n.modal()&&f.detail.isContextMenu&&f.preventDefault()},c=f=>{i.onFocusOutside?.(f),n.modal()&&f.preventDefault()},u=f=>{i.onInteractOutside?.(f),!n.modal()&&(f.defaultPrevented||(o=!0,f.detail.originalEvent.type==="pointerdown"&&(a=!0)),gn(n.triggerRef(),f.target)&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&a&&f.preventDefault())},d=f=>{i.onCloseAutoFocus?.(f),n.modal()?(f.preventDefault(),sn(n.triggerRef())):(f.defaultPrevented||(o||sn(n.triggerRef()),f.preventDefault()),o=!1,a=!1)};return A8({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>e?[e]:[]}),O8({element:()=>e??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),L8({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:d},()=>e),re(()=>ae(n.registerContentId(s.id))),O(Me,{get when(){return n.contentPresent()},get children(){return O(Ny,ne({ref(f){var h=Nt(p=>{n.setContentRef(p),e=p},i.ref);typeof h=="function"&&h(f)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return Be(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},s))}})}function N8(t){const e=Ys(),n=je({id:e.generateId("description")},t),[r,i]=ue(n,["id"]);return re(()=>ae(e.registerDescriptionId(r.id))),O(ut,ne({as:"p",get id(){return r.id}},i))}function $8(t){const e=Ys(),[n,r]=ue(t,["ref","style","onPointerDown"]),i=s=>{Ge(s,n.onPointerDown),s.target===s.currentTarget&&s.preventDefault()};return O(Me,{get when(){return e.overlayPresent()},get children(){return O(ut,ne({as:"div",ref(s){var o=Nt(e.setOverlayRef,n.ref);typeof o=="function"&&o(s)},get style(){return Si({"pointer-events":"auto"},n.style)},get"data-expanded"(){return e.isOpen()?"":void 0},get"data-closed"(){return e.isOpen()?void 0:""},onPointerDown:i},r))}})}function F8(t){const e=Ys();return O(Me,{get when(){return e.contentPresent()||e.overlayPresent()},get children(){return O(au,t)}})}var _4={dismiss:"Dismiss"};function H8(t){const e=`dialog-${xn()}`,n=je({id:e,modal:!0,translations:_4},t),[r,i]=be(),[s,o]=be(),[a,l]=be(),[c,u]=be(),[d,f]=be(),[h,p]=be(),m=cl({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:_=>n.onOpenChange?.(_)}),g=()=>n.forceMount||m.isOpen(),{present:y}=Ua({show:g,element:()=>c()??null}),{present:v}=Ua({show:g,element:()=>d()??null}),w={translations:()=>n.translations??_4,isOpen:m.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:s,descriptionId:a,triggerRef:h,overlayRef:c,setOverlayRef:u,contentRef:d,setContentRef:f,overlayPresent:y,contentPresent:v,close:m.close,toggle:m.toggle,setTriggerRef:p,generateId:_i(()=>n.id),registerContentId:On(i),registerTitleId:On(o),registerDescriptionId:On(l)};return O(D8.Provider,{value:w,get children(){return n.children}})}function V8(t){const e=Ys(),n=je({id:e.generateId("title")},t),[r,i]=ue(n,["id"]);return re(()=>ae(e.registerTitleId(r.id))),O(ut,ne({as:"h2",get id(){return r.id}},i))}function z8(t){const e=Ys(),[n,r]=ue(t,["ref","onClick"]);return O(Ho,ne({ref(s){var o=Nt(e.setTriggerRef,n.ref);typeof o=="function"&&o(s)},"aria-haspopup":"dialog",get"aria-expanded"(){return e.isOpen()},get"aria-controls"(){return Be(()=>!!e.isOpen())()?e.contentId():void 0},get"data-expanded"(){return e.isOpen()?"":void 0},get"data-closed"(){return e.isOpen()?void 0:""},onClick:s=>{Ge(s,n.onClick),e.toggle()}},r))}var As=Object.assign(H8,{CloseButton:R8,Content:P8,Description:N8,Overlay:$8,Portal:F8,Title:V8,Trigger:z8}),fP=Te("
");const B8=vt();function hP(){const[t,e]=be(),n={current:void 0},r={value:!1};ae(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const o=t();if(!o||r.value)return;r.value=!0,o.onClose?.(),o.setClosing(!0);const a=o.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,o.dispose(),t()?.id===a&&e(void 0),r.value=!1},100)};return re(()=>{if(!t())return;Rt(window,"keydown",a=>{a.key==="Escape"&&(i(),a.preventDefault(),a.stopPropagation())},{capture:!0})}),{get active(){return t()},close:i,show:(o,a,l)=>{const c=t();c&&(c.dispose(),e(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let d,f;const h=ji(a,()=>wn(p=>{d=p;const[m,g]=be(!1);return f=g,O(As,{modal:!0,get open(){return!m()},onOpenChange:y=>{y||i()},get children(){return O(As.Portal,{get children(){return[O(As.Overlay,{"data-component":"dialog-overlay",onClick:i}),Be(()=>o())]}})}})}));!d||!f||e({id:u,node:h,dispose:d,owner:a,onClose:l,setClosing:f})}}}function pP(t){const e=hP();return O(B8.Provider,{value:e,get children(){return[Be(()=>t.children),(()=>{var n=fP();return ie(n,()=>e.active?.node),n})()]}})}function F0(){const t=bt(B8),e=Jr();if(!e)throw new Error("useDialog must be used within a DialogProvider");if(!t)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return t.active},show(n,r){const i=t.active?.owner??e;return hy(()=>t.show(n,i,r))},close(){t.close()}}}const q8={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed":"Changed","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","dialog.usageExceeded.freeTier.title":"Free limit reached","dialog.usageExceeded.freeTier.description":"Subscribe to OpenCode Go for reliable access to the best open-source models, starting at $5/month.","dialog.usageExceeded.freeTier.actionLabel":"Subscribe","dialog.usageExceeded.accountRateLimit.title":"Go limit reached","dialog.usageExceeded.accountRateLimit.description":"Usage limit reached. To continue using this model now, enable usage from your available balance","dialog.usageExceeded.accountRateLimit.actionLabel":"Open settings","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function mP(t,e){return e?t.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),s=e[i];return s===void 0?"":String(s)}):t}const gP={locale:()=>"en",t:(t,e)=>{const n=q8[t]??String(t);return mP(n,e)}},j8=vt(gP);function yP(t){return O(j8.Provider,{get value(){return t.value},get children(){return t.children}})}function pu(){return bt(j8)}function $y(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Vo=$y();function U8(t){Vo=t}var uc={exec:()=>null};function ht(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace($n.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,e)};return r}var vP=(()=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},bP=/^(?:[ \t]*(?:\n|$))+/,wP=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kP=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,mu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xP=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fy=/(?:[*+-]|\d{1,9}[.)])/,W8=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,G8=ht(W8).replace(/bull/g,Fy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),SP=ht(W8).replace(/bull/g,Fy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Hy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_P=/^[^\n]+/,Vy=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,CP=ht(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vy).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),EP=ht(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fy).getRegex(),H0="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",zy=/|$))/,TP=ht("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",zy).replace("tag",H0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),K8=ht(Hy).replace("hr",mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",H0).getRegex(),LP=ht(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",K8).getRegex(),By={blockquote:LP,code:wP,def:CP,fences:kP,heading:xP,hr:mu,html:TP,lheading:G8,list:EP,newline:bP,paragraph:K8,table:uc,text:_P},C4=ht("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",H0).getRegex(),AP={...By,lheading:SP,table:C4,paragraph:ht(Hy).replace("hr",mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",C4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",H0).getRegex()},MP={...By,html:ht(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zy).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:uc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ht(Hy).replace("hr",mu).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",G8).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},IP=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,OP=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Z8=/^( {2,}|\\)\n(?!\s*$)/,DP=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",vP?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),X8=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,FP=ht(X8,"u").replace(/punct/g,V0).getRegex(),HP=ht(X8,"u").replace(/punct/g,Q8).getRegex(),J8="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",VP=ht(J8,"gu").replace(/notPunctSpace/g,Y8).replace(/punctSpace/g,qy).replace(/punct/g,V0).getRegex(),zP=ht(J8,"gu").replace(/notPunctSpace/g,NP).replace(/punctSpace/g,PP).replace(/punct/g,Q8).getRegex(),BP=ht("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Y8).replace(/punctSpace/g,qy).replace(/punct/g,V0).getRegex(),qP=ht(/\\(punct)/,"gu").replace(/punct/g,V0).getRegex(),jP=ht(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),UP=ht(zy).replace("(?:-->|$)","-->").getRegex(),WP=ht("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",UP).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Sf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,GP=ht(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Sf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ek=ht(/^!?\[(label)\]\[(ref)\]/).replace("label",Sf).replace("ref",Vy).getRegex(),tk=ht(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vy).getRegex(),KP=ht("reflink|nolink(?!\\()","g").replace("reflink",ek).replace("nolink",tk).getRegex(),E4=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jy={_backpedal:uc,anyPunctuation:qP,autolink:jP,blockSkip:$P,br:Z8,code:OP,del:uc,emStrongLDelim:FP,emStrongRDelimAst:VP,emStrongRDelimUnd:BP,escape:IP,link:GP,nolink:tk,punctuation:RP,reflink:ek,reflinkSearch:KP,tag:WP,text:DP,url:uc},ZP={...jy,link:ht(/^!?\[(label)\]\((.*?)\)/).replace("label",Sf).getRegex(),reflink:ht(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Sf).getRegex()},wg={...jy,emStrongRDelimAst:zP,emStrongLDelim:HP,url:ht(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",E4).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ht(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},T4=t=>QP[t];function Fi(t,e){if(e){if($n.escapeTest.test(t))return t.replace($n.escapeReplace,T4)}else if($n.escapeTestNoEncode.test(t))return t.replace($n.escapeReplaceNoEncode,T4);return t}function L4(t){try{t=encodeURI(t).replace($n.percentDecode,"%")}catch{return null}return t}function A4(t,e){let n=t.replace($n.findPipe,(s,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split($n.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length0?-2:-1}function M4(t,e,n,r,i){let s=e.href,o=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function JP(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(` `).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(` `)}var _f=class{options;rules;lexer;constructor(e){this.options=e||Vo}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:$l(r,` `)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],i=JP(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:i}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let i=$l(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:$l(n[0],` `)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=$l(n[0],` `).split(` `),i="",s="",o=[];for(;r.length>0;){let a=!1,l=[],c;for(c=0;c1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let o=this.rules.other.listItemRegex(r),a=!1;for(;e;){let c=!1,u="",d="";if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;u=n[0],e=e.substring(u.length);let f=n[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,g=>" ".repeat(3*g.length)),h=e.split(` `,1)[0],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,d=f.trimStart()):p?m=n[1].length+1:(m=n[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,d=f.slice(m),m+=n[1].length),p&&this.rules.other.blankLine.test(h)&&(u+=h+` `,e=e.substring(h.length+1),c=!0),!c){let g=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),v=this.rules.other.fencesBeginRegex(m),w=this.rules.other.headingBeginRegex(m),_=this.rules.other.htmlBeginRegex(m);for(;e;){let k=e.split(` `,1)[0],S;if(h=k,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),v.test(h)||w.test(h)||_.test(h)||g.test(h)||y.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=m||!h.trim())d+=` `+S.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||w.test(f)||y.test(f))break;d+=` `+h}!p&&!h.trim()&&(p=!0),u+=k+` `,e=e.substring(k.length+1),f=S.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0)),s.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),s.raw+=u}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c of s.items){if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),c.task){if(c.text=c.text.replace(this.rules.other.listReplaceTask,""),c.tokens[0]?.type==="text"||c.tokens[0]?.type==="paragraph"){c.tokens[0].raw=c.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),c.tokens[0].text=c.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(c.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};c.checked=d.checked,s.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=d.raw+c.tokens[0].raw,c.tokens[0].text=d.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(d)):c.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):c.tokens.unshift(d)}}if(!s.loose){let u=c.tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));s.loose=d}}if(s.loose)for(let c of s.items){c.loose=!0;for(let u of c.tokens)u.type==="text"&&(u.type="paragraph")}return s}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:i,title:s}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=A4(n[1]),i=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(` `):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===i.length){for(let a of i)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===` `?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=$l(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=XP(n[2],"()");if(o===-2)return;if(o>-1){let a=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,a).trim(),n[3]=""}}let i=n[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),M4(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=n[i.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return M4(r,s,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[2])||!r||this.rules.inline.punctuation.exec(r))){let s=[...i[0]].length-1,o,a,l=s,c=0,u=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,n=n.slice(-1*e.length+s);(i=u.exec(n))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(a=[...o].length,i[3]||i[4]){l+=a;continue}else if((i[5]||i[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let d=[...i[0]][0].length,f=e.slice(0,s+i.index+d+a);if(Math.min(s,a)%2){let p=f.slice(1,-1);return{type:"em",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}let h=f.slice(2,-2);return{type:"strong",raw:f,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,i;return n[2]==="@"?(r=n[1],i="mailto:"+r):(r=n[1],i=r),{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,i;if(n[2]==="@")r=n[0],i="mailto:"+r;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(s!==n[0]);r=n[0],n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},jr=class kg{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Vo,this.options.tokenizer=this.options.tokenizer||new _f,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:$n,block:Zu.normal,inline:Nl.normal};this.options.pedantic?(n.block=Zu.pedantic,n.inline=Nl.pedantic):this.options.gfm&&(n.block=Zu.gfm,this.options.breaks?n.inline=Nl.breaks:n.inline=Nl.gfm),this.tokenizer.rules=n}static get rules(){return{block:Zu,inline:Nl}}static lex(e,n){return new kg(n).lex(e)}static lexInline(e,n){return new kg(n).inlineTokens(e)}lex(e){e=e.replace($n.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let n=0;n(i=o.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=n.at(-1);i.raw.length===1&&o!==void 0?o.raw+=` `:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(` `)?"":` `)+i.raw,o.text+=` `+i.text,this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(` `)?"":` `)+i.raw,o.text+=` `+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,a=e.slice(1),l;this.options.extensions.startBlock.forEach(c=>{l=c.call({lexer:this},a),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(` `)?"":` `)+i.raw,o.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(` `)?"":` `)+i.raw,o.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let r=e,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let o=!1,a="";for(;e;){o||(a=""),o=!1;let l;if(this.options.extensions?.inline?.some(u=>(l=u.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let u=n.at(-1);l.type==="text"&&u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,r,a)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let c=e;if(this.options.extensions?.startInline){let u=1/0,d=e.slice(1),f;this.options.extensions.startInline.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=e.substring(0,u+1))}if(l=this.tokenizer.inlineText(c)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),o=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=l.raw,u.text+=l.text):n.push(l);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return n}},Cf=class{options;parser;constructor(e){this.options=e||Vo}space(e){return""}code({text:e,lang:n,escaped:r}){let i=(n||"").match($n.notSpaceStart)?.[0],s=e.replace($n.endingNewline,"")+` `;return i?'
'+(r?s:Fi(s,!0))+`
`:"
"+(r?s:Fi(s,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){let n=e.ordered,r=e.start,i="";for(let a=0;a `+i+" `}listitem(e){return`
  • ${this.parser.parse(e.tokens)}
  • `}checkbox({checked:e}){return" '}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let n="",r="";for(let s=0;s${i}`),` `+n+` `+i+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${Fi(e,!0)}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:n,tokens:r}){let i=this.parser.parseInline(r),s=L4(e);if(s===null)return i;e=s;let o='
    ",o}image({href:e,title:n,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let s=L4(e);if(s===null)return Fi(r);e=s;let o=`${r}{let a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:n.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=n[s.level];o?o.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),r.renderer){let s=this.defaults.renderer||new Cf(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d||""}}i.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new _f(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],c=s[a];s[a]=(...u)=>{let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}i.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new Ql;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],c=s[a];Ql.passThroughHooks.has(o)?s[a]=u=>{if(this.defaults.async&&Ql.passThroughHooksRespectAsync.has(o))return(async()=>{let f=await l.call(s,u);return c.call(s,f)})();let d=l.call(s,u);return c.call(s,d)}:s[a]=(...u)=>{if(this.defaults.async)return(async()=>{let f=await l.apply(s,u);return f===!1&&(f=await c.apply(s,u)),f})();let d=l.apply(s,u);return d===!1&&(d=c.apply(s,u)),d}}i.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return jr.lex(e,n??this.defaults)}parser(e,n){return Ur.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let i={...r},s={...this.defaults,...i},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(n):n,l=await(s.hooks?await s.hooks.provideLexer():e?jr.lex:jr.lexInline)(a,s),c=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser():e?Ur.parse:Ur.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=(s.hooks?s.hooks.provideLexer():e?jr.lex:jr.lexInline)(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let l=(s.hooks?s.hooks.provideParser():e?Ur.parse:Ur.parseInline)(a,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(e,n){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,e){let i="

    An error occurred:

    "+Fi(r.message+"",!0)+"
    ";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}}},Co=new eN;function wt(t,e){return Co.parse(t,e)}wt.options=wt.setOptions=function(t){return Co.setOptions(t),wt.defaults=Co.defaults,U8(wt.defaults),wt};wt.getDefaults=$y;wt.defaults=Vo;wt.use=function(...t){return Co.use(...t),wt.defaults=Co.defaults,U8(wt.defaults),wt};wt.walkTokens=function(t,e){return Co.walkTokens(t,e)};wt.parseInline=Co.parseInline;wt.Parser=Ur;wt.parser=Ur.parse;wt.Renderer=Cf;wt.TextRenderer=Uy;wt.Lexer=jr;wt.lexer=jr.lex;wt.Tokenizer=_f;wt.Hooks=Ql;wt.parse=wt;wt.options;wt.setOptions;wt.use;wt.walkTokens;wt.parseInline;Ur.parse;jr.lex;class Wn{constructor(e,n,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=n,this.end=r}static range(e,n){return n?!e||!e.loc||!n.loc||e.loc.lexer!==n.loc.lexer?null:new Wn(e.loc.lexer,e.loc.start,n.loc.end):e&&e.loc}}class cr{constructor(e,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=n}range(e,n){return new cr(n,Wn.range(this,e))}}class he{constructor(e,n){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var r="KaTeX parse error: "+e,i,s,o=n&&n.loc;if(o&&o.start<=o.end){var a=o.lexer.input;i=o.start,s=o.end,i===a.length?r+=" at end of input: ":r+=" at position "+(i+1)+": ";var l=a.slice(i,s).replace(/[^]/g,"$&̲"),c;i>15?c="…"+a.slice(i-15,i):c=a.slice(0,i);var u;s+15":">","<":"<",'"':""","'":"'"},sN=/[&><"']/g;function oN(t){return String(t).replace(sN,e=>iN[e])}var nk=function t(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?t(e.body[0]):e:e.type==="font"?t(e.body):e},aN=function(e){var n=nk(e);return n.type==="mathord"||n.type==="textord"||n.type==="atom"},lN=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},cN=function(e){var n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return n?n[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?null:n[1].toLowerCase():"_relative"},dt={deflt:tN,escape:oN,hyphenate:rN,getBaseElem:nk,isCharacterBox:aN,protocolFromUrl:cN},Kd={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:t=>"#"+t},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(t,e)=>(e.push(t),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:t=>Math.max(0,t),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:t=>Math.max(0,t),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:t=>Math.max(0,t),cli:"-e, --max-expand ",cliProcessor:t=>t==="Infinity"?1/0:parseInt(t)},globalGroup:{type:"boolean",cli:!1}};function uN(t){if(t.default)return t.default;var e=t.type,n=Array.isArray(e)?e[0]:e;if(typeof n!="string")return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}let Wy=class{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var n in Kd)if(Kd.hasOwnProperty(n)){var r=Kd[n];this[n]=e[n]!==void 0?r.processor?r.processor(e[n]):e[n]:uN(r)}}reportNonstrict(e,n,r){var i=this.strict;if(typeof i=="function"&&(i=i(e,n,r)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new he("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+e+"]"),r);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]"))}}useStrictBehavior(e,n,r){var i=this.strict;if(typeof i=="function")try{i=i(e,n,r)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+n+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var n=dt.protocolFromUrl(e.url);if(n==null)return!1;e.protocol=n}var r=typeof this.trust=="function"?this.trust(e):this.trust;return!!r}};class vs{constructor(e,n,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=n,this.cramped=r}sup(){return li[dN[this.id]]}sub(){return li[fN[this.id]]}fracNum(){return li[hN[this.id]]}fracDen(){return li[pN[this.id]]}cramp(){return li[mN[this.id]]}text(){return li[gN[this.id]]}isTight(){return this.size>=2}}var Gy=0,Ef=1,La=2,Yi=3,Lc=4,Er=5,Wa=6,Fn=7,li=[new vs(Gy,0,!1),new vs(Ef,0,!0),new vs(La,1,!1),new vs(Yi,1,!0),new vs(Lc,2,!1),new vs(Er,2,!0),new vs(Wa,3,!1),new vs(Fn,3,!0)],dN=[Lc,Er,Lc,Er,Wa,Fn,Wa,Fn],fN=[Er,Er,Er,Er,Fn,Fn,Fn,Fn],hN=[La,Yi,Lc,Er,Wa,Fn,Wa,Fn],pN=[Yi,Yi,Er,Er,Fn,Fn,Fn,Fn],mN=[Ef,Ef,Yi,Yi,Er,Er,Fn,Fn],gN=[Gy,Ef,La,Yi,La,Yi,La,Yi],De={DISPLAY:li[Gy],TEXT:li[La],SCRIPT:li[Lc],SCRIPTSCRIPT:li[Wa]},Sg=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function yN(t){for(var e=0;e=i[0]&&t<=i[1])return n.name}return null}var Zd=[];Sg.forEach(t=>t.blocks.forEach(e=>Zd.push(...e)));function rk(t){for(var e=0;e=Zd[e]&&t<=Zd[e+1])return!0;return!1}var Xo=80,vN=function(e,n){return"M95,"+(622+e+n)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 c69,-144,104.5,-217.7,106.5,-221 l`+e/2.075+" -"+e+` c5.3,-9.3,12,-14,20,-14 H400000v`+(40+e)+`H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z M`+(834+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},bN=function(e,n){return"M263,"+(601+e+n)+`c0.7,0,18,39.7,52,119 c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 c340,-704.7,510.7,-1060.3,512,-1067 l`+e/2.084+" -"+e+` c4.7,-7.3,11,-11,19,-11 H40000v`+(40+e)+`H1012.3 s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},wN=function(e,n){return"M983 "+(10+e+n)+` l`+e/3.13+" -"+e+` c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 c53.7,-170.3,84.5,-266.8,92.5,-289.5z M`+(1001+e)+" "+n+"h400000v"+(40+e)+"h-400000z"},kN=function(e,n){return"M424,"+(2398+e+n)+` c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 v`+(40+e)+`H1014.6 s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+n+` h400000v`+(40+e)+"h-400000z"},xN=function(e,n){return"M473,"+(2713+e+n)+` c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, 606zM`+(1001+e)+" "+n+"h400000v"+(40+e)+"H1017.7z"},SN=function(e){var n=e/2;return"M400000 "+e+" H0 L"+n+" 0 l65 45 L145 "+(e-80)+" H400000z"},_N=function(e,n,r){var i=r-54-n-e;return"M702 "+(e+n)+"H400000"+(40+e)+` H742v`+i+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 219 661 l218 661zM702 `+n+"H400000v"+(40+e)+"H742z"},CN=function(e,n,r){n=1e3*n;var i="";switch(e){case"sqrtMain":i=vN(n,Xo);break;case"sqrtSize1":i=bN(n,Xo);break;case"sqrtSize2":i=wN(n,Xo);break;case"sqrtSize3":i=kN(n,Xo);break;case"sqrtSize4":i=xN(n,Xo);break;case"sqrtTall":i=_N(n,Xo,r)}return i},EN=function(e,n){switch(e){case"⎜":return"M291 0 H417 V"+n+" H291z M291 0 H417 V"+n+" H291z";case"∣":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z";case"∥":return"M145 0 H188 V"+n+" H145z M145 0 H188 V"+n+" H145z"+("M367 0 H410 V"+n+" H367z M367 0 H410 V"+n+" H367z");case"⎟":return"M457 0 H583 V"+n+" H457z M457 0 H583 V"+n+" H457z";case"⎢":return"M319 0 H403 V"+n+" H319z M319 0 H403 V"+n+" H319z";case"⎥":return"M263 0 H347 V"+n+" H263z M263 0 H347 V"+n+" H263z";case"⎪":return"M384 0 H504 V"+n+" H384z M384 0 H504 V"+n+" H384z";case"⏐":return"M312 0 H355 V"+n+" H312z M312 0 H355 V"+n+" H312z";case"‖":return"M257 0 H300 V"+n+" H257z M257 0 H300 V"+n+" H257z"+("M478 0 H521 V"+n+" H478z M478 0 H521 V"+n+" H478z");default:return""}},I4={doubleleftarrow:`M262 157 l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 435 0h399565z`,leftgroupunder:`M400000 262 H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},TN=function(e,n){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 h347 v-84 H403z M403 1759 V0 H319 V1759 v`+n+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15 c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15 c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+` c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class gu{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),n=0;nn.toText();return this.children.map(e).join("")}}var di={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Yu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},O4={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function LN(t,e){di[t]=e}function Ky(t,e,n){if(!di[e])throw new Error("Font metrics not found for font: "+e+".");var r=t.charCodeAt(0),i=di[e][r];if(!i&&t[0]in O4&&(r=O4[t[0]].charCodeAt(0),i=di[e][r]),!i&&n==="text"&&rk(r)&&(i=di[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var fp={};function AN(t){var e;if(t>=5?e=0:t>=3?e=1:e=2,!fp[e]){var n=fp[e]={cssEmPerMu:Yu.quad[e]/18};for(var r in Yu)Yu.hasOwnProperty(r)&&(n[r]=Yu[r][e])}return fp[e]}var MN=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],D4=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],R4=function(e,n){return n.size<2?e:MN[e-1][n.size-1]};class Vi{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||Vi.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=D4[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return new Vi(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:R4(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:D4[e-1]})}havingBaseStyle(e){e=e||this.style.text();var n=R4(Vi.BASESIZE,e);return this.size===n&&this.textSize===Vi.BASESIZE&&this.style===e?this:this.extend({style:e,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Vi.BASESIZE?["sizing","reset-size"+this.size,"size"+Vi.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=AN(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Vi.BASESIZE=6;var _g={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},IN={ex:!0,em:!0,mu:!0},ik=function(e){return typeof e!="string"&&(e=e.unit),e in _g||e in IN||e==="ex"},Pt=function(e,n){var r;if(e.unit in _g)r=_g[e.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(e.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var i;if(n.style.isTight()?i=n.havingStyle(n.style.text()):i=n,e.unit==="ex")r=i.fontMetrics().xHeight;else if(e.unit==="em")r=i.fontMetrics().quad;else throw new he("Invalid unit: '"+e.unit+"'");i!==n&&(r*=i.sizeMultiplier/n.sizeMultiplier)}return Math.min(e.number*r,n.maxSize)},ve=function(e){return+e.toFixed(4)+"em"},zs=function(e){return e.filter(n=>n).join(" ")},sk=function(e,n,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var i=n.getColor();i&&(this.style.color=i)}},ok=function(e){var n=document.createElement(e);n.className=zs(this.classes);for(var r in this.style)this.style.hasOwnProperty(r)&&(n.style[r]=this.style[r]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&n.setAttribute(i,this.attributes[i]);for(var s=0;s/=\x00-\x1f]/,ak=function(e){var n="<"+e;this.classes.length&&(n+=' class="'+dt.escape(zs(this.classes))+'"');var r="";for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=dt.hyphenate(i)+":"+this.style[i]+";");r&&(n+=' style="'+dt.escape(r)+'"');for(var s in this.attributes)if(this.attributes.hasOwnProperty(s)){if(ON.test(s))throw new he("Invalid attribute name '"+s+"'");n+=" "+s+'="'+dt.escape(this.attributes[s])+'"'}n+=">";for(var o=0;o",n};class yu{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,sk.call(this,e,r,i),this.children=n||[]}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return ok.call(this,"span")}toMarkup(){return ak.call(this,"span")}}class Zy{constructor(e,n,r,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,sk.call(this,n,i),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,n){this.attributes[e]=n}hasClass(e){return this.classes.includes(e)}toNode(){return ok.call(this,"a")}toMarkup(){return ak.call(this,"a")}}class DN{constructor(e,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=e,this.classes=["mord"],this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var n in this.style)this.style.hasOwnProperty(n)&&(e.style[n]=this.style[n]);return e}toMarkup(){var e=''+dt.escape(this.alt)+'0&&(n=document.createElement("span"),n.style.marginRight=ve(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=zs(this.classes));for(var r in this.style)this.style.hasOwnProperty(r)&&(n=n||document.createElement("span"),n.style[r]=this.style[r]);return n?(n.appendChild(e),n):e}toMarkup(){var e=!1,n="0&&(r+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(r+=dt.hyphenate(i)+":"+this.style[i]+";");r&&(e=!0,n+=' style="'+dt.escape(r)+'"');var s=dt.escape(this.text);return e?(n+=">",n+=s,n+="",n):s}}class ts{constructor(e,n){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=n||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"svg");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);for(var i=0;i':''}}class Cg{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",n=document.createElementNS(e,"line");for(var r in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,r)&&n.setAttribute(r,this.attributes[r]);return n}toMarkup(){var e=" but got "+String(t)+".")}var NN={bin:1,close:1,inner:1,open:1,punct:1,rel:1},$N={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},It={math:{},text:{}};function b(t,e,n,r,i,s){It[t][i]={font:e,group:n,replace:r},s&&r&&(It[t][r]=It[t][i])}var x="math",oe="text",I="main",z="ams",Ot="accent-token",Ee="bin",Bn="close",ul="inner",Oe="mathord",Xt="op-token",hr="open",z0="punct",q="rel",cs="spacing",K="textord";b(x,I,q,"≡","\\equiv",!0);b(x,I,q,"≺","\\prec",!0);b(x,I,q,"≻","\\succ",!0);b(x,I,q,"∼","\\sim",!0);b(x,I,q,"⊥","\\perp");b(x,I,q,"⪯","\\preceq",!0);b(x,I,q,"⪰","\\succeq",!0);b(x,I,q,"≃","\\simeq",!0);b(x,I,q,"∣","\\mid",!0);b(x,I,q,"≪","\\ll",!0);b(x,I,q,"≫","\\gg",!0);b(x,I,q,"≍","\\asymp",!0);b(x,I,q,"∥","\\parallel");b(x,I,q,"⋈","\\bowtie",!0);b(x,I,q,"⌣","\\smile",!0);b(x,I,q,"⊑","\\sqsubseteq",!0);b(x,I,q,"⊒","\\sqsupseteq",!0);b(x,I,q,"≐","\\doteq",!0);b(x,I,q,"⌢","\\frown",!0);b(x,I,q,"∋","\\ni",!0);b(x,I,q,"∝","\\propto",!0);b(x,I,q,"⊢","\\vdash",!0);b(x,I,q,"⊣","\\dashv",!0);b(x,I,q,"∋","\\owns");b(x,I,z0,".","\\ldotp");b(x,I,z0,"⋅","\\cdotp");b(x,I,K,"#","\\#");b(oe,I,K,"#","\\#");b(x,I,K,"&","\\&");b(oe,I,K,"&","\\&");b(x,I,K,"ℵ","\\aleph",!0);b(x,I,K,"∀","\\forall",!0);b(x,I,K,"ℏ","\\hbar",!0);b(x,I,K,"∃","\\exists",!0);b(x,I,K,"∇","\\nabla",!0);b(x,I,K,"♭","\\flat",!0);b(x,I,K,"ℓ","\\ell",!0);b(x,I,K,"♮","\\natural",!0);b(x,I,K,"♣","\\clubsuit",!0);b(x,I,K,"℘","\\wp",!0);b(x,I,K,"♯","\\sharp",!0);b(x,I,K,"♢","\\diamondsuit",!0);b(x,I,K,"ℜ","\\Re",!0);b(x,I,K,"♡","\\heartsuit",!0);b(x,I,K,"ℑ","\\Im",!0);b(x,I,K,"♠","\\spadesuit",!0);b(x,I,K,"§","\\S",!0);b(oe,I,K,"§","\\S");b(x,I,K,"¶","\\P",!0);b(oe,I,K,"¶","\\P");b(x,I,K,"†","\\dag");b(oe,I,K,"†","\\dag");b(oe,I,K,"†","\\textdagger");b(x,I,K,"‡","\\ddag");b(oe,I,K,"‡","\\ddag");b(oe,I,K,"‡","\\textdaggerdbl");b(x,I,Bn,"⎱","\\rmoustache",!0);b(x,I,hr,"⎰","\\lmoustache",!0);b(x,I,Bn,"⟯","\\rgroup",!0);b(x,I,hr,"⟮","\\lgroup",!0);b(x,I,Ee,"∓","\\mp",!0);b(x,I,Ee,"⊖","\\ominus",!0);b(x,I,Ee,"⊎","\\uplus",!0);b(x,I,Ee,"⊓","\\sqcap",!0);b(x,I,Ee,"∗","\\ast");b(x,I,Ee,"⊔","\\sqcup",!0);b(x,I,Ee,"◯","\\bigcirc",!0);b(x,I,Ee,"∙","\\bullet",!0);b(x,I,Ee,"‡","\\ddagger");b(x,I,Ee,"≀","\\wr",!0);b(x,I,Ee,"⨿","\\amalg");b(x,I,Ee,"&","\\And");b(x,I,q,"⟵","\\longleftarrow",!0);b(x,I,q,"⇐","\\Leftarrow",!0);b(x,I,q,"⟸","\\Longleftarrow",!0);b(x,I,q,"⟶","\\longrightarrow",!0);b(x,I,q,"⇒","\\Rightarrow",!0);b(x,I,q,"⟹","\\Longrightarrow",!0);b(x,I,q,"↔","\\leftrightarrow",!0);b(x,I,q,"⟷","\\longleftrightarrow",!0);b(x,I,q,"⇔","\\Leftrightarrow",!0);b(x,I,q,"⟺","\\Longleftrightarrow",!0);b(x,I,q,"↦","\\mapsto",!0);b(x,I,q,"⟼","\\longmapsto",!0);b(x,I,q,"↗","\\nearrow",!0);b(x,I,q,"↩","\\hookleftarrow",!0);b(x,I,q,"↪","\\hookrightarrow",!0);b(x,I,q,"↘","\\searrow",!0);b(x,I,q,"↼","\\leftharpoonup",!0);b(x,I,q,"⇀","\\rightharpoonup",!0);b(x,I,q,"↙","\\swarrow",!0);b(x,I,q,"↽","\\leftharpoondown",!0);b(x,I,q,"⇁","\\rightharpoondown",!0);b(x,I,q,"↖","\\nwarrow",!0);b(x,I,q,"⇌","\\rightleftharpoons",!0);b(x,z,q,"≮","\\nless",!0);b(x,z,q,"","\\@nleqslant");b(x,z,q,"","\\@nleqq");b(x,z,q,"⪇","\\lneq",!0);b(x,z,q,"≨","\\lneqq",!0);b(x,z,q,"","\\@lvertneqq");b(x,z,q,"⋦","\\lnsim",!0);b(x,z,q,"⪉","\\lnapprox",!0);b(x,z,q,"⊀","\\nprec",!0);b(x,z,q,"⋠","\\npreceq",!0);b(x,z,q,"⋨","\\precnsim",!0);b(x,z,q,"⪹","\\precnapprox",!0);b(x,z,q,"≁","\\nsim",!0);b(x,z,q,"","\\@nshortmid");b(x,z,q,"∤","\\nmid",!0);b(x,z,q,"⊬","\\nvdash",!0);b(x,z,q,"⊭","\\nvDash",!0);b(x,z,q,"⋪","\\ntriangleleft");b(x,z,q,"⋬","\\ntrianglelefteq",!0);b(x,z,q,"⊊","\\subsetneq",!0);b(x,z,q,"","\\@varsubsetneq");b(x,z,q,"⫋","\\subsetneqq",!0);b(x,z,q,"","\\@varsubsetneqq");b(x,z,q,"≯","\\ngtr",!0);b(x,z,q,"","\\@ngeqslant");b(x,z,q,"","\\@ngeqq");b(x,z,q,"⪈","\\gneq",!0);b(x,z,q,"≩","\\gneqq",!0);b(x,z,q,"","\\@gvertneqq");b(x,z,q,"⋧","\\gnsim",!0);b(x,z,q,"⪊","\\gnapprox",!0);b(x,z,q,"⊁","\\nsucc",!0);b(x,z,q,"⋡","\\nsucceq",!0);b(x,z,q,"⋩","\\succnsim",!0);b(x,z,q,"⪺","\\succnapprox",!0);b(x,z,q,"≆","\\ncong",!0);b(x,z,q,"","\\@nshortparallel");b(x,z,q,"∦","\\nparallel",!0);b(x,z,q,"⊯","\\nVDash",!0);b(x,z,q,"⋫","\\ntriangleright");b(x,z,q,"⋭","\\ntrianglerighteq",!0);b(x,z,q,"","\\@nsupseteqq");b(x,z,q,"⊋","\\supsetneq",!0);b(x,z,q,"","\\@varsupsetneq");b(x,z,q,"⫌","\\supsetneqq",!0);b(x,z,q,"","\\@varsupsetneqq");b(x,z,q,"⊮","\\nVdash",!0);b(x,z,q,"⪵","\\precneqq",!0);b(x,z,q,"⪶","\\succneqq",!0);b(x,z,q,"","\\@nsubseteqq");b(x,z,Ee,"⊴","\\unlhd");b(x,z,Ee,"⊵","\\unrhd");b(x,z,q,"↚","\\nleftarrow",!0);b(x,z,q,"↛","\\nrightarrow",!0);b(x,z,q,"⇍","\\nLeftarrow",!0);b(x,z,q,"⇏","\\nRightarrow",!0);b(x,z,q,"↮","\\nleftrightarrow",!0);b(x,z,q,"⇎","\\nLeftrightarrow",!0);b(x,z,q,"△","\\vartriangle");b(x,z,K,"ℏ","\\hslash");b(x,z,K,"▽","\\triangledown");b(x,z,K,"◊","\\lozenge");b(x,z,K,"Ⓢ","\\circledS");b(x,z,K,"®","\\circledR");b(oe,z,K,"®","\\circledR");b(x,z,K,"∡","\\measuredangle",!0);b(x,z,K,"∄","\\nexists");b(x,z,K,"℧","\\mho");b(x,z,K,"Ⅎ","\\Finv",!0);b(x,z,K,"⅁","\\Game",!0);b(x,z,K,"‵","\\backprime");b(x,z,K,"▲","\\blacktriangle");b(x,z,K,"▼","\\blacktriangledown");b(x,z,K,"■","\\blacksquare");b(x,z,K,"⧫","\\blacklozenge");b(x,z,K,"★","\\bigstar");b(x,z,K,"∢","\\sphericalangle",!0);b(x,z,K,"∁","\\complement",!0);b(x,z,K,"ð","\\eth",!0);b(oe,I,K,"ð","ð");b(x,z,K,"╱","\\diagup");b(x,z,K,"╲","\\diagdown");b(x,z,K,"□","\\square");b(x,z,K,"□","\\Box");b(x,z,K,"◊","\\Diamond");b(x,z,K,"¥","\\yen",!0);b(oe,z,K,"¥","\\yen",!0);b(x,z,K,"✓","\\checkmark",!0);b(oe,z,K,"✓","\\checkmark");b(x,z,K,"ℶ","\\beth",!0);b(x,z,K,"ℸ","\\daleth",!0);b(x,z,K,"ℷ","\\gimel",!0);b(x,z,K,"ϝ","\\digamma",!0);b(x,z,K,"ϰ","\\varkappa");b(x,z,hr,"┌","\\@ulcorner",!0);b(x,z,Bn,"┐","\\@urcorner",!0);b(x,z,hr,"└","\\@llcorner",!0);b(x,z,Bn,"┘","\\@lrcorner",!0);b(x,z,q,"≦","\\leqq",!0);b(x,z,q,"⩽","\\leqslant",!0);b(x,z,q,"⪕","\\eqslantless",!0);b(x,z,q,"≲","\\lesssim",!0);b(x,z,q,"⪅","\\lessapprox",!0);b(x,z,q,"≊","\\approxeq",!0);b(x,z,Ee,"⋖","\\lessdot");b(x,z,q,"⋘","\\lll",!0);b(x,z,q,"≶","\\lessgtr",!0);b(x,z,q,"⋚","\\lesseqgtr",!0);b(x,z,q,"⪋","\\lesseqqgtr",!0);b(x,z,q,"≑","\\doteqdot");b(x,z,q,"≓","\\risingdotseq",!0);b(x,z,q,"≒","\\fallingdotseq",!0);b(x,z,q,"∽","\\backsim",!0);b(x,z,q,"⋍","\\backsimeq",!0);b(x,z,q,"⫅","\\subseteqq",!0);b(x,z,q,"⋐","\\Subset",!0);b(x,z,q,"⊏","\\sqsubset",!0);b(x,z,q,"≼","\\preccurlyeq",!0);b(x,z,q,"⋞","\\curlyeqprec",!0);b(x,z,q,"≾","\\precsim",!0);b(x,z,q,"⪷","\\precapprox",!0);b(x,z,q,"⊲","\\vartriangleleft");b(x,z,q,"⊴","\\trianglelefteq");b(x,z,q,"⊨","\\vDash",!0);b(x,z,q,"⊪","\\Vvdash",!0);b(x,z,q,"⌣","\\smallsmile");b(x,z,q,"⌢","\\smallfrown");b(x,z,q,"≏","\\bumpeq",!0);b(x,z,q,"≎","\\Bumpeq",!0);b(x,z,q,"≧","\\geqq",!0);b(x,z,q,"⩾","\\geqslant",!0);b(x,z,q,"⪖","\\eqslantgtr",!0);b(x,z,q,"≳","\\gtrsim",!0);b(x,z,q,"⪆","\\gtrapprox",!0);b(x,z,Ee,"⋗","\\gtrdot");b(x,z,q,"⋙","\\ggg",!0);b(x,z,q,"≷","\\gtrless",!0);b(x,z,q,"⋛","\\gtreqless",!0);b(x,z,q,"⪌","\\gtreqqless",!0);b(x,z,q,"≖","\\eqcirc",!0);b(x,z,q,"≗","\\circeq",!0);b(x,z,q,"≜","\\triangleq",!0);b(x,z,q,"∼","\\thicksim");b(x,z,q,"≈","\\thickapprox");b(x,z,q,"⫆","\\supseteqq",!0);b(x,z,q,"⋑","\\Supset",!0);b(x,z,q,"⊐","\\sqsupset",!0);b(x,z,q,"≽","\\succcurlyeq",!0);b(x,z,q,"⋟","\\curlyeqsucc",!0);b(x,z,q,"≿","\\succsim",!0);b(x,z,q,"⪸","\\succapprox",!0);b(x,z,q,"⊳","\\vartriangleright");b(x,z,q,"⊵","\\trianglerighteq");b(x,z,q,"⊩","\\Vdash",!0);b(x,z,q,"∣","\\shortmid");b(x,z,q,"∥","\\shortparallel");b(x,z,q,"≬","\\between",!0);b(x,z,q,"⋔","\\pitchfork",!0);b(x,z,q,"∝","\\varpropto");b(x,z,q,"◀","\\blacktriangleleft");b(x,z,q,"∴","\\therefore",!0);b(x,z,q,"∍","\\backepsilon");b(x,z,q,"▶","\\blacktriangleright");b(x,z,q,"∵","\\because",!0);b(x,z,q,"⋘","\\llless");b(x,z,q,"⋙","\\gggtr");b(x,z,Ee,"⊲","\\lhd");b(x,z,Ee,"⊳","\\rhd");b(x,z,q,"≂","\\eqsim",!0);b(x,I,q,"⋈","\\Join");b(x,z,q,"≑","\\Doteq",!0);b(x,z,Ee,"∔","\\dotplus",!0);b(x,z,Ee,"∖","\\smallsetminus");b(x,z,Ee,"⋒","\\Cap",!0);b(x,z,Ee,"⋓","\\Cup",!0);b(x,z,Ee,"⩞","\\doublebarwedge",!0);b(x,z,Ee,"⊟","\\boxminus",!0);b(x,z,Ee,"⊞","\\boxplus",!0);b(x,z,Ee,"⋇","\\divideontimes",!0);b(x,z,Ee,"⋉","\\ltimes",!0);b(x,z,Ee,"⋊","\\rtimes",!0);b(x,z,Ee,"⋋","\\leftthreetimes",!0);b(x,z,Ee,"⋌","\\rightthreetimes",!0);b(x,z,Ee,"⋏","\\curlywedge",!0);b(x,z,Ee,"⋎","\\curlyvee",!0);b(x,z,Ee,"⊝","\\circleddash",!0);b(x,z,Ee,"⊛","\\circledast",!0);b(x,z,Ee,"⋅","\\centerdot");b(x,z,Ee,"⊺","\\intercal",!0);b(x,z,Ee,"⋒","\\doublecap");b(x,z,Ee,"⋓","\\doublecup");b(x,z,Ee,"⊠","\\boxtimes",!0);b(x,z,q,"⇢","\\dashrightarrow",!0);b(x,z,q,"⇠","\\dashleftarrow",!0);b(x,z,q,"⇇","\\leftleftarrows",!0);b(x,z,q,"⇆","\\leftrightarrows",!0);b(x,z,q,"⇚","\\Lleftarrow",!0);b(x,z,q,"↞","\\twoheadleftarrow",!0);b(x,z,q,"↢","\\leftarrowtail",!0);b(x,z,q,"↫","\\looparrowleft",!0);b(x,z,q,"⇋","\\leftrightharpoons",!0);b(x,z,q,"↶","\\curvearrowleft",!0);b(x,z,q,"↺","\\circlearrowleft",!0);b(x,z,q,"↰","\\Lsh",!0);b(x,z,q,"⇈","\\upuparrows",!0);b(x,z,q,"↿","\\upharpoonleft",!0);b(x,z,q,"⇃","\\downharpoonleft",!0);b(x,I,q,"⊶","\\origof",!0);b(x,I,q,"⊷","\\imageof",!0);b(x,z,q,"⊸","\\multimap",!0);b(x,z,q,"↭","\\leftrightsquigarrow",!0);b(x,z,q,"⇉","\\rightrightarrows",!0);b(x,z,q,"⇄","\\rightleftarrows",!0);b(x,z,q,"↠","\\twoheadrightarrow",!0);b(x,z,q,"↣","\\rightarrowtail",!0);b(x,z,q,"↬","\\looparrowright",!0);b(x,z,q,"↷","\\curvearrowright",!0);b(x,z,q,"↻","\\circlearrowright",!0);b(x,z,q,"↱","\\Rsh",!0);b(x,z,q,"⇊","\\downdownarrows",!0);b(x,z,q,"↾","\\upharpoonright",!0);b(x,z,q,"⇂","\\downharpoonright",!0);b(x,z,q,"⇝","\\rightsquigarrow",!0);b(x,z,q,"⇝","\\leadsto");b(x,z,q,"⇛","\\Rrightarrow",!0);b(x,z,q,"↾","\\restriction");b(x,I,K,"‘","`");b(x,I,K,"$","\\$");b(oe,I,K,"$","\\$");b(oe,I,K,"$","\\textdollar");b(x,I,K,"%","\\%");b(oe,I,K,"%","\\%");b(x,I,K,"_","\\_");b(oe,I,K,"_","\\_");b(oe,I,K,"_","\\textunderscore");b(x,I,K,"∠","\\angle",!0);b(x,I,K,"∞","\\infty",!0);b(x,I,K,"′","\\prime");b(x,I,K,"△","\\triangle");b(x,I,K,"Γ","\\Gamma",!0);b(x,I,K,"Δ","\\Delta",!0);b(x,I,K,"Θ","\\Theta",!0);b(x,I,K,"Λ","\\Lambda",!0);b(x,I,K,"Ξ","\\Xi",!0);b(x,I,K,"Π","\\Pi",!0);b(x,I,K,"Σ","\\Sigma",!0);b(x,I,K,"Υ","\\Upsilon",!0);b(x,I,K,"Φ","\\Phi",!0);b(x,I,K,"Ψ","\\Psi",!0);b(x,I,K,"Ω","\\Omega",!0);b(x,I,K,"A","Α");b(x,I,K,"B","Β");b(x,I,K,"E","Ε");b(x,I,K,"Z","Ζ");b(x,I,K,"H","Η");b(x,I,K,"I","Ι");b(x,I,K,"K","Κ");b(x,I,K,"M","Μ");b(x,I,K,"N","Ν");b(x,I,K,"O","Ο");b(x,I,K,"P","Ρ");b(x,I,K,"T","Τ");b(x,I,K,"X","Χ");b(x,I,K,"¬","\\neg",!0);b(x,I,K,"¬","\\lnot");b(x,I,K,"⊤","\\top");b(x,I,K,"⊥","\\bot");b(x,I,K,"∅","\\emptyset");b(x,z,K,"∅","\\varnothing");b(x,I,Oe,"α","\\alpha",!0);b(x,I,Oe,"β","\\beta",!0);b(x,I,Oe,"γ","\\gamma",!0);b(x,I,Oe,"δ","\\delta",!0);b(x,I,Oe,"ϵ","\\epsilon",!0);b(x,I,Oe,"ζ","\\zeta",!0);b(x,I,Oe,"η","\\eta",!0);b(x,I,Oe,"θ","\\theta",!0);b(x,I,Oe,"ι","\\iota",!0);b(x,I,Oe,"κ","\\kappa",!0);b(x,I,Oe,"λ","\\lambda",!0);b(x,I,Oe,"μ","\\mu",!0);b(x,I,Oe,"ν","\\nu",!0);b(x,I,Oe,"ξ","\\xi",!0);b(x,I,Oe,"ο","\\omicron",!0);b(x,I,Oe,"π","\\pi",!0);b(x,I,Oe,"ρ","\\rho",!0);b(x,I,Oe,"σ","\\sigma",!0);b(x,I,Oe,"τ","\\tau",!0);b(x,I,Oe,"υ","\\upsilon",!0);b(x,I,Oe,"ϕ","\\phi",!0);b(x,I,Oe,"χ","\\chi",!0);b(x,I,Oe,"ψ","\\psi",!0);b(x,I,Oe,"ω","\\omega",!0);b(x,I,Oe,"ε","\\varepsilon",!0);b(x,I,Oe,"ϑ","\\vartheta",!0);b(x,I,Oe,"ϖ","\\varpi",!0);b(x,I,Oe,"ϱ","\\varrho",!0);b(x,I,Oe,"ς","\\varsigma",!0);b(x,I,Oe,"φ","\\varphi",!0);b(x,I,Ee,"∗","*",!0);b(x,I,Ee,"+","+");b(x,I,Ee,"−","-",!0);b(x,I,Ee,"⋅","\\cdot",!0);b(x,I,Ee,"∘","\\circ",!0);b(x,I,Ee,"÷","\\div",!0);b(x,I,Ee,"±","\\pm",!0);b(x,I,Ee,"×","\\times",!0);b(x,I,Ee,"∩","\\cap",!0);b(x,I,Ee,"∪","\\cup",!0);b(x,I,Ee,"∖","\\setminus",!0);b(x,I,Ee,"∧","\\land");b(x,I,Ee,"∨","\\lor");b(x,I,Ee,"∧","\\wedge",!0);b(x,I,Ee,"∨","\\vee",!0);b(x,I,K,"√","\\surd");b(x,I,hr,"⟨","\\langle",!0);b(x,I,hr,"∣","\\lvert");b(x,I,hr,"∥","\\lVert");b(x,I,Bn,"?","?");b(x,I,Bn,"!","!");b(x,I,Bn,"⟩","\\rangle",!0);b(x,I,Bn,"∣","\\rvert");b(x,I,Bn,"∥","\\rVert");b(x,I,q,"=","=");b(x,I,q,":",":");b(x,I,q,"≈","\\approx",!0);b(x,I,q,"≅","\\cong",!0);b(x,I,q,"≥","\\ge");b(x,I,q,"≥","\\geq",!0);b(x,I,q,"←","\\gets");b(x,I,q,">","\\gt",!0);b(x,I,q,"∈","\\in",!0);b(x,I,q,"","\\@not");b(x,I,q,"⊂","\\subset",!0);b(x,I,q,"⊃","\\supset",!0);b(x,I,q,"⊆","\\subseteq",!0);b(x,I,q,"⊇","\\supseteq",!0);b(x,z,q,"⊈","\\nsubseteq",!0);b(x,z,q,"⊉","\\nsupseteq",!0);b(x,I,q,"⊨","\\models");b(x,I,q,"←","\\leftarrow",!0);b(x,I,q,"≤","\\le");b(x,I,q,"≤","\\leq",!0);b(x,I,q,"<","\\lt",!0);b(x,I,q,"→","\\rightarrow",!0);b(x,I,q,"→","\\to");b(x,z,q,"≱","\\ngeq",!0);b(x,z,q,"≰","\\nleq",!0);b(x,I,cs," ","\\ ");b(x,I,cs," ","\\space");b(x,I,cs," ","\\nobreakspace");b(oe,I,cs," ","\\ ");b(oe,I,cs," "," ");b(oe,I,cs," ","\\space");b(oe,I,cs," ","\\nobreakspace");b(x,I,cs,null,"\\nobreak");b(x,I,cs,null,"\\allowbreak");b(x,I,z0,",",",");b(x,I,z0,";",";");b(x,z,Ee,"⊼","\\barwedge",!0);b(x,z,Ee,"⊻","\\veebar",!0);b(x,I,Ee,"⊙","\\odot",!0);b(x,I,Ee,"⊕","\\oplus",!0);b(x,I,Ee,"⊗","\\otimes",!0);b(x,I,K,"∂","\\partial",!0);b(x,I,Ee,"⊘","\\oslash",!0);b(x,z,Ee,"⊚","\\circledcirc",!0);b(x,z,Ee,"⊡","\\boxdot",!0);b(x,I,Ee,"△","\\bigtriangleup");b(x,I,Ee,"▽","\\bigtriangledown");b(x,I,Ee,"†","\\dagger");b(x,I,Ee,"⋄","\\diamond");b(x,I,Ee,"⋆","\\star");b(x,I,Ee,"◃","\\triangleleft");b(x,I,Ee,"▹","\\triangleright");b(x,I,hr,"{","\\{");b(oe,I,K,"{","\\{");b(oe,I,K,"{","\\textbraceleft");b(x,I,Bn,"}","\\}");b(oe,I,K,"}","\\}");b(oe,I,K,"}","\\textbraceright");b(x,I,hr,"{","\\lbrace");b(x,I,Bn,"}","\\rbrace");b(x,I,hr,"[","\\lbrack",!0);b(oe,I,K,"[","\\lbrack",!0);b(x,I,Bn,"]","\\rbrack",!0);b(oe,I,K,"]","\\rbrack",!0);b(x,I,hr,"(","\\lparen",!0);b(x,I,Bn,")","\\rparen",!0);b(oe,I,K,"<","\\textless",!0);b(oe,I,K,">","\\textgreater",!0);b(x,I,hr,"⌊","\\lfloor",!0);b(x,I,Bn,"⌋","\\rfloor",!0);b(x,I,hr,"⌈","\\lceil",!0);b(x,I,Bn,"⌉","\\rceil",!0);b(x,I,K,"\\","\\backslash");b(x,I,K,"∣","|");b(x,I,K,"∣","\\vert");b(oe,I,K,"|","\\textbar",!0);b(x,I,K,"∥","\\|");b(x,I,K,"∥","\\Vert");b(oe,I,K,"∥","\\textbardbl");b(oe,I,K,"~","\\textasciitilde");b(oe,I,K,"\\","\\textbackslash");b(oe,I,K,"^","\\textasciicircum");b(x,I,q,"↑","\\uparrow",!0);b(x,I,q,"⇑","\\Uparrow",!0);b(x,I,q,"↓","\\downarrow",!0);b(x,I,q,"⇓","\\Downarrow",!0);b(x,I,q,"↕","\\updownarrow",!0);b(x,I,q,"⇕","\\Updownarrow",!0);b(x,I,Xt,"∐","\\coprod");b(x,I,Xt,"⋁","\\bigvee");b(x,I,Xt,"⋀","\\bigwedge");b(x,I,Xt,"⨄","\\biguplus");b(x,I,Xt,"⋂","\\bigcap");b(x,I,Xt,"⋃","\\bigcup");b(x,I,Xt,"∫","\\int");b(x,I,Xt,"∫","\\intop");b(x,I,Xt,"∬","\\iint");b(x,I,Xt,"∭","\\iiint");b(x,I,Xt,"∏","\\prod");b(x,I,Xt,"∑","\\sum");b(x,I,Xt,"⨂","\\bigotimes");b(x,I,Xt,"⨁","\\bigoplus");b(x,I,Xt,"⨀","\\bigodot");b(x,I,Xt,"∮","\\oint");b(x,I,Xt,"∯","\\oiint");b(x,I,Xt,"∰","\\oiiint");b(x,I,Xt,"⨆","\\bigsqcup");b(x,I,Xt,"∫","\\smallint");b(oe,I,ul,"…","\\textellipsis");b(x,I,ul,"…","\\mathellipsis");b(oe,I,ul,"…","\\ldots",!0);b(x,I,ul,"…","\\ldots",!0);b(x,I,ul,"⋯","\\@cdots",!0);b(x,I,ul,"⋱","\\ddots",!0);b(x,I,K,"⋮","\\varvdots");b(oe,I,K,"⋮","\\varvdots");b(x,I,Ot,"ˊ","\\acute");b(x,I,Ot,"ˋ","\\grave");b(x,I,Ot,"¨","\\ddot");b(x,I,Ot,"~","\\tilde");b(x,I,Ot,"ˉ","\\bar");b(x,I,Ot,"˘","\\breve");b(x,I,Ot,"ˇ","\\check");b(x,I,Ot,"^","\\hat");b(x,I,Ot,"⃗","\\vec");b(x,I,Ot,"˙","\\dot");b(x,I,Ot,"˚","\\mathring");b(x,I,Oe,"","\\@imath");b(x,I,Oe,"","\\@jmath");b(x,I,K,"ı","ı");b(x,I,K,"ȷ","ȷ");b(oe,I,K,"ı","\\i",!0);b(oe,I,K,"ȷ","\\j",!0);b(oe,I,K,"ß","\\ss",!0);b(oe,I,K,"æ","\\ae",!0);b(oe,I,K,"œ","\\oe",!0);b(oe,I,K,"ø","\\o",!0);b(oe,I,K,"Æ","\\AE",!0);b(oe,I,K,"Œ","\\OE",!0);b(oe,I,K,"Ø","\\O",!0);b(oe,I,Ot,"ˊ","\\'");b(oe,I,Ot,"ˋ","\\`");b(oe,I,Ot,"ˆ","\\^");b(oe,I,Ot,"˜","\\~");b(oe,I,Ot,"ˉ","\\=");b(oe,I,Ot,"˘","\\u");b(oe,I,Ot,"˙","\\.");b(oe,I,Ot,"¸","\\c");b(oe,I,Ot,"˚","\\r");b(oe,I,Ot,"ˇ","\\v");b(oe,I,Ot,"¨",'\\"');b(oe,I,Ot,"˝","\\H");b(oe,I,Ot,"◯","\\textcircled");var lk={"--":!0,"---":!0,"``":!0,"''":!0};b(oe,I,K,"–","--",!0);b(oe,I,K,"–","\\textendash");b(oe,I,K,"—","---",!0);b(oe,I,K,"—","\\textemdash");b(oe,I,K,"‘","`",!0);b(oe,I,K,"‘","\\textquoteleft");b(oe,I,K,"’","'",!0);b(oe,I,K,"’","\\textquoteright");b(oe,I,K,"“","``",!0);b(oe,I,K,"“","\\textquotedblleft");b(oe,I,K,"”","''",!0);b(oe,I,K,"”","\\textquotedblright");b(x,I,K,"°","\\degree",!0);b(oe,I,K,"°","\\degree");b(oe,I,K,"°","\\textdegree",!0);b(x,I,K,"£","\\pounds");b(x,I,K,"£","\\mathsterling",!0);b(oe,I,K,"£","\\pounds");b(oe,I,K,"£","\\textsterling",!0);b(x,z,K,"✠","\\maltese");b(oe,z,K,"✠","\\maltese");var N4='0123456789/@."';for(var hp=0;hp0)return qr(s,c,i,n,o.concat(u));if(l){var d,f;if(l==="boldsymbol"){var h=VN(s,i,n,o,r);d=h.fontName,f=[h.fontClass]}else a?(d=dk[l].fontName,f=[l]):(d=ed(l,n.fontWeight,n.fontShape),f=[l,n.fontWeight,n.fontShape]);if(B0(s,d,i).metrics)return qr(s,d,i,n,o.concat(f));if(lk.hasOwnProperty(s)&&d.slice(0,10)==="Typewriter"){for(var p=[],m=0;m{if(zs(t.classes)!==zs(e.classes)||t.skew!==e.skew||t.maxFontSize!==e.maxFontSize)return!1;if(t.classes.length===1){var n=t.classes[0];if(n==="mbin"||n==="mord")return!1}for(var r in t.style)if(t.style.hasOwnProperty(r)&&t.style[r]!==e.style[r])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&t.style[i]!==e.style[i])return!1;return!0},qN=t=>{for(var e=0;en&&(n=o.height),o.depth>r&&(r=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=n,e.depth=r,e.maxFontSize=i},qn=function(e,n,r,i){var s=new yu(e,n,r,i);return Yy(s),s},ck=(t,e,n,r)=>new yu(t,e,n,r),jN=function(e,n,r){var i=qn([e],[],n);return i.height=Math.max(r||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),i.style.borderBottomWidth=ve(i.height),i.maxFontSize=1,i},UN=function(e,n,r,i){var s=new Zy(e,n,r,i);return Yy(s),s},uk=function(e){var n=new gu(e);return Yy(n),n},WN=function(e,n){return e instanceof gu?qn([],[e],n):e},GN=function(e){if(e.positionType==="individualShift"){for(var n=e.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,s=i,o=1;o{var n=qn(["mspace"],[],e),r=Pt(t,e);return n.style.marginRight=ve(r),n},ed=function(e,n,r){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return n==="textbf"&&r==="textit"?s="BoldItalic":n==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",i+"-"+s},dk={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},fk={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},YN=function(e,n){var[r,i,s]=fk[e],o=new Bs(r),a=new ts([o],{width:ve(i),height:ve(s),style:"width:"+ve(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),l=ck(["overlay"],[a],n);return l.height=s,l.style.height=ve(s),l.style.width=ve(i),l},X={fontMap:dk,makeSymbol:qr,mathsym:HN,makeSpan:qn,makeSvgSpan:ck,makeLineSpan:jN,makeAnchor:UN,makeFragment:uk,wrapFragment:WN,makeVList:KN,makeOrd:zN,makeGlue:ZN,staticSvg:YN,svgData:fk,tryCombineChars:qN},Dt={number:3,unit:"mu"},no={number:4,unit:"mu"},Ii={number:5,unit:"mu"},QN={mord:{mop:Dt,mbin:no,mrel:Ii,minner:Dt},mop:{mord:Dt,mop:Dt,mrel:Ii,minner:Dt},mbin:{mord:no,mop:no,mopen:no,minner:no},mrel:{mord:Ii,mop:Ii,mopen:Ii,minner:Ii},mopen:{},mclose:{mop:Dt,mbin:no,mrel:Ii,minner:Dt},mpunct:{mord:Dt,mop:Dt,mrel:Ii,mopen:Dt,mclose:Dt,mpunct:Dt,minner:Dt},minner:{mord:Dt,mop:Dt,mbin:no,mrel:Ii,mopen:Dt,mpunct:Dt,minner:Dt}},XN={mord:{mop:Dt},mop:{mord:Dt,mop:Dt},mbin:{},mrel:{},mopen:{},mclose:{mop:Dt},mpunct:{},minner:{mop:Dt}},hk={},Lf={},Af={};function _e(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},l=0;l{var g=m.classes[0],y=p.classes[0];g==="mbin"&&e$.includes(y)?m.classes[0]="mord":y==="mbin"&&JN.includes(g)&&(p.classes[0]="mord")},{node:d},f,h),z4(s,(p,m)=>{var g=Tg(m),y=Tg(p),v=g&&y?p.hasClass("mtight")?XN[g][y]:QN[g][y]:null;if(v)return X.makeGlue(v,c)},{node:d},f,h),s},z4=function t(e,n,r,i,s){i&&e.push(i);for(var o=0;of=>{e.splice(d+1,0,f),o++})(o)}i&&e.pop()},pk=function(e){return e instanceof gu||e instanceof Zy||e instanceof yu&&e.hasClass("enclosing")?e:null},r$=function t(e,n){var r=pk(e);if(r){var i=r.children;if(i.length){if(n==="right")return t(i[i.length-1],"right");if(n==="left")return t(i[0],"left")}}return e},Tg=function(e,n){return e?(n&&(e=r$(e,n)),n$[e.classes[0]]||null):null},Ac=function(e,n){var r=["nulldelimiter"].concat(e.baseSizingClasses());return ns(n.concat(r))},ct=function(e,n,r){if(!e)return ns();if(Lf[e.type]){var i=Lf[e.type](e,n);if(r&&n.size!==r.size){i=ns(n.sizingClasses(r),[i],n);var s=n.sizeMultiplier/r.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new he("Got group of unknown type: '"+e.type+"'")};function td(t,e){var n=ns(["base"],t,e),r=ns(["strut"]);return r.style.height=ve(n.height+n.depth),n.depth&&(r.style.verticalAlign=ve(-n.depth)),n.children.unshift(r),n}function Lg(t,e){var n=null;t.length===1&&t[0].type==="tag"&&(n=t[0].tag,t=t[0].body);var r=an(t,e,"root"),i;r.length===2&&r[1].hasClass("tag")&&(i=r.pop());for(var s=[],o=[],a=0;a0&&(s.push(td(o,e)),o=[]),s.push(r[a]));o.length>0&&s.push(td(o,e));var c;n?(c=td(an(n,e,!0)),c.classes=["tag"],s.push(c)):i&&s.push(i);var u=ns(["katex-html"],s);if(u.setAttribute("aria-hidden","true"),c){var d=c.children[0];d.style.height=ve(u.height+u.depth),u.depth&&(d.style.verticalAlign=ve(-u.depth))}return u}function mk(t){return new gu(t)}class sr{constructor(e,n,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=n||[],this.classes=r||[]}setAttribute(e,n){this.attributes[e]=n}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&e.setAttribute(n,this.attributes[n]);this.classes.length>0&&(e.className=zs(this.classes));for(var r=0;r0&&(e+=' class ="'+dt.escape(zs(this.classes))+'"'),e+=">";for(var r=0;r",e}toText(){return this.children.map(e=>e.toText()).join("")}}class fi{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return dt.escape(this.toText())}toText(){return this.text}}class i${constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",ve(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var ce={MathNode:sr,TextNode:fi,SpaceNode:i$,newDocumentFragment:mk},Rr=function(e,n,r){return It[n][e]&&It[n][e].replace&&e.charCodeAt(0)!==55349&&!(lk.hasOwnProperty(e)&&r&&(r.fontFamily&&r.fontFamily.slice(4,6)==="tt"||r.font&&r.font.slice(4,6)==="tt"))&&(e=It[n][e].replace),new ce.TextNode(e)},Qy=function(e){return e.length===1?e[0]:new ce.MathNode("mrow",e)},Xy=function(e,n){if(n.fontFamily==="texttt")return"monospace";if(n.fontFamily==="textsf")return n.fontShape==="textit"&&n.fontWeight==="textbf"?"sans-serif-bold-italic":n.fontShape==="textit"?"sans-serif-italic":n.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(n.fontShape==="textit"&&n.fontWeight==="textbf")return"bold-italic";if(n.fontShape==="textit")return"italic";if(n.fontWeight==="textbf")return"bold";var r=n.font;if(!r||r==="mathnormal")return null;var i=e.mode;if(r==="mathit")return"italic";if(r==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(r==="mathbf")return"bold";if(r==="mathbb")return"double-struck";if(r==="mathsfit")return"sans-serif-italic";if(r==="mathfrak")return"fraktur";if(r==="mathscr"||r==="mathcal")return"script";if(r==="mathsf")return"sans-serif";if(r==="mathtt")return"monospace";var s=e.text;if(["\\imath","\\jmath"].includes(s))return null;It[i][s]&&It[i][s].replace&&(s=It[i][s].replace);var o=X.fontMap[r].fontName;return Ky(s,o,i)?X.fontMap[r].variant:null};function yp(t){if(!t)return!1;if(t.type==="mi"&&t.children.length===1){var e=t.children[0];return e instanceof fi&&e.text==="."}else if(t.type==="mo"&&t.children.length===1&&t.getAttribute("separator")==="true"&&t.getAttribute("lspace")==="0em"&&t.getAttribute("rspace")==="0em"){var n=t.children[0];return n instanceof fi&&n.text===","}else return!1}var Kn=function(e,n,r){if(e.length===1){var i=Lt(e[0],n);return r&&i instanceof sr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,a=0;a=1&&(o.type==="mn"||yp(o))){var c=l.children[0];c instanceof sr&&c.type==="mn"&&(c.children=[...o.children,...c.children],s.pop())}else if(o.type==="mi"&&o.children.length===1){var u=o.children[0];if(u instanceof fi&&u.text==="̸"&&(l.type==="mo"||l.type==="mi"||l.type==="mn")){var d=l.children[0];d instanceof fi&&d.text.length>0&&(d.text=d.text.slice(0,1)+"̸"+d.text.slice(1),s.pop())}}}s.push(l),o=l}return s},qs=function(e,n,r){return Qy(Kn(e,n,r))},Lt=function(e,n){if(!e)return new ce.MathNode("mrow");if(Af[e.type]){var r=Af[e.type](e,n);return r}else throw new he("Got group of unknown type: '"+e.type+"'")};function B4(t,e,n,r,i){var s=Kn(t,n),o;s.length===1&&s[0]instanceof sr&&["mrow","mtable"].includes(s[0].type)?o=s[0]:o=new ce.MathNode("mrow",s);var a=new ce.MathNode("annotation",[new ce.TextNode(e)]);a.setAttribute("encoding","application/x-tex");var l=new ce.MathNode("semantics",[o,a]),c=new ce.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=i?"katex":"katex-mathml";return X.makeSpan([u],[c])}var gk=function(e){return new Vi({style:e.displayMode?De.DISPLAY:De.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},yk=function(e,n){if(n.displayMode){var r=["katex-display"];n.leqno&&r.push("leqno"),n.fleqn&&r.push("fleqn"),e=X.makeSpan(r,[e])}return e},s$=function(e,n,r){var i=gk(r),s;if(r.output==="mathml")return B4(e,n,i,r.displayMode,!0);if(r.output==="html"){var o=Lg(e,i);s=X.makeSpan(["katex"],[o])}else{var a=B4(e,n,i,r.displayMode,!1),l=Lg(e,i);s=X.makeSpan(["katex"],[a,l])}return yk(s,r)},o$=function(e,n,r){var i=gk(r),s=Lg(e,i),o=X.makeSpan(["katex"],[s]);return yk(o,r)},a$={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},l$=function(e){var n=new ce.MathNode("mo",[new ce.TextNode(a$[e.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},c$={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},u$=function(e){return e.type==="ordgroup"?e.body.length:1},d$=function(e,n){function r(){var a=4e5,l=e.label.slice(1);if(["widehat","widecheck","widetilde","utilde"].includes(l)){var c=e,u=u$(c.base),d,f,h;if(u>5)l==="widehat"||l==="widecheck"?(d=420,a=2364,h=.42,f=l+"4"):(d=312,a=2340,h=.34,f="tilde4");else{var p=[1,1,2,2,3,3][u];l==="widehat"||l==="widecheck"?(a=[0,1062,2364,2364,2364][p],d=[0,239,300,360,420][p],h=[0,.24,.3,.3,.36,.42][p],f=l+p):(a=[0,600,1033,2339,2340][p],d=[0,260,286,306,312][p],h=[0,.26,.286,.3,.306,.34][p],f="tilde"+p)}var m=new Bs(f),g=new ts([m],{width:"100%",height:ve(h),viewBox:"0 0 "+a+" "+d,preserveAspectRatio:"none"});return{span:X.makeSvgSpan([],[g],n),minWidth:0,height:h}}else{var y=[],v=c$[l],[w,_,k]=v,S=k/1e3,L=w.length,E,C;if(L===1){var V=v[3];E=["hide-tail"],C=[V]}else if(L===2)E=["halfarrow-left","halfarrow-right"],C=["xMinYMin","xMaxYMin"];else if(L===3)E=["brace-left","brace-center","brace-right"],C=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support `+L+" children.");for(var R=0;R0&&(i.style.minWidth=ve(s)),i},f$=function(e,n,r,i,s){var o,a=e.height+e.depth+r+i;if(/fbox|color|angl/.test(n)){if(o=X.makeSpan(["stretchy",n],[],s),n==="fbox"){var l=s.color&&s.getColor();l&&(o.style.borderColor=l)}}else{var c=[];/^[bx]cancel$/.test(n)&&c.push(new Cg({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&c.push(new Cg({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var u=new ts(c,{width:"100%",height:ve(a)});o=X.makeSvgSpan([],[u],s)}return o.height=a,o.style.height=ve(a),o},rs={encloseSpan:f$,mathMLnode:l$,svgSpan:d$};function Je(t,e){if(!t||t.type!==e)throw new Error("Expected node of type "+e+", but got "+(t?"node of type "+t.type:String(t)));return t}function Jy(t){var e=q0(t);if(!e)throw new Error("Expected node of symbol group type, but got "+(t?"node of type "+t.type:String(t)));return e}function q0(t){return t&&(t.type==="atom"||$N.hasOwnProperty(t.type))?t:null}var ev=(t,e)=>{var n,r,i;t&&t.type==="supsub"?(r=Je(t.base,"accent"),n=r.base,t.base=n,i=PN(ct(t,e)),t.base=r):(r=Je(t,"accent"),n=r.base);var s=ct(n,e.havingCrampedStyle()),o=r.isShifty&&dt.isCharacterBox(n),a=0;if(o){var l=dt.getBaseElem(n),c=ct(l,e.havingCrampedStyle());a=P4(c).skew}var u=r.label==="\\c",d=u?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),f;if(r.isStretchy)f=rs.svgSpan(r,e),f=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+ve(2*a)+")",marginLeft:ve(2*a)}:void 0}]},e);else{var h,p;r.label==="\\vec"?(h=X.staticSvg("vec",e),p=X.svgData.vec[1]):(h=X.makeOrd({mode:r.mode,text:r.label},e,"textord"),h=P4(h),h.italic=0,p=h.width,u&&(d+=h.depth)),f=X.makeSpan(["accent-body"],[h]);var m=r.label==="\\textcircled";m&&(f.classes.push("accent-full"),d=s.height);var g=a;m||(g-=p/2),f.style.left=ve(g),r.label==="\\textcircled"&&(f.style.top=".2em"),f=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-d},{type:"elem",elem:f}]},e)}var y=X.makeSpan(["mord","accent"],[f],e);return i?(i.children[0]=y,i.height=Math.max(y.height,i.height),i.classes[0]="mord",i):y},vk=(t,e)=>{var n=t.isStretchy?rs.mathMLnode(t.label):new ce.MathNode("mo",[Rr(t.label,t.mode)]),r=new ce.MathNode("mover",[Lt(t.base,e),n]);return r.setAttribute("accent","true"),r},h$=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(t=>"\\"+t).join("|"));_e({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(t,e)=>{var n=Mf(e[0]),r=!h$.test(t.funcName),i=!r||t.funcName==="\\widehat"||t.funcName==="\\widetilde"||t.funcName==="\\widecheck";return{type:"accent",mode:t.parser.mode,label:t.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:ev,mathmlBuilder:vk});_e({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(t,e)=>{var n=e[0],r=t.parser.mode;return r==="math"&&(t.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+t.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:t.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:ev,mathmlBuilder:vk});_e({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(t,e)=>{var n=ct(t.base,e),r=rs.svgSpan(t,e),i=t.label==="\\utilde"?.12:0,s=X.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]},e);return X.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(t,e)=>{var n=rs.mathMLnode(t.label),r=new ce.MathNode("munder",[Lt(t.base,e),n]);return r.setAttribute("accentunder","true"),r}});var nd=t=>{var e=new ce.MathNode("mpadded",t?[t]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};_e({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r,funcName:i}=t;return{type:"xArrow",mode:r.mode,label:i,body:e[0],below:n[0]}},htmlBuilder(t,e){var n=e.style,r=e.havingStyle(n.sup()),i=X.wrapFragment(ct(t.body,r,e),e),s=t.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;t.below&&(r=e.havingStyle(n.sub()),o=X.wrapFragment(ct(t.below,r,e),e),o.classes.push(s+"-arrow-pad"));var a=rs.svgSpan(t,e),l=-e.fontMetrics().axisHeight+.5*a.height,c=-e.fontMetrics().axisHeight-.5*a.height-.111;(i.depth>.25||t.label==="\\xleftequilibrium")&&(c-=i.depth);var u;if(o){var d=-e.fontMetrics().axisHeight+o.height+.5*a.height+.111;u=X.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l},{type:"elem",elem:o,shift:d}]},e)}else u=X.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:c},{type:"elem",elem:a,shift:l}]},e);return u.children[0].children[0].children[1].classes.push("svg-align"),X.makeSpan(["mrel","x-arrow"],[u],e)},mathmlBuilder(t,e){var n=rs.mathMLnode(t.label);n.setAttribute("minsize",t.label.charAt(0)==="x"?"1.75em":"3.0em");var r;if(t.body){var i=nd(Lt(t.body,e));if(t.below){var s=nd(Lt(t.below,e));r=new ce.MathNode("munderover",[n,s,i])}else r=new ce.MathNode("mover",[n,i])}else if(t.below){var o=nd(Lt(t.below,e));r=new ce.MathNode("munder",[n,o])}else r=nd(),r=new ce.MathNode("mover",[n,r]);return r}});var p$=X.makeSpan;function bk(t,e){var n=an(t.body,e,!0);return p$([t.mclass],n,e)}function wk(t,e){var n,r=Kn(t.body,e);return t.mclass==="minner"?n=new ce.MathNode("mpadded",r):t.mclass==="mord"?t.isCharacterBox?(n=r[0],n.type="mi"):n=new ce.MathNode("mi",r):(t.isCharacterBox?(n=r[0],n.type="mo"):n=new ce.MathNode("mo",r),t.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):t.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):t.mclass==="mopen"||t.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):t.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}_e({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:jt(i),isCharacterBox:dt.isCharacterBox(i)}},htmlBuilder:bk,mathmlBuilder:wk});var j0=t=>{var e=t.type==="ordgroup"&&t.body.length?t.body[0]:t;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};_e({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(t,e){var{parser:n}=t;return{type:"mclass",mode:n.mode,mclass:j0(e[0]),body:jt(e[1]),isCharacterBox:dt.isCharacterBox(e[1])}}});_e({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(t,e){var{parser:n,funcName:r}=t,i=e[1],s=e[0],o;r!=="\\stackrel"?o=j0(i):o="mrel";var a={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!=="\\stackrel",body:jt(i)},l={type:"supsub",mode:s.mode,base:a,sup:r==="\\underset"?null:s,sub:r==="\\underset"?s:null};return{type:"mclass",mode:n.mode,mclass:o,body:[l],isCharacterBox:dt.isCharacterBox(l)}},htmlBuilder:bk,mathmlBuilder:wk});_e({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"pmb",mode:n.mode,mclass:j0(e[0]),body:jt(e[0])}},htmlBuilder(t,e){var n=an(t.body,e,!0),r=X.makeSpan([t.mclass],n,e);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(t,e){var n=Kn(t.body,e),r=new ce.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var m$={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},q4=()=>({type:"styling",body:[],mode:"math",style:"display"}),j4=t=>t.type==="textord"&&t.text==="@",g$=(t,e)=>(t.type==="mathord"||t.type==="atom")&&t.text===e;function y$(t,e,n){var r=m$[t];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=n.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:r,mode:"math",family:"rel"},o=n.callFunction("\\Big",[s],[]),a=n.callFunction("\\\\cdright",[e[1]],[]),l={type:"ordgroup",mode:"math",body:[i,o,a]};return n.callFunction("\\\\cdparent",[l],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var c={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[c],[])}default:return{type:"textord",text:" ",mode:"math"}}}function v$(t){var e=[];for(t.gullet.beginGroup(),t.gullet.macros.set("\\cr","\\\\\\relax"),t.gullet.beginGroup();;){e.push(t.parseExpression(!1,"\\\\")),t.gullet.endGroup(),t.gullet.beginGroup();var n=t.fetch().text;if(n==="&"||n==="\\\\")t.consume();else if(n==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new he("Expected \\\\ or \\cr or \\end",t.nextToken)}for(var r=[],i=[r],s=0;s-1))if("<>AV".indexOf(c)>-1)for(var d=0;d<2;d++){for(var f=!0,h=l+1;hAV=|." after @',o[l]);var p=y$(c,u,t),m={type:"styling",body:[p],mode:"math",style:"display"};r.push(m),a=q4()}s%2===0?r.push(a):r.shift(),r=[],i.push(r)}t.gullet.endGroup(),t.gullet.endGroup();var g=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:g,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}_e({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:e[0]}},htmlBuilder(t,e){var n=e.havingStyle(e.style.sup()),r=X.wrapFragment(ct(t.label,n,e),e);return r.classes.push("cd-label-"+t.side),r.style.bottom=ve(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(t,e){var n=new ce.MathNode("mrow",[Lt(t.label,e)]);return n=new ce.MathNode("mpadded",[n]),n.setAttribute("width","0"),t.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new ce.MathNode("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});_e({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(t,e){var{parser:n}=t;return{type:"cdlabelparent",mode:n.mode,fragment:e[0]}},htmlBuilder(t,e){var n=X.wrapFragment(ct(t.fragment,e),e);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(t,e){return new ce.MathNode("mrow",[Lt(t.fragment,e)])}});_e({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(t,e){for(var{parser:n}=t,r=Je(e[0],"ordgroup"),i=r.body,s="",o=0;o=1114111)throw new he("\\@char with invalid code point "+s);return l<=65535?c=String.fromCharCode(l):(l-=65536,c=String.fromCharCode((l>>10)+55296,(l&1023)+56320)),{type:"textord",mode:n.mode,text:c}}});var kk=(t,e)=>{var n=an(t.body,e.withColor(t.color),!1);return X.makeFragment(n)},xk=(t,e)=>{var n=Kn(t.body,e.withColor(t.color)),r=new ce.MathNode("mstyle",n);return r.setAttribute("mathcolor",t.color),r};_e({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(t,e){var{parser:n}=t,r=Je(e[0],"color-token").color,i=e[1];return{type:"color",mode:n.mode,color:r,body:jt(i)}},htmlBuilder:kk,mathmlBuilder:xk});_e({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(t,e){var{parser:n,breakOnTokenText:r}=t,i=Je(e[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var s=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:s}},htmlBuilder:kk,mathmlBuilder:xk});_e({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(t,e,n){var{parser:r}=t,i=r.gullet.future().text==="["?r.parseSizeGroup(!0):null,s=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:s,size:i&&Je(i,"size").value}},htmlBuilder(t,e){var n=X.makeSpan(["mspace"],[],e);return t.newLine&&(n.classes.push("newline"),t.size&&(n.style.marginTop=ve(Pt(t.size,e)))),n},mathmlBuilder(t,e){var n=new ce.MathNode("mspace");return t.newLine&&(n.setAttribute("linebreak","newline"),t.size&&n.setAttribute("height",ve(Pt(t.size,e)))),n}});var Ag={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Sk=t=>{var e=t.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new he("Expected a control sequence",t);return e},b$=t=>{var e=t.gullet.popToken();return e.text==="="&&(e=t.gullet.popToken(),e.text===" "&&(e=t.gullet.popToken())),e},_k=(t,e,n,r)=>{var i=t.gullet.macros.get(n.text);i==null&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!t.gullet.isExpandable(n.text)}),t.gullet.macros.set(e,i,r)};_e({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(t){var{parser:e,funcName:n}=t;e.consumeSpaces();var r=e.fetch();if(Ag[r.text])return(n==="\\global"||n==="\\\\globallong")&&(r.text=Ag[r.text]),Je(e.parseFunction(),"internal");throw new he("Invalid token after macro prefix",r)}});_e({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=e.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new he("Expected a control sequence",r);for(var s=0,o,a=[[]];e.gullet.future().text!=="{";)if(r=e.gullet.popToken(),r.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),a[s].push("{");break}if(r=e.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new he('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==s+1)throw new he('Argument number "'+r.text+'" out of order');s++,a.push([])}else{if(r.text==="EOF")throw new he("Expected a macro definition");a[s].push(r.text)}var{tokens:l}=e.gullet.consumeArg();return o&&l.unshift(o),(n==="\\edef"||n==="\\xdef")&&(l=e.gullet.expandTokens(l),l.reverse()),e.gullet.macros.set(i,{tokens:l,numArgs:s,delimiters:a},n===Ag[n]),{type:"internal",mode:e.mode}}});_e({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=Sk(e.gullet.popToken());e.gullet.consumeSpaces();var i=b$(e);return _k(e,r,i,n==="\\\\globallet"),{type:"internal",mode:e.mode}}});_e({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t){var{parser:e,funcName:n}=t,r=Sk(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return _k(e,r,s,n==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Xl=function(e,n,r){var i=It.math[e]&&It.math[e].replace,s=Ky(i||e,n,r);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+n+".");return s},tv=function(e,n,r,i){var s=r.havingBaseStyle(n),o=X.makeSpan(i.concat(s.sizingClasses(r)),[e],r),a=s.sizeMultiplier/r.sizeMultiplier;return o.height*=a,o.depth*=a,o.maxFontSize=s.sizeMultiplier,o},Ck=function(e,n,r){var i=n.havingBaseStyle(r),s=(1-n.sizeMultiplier/i.sizeMultiplier)*n.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=ve(s),e.height-=s,e.depth+=s},w$=function(e,n,r,i,s,o){var a=X.makeSymbol(e,"Main-Regular",s,i),l=tv(a,n,i,o);return r&&Ck(l,i,n),l},k$=function(e,n,r,i){return X.makeSymbol(e,"Size"+n+"-Regular",r,i)},Ek=function(e,n,r,i,s,o){var a=k$(e,n,s,i),l=tv(X.makeSpan(["delimsizing","size"+n],[a],i),De.TEXT,i,o);return r&&Ck(l,i,De.TEXT),l},vp=function(e,n,r){var i;n==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=X.makeSpan(["delimsizinginner",i],[X.makeSpan([],[X.makeSymbol(e,n,r)])]);return{type:"elem",elem:s}},bp=function(e,n,r){var i=di["Size4-Regular"][e.charCodeAt(0)]?di["Size4-Regular"][e.charCodeAt(0)][4]:di["Size1-Regular"][e.charCodeAt(0)][4],s=new Bs("inner",EN(e,Math.round(1e3*n))),o=new ts([s],{width:ve(i),height:ve(n),style:"width:"+ve(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),a=X.makeSvgSpan([],[o],r);return a.height=n,a.style.height=ve(n),a.style.width=ve(i),{type:"elem",elem:a}},Mg=.008,rd={type:"kern",size:-1*Mg},x$=["|","\\lvert","\\rvert","\\vert"],S$=["\\|","\\lVert","\\rVert","\\Vert"],Tk=function(e,n,r,i,s,o){var a,l,c,u,d="",f=0;a=c=u=e,l=null;var h="Size1-Regular";e==="\\uparrow"?c=u="⏐":e==="\\Uparrow"?c=u="‖":e==="\\downarrow"?a=c="⏐":e==="\\Downarrow"?a=c="‖":e==="\\updownarrow"?(a="\\uparrow",c="⏐",u="\\downarrow"):e==="\\Updownarrow"?(a="\\Uparrow",c="‖",u="\\Downarrow"):x$.includes(e)?(c="∣",d="vert",f=333):S$.includes(e)?(c="∥",d="doublevert",f=556):e==="["||e==="\\lbrack"?(a="⎡",c="⎢",u="⎣",h="Size4-Regular",d="lbrack",f=667):e==="]"||e==="\\rbrack"?(a="⎤",c="⎥",u="⎦",h="Size4-Regular",d="rbrack",f=667):e==="\\lfloor"||e==="⌊"?(c=a="⎢",u="⎣",h="Size4-Regular",d="lfloor",f=667):e==="\\lceil"||e==="⌈"?(a="⎡",c=u="⎢",h="Size4-Regular",d="lceil",f=667):e==="\\rfloor"||e==="⌋"?(c=a="⎥",u="⎦",h="Size4-Regular",d="rfloor",f=667):e==="\\rceil"||e==="⌉"?(a="⎤",c=u="⎥",h="Size4-Regular",d="rceil",f=667):e==="("||e==="\\lparen"?(a="⎛",c="⎜",u="⎝",h="Size4-Regular",d="lparen",f=875):e===")"||e==="\\rparen"?(a="⎞",c="⎟",u="⎠",h="Size4-Regular",d="rparen",f=875):e==="\\{"||e==="\\lbrace"?(a="⎧",l="⎨",u="⎩",c="⎪",h="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(a="⎫",l="⎬",u="⎭",c="⎪",h="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(a="⎧",u="⎩",c="⎪",h="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(a="⎫",u="⎭",c="⎪",h="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(a="⎧",u="⎭",c="⎪",h="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(a="⎫",u="⎩",c="⎪",h="Size4-Regular");var p=Xl(a,h,s),m=p.height+p.depth,g=Xl(c,h,s),y=g.height+g.depth,v=Xl(u,h,s),w=v.height+v.depth,_=0,k=1;if(l!==null){var S=Xl(l,h,s);_=S.height+S.depth,k=2}var L=m+w+_,E=Math.max(0,Math.ceil((n-L)/(k*y))),C=L+E*k*y,V=i.fontMetrics().axisHeight;r&&(V*=i.sizeMultiplier);var R=C/2-V,F=[];if(d.length>0){var T=C-m-w,D=Math.round(C*1e3),M=TN(d,Math.round(T*1e3)),$=new Bs(d,M),H=(f/1e3).toFixed(3)+"em",U=(D/1e3).toFixed(3)+"em",j=new ts([$],{width:H,height:U,viewBox:"0 0 "+f+" "+D}),G=X.makeSvgSpan([],[j],i);G.height=D/1e3,G.style.width=H,G.style.height=U,F.push({type:"elem",elem:G})}else{if(F.push(vp(u,h,s)),F.push(rd),l===null){var Z=C-m-w+2*Mg;F.push(bp(c,Z,i))}else{var Q=(C-m-w-_)/2+2*Mg;F.push(bp(c,Q,i)),F.push(rd),F.push(vp(l,h,s)),F.push(rd),F.push(bp(c,Q,i))}F.push(rd),F.push(vp(a,h,s))}var ee=i.havingBaseStyle(De.TEXT),le=X.makeVList({positionType:"bottom",positionData:R,children:F},ee);return tv(X.makeSpan(["delimsizing","mult"],[le],ee),De.TEXT,i,o)},wp=80,kp=.08,xp=function(e,n,r,i,s){var o=CN(e,i,r),a=new Bs(e,o),l=new ts([a],{width:"400em",height:ve(n),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return X.makeSvgSpan(["hide-tail"],[l],s)},_$=function(e,n){var r=n.havingBaseSizing(),i=Ik("\\surd",e*r.sizeMultiplier,Mk,r),s=r.sizeMultiplier,o=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),a,l=0,c=0,u=0,d;return i.type==="small"?(u=1e3+1e3*o+wp,e<1?s=1:e<1.4&&(s=.7),l=(1+o+kp)/s,c=(1+o)/s,a=xp("sqrtMain",l,u,o,n),a.style.minWidth="0.853em",d=.833/s):i.type==="large"?(u=(1e3+wp)*dc[i.size],c=(dc[i.size]+o)/s,l=(dc[i.size]+o+kp)/s,a=xp("sqrtSize"+i.size,l,u,o,n),a.style.minWidth="1.02em",d=1/s):(l=e+o+kp,c=e+o,u=Math.floor(1e3*e+o)+wp,a=xp("sqrtTall",l,u,o,n),a.style.minWidth="0.742em",d=1.056),a.height=c,a.style.height=ve(l),{span:a,advanceWidth:d,ruleWidth:(n.fontMetrics().sqrtRuleThickness+o)*s}},Lk=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],C$=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Ak=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],dc=[0,1.2,1.8,2.4,3],E$=function(e,n,r,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),Lk.includes(e)||Ak.includes(e))return Ek(e,n,!1,r,i,s);if(C$.includes(e))return Tk(e,dc[n],!1,r,i,s);throw new he("Illegal delimiter: '"+e+"'")},T$=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],L$=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"stack"}],Mk=[{type:"small",style:De.SCRIPTSCRIPT},{type:"small",style:De.SCRIPT},{type:"small",style:De.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],A$=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Ik=function(e,n,r,i){for(var s=Math.min(2,3-i.style.size),o=s;on)return r[o]}return r[r.length-1]},Ok=function(e,n,r,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var a;Ak.includes(e)?a=T$:Lk.includes(e)?a=Mk:a=L$;var l=Ik(e,n,a,i);return l.type==="small"?w$(e,l.style,r,i,s,o):l.type==="large"?Ek(e,l.size,r,i,s,o):Tk(e,n,r,i,s,o)},M$=function(e,n,r,i,s,o){var a=i.fontMetrics().axisHeight*i.sizeMultiplier,l=901,c=5/i.fontMetrics().ptPerEm,u=Math.max(n-a,r+a),d=Math.max(u/500*l,2*u-c);return Ok(e,d,!0,i,s,o)},Qi={sqrtImage:_$,sizedDelim:E$,sizeToMaxHeight:dc,customSizedDelim:Ok,leftRightDelim:M$},U4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},I$=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function U0(t,e){var n=q0(t);if(n&&I$.includes(n.text))return n;throw n?new he("Invalid delimiter '"+n.text+"' after '"+e.funcName+"'",t):new he("Invalid delimiter type '"+t.type+"'",t)}_e({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(t,e)=>{var n=U0(e[0],t);return{type:"delimsizing",mode:t.parser.mode,size:U4[t.funcName].size,mclass:U4[t.funcName].mclass,delim:n.text}},htmlBuilder:(t,e)=>t.delim==="."?X.makeSpan([t.mclass]):Qi.sizedDelim(t.delim,t.size,e,t.mode,[t.mclass]),mathmlBuilder:t=>{var e=[];t.delim!=="."&&e.push(Rr(t.delim,t.mode));var n=new ce.MathNode("mo",e);t.mclass==="mopen"||t.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=ve(Qi.sizeToMaxHeight[t.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}});function W4(t){if(!t.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}_e({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=t.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new he("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:t.parser.mode,delim:U0(e[0],t).text,color:n}}});_e({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=U0(e[0],t),r=t.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var s=Je(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:s.delim,rightColor:s.color}},htmlBuilder:(t,e)=>{W4(t);for(var n=an(t.body,e,!0,["mopen","mclose"]),r=0,i=0,s=!1,o=0;o{W4(t);var n=Kn(t.body,e);if(t.left!=="."){var r=new ce.MathNode("mo",[Rr(t.left,t.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if(t.right!=="."){var i=new ce.MathNode("mo",[Rr(t.right,t.mode)]);i.setAttribute("fence","true"),t.rightColor&&i.setAttribute("mathcolor",t.rightColor),n.push(i)}return Qy(n)}});_e({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var n=U0(e[0],t);if(!t.parser.leftrightDepth)throw new he("\\middle without preceding \\left",n);return{type:"middle",mode:t.parser.mode,delim:n.text}},htmlBuilder:(t,e)=>{var n;if(t.delim===".")n=Ac(e,[]);else{n=Qi.sizedDelim(t.delim,1,e,t.mode,[]);var r={delim:t.delim,options:e};n.isMiddle=r}return n},mathmlBuilder:(t,e)=>{var n=t.delim==="\\vert"||t.delim==="|"?Rr("|","text"):Rr(t.delim,t.mode),r=new ce.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var nv=(t,e)=>{var n=X.wrapFragment(ct(t.body,e),e),r=t.label.slice(1),i=e.sizeMultiplier,s,o=0,a=dt.isCharacterBox(t.body);if(r==="sout")s=X.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(r==="phase"){var l=Pt({number:.6,unit:"pt"},e),c=Pt({number:.35,unit:"ex"},e),u=e.havingBaseSizing();i=i/u.sizeMultiplier;var d=n.height+n.depth+l+c;n.style.paddingLeft=ve(d/2+l);var f=Math.floor(1e3*d*i),h=SN(f),p=new ts([new Bs("phase",h)],{width:"400em",height:ve(f/1e3),viewBox:"0 0 400000 "+f,preserveAspectRatio:"xMinYMin slice"});s=X.makeSvgSpan(["hide-tail"],[p],e),s.style.height=ve(d),o=n.depth+l+c}else{/cancel/.test(r)?a||n.classes.push("cancel-pad"):r==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var m=0,g=0,y=0;/box/.test(r)?(y=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),m=e.fontMetrics().fboxsep+(r==="colorbox"?0:y),g=m):r==="angl"?(y=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),m=4*y,g=Math.max(0,.25-n.depth)):(m=a?.2:0,g=m),s=rs.encloseSpan(n,r,m,g,e),/fbox|boxed|fcolorbox/.test(r)?(s.style.borderStyle="solid",s.style.borderWidth=ve(y)):r==="angl"&&y!==.049&&(s.style.borderTopWidth=ve(y),s.style.borderRightWidth=ve(y)),o=n.depth+g,t.backgroundColor&&(s.style.backgroundColor=t.backgroundColor,t.borderColor&&(s.style.borderColor=t.borderColor))}var v;if(t.backgroundColor)v=X.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:n,shift:0}]},e);else{var w=/cancel|phase/.test(r)?["svg-align"]:[];v=X.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:w}]},e)}return/cancel/.test(r)&&(v.height=n.height,v.depth=n.depth),/cancel/.test(r)&&!a?X.makeSpan(["mord","cancel-lap"],[v],e):X.makeSpan(["mord"],[v],e)},rv=(t,e)=>{var n=0,r=new ce.MathNode(t.label.indexOf("colorbox")>-1?"mpadded":"menclose",[Lt(t.body,e)]);switch(t.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),t.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);r.setAttribute("style","border: "+i+"em solid "+String(t.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return t.backgroundColor&&r.setAttribute("mathbackground",t.backgroundColor),r};_e({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Je(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:nv,mathmlBuilder:rv});_e({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(t,e,n){var{parser:r,funcName:i}=t,s=Je(e[0],"color-token").color,o=Je(e[1],"color-token").color,a=e[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,borderColor:s,body:a}},htmlBuilder:nv,mathmlBuilder:rv});_e({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\fbox",body:e[0]}}});_e({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"enclose",mode:n.mode,label:r,body:i}},htmlBuilder:nv,mathmlBuilder:rv});_e({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"enclose",mode:n.mode,label:"\\angl",body:e[0]}}});var Dk={};function Ci(t){for(var{type:e,names:n,props:r,handler:i,htmlBuilder:s,mathmlBuilder:o}=t,a={type:e,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},l=0;l{var e=t.parser.settings;if(!e.displayMode)throw new he("{"+t.envName+"} can be used only in display mode.")};function iv(t){if(t.indexOf("ed")===-1)return t.indexOf("*")===-1}function Qs(t,e,n){var{hskipBeforeAndAfter:r,addJot:i,cols:s,arraystretch:o,colSeparationType:a,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:f}=e;if(t.gullet.beginGroup(),c||t.gullet.macros.set("\\cr","\\\\\\relax"),!o){var h=t.gullet.expandMacroAsText("\\arraystretch");if(h==null)o=1;else if(o=parseFloat(h),!o||o<0)throw new he("Invalid \\arraystretch: "+h)}t.gullet.beginGroup();var p=[],m=[p],g=[],y=[],v=l!=null?[]:void 0;function w(){l&&t.gullet.macros.set("\\@eqnsw","1",!0)}function _(){v&&(t.gullet.macros.get("\\df@tag")?(v.push(t.subparse([new cr("\\df@tag")])),t.gullet.macros.set("\\df@tag",void 0,!0)):v.push(!!l&&t.gullet.macros.get("\\@eqnsw")==="1"))}for(w(),y.push(G4(t));;){var k=t.parseExpression(!1,c?"\\end":"\\\\");t.gullet.endGroup(),t.gullet.beginGroup(),k={type:"ordgroup",mode:t.mode,body:k},n&&(k={type:"styling",mode:t.mode,style:n,body:[k]}),p.push(k);var S=t.fetch().text;if(S==="&"){if(d&&p.length===d){if(c||a)throw new he("Too many tab characters: &",t.nextToken);t.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}t.consume()}else if(S==="\\end"){_(),p.length===1&&k.type==="styling"&&k.body[0].body.length===0&&(m.length>1||!u)&&m.pop(),y.length0&&(w+=.25),c.push({pos:w,isDashed:At[Mi]})}for(_(o[0]),r=0;r0&&(R+=v,LAt))for(r=0;r=a)){var Ce=void 0;(i>0||e.hskipBeforeAndAfter)&&(Ce=dt.deflt(Q.pregap,f),Ce!==0&&(M=X.makeSpan(["arraycolsep"],[]),M.style.width=ve(Ce),D.push(M)));var me=[];for(r=0;r0){for(var cn=X.makeLineSpan("hline",n,u),Pe=X.makeLineSpan("hdashline",n,u),N=[{type:"elem",elem:l,shift:0}];c.length>0;){var qe=c.pop(),rt=qe.pos-F;qe.isDashed?N.push({type:"elem",elem:Pe,shift:rt}):N.push({type:"elem",elem:cn,shift:rt})}l=X.makeVList({positionType:"individualShift",children:N},n)}if(H.length===0)return X.makeSpan(["mord"],[l],n);var Ut=X.makeVList({positionType:"individualShift",children:H},n);return Ut=X.makeSpan(["tag"],[Ut],n),X.makeFragment([l,Ut])},O$={c:"center ",l:"left ",r:"right "},Ti=function(e,n){for(var r=[],i=new ce.MathNode("mtd",[],["mtr-glue"]),s=new ce.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var p=e.cols,m="",g=!1,y=0,v=p.length;p[0].type==="separator"&&(f+="top ",y=1),p[p.length-1].type==="separator"&&(f+="bottom ",v-=1);for(var w=y;w0?"left ":"",f+=E[E.length-1].length>0?"right ":"";for(var C=1;C-1?"alignat":"align",s=e.envName==="split",o=Qs(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:iv(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),a,l=0,c={type:"ordgroup",mode:e.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var u="",d=0;d0&&h&&(g=1),r[p]={type:"align",align:m,pregap:g,postgap:0}}return o.colSeparationType=h?"align":"alignat",o};Ci({type:"array",names:["array","darray"],props:{numArgs:1},handler(t,e){var n=q0(e[0]),r=n?[e[0]]:Je(e[0],"ordgroup").body,i=r.map(function(o){var a=Jy(o),l=a.text;if("lcr".indexOf(l)!==-1)return{type:"align",align:l};if(l==="|")return{type:"separator",separator:"|"};if(l===":")return{type:"separator",separator:":"};throw new he("Unknown column alignment: "+l,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return Qs(t.parser,s,sv(t.envName))},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(t){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[t.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(t.envName.charAt(t.envName.length-1)==="*"){var i=t.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,"lcr".indexOf(n)===-1)throw new he("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var s=Qs(t.parser,r,sv(t.envName)),o=Math.max(0,...s.body.map(a=>a.length));return s.cols=new Array(o).fill({type:"align",align:n}),e?{type:"leftright",mode:t.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(t){var e={arraystretch:.5},n=Qs(t.parser,e,"script");return n.colSeparationType="small",n},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["subarray"],props:{numArgs:1},handler(t,e){var n=q0(e[0]),r=n?[e[0]]:Je(e[0],"ordgroup").body,i=r.map(function(o){var a=Jy(o),l=a.text;if("lc".indexOf(l)!==-1)return{type:"align",align:l};throw new he("Unknown column alignment: "+l,o)});if(i.length>1)throw new he("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=Qs(t.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new he("{subarray} can contain only one column");return s},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(t){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Qs(t.parser,e,sv(t.envName));return{type:"leftright",mode:t.mode,body:[n],left:t.envName.indexOf("r")>-1?".":"\\{",right:t.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Pk,htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(t){["gather","gather*"].includes(t.envName)&&W0(t);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:iv(t.envName),emptySingleRow:!0,leqno:t.parser.settings.leqno};return Qs(t.parser,e,"display")},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Pk,htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(t){W0(t);var e={autoTag:iv(t.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:t.parser.settings.leqno};return Qs(t.parser,e,"display")},htmlBuilder:Ei,mathmlBuilder:Ti});Ci({type:"array",names:["CD"],props:{numArgs:0},handler(t){return W0(t),v$(t.parser)},htmlBuilder:Ei,mathmlBuilder:Ti});P("\\nonumber","\\gdef\\@eqnsw{0}");P("\\notag","\\nonumber");_e({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(t,e){throw new he(t.funcName+" valid only within array environment")}});var K4=Dk;_e({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];if(i.type!=="ordgroup")throw new he("Invalid environment name",i);for(var s="",o=0;o{var n=t.font,r=e.withFont(n);return ct(t.body,r)},$k=(t,e)=>{var n=t.font,r=e.withFont(n);return Lt(t.body,r)},Z4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};_e({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=Mf(e[0]),s=r;return s in Z4&&(s=Z4[s]),{type:"font",mode:n.mode,font:s.slice(1),body:i}},htmlBuilder:Nk,mathmlBuilder:$k});_e({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(t,e)=>{var{parser:n}=t,r=e[0],i=dt.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:j0(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:i}}});_e({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r,breakOnTokenText:i}=t,{mode:s}=n,o=n.parseExpression(!0,i),a="math"+r.slice(1);return{type:"font",mode:s,font:a,body:{type:"ordgroup",mode:n.mode,body:o}}},htmlBuilder:Nk,mathmlBuilder:$k});var Fk=(t,e)=>{var n=e;return t==="display"?n=n.id>=De.SCRIPT.id?n.text():De.DISPLAY:t==="text"&&n.size===De.DISPLAY.size?n=De.TEXT:t==="script"?n=De.SCRIPT:t==="scriptscript"&&(n=De.SCRIPTSCRIPT),n},ov=(t,e)=>{var n=Fk(t.size,e.style),r=n.fracNum(),i=n.fracDen(),s;s=e.havingStyle(r);var o=ct(t.numer,s,e);if(t.continued){var a=8.5/e.fontMetrics().ptPerEm,l=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?p=3*f:p=7*f,m=e.fontMetrics().denom1):(d>0?(h=e.fontMetrics().num2,p=f):(h=e.fontMetrics().num3,p=3*f),m=e.fontMetrics().denom2);var g;if(u){var v=e.fontMetrics().axisHeight;h-o.depth-(v+.5*d){var n=new ce.MathNode("mfrac",[Lt(t.numer,e),Lt(t.denom,e)]);if(!t.hasBarLine)n.setAttribute("linethickness","0px");else if(t.barSize){var r=Pt(t.barSize,e);n.setAttribute("linethickness",ve(r))}var i=Fk(t.size,e.style);if(i.size!==e.style.size){n=new ce.MathNode("mstyle",[n]);var s=i.size===De.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",s),n.setAttribute("scriptlevel","0")}if(t.leftDelim!=null||t.rightDelim!=null){var o=[];if(t.leftDelim!=null){var a=new ce.MathNode("mo",[new ce.TextNode(t.leftDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}if(o.push(n),t.rightDelim!=null){var l=new ce.MathNode("mo",[new ce.TextNode(t.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}return Qy(o)}return n};_e({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1],o,a=null,l=null,c="auto";switch(r){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,a="(",l=")";break;case"\\\\bracefrac":o=!1,a="\\{",l="\\}";break;case"\\\\brackfrac":o=!1,a="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(r){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text";break}return{type:"genfrac",mode:n.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:a,rightDelim:l,size:c,barSize:null}},htmlBuilder:ov,mathmlBuilder:av});_e({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=e[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});_e({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(t){var{parser:e,funcName:n,token:r}=t,i;switch(n){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:r}}});var Y4=["display","text","script","scriptscript"],Q4=function(e){var n=null;return e.length>0&&(n=e,n=n==="."?null:n),n};_e({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(t,e){var{parser:n}=t,r=e[4],i=e[5],s=Mf(e[0]),o=s.type==="atom"&&s.family==="open"?Q4(s.text):null,a=Mf(e[1]),l=a.type==="atom"&&a.family==="close"?Q4(a.text):null,c=Je(e[2],"size"),u,d=null;c.isBlank?u=!0:(d=c.value,u=d.number>0);var f="auto",h=e[3];if(h.type==="ordgroup"){if(h.body.length>0){var p=Je(h.body[0],"textord");f=Y4[Number(p.text)]}}else h=Je(h,"textord"),f=Y4[Number(h.text)];return{type:"genfrac",mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:l,size:f}},htmlBuilder:ov,mathmlBuilder:av});_e({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(t,e){var{parser:n,funcName:r,token:i}=t;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:Je(e[0],"size").value,token:i}}});_e({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0],s=lN(Je(e[1],"infix").size),o=e[2],a=s.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:a,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:ov,mathmlBuilder:av});var Hk=(t,e)=>{var n=e.style,r,i;t.type==="supsub"?(r=t.sup?ct(t.sup,e.havingStyle(n.sup()),e):ct(t.sub,e.havingStyle(n.sub()),e),i=Je(t.base,"horizBrace")):i=Je(t,"horizBrace");var s=ct(i.base,e.havingBaseStyle(De.DISPLAY)),o=rs.svgSpan(i,e),a;if(i.isOver?(a=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),a.children[0].children[0].children[1].classes.push("svg-align")):(a=X.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),a.children[0].children[0].children[0].classes.push("svg-align")),r){var l=X.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e);i.isOver?a=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},e):a=X.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},e)}return X.makeSpan(["mord",i.isOver?"mover":"munder"],[a],e)},D$=(t,e)=>{var n=rs.mathMLnode(t.label);return new ce.MathNode(t.isOver?"mover":"munder",[Lt(t.base,e),n])};_e({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(t,e){var{parser:n,funcName:r}=t;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:e[0]}},htmlBuilder:Hk,mathmlBuilder:D$});_e({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[1],i=Je(e[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:jt(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(t,e)=>{var n=an(t.body,e,!1);return X.makeAnchor(t.href,[],n,e)},mathmlBuilder:(t,e)=>{var n=qs(t.body,e);return n instanceof sr||(n=new sr("mrow",[n])),n.setAttribute("href",t.href),n}});_e({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=Je(e[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:n,funcName:r,token:i}=t,s=Je(e[0],"raw").string,o=e[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a,l={};switch(r){case"\\htmlClass":l.class=s,a={command:"\\htmlClass",class:s};break;case"\\htmlId":l.id=s,a={command:"\\htmlId",id:s};break;case"\\htmlStyle":l.style=s,a={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var c=s.split(","),u=0;u{var n=an(t.body,e,!1),r=["enclosing"];t.attributes.class&&r.push(...t.attributes.class.trim().split(/\s+/));var i=X.makeSpan(r,n,e);for(var s in t.attributes)s!=="class"&&t.attributes.hasOwnProperty(s)&&i.setAttribute(s,t.attributes[s]);return i},mathmlBuilder:(t,e)=>qs(t.body,e)});_e({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"htmlmathml",mode:n.mode,html:jt(e[0]),mathml:jt(e[1])}},htmlBuilder:(t,e)=>{var n=an(t.html,e,!1);return X.makeFragment(n)},mathmlBuilder:(t,e)=>qs(t.mathml,e)});var Sp=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!n)throw new he("Invalid size: '"+e+"' in \\includegraphics");var r={number:+(n[1]+n[2]),unit:n[3]};if(!ik(r))throw new he("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r};_e({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(t,e,n)=>{var{parser:r}=t,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},a="";if(n[0])for(var l=Je(n[0],"raw").string,c=l.split(","),u=0;u{var n=Pt(t.height,e),r=0;t.totalheight.number>0&&(r=Pt(t.totalheight,e)-n);var i=0;t.width.number>0&&(i=Pt(t.width,e));var s={height:ve(n+r)};i>0&&(s.width=ve(i)),r>0&&(s.verticalAlign=ve(-r));var o=new DN(t.src,t.alt,s);return o.height=n,o.depth=r,o},mathmlBuilder:(t,e)=>{var n=new ce.MathNode("mglyph",[]);n.setAttribute("alt",t.alt);var r=Pt(t.height,e),i=0;if(t.totalheight.number>0&&(i=Pt(t.totalheight,e)-r,n.setAttribute("valign",ve(-i))),n.setAttribute("height",ve(r+i)),t.width.number>0){var s=Pt(t.width,e);n.setAttribute("width",ve(s))}return n.setAttribute("src",t.src),n}});_e({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=Je(e[0],"size");if(n.settings.strict){var s=r[1]==="m",o=i.value.unit==="mu";s?(o||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, "+("not "+i.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):o&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder(t,e){return X.makeGlue(t.dimension,e)},mathmlBuilder(t,e){var n=Pt(t.dimension,e);return new ce.SpaceNode(n)}});_e({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(t,e)=>{var n;t.alignment==="clap"?(n=X.makeSpan([],[ct(t.body,e)]),n=X.makeSpan(["inner"],[n],e)):n=X.makeSpan(["inner"],[ct(t.body,e)]);var r=X.makeSpan(["fix"],[]),i=X.makeSpan([t.alignment],[n,r],e),s=X.makeSpan(["strut"]);return s.style.height=ve(i.height+i.depth),i.depth&&(s.style.verticalAlign=ve(-i.depth)),i.children.unshift(s),i=X.makeSpan(["thinbox"],[i],e),X.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(t,e)=>{var n=new ce.MathNode("mpadded",[Lt(t.body,e)]);if(t.alignment!=="rlap"){var r=t.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}});_e({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){var{funcName:n,parser:r}=t,i=r.mode;r.switchMode("math");var s=n==="\\("?"\\)":"$",o=r.parseExpression(!1,s);return r.expect(s),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",body:o}}});_e({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(t,e){throw new he("Mismatched "+t.funcName)}});var X4=(t,e)=>{switch(e.style.size){case De.DISPLAY.size:return t.display;case De.TEXT.size:return t.text;case De.SCRIPT.size:return t.script;case De.SCRIPTSCRIPT.size:return t.scriptscript;default:return t.text}};_e({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(t,e)=>{var{parser:n}=t;return{type:"mathchoice",mode:n.mode,display:jt(e[0]),text:jt(e[1]),script:jt(e[2]),scriptscript:jt(e[3])}},htmlBuilder:(t,e)=>{var n=X4(t,e),r=an(n,e,!1);return X.makeFragment(r)},mathmlBuilder:(t,e)=>{var n=X4(t,e);return qs(n,e)}});var Vk=(t,e,n,r,i,s,o)=>{t=X.makeSpan([],[t]);var a=n&&dt.isCharacterBox(n),l,c;if(e){var u=ct(e,r.havingStyle(i.sup()),r);c={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=ct(n,r.havingStyle(i.sub()),r);l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(c&&l){var h=r.fontMetrics().bigOpSpacing5+l.elem.height+l.elem.depth+l.kern+t.depth+o;f=X.makeVList({positionType:"bottom",positionData:h,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ve(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ve(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(l){var p=t.height-o;f=X.makeVList({positionType:"top",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:l.elem,marginLeft:ve(-s)},{type:"kern",size:l.kern},{type:"elem",elem:t}]},r)}else if(c){var m=t.depth+o;f=X.makeVList({positionType:"bottom",positionData:m,children:[{type:"elem",elem:t},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:ve(s)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else return t;var g=[f];if(l&&s!==0&&!a){var y=X.makeSpan(["mspace"],[],r);y.style.marginRight=ve(s),g.unshift(y)}return X.makeSpan(["mop","op-limits"],g,r)},zk=["\\smallint"],dl=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Je(t.base,"op"),i=!0):s=Je(t,"op");var o=e.style,a=!1;o.size===De.DISPLAY.size&&s.symbol&&!zk.includes(s.name)&&(a=!0);var l;if(s.symbol){var c=a?"Size2-Regular":"Size1-Regular",u="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(u=s.name.slice(1),s.name=u==="oiint"?"\\iint":"\\iiint"),l=X.makeSymbol(s.name,c,"math",e,["mop","op-symbol",a?"large-op":"small-op"]),u.length>0){var d=l.italic,f=X.staticSvg(u+"Size"+(a?"2":"1"),e);l=X.makeVList({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:f,shift:a?.08:0}]},e),s.name="\\"+u,l.classes.unshift("mop"),l.italic=d}}else if(s.body){var h=an(s.body,e,!0);h.length===1&&h[0]instanceof Dr?(l=h[0],l.classes[0]="mop"):l=X.makeSpan(["mop"],h,e)}else{for(var p=[],m=1;m{var n;if(t.symbol)n=new sr("mo",[Rr(t.name,t.mode)]),zk.includes(t.name)&&n.setAttribute("largeop","false");else if(t.body)n=new sr("mo",Kn(t.body,e));else{n=new sr("mi",[new fi(t.name.slice(1))]);var r=new sr("mo",[Rr("⁡","text")]);t.parentIsSupSub?n=new sr("mrow",[n,r]):n=mk([n,r])}return n},R$={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};_e({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=r;return i.length===1&&(i=R$[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:dl,mathmlBuilder:vu});_e({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:jt(r)}},htmlBuilder:dl,mathmlBuilder:vu});var P$={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};_e({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:dl,mathmlBuilder:vu});_e({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(t){var{parser:e,funcName:n}=t;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:dl,mathmlBuilder:vu});_e({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(t){var{parser:e,funcName:n}=t,r=n;return r.length===1&&(r=P$[r]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:dl,mathmlBuilder:vu});var Bk=(t,e)=>{var n,r,i=!1,s;t.type==="supsub"?(n=t.sup,r=t.sub,s=Je(t.base,"operatorname"),i=!0):s=Je(t,"operatorname");var o;if(s.body.length>0){for(var a=s.body.map(d=>{var f=d.text;return typeof f=="string"?{type:"textord",mode:d.mode,text:f}:d}),l=an(a,e.withFont("mathrm"),!0),c=0;c{for(var n=Kn(t.body,e.withFont("mathrm")),r=!0,i=0;iu.toText()).join("");n=[new ce.TextNode(a)]}var l=new ce.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new ce.MathNode("mo",[Rr("⁡","text")]);return t.parentIsSupSub?new ce.MathNode("mrow",[l,c]):ce.newDocumentFragment([l,c])};_e({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(t,e)=>{var{parser:n,funcName:r}=t,i=e[0];return{type:"operatorname",mode:n.mode,body:jt(i),alwaysHandleSupSub:r==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:Bk,mathmlBuilder:N$});P("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");zo({type:"ordgroup",htmlBuilder(t,e){return t.semisimple?X.makeFragment(an(t.body,e,!1)):X.makeSpan(["mord"],an(t.body,e,!0),e)},mathmlBuilder(t,e){return qs(t.body,e,!0)}});_e({type:"overline",names:["\\overline"],props:{numArgs:1},handler(t,e){var{parser:n}=t,r=e[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(t,e){var n=ct(t.body,e.havingCrampedStyle()),r=X.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]},e);return X.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(t,e){var n=new ce.MathNode("mo",[new ce.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ce.MathNode("mover",[Lt(t.body,e),n]);return r.setAttribute("accent","true"),r}});_e({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"phantom",mode:n.mode,body:jt(r)}},htmlBuilder:(t,e)=>{var n=an(t.body,e.withPhantom(),!1);return X.makeFragment(n)},mathmlBuilder:(t,e)=>{var n=Kn(t.body,e);return new ce.MathNode("mphantom",n)}});_e({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=X.makeSpan([],[ct(t.body,e.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r{var n=Kn(jt(t.body),e),r=new ce.MathNode("mphantom",n),i=new ce.MathNode("mpadded",[r]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});_e({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(t,e)=>{var{parser:n}=t,r=e[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(t,e)=>{var n=X.makeSpan(["inner"],[ct(t.body,e.withPhantom())]),r=X.makeSpan(["fix"],[]);return X.makeSpan(["mord","rlap"],[n,r],e)},mathmlBuilder:(t,e)=>{var n=Kn(jt(t.body),e),r=new ce.MathNode("mphantom",n),i=new ce.MathNode("mpadded",[r]);return i.setAttribute("width","0px"),i}});_e({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(t,e){var{parser:n}=t,r=Je(e[0],"size").value,i=e[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(t,e){var n=ct(t.body,e),r=Pt(t.dy,e);return X.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){var n=new ce.MathNode("mpadded",[Lt(t.body,e)]),r=t.dy.number+t.dy.unit;return n.setAttribute("voffset",r),n}});_e({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(t){var{parser:e}=t;return{type:"internal",mode:e.mode}}});_e({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(t,e,n){var{parser:r}=t,i=n[0],s=Je(e[0],"size"),o=Je(e[1],"size");return{type:"rule",mode:r.mode,shift:i&&Je(i,"size").value,width:s.value,height:o.value}},htmlBuilder(t,e){var n=X.makeSpan(["mord","rule"],[],e),r=Pt(t.width,e),i=Pt(t.height,e),s=t.shift?Pt(t.shift,e):0;return n.style.borderRightWidth=ve(r),n.style.borderTopWidth=ve(i),n.style.bottom=ve(s),n.width=r,n.height=i+s,n.depth=-s,n.maxFontSize=i*1.125*e.sizeMultiplier,n},mathmlBuilder(t,e){var n=Pt(t.width,e),r=Pt(t.height,e),i=t.shift?Pt(t.shift,e):0,s=e.color&&e.getColor()||"black",o=new ce.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",ve(n)),o.setAttribute("height",ve(r));var a=new ce.MathNode("mpadded",[o]);return i>=0?a.setAttribute("height",ve(i)):(a.setAttribute("height",ve(i)),a.setAttribute("depth",ve(-i))),a.setAttribute("voffset",ve(i)),a}});function qk(t,e,n){for(var r=an(t,e,!1),i=e.sizeMultiplier/n.sizeMultiplier,s=0;s{var n=e.havingSize(t.size);return qk(t.body,n,e)};_e({type:"sizing",names:J4,props:{numArgs:0,allowedInText:!0},handler:(t,e)=>{var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:J4.indexOf(r)+1,body:s}},htmlBuilder:$$,mathmlBuilder:(t,e)=>{var n=e.havingSize(t.size),r=Kn(t.body,n),i=new ce.MathNode("mstyle",r);return i.setAttribute("mathsize",ve(n.sizeMultiplier)),i}});_e({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(t,e,n)=>{var{parser:r}=t,i=!1,s=!1,o=n[0]&&Je(n[0],"ordgroup");if(o)for(var a="",l=0;l{var n=X.makeSpan([],[ct(t.body,e)]);if(!t.smashHeight&&!t.smashDepth)return n;if(t.smashHeight&&(n.height=0,n.children))for(var r=0;r{var n=new ce.MathNode("mpadded",[Lt(t.body,e)]);return t.smashHeight&&n.setAttribute("height","0px"),t.smashDepth&&n.setAttribute("depth","0px"),n}});_e({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(t,e,n){var{parser:r}=t,i=n[0],s=e[0];return{type:"sqrt",mode:r.mode,body:s,index:i}},htmlBuilder(t,e){var n=ct(t.body,e.havingCrampedStyle());n.height===0&&(n.height=e.fontMetrics().xHeight),n=X.wrapFragment(n,e);var r=e.fontMetrics(),i=r.defaultRuleThickness,s=i;e.style.idn.height+n.depth+o&&(o=(o+d-n.height-n.depth)/2);var f=l.height-n.height-o-c;n.style.paddingLeft=ve(u);var h=X.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+f)},{type:"elem",elem:l},{type:"kern",size:c}]},e);if(t.index){var p=e.havingStyle(De.SCRIPTSCRIPT),m=ct(t.index,p,e),g=.6*(h.height-h.depth),y=X.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:m}]},e),v=X.makeSpan(["root"],[y]);return X.makeSpan(["mord","sqrt"],[v,h],e)}else return X.makeSpan(["mord","sqrt"],[h],e)},mathmlBuilder(t,e){var{body:n,index:r}=t;return r?new ce.MathNode("mroot",[Lt(n,e),Lt(r,e)]):new ce.MathNode("msqrt",[Lt(n,e)])}});var e6={display:De.DISPLAY,text:De.TEXT,script:De.SCRIPT,scriptscript:De.SCRIPTSCRIPT};_e({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(t,e){var{breakOnTokenText:n,funcName:r,parser:i}=t,s=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(t,e){var n=e6[t.style],r=e.havingStyle(n).withFont("");return qk(t.body,r,e)},mathmlBuilder(t,e){var n=e6[t.style],r=e.havingStyle(n),i=Kn(t.body,r),s=new ce.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},a=o[t.style];return s.setAttribute("scriptlevel",a[0]),s.setAttribute("displaystyle",a[1]),s}});var F$=function(e,n){var r=e.base;if(r)if(r.type==="op"){var i=r.limits&&(n.style.size===De.DISPLAY.size||r.alwaysHandleSupSub);return i?dl:null}else if(r.type==="operatorname"){var s=r.alwaysHandleSupSub&&(n.style.size===De.DISPLAY.size||r.limits);return s?Bk:null}else{if(r.type==="accent")return dt.isCharacterBox(r.base)?ev:null;if(r.type==="horizBrace"){var o=!e.sub;return o===r.isOver?Hk:null}else return null}else return null};zo({type:"supsub",htmlBuilder(t,e){var n=F$(t,e);if(n)return n(t,e);var{base:r,sup:i,sub:s}=t,o=ct(r,e),a,l,c=e.fontMetrics(),u=0,d=0,f=r&&dt.isCharacterBox(r);if(i){var h=e.havingStyle(e.style.sup());a=ct(i,h,e),f||(u=o.height-h.fontMetrics().supDrop*h.sizeMultiplier/e.sizeMultiplier)}if(s){var p=e.havingStyle(e.style.sub());l=ct(s,p,e),f||(d=o.depth+p.fontMetrics().subDrop*p.sizeMultiplier/e.sizeMultiplier)}var m;e.style===De.DISPLAY?m=c.sup1:e.style.cramped?m=c.sup3:m=c.sup2;var g=e.sizeMultiplier,y=ve(.5/c.ptPerEm/g),v=null;if(l){var w=t.base&&t.base.type==="op"&&t.base.name&&(t.base.name==="\\oiint"||t.base.name==="\\oiiint");(o instanceof Dr||w)&&(v=ve(-o.italic))}var _;if(a&&l){u=Math.max(u,m,a.depth+.25*c.xHeight),d=Math.max(d,c.sub2);var k=c.defaultRuleThickness,S=4*k;if(u-a.depth-(l.height-d)0&&(u+=L,d-=L)}var E=[{type:"elem",elem:l,shift:d,marginRight:y,marginLeft:v},{type:"elem",elem:a,shift:-u,marginRight:y}];_=X.makeVList({positionType:"individualShift",children:E},e)}else if(l){d=Math.max(d,c.sub1,l.height-.8*c.xHeight);var C=[{type:"elem",elem:l,marginLeft:v,marginRight:y}];_=X.makeVList({positionType:"shift",positionData:d,children:C},e)}else if(a)u=Math.max(u,m,a.depth+.25*c.xHeight),_=X.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:a,marginRight:y}]},e);else throw new Error("supsub must have either sup or sub.");var V=Tg(o,"right")||"mord";return X.makeSpan([V],[o,X.makeSpan(["msupsub"],[_])],e)},mathmlBuilder(t,e){var n=!1,r,i;t.base&&t.base.type==="horizBrace"&&(i=!!t.sup,i===t.base.isOver&&(n=!0,r=t.base.isOver)),t.base&&(t.base.type==="op"||t.base.type==="operatorname")&&(t.base.parentIsSupSub=!0);var s=[Lt(t.base,e)];t.sub&&s.push(Lt(t.sub,e)),t.sup&&s.push(Lt(t.sup,e));var o;if(n)o=r?"mover":"munder";else if(t.sub)if(t.sup){var c=t.base;c&&c.type==="op"&&c.limits&&e.style===De.DISPLAY||c&&c.type==="operatorname"&&c.alwaysHandleSupSub&&(e.style===De.DISPLAY||c.limits)?o="munderover":o="msubsup"}else{var l=t.base;l&&l.type==="op"&&l.limits&&(e.style===De.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===De.DISPLAY)?o="munder":o="msub"}else{var a=t.base;a&&a.type==="op"&&a.limits&&(e.style===De.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===De.DISPLAY)?o="mover":o="msup"}return new ce.MathNode(o,s)}});zo({type:"atom",htmlBuilder(t,e){return X.mathsym(t.text,t.mode,e,["m"+t.family])},mathmlBuilder(t,e){var n=new ce.MathNode("mo",[Rr(t.text,t.mode)]);if(t.family==="bin"){var r=Xy(t,e);r==="bold-italic"&&n.setAttribute("mathvariant",r)}else t.family==="punct"?n.setAttribute("separator","true"):(t.family==="open"||t.family==="close")&&n.setAttribute("stretchy","false");return n}});var jk={mi:"italic",mn:"normal",mtext:"normal"};zo({type:"mathord",htmlBuilder(t,e){return X.makeOrd(t,e,"mathord")},mathmlBuilder(t,e){var n=new ce.MathNode("mi",[Rr(t.text,t.mode,e)]),r=Xy(t,e)||"italic";return r!==jk[n.type]&&n.setAttribute("mathvariant",r),n}});zo({type:"textord",htmlBuilder(t,e){return X.makeOrd(t,e,"textord")},mathmlBuilder(t,e){var n=Rr(t.text,t.mode,e),r=Xy(t,e)||"normal",i;return t.mode==="text"?i=new ce.MathNode("mtext",[n]):/[0-9]/.test(t.text)?i=new ce.MathNode("mn",[n]):t.text==="\\prime"?i=new ce.MathNode("mo",[n]):i=new ce.MathNode("mi",[n]),r!==jk[i.type]&&i.setAttribute("mathvariant",r),i}});var _p={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Cp={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};zo({type:"spacing",htmlBuilder(t,e){if(Cp.hasOwnProperty(t.text)){var n=Cp[t.text].className||"";if(t.mode==="text"){var r=X.makeOrd(t,e,"textord");return r.classes.push(n),r}else return X.makeSpan(["mspace",n],[X.mathsym(t.text,t.mode,e)],e)}else{if(_p.hasOwnProperty(t.text))return X.makeSpan(["mspace",_p[t.text]],[],e);throw new he('Unknown type of space "'+t.text+'"')}},mathmlBuilder(t,e){var n;if(Cp.hasOwnProperty(t.text))n=new ce.MathNode("mtext",[new ce.TextNode(" ")]);else{if(_p.hasOwnProperty(t.text))return new ce.MathNode("mspace");throw new he('Unknown type of space "'+t.text+'"')}return n}});var t6=()=>{var t=new ce.MathNode("mtd",[]);return t.setAttribute("width","50%"),t};zo({type:"tag",mathmlBuilder(t,e){var n=new ce.MathNode("mtable",[new ce.MathNode("mtr",[t6(),new ce.MathNode("mtd",[qs(t.body,e)]),t6(),new ce.MathNode("mtd",[qs(t.tag,e)])])]);return n.setAttribute("width","100%"),n}});var n6={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},r6={"\\textbf":"textbf","\\textmd":"textmd"},H$={"\\textit":"textit","\\textup":"textup"},i6=(t,e)=>{var n=t.font;if(n){if(n6[n])return e.withTextFontFamily(n6[n]);if(r6[n])return e.withTextFontWeight(r6[n]);if(n==="\\emph")return e.fontShape==="textit"?e.withTextFontShape("textup"):e.withTextFontShape("textit")}else return e;return e.withTextFontShape(H$[n])};_e({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(t,e){var{parser:n,funcName:r}=t,i=e[0];return{type:"text",mode:n.mode,body:jt(i),font:r}},htmlBuilder(t,e){var n=i6(t,e),r=an(t.body,n,!0);return X.makeSpan(["mord","text"],r,n)},mathmlBuilder(t,e){var n=i6(t,e);return qs(t.body,n)}});_e({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(t,e){var{parser:n}=t;return{type:"underline",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=ct(t.body,e),r=X.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=X.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]},e);return X.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(t,e){var n=new ce.MathNode("mo",[new ce.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new ce.MathNode("munder",[Lt(t.body,e),n]);return r.setAttribute("accentunder","true"),r}});_e({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(t,e){var{parser:n}=t;return{type:"vcenter",mode:n.mode,body:e[0]}},htmlBuilder(t,e){var n=ct(t.body,e),r=e.fontMetrics().axisHeight,i=.5*(n.height-r-(n.depth+r));return X.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:n}]},e)},mathmlBuilder(t,e){return new ce.MathNode("mpadded",[Lt(t.body,e)],["vcenter"])}});_e({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(t,e,n){throw new he("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(t,e){for(var n=s6(t),r=[],i=e.havingStyle(e.style.text()),s=0;st.body.replace(/ /g,t.star?"␣":" "),Ms=hk,Uk=`[ \r ]`,V$="\\\\[a-zA-Z@]+",z$="\\\\[^\uD800-\uDFFF]",B$="("+V$+")"+Uk+"*",q$=`\\\\( |[ \r ]+ ?)[ \r ]*`,Ig="[̀-ͯ]",j$=new RegExp(Ig+"+$"),U$="("+Uk+"+)|"+(q$+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Ig+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Ig+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+B$)+("|"+z$+")");class o6{constructor(e,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=n,this.tokenRegex=new RegExp(U$,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,n){this.catcodes[e]=n}lex(){var e=this.input,n=this.tokenRegex.lastIndex;if(n===e.length)return new cr("EOF",new Wn(this,n,n));var r=this.tokenRegex.exec(e);if(r===null||r.index!==n)throw new he("Unexpected character: '"+e[n]+"'",new cr(e[n],new Wn(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(` `,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new cr(i,new Wn(this,n,this.tokenRegex.lastIndex))}}class W${constructor(e,n){e===void 0&&(e={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new he("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var n in e)e.hasOwnProperty(n)&&(e[n]==null?delete this.current[n]:this.current[n]=e[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=n)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}n==null?delete this.current[e]:this.current[e]=n}}var G$=Rk;P("\\noexpand",function(t){var e=t.popToken();return t.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});P("\\expandafter",function(t){var e=t.popToken();return t.expandOnce(!0),{tokens:[e],numArgs:0}});P("\\@firstoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[0],numArgs:0}});P("\\@secondoftwo",function(t){var e=t.consumeArgs(2);return{tokens:e[1],numArgs:0}});P("\\@ifnextchar",function(t){var e=t.consumeArgs(3);t.consumeSpaces();var n=t.future();return e[0].length===1&&e[0][0].text===n.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});P("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");P("\\TextOrMath",function(t){var e=t.consumeArgs(2);return t.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var a6={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};P("\\char",function(t){var e=t.popToken(),n,r="";if(e.text==="'")n=8,e=t.popToken();else if(e.text==='"')n=16,e=t.popToken();else if(e.text==="`")if(e=t.popToken(),e.text[0]==="\\")r=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new he("\\char` missing argument");r=e.text.charCodeAt(0)}else n=10;if(n){if(r=a6[e.text],r==null||r>=n)throw new he("Invalid base-"+n+" digit "+e.text);for(var i;(i=a6[t.future().text])!=null&&i{var i=t.consumeArg().tokens;if(i.length!==1)throw new he("\\newcommand's first argument must be a macro name");var s=i[0].text,o=t.isDefined(s);if(o&&!e)throw new he("\\newcommand{"+s+"} attempting to redefine "+(s+"; use \\renewcommand"));if(!o&&!n)throw new he("\\renewcommand{"+s+"} when command "+s+" does not yet exist; use \\newcommand");var a=0;if(i=t.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=t.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=t.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new he("Invalid number of arguments: "+l);a=parseInt(l),i=t.consumeArg().tokens}return o&&r||t.macros.set(s,{tokens:i,numArgs:a}),""};P("\\newcommand",t=>lv(t,!1,!0,!1));P("\\renewcommand",t=>lv(t,!0,!1,!1));P("\\providecommand",t=>lv(t,!0,!0,!0));P("\\message",t=>{var e=t.consumeArgs(1)[0];return console.log(e.reverse().map(n=>n.text).join("")),""});P("\\errmessage",t=>{var e=t.consumeArgs(1)[0];return console.error(e.reverse().map(n=>n.text).join("")),""});P("\\show",t=>{var e=t.popToken(),n=e.text;return console.log(e,t.macros.get(n),Ms[n],It.math[n],It.text[n]),""});P("\\bgroup","{");P("\\egroup","}");P("~","\\nobreakspace");P("\\lq","`");P("\\rq","'");P("\\aa","\\r a");P("\\AA","\\r A");P("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");P("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");P("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");P("ℬ","\\mathscr{B}");P("ℰ","\\mathscr{E}");P("ℱ","\\mathscr{F}");P("ℋ","\\mathscr{H}");P("ℐ","\\mathscr{I}");P("ℒ","\\mathscr{L}");P("ℳ","\\mathscr{M}");P("ℛ","\\mathscr{R}");P("ℭ","\\mathfrak{C}");P("ℌ","\\mathfrak{H}");P("ℨ","\\mathfrak{Z}");P("\\Bbbk","\\Bbb{k}");P("·","\\cdotp");P("\\llap","\\mathllap{\\textrm{#1}}");P("\\rlap","\\mathrlap{\\textrm{#1}}");P("\\clap","\\mathclap{\\textrm{#1}}");P("\\mathstrut","\\vphantom{(}");P("\\underbar","\\underline{\\text{#1}}");P("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');P("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");P("\\ne","\\neq");P("≠","\\neq");P("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");P("∉","\\notin");P("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");P("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");P("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");P("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");P("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");P("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");P("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");P("⟂","\\perp");P("‼","\\mathclose{!\\mkern-0.8mu!}");P("∌","\\notni");P("⌜","\\ulcorner");P("⌝","\\urcorner");P("⌞","\\llcorner");P("⌟","\\lrcorner");P("©","\\copyright");P("®","\\textregistered");P("️","\\textregistered");P("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');P("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');P("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');P("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');P("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");P("⋮","\\vdots");P("\\varGamma","\\mathit{\\Gamma}");P("\\varDelta","\\mathit{\\Delta}");P("\\varTheta","\\mathit{\\Theta}");P("\\varLambda","\\mathit{\\Lambda}");P("\\varXi","\\mathit{\\Xi}");P("\\varPi","\\mathit{\\Pi}");P("\\varSigma","\\mathit{\\Sigma}");P("\\varUpsilon","\\mathit{\\Upsilon}");P("\\varPhi","\\mathit{\\Phi}");P("\\varPsi","\\mathit{\\Psi}");P("\\varOmega","\\mathit{\\Omega}");P("\\substack","\\begin{subarray}{c}#1\\end{subarray}");P("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");P("\\boxed","\\fbox{$\\displaystyle{#1}$}");P("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");P("\\implies","\\DOTSB\\;\\Longrightarrow\\;");P("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");P("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");P("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var l6={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};P("\\dots",function(t){var e="\\dotso",n=t.expandAfterFuture().text;return n in l6?e=l6[n]:(n.slice(0,4)==="\\not"||n in It.math&&["bin","rel"].includes(It.math[n].group))&&(e="\\dotsb"),e});var cv={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};P("\\dotso",function(t){var e=t.future().text;return e in cv?"\\ldots\\,":"\\ldots"});P("\\dotsc",function(t){var e=t.future().text;return e in cv&&e!==","?"\\ldots\\,":"\\ldots"});P("\\cdots",function(t){var e=t.future().text;return e in cv?"\\@cdots\\,":"\\@cdots"});P("\\dotsb","\\cdots");P("\\dotsm","\\cdots");P("\\dotsi","\\!\\cdots");P("\\dotsx","\\ldots\\,");P("\\DOTSI","\\relax");P("\\DOTSB","\\relax");P("\\DOTSX","\\relax");P("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");P("\\,","\\tmspace+{3mu}{.1667em}");P("\\thinspace","\\,");P("\\>","\\mskip{4mu}");P("\\:","\\tmspace+{4mu}{.2222em}");P("\\medspace","\\:");P("\\;","\\tmspace+{5mu}{.2777em}");P("\\thickspace","\\;");P("\\!","\\tmspace-{3mu}{.1667em}");P("\\negthinspace","\\!");P("\\negmedspace","\\tmspace-{4mu}{.2222em}");P("\\negthickspace","\\tmspace-{5mu}{.277em}");P("\\enspace","\\kern.5em ");P("\\enskip","\\hskip.5em\\relax");P("\\quad","\\hskip1em\\relax");P("\\qquad","\\hskip2em\\relax");P("\\tag","\\@ifstar\\tag@literal\\tag@paren");P("\\tag@paren","\\tag@literal{({#1})}");P("\\tag@literal",t=>{if(t.macros.get("\\df@tag"))throw new he("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});P("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");P("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");P("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");P("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");P("\\newline","\\\\\\relax");P("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Wk=ve(di["Main-Regular"][84][1]-.7*di["Main-Regular"][65][1]);P("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Wk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");P("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Wk+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");P("\\hspace","\\@ifstar\\@hspacer\\@hspace");P("\\@hspace","\\hskip #1\\relax");P("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");P("\\ordinarycolon",":");P("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");P("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');P("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');P("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');P("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');P("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');P("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');P("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');P("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');P("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');P("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');P("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');P("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');P("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');P("∷","\\dblcolon");P("∹","\\eqcolon");P("≔","\\coloneqq");P("≕","\\eqqcolon");P("⩴","\\Coloneqq");P("\\ratio","\\vcentcolon");P("\\coloncolon","\\dblcolon");P("\\colonequals","\\coloneqq");P("\\coloncolonequals","\\Coloneqq");P("\\equalscolon","\\eqqcolon");P("\\equalscoloncolon","\\Eqqcolon");P("\\colonminus","\\coloneq");P("\\coloncolonminus","\\Coloneq");P("\\minuscolon","\\eqcolon");P("\\minuscoloncolon","\\Eqcolon");P("\\coloncolonapprox","\\Colonapprox");P("\\coloncolonsim","\\Colonsim");P("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");P("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");P("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");P("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");P("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");P("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");P("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");P("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");P("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");P("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");P("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");P("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");P("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");P("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");P("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");P("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");P("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");P("\\nleqq","\\html@mathml{\\@nleqq}{≰}");P("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");P("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");P("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");P("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");P("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");P("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");P("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");P("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");P("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");P("\\imath","\\html@mathml{\\@imath}{ı}");P("\\jmath","\\html@mathml{\\@jmath}{ȷ}");P("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");P("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");P("⟦","\\llbracket");P("⟧","\\rrbracket");P("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");P("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");P("⦃","\\lBrace");P("⦄","\\rBrace");P("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");P("⦵","\\minuso");P("\\darr","\\downarrow");P("\\dArr","\\Downarrow");P("\\Darr","\\Downarrow");P("\\lang","\\langle");P("\\rang","\\rangle");P("\\uarr","\\uparrow");P("\\uArr","\\Uparrow");P("\\Uarr","\\Uparrow");P("\\N","\\mathbb{N}");P("\\R","\\mathbb{R}");P("\\Z","\\mathbb{Z}");P("\\alef","\\aleph");P("\\alefsym","\\aleph");P("\\Alpha","\\mathrm{A}");P("\\Beta","\\mathrm{B}");P("\\bull","\\bullet");P("\\Chi","\\mathrm{X}");P("\\clubs","\\clubsuit");P("\\cnums","\\mathbb{C}");P("\\Complex","\\mathbb{C}");P("\\Dagger","\\ddagger");P("\\diamonds","\\diamondsuit");P("\\empty","\\emptyset");P("\\Epsilon","\\mathrm{E}");P("\\Eta","\\mathrm{H}");P("\\exist","\\exists");P("\\harr","\\leftrightarrow");P("\\hArr","\\Leftrightarrow");P("\\Harr","\\Leftrightarrow");P("\\hearts","\\heartsuit");P("\\image","\\Im");P("\\infin","\\infty");P("\\Iota","\\mathrm{I}");P("\\isin","\\in");P("\\Kappa","\\mathrm{K}");P("\\larr","\\leftarrow");P("\\lArr","\\Leftarrow");P("\\Larr","\\Leftarrow");P("\\lrarr","\\leftrightarrow");P("\\lrArr","\\Leftrightarrow");P("\\Lrarr","\\Leftrightarrow");P("\\Mu","\\mathrm{M}");P("\\natnums","\\mathbb{N}");P("\\Nu","\\mathrm{N}");P("\\Omicron","\\mathrm{O}");P("\\plusmn","\\pm");P("\\rarr","\\rightarrow");P("\\rArr","\\Rightarrow");P("\\Rarr","\\Rightarrow");P("\\real","\\Re");P("\\reals","\\mathbb{R}");P("\\Reals","\\mathbb{R}");P("\\Rho","\\mathrm{P}");P("\\sdot","\\cdot");P("\\sect","\\S");P("\\spades","\\spadesuit");P("\\sub","\\subset");P("\\sube","\\subseteq");P("\\supe","\\supseteq");P("\\Tau","\\mathrm{T}");P("\\thetasym","\\vartheta");P("\\weierp","\\wp");P("\\Zeta","\\mathrm{Z}");P("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");P("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");P("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");P("\\bra","\\mathinner{\\langle{#1}|}");P("\\ket","\\mathinner{|{#1}\\rangle}");P("\\braket","\\mathinner{\\langle{#1}\\rangle}");P("\\Bra","\\left\\langle#1\\right|");P("\\Ket","\\left|#1\\right\\rangle");var Gk=t=>e=>{var n=e.consumeArg().tokens,r=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),a=e.macros.get("\\|");e.macros.beginGroup();var l=d=>f=>{t&&(f.macros.set("|",o),i.length&&f.macros.set("\\|",a));var h=d;if(!d&&i.length){var p=f.future();p.text==="|"&&(f.popToken(),h=!0)}return{tokens:h?i:r,numArgs:0}};e.macros.set("|",l(!1)),i.length&&e.macros.set("\\|",l(!0));var c=e.consumeArg().tokens,u=e.expandTokens([...s,...c,...n]);return e.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};P("\\bra@ket",Gk(!1));P("\\bra@set",Gk(!0));P("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");P("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");P("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");P("\\angln","{\\angl n}");P("\\blue","\\textcolor{##6495ed}{#1}");P("\\orange","\\textcolor{##ffa500}{#1}");P("\\pink","\\textcolor{##ff00af}{#1}");P("\\red","\\textcolor{##df0030}{#1}");P("\\green","\\textcolor{##28ae7b}{#1}");P("\\gray","\\textcolor{gray}{#1}");P("\\purple","\\textcolor{##9d38bd}{#1}");P("\\blueA","\\textcolor{##ccfaff}{#1}");P("\\blueB","\\textcolor{##80f6ff}{#1}");P("\\blueC","\\textcolor{##63d9ea}{#1}");P("\\blueD","\\textcolor{##11accd}{#1}");P("\\blueE","\\textcolor{##0c7f99}{#1}");P("\\tealA","\\textcolor{##94fff5}{#1}");P("\\tealB","\\textcolor{##26edd5}{#1}");P("\\tealC","\\textcolor{##01d1c1}{#1}");P("\\tealD","\\textcolor{##01a995}{#1}");P("\\tealE","\\textcolor{##208170}{#1}");P("\\greenA","\\textcolor{##b6ffb0}{#1}");P("\\greenB","\\textcolor{##8af281}{#1}");P("\\greenC","\\textcolor{##74cf70}{#1}");P("\\greenD","\\textcolor{##1fab54}{#1}");P("\\greenE","\\textcolor{##0d923f}{#1}");P("\\goldA","\\textcolor{##ffd0a9}{#1}");P("\\goldB","\\textcolor{##ffbb71}{#1}");P("\\goldC","\\textcolor{##ff9c39}{#1}");P("\\goldD","\\textcolor{##e07d10}{#1}");P("\\goldE","\\textcolor{##a75a05}{#1}");P("\\redA","\\textcolor{##fca9a9}{#1}");P("\\redB","\\textcolor{##ff8482}{#1}");P("\\redC","\\textcolor{##f9685d}{#1}");P("\\redD","\\textcolor{##e84d39}{#1}");P("\\redE","\\textcolor{##bc2612}{#1}");P("\\maroonA","\\textcolor{##ffbde0}{#1}");P("\\maroonB","\\textcolor{##ff92c6}{#1}");P("\\maroonC","\\textcolor{##ed5fa6}{#1}");P("\\maroonD","\\textcolor{##ca337c}{#1}");P("\\maroonE","\\textcolor{##9e034e}{#1}");P("\\purpleA","\\textcolor{##ddd7ff}{#1}");P("\\purpleB","\\textcolor{##c6b9fc}{#1}");P("\\purpleC","\\textcolor{##aa87ff}{#1}");P("\\purpleD","\\textcolor{##7854ab}{#1}");P("\\purpleE","\\textcolor{##543b78}{#1}");P("\\mintA","\\textcolor{##f5f9e8}{#1}");P("\\mintB","\\textcolor{##edf2df}{#1}");P("\\mintC","\\textcolor{##e0e5cc}{#1}");P("\\grayA","\\textcolor{##f6f7f7}{#1}");P("\\grayB","\\textcolor{##f0f1f2}{#1}");P("\\grayC","\\textcolor{##e3e5e6}{#1}");P("\\grayD","\\textcolor{##d6d8da}{#1}");P("\\grayE","\\textcolor{##babec2}{#1}");P("\\grayF","\\textcolor{##888d93}{#1}");P("\\grayG","\\textcolor{##626569}{#1}");P("\\grayH","\\textcolor{##3b3e40}{#1}");P("\\grayI","\\textcolor{##21242c}{#1}");P("\\kaBlue","\\textcolor{##314453}{#1}");P("\\kaGreen","\\textcolor{##71B307}{#1}");var Kk={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class K${constructor(e,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(e),this.macros=new W$(G$,n.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new o6(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var n,r,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new cr("EOF",r.loc)),this.pushTokens(i),new cr("",Wn.range(n,r))}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var n=[],r=e&&e.length>0;r||this.consumeSpaces();var i=this.future(),s,o=0,a=0;do{if(s=this.popToken(),n.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new he("Extra }",s)}else if(s.text==="EOF")throw new he("Unexpected end of input in a macro argument, expected '"+(e&&r?e[a]:"}")+"'",s);if(e&&r)if((o===0||o===1&&e[a]==="{")&&s.text===e[a]){if(++a,a===e.length){n.splice(-a,a);break}}else a=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:s}}consumeArgs(e,n){if(n){if(n.length!==e+1)throw new he("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;ithis.settings.maxExpand)throw new he("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||e&&i.unexpandable){if(e&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new he("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var a=s.length-1;a>=0;--a){var l=s[a];if(l.text==="#"){if(a===0)throw new he("Incomplete placeholder at end of macro body",l);if(l=s[--a],l.text==="#")s.splice(a+1,1);else if(/^[1-9]$/.test(l.text))s.splice(a,2,...o[+l.text-1]);else throw new he("Not a valid argument number",l)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new cr(e)]):void 0}expandTokens(e){var n=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(e){var n=this.expandMacro(e);return n&&n.map(r=>r.text).join("")}_getExpansion(e){var n=this.macros.get(e);if(n==null)return n;if(e.length===1){var r=this.lexer.catcodes[e];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var a=new o6(i,this.settings),l=[],c=a.lex();c.text!=="EOF";)l.push(c),c=a.lex();l.reverse();var u={tokens:l,numArgs:s};return u}return i}isDefined(e){return this.macros.has(e)||Ms.hasOwnProperty(e)||It.math.hasOwnProperty(e)||It.text.hasOwnProperty(e)||Kk.hasOwnProperty(e)}isExpandable(e){var n=this.macros.get(e);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Ms.hasOwnProperty(e)&&!Ms[e].primitive}}var c6=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,id=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ep={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},u6={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class G0{constructor(e,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new K$(e,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(e,n){if(n===void 0&&(n=!0),this.fetch().text!==e)throw new he("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var n=this.nextToken;this.consume(),this.gullet.pushToken(new cr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(e,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(G0.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||e&&Ms[i.text]&&Ms[i.text].infix)break;var s=this.parseAtom(n);if(s){if(s.type==="internal")continue}else break;r.push(s)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var n=-1,r,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',e);var a=It[this.mode][n].group,l=Wn.range(e),c;if(NN.hasOwnProperty(a)){var u=a;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:a,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(rk(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:Wn.range(e),text:n};else return null;if(this.consume(),s)for(var d=0;dOg.renderToString(n.text,{...t,displayMode:n.displayMode})+(e?` `:"")}function iF(t,e){const n=t&&t.nonStandard,r=n?tF:eF;return{name:"inlineKatex",level:"inline",start(i){let s,o=i;for(;o;){if(s=o.indexOf("$"),s===-1)return;if((n?s>-1:s===0||o.charAt(s-1)===" ")&&o.substring(s).match(r))return s;o=o.substring(s+1).replace(/^\$+/,"")}},tokenizer(i,s){const o=i.match(r);if(o)return{type:"inlineKatex",raw:o[0],text:o[2].trim(),displayMode:o[1].length===2}},renderer:e}}function sF(t,e){return{name:"blockKatex",level:"block",tokenizer(n,r){const i=n.match(nF);if(i)return{type:"blockKatex",raw:i[0],text:i[2].trim(),displayMode:i[1].length===2}},renderer:e}}function oF(t={}){const{highlight:e,container:n}=t;return{async:!0,async walkTokens(r){var i;if(r.type!=="code"||typeof e!="function")return;const[s="text",...o]=((i=r.lang)==null?void 0:i.split(" "))??[],{text:a}=r,l=await e(a,s,o),c=n?n.replace("%l",String(s).toUpperCase()).replace("%s",l).replace("%t",a):l;Object.assign(r,{type:"html",block:!0,text:`${c} `})}}}let Zt=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function aF(t){return fv(t)}function fv(t){return Array.isArray(t)?lF(t):t instanceof RegExp?t:typeof t=="object"?cF(t):t}function lF(t){let e=[];for(let n=0,r=t.length;n{for(let r in n)t[r]=n[r]}),t}function Xk(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Xk(t.substring(0,t.length-1)):t.substr(~e+1)}var Tp=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,sd=class{static hasCaptures(t){return t===null?!1:(Tp.lastIndex=0,Tp.test(t))}static replaceCaptures(t,e,n){return t.replace(Tp,(r,i,s,o)=>{let a=n[parseInt(i||s,10)];if(a){let l=e.substring(a.start,a.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Jk(t,e){return te?1:0}function e9(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;ithis._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>uF(t.parent,i.parentScopes));return r?new r9(r.fontStyle,r.foreground,r.background):null}},Lp=class Yd{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new Yd(e,r);return e}static from(...e){let n=null;for(let r=0;r"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!dF(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function dF(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var r9=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function fF(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,s=e.length;i1&&(g=p.slice(0,p.length-1),g.reverse()),n[r++]=new hF(m,g,i,l,c,u)}}return n}var hF=class{constructor(t,e,n,r,i,s){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=s}},Mn=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(Mn||{});function pF(t,e){t.sort((l,c)=>{let u=Jk(l.scope,c.scope);return u!==0||(u=e9(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let l=t.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let s=new mF(e),o=new r9(n,s.getId(r),s.getId(i)),a=new yF(new Dg(0,null,-1,0,0),[]);for(let l=0,c=t.length;le?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},yF=class Rg{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const s=n.parentScopes[i].length-e.parentScopes[r].length;if(s!==0)return s;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,s;if(r===-1?(i=e,s=""):(i=e.substring(0,r),s=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Rg._cmpBySpecificity),n}insert(e,n,r,i,s,o){if(n===""){this._doInsertHere(e,r,i,s,o);return}let a=n.indexOf("."),l,c;a===-1?(l=n,c=""):(l=n.substring(0,a),c=n.substring(a+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new Rg(this._mainRule.clone(),Dg.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(e+1,c,r,i,s,o)}_doInsertHere(e,n,r,i,s){if(n===null){this._mainRule.acceptOverwrite(e,r,i,s);return}for(let o=0,a=this._rulesWithParentScopes.length;o>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,s,o,a){let l=br.getLanguageId(e),c=br.getTokenType(e),u=br.containsBalancedBrackets(e)?1:0,d=br.getFontStyle(e),f=br.getForeground(e),h=br.getBackground(e);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(u=i?1:0),s!==-1&&(d=s),o!==0&&(f=o),a!==0&&(h=a),(l<<0|c<<8|u<<10|d<<11|f<<15|h<<24)>>>0}};function Of(t,e){const n=[],r=vF(t);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function s(){if(i==="-"){i=r.next();const l=s();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=a();return i===")"&&(i=r.next()),l}if(h6(i)){const l=[];do l.push(i),i=r.next();while(h6(i));return c=>e(l,c)}return null}function o(){const l=[];let c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function a(){const l=[];let c=o();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return u=>l.some(d=>d(u))}}function h6(t){return!!t&&!!t.match(/[\w\.:]+/)}function vF(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function s9(t){typeof t.dispose=="function"&&t.dispose()}var Mc=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},bF=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},wF=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},kF=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Mc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new wF;for(const n of t)xF(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof Mc){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 xF(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const s=n.lookup(e);t instanceof Mc?Qd({baseGrammar:s,selfGrammar:i},r):Pg(t.ruleName,{baseGrammar:s,selfGrammar:i,repository:i.repository},r);const o=n.injections(t.scopeName);if(o)for(const a of o)r.add(new Mc(a))}function Pg(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];Df([r],e,n)}}function Qd(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Df(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Df(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Df(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Qk({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Df(r.patterns,{...e,repository:i},n);const s=r.include;if(!s)continue;const o=o9(s);switch(o.kind){case 0:Qd({...e,selfGrammar:e.baseGrammar},n);break;case 1:Qd(e,n);break;case 2:Pg(o.ruleName,{...e,repository:i},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const l={baseGrammar:e.baseGrammar,selfGrammar:a,repository:i};o.kind===4?Pg(o.ruleName,l,n):Qd(l,n)}else o.kind===4?n.add(new bF(o.scopeName,o.ruleName)):n.add(new Mc(o.scopeName));break}}}var SF=class{kind=0},_F=class{kind=1},CF=class{constructor(t){this.ruleName=t}kind=2},EF=class{constructor(t){this.scopeName=t}kind=3},TF=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function o9(t){if(t==="$base")return new SF;if(t==="$self")return new _F;const e=t.indexOf("#");if(e===-1)return new EF(t);if(e===0)return new CF(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new TF(n,r)}}var LF=/\\(\d+)/,p6=/\\(\d+)/g,AF=-1,a9=-2;var bu=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=sd.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=sd.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Xk(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:sd.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:sd.replaceCaptures(this._contentName,t,e)}},MF=class extends bu{retokenizeCapturedWithRuleId;constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},IF=class extends bu{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,null),this._match=new Ic(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},m6=class extends bu{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Oc,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ng=class extends bu{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i,s,o,a,l,c){super(t,e,n,r),this._begin=new Ic(i,this.id),this.beginCaptures=s,this._end=new Ic(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.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(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oc;for(const n of this.patterns)t.getRule(n).collectPatterns(t,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,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Rf=class extends bu{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,i,s,o,a,l){super(t,e,n,r),this._begin=new Ic(i,this.id),this.beginCaptures=s,this.whileCaptures=a,this._while=new Ic(o,a9),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Oc;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){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,e||"￿"),this._cachedCompiledWhilePatterns}},l9=class Cn{static createCaptureRule(e,n,r,i,s){return e.registerRule(o=>new MF(n,o,r,i,s))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new IF(e.$vscodeTextmateLocation,e.id,e.name,e.match,Cn._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Qk({},r,e.repository));let s=e.patterns;return typeof s>"u"&&e.include&&(s=[{include:e.include}]),new m6(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,Cn._compilePatterns(s,n,r))}return e.while?new Rf(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,Cn._compileCaptures(e.whileCaptures||e.captures,n,r),Cn._compilePatterns(e.patterns,n,r)):new Ng(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,Cn._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,Cn._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,Cn._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let s=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);a>s&&(s=a)}for(let o=0;o<=s;o++)i[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let l=0;e[o].patterns&&(l=Cn.getCompiledRuleId(e[o],n,r)),i[a]=Cn.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,l)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let s=0,o=e.length;se.substring(i.start,i.end));return p6.lastIndex=0,this.source.replace(p6,(i,s)=>t9(r[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 e=[],n=[],r=[],i=[],s,o,a,l;for(s=0,o=this.source.length;sn.source);this._cached=new g6(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new g6(t,r,this._items.map(i=>i.ruleId))}},g6=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Ap(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match($g.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/},DF=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>t9(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},y6=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function u9(t,e,n,r,i,s,o,a){const l=e.content.length;let c=!1,u=-1;if(o){const h=RF(t,e,n,r,i,s);i=h.stack,r=h.linePos,n=h.isFirstLine,u=h.anchorPosition}const d=Date.now();for(;!c;){if(a!==0&&Date.now()-d>a)return new y6(i,!0);f()}return new y6(i,!1);function f(){const h=PF(t,e,n,r,i,u);if(!h){s.produce(i,l),c=!0;return}const p=h.captureIndices,m=h.matchedRuleId,g=p&&p.length>0?p[0].end>r:!1;if(m===AF){const y=i.getRule(t);s.produce(i,p[0].start),i=i.withContentNameScopesList(i.nameScopesList),Jl(t,e,n,i,s,y.endCaptures,p),s.produce(i,p[0].end);const v=i;if(i=i.parent,u=v.getAnchorPos(),!g&&v.getEnterPos()===r){i=v,s.produce(i,l),c=!0;return}}else{const y=t.getRule(m);s.produce(i,p[0].start);const v=i,w=y.getName(e.content,p),_=i.contentNameScopesList.pushAttributed(w,t);if(i=i.push(m,r,u,p[0].end===l,null,_,_),y instanceof Ng){const k=y;Jl(t,e,n,i,s,k.beginCaptures,p),s.produce(i,p[0].end),u=p[0].end;const S=k.getContentName(e.content,p),L=_.pushAttributed(S,t);if(i=i.withContentNameScopesList(L),k.endHasBackReferences&&(i=i.withEndRule(k.getEndWithResolvedBackReferences(e.content,p))),!g&&v.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(y instanceof Rf){const k=y;Jl(t,e,n,i,s,k.beginCaptures,p),s.produce(i,p[0].end),u=p[0].end;const S=k.getContentName(e.content,p),L=_.pushAttributed(S,t);if(i=i.withContentNameScopesList(L),k.whileHasBackReferences&&(i=i.withEndRule(k.getWhileWithResolvedBackReferences(e.content,p))),!g&&v.hasSameRuleAs(i)){i=i.pop(),s.produce(i,l),c=!0;return}}else if(Jl(t,e,n,i,s,y.captures,p),s.produce(i,p[0].end),i=i.pop(),!g){i=i.safePop(),s.produce(i,l),c=!0;return}}p[0].end>r&&(r=p[0].end,n=!1)}}function RF(t,e,n,r,i,s){let o=i.beginRuleCapturedEOL?0:-1;const a=[];for(let l=i;l;l=l.pop()){const c=l.getRule(t);c instanceof Rf&&a.push({rule:c,stack:l})}for(let l=a.pop();l;l=a.pop()){const{ruleScanner:c,findOptions:u}=FF(l.rule,t,l.stack.endRule,n,r===o),d=c.findNextMatchSync(e,r,u);if(d){if(d.ruleId!==a9){i=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Jl(t,e,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),o=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function PF(t,e,n,r,i,s){const o=NF(t,e,n,r,i,s),a=t.getInjections();if(a.length===0)return o;const l=$F(a,t,e,n,r,i,s);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,u=l.captureIndices[0].start;return u=a)&&(a=w,l=v.captureIndices,c=v.ruleId,u=p.priority,a===i))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function d9(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function FF(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function Jl(t,e,n,r,i,s,o){if(s.length===0)return;const a=e.content,l=Math.min(s.length,o.length),c=[],u=o[0].end;for(let d=0;du)break;for(;c.length>0&&c[c.length-1].endPos<=h.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,h.start):i.produce(r,h.start),f.retokenizeCapturedWithRuleId){const m=f.getName(a,o),g=r.contentNameScopesList.pushAttributed(m,t),y=f.getContentName(a,o),v=g.pushAttributed(y,t),w=r.push(f.retokenizeCapturedWithRuleId,h.start,-1,!1,null,g,v),_=t.createOnigString(a.substring(0,h.end));u9(t,_,n&&h.start===0,h.start,w,i,!1,0),s9(_);continue}const p=f.getName(a,o);if(p!==null){const g=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(p,t);c.push(new HF(g,h.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var HF=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function VF(t,e,n,r,i,s,o,a){return new BF(t,e,n,r,i,s,o,a)}function v6(t,e,n,r,i){const s=Of(e,Pf),o=l9.getCompiledRuleId(n,r,i.repository);for(const a of s)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:i,priority:a.priority})}function Pf(t,e){if(e.length{for(let i=n;in&&t.substr(0,n)===e&&t[n]==="."}var BF=class{constructor(t,e,n,r,i,s,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=s,this._onigLib=a,this._basicScopeAttributesProvider=new OF(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=b6(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=Of(l,Pf);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)v6(e,o,i[o],this,r);const s=this._grammarRepository.injections(n);s&&s.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const l=a.injectionSelector;l&&v6(e,l,a,this,a)}})}return e.sort((i,s)=>i.priority-s.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=b6(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=l9.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===Fg.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=Ga.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let h;f?h=fc.createRootAndLookUpScopeName(f,d,this):h=fc.createRoot("unknown",d),e=new Fg(null,this._rootId,-1,-1,!1,null,h,h)}else i=!1,e.reset();t=t+` `;const s=this.createOnigString(t),o=s.content.length,a=new jF(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=u9(this,s,i,0,e,a,!0,r);return s9(s),{lineLength:o,lineTokens:a,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function b6(t,e){return t=aF(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var fc=class si{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=e?.scopePath??null;for(const s of n)i=Lp.push(i,s.scopeNames),r=new si(r,i,s.encodedTokenAttributes);return r}static createRoot(e,n){return new si(null,new Lp(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),s=new Lp(null,e),o=r.themeProvider.themeMatch(s),a=si.mergeAttributes(n,i,o);return new si(null,s,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return si.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,s=0,o=0;return r!==null&&(i=r.fontStyle,s=r.foregroundId,o=r.backgroundId),Ga.set(e,n.languageId,n.tokenType,null,i,s,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return si._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const s of r)i=si._pushAttributed(i,s,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),s=e.scopePath.push(n),o=r.themeProvider.themeMatch(s),a=si.mergeAttributes(e.tokenAttributes,i,o);return new si(e,s,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Fg=class uo{constructor(e,n,r,i,s,o,a,l){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new uo(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:uo._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?fc.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){uo._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,s,o,a){return new uo(this,e,n,r,i,s,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new uo(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.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(e,n){const r=fc.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new uo(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,fc.fromExtension(r,n.contentNameScopesList))}},qF=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Of(n,Pf).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Of(n,Pf).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},jF=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const s=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(s)&&(r=Ga.set(r,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(s))}if(i&&(r=Ga.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,r,i,s)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,s=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,s)}},Hg=Fg.NULL;const GF=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class wu{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}wu.prototype.normal={};wu.prototype.property={};wu.prototype.space=void 0;function f9(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new wu(n,r,e)}function Vg(t){return t.toLowerCase()}let Zn=class{constructor(e,n){this.attribute=n,this.property=e}};Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let KF=0;const Xe=Bo(),Wt=Bo(),zg=Bo(),pe=Bo(),Mt=Bo(),Aa=Bo(),er=Bo();function Bo(){return 2**++KF}const Bg=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:Wt,commaOrSpaceSeparated:er,commaSeparated:Aa,number:pe,overloadedBoolean:zg,spaceSeparated:Mt},Symbol.toStringTag,{value:"Module"})),Mp=Object.keys(Bg);class hv extends Zn{constructor(e,n,r,i){let s=-1;if(super(e,n),w6(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&XF.test(e)){if(e.charAt(4)==="-"){const s=e.slice(5).replace(k6,tH);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=e.slice(4);if(!k6.test(s)){let o=s.replace(QF,eH);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=hv}return new i(r,e)}function eH(t){return"-"+t.toLowerCase()}function tH(t){return t.charAt(1).toUpperCase()}const nH=f9([h9,ZF,g9,y9,v9],"html"),b9=f9([h9,YF,g9,y9,v9],"svg"),x6={}.hasOwnProperty;function rH(t,e){const n=e||{};function r(i,...s){let o=r.invalid;const a=r.handlers;if(i&&x6.call(i,t)){const l=String(i[t]);o=x6.call(a,l)?a[l]:r.unknown}if(o)return o.call(this,i,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const iH=/["&'<>`]/g,sH=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,oH=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,aH=/[|\\{}()[\]^$+*?.]/g,S6=new WeakMap;function lH(t,e){if(t=t.replace(e.subset?cH(e.subset):iH,r),e.subset||e.escapeOnly)return t;return t.replace(sH,n).replace(oH,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function cH(t){let e=S6.get(t);return e||(e=uH(t),S6.set(t,e)),e}function uH(t){const e=[];let n=-1;for(;++n",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:"€"},gH=["cent","copy","divide","gt","lt","not","para","times"],w9={}.hasOwnProperty,qg={};let od;for(od in Ip)w9.call(Ip,od)&&(qg[Ip[od]]=od);const yH=/[^\dA-Za-z]/;function vH(t,e,n,r){const i=String.fromCharCode(t);if(w9.call(qg,i)){const s=qg[i],o="&"+s;return n&&mH.includes(s)&&!gH.includes(s)&&(!r||e&&e!==61&&yH.test(String.fromCharCode(e)))?o:o+";"}return""}function bH(t,e,n){let r=fH(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=vH(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const s=pH(t,e,n.omitOptionalSemicolons);s.length|^->||--!>|"],xH=["<",">"];function SH(t,e,n,r){return r.settings.bogusComments?"":"";function i(s){return Ma(s,Object.assign({},r.settings.characterReferences,{subset:xH}))}}function _H(t,e,n,r){return""}function _6(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function CH(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function EH(t){return t.join(" ").trim()}const TH=/[ \t\n\f\r]/g;function pv(t){return typeof t=="object"?t.type==="text"?C6(t.value):!1:C6(t)}function C6(t){return t.replace(TH,"")===""}const ln=x9(1),k9=x9(-1),LH=[];function x9(t){return e;function e(n,r,i){const s=n?n.children:LH;let o=(r||0)+t,a=s[o];if(!i)for(;a&&pv(a);)o+=t,a=s[o];return a}}const AH={}.hasOwnProperty;function S9(t){return e;function e(n,r,i){return AH.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mv=S9({body:IH,caption:Op,colgroup:Op,dd:PH,dt:RH,head:Op,html:MH,li:DH,optgroup:NH,option:$H,p:OH,rp:E6,rt:E6,tbody:HH,td:T6,tfoot:VH,th:T6,thead:FH,tr:zH});function Op(t,e,n){const r=ln(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&pv(r.value.charAt(0)))}function MH(t,e,n){const r=ln(n,e);return!r||r.type!=="comment"}function IH(t,e,n){const r=ln(n,e);return!r||r.type!=="comment"}function OH(t,e,n){const r=ln(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function DH(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&r.tagName==="li"}function RH(t,e,n){const r=ln(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function PH(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function E6(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function NH(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function $H(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function FH(t,e,n){const r=ln(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function HH(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function VH(t,e,n){return!ln(n,e)}function zH(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function T6(t,e,n){const r=ln(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const BH=S9({body:UH,colgroup:WH,head:jH,html:qH,tbody:GH});function qH(t){const e=ln(t,-1);return!e||e.type!=="comment"}function jH(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function UH(t){const e=ln(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&pv(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function WH(t,e,n){const r=k9(n,e),i=ln(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&mv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function GH(t,e,n){const r=k9(n,e),i=ln(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&mv(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const ad={name:[[` \f\r &/=>`.split(""),` \f\r "&'/=>\``.split("")],[`\0 \f\r "&'/<=>`.split(""),`\0 \f\r "&'/<=>\``.split("")]],unquoted:[[` \f\r &>`.split(""),`\0 \f\r "&'<=>\``.split("")],[`\0 \f\r "&'<=>\``.split(""),`\0 \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function KH(t,e,n,r){const i=r.schema,s=i.space==="svg"?!1:r.settings.omitOptionalTags;let o=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const a=[];let l;i.space==="html"&&t.tagName==="svg"&&(r.schema=b9);const c=ZH(r,t.properties),u=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,u&&(o=!1),(c||!s||!BH(t,e,n))&&(a.push("<",t.tagName,c?" "+c:""),o&&(i.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!o&&(!s||!mv(t,e,n))&&a.push(""),a.join("")}function ZH(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const s=YH(t,i,e[i]);s&&n.push(s)}}for(;++r_6(n,t.alternative)&&(o=t.alternative),a=o+Ma(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?ad.single:ad.double)[i][s],attribute:!0}))+o),l+(a&&"="+a))}const QH=["<","&"];function _9(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:Ma(t.value,Object.assign({},r.settings.characterReferences,{subset:QH}))}function XH(t,e,n,r){return r.settings.allowDangerousHtml?t.value:_9(t,e,n,r)}function JH(t,e,n,r){return r.all(t)}const eV=rH("type",{invalid:tV,unknown:nV,handlers:{comment:SH,doctype:_H,element:KH,raw:XH,root:JH,text:_9}});function tV(t){throw new Error("Expected node, not `"+t+"`")}function nV(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const rV={},iV={},sV=[];function gi(t,e){const n=e||rV,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:oV,all:aV,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||GF,characterReferences:n.characterReferences||iV,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?b9:nH,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function oV(t,e,n){return eV(t,e,n,this)}function aV(t){const e=[],n=t&&t.children||sV;let r=-1;for(;++re.default||e)}function gv(t){return!t||["plaintext","txt","text","plain"].includes(t)}function E9(t){return t==="ansi"||gv(t)}function yv(t){return t==="none"}function T9(t){return yv(t)}function L9(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function K0(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const i=[];for(let s=0;si);function n(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let s=i,o=0;for(const a of e){if(sn&&r.push({...t,content:t.content.slice(n,i),offset:t.offset+n}),n=i;return nr-i);return n.length?t.map(r=>r.flatMap(i=>{const s=n.filter(o=>i.offseto-i.offset).sort((o,a)=>o-a);return s.length?dV(i,s):i})):t}function hV(t,e,n,r,i="css-vars"){const s={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>$f(t.variants[u])),a=new Set(o.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{const f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[u]+(d==="color"?"":f)};return o.forEach((u,d)=>{for(const f of a){const h=u[f]||"inherit";if(d===0&&r&&uV.includes(f))if(r===vv&&o.length>1){const p=e.findIndex(v=>v==="light"),m=e.findIndex(v=>v==="dark");if(p===-1||m===-1)throw new Zt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const g=o[p][f]||"inherit",y=o[m][f]||"inherit";l[f]=`light-dark(${g}, ${y})`,i==="css-vars"&&(l[c(d,f)]=h)}else l[f]=h;else i==="css-vars"&&(l[c(d,f)]=h)}}),s.htmlStyle=l,s}function $f(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&Mn.Italic&&(e["font-style"]="italic"),t.fontStyle&Mn.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&Mn.Underline&&n.push("underline"),t.fontStyle&Mn.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function jg(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const A9=new WeakMap;function Z0(t,e){A9.set(t,e)}function Dc(t){return A9.get(t)}class hl{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new hl(Object.fromEntries(lV(n).map(r=>[r,Hg])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,i]=e;this.lang=r,this._stacks={[i]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return pV(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function pV(t){const e=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const s=i?.nameScopesList?.scopeName;s&&e.push(s),i.parent&&r(i.parent)}return r(t),e}function mV(t,e){if(!(t instanceof hl))throw new Zt("Invalid grammar state");return t.getInternalStack(e)}function gV(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new Zt(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...i.indexToPos(o),offset:o}}else{const a=i.lines[o.line];if(a===void 0)throw new Zt(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${i.lines.length}`);let l=o.character;if(l<0&&(l=a.length+l),l<0||l>a.length)throw new Zt(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:l,offset:i.posToIndex(o.line,l)}}};const i=cV(n.source),s=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));yV(s),t.set(n.meta,{decorations:s,converter:i,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=e(this).decorations.flatMap(o=>[o.start.offset,o.end.offset]);return fV(n,i)},code(n){if(!this.options.decorations?.length)return;const r=e(this),i=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(i.length!==r.converter.lines.length)throw new Zt(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function s(u,d,f,h){const p=i[u];let m="",g=-1,y=-1;if(d===0&&(g=0),f===0&&(y=0),f===Number.POSITIVE_INFINITY&&(y=p.children.length),g===-1||y===-1)for(let w=0;wm);return u.tagName=d.tagName||"span",u.properties={...u.properties,...h,class:u.properties.class},d.properties?.class&&L9(u,d.properties.class),u=p(u,f)||u,u}const l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(const u of c){const{start:d,end:f}=u;if(d.line===f.line)s(d.line,d.character,f.character,u);else if(d.lineo(h,u));s(f.line,0,f.character,u)}}l.forEach(u=>u())}}}function yV(t){for(let e=0;en.end.offset)throw new Zt(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;rNumber.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function kV(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Dp[r]&&e.push({type:"setDecoration",value:Dp[r]});else if(r<=29){const i=Dp[r-20];i&&(e.push({type:"resetDecoration",value:i}),i==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:yo[r-30]}});else if(r===38){const i=L6(t);i&&e.push({type:"setForegroundColor",value:i})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:yo[r-40]}});else if(r===48){const i=L6(t);i&&e.push({type:"setBackgroundColor",value:i})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:yo[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:yo[r-100+8]}})}return e}function xV(){let t=null,e=null,n=new Set;return{parse(r){const i=[];let s=0;do{const o=wV(r,s),a=o.sequence?r.substring(s,o.startPosition):r.substring(s);if(a.length>0&&i.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const l=kV(o.sequence);for(const c of l)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of l)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}s=o.position}while(sMath.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c{const c=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`,u=t.colors?.[c];return[l,u||CV[l]]})),o=_V(s),a=xV();return i.map(l=>a.parse(l[0]).map(c=>{let u,d;c.decorations.has("reverse")?(u=c.background?o.value(c.background):t.bg,d=c.foreground?o.value(c.foreground):t.fg):(u=c.foreground?o.value(c.foreground):t.fg,d=c.background?o.value(c.background):void 0),u=Os(u,r),d=Os(d,r),c.decorations.has("dim")&&(u=TV(u));let f=Mn.None;return c.decorations.has("bold")&&(f|=Mn.Bold),c.decorations.has("italic")&&(f|=Mn.Italic),c.decorations.has("underline")&&(f|=Mn.Underline),c.decorations.has("strikethrough")&&(f|=Mn.Strikethrough),{content:c.value,offset:l[1],color:u,bgColor:d,fontStyle:f}}))}function TV(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],s=r[1],o=r[2],a=r[3],l=Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${s}${s}${o}${o}${l}`}else if(r.length===3){const i=r[0],s=r[1],o=r[2];return`#${i}${i}${s}${s}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function bv(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,i=t.resolveLangAlias(n.lang||"text");if(gv(i)||yv(r))return K0(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:s,colorMap:o}=t.setTheme(r);if(i==="ansi")return EV(s,e,n);const a=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new Zt(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new Zt(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return AV(e,a,s,o,n)}function LV(...t){if(t.length===2)return Dc(t[1]);const[e,n,r={}]=t,{lang:i="text",theme:s=e.getLoadedThemes()[0]}=r;if(gv(i)||yv(s))throw new Zt("Plain language does not have grammar state");if(i==="ansi")throw new Zt("ANSI language does not have grammar state");const{theme:o,colorMap:a}=e.setTheme(s),l=e.getLanguage(i);return new hl(wv(n,l,o,a,r).stateStack,l.name,o.name)}function AV(t,e,n,r,i){const s=wv(t,e,n,r,i),o=new hl(s.stateStack,e.name,n.name);return Z0(s.tokens,o),s.tokens}function wv(t,e,n,r,i){const s=Nf(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=i,l=K0(t);let c=i.grammarState?mV(i.grammarState,n.name)??Hg:i.grammarContextCode!=null?wv(i.grammarContextCode,e,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:Hg,u=[];const d=[];for(let f=0,h=l.length;f0&&p.length>=o){u=[],d.push([{content:p,offset:m,color:"",fontStyle:0}]);continue}let g,y,v;i.includeExplanation&&(g=e.tokenizeLine(p,c,a),y=g.tokens,v=0);const w=e.tokenizeLine2(p,c,a),_=w.tokens.length/2;for(let k=0;k<_;k++){const S=w.tokens[2*k],L=k+1<_?w.tokens[2*k+2]:p.length;if(S===L)continue;const E=w.tokens[2*k+1],C=Os(r[Ga.getForeground(E)],s),V=Ga.getFontStyle(E),R={content:p.substring(S,L),offset:m+S,color:C,fontStyle:V};if(i.includeExplanation){const F=[];if(i.includeExplanation!=="scopeName")for(const D of n.settings){let M;switch(typeof D.scope){case"string":M=D.scope.split(/,/).map($=>$.trim());break;case"object":M=D.scope;break;default:continue}F.push({settings:D,selectors:M.map($=>$.split(/ /))})}R.explanation=[];let T=0;for(;S+T({scopeName:e}))}function IV(t,e){const n=[];for(let r=0,i=e.length;r=0&&i>=0;)A6(t[r],n[i])&&(r-=1),i-=1;return r===-1}function DV(t,e,n){const r=[];for(const{selectors:i,settings:s}of t)for(const o of i)if(OV(o,e,n)){r.push(s);break}return r}function I9(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const c=bv(t,e,{...n,theme:l.theme}),u=Dc(c),d=typeof l.theme=="string"?l.theme:l.theme.name;return{tokens:c,state:u,theme:d}}),s=RV(...i.map(l=>l.tokens)),o=s[0].map((l,c)=>l.map((u,d)=>{const f={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=u.explanation),s.forEach((h,p)=>{const{content:m,explanation:g,offset:y,...v}=h[c][d];f.variants[r[p].color]=v}),f})),a=i[0].state?new hl(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return a&&Z0(o,a),o}function RV(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;rl[r]),s=e.map(()=>[]);e.forEach((l,c)=>l.push(s[c]));const o=i.map(()=>0),a=i.map(l=>l[0]);for(;a.every(l=>l);){const l=Math.min(...a.map(c=>c.content.length));for(let c=0;cy[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,v)=>y.color===c?-1:v.color===c?1:0);if(f.length===0)throw new Zt("`themes` option must not be empty");const h=I9(t,e,n);if(l=Dc(h),c&&vv!==c&&!f.find(y=>y.color===c))throw new Zt(`\`themes\` option must contain the defaultColor key \`${c}\``);const p=f.map(y=>t.getTheme(y.theme)),m=f.map(y=>y.color);s=h.map(y=>y.map(v=>hV(v,m,u,c,d))),l&&Z0(s,l);const g=f.map(y=>Nf(y.theme,n));i=M6(f,p,g,u,c,"fg",d),r=M6(f,p,g,u,c,"bg",d),o=`shiki-themes ${p.map(y=>y.name).join(" ")}`,a=c?void 0:[i,r].join(";")}else if("theme"in n){const c=Nf(n.theme,n);s=bv(t,e,n);const u=t.getTheme(n.theme);r=Os(u.bg,c),i=Os(u.fg,c),o=u.name,l=Dc(s)}else throw new Zt("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:i,bg:r,themeName:o,rootStyle:a,grammarState:l}}function M6(t,e,n,r,i,s,o){return t.map((a,l)=>{const c=Os(e[l][s],n[l])||"inherit",u=`${r+a.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&i){if(i===vv&&t.length>1){const d=t.findIndex(m=>m.color==="light"),f=t.findIndex(m=>m.color==="dark");if(d===-1||f===-1)throw new Zt('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const h=Os(e[d][s],n[d])||"inherit",p=Os(e[f][s],n[f])||"inherit";return`light-dark(${h}, ${p});${u}`}return c}return o==="css-vars"?u:null}).filter(a=>!!a).join(";")}function Vf(t,e,n,r={meta:{},options:n,codeToHast:(i,s)=>Vf(t,i,s),codeToTokens:(i,s)=>Hf(t,i,s)}){let i=e;for(const p of Ff(n))i=p.preprocess?.call(r,i,n)||i;let{tokens:s,fg:o,bg:a,themeName:l,rootStyle:c,grammarState:u}=Hf(t,i,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?s=NV(s):d==="never"&&(s=$V(s)),f&&(s=FV(s));const h={...r,get source(){return i}};for(const p of Ff(n))s=p.tokens?.call(h,s)||s;return PV(s,{...n,fg:o,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},h,u)}function PV(t,e,n,r=Dc(t)){const i=Ff(e),s=[],o={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(const[m,g]of Object.entries(e.meta||{}))m.startsWith("_")||(c[m]=g);let u={type:"element",tagName:"pre",properties:c,children:[]},d={type:"element",tagName:"code",properties:{},children:s};const f=[],h={...n,structure:a,addClassToHast:L9,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(t.forEach((m,g)=>{g&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&s.push({type:"text",value:` `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},v=0;for(const w of m){let _={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]};const k=jg(w.htmlStyle||$f(w));k&&(_.properties.style=k);for(const S of i)_=S?.span?.call(h,_,g+1,v,y,w)||_;a==="inline"?o.children.push(_):a==="classic"&&y.children.push(_),v+=w.content.length}if(a==="classic"){for(const w of i)y=w?.line?.call(h,y,g+1)||y;f.push(y),s.push(y)}else a==="inline"&&f.push(y)}),a==="classic"){for(const m of i)d=m?.code?.call(h,d)||d;u.children.push(d);for(const m of i)u=m?.pre?.call(h,u)||u;o.children.push(u)}else if(a==="inline"){const m=[];let g={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const w of o.children)w.type==="element"&&w.tagName==="br"?(m.push(g),g={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(w.type==="element"||w.type==="text")&&g.children.push(w);m.push(g);let v={type:"element",tagName:"code",properties:{},children:m};for(const w of i)v=w?.code?.call(h,v)||v;o.children=[];for(let w=0;w0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const _=v.children[w];_.type==="element"&&o.children.push(..._.children)}}let p=o;for(const m of i)p=m?.root?.call(h,p)||p;return r&&Z0(p,r),p}function NV(t){return t.map(e=>{const n=[];let r="",i;return e.forEach((s,o)=>{const l=!(s.fontStyle&&(s.fontStyle&Mn.Underline||s.fontStyle&Mn.Strikethrough));l&&s.content.match(/^\s+$/)&&e[o+1]?(i===void 0&&(i=s.offset),r+=s.content):r?(l?n.push({...s,offset:i,content:r+s.content}):n.push({content:r,offset:i},s),i=void 0,r=""):n.push(s)}),n})}function $V(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,s,o]=r;if(!i&&!o)return n;const a=[{...n,offset:n.offset+i.length,content:s}];return i&&a.unshift({content:i,offset:n.offset}),o&&a.push({content:o,offset:n.offset+i.length+s.length}),a}))}function FV(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],s=jg(i.htmlStyle||$f(i)),o=jg(r.htmlStyle||$f(r)),a=i.fontStyle&&(i.fontStyle&Mn.Underline||i.fontStyle&Mn.Strikethrough),l=r.fontStyle&&(r.fontStyle&Mn.Underline||r.fontStyle&Mn.Strikethrough);!a&&!l&&s===o?i.content+=r.content:n.push({...r})}return n})}const HV=gi;function VV(t,e,n){const r={meta:{},options:n,codeToHast:(s,o)=>Vf(t,s,o),codeToTokens:(s,o)=>Hf(t,s,o)};let i=HV(Vf(t,e,n,r));for(const s of Ff(n))i=s.postprocess?.call(r,i,n)||i;return i}const I6={light:"#333333",dark:"#bbbbbb"},O6={light:"#fffffe",dark:"#1e1e1e"},D6="__shiki_resolved";function Y0(t){if(t?.[D6])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){const a=e.settings?e.settings.find(l=>!l.name&&!l.scope):void 0;a?.settings?.foreground&&(r=a.settings.foreground),a?.settings?.background&&(n=a.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?I6.light:I6.dark),n||(n=e.type==="light"?O6.light:O6.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const s=new Map;function o(a){if(s.has(a))return s.get(a);i+=1;const l=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?o(a):(s.set(a,l),l)}e.settings=e.settings.map(a=>{const l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),c=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!c)return a;const u={...a,settings:{...a.settings}};if(l){const d=o(a.settings.foreground);e.colorReplacements[d]=a.settings.foreground,u.settings.foreground=d}if(c){const d=o(a.settings.background);e.colorReplacements[d]=a.settings.background,u.settings.background=d}return u});for(const a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){const l=o(e.colors[a]);e.colorReplacements[l]=e.colors[a],e.colors[a]=l}return Object.defineProperty(e,D6,{enumerable:!1,writable:!1,value:!0}),e}async function O9(t){return Array.from(new Set((await Promise.all(t.filter(e=>!E9(e)).map(async e=>await C9(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function D9(t){return(await Promise.all(t.map(async n=>T9(n)?null:Y0(await C9(n))))).filter(n=>!!n)}let zV=3;function BV(t,e=3){e>zV||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let xa=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function R9(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new xa(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class qV extends WF{constructor(e,n,r,i={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=Y0(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=If.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=R9(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,n.size)for(const s of n)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.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 n=Array.from(this._langGraph.entries()),r=n.filter(([i,s])=>!s);if(r.length){const i=n.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(l=>r.map(([c])=>c).includes(l)):!1).filter(s=>!r.includes(s));throw new xa(`Missing languages ${r.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of n)this._resolver.addLanguage(s);for(const[i,s]of n)this.loadLanguage(s)}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 n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class jV{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}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(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let i=1;i<=n.length;i++){const s=n.slice(0,i).join(".");r=[...r,...this._injections.get(s)||[]]}return r}}let Fl=0;function UV(t){Fl+=1,t.warnings!==!1&&Fl>=10&&Fl%10===0&&console.warn(`[Shiki] ${Fl} 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 e=!1;if(!t.engine)throw new xa("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(Y0),i=new jV(t.engine,n),s=new qV(i,r,n,t.langAlias);let o;function a(w){return R9(w,t.langAlias)}function l(w){y();const _=s.getGrammar(typeof w=="string"?w:w.name);if(!_)throw new xa(`Language \`${w}\` not found, you may need to load it first`);return _}function c(w){if(w==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const _=s.getTheme(w);if(!_)throw new xa(`Theme \`${w}\` not found, you may need to load it first`);return _}function u(w){y();const _=c(w);o!==w&&(s.setTheme(_),o=w);const k=s.getColorMap();return{theme:_,colorMap:k}}function d(){return y(),s.getLoadedThemes()}function f(){return y(),s.getLoadedLanguages()}function h(...w){y(),s.loadLanguages(w.flat(1))}async function p(...w){return h(await O9(w))}function m(...w){y();for(const _ of w.flat(1))s.loadTheme(_)}async function g(...w){return y(),m(await D9(w))}function y(){if(e)throw new xa("Shiki instance has been disposed")}function v(){e||(e=!0,s.dispose(),Fl-=1)}return{setTheme:u,getTheme:c,getLanguage:l,getLoadedThemes:d,getLoadedLanguages:f,resolveLangAlias:a,loadLanguage:p,loadLanguageSync:h,loadTheme:g,loadThemeSync:m,dispose:v,[Symbol.dispose]:v}}async function WV(t){t.engine||BV("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([D9(t.themes||[]),O9(t.langs||[]),t.engine]);return UV({...t,themes:e,langs:n,engine:r})}async function GV(t){const e=await WV(t);return{getLastGrammarState:(...n)=>LV(e,...n),codeToTokensBase:(n,r)=>bv(e,n,r),codeToTokensWithThemes:(n,r)=>I9(e,n,r),codeToTokens:(n,r)=>Hf(e,n,r),codeToHast:(n,r)=>Vf(e,n,r),codeToHtml:(n,r)=>VV(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function KV(t){const e=t.langs,n=t.themes,r=t.engine;async function i(s){function o(d){if(typeof d=="string"){if(d=s.langAlias?.[d]||d,E9(d))return[];const f=e[d];if(!f)throw new Zt(`Language \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}function a(d){if(T9(d))return"none";if(typeof d=="string"){const f=n[d];if(!f)throw new Zt(`Theme \`${d}\` is not included in this bundle. You may want to load it from external source.`);return f}return d}const l=(s.themes??[]).map(d=>a(d)),c=(s.langs??[]).map(d=>o(d)),u=await GV({engine:s.engine??r(),...s,themes:l,langs:c});return{...u,loadLanguage(...d){return u.loadLanguage(...d.map(o))},loadTheme(...d){return u.loadTheme(...d.map(a))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return i}const P9=[{id:"abap",name:"ABAP",import:(()=>A(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>A(()=>import("./actionscript-3-CfeIJUat.js"),[]))},{id:"ada",name:"Ada",import:(()=>A(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>A(()=>import("./angular-html-CU67Zn6k.js").then(t=>t.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>A(()=>import("./angular-ts-BwZT4LLn.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>A(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>A(()=>import("./apex-DDbsPZ6N.js"),[]))},{id:"apl",name:"APL",import:(()=>A(()=>import("./apl-dKokRX4l.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>A(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>A(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>A(()=>import("./asciidoc-Dv7Oe6Be.js"),[]))},{id:"asm",name:"Assembly",import:(()=>A(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>A(()=>import("./astro-CbQHKStN.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>A(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>A(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>A(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>A(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>A(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>A(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>A(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"blade",name:"Blade",import:(()=>A(()=>import("./blade-DVc8C-J4.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>A(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>A(()=>import("./c-BIGW1oBm.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>A(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>A(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>A(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>A(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>A(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>A(()=>import("./cobol-nwyudZeR.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>A(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>A(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>A(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>A(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>A(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>A(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>A(()=>import("./crystal-tKQVLTB8.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>A(()=>import("./csharp-K5feNrxe.js"),[]))},{id:"css",name:"CSS",import:(()=>A(()=>import("./css-DPfMkruS.js"),[]))},{id:"csv",name:"CSV",import:(()=>A(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>A(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>A(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>A(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>A(()=>import("./dart-CF10PKvl.js"),[]))},{id:"dax",name:"DAX",import:(()=>A(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>A(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>A(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>A(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>A(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>A(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>A(()=>import("./edge-BkV0erSs.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>A(()=>import("./elixir-CDX3lj18.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>A(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>A(()=>import("./emacs-lisp-C9XAeP06.js"),[]))},{id:"erb",name:"ERB",import:(()=>A(()=>import("./erb-BOJIQeun.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>A(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>A(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>A(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>A(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>A(()=>import("./fortran-fixed-form-BZjJHVRy.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>A(()=>import("./fortran-free-form-D22FLkUw.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>A(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",import:(()=>A(()=>import("./gdresource-B7Tvp0Sc.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",import:(()=>A(()=>import("./gdscript-DTMYz4Jt.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>A(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>A(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>A(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>A(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>A(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>A(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>A(()=>import("./glimmer-js-Rg0-pVw9.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>A(()=>import("./glimmer-ts-U6CK756n.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>A(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gnuplot",name:"Gnuplot",import:(()=>A(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>A(()=>import("./go-Dn2_MT6a.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>A(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>A(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>A(()=>import("./hack-CaT9iCJl.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>A(()=>import("./haml-B8DHNrY2.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>A(()=>import("./handlebars-BL8al0AC.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>A(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>A(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>A(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>A(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>A(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>A(()=>import("./html-GMplVEZG.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>A(()=>import("./html-derivative-BFtXZ54Q.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>A(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>A(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>A(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>A(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>A(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>A(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>A(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>A(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>A(()=>import("./jinja-4LBKfQ-Z.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>A(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>A(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>A(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>A(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>A(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>A(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>A(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>A(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>A(()=>import("./julia-C8NyazO9.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"kdl",name:"KDL",import:(()=>A(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>A(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>A(()=>import("./kusto-BvAqAH-y.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>A(()=>import("./latex-BdAV_C_H.js"),__vite__mapDeps([63,64,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>A(()=>import("./lean-Bc6EcWN3.js"),[]))},{id:"less",name:"Less",import:(()=>A(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>A(()=>import("./liquid-DYVedYrR.js"),__vite__mapDeps([65,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>A(()=>import("./llvm-BtvRca6l.js"),[]))},{id:"log",name:"Log file",import:(()=>A(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>A(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>A(()=>import("./lua-BbnMAYS6.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>A(()=>import("./luau-CXu1NL6O.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>A(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>A(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>A(()=>import("./marko-CPi9NSCl.js"),__vite__mapDeps([66,3,67,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>A(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>A(()=>import("./mdc-DUICxH0z.js"),__vite__mapDeps([68,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>A(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>A(()=>import("./mermaid-DKYwYmdq.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>A(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>A(()=>import("./mojo-1DNp92w6.js"),[]))},{id:"move",name:"Move",import:(()=>A(()=>import("./move-Bu9oaDYs.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>A(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>A(()=>import("./nextflow-BrzmwbiE.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>A(()=>import("./nginx-DknmC5AR.js"),__vite__mapDeps([69,37,26])))},{id:"nim",name:"Nim",import:(()=>A(()=>import("./nim-CVrawwO9.js"),__vite__mapDeps([70,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>A(()=>import("./nix-c8nO5XWb.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>A(()=>import("./nushell-C-sUppwS.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>A(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>A(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>A(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>A(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>A(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>A(()=>import("./perl-C0TMdlhV.js"),__vite__mapDeps([71,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>A(()=>import("./php-CDn_0X-4.js"),__vite__mapDeps([72,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>A(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>A(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>A(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>A(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>A(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>A(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>A(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>A(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>A(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>A(()=>import("./proto-DyJlTyXw.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>A(()=>import("./pug-CGlum2m_.js"),__vite__mapDeps([73,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>A(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>A(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>A(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>A(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([74,2])))},{id:"qmldir",name:"QML Directory",import:(()=>A(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>A(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>A(()=>import("./r-DiinP2Uv.js"),[]))},{id:"racket",name:"Racket",import:(()=>A(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>A(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>A(()=>import("./razor-CE9lU5zL.js"),__vite__mapDeps([75,1,2,3,76])))},{id:"reg",name:"Windows Registry Script",import:(()=>A(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>A(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>A(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>A(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>A(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>A(()=>import("./rst-B0xPkSld.js"),__vite__mapDeps([77,15,1,2,3,23,24,25,26,16,20,28,38,78,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>A(()=>import("./ruby-BvKwtOVI.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>A(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>A(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([79,16])))},{id:"sass",name:"Sass",import:(()=>A(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>A(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>A(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>A(()=>import("./scss-OYdSNvt2.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>A(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>A(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([80,81])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>A(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>A(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([82,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>A(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>A(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>A(()=>import("./soy-Brmx7dQM.js"),__vite__mapDeps([83,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>A(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([84,85])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>A(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>A(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>A(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>A(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([86,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>A(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"svelte",name:"Svelte",import:(()=>A(()=>import("./svelte-3Dk4HxPD.js"),__vite__mapDeps([87,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>A(()=>import("./swift-Dg5xB15N.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>A(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>A(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>A(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>A(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>A(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>A(()=>import("./templ-W15q3VgB.js"),__vite__mapDeps([88,89,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>A(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>A(()=>import("./tex-CxkMU7Pf.js"),__vite__mapDeps([64,62])))},{id:"toml",name:"TOML",import:(()=>A(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>A(()=>import("./ts-tags-zn1MmPIZ.js"),__vite__mapDeps([90,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>A(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>A(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>A(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>A(()=>import("./twig-CO9l9SDP.js"),__vite__mapDeps([91,3,2,5,72,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>A(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>A(()=>import("./typespec-BGHnOYBU.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>A(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>A(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>A(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>A(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>A(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>A(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>A(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>A(()=>import("./vue-DnHKYNfI.js"),__vite__mapDeps([92,3,2,11,9,15,1])))},{id:"vue-html",name:"Vue HTML",import:(()=>A(()=>import("./vue-html-CChd_i61.js"),__vite__mapDeps([93,92,3,2,11,9,15,1])))},{id:"vue-vine",name:"Vue Vine",import:(()=>A(()=>import("./vue-vine-8moa0y9V.js"),__vite__mapDeps([94,3,5,67,95,12,92,2,11,9,15,1])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>A(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>A(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>A(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>A(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>A(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>A(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>A(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>A(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>A(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([96,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>A(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>A(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>A(()=>import("./zig-VOosw3JB.js"),[]))}],ZV=Object.fromEntries(P9.map(t=>[t.id,t.import])),YV=Object.fromEntries(P9.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),Rc={...ZV,...YV},QV=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>A(()=>import("./andromeeda-C-Jbm3Hp.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>A(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>A(()=>import("./ayu-dark-Cv9koXgw.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>A(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>A(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>A(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>A(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>A(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>A(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>A(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>A(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>A(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>A(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>A(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>A(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>A(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>A(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>A(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>A(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>A(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>A(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>A(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>A(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>A(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>A(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>A(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>A(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>A(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>A(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>A(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>A(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>A(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>A(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>A(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>A(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>A(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>A(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>A(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>A(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>A(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>A(()=>import("./one-light-PoHY5YXO.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>A(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>A(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>A(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>A(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>A(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>A(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>A(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>A(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>A(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>A(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>A(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>A(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>A(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>A(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>A(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>A(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>A(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],N9=Object.fromEntries(QV.map(t=>[t.id,t.import]));class kv extends Error{constructor(e){super(e),this.name="ShikiError"}}function XV(){return 2147483648}function JV(){return typeof performance<"u"?performance.now():Date.now()}const ez=(t,e)=>t+(e-t%e)%e;async function tz(t){let e,n;const r={};function i(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function s(h,p,m){r.HEAPU8.copyWithin(h,p,p+m)}function o(h){try{return e.grow(h-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function a(h){const p=r.HEAPU8.length;h=h>>>0;const m=XV();if(h>m)return!1;for(let g=1;g<=4;g*=2){let y=p*(1+.2/g);y=Math.min(y,h+100663296);const v=Math.min(m,ez(Math.max(h,y),65536));if(o(v))return!0}return!1}const l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(h,p,m=1024){const g=p+m;let y=p;for(;h[y]&&!(y>=g);)++y;if(y-p>16&&h.buffer&&l)return l.decode(h.subarray(p,y));let v="";for(;p>10,56320|S&1023)}}return v}function u(h,p){return h?c(r.HEAPU8,h,p):""}const d={emscripten_get_now:JV,emscripten_memcpy_big:s,emscripten_resize_heap:a,fd_write:()=>0};async function f(){const p=await t({env:d,wasi_snapshot_preview1:d});e=p.memory,i(e.buffer),Object.assign(r,p),r.UTF8ToString=u}return await f(),r}var nz=Object.defineProperty,rz=(t,e,n)=>e in t?nz(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,nn=(t,e,n)=>rz(t,typeof e!="symbol"?e+"":e,n);let un=null;function iz(t){throw new kv(t.UTF8ToString(t.getLastOnigError()))}class Q0{constructor(e){nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16Value"),nn(this,"utf8Value"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16");const n=e.length,r=Q0._utf8ByteLength(e),i=r!==n,s=i?new Uint32Array(n+1):null;i&&(s[n]=r);const o=i?new Uint32Array(r+1):null;i&&(o[r]=n);const a=new Uint8Array(r);let l=0;for(let c=0;c=55296&&u<=56319&&c+1=56320&&h<=57343&&(d=(u-55296<<10)+65536|h-56320,f=!0)}i&&(s[c]=l,f&&(s[c+1]=l),d<=127?o[l+0]=c:d<=2047?(o[l+0]=c,o[l+1]=c):d<=65535?(o[l+0]=c,o[l+1]=c,o[l+2]=c):(o[l+0]=c,o[l+1]=c,o[l+2]=c,o[l+3]=c)),d<=127?a[l++]=d:d<=2047?(a[l++]=192|(d&1984)>>>6,a[l++]=128|(d&63)>>>0):d<=65535?(a[l++]=224|(d&61440)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0):(a[l++]=240|(d&1835008)>>>18,a[l++]=128|(d&258048)>>>12,a[l++]=128|(d&4032)>>>6,a[l++]=128|(d&63)>>>0),f&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r=55296&&s<=56319&&r+1=56320&&l<=57343&&(o=(s-55296<<10)+65536|l-56320,a=!0)}o<=127?n+=1:o<=2047?n+=2:o<=65535?n+=3:n+=4,a&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const X0=class oi{constructor(e){if(nn(this,"id",++oi.LAST_ID),nn(this,"_onigBinding"),nn(this,"content"),nn(this,"utf16Length"),nn(this,"utf8Length"),nn(this,"utf16OffsetToUtf8"),nn(this,"utf8OffsetToUtf16"),nn(this,"ptr"),!un)throw new kv("Must invoke loadWasm first.");this._onigBinding=un,this.content=e;const n=new Q0(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!oi._sharedPtrInUse?(oi._sharedPtr||(oi._sharedPtr=un.omalloc(1e4)),oi._sharedPtrInUse=!0,un.HEAPU8.set(n.utf8Value,oi._sharedPtr),this.ptr=oi._sharedPtr):this.ptr=n.createString(un)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===oi._sharedPtr?oi._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};nn(X0,"LAST_ID",0);nn(X0,"_sharedPtr",0);nn(X0,"_sharedPtrInUse",!1);let $9=X0;class sz{constructor(e){if(nn(this,"_onigBinding"),nn(this,"_ptr"),!un)throw new kv("Must invoke loadWasm first.");const n=[],r=[];for(let a=0,l=e.length;a{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),oz(r)?r=await r.instantiator(n):az(r)?r=await r.default(n):(lz(r)&&(r=r.data),cz(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await fz(r)(n):r=await hz(r)(n):uz(r)?r=await Rp(r)(n):r instanceof WebAssembly.Module?r=await Rp(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Rp(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return ld=e(),ld}function Rp(t){return e=>WebAssembly.instantiate(t,e)}function fz(t){return e=>WebAssembly.instantiateStreaming(t,e)}function hz(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function F9(t){return t&&await dz(t),{createScanner(e){return new sz(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new $9(e)}}}const pz=KV({langs:Rc,themes:N9,engine:()=>F9(A(()=>import("./wasm-CG6Dc4jp.js"),[]))});function pl(t){if([...t].length!==1)throw new Error(`Expected "${t}" to be a single code point`);return t.codePointAt(0)}function mz(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}const xv=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),mn=String.raw;function ml(t,e){if(t==null)throw new Error(e??"Value expected");return t}const H9=mn`\[\^?`,V9=`c.? | C(?:-.?)?|${mn`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${mn`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${mn`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${mn`o\{[^\}]*\}?`}|${mn`\d{1,3}`}`,Sv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,cd=new RegExp(mn` \\ (?: ${V9} | [gk]<[^>]*>? | [gk]'[^']*'? | . ) | \( (?: \? (?: [:=!>({] | <[=!] | <[^>]*> | '[^']*' | ~\|? | #(?:[^)\\]|\\.?)* | [^:)]*[:)] )? | \*[^\)]*\)? )? | (?:${Sv.source})+ | ${H9} | . `.replace(/\s+/g,""),"gsu"),Pp=new RegExp(mn` \\ (?: ${V9} | . ) | \[:(?:\^?\p{Alpha}+|\^):\] | ${H9} | && | . `.replace(/\s+/g,""),"gsu");function gz(t,e={}){const n={flags:"",...e,rules:{captureGroup:!1,singleline:!1,...e.rules}};if(typeof t!="string")throw new Error("String expected as pattern");const r=Pz(n.flags),i=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(d){i.push(d)},replaceCurrentModX(d){i[i.length-1]=d},singleline:n.rules.singleline};let o=[],a;for(cd.lastIndex=0;a=cd.exec(t);){const d=yz(s,t,a[0],cd.lastIndex);d.tokens?o.push(...d.tokens):d.token&&o.push(d.token),d.lastIndex!==void 0&&(cd.lastIndex=d.lastIndex)}const l=[];let c=0;o.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});const u=c||l.length;return{tokens:o.map(d=>d.type==="EscapedNumber"?$z(d,u):d).flat(),flags:r}}function yz(t,e,n,r){const[i,s]=n;if(n==="["||n==="[^"){const o=vz(e,n,r);return{tokens:o.tokens,lastIndex:o.lastIndex}}if(i==="\\"){if("AbBGyYzZ".includes(s))return{token:R6(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Lz(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:B9(n)}}if(s==="K")return{token:q9("keep",n)};if(s==="N"||s==="R")return{token:vo("newline",n,{negate:s==="N"})};if(s==="O")return{token:vo("any",n)};if(s==="X")return{token:vo("text_segment",n)};const o=z9(n,{inCharClass:!1});return Array.isArray(o)?{tokens:o}:{token:o}}if(i==="("){if(s==="*")return{token:Oz(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(e[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Iz(n,t)};if(t.pushModX(t.getCurrentModX()),t.numOpenGroups++,n==="("&&!t.captureGroup||n==="(?:")return{token:pa("group",n)};if(n==="(?>")return{token:pa("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?")||n.startsWith("(?'")&&n.endsWith("'"))return{token:pa("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:pa("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(t.popModX(),t.numOpenGroups--,t.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Cz(n)}}if(t.getCurrentModX()){if(n==="#"){const o=e.indexOf(` `,r);return{lastIndex:o===-1?e.length:o}}if(/^\s$/.test(n)){const o=/\s+/y;return o.lastIndex=r,{lastIndex:o.exec(e)?o.lastIndex:r}}}if(n===".")return{token:vo("dot",n)};if(n==="^"||n==="$"){const o=t.singleline?{"^":mn`\A`,$:mn`\Z`}[n]:n;return{token:R6(o,n)}}return n==="|"?{token:wz(n)}:Sv.test(n)?{tokens:Fz(n)}:{token:Ui(pl(n),n)}}function vz(t,e,n){const r=[P6(e[1]==="^",e)];let i=1,s;for(Pp.lastIndex=n;s=Pp.exec(t);){const o=s[0];if(o[0]==="["&&o[1]!==":")i++,r.push(P6(o[1]==="^",o));else if(o==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Ui(93,o));else if(i--,r.push(kz(o)),!i)break}else{const a=bz(o);Array.isArray(a)?r.push(...a):r.push(a)}}return{tokens:r,lastIndex:Pp.lastIndex||t.length}}function bz(t){if(t[0]==="\\")return z9(t,{inCharClass:!0});if(t[0]==="["){const e=/\[:(?\^?)(?[a-z]+):\]/.exec(t);if(!e||!xv.has(e.groups.name))throw new Error(`Invalid POSIX class "${t}"`);return vo("posix",t,{value:e.groups.name,negate:!!e.groups.negate})}return t==="-"?xz(t):t==="&&"?Sz(t):Ui(pl(t),t)}function z9(t,{inCharClass:e}){const n=t[1];if(n==="c"||n==="C")return Mz(t);if("dDhHsSwW".includes(n))return Dz(t);if(t.startsWith(mn`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${t}"`);if(/^\\[pP]\{/.test(t)){if(t.length===3)throw new Error(`Incomplete or invalid Unicode property "${t}"`);return Rz(t)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(t))try{const r=t.split(/\\x/).slice(1).map(o=>parseInt(o,16)),i=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...i].map(o=>{const a=[...s.encode(o)].map(l=>`\\x${l.toString(16)}`).join("");return Ui(pl(o),a)})}catch{throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Ui(Nz(t),t);if(N6.has(n))return Ui(N6.get(n),t);if(/\d/.test(n))return _z(e,t);if(t==="\\")throw new Error(mn`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${t}"`);if([...t].length===2)return Ui(t.codePointAt(1),t);throw new Error(`Unexpected escape "${t}"`)}function wz(t){return{type:"Alternator",raw:t}}function R6(t,e){return{type:"Assertion",kind:t,raw:e}}function B9(t){return{type:"Backreference",raw:t}}function Ui(t,e){return{type:"Character",value:t,raw:e}}function kz(t){return{type:"CharacterClassClose",raw:t}}function xz(t){return{type:"CharacterClassHyphen",raw:t}}function Sz(t){return{type:"CharacterClassIntersector",raw:t}}function P6(t,e){return{type:"CharacterClassOpen",negate:t,raw:e}}function vo(t,e,n={}){return{type:"CharacterSet",kind:t,...n,raw:e}}function q9(t,e,n={}){return t==="keep"?{type:"Directive",kind:t,raw:e}:{type:"Directive",kind:t,flags:ml(n.flags),raw:e}}function _z(t,e){return{type:"EscapedNumber",inCharClass:t,raw:e}}function Cz(t){return{type:"GroupClose",raw:t}}function pa(t,e,n={}){return{type:"GroupOpen",kind:t,...n,raw:e}}function Ez(t,e,n,r){return{type:"NamedCallout",kind:t,tag:e,arguments:n,raw:r}}function Tz(t,e,n,r){return{type:"Quantifier",kind:t,min:e,max:n,raw:r}}function Lz(t){return{type:"Subroutine",raw:t}}const Az=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),N6=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Mz(t){const e=t[1]==="c"?t[2]:t[3];if(!e||!/[A-Za-z]/.test(e))throw new Error(`Unsupported control character "${t}"`);return Ui(pl(e.toUpperCase())-64,t)}function Iz(t,e){let{on:n,off:r}=/^\(\?(?[imx]*)(?:-(?[-imx]*))?/.exec(t).groups;r??="";const i=(e.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=F6(n),o=F6(r),a={};if(s&&(a.enable=s),o&&(a.disable=o),t.endsWith(")"))return e.replaceCurrentModX(i),q9("flags",t,{flags:a});if(t.endsWith(":"))return e.pushModX(i),e.numOpenGroups++,pa("group",t,{...(s||o)&&{flags:a}});throw new Error(`Unexpected flag modifier "${t}"`)}function Oz(t){const e=/\(\*(?[A-Za-z_]\w*)?(?:\[(?(?:[A-Za-z_]\w*)?)\])?(?:\{(?[^}]*)\})?\)/.exec(t);if(!e)throw new Error(`Incomplete or invalid named callout "${t}"`);const{name:n,tag:r,args:i}=e.groups;if(!n)throw new Error(`Invalid named callout "${t}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${t}"`);const s=i?i.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[o,a,l]=s,c=Az.has(n)?n.toLowerCase():"custom";switch(c){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 o=="string")throw new Error(`Named callout argument must be a number "${o}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(s.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);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 o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof o=="string"&&!/^[A-Za-z_]\w*$/.test(o))throw new Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Ez(c,r??null,i?.split(",")??null,t)}function $6(t){let e=null,n,r;if(t[0]==="{"){const{minStr:i,maxStr:s}=/^\{(?\d*)(?:,(?\d*))?/.exec(t).groups,o=1e5;if(+i>o||s&&+s>o)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+i,r=s===void 0?+i:s===""?1/0:+s,n>r&&(e="possessive",[n,r]=[r,n]),t.endsWith("?")){if(e==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');e="lazy"}else e||(e="greedy")}else n=t[0]==="+"?1:0,r=t[0]==="?"?1:1/0,e=t[1]==="+"?"possessive":t[1]==="?"?"lazy":"greedy";return Tz(e,n,r,t)}function Dz(t){const e=t[1].toLowerCase();return vo({d:"digit",h:"hex",s:"space",w:"word"}[e],t,{negate:t[1]!==e})}function Rz(t){const{p:e,neg:n,value:r}=/^\\(?

    [pP])\{(?\^?)(?[^}]+)/.exec(t).groups;return vo("property",t,{value:r,negate:e==="P"&&!n||e==="p"&&!!n})}function F6(t){const e={};return t.includes("i")&&(e.ignoreCase=!0),t.includes("m")&&(e.dotAll=!0),t.includes("x")&&(e.extended=!0),Object.keys(e).length?e:null}function Pz(t){const e={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n\p{AHex}+)/u.exec(t).groups.hex:t.slice(2);return parseInt(e,16)}function $z(t,e){const{raw:n,inCharClass:r}=t,i=n.slice(1);if(!r&&(i!=="0"&&i.length===1||i[0]!=="0"&&+i<=e))return[B9(n)];const s=[],o=i.match(/^[0-7]+|\d/g);for(let a=0;a127)throw new Error(mn`Octal encoded byte above 177 unsupported "${n}"`)}else c=pl(l);s.push(Ui(c,(a===0?"\\":"")+l))}return s}function Fz(t){const e=[],n=new RegExp(Sv,"gy");let r;for(;r=n.exec(t);){const i=r[0];if(i[0]==="{"){const s=/^\{(?\d+),(?\d+)\}\??$/.exec(i);if(s){const{min:o,max:a}=s.groups;if(+o>+a&&i.endsWith("?")){n.lastIndex--,e.push($6(i.slice(0,-1)));continue}}}e.push($6(i))}return e}function j9(t,e){if(!Array.isArray(t.body))throw new Error("Expected node with body array");if(t.body.length!==1)return!1;const n=t.body[0];return!e||Object.keys(e).every(r=>e[r]===n[r])}function Hz(t){return Vz.has(t.type)}const Vz=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function U9(t,e={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e,rules:{captureGroup:!1,singleline:!1,...e.rules}},r=gz(t,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(f,h)=>{const p=r.tokens[s.nextIndex];switch(s.parent=f,s.nextIndex++,p.type){case"Alternator":return Eo();case"Assertion":return zz(p);case"Backreference":return Bz(p,s);case"Character":return J0(p.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return qz(p,s,h);case"CharacterClassOpen":return jz(p,s,h);case"CharacterSet":return Uz(p,s);case"Directive":return Qz(p.kind,{flags:p.flags});case"GroupOpen":return Wz(p,s,h);case"NamedCallout":return Jz(p.kind,p.tag,p.arguments);case"Quantifier":return Gz(p,s);case"Subroutine":return Kz(p,s);default:throw new Error(`Unexpected token type "${p.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:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=tB(Xz(r.flags));let a=o.body[0];for(;s.nextIndexl.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(mn`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(mn`Subroutine uses a group name that's not defined "\g<${f}>"`);return o}function zz({kind:t}){return Ug(ml({"^":"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"}[t],`Unexpected assertion kind "${t}"`),{negate:t===mn`\B`||t===mn`\Y`})}function Bz({raw:t},e){const n=/^\\k[<']/.test(t),r=n?t.slice(3,-1):t.slice(1),i=(s,o=!1)=>{const a=e.capturingGroups.length;let l=!1;if(s>a)if(e.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${t}"`);return e.hasNumberedRef=!0,Wg(o?a+1-s:s,{orphan:l})};if(n){const s=/^(?-?)0*(?[1-9]\d*)$/.exec(r);if(s)return i(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${t}"`);if(!e.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${t}"`);return Wg(r)}return i(+r)}function qz(t,e,n){const{tokens:r,walk:i}=e,s=e.parent,o=s.body.at(-1),a=r[e.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!=="CharacterClass"&&o.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){const l=i(s,{...n,isCheckingRangeEnd:!0});if(o.type==="Character"&&l.type==="Character")return s.body.pop(),Yz(o,l);throw new Error("Invalid character class range")}return J0(pl("-"))}function jz({negate:t},e,n){const{tokens:r,walk:i}=e,s=r[e.nextIndex],o=[Xd()];let a=z6(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(Xd()),e.nextIndex++;else{const c=o.at(-1);c.body.push(i(c,n))}a=z6(r[e.nextIndex],s)}const l=Xd({negate:t});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),e.nextIndex++,l}function Uz({kind:t,negate:e,value:n},r){const{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o}=r;if(t==="property"){const a=eh(n);if(xv.has(a)&&!o?.has(a))t="posix",n=a;else return ma(n,{negate:e,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:s,unicodePropertyMap:o})}return t==="posix"?eB(n,{negate:e}):Gg(t,{negate:e})}function Wz(t,e,n){const{tokens:r,capturingGroups:i,namedGroupsByName:s,skipLookbehindValidation:o,walk:a}=e,l=nB(t),c=l.type==="AbsenceFunction",u=V6(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(i.push(l),l.name&&mz(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=B6(r[e.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(Eo()),e.nextIndex++;else{const h=l.body.at(-1),p=a(h,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(h.body.push(p),(u||n.isInLookbehind)&&!o){const m="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(H6(p)||p.type==="CapturingGroup")throw new Error(m)}else if(H6(p)||V6(p)&&p.negate)throw new Error(m)}}f=B6(r[e.nextIndex])}return e.nextIndex++,l}function Gz({kind:t,min:e,max:n},r){const i=r.parent,s=i.body.at(-1);if(!s||!Hz(s))throw new Error("Quantifier requires a repeatable token");const o=G9(t,e,n,s);return i.body.pop(),o}function Kz({raw:t},e){const{capturingGroups:n,subroutines:r}=e;let i=t.slice(3,-1);const s=/^(?[-+]?)0*(?[1-9]\d*)$/.exec(i);if(s){const a=+s.groups.num,l=n.length;if(e.hasNumberedRef=!0,i={"":a,"+":l+a,"-":l+1-a}[s.groups.sign],i<1)throw new Error("Invalid subroutine number")}else i==="0"&&(i=0);const o=K9(i);return r.push(o),o}function Zz(t,e){return{type:"AbsenceFunction",kind:t,body:ku(e?.body)}}function Eo(t){return{type:"Alternative",body:Z9(t?.body)}}function Ug(t,e){const n={type:"Assertion",kind:t};return(t==="word_boundary"||t==="text_segment_boundary")&&(n.negate=!!e?.negate),n}function Wg(t,e){const n=!!e?.orphan;return{type:"Backreference",ref:t,...n&&{orphan:n}}}function W9(t,e){const n={name:void 0,isSubroutined:!1,...e};if(n.name!==void 0&&!rB(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:t,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:ku(e?.body)}}function J0(t,e){const n={useLastValid:!1,...e};if(t>1114111){const r=t.toString(16);if(n.useLastValid)t=1114111;else throw t>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:t}}function Xd(t){const e={kind:"union",negate:!1,...t};return{type:"CharacterClass",kind:e.kind,negate:e.negate,body:Z9(t?.body)}}function Yz(t,e){if(e.valuen)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:t,min:e,max:n,body:r}}function tB(t,e){return{type:"Regex",body:ku(e?.body),flags:t}}function K9(t){return{type:"Subroutine",ref:t}}function ma(t,e){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...e};let r=n.unicodePropertyMap?.get(eh(t));if(!r){if(n.normalizeUnknownPropertyNames)r=iB(t);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(mn`Invalid Unicode property "\p{${t}}"`)}return{type:"CharacterSet",kind:"property",value:r??t,negate:n.negate}}function nB({flags:t,kind:e,name:n,negate:r,number:i}){switch(e){case"absence_repeater":return Zz("repeater");case"atomic":return Wr({atomic:!0});case"capturing":return W9(i,{name:n});case"group":return Wr({flags:t});case"lookahead":case"lookbehind":return po({behind:e==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${e}"`)}}function ku(t){if(t===void 0)t=[Eo()];else if(!Array.isArray(t)||!t.length||!t.every(e=>e.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return t}function Z9(t){if(t===void 0)t=[];else if(!Array.isArray(t)||!t.every(e=>!!e.type))throw new Error("Invalid body; expected array of nodes");return t}function H6(t){return t.type==="LookaroundAssertion"&&t.kind==="lookahead"}function V6(t){return t.type==="LookaroundAssertion"&&t.kind==="lookbehind"}function rB(t){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(t)}function iB(t){return t.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function eh(t){return t.replace(/[- _]+/g,"").toLowerCase()}function z6(t,e){return ml(t,`${e?.type==="Character"&&e.value===93?"Empty":"Unclosed"} character class`)}function B6(t){return ml(t,"Unclosed group")}function hc(t,e,n=null){function r(s,o){for(let a=0;aA-Za-z\-]|<[=!]|\(DEFINE\))`;function oB(t,e){for(let n=0;n=e&&t[n]++}function aB(t,e,n,r){return t.slice(0,e)+r+t.slice(e+n.length)}const Tr=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function _v(t,e,n,r){const i=new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1];let o=0,a="";for(const l of t.matchAll(i)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===Tr.DEFAULT==!o)){n instanceof Function?a+=n(l,{context:o?Tr.CHAR_CLASS:Tr.DEFAULT,negated:s[s.length-1]}):a+=n;continue}c[0]==="["?(o++,s.push(c[1]==="^")):c==="]"&&o&&(o--,s.pop()),a+=c}return a}function Y9(t,e,n,r){_v(t,e,n,r)}function lB(t,e,n=0,r){if(!new RegExp(e,"su").test(t))return null;const i=new RegExp(`${e}|(?<$skip>\\\\?.)`,"gsu");i.lastIndex=n;let s=0,o;for(;o=i.exec(t);){const{0:a,groups:{$skip:l}}=o;if(!l&&(!r||r===Tr.DEFAULT==!s))return o;a==="["?s++:a==="]"&&s&&s--,i.lastIndex==o.index&&i.lastIndex++}return null}function dd(t,e,n){return!!lB(t,e,0,n)}function cB(t,e){const n=/\\?./gsu;n.lastIndex=e;let r=t.length,i=0,s=1,o;for(;o=n.exec(t);){const[a]=o;if(a==="[")i++;else if(i)a==="]"&&i--;else if(a==="(")s++;else if(a===")"&&(s--,!s)){r=o.index;break}}return t.slice(e,r)}const q6=new RegExp(String.raw`(?${sB})|(?\((?:\?<[^>]+>)?)|\\?.`,"gsu");function uB(t,e){const n=e?.hiddenCaptures??[];let r=e?.captureTransfers??new Map;if(!/\(\?>/.test(t))return{pattern:t,captureTransfers:r,hiddenCaptures:n};const i="(?>",s="(?:(?=(",o=[0],a=[];let l=0,c=0,u=NaN,d;do{d=!1;let f=0,h=0,p=!1,m;for(q6.lastIndex=Number.isNaN(u)?0:u+s.length;m=q6.exec(t);){const{0:g,index:y,groups:{capturingStart:v,noncapturingStart:w}}=m;if(g==="[")f++;else if(f)g==="]"&&f--;else if(g===i&&!p)u=y,p=!0;else if(p&&w)h++;else if(v)p?h++:(l++,o.push(l+c));else if(g===")"&&p){if(!h){c++;const _=l+c;if(t=`${t.slice(0,u)}${s}${t.slice(u+i.length,y)}))<$$${_}>)${t.slice(y+1)}`,d=!0,a.push(_),oB(n,_),r.size){const k=new Map;r.forEach((S,L)=>{k.set(L>=_?L+1:L,S.map(E=>E>=_?E+1:E))}),r=k}break}h--}}}while(d);return n.push(...a),t=_v(t,String.raw`\\(?[1-9]\d*)|<\$\$(?\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:p}})=>{if(h){const m=+h;if(m>o.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${o[m]}`}return`\\${p}`},Tr.DEFAULT),{pattern:t,captureTransfers:r,hiddenCaptures:n}}const Q9=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Np=new RegExp(String.raw` \\(?: \d+ | c[A-Za-z] | [gk]<[^>]+> | [pPu]\{[^\}]+\} | u[A-Fa-f\d]{4} | x[A-Fa-f\d]{2} ) | \((?: \? (?: [:=!>] | <(?:[=!]|[^>]+>) | [A-Za-z\-]+: | \(DEFINE\) ))? | (?${Q9})(?[?+]?)(?[?*+\{]?) | \\?. `.replace(/\s+/g,""),"gsu");function dB(t){if(!new RegExp(`${Q9}\\+`).test(t))return{pattern:t};const e=[];let n=null,r=null,i="",s=0,o;for(Np.lastIndex=0;o=Np.exec(t);){const{0:a,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=o;if(a==="[")s||(r=l),s++;else if(a==="]")s?s--:r=null;else if(!s)if(u==="+"&&i&&!i.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${a}"`);let f=-1;if(/^\{\d+\}$/.test(c))t=aB(t,l+c.length,u,"");else{if(i===")"||i==="]"){const h=i===")"?n:r;if(h===null)throw new Error(`Invalid unmatched "${i}"`);t=`${t.slice(0,h)}(?>${t.slice(h,l)}${c})${t.slice(l+a.length)}`}else t=`${t.slice(0,l-i.length)}(?>${i}${c})${t.slice(l+a.length)}`;f+=4}Np.lastIndex+=f}else a[0]==="("?e.push(l):a===")"&&(n=e.length?e.pop():null);i=a}return{pattern:t}}const _r=String.raw,fB=_r`\\g<(?[^>&]+)&R=(?[^>]+)>`,Kg=_r`\(\?R=(?[^\)]+)\)|${fB}`,th=_r`\(\?<(?![=!])(?[^>]+)>`,X9=_r`${th}|(?\()(?!\?)`,ro=new RegExp(_r`${th}|${Kg}|\(\?|\\?.`,"gsu"),$p="Cannot use multiple overlapping recursions";function hB(t,e){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...e};let i=e?.captureTransfers??new Map;if(!new RegExp(Kg,"su").test(t))return{pattern:t,captureTransfers:i,hiddenCaptures:n};if(r==="plugin"&&dd(t,_r`\(\?\(DEFINE\)`,Tr.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const s=[],o=dd(t,_r`\\[1-9]`,Tr.DEFAULT),a=new Map,l=[];let c=!1,u=0,d=0,f;for(ro.lastIndex=0;f=ro.exec(t);){const{0:h,groups:{captureName:p,rDepth:m,gRNameOrNum:g,gRDepth:y}}=f;if(h==="[")u++;else if(u)h==="]"&&u--;else if(m){if(j6(m),c)throw new Error($p);if(o)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const v=t.slice(0,f.index),w=t.slice(ro.lastIndex);if(dd(w,Kg,Tr.DEFAULT))throw new Error($p);const _=+m-1;t=U6(v,w,_,!1,n,s,d),i=G6(i,v,_,s.length,0,d);break}else if(g){j6(y);let v=!1;for(const F of l)if(F.name===g||F.num===+g){if(v=!0,F.hasRecursedWithin)throw new Error($p);break}if(!v)throw new Error(_r`Recursive \g cannot be used outside the referenced group "${r==="external"?g:_r`\g<${g}&R=${y}>`}"`);const w=a.get(g),_=cB(t,w);if(o&&dd(_,_r`${th}|\((?!\?)`,Tr.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const k=t.slice(w,f.index),S=_.slice(k.length+h.length),L=s.length,E=+y-1,C=U6(k,S,E,!0,n,s,d);i=G6(i,k,E,s.length-L,L,d);const V=t.slice(0,w),R=t.slice(w+_.length);t=`${V}${C}${R}`,ro.lastIndex+=C.length-h.length-k.length-S.length,l.forEach(F=>F.hasRecursedWithin=!0),c=!0}else if(p)d++,a.set(String(d),ro.lastIndex),a.set(p,ro.lastIndex),l.push({num:d,name:p});else if(h[0]==="("){const v=h==="(";v&&(d++,a.set(String(d),ro.lastIndex)),l.push(v?{num:d}:{})}else h===")"&&l.pop()}return n.push(...s),{pattern:t,captureTransfers:i,hiddenCaptures:n}}function j6(t){const e=`Max depth must be integer between 2 and 100; used ${t}`;if(!/^[1-9]\d*$/.test(t))throw new Error(e);if(t=+t,t<2||t>100)throw new Error(e)}function U6(t,e,n,r,i,s,o){const a=new Set;r&&Y9(t+e,th,({groups:{captureName:c}})=>{a.add(c)},Tr.DEFAULT);const l=[n,r?a:null,i,s,o];return`${t}${W6(`(?:${t}`,"forward",...l)}(?:)${W6(`${e})`,"backward",...l)}${e}`}function W6(t,e,n,r,i,s,o){const l=u=>e==="forward"?u+2:n-u+2-1;let c="";for(let u=0;u[^>]+)>`,({0:f,groups:{captureName:h,unnamed:p,backref:m}})=>{if(m&&r&&!r.has(m))return f;const g=`_$${d}`;if(p||h){const y=o+s.length+1;return s.push(y),pB(i,y),p?f:`(?<${h}${g}>`}return _r`\k<${m}${g}>`},Tr.DEFAULT)}return c}function pB(t,e){for(let n=0;n=e&&t[n]++}function G6(t,e,n,r,i,s){if(t.size&&r){let o=0;Y9(e,X9,()=>o++,Tr.DEFAULT);const a=s-o+i,l=new Map;return t.forEach((c,u)=>{const d=(r-o*n)/n,f=o*n,h=u>a+o?u+r:u,p=[];for(const m of c)if(m<=a)p.push(m);else if(m>a+o+d)p.push(m+r);else if(m<=a+o)for(let g=0;g<=n;g++)p.push(m+o*g);else for(let g=0;g<=n;g++)p.push(m+f+d*g);l.set(h,p)}),l}return t}var rn=String.fromCodePoint,Ue=String.raw,Yr={},nh=globalThis.RegExp;Yr.flagGroups=(()=>{try{new nh("(?i:)")}catch{return!1}return!0})();Yr.unicodeSets=(()=>{try{new nh("[[]]","v")}catch{return!1}return!0})();Yr.bugFlagVLiteralHyphenIsRange=Yr.unicodeSets?(()=>{try{new nh(Ue`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Yr.bugNestedClassIgnoresNegation=Yr.unicodeSets&&new nh("[[^a]]","v").test("a");function zf(t,{enable:e,disable:n}){return{dotAll:!n?.dotAll&&!!(e?.dotAll||t.dotAll),ignoreCase:!n?.ignoreCase&&!!(e?.ignoreCase||t.ignoreCase)}}function Pc(t,e,n){return t.has(e)||t.set(e,n),t.get(e)}function Zg(t,e){return K6[t]>=K6[e]}function mB(t,e){if(t==null)throw new Error(e??"Value expected");return t}var K6={ES2025:2025,ES2024:2024,ES2018:2018},gB={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function J9(t={}){if({}.toString.call(t)!=="[object Object]")throw new Error("Unexpected options");if(t.target!==void 0&&!gB[t.target])throw new Error(`Unexpected target "${t.target}"`);const e={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...t,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...t.rules}};return e.target==="auto"&&(e.target=Yr.flagGroups?"ES2025":Yr.unicodeSets?"ES2024":"ES2018"),e}var yB="[ -\r ]",vB=new Set([rn(304),rn(305)]),Oi=Ue`[\p{L}\p{M}\p{N}\p{Pc}]`;function ex(t){if(vB.has(t))return[t];const e=new Set,n=t.toLowerCase(),r=n.toUpperCase(),i=kB.get(n),s=bB.get(n),o=wB.get(n);return[...r].length===1&&e.add(r),o&&e.add(o),i&&e.add(i),e.add(n),s&&e.add(s),[...e]}var Cv=new Map(`C Other Cc Control cntrl Cf Format Cn Unassigned Co Private_Use Cs Surrogate L Letter LC Cased_Letter Ll Lowercase_Letter Lm Modifier_Letter Lo Other_Letter Lt Titlecase_Letter Lu Uppercase_Letter M Mark Combining_Mark Mc Spacing_Mark Me Enclosing_Mark Mn Nonspacing_Mark N Number Nd Decimal_Number digit Nl Letter_Number No Other_Number P Punctuation punct Pc Connector_Punctuation Pd Dash_Punctuation Pe Close_Punctuation Pf Final_Punctuation Pi Initial_Punctuation Po Other_Punctuation Ps Open_Punctuation S Symbol Sc Currency_Symbol Sk Modifier_Symbol Sm Math_Symbol So Other_Symbol Z Separator Zl Line_Separator Zp Paragraph_Separator Zs Space_Separator ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component EComp Emoji_Modifier EMod Emoji_Modifier_Base EBase Emoji_Presentation EPres Extended_Pictographic ExtPict Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`.split(/\s/).map(t=>[eh(t),t])),bB=new Map([["s",rn(383)],[rn(383),"s"]]),wB=new Map([[rn(223),rn(7838)],[rn(107),rn(8490)],[rn(229),rn(8491)],[rn(969),rn(8486)]]),kB=new Map([Ss(453),Ss(456),Ss(459),Ss(498),...Fp(8072,8079),...Fp(8088,8095),...Fp(8104,8111),Ss(8124),Ss(8140),Ss(8188)]),xB=new Map([["alnum",Ue`[\p{Alpha}\p{Nd}]`],["alpha",Ue`\p{Alpha}`],["ascii",Ue`\p{ASCII}`],["blank",Ue`[\p{Zs}\t]`],["cntrl",Ue`\p{Cc}`],["digit",Ue`\p{Nd}`],["graph",Ue`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ue`\p{Lower}`],["print",Ue`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ue`[\p{P}\p{S}]`],["space",Ue`\p{space}`],["upper",Ue`\p{Upper}`],["word",Ue`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ue`\p{AHex}`]]);function SB(t,e){const n=[];for(let r=t;r<=e;r++)n.push(r);return n}function Ss(t){const e=rn(t);return[e.toLowerCase(),e]}function Fp(t,e){return SB(t,e).map(n=>Ss(n))}var tx=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function _B(t,e){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...e};nx(t);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Zg(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:t.flags.digitIsAscii,spaceIsAscii:t.flags.spaceIsAscii,wordIsAscii:t.flags.wordIsAscii};hc(t,CB,r);const i={dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},s={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};hc(t,EB,s);const o={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return hc(t,TB,o),t._originMap=s.groupOriginByCopy,t._strategy=r.strategy,t}var CB={AbsenceFunction({node:t,parent:e,replaceWith:n}){const{body:r,kind:i}=t;if(i==="repeater"){const s=Wr();s.body[0].body.push(po({negate:!0,body:r}),ma("Any"));const o=Wr();o.body[0].body.push(G9("greedy",0,1/0,s)),n(Bt(o,e),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:t,parent:e,key:n},{flagDirectivesByAlt:r}){const i=t.body.filter(s=>s.kind==="flags");for(let s=n+1;s\r\n|${i?Ue`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),e))}else if(l==="hex")n(_s(ma("AHex",{negate:c}),e));else if(l==="newline")n(Bt(Di(c?`[^ ]`:`(?>\r ?|[ \v\f…\u2028\u2029])`),e));else if(l==="posix")if(!i&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${rn(d.codePointAt(0)-1)}${rn(d.codePointAt(2)+1)}-􏿿`),n(Bt(Di(`[${d}]`),e))}else n(Bt(zp(Di(xB.get(u)),c),e));else if(l==="property")Cv.has(eh(u))||(t.key="sc");else if(l==="space")n(_s(ma("space",{negate:c}),e));else if(l==="word")n(Bt(zp(Di(Oi),c),e));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:t,parent:e,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:s,removeAllNextSiblings:o}){const{kind:a,flags:l}=t;if(a==="flags")if(!l.enable&&!l.disable)r();else{const c=Wr({flags:l});c.body[0].body=o(),i(Bt(c,e),{traverse:!0})}else if(a==="keep"){const c=n.body[0],d=n.body.length===1&&j9(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(e.parent!==d||d.body.length>1)throw new Error(Ue`Uses "\K" in a way that's unsupported`);const f=po({behind:!0});f.body[0].body=s(),i(Bt(f,e))}else throw new Error(`Unexpected directive kind "${a}"`)},Flags({node:t,parent:e}){if(t.posixIsAscii)throw new Error('Unsupported flag "P"');if(t.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete t[n]),Object.assign(t,{global:!1,hasIndices:!1,multiline:!1,sticky:t.sticky??!1}),e.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:t}){if(!t.flags)return;const{enable:e,disable:n}=t.flags;e?.extended&&delete e.extended,n?.extended&&delete n.extended,e?.dotAll&&n?.dotAll&&delete e.dotAll,e?.ignoreCase&&n?.ignoreCase&&delete e.ignoreCase,e&&!Object.keys(e).length&&delete t.flags.enable,n&&!Object.keys(n).length&&delete t.flags.disable,!t.flags.enable&&!t.flags.disable&&delete t.flags},LookaroundAssertion({node:t},e){const{kind:n}=t;n==="lookbehind"&&(e.passedLookbehind=!0)},NamedCallout({node:t,parent:e,replaceWith:n}){const{kind:r}=t;if(r==="fail")n(Bt(po({negate:!0}),e));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:t}){if(t.body.type==="Quantifier"){const e=Wr();e.body[0].body.push(t.body),t.body=Bt(e,t)}},Regex:{enter({node:t},{supportedGNodes:e}){const n=[];let r=!1,i=!1;for(const s of t.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{const o=ox(s.body);o?(r=!0,Array.isArray(o)?n.push(...o):n.push(o)):i=!0}r&&!i&&n.forEach(s=>e.add(s))},exit(t,{accuracy:e,passedLookbehind:n,strategy:r}){if(e==="strict"&&n&&r)throw new Error(Ue`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:t},{jsGroupNameMap:e}){let{ref:n}=t;typeof n=="string"&&!Vp(n)&&(n=Hp(n,e),t.ref=n)}},EB={Backreference({node:t},{multiplexCapturesToLeftByRef:e,reffedNodesByReferencer:n}){const{orphan:r,ref:i}=t;r||n.set(t,[...e.get(i).map(({node:s})=>s)])},CapturingGroup:{enter({node:t,parent:e,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:s,multiplexCapturesToLeftByRef:o,openRefs:a,reffedNodesByReferencer:l}){const c=i.get(t);if(c&&a.has(t.number)){const d=_s(Z6(t.number),e);l.set(d,a.get(t.number)),n(d);return}a.set(t.number,t),o.set(t.number,[]),t.name&&Pc(o,t.name,[]);const u=o.get(t.name??t.number);for(let d=0;df.type==="Group"&&!!f.flags)),d=u?zf(r.globalFlags,u):r.globalFlags;LB(d,r.currentFlags)||(c=Wr({flags:IB(d)}),c.body[0].body.push(l))}n(Bt(c,e),{traverse:!a})}},TB={Backreference({node:t,parent:e,replaceWith:n},r){if(t.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,t.ref);return}const s=r.reffedNodesByReferencer.get(t).filter(o=>AB(o,t));if(!s.length)n(Bt(po({negate:!0}),e));else if(s.length>1){const o=Wr({atomic:!0,body:s.reverse().map(a=>Eo({body:[Wg(a.number)]}))});n(Bt(o,e))}else t.ref=s[0].number},CapturingGroup({node:t},e){t.number=++e.numCapturesToLeft,t.name&&e.groupsByName.get(t.name).get(t).hasDuplicateNameToRemove&&delete t.name},Regex:{exit({node:t},e){const n=Math.max(e.highestOrphanBackref-e.numCapturesToLeft,0);for(let r=0;r{e.forEach(i=>{r.enable?.[i]&&(delete n.disable[i],n.enable[i]=!0),r.disable?.[i]&&(n.disable[i]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function IB({dotAll:t,ignoreCase:e}){const n={};return(t||e)&&(n.enable={},t&&(n.enable.dotAll=!0),e&&(n.enable.ignoreCase=!0)),(!t||!e)&&(n.disable={},!t&&(n.disable.dotAll=!0),!e&&(n.disable.ignoreCase=!0)),n}function sx(t){if(!t)throw new Error("Node expected");const{body:e}=t;return Array.isArray(e)?e:e?[e]:null}function ox(t){const e=t.find(n=>n.kind==="search_start"||RB(n,{negate:!1})||!OB(n));if(!e)return null;if(e.kind==="search_start")return e;if(e.type==="LookaroundAssertion")return e.body[0].body[0];if(e.type==="CapturingGroup"||e.type==="Group"){const n=[];for(const r of e.body){const i=ox(r.body);if(!i)return null;Array.isArray(i)?n.push(...i):n.push(i)}return n}return null}function ax(t,e){const n=sx(t)??[];for(const r of n)if(r===e||ax(r,e))return!0;return!1}function OB({type:t}){return t==="Assertion"||t==="Directive"||t==="LookaroundAssertion"}function DB(t){const e=["Character","CharacterClass","CharacterSet"];return e.includes(t.type)||t.type==="Quantifier"&&t.min&&e.includes(t.body.type)}function RB(t,e){const n={negate:null,...e};return t.type==="LookaroundAssertion"&&(n.negate===null||t.negate===n.negate)&&t.body.length===1&&j9(t.body[0],{type:"Assertion",kind:"search_start"})}function Vp(t){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(t)}function Di(t,e){const r=U9(t,{...e,unicodePropertyMap:Cv}).body;return r.length>1||r[0].body.length>1?Wr({body:r}):r[0].body[0]}function zp(t,e){return t.negate=e,t}function _s(t,e){return t.parent=e,t}function Bt(t,e){return nx(t),t.parent=e,t}function PB(t,e){const n=J9(e),r=Zg(n.target,"ES2024"),i=Zg(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let o=null,a=null;if(!i){const h=[t.flags.ignoreCase];hc(t,NB,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(p){h.push(p)},setHasCasedChar(){h.at(-1)?o=!0:a=!0}})}const l={dotAll:t.flags.dotAll,ignoreCase:!!((t.flags.ignoreCase||o)&&!a)};let c=t;const u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:t.flags.dotAll,ignoreCase:t.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:t._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!i&&o&&a),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(h){return u.lastNode=c,c=h,mB($B[h.type],`Unexpected node type "${h.type}"`)(h,u,d)}const f={pattern:t.body.map(d).join("|"),flags:d(t.flags),options:{...t.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((h,p)=>{h.hidden&&f._hiddenCaptures.push(p),h.transferTo&&Pc(f._captureTransfers,h.transferTo,[]).push(p)}),f}var NB={"*":{enter({node:t},e){if(Q6(t)){const n=e.getCurrentModI();e.pushModI(t.flags?zf({ignoreCase:n},t.flags).ignoreCase:n)}},exit({node:t},e){Q6(t)&&e.popModI()}},Backreference(t,e){e.setHasCasedChar()},Character({node:t},e){Ev(rn(t.value))&&e.setHasCasedChar()},CharacterClassRange({node:t,skip:e},n){e(),lx(t,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:t},e){t.kind==="property"&&tx.has(t.value)&&e.setHasCasedChar()}},$B={Alternative({body:t},e,n){return t.map(n).join("")},Assertion({kind:t,negate:e}){if(t==="string_end")return"$";if(t==="string_start")return"^";if(t==="word_boundary")return e?Ue`\B`:Ue`\b`;throw new Error(`Unexpected assertion kind "${t}"`)},Backreference({ref:t},e){if(typeof t!="number")throw new Error("Unexpected named backref in transformed AST");if(!e.useFlagMods&&e.accuracy==="strict"&&e.currentFlags.ignoreCase&&!e.captureMap.get(t).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+t},CapturingGroup(t,e,n){const{body:r,name:i,number:s}=t,o={ignoreCase:e.currentFlags.ignoreCase},a=e.originMap.get(t);return a&&(o.hidden=!0,s>a.number&&(o.transferTo=a.number)),e.captureMap.set(s,o),`(${i?`?<${i}>`:""}${r.map(n).join("|")})`},Character({value:t},e){const n=rn(t),r=ea(t,{escDigit:e.lastNode.type==="Backreference",inCharClass:e.inCharClass,useFlagV:e.useFlagV});if(r!==n)return r;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase&&Ev(n)){const i=ex(n);return e.inCharClass?i.join(""):i.length>1?`[${i.join("")}]`:i[0]}return n},CharacterClass(t,e,n){const{kind:r,negate:i,parent:s}=t;let{body:o}=t;if(r==="intersection"&&!e.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Yr.bugFlagVLiteralHyphenIsRange&&e.useFlagV&&o.some(X6)&&(o=[J0(45),...o.filter(c=>!X6(c))]);const a=()=>`[${i?"^":""}${o.map(n).join(r==="intersection"?"&&":"")}]`;if(!e.inCharClass){if((!e.useFlagV||Yr.bugNestedClassIgnoresNegation)&&!i){const u=o.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){const d=Wr(),f=d.body[0];return d.parent=s,f.parent=d,o=o.filter(h=>!u.includes(h)),t.body=o,o.length?(t.parent=f,f.body.push(t)):d.body.pop(),u.forEach(h=>{const p=Eo({body:[h]});h.parent=p,p.parent=d,d.body.push(p)}),n(d)}}e.inCharClass=!0;const c=a();return e.inCharClass=!1,c}const l=o[0];if(r==="union"&&!i&&l&&((!e.useFlagV||!e.verbose)&&s.kind==="union"&&!(Yr.bugFlagVLiteralHyphenIsRange&&e.useFlagV)||!e.verbose&&s.kind==="intersection"&&o.length===1&&l.type!=="CharacterClassRange"))return o.map(n).join("");if(!e.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(t,e){const n=t.min.value,r=t.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:e.useFlagV},s=ea(n,i),o=ea(r,i),a=new Set;if(e.useAppliedIgnoreCase&&e.currentFlags.ignoreCase){const l=lx(t);BB(l).forEach(u=>{a.add(Array.isArray(u)?`${ea(u[0],i)}-${ea(u[1],i)}`:ea(u,i))})}return`${s}-${o}${[...a].join("")}`},CharacterSet({kind:t,negate:e,value:n,key:r},i){if(t==="dot")return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?".":"[^]":Ue`[^\n]`;if(t==="digit")return e?Ue`\D`:Ue`\d`;if(t==="property"){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&tx.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${e?Ue`\P`:Ue`\p`}{${r?`${r}=`:""}${n}}`}if(t==="word")return e?Ue`\W`:Ue`\w`;throw new Error(`Unexpected character set kind "${t}"`)},Flags(t,e){return(e.appliedGlobalFlags.ignoreCase?"i":"")+(t.dotAll?"s":"")+(t.sticky?"y":"")},Group({atomic:t,body:e,flags:n,parent:r},i,s){const o=i.currentFlags;n&&(i.currentFlags=zf(o,n));const a=e.map(s).join("|"),l=!i.verbose&&e.length===1&&r.type!=="Quantifier"&&!t&&(!i.useFlagMods||!n)?a:`(?${qB(t,n,i.useFlagMods)}${a})`;return i.currentFlags=o,l},LookaroundAssertion({body:t,kind:e,negate:n},r,i){return`(?${`${e==="lookahead"?"":"<"}${n?"!":"="}`}${t.map(i).join("|")})`},Quantifier(t,e,n){return n(t.body)+jB(t)},Subroutine({isRecursive:t,ref:e},n){if(!t)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return e===0?`(?R=${r})`:Ue`\g<${e}&R=${r}>`}},FB=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),HB=new Set(["-","\\","]","^","["]),VB=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Y6=new Map([[9,Ue`\t`],[10,Ue`\n`],[11,Ue`\v`],[12,Ue`\f`],[13,Ue`\r`],[8232,Ue`\u2028`],[8233,Ue`\u2029`],[65279,Ue`\uFEFF`]]),zB=/^\p{Cased}$/u;function Ev(t){return zB.test(t)}function lx(t,e){const n=!!e?.firstOnly,r=t.min.value,i=t.max.value,s=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return s;for(let o=r;o<=i;o++){const a=rn(o);if(!Ev(a))continue;const l=ex(a).filter(c=>{const u=c.codePointAt(0);return ui});if(l.length&&(s.push(...l),n))break}return s}function ea(t,{escDigit:e,inCharClass:n,useFlagV:r}){if(Y6.has(t))return Y6.get(t);if(t<32||t>126&&t<160||t>262143||e&&UB(t))return t>255?`\\u{${t.toString(16).toUpperCase()}}`:`\\x${t.toString(16).toUpperCase().padStart(2,"0")}`;const i=n?r?VB:HB:FB,s=rn(t);return(i.has(s)?"\\":"")+s}function BB(t){const e=t.map(i=>i.codePointAt(0)).sort((i,s)=>i-s),n=[];let r=null;for(let i=0;i";let r="";if(e&&n){const{enable:i,disable:s}=e;r=(i?.ignoreCase?"i":"")+(i?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function jB({kind:t,max:e,min:n}){let r;return!n&&e===1?r="?":!n&&e===1/0?r="*":n===1&&e===1/0?r="+":n===e?r=`{${n}}`:r=`{${n},${e===1/0?"":e}}`,r+{greedy:"",lazy:"?",possessive:"+"}[t]}function Q6({type:t}){return t==="CapturingGroup"||t==="Group"||t==="LookaroundAssertion"}function UB(t){return t>47&&t<58}function X6({type:t,value:e}){return t==="Character"&&e===45}var WB=class Yg extends RegExp{#t=new Map;#e=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(e,n,r){const i=!!r?.lazyCompile;if(e instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const s=e;super(s,n),this.#n=s.source,s instanceof Yg&&(this.#t=s.#t,this.#i=s.#i,this.#r=s.#r,this.rawOptions=s.rawOptions)}else{const s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?"":e,n),this.#n=e,this.#t=KB(s.hiddenCaptures,s.transfers),this.#r=s.strategy,this.rawOptions=r??{}}i||(this.#e=this)}exec(e){if(!this.#e){const{lazyCompile:i,...s}=this.rawOptions;this.#e=new Yg(this.#n,this.flags,s)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#r==="clip_search"&&n&&r){this.lastIndex=0;const i=this.#s(e.slice(r));return i&&(GB(i,r,e,this.hasIndices),this.lastIndex+=r),i}return this.#s(e)}#s(e){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,e);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let i;this.hasIndices&&(i=[...n.indices],n.indices.length=1);const s=[0];for(let o=1;o{const a=s[o];a&&(s[o]=[a[0]+e,a[1]+e])})}}function KB(t,e){const n=new Map;for(const r of t)n.set(r,{hidden:!0});for(const[r,i]of e)for(const s of i)Pc(n,s,{}).transferTo=r;return n}function ZB(t){const e=/(?\((?:\?<(?![=!])(?[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,i=0,s;for(;s=e.exec(t);){const{0:o,groups:{capture:a,name:l}}=s;o==="["?r++:r?o==="]"&&r--:a&&(i++,l&&n.set(i,l))}return n}function YB(t,e){const n=QB(t,e);return n.options?new WB(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function QB(t,e){const n=J9(e),r=U9(t,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Cv}),i=_B(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=PB(i,n),o=hB(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),a=dB(o.pattern),l=uB(a.pattern,{captureTransfers:o.captureTransfers,hiddenCaptures:o.hiddenCaptures}),c={pattern:l.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 u=l.hiddenCaptures.sort((p,m)=>p-m),d=Array.from(l.captureTransfers),f=i._strategy,h=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||f||h)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...f&&{strategy:f},...h&&{lazyCompile:h}})}return c}const J6=4294967295;class XB{constructor(e,n={}){this.patterns=e,this.options=n;const{forgiving:r=!1,cache:i,regexConstructor:s}=n;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const a=i?.get(o);if(a){if(a instanceof RegExp)return a;if(r)return null;throw a}try{const l=s(o);return i?.set(o,l),l}catch(l){if(i?.set(o,l),r)return null;throw l}})}regexps;findNextMatchSync(e,n,r){const i=typeof e=="string"?e:e.content,s=[];function o(a,l,c=0){return{index:a,captureIndices:l.indices.map(u=>u==null?{start:J6,end:J6,length:0}:{start:u[0]+c,end:u[1]+c,length:u[1]-u[0]})}}for(let a=0;al[1].index));for(const[l,c,u]of s)if(c.index===a)return o(l,c,u)}return null}}function JB(t,e){return YB(t,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...e})}function eq(t={}){const e=Object.assign({target:"auto",cache:new Map},t);return e.regexConstructor||=n=>JB(n,{target:e.target}),{createScanner(n){return new XB(n,e)},createString(n){return{content:n}}}}const Bf="diffs-container",tq=/(?=^From [a-f0-9]+ .+$)/m,Jd=/(?=^diff --git)/gm,e3=/(?=^---\s+\S)/gm,nq=/(?=^@@ )/gm,rq=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,ef=/(?<=\n)/,iq=/^(---|\+\+\+)\s+([^\t\r\n]+)/,sq=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,oq=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,aq=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Tv="header-prefix",Lv="header-metadata",Dn={dark:"pierre-dark",light:"pierre-light"},Av="data-unsafe-css",Ia=1,Mv={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,hunkSeparatorHeight:32,fileGap:8},lq=Object.freeze({fromStart:0,fromEnd:0}),qf={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},cx={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function t3(t,e){return t?.start===e?.start&&t?.end===e?.end&&t?.side===e?.side&&t?.endSide===e?.endSide}function is(t){return{type:"text",value:t}}function nt({tagName:t,children:e=[],properties:n={}}){return{type:"element",tagName:t,properties:n,children:e}}function jf({name:t,width:e=16,height:n=16,properties:r}){return nt({tagName:"svg",properties:{width:e,height:n,viewBox:"0 0 16 16",...r},children:[nt({tagName:"use",properties:{href:`#${t.replace(/^#/,"")}`}})]})}function cq(t){let e=t.children[0];for(;e!=null;){if(e.type==="element"&&e.tagName==="code")return e;"children"in e?e=e.children[0]:e=null}}function Sa(t){return nt({tagName:"div",properties:{"data-gutter":""},children:t})}function ux(t,e,n){return nt({tagName:"div",properties:{"data-line-type":t,"data-column-number":e,"data-line-index":n},children:e!=null?[nt({tagName:"span",properties:{"data-line-number-content":""},children:[is(`${e}`)]})]:void 0})}function kr(t,e,n){return nt({tagName:"div",properties:{"data-gutter-buffer":e,"data-buffer-size":n,"data-line-type":e==="annotation"?void 0:t,style:e==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function uq(){return nt({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[jf({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function dq(t,e){return t.lineNumber===e.lineNumber&&t.side===e.side}var dx=class{hoveredLine;pre;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(t,e){this.mode=t,this.options=e}setOptions(t){this.options=t}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.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(t){this.setSelectionDirty();const{usesCustomGutterUtility:e=!1,enableGutterUtility:n=!1}=this.options;this.pre!==t&&(this.cleanUp(),this.pre=t),n?this.ensureGutterUtilityNode(e):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(t),this.updateInteractiveLineAttributes(),this.renderSelection()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(t){const e=!(t===this.selectedRange||t3(t??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!e||(this.selectedRange=t,this.renderSelection(),e&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{if(this.hoveredLine!=null){if(this.mode==="diff"&&this.hoveredLine.type==="diff-line")return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if(this.mode==="file"&&this.hoveredLine.type==="line")return{lineNumber:this.hoveredLine.lineNumber}}};handlePointerClick=t=>{const{onHunkExpand:e,onLineClick:n,onLineNumberClick:r}=this.options;e==null&&n==null&&r==null||this.options.onGutterUtilityClick!=null&&i3(t.composedPath())||(Ri(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",t),this.handlePointerEvent({eventType:"click",event:t}))};handlePointerMove=t=>{const{lineHoverHighlight:e="disabled",onLineEnter:n,onLineLeave:r,enableGutterUtility:i=!1}=this.options;e==="disabled"&&!i&&n==null&&r==null||(Ri(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",t),this.handlePointerEvent({eventType:"move",event:t}))};handlePointerLeave=t=>{const{__debugPointerEvents:e}=this.options;if(Ri(e,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null){Ri(e,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no .hoveredLine");return}this.gutterUtilityContainer?.remove(),this.options.onLineLeave?.({...this.hoveredLine,event:t}),this.clearHoveredLine()};handlePointerEvent({eventType:t,event:e}){const{__debugPointerEvents:n}=this.options,r=e.composedPath();Ri(n,t,"FileDiff.DEBUG.handlePointerEvent:",{eventType:t,composedPath:r});const i=this.resolvePointerTarget(r);Ri(n,t,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",i);const{onLineClick:s,onLineNumberClick:o,onLineEnter:a,onLineLeave:l,onHunkExpand:c}=this.options;switch(t){case"move":if(Hl(i)&&this.hoveredLine?.lineElement===i.lineElement)break;this.hoveredLine!=null&&(this.gutterUtilityContainer?.remove(),l?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),Hl(i)&&(this.setHoveredLine(this.toEventBaseProps(i)),this.gutterUtilityContainer!=null&&i.numberElement.appendChild(this.gutterUtilityContainer),a?.({...this.hoveredLine,event:e}));break;case"click":{if(i==null)break;if(hq(i)&&c!=null){c(i.hunkIndex,i.direction,e.shiftKey);break}if(!Hl(i))break;const u=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...u,event:e}):s?.({...u,event:e});break}}}syncPointerListeners(t){const{__debugPointerEvents:e,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:i,onLineEnter:s,onLineLeave:o,onHunkExpand:a,enableGutterUtility:l=!1,enableLineSelection:c=!1,onGutterUtilityClick:u}=this.options,d=u!=null,f=n!=="disabled"||r!=null||i!=null||a!=null||s!=null||o!=null||l||c||d;f&&!this.hasPointerListeners?(t.addEventListener("click",this.handlePointerClick),t.addEventListener("pointerdown",this.handlePointerDown),t.addEventListener("pointermove",this.handlePointerMove),t.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,Ri(e,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const m=[];return(e==="both"||e==="click")&&(r!=null&&m.push("onLineClick"),i!=null&&m.push("onLineNumberClick"),a!=null&&m.push("expandable hunk separators")),m})()),Ri(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Ri(e,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!f&&this.hasPointerListeners&&(t.removeEventListener("click",this.handlePointerClick),t.removeEventListener("pointerdown",this.handlePointerDown),t.removeEventListener("pointermove",this.handlePointerMove),t.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const h=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!c&&h||!d&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:t,onLineNumberClick:e,enableLineSelection:n=!1}=this.options,r=t!=null,i=e!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=t=>{if(t.pointerType==="mouse"&&t.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const e=t.composedPath();i3(e)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(t,e):this.startLineSelectionFromPointerDown(t,e)};startLineSelectionFromPointerDown(t,e){const{enableLineSelection:n=!1}=this.options;if(!n)return;const r=this.getSelectionPointerInfo(e,!0);if(r==null)return;const{pre:i}=this;if(i==null)return;t.preventDefault();const{lineNumber:s,eventSide:o,lineIndex:a}=r;if(t.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(l==null)return;const c=l.start<=l.end?a>=l.start:a<=l.end;this.selectionAnchor={lineNumber:c?this.selectedRange.start:this.selectedRange.end,side:c?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(s,o,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:t.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===s&&this.selectedRange?.end===s){const l={lineNumber:s,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:t.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.selectedRange=null,this.selectionAnchor={lineNumber:s,side:o},this.updateSelection(s,o,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:t.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(t,e){const{enableLineSelection:n=!1,onGutterUtilityClick:r}=this.options;if(r==null)return;const i=this.getSelectionPointFromPath(e);i!=null&&(t.preventDefault(),t.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:t.pointerId,anchor:i,current:i},n&&(this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.selectedRange)),this.attachDocumentPointerListeners())}handleDocumentPointerMove=t=>{const{enableLineSelection:e=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(t.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointFromPath(t.composedPath());if(n==null)return;this.pointerSession.current=n,e===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(t.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointerInfo(t.composedPath(),!1);if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(t.pointerId!==this.pointerSession.pointerId)return;const n=this.getSelectionPointerInfo(t.composedPath(),!1);if(n==null||this.selectionAnchor==null)return;const r={lineNumber:n.lineNumber,side:n.eventSide};if(dq(this.pointerSession.pending,r))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.selectedRange),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:t.pointerId};return}}};handleDocumentPointerUp=t=>{const{enableLineSelection:e=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(t.pointerId!==this.pointerSession.pointerId)return;const r=this.getSelectionPointFromPath(t.composedPath());r!=null&&(this.pointerSession.current=r,e&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,e&&(this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(t.pointerId!==this.pointerSession.pointerId)return;this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted();return;case"selecting":if(t.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()}};handleDocumentPointerCancel=t=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&t.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,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(t){const{lineHoverHighlight:e="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=t,e!=="disabled"&&((e==="both"||e==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(e==="both"||e==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}ensureGutterUtilityNode(t){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),t)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 e=document.createElement("div");e.innerHTML=gi(uq());const n=e.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)}}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"})}getSelectionPointerInfo(t,e){const n=this.resolvePointerTarget(t);if(Hl(n)&&!(e&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}getSelectionPointFromPath(t){const e=this.resolvePointerTarget(t);if(Hl(e))return{lineNumber:e.lineNumber,side:this.mode==="diff"?e.side:void 0}}getLineIndex(t,e){const{getLineIndex:n}=this.options;return n!=null?n(t,e):[t-1,t-1]}updateSelection(t,e,n=!0){const{selectedRange:r}=this;let i;if(t==null)i=null;else{const s=this.selectionAnchor?.side??e,o=this.selectionAnchor?.lineNumber??t;i=this.buildSelectionRange(o,t,s,e)}t3(r??void 0,i??void 0)||(this.selectedRange=i,n&&this.notifySelectionChangeDelta(),this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection))}getIndexesFromSelection(t,e){if(this.pre==null)return;const n=this.getLineIndex(t.start,t.side),r=this.getLineIndex(t.end,t.endSide??t.side);return n!=null&&r!=null?{start:e?n[1]:n[0],end:e?r[1]:r[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const t=this.pre.querySelectorAll("[data-selected-line]");for(const a of t)a.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:e}=this.pre;if(e.length===0)return;if(e.length>2)throw console.error(e),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const i=r.start===r.end,s=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(const a of e){const[l,c]=a.children,u=c.children.length;if(u!==l.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let d=0;do)break;if(p==null||p{switch(n){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return r.hasAttribute("data-deletions")?"deletions":"additions"}})();return{kind:"line",lineType:n,lineElement:i,lineNumber:l,numberColumn:e,numberElement:o,side:u,splitLineIndex:c}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(t,e){const n=(t.getAttribute("data-line-index")??"").split(",").map(r=>Number.parseInt(r,10)).filter(r=>!Number.isNaN(r));if(e&&n.length===2)return n[1];if(!e)return n[0]}};function Uf({enableGutterUtility:t,enableHoverUtility:e,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:s,onLineLeave:o,onLineNumberClick:a,renderGutterUtility:l,renderHoverUtility:c,__debugPointerEvents:u,enableLineSelection:d,onLineSelected:f,onLineSelectionStart:h,onLineSelectionChange:p,onLineSelectionEnd:m},g,y){return{enableGutterUtility:fq({enableGutterUtility:t,enableHoverUtility:e,renderGutterUtility:l,renderHoverUtility:c,onGutterUtilityClick:r}),usesCustomGutterUtility:l!=null||c!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:g,onLineClick:i,onLineEnter:s,onLineLeave:o,onLineNumberClick:a,__debugPointerEvents:u,enableLineSelection:d,onLineSelected:f,onLineSelectionStart:h,onLineSelectionChange:p,onLineSelectionEnd:m,getLineIndex:y}}function fq({enableGutterUtility:t,enableHoverUtility:e,renderGutterUtility:n,renderHoverUtility:r,onGutterUtilityClick:i}){if(t!==void 0&&e!==void 0)throw new Error("Cannot use both 'enableGutterUtility' and deprecated 'enableHoverUtility'. Use only 'enableGutterUtility'.");if(n!=null&&r!=null)throw new Error("Cannot use both 'renderGutterUtility' and deprecated 'renderHoverUtility'. Use only 'renderGutterUtility'.");if(i!=null&&(n!=null||r!=null))throw new Error("Cannot use both 'onGutterUtilityClick' and render utility callbacks ('renderGutterUtility'/'renderHoverUtility'). Use only one gutter utility API.");return t??e??!1}function Hl(t){return t!=null&&"kind"in t&&t.kind==="line"}function hq(t){return"type"in t&&t.type==="line-info"}function n3(t,e){const n=t?.querySelector(e);return n instanceof HTMLElement?n:void 0}function r3(t){const e=t.getAttribute("data-line-type");if(e!=null)switch(e){case"change-deletion":case"change-addition":case"context":case"context-expanded":return e;default:return}}function i3(t){for(const e of t)if(e instanceof HTMLElement&&e.hasAttribute("data-utility-button"))return!0;return!1}function Ri(t="none",e,...n){switch(t){case"none":return;case"both":break;case"click":if(e!=="click")return;break;case"move":if(e!=="move")return;break}console.log(...n)}var fx=class{observedNodes=new Map;timeoutID;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.timeoutID!=null&&clearTimeout(this.timeoutID)}resizeObserver;setup(t,e){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);const n=t.querySelectorAll("code"),r=new Map(this.observedNodes);this.observedNodes.clear();for(const i of n){let s=r.get(i);if(s!=null){this.observedNodes.set(i,s),r.delete(i);continue}let o=i.querySelector("[data-gutter]");o instanceof HTMLElement||(o=null),s={type:"code",codeElement:i,numberElement:o,codeWidth:"auto",numberWidth:0},this.observedNodes.set(i,s),this.resizeObserver.observe(i),o!=null&&(this.observedNodes.set(o,s),this.resizeObserver.observe(o))}if(n.length>1&&!e){const i=t.querySelectorAll('[data-line-annotation*=","]'),s=new Map;for(const o of i){if(!(o instanceof HTMLElement))continue;const{lineAnnotation:a=""}=o.dataset;if(!/^\d+,\d+$/.test(a)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:a,element:o});continue}let l=s.get(a);l==null&&(l=[],s.set(a,l)),l.push(o)}for(const[o,a]of s){if(a.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",o,a);continue}const[l,c]=a,u=l.firstElementChild,d=c.firstElementChild;if(!(l instanceof HTMLElement)||!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(d instanceof HTMLElement))continue;let f=r.get(u);if(f!=null){this.observedNodes.set(u,f),this.observedNodes.set(d,f),r.delete(u),r.delete(d);continue}f={type:"annotations",column1:{container:l,child:u,childHeight:u.getBoundingClientRect().height},column2:{container:c,child:d,childHeight:d.getBoundingClientRect().height},currentHeight:"auto"};const h=Math.max(f.column1.childHeight,f.column2.childHeight);this.applyNewHeight(f,h),this.observedNodes.set(u,f),this.observedNodes.set(d,f),this.resizeObserver.observe(u),this.resizeObserver.observe(d)}}for(const i of r.keys())i.isConnected&&(i.style.removeProperty("--diffs-column-content-width"),i.style.removeProperty("--diffs-column-number-width"),i.style.removeProperty("--diffs-column-width"),i.parentElement instanceof HTMLElement&&i.parentElement.style.removeProperty("--diffs-annotation-min-height")),this.resizeObserver.unobserve(i);r.clear()}handleResizeObserver=t=>{for(const e of t){const{target:n,borderBoxSize:r}=e;if(!(n instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",e);continue}const i=this.observedNodes.get(n);if(i==null){console.error("FileDiff.handleResizeObserver: Not a valid observed node",e);continue}const s=r[0];if(i.type==="annotations"){const o=(()=>{if(n===i.column1.child)return i.column1;if(n===i.column2.child)return i.column2})();if(o==null){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:i,target:n});continue}o.childHeight=s.blockSize;const a=Math.max(i.column1.childHeight,i.column2.childHeight);this.applyNewHeight(i,a)}else i.type==="code"&&(this.queuedUpdates.set(n,[i,s]),this.queueColumnUpdate())}};queueColumnUpdate(){this.timeoutID!=null&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(this.handleColumnChange,1e3/30)}handleColumnChange=()=>{this.timeoutID=void 0;for(const[t,[e,n]]of this.queuedUpdates)if(t===e.codeElement){const r=Math.max(Math.floor(n.inlineSize),0);if(r!==e.codeWidth){e.codeWidth=r;const i=Math.max(e.codeWidth-e.numberWidth,0);e.codeElement.style.setProperty("--diffs-column-content-width",`${i===0?"auto":`${i}px`}`),e.codeElement.style.setProperty("--diffs-column-width",`${e.codeWidth===0?"auto":`${e.codeWidth}px`}`)}}else if(t===e.numberElement){const r=Math.max(Math.ceil(n.inlineSize),0);if(r!==e.numberWidth&&(e.numberWidth=r,e.codeElement.style.setProperty("--diffs-column-number-width",`${e.numberWidth===0?"auto":`${e.numberWidth}px`}`),e.codeWidth!=="auto")){const i=Math.max(e.codeWidth-e.numberWidth,0);e.codeElement.style.setProperty("--diffs-column-content-width",`${i===0?"auto":`${i}px`}`)}}this.queuedUpdates.clear()};applyNewHeight(t,e){e!==t.currentHeight&&(t.currentHeight=Math.max(e,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`))}};const To=new Map,Bp=new Map,pq=new Map,Qg=new Set;function Wf(t){for(const e of Array.isArray(t)?t:[t])if(!Qg.has(e))return!1;return!0}function s3(t,e){t=Array.isArray(t)?t:[t];for(const n of t){if(Qg.has(n.name))continue;let r=To.get(n.name);r==null&&(r=n,To.set(n.name,r)),Qg.add(r.name),e.loadLanguageSync(r.data)}}function hx(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function px(t){if(hx())throw new Error(`resolveLanguage("${t}") 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 e=Bp.get(t);if(e!=null)return e;try{let n=pq.get(t);if(n==null&&Object.prototype.hasOwnProperty.call(Rc,t)&&(n=Rc[t]),n==null)throw new Error(`resolveLanguage: "${t}" not found in bundled or custom languages`);const r=n().then(({default:i})=>{const s={name:t,data:i};return To.has(t)||To.set(t,s),s});return Bp.set(t,r),await r}finally{Bp.delete(t)}}function mx(t){return To.get(t)??px(t)}const Xi=new Map,qp=new Map,Xg=new Map,Jg=new Set;function e1(t,e){t=Array.isArray(t)?t:[t];for(let n of t){let r;if(typeof n=="string"){if(r=Xi.get(n),r==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else r=n,n=n.name,Xi.has(n)||Xi.set(n,r);Jg.has(n)||(Jg.add(n),e.loadThemeSync(r))}}async function gx(t){if(hx())throw new Error(`resolveTheme("${t}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const e=qp.get(t);if(e!=null)return e;try{const n=Xg.get(t)??N9[t];if(n==null)throw new Error(`resolveTheme: No valid loader for ${t}`);const r=n().then(s=>mq(t,"default"in s?s.default:s));qp.set(t,r);const i=await r;if(i.name!==t)throw new Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${i.name}`);return Xi.set(i.name,i),i}finally{qp.delete(t)}}function mq(t,e){const n=Xi.get(t);return n??(e=Y0(e),Xi.set(t,e),e)}function yx(t){return Xi.get(t)??gx(t)}function Iv(t,e){if(Xg.has(t)){console.error("SharedHighlight.registerCustomTheme: theme name already registered",t);return}Xg.set(t,e)}let ci;async function Ka({themes:t,langs:e,preferredHighlighter:n="shiki-js"}){ci??=pz({themes:[],langs:["text"],engine:n==="shiki-wasm"?F9(A(()=>import("./wasm-CG6Dc4jp.js"),[])):eq()});const r=gq(ci)?await ci:ci;ci=r;const i=[];for(const o of e){if(o==="text"||o==="ansi")continue;const a=mx(o);"then"in a?i.push(a):s3(a,r)}const s=[];for(const o of t){const a=yx(o);"then"in a?s.push(a):e1(a,ci)}return(i.length>0||s.length>0)&&await Promise.all([Promise.all(i).then(o=>{s3(o,r)}),Promise.all(s).then(o=>{e1(o,r)})]),r}function vx(){if(ci!=null&&!("then"in ci))return ci}function gq(t=ci){return t!=null&&"then"in t}Iv("pierre-dark",async()=>{const t=await A(()=>import("./pierre-dark-ClCaJvdG.js"),[]);return{...t.default??t,name:"pierre-dark"}});Iv("pierre-light",async()=>{const t=await A(()=>import("./pierre-light-zjGsWSiE.js"),[]);return{...t.default??t,name:"pierre-light"}});function Nc(t=Dn){const e=[];return typeof t=="string"?e.push(t):(e.push(t.dark),e.push(t.light)),e}function pc(t){for(const e of Nc(t))if(!Jg.has(e))return!1;return!0}function t1(t){for(const e of t)if(!Xi.has(e))return!1;return!0}function rh(t,e){return t==null||e==null?t===e:t.startingLine===e.startingLine&&t.totalLines===e.totalLines&&t.bufferBefore===e.bufferBefore&&t.bufferAfter===e.bufferAfter}function Ov(t,e){return t==null||e==null||typeof t=="string"||typeof e=="string"?t===e:t.dark===e.dark&&t.light===e.light}function tf(t){return nt({tagName:"div",children:[nt({tagName:"div",children:t.annotations?.map(e=>nt({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${t.hunkIndex},${t.lineIndex}`}})}function yq(t){switch(t){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 bx({fileOrDiff:t,themeStyles:e,themeType:n}){const r="type"in t?t:void 0,i={"data-diffs-header":"","data-change-type":r?.type,"data-theme-type":n!=="system"?n:void 0,style:e};return nt({tagName:"div",children:[vq({name:t.name,prevName:"prevName"in t?t.prevName:void 0,iconType:r?.type??"file"}),bq(r)],properties:i})}function vq({name:t,prevName:e,iconType:n}){const r=[nt({tagName:"slot",properties:{name:Tv}}),jf({name:yq(n),properties:{"data-change-icon":n}})];return e!=null&&(r.push(nt({tagName:"div",children:[is(e)],properties:{"data-prev-name":""}})),r.push(jf({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),r.push(nt({tagName:"div",children:[is(t)],properties:{"data-title":""}})),nt({tagName:"div",children:r,properties:{"data-header-content":""}})}function bq(t){const e=[];if(t!=null){let n=0,r=0;for(const i of t.hunks)n+=i.additionLines,r+=i.deletionLines;(r>0||n===0)&&e.push(nt({tagName:"span",children:[is(`-${r}`)],properties:{"data-deletions-count":""}})),(n>0||r===0)&&e.push(nt({tagName:"span",children:[is(`+${n}`)],properties:{"data-additions-count":""}}))}return e.push(nt({tagName:"slot",properties:{name:Lv}})),nt({tagName:"div",children:e,properties:{"data-metadata":""}})}function wx(t){return nt({tagName:"pre",properties:wq(t)})}function wq({diffIndicators:t,disableBackground:e,disableLineNumbers:n,overflow:r,split:i,themeType:s,themeStyles:o,totalLines:a,type:l}){const c={"data-diff":l==="diff"?"":void 0,"data-file":l==="file"?"":void 0,"data-diff-type":l==="diff"?i?"split":"single":void 0,"data-overflow":r,"data-disable-line-numbers":n?"":void 0,"data-background":e?void 0:"","data-indicators":t==="bars"||t==="classic"?t:void 0,"data-theme-type":s!=="system"?s:void 0,style:o,tabIndex:0};return c.style+=`--diffs-min-number-column-width-default:${`${a}`.length}ch;`,c}const ta=new Map,Vl={"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",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 Ir(t){if(ta.has(t))return ta.get(t)??"text";if(Vl[t]!=null)return Vl[t];const e=t.match(/\.([^/\\]+\.[^/\\]+)$/);if(e!=null){if(ta.has(e[1]))return ta.get(e[1])??"text";if(Vl[e[1]]!=null)return Vl[e[1]]??"text"}const n=t.match(/\.([^.]+)$/)?.[1]??"";return ta.has(n)?ta.get(n)??"text":Vl[n]??"text"}function kx(t,{theme:e,preferredHighlighter:n="shiki-js"}){return{langs:[t??"text"],themes:Nc(e),preferredHighlighter:n}}function Lo(t){return`annotation-${"side"in t?`${t.side}-`:""}${t.lineNumber}`}function Ao(t){return t.replace(/\n$|\r\n$/,"")}function kq(t,e,n){const r=typeof n.lineInfo=="function"?n.lineInfo(e):n.lineInfo[e-1];if(r==null){const i=`processLine: line ${e}, contains no state.lineInfo`;throw console.error(i,{node:t,line:e,state:n}),new Error(i)}return t.tagName="div",t.properties["data-line"]=r.lineNumber,t.properties["data-alt-line"]=r.altLineNumber,t.properties["data-line-type"]=r.type,t.properties["data-line-index"]=r.lineIndex,t.children.length===0&&t.children.push(is(` `)),t}function xq(t={}){const{classPrefix:e="__shiki_",classSuffix:n="",classReplacer:r=a=>a}=t,i=new Map;function s(a){return Object.entries(a).map(([l,c])=>`${l}:${c}`).join(";")}function o(a){const l=typeof a=="string"?a:s(a);let c=e+Sq(l)+n;return c=r(c),i.has(c)||i.set(c,typeof a=="string"?a:{...a}),c}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;const l=o(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(const l of a)for(const c of l){if(!c.htmlStyle)continue;const u=o(c.htmlStyle);c.htmlStyle={},c.htmlAttrs||={},c.htmlAttrs.class?c.htmlAttrs.class+=` ${u}`:c.htmlAttrs.class=u}},getClassRegistry(){return i},getCSS(){let a="";for(const[l,c]of i.entries())a+=`.${l}{${typeof c=="string"?c:s(c)}}`;return a},clearRegistry(){i.clear()}}}function Sq(t,e=0){let n=3735928559^e,r=1103547991^e;for(let i=0,s;i>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function xx(t=!1){const e={lineInfo:[]},n=[{line(r){return delete r.properties.class,r},pre(r){const i=cq(r),s=[];if(i!=null){let o=1;for(const a of i.children)a.type==="element"&&(s.push(kq(a,o,e)),o++);i.children=s}return r}}];return t&&n.push(_q,o3),{state:e,transformers:n,toClass:o3}}const o3=xq({classPrefix:"hl-"}),_q={name:"token-style-normalizer",tokens(t){for(const e of t)for(const n of e){if(n.htmlStyle!=null)continue;const r={};n.color!=null&&(r.color=n.color),n.bgColor!=null&&(r["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(r["font-style"]="italic"),(n.fontStyle&2)!==0&&(r["font-weight"]="bold"),(n.fontStyle&4)!==0&&(r["text-decoration"]="underline")),Object.keys(r).length>0&&(n.htmlStyle=r)}}};function nr(t){return`--${t==="token"?"diffs-token":"diffs"}-`}function Sx({theme:t=Dn,highlighter:e,prefix:n}){let r="";if(typeof t=="string"){const i=e.getTheme(t);r+=`color:${i.fg};`,r+=`background-color:${i.bg};`,r+=`${nr("global")}fg:${i.fg};`,r+=`${nr("global")}bg:${i.bg};`,r+=jp(i,n)}else{let i=e.getTheme(t.dark);r+=`${nr("global")}dark:${i.fg};`,r+=`${nr("global")}dark-bg:${i.bg};`,r+=jp(i,"dark"),i=e.getTheme(t.light),r+=`${nr("global")}light:${i.fg};`,r+=`${nr("global")}light-bg:${i.bg};`,r+=jp(i,"light")}return r}function jp(t,e){e=e!=null?`${e}-`:"";let n="";const r=t.colors?.["gitDecoration.addedResourceForeground"]??t.colors?.["terminal.ansiGreen"];r!=null&&(n+=`${nr("global")}${e}addition-color:${r};`);const i=t.colors?.["gitDecoration.deletedResourceForeground"]??t.colors?.["terminal.ansiRed"];i!=null&&(n+=`${nr("global")}${e}deletion-color:${i};`);const s=t.colors?.["gitDecoration.modifiedResourceForeground"]??t.colors?.["terminal.ansiBlue"];return s!=null&&(n+=`${nr("global")}${e}modified-color:${s};`),n}function n1(t){let e=t.children[0];for(;e!=null;){if(e.type==="element"&&e.tagName==="code")return e.children;"children"in e?e=e.children[0]:e=null}throw console.error(t),new Error("getLineNodes: Unable to find children")}function Gf({lines:t,startingLine:e=0,totalLines:n=1/0,callback:r}){const i=Math.min(e+n,t.length),s=(()=>{const o=t.at(-1);return o===""||o===` `||o===`\r `||o==="\r"?Math.max(0,t.length-2):t.length-1})();for(let o=e;o0||o<1/0,{state:c,transformers:u}=xx(),d=i?"text":t.lang??Ir(t.name),f=(()=>{if(typeof n=="string")return e.getTheme(n).type})(),h=Sx({theme:n,highlighter:e});c.lineInfo=y=>({type:"context",lineIndex:y-1+s,lineNumber:y+s});const p=typeof n=="string"?{lang:d,theme:n,transformers:u,defaultColor:!1,cssVariablePrefix:nr("token"),tokenizeMaxLineLength:r}:{lang:d,themes:n,transformers:u,defaultColor:!1,cssVariablePrefix:nr("token"),tokenizeMaxLineLength:r},m=n1(e.codeToHast(l?Eq(a??r1(t.contents),s,o):Ao(t.contents),p)),g=l?new Array(s):m;return l&&g.push(...m),{code:g,themeStyles:h,baseThemeType:f}}function Eq(t,e,n){let r="";return Gf({lines:t,startingLine:e,totalLines:n,callback({content:i}){r+=i}}),r}function Cx(t,e){return nt({tagName:"div",children:t,properties:{"data-content":"",style:`grid-row: span ${e}`}})}let Tq=-1;var Lq=class{__id=`file-renderer:${++Tq}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(t={theme:Dn},e,n){this.options=t,this.onRenderUpdate=e,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=pc(t.theme??Dn)?vx():void 0)}setOptions(t){this.options=t}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&this.mergeOptions({themeType:t})}setLineAnnotations(t){this.lineAnnotations={};for(const e of t){const n=this.lineAnnotations[e.lineNumber]??[];this.lineAnnotations[e.lineNumber]=n,n.push(e)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0,this.lineCache=void 0}hydrate(t){const{options:e}=this.getRenderOptions(t);let n=this.workerManager?.getFileResultCache(t);n!=null&&!Up(e,n.options)&&(n=void 0),this.renderCache??={file:t,options:e,highlighted:!0,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightFileAST(this,t):this.asyncHighlight(t).then(({result:r,options:i})=>{this.onHighlightSuccess(t,r,i)})}getRenderOptions(t){const e=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:r=Dn,tokenizeMaxLineLength:i=1e3}=this.options;return{theme:r,tokenizeMaxLineLength:i}})(),{renderCache:n}=this;return n?.result==null?{options:e,forceRender:!0}:t!==n.file||!Up(e,n.options)?{options:e,forceRender:!0}:{options:e,forceRender:!1}}getOrCreateLineCache(t){if(t.cacheKey==null)return this.lineCache=void 0,r1(t.contents);let{lineCache:e}=this;return(e==null||e.cacheKey!==t.cacheKey)&&(e={cacheKey:t.cacheKey,lines:r1(t.contents)}),this.lineCache=e,e.lines}renderFile(t=this.renderCache?.file,e=qf){if(t==null)return;const n=this.workerManager?.getFileResultCache(t);n!=null&&this.renderCache==null&&(this.renderCache={file:t,highlighted:!0,renderRange:void 0,...n});const{options:r,forceRender:i}=this.getRenderOptions(t);if(this.renderCache??={file:t,highlighted:!1,options:r,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!rh(this.renderCache.renderRange,e))&&(this.renderCache.result=this.workerManager.getPlainFileAST(t,e.startingLine,e.totalLines,this.getOrCreateLineCache(t)),this.renderCache.renderRange=e),e.totalLines>0&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,t);else{this.computedLang=t.lang??Ir(t.name);const s=this.highlighter!=null&&pc(r.theme),o=this.highlighter!=null&&Wf(this.computedLang);if(this.highlighter!=null&&s&&(i||!this.renderCache.highlighted&&o||this.renderCache.result==null)){const{result:a,options:l}=this.renderFileWithHighlighter(t,this.highlighter,!o);this.renderCache={file:t,options:l,highlighted:o,result:a,renderRange:void 0}}(!s||!o)&&this.asyncHighlight(t).then(({result:a,options:l})=>{this.onHighlightSuccess(t,a,l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,e,this.renderCache.result):void 0}async asyncRender(t,e=qf){const{result:n}=await this.asyncHighlight(t);return this.processFileResult(t,e,n)}async asyncHighlight(t){this.computedLang=t.lang??Ir(t.name);const e=this.highlighter!=null&&t1(Nc(this.options.theme)),n=this.highlighter!=null&&Wf(this.computedLang);return(this.highlighter==null||!e||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(t,this.highlighter)}renderFileWithHighlighter(t,e,n=!1){const{options:r}=this.getRenderOptions(t);return{result:_x(t,e,r,{forcePlainText:n}),options:r}}processFileResult(t,e,{code:n,themeStyles:r,baseThemeType:i}){const{disableFileHeader:s=!1}=this.options,o=[],a=Sa(),l=this.getOrCreateLineCache(t);let c=0;return Gf({lines:l,startingLine:e.startingLine,totalLines:e.totalLines,callback:({lineIndex:u,lineNumber:d})=>{const f=n[u];if(f==null){const h="FileRenderer.processFileResult: Line doesnt exist";throw console.error(h,{name:t.name,lineIndex:u,lineNumber:d,lines:l}),new Error(h)}if(f!=null){a.children.push(ux("context",d,`${u}`)),o.push(f),c++;const h=this.lineAnnotations[d];h!=null&&(a.children.push(kr("context","annotation",1)),o.push(tf({hunkIndex:0,lineIndex:d,annotations:h.map(p=>Lo(p))})),c++)}}}),a.properties.style=`grid-row: span ${c}`,{gutterAST:a.children??[],contentAST:o,preAST:this.createPreElement(l.length,r,i),headerAST:s?void 0:this.renderHeader(t,r,i),totalLines:l.length,rowCount:c,themeStyles:r,baseThemeType:i,bufferBefore:e.bufferBefore,bufferAfter:e.bufferAfter,css:""}}renderHeader(t,e,n){const{themeType:r="system"}=this.options;return bx({fileOrDiff:t,themeStyles:e,themeType:n??r})}renderFullHTML(t){return gi(this.renderFullAST(t))}renderFullAST(t,e=[]){return e.push(nt({tagName:"code",children:this.renderCodeAST(t),properties:{"data-code":""}})),{...t.preAST,children:e}}renderCodeAST(t){const e=Sa();return e.children=t.gutterAST,e.properties.style=`grid-row: span ${t.rowCount}`,[e,Cx(t.contentAST,t.rowCount)]}renderPartialHTML(t,e=!1){return gi(e?nt({tagName:"code",children:t,properties:{"data-code":""}}):t)}async initializeHighlighter(){return this.highlighter=await Ka(kx(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(t,e,n){if(this.renderCache==null)return;const r=this.renderCache.file!==t||!this.renderCache.highlighted||!Up(n,this.renderCache.options);this.renderCache={file:t,options:n,highlighted:!0,result:e,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(t){console.error(t)}createPreElement(t,e,n){const{disableLineNumbers:r=!1,overflow:i="scroll",themeType:s="system"}=this.options;return wx({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:r,overflow:i,themeStyles:e,themeType:n??s,split:!1,totalLines:t})}};function Up(t,e){return Ov(t.theme,e.theme)&&t.tokenizeMaxLineLength===e.tokenizeMaxLineLength}const Ex=``;function Kf(t,e){return t?.cacheKey===e?.cacheKey&&t?.contents===e?.contents&&t?.name===e?.name&&t?.lang===e?.lang}function Aq(t,e){return t.lineNumber===e.lineNumber&&t.metadata===e.metadata}function Tx(t,e){return t==null||e==null?t===e:t.type===e.type&&t.diffIndicators===e.diffIndicators&&t.disableBackground===e.disableBackground&&t.disableLineNumbers===e.disableLineNumbers&&t.overflow===e.overflow&&t.split===e.split&&t.themeStyles===e.themeStyles&&t.themeType===e.themeType&&t.totalLines===e.totalLines}function Lx(t){const e=document.createElement("div");return e.dataset.annotationSlot="",e.slot=t,e.style.whiteSpace="normal",e}function Ax(){const t=document.createElement("div");return t.slot="gutter-utility-slot",t.style.position="absolute",t.style.top="0",t.style.bottom="0",t.style.textAlign="center",t.style.whiteSpace="normal",t}function Mx(){const t=document.createElement("style");return t.setAttribute(Av,""),t}var Mq=`@layer base, theme, unsafe; @layer base { :host { --diffs-bg: #fff; --diffs-fg: #000; --diffs-font-fallback: 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono', 'Courier New', monospace; --diffs-header-font-fallback: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', 'Liberation Sans', Arial, sans-serif; --diffs-mixer: light-dark(black, white); --diffs-gap-fallback: 8px; /* // Available CSS Color Overrides --diffs-bg-buffer-override --diffs-bg-hover-override --diffs-bg-context-override --diffs-bg-separator-override --diffs-fg-number-override --diffs-fg-number-addition-override --diffs-fg-number-deletion-override --diffs-deletion-color-override --diffs-addition-color-override --diffs-modified-color-override --diffs-bg-deletion-override --diffs-bg-deletion-number-override --diffs-bg-deletion-hover-override --diffs-bg-deletion-emphasis-override --diffs-bg-addition-override --diffs-bg-addition-number-override --diffs-bg-addition-hover-override --diffs-bg-addition-emphasis-override // Line Selection Color Overrides (for enableLineSelection) --diffs-selection-color-override --diffs-bg-selection-override --diffs-bg-selection-number-override --diffs-bg-selection-background-override --diffs-bg-selection-number-background-override // Available CSS Layout Overrides --diffs-gap-inline --diffs-gap-block --diffs-gap-style --diffs-tab-size */ color-scheme: light dark; display: block; font-family: var( --diffs-header-font-family, var(--diffs-header-font-fallback) ); font-size: var(--diffs-font-size, 13px); line-height: var(--diffs-line-height, 20px); font-feature-settings: var(--diffs-font-features); } /* NOTE(mdo): Some semantic HTML elements (e.g. \`pre\`, \`code\`) have default * user-agent styles. These must be overridden to use our custom styles. */ pre, code, [data-error-wrapper] { isolation: isolate; margin: 0; padding: 0; display: block; outline: none; font-family: var(--diffs-font-family, var(--diffs-font-fallback)); } pre, code { background-color: var(--diffs-bg); } code { contain: content; } *, *::before, *::after { box-sizing: border-box; } [data-icon-sprite] { display: none; } /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset * their font-family explicitly. */ [data-diffs-header], [data-separator] { font-family: var( --diffs-header-font-family, var(--diffs-header-font-fallback) ); } [data-file-info] { padding: 10px; font-weight: 700; color: var(--fg); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ background-color: color-mix(in lab, var(--bg) 98%, var(--fg)); border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg)); } [data-diffs-header], [data-diff], [data-file], [data-error-wrapper], [data-virtualizer-buffer] { --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg)); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ --diffs-bg-buffer: var( --diffs-bg-buffer-override, light-dark( color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)) ) ); --diffs-bg-hover: var( --diffs-bg-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer)) ) ); --diffs-bg-context: var( --diffs-bg-context-override, light-dark( color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer)) ) ); --diffs-bg-context-number: var( --diffs-bg-context-number-override, light-dark( color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)), color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg)) ) ); --diffs-bg-separator: var( --diffs-bg-separator-override, light-dark( color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer)) ) ); --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark)); --diffs-fg-number: var( --diffs-fg-number-override, light-dark( color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)) ) ); --diffs-deletion-base: var( --diffs-deletion-color-override, light-dark( var( --diffs-light-deletion-color, var(--diffs-deletion-color, rgb(255, 0, 0)) ), var( --diffs-dark-deletion-color, var(--diffs-deletion-color, rgb(255, 0, 0)) ) ) ); --diffs-addition-base: var( --diffs-addition-color-override, light-dark( var( --diffs-light-addition-color, var(--diffs-addition-color, rgb(0, 255, 0)) ), var( --diffs-dark-addition-color, var(--diffs-addition-color, rgb(0, 255, 0)) ) ) ); --diffs-modified-base: var( --diffs-modified-color-override, light-dark( var( --diffs-light-modified-color, var(--diffs-modified-color, rgb(0, 0, 255)) ), var( --diffs-dark-modified-color, var(--diffs-modified-color, rgb(0, 0, 255)) ) ) ); /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor * and vscode use an older build of chrome that appears to have a bug with * color-mix and 'in oklch', so use 'in lab' instead */ --diffs-bg-deletion: var( --diffs-bg-deletion-override, light-dark( color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-number: var( --diffs-bg-deletion-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-hover: var( --diffs-bg-deletion-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base)) ) ); --diffs-bg-deletion-emphasis: var( --diffs-bg-deletion-emphasis-override, light-dark( rgb(from var(--diffs-deletion-base) r g b / 0.15), rgb(from var(--diffs-deletion-base) r g b / 0.2) ) ); --diffs-bg-addition: var( --diffs-bg-addition-override, light-dark( color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-number: var( --diffs-bg-addition-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-hover: var( --diffs-bg-addition-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base)) ) ); --diffs-bg-addition-emphasis: var( --diffs-bg-addition-emphasis-override, light-dark( rgb(from var(--diffs-addition-base) r g b / 0.15), rgb(from var(--diffs-addition-base) r g b / 0.2) ) ); --diffs-selection-base: var(--diffs-modified-base); --diffs-selection-number-fg: light-dark( color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)) ); --diffs-bg-selection: var( --diffs-bg-selection-override, light-dark( color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)) ) ); --diffs-bg-selection-number: var( --diffs-bg-selection-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)), color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base)) ) ); background-color: var(--diffs-bg); color: var(--diffs-fg); } [data-diff], [data-file] { /* This feels a bit crazy to me... so I need to think about it a bit more... */ --diffs-grid-number-column-width: minmax(min-content, max-content); --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr; &[data-dehydrated] { --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr); } &[data-theme-type='light'], & { [data-line] span { color: light-dark( var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)) ); font-weight: var(--diffs-token-light-font-weight, inherit); font-style: var(--diffs-token-light-font-style, inherit); -webkit-text-decoration: var(--diffs-token-light-text-decoration, inherit); text-decoration: var(--diffs-token-light-text-decoration, inherit); } } &[data-theme-type='dark'] [data-line] span { font-weight: var(--diffs-token-dark-font-weight, inherit); font-style: var(--diffs-token-dark-font-style, inherit); -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit); text-decoration: var(--diffs-token-dark-text-decoration, inherit); } &:hover [data-code]::-webkit-scrollbar-thumb { background-color: var(--diffs-bg-context); } } [data-line] span { background-color: light-dark( var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit) ); } [data-line], [data-gutter-buffer], [data-line-annotation], [data-no-newline] { color: var(--diffs-fg); background-color: var(--diffs-line-bg, var(--diffs-bg)); } [data-no-newline] { -webkit-user-select: none; user-select: none; span { opacity: 0.6; } } @media (prefers-color-scheme: dark) { [data-diffs-header], [data-error-wrapper], [data-diff], [data-file] { color-scheme: dark; } [data-content] [data-line] span { font-weight: var(--diffs-token-dark-font-weight, inherit); font-style: var(--diffs-token-dark-font-style, inherit); -webkit-text-decoration: var(--diffs-token-dark-text-decoration, inherit); text-decoration: var(--diffs-token-dark-text-decoration, inherit); } } [data-diffs-header], [data-diff], [data-file] { &[data-theme-type='light'] { color-scheme: light; } &[data-theme-type='dark'] { color-scheme: dark; } } [data-diff-type='split'][data-overflow='scroll'] { display: grid; grid-template-columns: 1fr 1fr; [data-additions] { border-left: 1px solid var(--diffs-bg); } [data-deletions] { border-right: 1px solid var(--diffs-bg); } } [data-code] { display: grid; grid-auto-flow: dense; grid-template-columns: var(--diffs-code-grid); overflow: scroll clip; overscroll-behavior-x: none; tab-size: var(--diffs-tab-size, 2); align-self: flex-start; padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback)); padding-bottom: max( 0px, calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px) ); } [data-container-size] { container-type: inline-size; } [data-code]::-webkit-scrollbar { width: 0; height: 6px; } [data-code]::-webkit-scrollbar-track { background: transparent; } [data-code]::-webkit-scrollbar-thumb { background-color: transparent; border: 1px solid transparent; background-clip: content-box; border-radius: 3px; } [data-code]::-webkit-scrollbar-corner { background-color: transparent; } /* * If we apply these rules globally it will mean that webkit will opt into the * standards compliant version of custom css scrollbars, which we do not want * because the custom stuff will look better */ @supports (-moz-appearance: none) { [data-code] { scrollbar-width: thin; scrollbar-color: var(--diffs-bg-context) transparent; padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback)); } } [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] { [data-code], &[data-overflow='wrap'] { padding-top: 0; } } [data-gutter] { display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; grid-column: 1; z-index: 3; position: relative; background-color: var(--diffs-bg); [data-gutter-buffer], [data-column-number] { border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg)); } } [data-content] { display: grid; grid-template-rows: subgrid; grid-template-columns: subgrid; grid-column: 2; min-width: 0; } [data-diff-type='split'][data-overflow='wrap'] { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, var(--diffs-code-grid)); padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); [data-deletions] { display: contents; [data-gutter] { grid-column: 1; } [data-content] { grid-column: 2; border-right: 1px solid var(--diffs-bg); } } [data-additions] { display: contents; [data-gutter] { grid-column: 3; border-left: 1px solid var(--diffs-bg); } [data-content] { grid-column: 4; } } } [data-overflow='scroll'] [data-gutter] { position: sticky; left: 0; } [data-line-annotation][data-selected-line] { background-color: unset; &::before { content: ''; /* FIXME(amadeus): This needs to be audited ... */ position: sticky; top: 0; left: 0; display: block; border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg)); background-color: var(--diffs-bg-selection-number); } [data-annotation-content] { background-color: var(--diffs-bg-selection); } } [data-interactive-lines] [data-line] { cursor: pointer; } [data-content-buffer], [data-gutter-buffer] { position: relative; -webkit-user-select: none; user-select: none; min-height: 1lh; } [data-gutter-buffer='annotation'] { min-height: 0; } [data-gutter-buffer='buffer'] { background-size: 8px 8px; background-position: 0 0; background-origin: border-box; background-color: var(--diffs-bg); /* This is incredibley expensive... */ background-image: repeating-linear-gradient( -45deg, transparent, transparent calc(3px * 1.414), rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414), rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414) ); } [data-content-buffer] { grid-column: 1; /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */ background-size: 8px 8px; background-position: 5px 0; background-origin: border-box; background-color: var(--diffs-bg); /* This is incredibley expensive... */ background-image: repeating-linear-gradient( -45deg, transparent, transparent calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414) ); } [data-separator] { box-sizing: content-box; background-color: var(--diffs-bg); } [data-separator='simple'] { min-height: 4px; } [data-separator='line-info'], [data-separator='line-info-basic'], [data-separator='metadata'], [data-separator='simple'] { background-color: var(--diffs-bg-separator); } [data-separator='line-info'], [data-separator='line-info-basic'], [data-separator='metadata'] { height: 32px; position: relative; } [data-separator-wrapper] { -webkit-user-select: none; user-select: none; fill: currentColor; position: absolute; inset-inline: 0; display: flex; align-items: center; background-color: var(--diffs-bg); height: 100%; } [data-content] [data-separator-wrapper] { display: none; } [data-separator='metadata'] [data-separator-wrapper] { inset-inline: 100% auto; padding-inline: 1ch; height: 100%; background-color: var(--diffs-bg-separator); color: var(--diffs-fg-number); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: min-content; } [data-separator='line-info'] { margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback)); } [data-separator='line-info-basic'], [data-separator='metadata'] { margin-block: 0; } [data-separator='line-info'][data-separator-first] { margin-top: 0; } [data-separator='line-info'][data-separator-last] { margin-bottom: 0; } [data-expand-index] [data-separator-wrapper] { display: grid; grid-template-columns: 32px auto; } [data-expand-index] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 32px 32px auto; } [data-expand-button], [data-separator-content] { display: flex; flex: 0 0 auto; align-items: center; background-color: var(--diffs-bg-separator); } [data-expand-button] { justify-content: center; flex-shrink: 0; cursor: pointer; min-width: 32px; align-self: stretch; color: var(--diffs-fg-number); border-right: 2px solid var(--diffs-bg); &:hover { color: var(--diffs-fg); } } [data-expand-down] [data-icon] { transform: scaleY(-1); } [data-separator-content] { flex: 1 1 auto; padding: 0 1ch; height: 100%; color: var(--diffs-fg-number); overflow: hidden; justify-content: flex-start; } [data-separator='line-info'], [data-separator='line-info-basic'] { [data-separator-content] { height: 100%; -webkit-user-select: none; user-select: none; overflow: clip; } } @supports (width: 1cqi) { [data-unified] { [data-separator='line-info'] [data-separator-wrapper] { padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback)); width: 100cqi; [data-separator-content] { border-radius: 6px; } } [data-separator='line-info'][data-expand-index] [data-separator-wrapper] [data-separator-content] { border-top-left-radius: unset; border-bottom-left-radius: unset; } } [data-gutter] { [data-separator='line-info'] [data-separator-wrapper] { padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback)); } [data-separator='line-info'] [data-separator-content] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } [data-separator='line-info'][data-expand-index] [data-separator-content] { border-top-left-radius: unset; border-bottom-left-radius: unset; } } [data-additions] { [data-content] [data-separator='line-info'] { background-color: var(--diffs-bg); [data-separator-wrapper] { display: none; } } [data-gutter] [data-separator='line-info'] [data-separator-wrapper] { display: block; height: 100%; background-color: var(--diffs-bg-separator); border-top-right-radius: 6px; border-bottom-right-radius: 6px; [data-separator-content], [data-expand-button] { display: none; } } } [data-overflow='scroll'] [data-additions] [data-gutter] [data-separator='line-info'] [data-separator-wrapper] { width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback))); } [data-overflow='wrap'] [data-additions] [data-content] [data-separator='line-info'] [data-separator-wrapper] { background-color: var(--diffs-bg-separator); display: block; height: 100%; margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback)); border-top-right-radius: 6px; border-bottom-right-radius: 6px; [data-separator-content], [data-expand-button] { display: none; } } [data-separator='line-info'] [data-separator-wrapper] { [data-expand-both], [data-expand-down], [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } } @media (pointer: fine) { [data-separator='line-info'] [data-separator-wrapper] { &[data-separator-multi-button] { [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: unset; } [data-expand-down] { border-bottom-left-radius: 6px; border-top-left-radius: unset; } } } } } @media (pointer: coarse) { [data-separator='line-info-basic'] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 34px 34px auto; [data-separator-content] { grid-column: unset; grid-row: unset; } } @supports (width: 1cqi) { [data-separator='line-info'] [data-separator-wrapper] { [data-expand-both], [data-expand-down], [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } &[data-separator-multi-button] { [data-expand-up] { border-top-left-radius: 6px; border-bottom-left-radius: 6px; } [data-expand-down] { border-bottom-left-radius: unset; border-top-left-radius: unset; } } } } } @media (pointer: fine) { [data-separator-wrapper][data-separator-multi-button] { display: grid; grid-template-rows: 50% 50%; [data-separator-content] { grid-column: 2; grid-row: 1 / -1; min-width: min-content; } [data-expand-button] { grid-column: 1; } } [data-separator='line-info'] [data-separator-wrapper], [data-separator='line-info'] [data-separator-wrapper][data-separator-multi-button] { grid-template-columns: 34px auto; } [data-separator='line-info-basic'][data-expand-index] [data-separator-wrapper] { grid-template-columns: 100% auto; } [data-separator='line-info'], [data-separator='line-info-basic'] { [data-separator-multi-button] { [data-expand-up] { border-bottom: 1px solid var(--diffs-bg); border-right: 2px solid var(--diffs-bg); } [data-expand-down] { border-top: 1px solid var(--diffs-bg); border-right: 2px solid var(--diffs-bg); } } } } [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator='line-info-basic'] [data-separator-wrapper], [data-content] [data-separator-wrapper] { display: none; } [data-line-annotation], [data-gutter-buffer='annotation'] { --diffs-line-bg: var(--diffs-bg-context); } [data-line-annotation] { min-height: var(--diffs-annotation-min-height, 0); z-index: 2; } [data-separator='custom'] { display: grid; grid-template-columns: subgrid; } [data-line], [data-column-number], [data-no-newline] { position: relative; padding-inline: 1ch; } [data-indicators='classic'] [data-line] { padding-inline-start: 2ch; } [data-indicators='classic'] { [data-line-type='change-addition'], [data-line-type='change-deletion'] { &[data-no-newline], &[data-line] { &::before { display: inline-block; width: 1ch; height: 1lh; position: absolute; top: 0; left: 0; -webkit-user-select: none; user-select: none; } } } [data-line-type='change-addition'] { &[data-line], &[data-no-newline] { &::before { content: '+'; color: var(--diffs-addition-base); } } } [data-line-type='change-deletion'] { &[data-line], &[data-no-newline] { &::before { content: '-'; color: var(--diffs-deletion-base); } } } } [data-indicators='bars'] { [data-line-type='change-deletion'], [data-line-type='change-addition'] { &[data-column-number] { &::before { content: ''; display: block; width: 4px; height: 100%; position: absolute; top: 0; left: 0; -webkit-user-select: none; user-select: none; contain: strict; } } } [data-line-type='change-deletion'] { &[data-column-number] { &::before { background-image: linear-gradient( 0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50% ); background-repeat: repeat; background-size: 2px 2px; background-size: calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px)); } } } [data-line-type='change-addition'] { &[data-column-number] { &::before { background-color: var(--diffs-addition-base); } } } } [data-overflow='wrap'] { [data-line], [data-annotation-content] { white-space: pre-wrap; word-break: break-word; } } [data-overflow='scroll'] [data-line] { white-space: pre; min-height: 1lh; } [data-column-number] { box-sizing: content-box; text-align: right; -webkit-user-select: none; user-select: none; background-color: var(--diffs-bg); color: var(--diffs-fg-number); padding-left: 2ch; } [data-line-number-content] { display: inline-block; min-width: var( --diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch) ); } [data-disable-line-numbers] { [data-column-number] { min-width: 4px; padding: 0; } [data-line-number-content] { display: none; } [data-gutter-utility-slot] { right: unset; left: 0; justify-content: flex-start; } &[data-indicators='bars'] [data-gutter-utility-slot] { /* Using 5px here because theres a 1px separator after the bar */ left: 5px; } } [data-file][data-disable-line-numbers] { [data-gutter-buffer], [data-column-number] { min-width: 0; border-right: 0; } } [data-interactive-line-numbers] [data-column-number] { cursor: pointer; } [data-diff-span] { border-radius: 3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; } [data-line-type='change-addition'] { &[data-column-number] { color: var( --diffs-fg-number-addition-override, var(--diffs-addition-base) ); } > [data-diff-span] { background-color: var(--diffs-bg-addition-emphasis); } } [data-line-type='change-deletion'] { &[data-column-number] { color: var( --diffs-fg-number-deletion-override, var(--diffs-deletion-base) ); } [data-diff-span] { background-color: var(--diffs-bg-deletion-emphasis); } } [data-background] [data-line-type='change-addition'] { --diffs-line-bg: var(--diffs-bg-addition); &[data-column-number] { background-color: var(--diffs-bg-addition-number); } } [data-background] [data-line-type='change-deletion'] { --diffs-line-bg: var(--diffs-bg-deletion); &[data-column-number] { background-color: var(--diffs-bg-deletion-number); } } @media (pointer: fine) { [data-column-number], [data-line] { &[data-hovered] { background-color: var(--diffs-bg-hover); } } [data-background] { [data-column-number], [data-line] { &[data-hovered] { &[data-line-type='change-deletion'] { background-color: var(--diffs-bg-deletion-hover); } &[data-line-type='change-addition'] { background-color: var(--diffs-bg-addition-hover); } } } } } [data-diffs-header] { position: relative; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); min-height: calc( 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3) ); padding-inline: 16px; top: 0; z-index: 2; } [data-header-content] { display: flex; flex-direction: row; align-items: center; gap: var(--diffs-gap-inline, var(--diffs-gap-fallback)); min-width: 0; white-space: nowrap; } [data-header-content] [data-prev-name], [data-header-content] [data-title] { direction: rtl; overflow: hidden; text-overflow: ellipsis; min-width: 0; white-space: nowrap; } [data-prev-name] { opacity: 0.7; } [data-rename-icon] { fill: currentColor; flex-shrink: 0; flex-grow: 0; } [data-diffs-header] [data-metadata] { display: flex; align-items: center; gap: 1ch; white-space: nowrap; } [data-diffs-header] [data-additions-count] { font-family: var(--diffs-font-family, var(--diffs-font-fallback)); color: var(--diffs-addition-base); } [data-diffs-header] [data-deletions-count] { font-family: var(--diffs-font-family, var(--diffs-font-fallback)); color: var(--diffs-deletion-base); } [data-annotation-content] { position: relative; display: flow-root; align-self: flex-start; z-index: 2; min-width: 0; isolation: isolate; } /* Sticky positioning has a composite costs, so we should _only_ pay it if we * need to */ [data-overflow='scroll'] [data-annotation-content] { position: sticky; width: var(--diffs-column-content-width, auto); left: var(--diffs-column-number-width, 0); } /* Undo some of the stuff that the 'pre' tag does */ [data-annotation-slot] { text-wrap-mode: wrap; word-break: normal; white-space-collapse: collapse; } [data-change-icon] { fill: currentColor; flex-shrink: 0; } [data-change-icon='change'], [data-change-icon='rename-pure'], [data-change-icon='rename-changed'] { color: var(--diffs-modified-base); } [data-change-icon='new'] { color: var(--diffs-addition-base); } [data-change-icon='deleted'] { color: var(--diffs-deletion-base); } [data-change-icon='file'] { opacity: 0.6; } /* Line selection highlighting */ [data-selected-line] { &[data-gutter-buffer='annotation'], &[data-column-number] { color: var(--diffs-selection-number-fg); background-color: var(--diffs-bg-selection-number); } &[data-line] { background-color: var(--diffs-bg-selection); } } [data-line-type='change-addition'], [data-line-type='change-deletion'] { &[data-selected-line] { &[data-line], &[data-line][data-hovered] { background-color: light-dark( color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 82%, var(--diffs-selection-base) ), color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 75%, var(--diffs-selection-base) ) ); } &[data-column-number], &[data-column-number][data-hovered] { color: var(--diffs-selection-number-fg); background-color: light-dark( color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 75%, var(--diffs-selection-base) ), color-mix( in lab, var(--diffs-line-bg, var(--diffs-bg)) 60%, var(--diffs-selection-base) ) ); } } } [data-gutter-utility-slot] { position: absolute; top: 0; bottom: 0; right: 0; display: flex; justify-content: flex-end; } [data-unmodified-lines] { display: block; overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; } [data-error-wrapper] { overflow: auto; padding: var(--diffs-gap-block, var(--diffs-gap-fallback)) var(--diffs-gap-inline, var(--diffs-gap-fallback)); max-height: 400px; scrollbar-width: none; [data-error-message] { font-weight: bold; font-size: 18px; color: var(--diffs-deletion-base); } [data-error-stack] { color: var(--diffs-fg-number); } } [data-placeholder] { contain: strict; } [data-utility-button] { display: flex; align-items: center; justify-content: center; border: none; appearance: none; width: 1lh; height: 1lh; margin-right: calc((1lh - 1ch) * -1); padding: 0; cursor: pointer; font-size: var(--diffs-font-size, 13px); line-height: var(--diffs-line-height, 20px); border-radius: 4px; background-color: var(--diffs-modified-base); color: var(--diffs-bg); fill: currentColor; position: relative; z-index: 4; } } `;const Iq="@layer base, theme, unsafe;";function Ix(t){return`${Iq} @layer unsafe { ${t} }`}function nf({code:t,pre:e,columnType:n,rowSpan:r,containerSize:i=!1}={}){return t==null&&(t=document.createElement("code"),t.setAttribute("data-code",""),n!=null&&t.setAttribute(`data-${n}`,""),e?.appendChild(t)),r!=null?t.style.setProperty("grid-row",`span ${r}`):t.style.removeProperty("grid-row"),i?t.setAttribute("data-container-size",""):t.removeAttribute("data-container-size"),t}function Ox(t,e){if(e==null)return;const n=t.shadowRoot??t.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=e)}function Dx(t,{type:e,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:s,split:o,themeStyles:a,themeType:l,totalLines:c}){switch(e==="diff"?(t.setAttribute("data-diff",""),t.removeAttribute("data-file")):(t.setAttribute("data-file",""),t.removeAttribute("data-diff")),l==="system"?t.removeAttribute("data-theme-type"):t.setAttribute("data-theme-type",l),n){case"bars":case"classic":t.setAttribute("data-indicators",n);break;case"none":t.removeAttribute("data-indicators");break}return i?t.setAttribute("data-disable-line-numbers",""):t.removeAttribute("data-disable-line-numbers"),r?t.removeAttribute("data-background"):t.setAttribute("data-background",""),e==="diff"?t.setAttribute("data-diff-type",o?"split":"single"):t.removeAttribute("data-diff-type"),t.setAttribute("data-overflow",s),t.tabIndex=0,t.style=a,t.style.setProperty("--diffs-min-number-column-width-default",`${`${c}`.length}ch`),t}if(typeof HTMLElement<"u"&&customElements.get(Bf)==null){let t;class e extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const r=this.attachShadow({mode:"open"});t==null&&(t=new CSSStyleSheet,t.replaceSync(Mq)),r.adoptedStyleSheets=[t]}}customElements.define(Bf,e)}const Rx=!0,Oq=[];let Dq=-1;var Px=class{static LoadedCustomComponent=Rx;__id=`file:${++Dq}`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;unsafeCSSStyle;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;appliedPreAttributes;lastRowCount;headerElement;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];file;renderRange;constructor(e={theme:Dn},n,r=!1){this.options=e,this.workerManager=n,this.isContainerManaged=r,this.fileRenderer=new Lq(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new fx,this.interactionManager=new dx("file",Uf(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.file!=null&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}setOptions(e){e!=null&&(this.options=e,this.interactionManager.setOptions(Uf(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.fileRenderer.setThemeType(e),this.headerElement!=null&&(e==="system"?delete this.headerElement.dataset.themeType:this.headerElement.dataset.themeType=e),this.pre!=null))switch(e){case"system":delete this.pre.dataset.themeType;break;case"light":case"dark":this.pre.dataset.themeType=e;break}}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.renderRange=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,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.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.unsafeCSSStyle=void 0,this.placeHolder=void 0}hydrate(e){const{fileContainer:n,prerenderedHTML:r}=e;Ox(n,r);for(const i of Array.from(n.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(Av)){this.unsafeCSSStyle=i;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}if(this.pre==null)this.render(e);else{const{file:i,lineAnnotations:s}=e,{overflow:o="scroll"}=this.options;this.fileContainer=n,delete this.pre.dataset.dehydrated,this.lineAnnotations=s??this.lineAnnotations,this.file=i,this.fileRenderer.hydrate(i),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,o==="wrap")}}getOrCreateLineCache(e=this.file){return e!=null?this.fileRenderer.getOrCreateLineCache(e):Oq}render({file:e,fileContainer:n,forceRender:r=!1,containerWrapper:i,lineAnnotations:s,renderRange:o}){const{collapsed:a=!1}=this.options,l=a?void 0:o,c=this.renderRange,u=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1,d=!Kf(this.file,e);if(!a&&!r&&rh(l,this.renderRange)&&!d&&!u)return!1;this.renderRange=l,this.file=e,this.fileRenderer.setOptions(this.options),s!=null&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:f=!1,disableFileHeader:h=!1,overflow:p="scroll"}=this.options;if(h&&(this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.headerPrefix!=null&&(this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerPrefix=void 0),this.headerMetadata!=null&&(this.headerMetadata.parentNode?.removeChild(this.headerMetadata),this.headerMetadata=void 0)),n=this.getOrCreateFileContainerNode(n,i),a){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const m=this.fileRenderer.renderFile(e,cx);m?.headerAST!=null&&this.applyHeaderToDOM(m.headerAST,n),this.injectUnsafeCSS()}catch(m){if(f)throw m;console.error(m),m instanceof Error&&this.applyErrorToDOM(m,n)}return!0}try{const m=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(r,u,d)||!this.applyPartialRender(c,l)){const g=this.fileRenderer.renderFile(e,l);if(g==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;g.headerAST!=null&&this.applyHeaderToDOM(g.headerAST,n),this.applyFullRender(g,m)}this.applyBuffers(m,l),this.injectUnsafeCSS(),this.interactionManager.setup(m),this.resizeManager.setup(m,p==="wrap"),this.renderAnnotations(),this.renderGutterUtility()}catch(m){if(f)throw m;console.error(m),m instanceof Error&&this.applyErrorToDOM(m,n)}return!0}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.parentNode?.removeChild(e);this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,n,r){return!(e||n||r)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}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.pre?.remove(),this.spriteSVG?.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.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:r}of this.annotationCache.values())r.parentNode?.removeChild(r);this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[r,i]of this.lineAnnotations.entries()){const s=`${r}-${Lo(i)}`;let o=this.annotationCache.get(s);if(o==null||!Aq(i,o.annotation)){o?.element.parentElement?.removeChild(o.element);const a=n(i);if(a==null)continue;o={element:Lx(Lo(i)),annotation:i},o.element.appendChild(a),this.fileContainer.appendChild(o.element),this.annotationCache.set(s,o)}e.delete(s)}for(const[r,{element:i}]of e.entries())this.annotationCache.delete(r),i.parentNode?.removeChild(i)}renderGutterUtility(){const e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=e(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.parentNode?.removeChild(this.gutterUtilityContent),this.gutterUtilityContent=void 0;return}const r=Ax();r.appendChild(n),this.fileContainer.appendChild(r),this.gutterUtilityContent=r}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:e}=this.options;if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.parentNode?.removeChild(this.unsafeCSSStyle),this.unsafeCSSStyle=void 0);return}this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Mx(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ix(e)}applyFullRender(e,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,e),this.code=nf({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),n.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,n){if(e==null||n==null)return!1;const{file:r,code:i}=this,s=i!=null?this.getColumns(i):void 0;if(r==null||i==null||s==null)return!1;const o=e.startingLine,a=n.startingLine,l=e.totalLines===1/0?Number.POSITIVE_INFINITY:o+e.totalLines,c=n.totalLines===1/0?Number.POSITIVE_INFINITY:a+n.totalLines,u=Math.max(o,a),d=Math.min(l,c);if(d<=u||!this.trimDOMToOverlap(s.gutter,u,d)||!this.trimDOMToOverlap(s.content,u,d))return!1;let{length:f}=s.content.children;const h=(y,v)=>{if(!(v<=0))return this.fileRenderer.renderFile(r,{startingLine:y,totalLines:v,bufferBefore:0,bufferAfter:0})},p=ad?h(d,m):void 0;return g===void 0&&c>d?!1:(this.cleanupErrorWrapper(),p!=null&&(s.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(p.gutterAST)),s.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(p.contentAST)),f+=p.rowCount),g!=null&&(s.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.gutterAST)),s.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.contentAST)),f+=g.rowCount),this.lastRowCount!==f&&(s.gutter.style.setProperty("grid-row",`span ${f}`),s.content.style.setProperty("grid-row",`span ${f}`),this.lastRowCount=f),!0)}getColumns(e){const n=e.children[0],r=e.children[1];if(!(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||n.dataset.gutter==null||r.dataset.content==null))return{gutter:n,content:r}}trimDOMToOverlap(e,n,r){const i=this.getDOMBoundaryIndices(e,[n,r]),s=i.get(n)??e.children.length,o=i.get(r)??e.children.length;if(s>o)return!1;for(let a=e.children.length-1;a>=o;a-=1)e.children[a]?.remove();for(let a=s-1;a>=0;a-=1)e.children[a]?.remove();return!0}getDOMBoundaryIndices(e,n){const r=[...new Set(n)].sort((l,c)=>l-c),i=new Map;if(r.length===0)return i;let s=0,o=r[s];const{children:a}=e;for(let l=0;l=o;)i.set(o,l),s+=1,o=r[s];if(s>=r.length)break}}for(const l of r)i.has(l)||i.set(l,a.length);return i}getLineIndexFromDOMNode(e){const n=e.dataset.lineIndex;if(n==null)return;const r=Number(n);return Number.isNaN(r)?void 0:r}applyBuffers(e,n){const{disableVirtualizationBuffers:r=!1}=this.options;if(r||n==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyHeaderToDOM(e,n){const{file:r}=this;if(r==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const i=gi(e);if(i!==this.lastRenderedHeaderHTML){const c=document.createElement("div");c.innerHTML=i;const u=c.firstElementChild;if(!(u instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(u,this.headerElement):n.shadowRoot?.prepend(u),this.headerElement=u,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;const{renderHeaderPrefix:s,renderCustomMetadata:o}=this.options;this.headerPrefix!=null&&this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const a=s?.(r)??void 0,l=o?.(r)??void 0;a!=null&&(this.headerPrefix=document.createElement("div"),this.headerPrefix.slot=Tv,a instanceof Element?this.headerPrefix.appendChild(a):this.headerPrefix.innerText=`${a}`,n.appendChild(this.headerPrefix)),l!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=Lv,l instanceof Element?this.headerMetadata.appendChild(l):this.headerMetadata.innerText=`${l}`,n.appendChild(this.headerMetadata))}getOrCreateFileContainerNode(e,n){const r=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(Bf),r!=null&&r!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=Ex;const s=i.firstChild;s instanceof SVGElement&&(this.spriteSVG=s,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(e){const n=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}applyPreNodeAttributes(e,{totalLines:n,themeStyles:r,baseThemeType:i}){const{overflow:s="scroll",themeType:o="system",disableLineNumbers:a=!1}=this.options,l={type:"file",split:!1,themeStyles:r,overflow:s,disableLineNumbers:a,themeType:i??o,diffIndicators:"none",disableBackground:!0,totalLines:n};Tx(l,this.appliedPreAttributes)||(Dx(e,l),this.appliedPreAttributes=l)}applyErrorToDOM(e,n){this.cleanupErrorWrapper();const r=this.getOrCreatePreNode(n);r.innerHTML="",r.parentNode?.removeChild(r),this.pre=void 0,this.appliedPreAttributes=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);const s=document.createElement("div");s.dataset.errorMessage="",s.innerText=e.message,this.errorWrapper.appendChild(s);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}},Rq=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(t,e,n){if(e==null||n==null)for(const r of t.children??[])r instanceof HTMLElement&&("deletions"in r.dataset?e=r:"additions"in r.dataset&&(n=r));if(n==null||e==null){this.cleanUp();return}this.codeDeletions!==e&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=e,e.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 fd(t){return nt({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":t,style:`grid-row: span ${t};min-height:calc(${t} * 1lh)`}})}function hd(t){return nt({tagName:"div",children:[nt({tagName:"span",children:[is("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":t,"data-column-content":""}})}function Wp(t){return nt({tagName:"div",children:[jf({name:t==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{"data-expand-button":"","data-expand-both":t==="both"?"":void 0,"data-expand-up":t==="up"?"":void 0,"data-expand-down":t==="down"?"":void 0}})}function na({type:t,content:e,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:s,isLastHunk:o}){const a=[];if(t==="metadata"&&e!=null&&a.push(nt({tagName:"div",children:[is(e)],properties:{"data-separator-wrapper":""}})),(t==="line-info"||t==="line-info-basic")&&e!=null){const l=[];n!=null&&(r?(s||l.push(Wp("up")),o||l.push(Wp("down"))):l.push(Wp(!s&&!o?"both":s?"down":"up"))),l.push(nt({tagName:"div",children:[nt({tagName:"span",children:[is(e)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),a.push(nt({tagName:"div",children:l,properties:{"data-separator-wrapper":"","data-separator-multi-button":l.length>2?"":void 0}}))}return t==="custom"&&i!=null&&a.push(nt({tagName:"slot",properties:{name:i}})),nt({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":t,"data-expand-index":n,"data-separator-first":s?"":void 0,"data-separator-last":o?"":void 0}})}function Pq(t,e){return`hunk-separator-${t}-${e}`}function Nq(t){const e=t.at(-1);return e==null?0:Math.max(e.additionStart+e.additionCount,e.deletionStart+e.deletionCount)}function $q(t){return t.startingLine===0&&t.totalLines===1/0&&t.bufferBefore===0&&t.bufferAfter===0}let Dv=class{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(e,n,r,i){var s;const o=v=>{if(v=this.postProcess(v,r),i){setTimeout(function(){i(v)},0);return}else return v},a=n.length,l=e.length;let c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));const d=(s=r.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+d,h=[{oldPos:-1,lastComponent:void 0}];let p=this.extractCommon(h[0],n,e,0,r);if(h[0].oldPos+1>=l&&p+1>=a)return o(this.buildValues(h[0].lastComponent,n,e));let m=-1/0,g=1/0;const y=()=>{for(let v=Math.max(m,-c);v<=Math.min(g,c);v+=2){let w;const _=h[v-1],k=h[v+1];_&&(h[v-1]=void 0);let S=!1;if(k){const E=k.oldPos-v;S=k&&0<=E&&E=l&&p+1>=a)return o(this.buildValues(w.lastComponent,n,e))||!0;h[v]=w,w.oldPos+1>=l&&(g=Math.min(g,v-1)),p+1>=a&&(m=Math.max(m,v+1))}c++};if(i)(function v(){setTimeout(function(){if(c>u||Date.now()>f)return i(void 0);y()||v()},0)})();else for(;c<=u&&Date.now()<=f;){const v=y();if(v)return v}}addToPath(e,n,r,i,s){const o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){const o=n.length,a=r.length;let l=e.oldPos,c=l-i,u=0;for(;c+1f.length?p:f}),u.value=this.join(d)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return i}};class Fq extends Dv{}const Hq=new Fq;function Vq(t,e,n){return Hq.diff(t,e,n)}const a3="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 zq extends Dv{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${a3}]+|[^\\S\\n\\r]+|[^${a3}]`,"ug");return e.match(n)||[]}}const Bq=new zq;function qq(t,e,n){return Bq.diff(t,e,n)}class jq extends Dv{constructor(){super(...arguments),this.tokenize=Wq}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(` `))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(` `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(` `)&&(e=e.slice(0,-1)),n.endsWith(` `)&&(n=n.slice(0,-1))),super.equals(e,n,r)}}const Uq=new jq;function l3(t,e,n){return Uq.diff(t,e,n)}function Wq(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` `));const n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:u}=a;l3(n,r,Object.assign(Object.assign({},a),{callback:d=>{const f=c(d);u(f)}}))}else return c(l3(n,r,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function d(v){return v.map(function(w){return" "+w})}const f=[];let h=0,p=0,m=[],g=1,y=1;for(let v=0;v0?d(k.lines.slice(-l)):[],h-=m.length,p-=m.length)}for(const k of _)m.push((w.added?"+":"-")+k);w.added?y+=_.length:g+=_.length}else{if(h)if(_.length<=l*2&&v1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(r=>Nx(r,e)).join(` `)}const n=[];e.includeIndex&&t.oldFileName==t.newFileName&&n.push("Index: "+t.oldFileName),e.includeUnderline&&n.push("==================================================================="),e.includeFileHeaders&&(n.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),n.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader)));for(let r=0;rr+` `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function c3({line:t,spanStart:e,spanLength:n}){return{start:{line:t,character:e},end:{line:t,character:e+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function pd({item:t,arr:e,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){const s=e[e.length-1];if(s==null||i||!n){e.push([r?0:1,t.value]);return}const o=s[0]===0;if(r===o||r&&t.value.length===1&&!o){s[1]+=t.value;return}e.push([r?0:1,t.value])}function Zf({diff:t,diffStyle:e,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:s=Ia,callback:o}){const a={finalHunk:t.hunks.at(-1),viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:0,unifiedCount:0,shouldBreak(){if(!a.isWindowedHighlight)return!1;const l=a.unifiedCount>=n+r,c=a.splitCount>=n+r;return e==="unified"?l:(e==="split"||l)&&c},shouldSkip(l,c){if(!a.isWindowedHighlight)return!1;const u=a.unifiedCount+l=n-l&&a.unifiedCount=n-l&&a.splitCount0?0:e==="unified"?S===c.unifiedLineStart+c.unifiedLineCount-1?d.collapsedLines:0:L===c.splitLineStart+c.splitLineCount-1?d.collapsedLines:0},p=function(){if(u.collapsedLines===0)return 0;const S=u.collapsedLines;return u.collapsedLines=0,S};if(a.shouldBreak())break;const u=u3(t.isPartial,c.collapsedBefore,i,l,s),d=(()=>{if(c!==a.finalHunk||!Qq(t))return;const S=t.additionLines.length-(c.additionLineIndex+c.additionCount),L=t.deletionLines.length-(c.deletionLineIndex+c.deletionCount);if(S!==L)throw new Error(`iterateOverDiff: trailing context mismatch (additions=${S}, deletions=${L}) for ${t.name}`);const E=Math.min(S,L);return u3(t.isPartial,E,i,t.hunks.length,s)})(),f=u.fromStart+u.fromEnd;if(a.shouldSkip(f,f))a.incrementCounts(f,f),p();else{let S=c.unifiedLineStart-u.rangeSize,L=c.splitLineStart-u.rangeSize,E=c.deletionLineIndex-u.rangeSize,C=c.additionLineIndex-u.rangeSize,V=c.deletionStart-u.rangeSize,R=c.additionStart-u.rangeSize,F=0;for(;F=e;return{fromStart:c?e:o,fromEnd:c?0:a,rangeSize:e,collapsedLines:Math.max(e-l,0)}}function Qq(t){const e=t.hunks.at(-1);return e==null||t.isPartial||t.additionLines.length===0||t.deletionLines.length===0?!1:e.additionLineIndex+e.additionCount=t.viewportEnd)return;const h=Math.max(0,t.viewportStart-d),p=Math.min(f,t.viewportEnd-d);return p>h?[h,p]:void 0}function l(d,f){return s==="split"?d:f==="additions"?[d[0]+e.deletions,d[1]+e.deletions]:d}function c(d,f){if(d==null)return;const[h,p]=l(d,f);p>h&&o.push([h,p])}if(r&&(c(a(t.unifiedCount,e.deletions),"deletions"),c(a(t.unifiedCount+e.deletions,e.additions),"additions")),i&&(c(a(t.splitCount,e.deletions),"deletions"),c(a(t.splitCount,e.additions),"additions")),o.length===0)return o;o.sort((d,f)=>d[0]-f[0]);const u=[o[0]];for(const[d,f]of o.slice(1)){const h=u[u.length-1];d<=h[1]?h[1]=Math.max(h[1],f):u.push([d,f])}return u}function Jq({hunkIndex:t,hunk:e,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:s,unifiedLineIndex:o,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:c,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:h,unifiedCount:p,splitCount:m}){const g=s=f.deletions?o+s:void 0:s=f.deletions?l+(s-f.deletions):void 0:s=f.deletions?u+(s-f.deletions):void 0:s0||s<1/0,c=(()=>{const v=n.theme??Dn;if(typeof v=="string")return e.getTheme(v).type})(),u=Sx({theme:n.theme,highlighter:e}),d=r&&!l&&(t.unifiedLineCount>1e3||t.splitLineCount>1e3)?"none":n.lineDiffType,f={deletionLines:[],additionLines:[]},h=!r&&!t.isPartial,p=r?o:void 0,m=new Map;function g(v){const w=h?0:v,_=m.get(w)??nj();return m.set(w,_),_}function y(v,w,_,k){if(l){let S=_.at(-1);(S==null||S.targetIndex+S.count!==w)&&(S={targetIndex:w,originalOffset:k.length,count:0},_.push(S)),S.count++}k.push(v)}Zf({diff:t,diffStyle:"both",startingLine:i,totalLines:s,expandedHunks:l?p:!0,collapsedContextThreshold:a,callback:({hunkIndex:v,additionLine:w,deletionLine:_,type:k})=>{const S=g(v),L=w!=null?w.splitLineIndex:_.splitLineIndex;k==="change"&&w!=null&&_!=null&&tj({additionLine:t.additionLines[w.lineIndex],deletionLine:t.deletionLines[_.lineIndex],deletionLineIndex:S.deletionContent.length,additionLineIndex:S.additionContent.length,deletionDecorations:S.deletionDecorations,additionDecorations:S.additionDecorations,lineDiffType:d}),_!=null&&(y(t.deletionLines[_.lineIndex],_.lineIndex,S.deletionSegments,S.deletionContent),S.deletionInfo.push({type:k==="change"?"change-deletion":k,lineNumber:_.lineNumber,altLineNumber:k==="change"?void 0:w.lineNumber??void 0,lineIndex:`${_.unifiedLineIndex},${L}`})),w!=null&&(y(t.additionLines[w.lineIndex],w.lineIndex,S.additionSegments,S.additionContent),S.additionInfo.push({type:k==="change"?"change-addition":k,lineNumber:w.lineNumber,altLineNumber:k==="change"?void 0:_.lineNumber??void 0,lineIndex:`${w.unifiedLineIndex},${L}`}))}});for(const v of m.values()){if(v.deletionContent.length===0&&v.additionContent.length===0)continue;const w={name:t.prevName??t.name,contents:v.deletionContent.value},_={name:t.name,contents:v.additionContent.value},{deletionLines:k,additionLines:S}=rj({deletionFile:w,deletionInfo:v.deletionInfo,deletionDecorations:v.deletionDecorations,additionFile:_,additionInfo:v.additionInfo,additionDecorations:v.additionDecorations,highlighter:e,options:n,languageOverride:r?"text":t.lang});if(h){f.deletionLines=k,f.additionLines=S;continue}if(v.deletionSegments.length>0)for(const L of v.deletionSegments)for(let E=0;E0)for(const L of v.additionSegments)for(let E=0;E{switch(e.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),r=n[e.lineNumber]??[];n[e.lineNumber]=r,r.push(e)}}getOptionsWithDefaults(){const{diffIndicators:t="bars",diffStyle:e="split",disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:s=!1,collapsed:o=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=Ia,expansionLineCount:c=100,hunkSeparators:u="line-info",lineDiffType:d="word-alt",maxLineDiffLength:f=1e3,overflow:h="scroll",theme:p=Dn,themeType:m="system",tokenizeMaxLineLength:g=1e3,useCSSClasses:y=!1}=this.options;return{diffIndicators:t,diffStyle:e,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:s,collapsed:o,expandUnchanged:a,collapsedContextThreshold:l,expansionLineCount:c,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:h,theme:this.workerManager?.getDiffRenderOptions().theme??p,themeType:m,tokenizeMaxLineLength:g,useCSSClasses:y}}async initializeHighlighter(){return this.highlighter=await Ka(kx(this.computedLang,this.options)),this.highlighter}hydrate(t){if(t==null)return;this.diff=t;const{options:e}=this.getRenderOptions(t);let n=this.workerManager?.getDiffResultCache(t);n!=null&&!Gp(e,n.options)&&(n=void 0),this.renderCache??={diff:t,highlighted:!0,options:e,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0&&this.renderCache.result==null?this.workerManager.highlightDiffAST(this,this.diff):this.asyncHighlight(t).then(({result:r,options:i})=>{this.onHighlightSuccess(t,r,i)})}getRenderOptions(t){const e=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}=this.getOptionsWithDefaults();return{theme:r,tokenizeMaxLineLength:i,lineDiffType:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:e,forceRender:!0}:t!==n.diff||!Gp(e,n.options)?{options:e,forceRender:!0}:{options:e,forceRender:!1}}renderDiff(t=this.renderCache?.diff,e=qf){if(t==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),i=this.workerManager?.getDiffResultCache(t);i!=null&&this.renderCache==null&&(this.renderCache={diff:t,highlighted:!0,renderRange:void 0,...i});const{options:s,forceRender:o}=this.getRenderOptions(t);if(this.renderCache??={diff:t,highlighted:!1,options:s,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)(this.renderCache.result==null||!this.renderCache.highlighted&&!rh(this.renderCache.renderRange,e))&&(this.renderCache.result=this.workerManager.getPlainDiffAST(t,e.startingLine,e.totalLines,$q(e)||n?!0:this.expandedHunks,r),this.renderCache.renderRange=e),e.totalLines>0&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,t);else{this.computedLang=t.lang??Ir(t.name);const a=this.highlighter!=null&&pc(s.theme),l=this.highlighter!=null&&Wf(this.computedLang);if(this.highlighter!=null&&a&&(o||!this.renderCache.highlighted&&l||this.renderCache.result==null)){const{result:c,options:u}=this.renderDiffWithHighlighter(t,this.highlighter,!l);this.renderCache={diff:t,options:u,highlighted:l,result:c,renderRange:void 0}}(!a||!l)&&this.asyncHighlight(t).then(({result:c,options:u})=>{this.onHighlightSuccess(t,c,u)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,e,this.renderCache.result):void 0}async asyncRender(t,e=qf){const{result:n}=await this.asyncHighlight(t);return this.processDiffResult(t,e,n)}createPreElement(t,e,n,r){const{diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:a,themeType:l}=this.getOptionsWithDefaults();return wx({type:"diff",diffIndicators:i,disableBackground:s,disableLineNumbers:o,overflow:a,themeStyles:n,split:t,themeType:r??l,totalLines:e})}async asyncHighlight(t){this.computedLang=t.lang??Ir(t.name);const e=this.highlighter!=null&&pc(this.options.theme??Dn),n=this.highlighter!=null&&Wf(this.computedLang);return(this.highlighter==null||!e||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(t,this.highlighter)}renderDiffWithHighlighter(t,e,n=!1){const{options:r}=this.getRenderOptions(t),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:$x(t,e,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(t,e,n){if(this.renderCache==null)return;const r=this.renderCache.diff!==t||!this.renderCache.highlighted||!Gp(this.renderCache.options,n);this.renderCache={diff:t,options:n,highlighted:!0,result:e,renderRange:void 0},r&&this.onRenderUpdate?.()}onHighlightError(t){console.error(t)}processDiffResult(t,e,{code:n,themeStyles:r,baseThemeType:i}){const{diffStyle:s,disableFileHeader:o,expandUnchanged:a,expansionLineCount:l,collapsedContextThreshold:c,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=t;const d=s==="unified";let f=[],h=[],p=[];const m=[],{additionLines:g,deletionLines:y}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:h,unifiedContentAST:p,unifiedGutterAST:Sa(),deletionsGutterAST:Sa(),additionsGutterAST:Sa(),expansionLineCount:l,hunkData:m,incrementRowCount(M=1){v.rowCount+=M},pushToGutter(M,$){switch(M){case"unified":v.unifiedGutterAST.children.push($);break;case"deletions":v.deletionsGutterAST.children.push($);break;case"additions":v.additionsGutterAST.children.push($);break}}},w=oj(t);let _=0,k;function S(M,$,H,U){v.pushToGutter(M,ux($,H,U))}function L(){if(s!=="unified"){if(_<=0||k==null){_=0,k=void 0;return}k==="additions"?(v.pushToGutter("additions",kr(void 0,"buffer",_)),f?.push(fd(_))):(v.pushToGutter("deletions",kr(void 0,"buffer",_)),h?.push(fd(_))),_=0,k=void 0}}function E(M){L(),s==="unified"?Kp("unified",M,v):(Kp("deletions",M,v),Kp("additions",M,v))}Zf({diff:t,diffStyle:s,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:a?!0:this.expandedHunks,collapsedContextThreshold:c,callback:({hunkIndex:M,hunk:$,collapsedBefore:H,collapsedAfter:U,additionLine:j,deletionLine:G,type:Z})=>{const Q=G!=null?G.splitLineIndex:j.splitLineIndex,ee=j!=null?j.unifiedLineIndex:G.unifiedLineIndex;s==="split"&&Z!=="change"&&L(),H>0&&E({hunkIndex:M,collapsedLines:H,rangeSize:Math.max($?.collapsedBefore??0,0),hunkSpecs:$?.hunkSpecs,isFirstHunk:M===0,isLastHunk:!1,isExpandable:!t.isPartial});const le=s==="unified"?ee:Q;if(s==="unified"){const Ce=G!=null?y[G.lineIndex]:void 0,me=j!=null?g[j.lineIndex]:void 0;if(Ce==null&&me==null){const Re="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Re,{file:t.name}),new Error(Re)}S("unified",Z==="change"?j!=null?"change-addition":"change-deletion":Z,j!=null?j.lineNumber:G.lineNumber,`${ee},${Q}`),f3({diffStyle:"unified",type:Z,deletionLine:Ce,additionLine:me,unifiedSpan:this.getAnnotations("unified",G?.lineNumber,j?.lineNumber,M,le),context:v})}else{const Ce=G!=null?y[G.lineIndex]:void 0,me=j!=null?g[j.lineIndex]:void 0;if(Ce==null&&me==null){const Ye="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Ye,{file:t.name}),new Error(Ye)}const Re=(()=>{if(Z==="change"){if(me==null)return"additions";if(Ce==null)return"deletions"}})();if(Re!=null){if(k!=null&&k!==Re)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");k=Re,_++}const ge=this.getAnnotations("split",G?.lineNumber,j?.lineNumber,M,le);ge!=null&&_>0&&L(),G!=null&&S("deletions",Z==="change"?"change-deletion":Z,G.lineNumber,`${G.unifiedLineIndex},${Q}`),j!=null&&S("additions",Z==="change"?"change-addition":Z,j.lineNumber,`${j.unifiedLineIndex},${Q}`),f3({diffStyle:"split",type:Z,additionLine:me,deletionLine:Ce,...ge,context:v})}const ye=G?.noEOFCR??!1,xe=j?.noEOFCR??!1;if(xe||ye){if(ye){const Ce=Z==="context"||Z==="context-expanded"?Z:"change-deletion";s==="unified"?(v.unifiedContentAST.push(hd(Ce)),v.pushToGutter("unified",kr(Ce,"metadata",1))):(v.deletionsContentAST.push(hd(Ce)),v.pushToGutter("deletions",kr(Ce,"metadata",1)),xe||(v.pushToGutter("additions",kr(void 0,"buffer",1)),v.additionsContentAST.push(fd(1))))}if(xe){const Ce=Z==="context"||Z==="context-expanded"?Z:"change-addition";s==="unified"?(v.unifiedContentAST.push(hd(Ce)),v.pushToGutter("unified",kr(Ce,"metadata",1))):(v.additionsContentAST.push(hd(Ce)),v.pushToGutter("additions",kr(Ce,"metadata",1)),ye||(v.pushToGutter("deletions",kr(void 0,"buffer",1)),v.deletionsContentAST.push(fd(1))))}v.incrementRowCount(1)}U>0&&u!=="simple"&&E({hunkIndex:Z==="context-expanded"?M:M+1,collapsedLines:U,rangeSize:w,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!t.isPartial}),v.incrementRowCount(1)}}),s==="split"&&L();const C=Math.max(Nq(t.hunks),t.additionLines.length??0,t.deletionLines.length??0),V=e.bufferBefore>0||e.bufferAfter>0,R=!d&&t.type!=="deleted",F=!d&&t.type!=="new",T=v.rowCount>0||V;f=R&&T?f:void 0,h=F&&T?h:void 0,p=d&&T?p:void 0;const D=this.createPreElement(h!=null&&f!=null,C,r,i);return{unifiedGutterAST:d&&T?v.unifiedGutterAST.children:void 0,unifiedContentAST:p,deletionsGutterAST:F&&T?v.deletionsGutterAST.children:void 0,deletionsContentAST:h,additionsGutterAST:R&&T?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:m,preNode:D,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff,r,i),totalLines:C,rowCount:v.rowCount,bufferBefore:e.bufferBefore,bufferAfter:e.bufferAfter,css:""}}renderCodeAST(t,e){const n=t==="unified"?e.unifiedGutterAST:t==="deletions"?e.deletionsGutterAST:e.additionsGutterAST,r=t==="unified"?e.unifiedContentAST:t==="deletions"?e.deletionsContentAST:e.additionsContentAST;if(n==null||r==null)return;const i=Sa(n);return i.properties.style=`grid-row: span ${e.rowCount}`,[i,Cx(r,e.rowCount)]}renderFullAST(t,e=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",r=this.renderCodeAST("unified",t);if(r!=null)return e.push(nt({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...t.preNode,children:e};const i=this.renderCodeAST("deletions",t);i!=null&&e.push(nt({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const s=this.renderCodeAST("additions",t);return s!=null&&e.push(nt({tagName:"code",children:s,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...t.preNode,children:e}}renderFullHTML(t,e=[]){return gi(this.renderFullAST(t,e))}renderPartialHTML(t,e){return e==null?gi(t):gi(nt({tagName:"code",children:t,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${e}`]:""}}))}getAnnotations(t,e,n,r,i){const s={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(e!=null)for(const a of this.deletionAnnotations[e]??[])s.annotations.push(Lo(a));const o={type:"annotation",hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(const a of this.additionAnnotations[n]??[])(t==="unified"?s:o).annotations.push(Lo(a));if(t==="unified")return s.annotations.length>0?s:void 0;if(!(o.annotations.length===0&&s.annotations.length===0))return{deletionSpan:s,additionSpan:o}}renderHeader(t,e,n){const{themeType:r}=this.getOptionsWithDefaults();return bx({fileOrDiff:t,themeStyles:e,themeType:n??r})}};function Gp(t,e){return Ov(t.theme,e.theme)&&t.tokenizeMaxLineLength===e.tokenizeMaxLineLength&&t.lineDiffType===e.lineDiffType}function d3(t){return`${t} unmodified line${t>1?"s":""}`}function f3({diffStyle:t,type:e,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:s,additionSpan:o,context:a}){let l=!1;if(t==="unified"){if(r!=null?a.unifiedContentAST.push(r):n!=null&&a.unifiedContentAST.push(n),i!=null){const c=e==="change"?n!=null?"change-deletion":"change-addition":e;a.unifiedContentAST.push(tf(i)),a.pushToGutter("unified",kr(c,"annotation",1)),l=!0}}else if(t==="split"){if(n!=null&&a.deletionsContentAST.push(n),r!=null&&a.additionsContentAST.push(r),s!=null){const c=e==="change"?n!=null?"change-deletion":"context":e;a.deletionsContentAST.push(tf(s)),a.pushToGutter("deletions",kr(c,"annotation",1)),l=!0}if(o!=null){const c=e==="change"?r!=null?"change-addition":"context":e;a.additionsContentAST.push(tf(o)),a.pushToGutter("additions",kr(c,"annotation",1)),l=!0}}l&&a.incrementRowCount(1)}function Kp(t,{hunkIndex:e,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:s,isLastHunk:o,isExpandable:a},l){if(n<=0)return;const c=t==="unified"?l.unifiedContentAST:t==="deletions"?l.deletionsContentAST:l.additionsContentAST;if(l.hunkSeparators==="metadata"){i!=null&&(l.pushToGutter(t,na({type:"metadata",content:i,isFirstHunk:s,isLastHunk:o})),c.push(na({type:"metadata",content:i,isFirstHunk:s,isLastHunk:o})),t!=="additions"&&l.incrementRowCount(1));return}if(l.hunkSeparators==="simple"){e>0&&(l.pushToGutter(t,na({type:"simple",isFirstHunk:s,isLastHunk:!1})),c.push(na({type:"simple",isFirstHunk:s,isLastHunk:!1})),t!=="additions"&&l.incrementRowCount(1));return}const u=Pq(t,e),d=r>l.expansionLineCount,f=a?e:void 0;l.pushToGutter(t,na({type:l.hunkSeparators,content:d3(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:s,isLastHunk:o})),c.push(na({type:l.hunkSeparators,content:d3(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:s,isLastHunk:o})),t!=="additions"&&l.incrementRowCount(1),l.hunkData.push({slotName:u,hunkIndex:e,lines:n,type:t,expandable:a?{up:!s,down:!o,chunked:d}:void 0})}function oj(t){const e=t.hunks.at(-1);if(e==null||t.isPartial||t.additionLines.length===0||t.deletionLines.length===0)return 0;const n=t.additionLines.length-(e.additionLineIndex+e.additionCount),r=t.deletionLines.length-(e.deletionLineIndex+e.deletionCount);if(n!==r)throw new Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${r}) for ${t.name}`);return Math.min(n,r)}function aj(t,e){return t.lineNumber===e.lineNumber&&t.side===e.side&&t.metadata===e.metadata}function lj(t,e){return t.slotName===e.slotName&&t.hunkIndex===e.hunkIndex&&t.lines===e.lines&&t.type===e.type&&t.expandable?.chunked===e.expandable?.chunked&&t.expandable?.up===e.expandable?.up&&t.expandable?.down===e.expandable?.down}function cj(t){const e=t[0];if(e!=="+"&&e!=="-"&&e!==" "&&e!=="\\"){console.error(`parseLineType: Invalid firstChar: "${e}", full line: "${t}"`);return}const n=t.substring(1);return{line:n===""?` `:n,type:e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}}function uj(t,e,n=!1){const r=Jd.test(t),i=t.split(r?Jd:e3);let s;const o=[];for(const a of i){if(r&&!Jd.test(a)){if(s==null)s=a;else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}else if(!r&&!e3.test(a)){if(s==null)s=a;else{if(n)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}const l=Fx(a,{cacheKey:void 0,isGitDiff:r,throwOnError:n});l!=null&&o.push(l)}return{patchMetadata:s,files:o}}function Fx(t,{cacheKey:e,isGitDiff:n=Jd.test(t),oldFile:r,newFile:i,throwOnError:s=!1}={}){let o=0;const a=t.split(nq);let l;const c=r==null||i==null;let u=0,d=0;for(const f of a){const h=f.split(ef),p=h.shift();if(p==null){if(s)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}const m=p.match(rq);let g=0,y=0;if(m==null||l==null){if(l!=null){if(s)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:c,additionLines:!c&&r!=null&&i!=null?i.contents.split(ef):[],deletionLines:!c&&r!=null&&i!=null?r.contents.split(ef):[],cacheKey:e},l.additionLines.length===1&&i?.contents===""&&(l.additionLines.length=0),l.deletionLines.length===1&&r?.contents===""&&(l.deletionLines.length=0),h.unshift(p);for(const L of h){const E=L.match(n?sq:iq);if(L.startsWith("diff --git")){const[,,C,,V]=L.trim().match(oq)??[];l.name=V.trim(),C!==V&&(l.prevName=C.trim())}else if(E!=null){const[,C,V]=E;C==="---"&&V!=="/dev/null"?(l.prevName=V.trim(),l.name=V.trim()):C==="+++"&&V!=="/dev/null"&&(l.name=V.trim())}else if(n){if(L.startsWith("new mode ")&&(l.mode=L.replace("new mode","").trim()),L.startsWith("old mode ")&&(l.prevMode=L.replace("old mode","").trim()),L.startsWith("new file mode")&&(l.type="new",l.mode=L.replace("new file mode","").trim()),L.startsWith("deleted file mode")&&(l.type="deleted",l.mode=L.replace("deleted file mode","").trim()),L.startsWith("similarity index")&&(L.startsWith("similarity index 100%")?l.type="rename-pure":l.type="rename-changed"),L.startsWith("index ")){const[,C,V,R]=L.trim().match(aq)??[];C!=null&&(l.prevObjectId=C),V!=null&&(l.newObjectId=V),R!=null&&(l.mode=R)}L.startsWith("rename from ")&&(l.prevName=L.replace("rename from ","")),L.startsWith("rename to ")&&(l.name=L.replace("rename to ","").trim())}}continue}let v,w;for(;h.length>0&&(h[h.length-1]===` `||h[h.length-1]==="\r"||h[h.length-1]===`\r `||h[h.length-1]==="");)h.pop();const _=parseInt(m[3]),k=parseInt(m[1]);u=c?u:k-1,d=c?d:_-1;const S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(m[4]??"1"),additionStart:_,additionLines:g,deletionCount:parseInt(m[2]??"1"),deletionStart:k,deletionLines:y,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:m[5],hunkSpecs:p,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(S.additionCount)||isNaN(S.deletionCount)||isNaN(S.additionStart)||isNaN(S.deletionStart)){if(s)throw Error("parsePatchContent: invalid hunk metadata");console.error("parsePatchContent: invalid hunk metadata",S);continue}for(const L of h){const E=cj(L);if(E==null){console.error("processFile: invalid rawLine:",L);continue}const{type:C,line:V}=E;if(C==="addition")(v==null||v.type!=="change")&&(v=Zp("change",u,d),S.hunkContent.push(v)),d++,c&&l.additionLines.push(V),v.additions++,g++,w="addition";else if(C==="deletion")(v==null||v.type!=="change")&&(v=Zp("change",u,d),S.hunkContent.push(v)),u++,c&&l.deletionLines.push(V),v.deletions++,y++,w="deletion";else if(C==="context")(v==null||v.type!=="context")&&(v=Zp("context",u,d),S.hunkContent.push(v)),d++,u++,c&&(l.deletionLines.push(V),l.additionLines.push(V)),v.lines++,w="context";else if(C==="metadata"&&v!=null){if(v.type==="context"?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):w==="deletion"?S.noEOFCRDeletions=!0:w==="addition"&&(S.noEOFCRAdditions=!0),c&&(w==="addition"||w==="context")){const R=l.additionLines.length-1;R>=0&&(l.additionLines[R]=Ao(l.additionLines[R]))}if(c&&(w==="deletion"||w==="context")){const R=l.deletionLines.length-1;R>=0&&(l.deletionLines[R]=Ao(l.deletionLines[R]))}}}S.additionLines=g,S.deletionLines=y,S.collapsedBefore=Math.max(S.additionStart-1-o,0),l.hunks.push(S),o=S.additionStart+S.additionCount-1;for(const L of S.hunkContent)L.type==="context"?(S.splitLineCount+=L.lines,S.unifiedLineCount+=L.lines):(S.splitLineCount+=Math.max(L.additions,L.deletions),S.unifiedLineCount+=L.deletions+L.additions);S.splitLineStart=l.splitLineCount+S.collapsedBefore,S.unifiedLineStart=l.unifiedLineCount+S.collapsedBefore,l.splitLineCount+=S.collapsedBefore+S.splitLineCount,l.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(l!=null){if(l.hunks.length>0&&!c&&l.additionLines.length>0&&l.deletionLines.length>0){const f=l.hunks[l.hunks.length-1],h=f.additionStart+f.additionCount-1,p=l.additionLines.length,m=Math.max(p-h,0);l.splitLineCount+=m,l.unifiedLineCount+=m}return n||(l.prevName!=null&&l.name!==l.prevName?l.hunks.length>0?l.type="rename-changed":l.type="rename-pure":i!=null&&i.contents===""?l.type="deleted":r!=null&&r.contents===""&&(l.type="new")),l.type!=="rename-pure"&&l.type!=="rename-changed"&&(l.prevName=void 0),l}}function Pue(t,e,n=!1){const r=[];for(const i of t.split(tq))try{r.push(uj(i,e!=null?`${e}-${r.length}`:void 0,n))}catch(s){if(n)throw s;console.error(s)}return r}function Zp(t,e,n){return t==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:e}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:e}}function i1(t,e,n,r=!1){const i=Fx(Zq(t.name,e.name,t.contents,e.contents,t.header,e.header),{cacheKey:(()=>{if(t.cacheKey!=null&&e.cacheKey!=null)return`${t.cacheKey}:${e.cacheKey}`})(),oldFile:t,newFile:e,throwOnError:r});if(i==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return i}let dj=-1;var Hx=class{static LoadedCustomComponent=Rx;__id=`file-diff:${++dj}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;unsafeCSSStyle;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(t={theme:Dn},e,n=!1){this.options=t,this.workerManager=e,this.isContainerManaged=n,this.hunksRenderer=new sj({...t,hunkSeparators:typeof t.hunkSeparators=="function"?"custom":t.hunkSeparators},this.handleHighlightRender,this.workerManager),this.resizeManager=new fx,this.scrollSyncManager=new Rq,this.interactionManager=new dx("diff",Uf(t,typeof t.hunkSeparators=="function"||(t.hunkSeparators??"line-info")==="line-info"||t.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getLineIndex=(t,e="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let r,i;e:for(const s of this.fileDiff.hunks){let o=e==="deletions"?s.deletionStart:s.additionStart;const a=e==="deletions"?s.deletionCount:s.additionCount;let l=s.splitLineStart,c=s.unifiedLineStart;if(t=o+a){if(s===n){const u=t-(o+a);r=c+s.unifiedLineCount+u,i=l+s.splitLineCount+u;break e}continue}for(const u of s.hunkContent)if(u.type==="context")if(tthis.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}canPartiallyRender(t,e,n){return!(t||e||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(t){this.interactionManager.setSelection(t)}cleanUp(t=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.parentNode?.removeChild(this.fileContainer),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre!=null&&(this.pre.innerHTML="",this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,t?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(t){const{overflow:e="scroll",diffStyle:n="split"}=this.options,{fileContainer:r,prerenderedHTML:i}=t;Ox(r,i);for(const s of r.shadowRoot?.children??[]){if(s instanceof SVGElement){this.spriteSVG=s;continue}if(s instanceof HTMLElement){if(s instanceof HTMLPreElement){this.pre=s;for(const o of s.children)!(o instanceof HTMLElement)||o.tagName.toLowerCase()!=="code"||("deletions"in o.dataset&&(this.codeDeletions=o),"additions"in o.dataset&&(this.codeAdditions=o),"unified"in o.dataset&&(this.codeUnified=o));continue}if("diffsHeader"in s.dataset){this.headerElement=s;continue}if(s instanceof HTMLStyleElement&&s.hasAttribute(Av)){this.unsafeCSSStyle=s;continue}}}if(this.pre!=null&&this.syncCodeNodesFromPre(this.pre),this.pre==null)this.render(t);else{const{lineAnnotations:s,oldFile:o,newFile:a,fileDiff:l}=t;this.fileContainer=r,delete this.pre.dataset.dehydrated,this.lineAnnotations=s??this.lineAnnotations,this.additionFile=a,this.deletionFile=o,this.fileDiff=l??(o!=null&&a!=null?i1(o,a):void 0),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e==="wrap"),e==="scroll"&&n==="split"&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions)}}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({oldFile:this.deletionFile,newFile:this.additionFile,fileDiff:this.fileDiff,forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(t,e,n=!1)=>{if(n){this.expandHunkFully(t);return}this.expandHunk(t,e)};expandHunk(t,e){this.hunksRenderer.expandHunk(t,e),this.rerender()}expandHunkFully(t){this.hunksRenderer.expandHunkFully(t),this.rerender()}render({oldFile:t,newFile:e,fileDiff:n,forceRender:r=!1,lineAnnotations:i,fileContainer:s,containerWrapper:o,renderRange:a}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:l=!1}=this.options,c=l?void 0:a,u=t!=null&&e!=null&&(!Kf(t,this.deletionFile)||!Kf(e,this.additionFile));let d=n!=null&&n!==this.fileDiff;const f=i!=null&&(i.length>0||this.lineAnnotations.length>0)?i!==this.lineAnnotations:!1;if(!l&&rh(c,this.renderRange)&&!r&&!f&&(n!=null&&n===this.fileDiff||n==null&&!u))return!1;const{renderRange:h}=this;if(this.renderRange=c,this.deletionFile=t,this.additionFile=e,n!=null?this.fileDiff=n:t!=null&&e!=null&&u&&(d=!0,this.fileDiff=i1(t,e)),i!=null&&this.setLineAnnotations(i),this.fileDiff==null)return!1;this.hunksRenderer.setOptions({...this.options,hunkSeparators:typeof this.options.hunkSeparators=="function"?"custom":this.options.hunkSeparators}),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{diffStyle:p="split",disableErrorHandling:m=!1,disableFileHeader:g=!1,overflow:y="scroll"}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.parentNode?.removeChild(this.headerElement),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.headerPrefix!=null&&(this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerPrefix=void 0),this.headerMetadata!=null&&(this.headerMetadata.parentNode?.removeChild(this.headerMetadata),this.headerMetadata=void 0)),s=this.getOrCreateFileContainer(s,o),l){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const v=this.hunksRenderer.renderDiff(this.fileDiff,cx);v?.headerElement!=null&&this.applyHeaderToDOM(v.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(v){if(m)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,s)}return!0}try{const v=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(r,f,u||d)&&this.applyPartialRender({previousRenderRange:h,renderRange:c}))){const w=this.hunksRenderer.renderDiff(this.fileDiff,c);if(w==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;w.headerElement!=null&&this.applyHeaderToDOM(w.headerElement,s),w.additionsContentAST!=null||w.deletionsContentAST!=null||w.unifiedContentAST!=null?this.applyHunksToDOM(v,w):this.pre!=null&&(this.pre.parentNode?.removeChild(this.pre),this.pre=void 0),this.renderSeparators(w.hunkData)}this.applyBuffers(v,c),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(v),this.resizeManager.setup(v,y==="wrap"),y==="scroll"&&p==="split"?this.scrollSyncManager.setup(v,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(v){if(m)throw v;console.error(v),v instanceof Error&&this.applyErrorToDOM(v,s)}return!0}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:t}of this.separatorCache.values())t.parentNode?.removeChild(t);this.separatorCache.clear();for(const{element:t}of this.annotationCache.values())t.parentNode?.removeChild(t);this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.cleanChildNodes(),this.placeHolder==null){const e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.pre=void 0,this.spriteSVG=void 0,this.unsafeCSSStyle=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(t){const{hunkSeparators:e}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof e!="function"){for(const{element:r}of this.separatorCache.values())r.parentNode?.removeChild(r);this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const r of t){const i=r.slotName;let s=this.separatorCache.get(i);if(s==null||!lj(r,s.hunkData)){s?.element.parentNode?.removeChild(s.element);const o=document.createElement("div");o.style.display="contents",o.slot=r.slotName,o.appendChild(e(r,this)),this.fileContainer.appendChild(o),s={element:o,hunkData:r},this.separatorCache.set(i,s)}n.delete(i)}for(const[r,{element:i}]of n.entries())this.separatorCache.delete(r),i.parentNode?.removeChild(i)}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.parentNode?.removeChild(n);this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:e}=this.options;if(e!=null&&this.lineAnnotations.length>0)for(const[n,r]of this.lineAnnotations.entries()){const i=`${n}-${Lo(r)}`;let s=this.annotationCache.get(i);if(s==null||!aj(r,s.annotation)){s?.element.parentElement?.removeChild(s.element);const o=e(r);if(o==null)continue;s={element:Lx(Lo(r)),annotation:r},s.element.appendChild(o),this.fileContainer.appendChild(s.element),this.annotationCache.set(i,s)}t.delete(i)}for(const[n,{element:r}]of t.entries())this.annotationCache.delete(n),r.parentNode?.removeChild(r)}renderGutterUtility(){const t=this.options.renderGutterUtility??this.options.renderHoverUtility;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const e=t(this.interactionManager.getHoveredLine);if(e!=null&&this.gutterUtilityContent!=null)return;if(e==null){this.gutterUtilityContent?.parentNode?.removeChild(this.gutterUtilityContent),this.gutterUtilityContent=void 0;return}const n=Ax();n.appendChild(e),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(t,e){const n=this.fileContainer;if(this.fileContainer=t??this.fileContainer??document.createElement(Bf),n!=null&&n!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),e!=null&&this.fileContainer.parentNode!==e&&e.appendChild(this.fileContainer),this.spriteSVG==null){const r=document.createElement("div");r.innerHTML=Ex;const i=r.firstChild;i instanceof SVGElement&&(this.spriteSVG=i,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(t){const e=t.shadowRoot??t.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,e.appendChild(this.pre)):this.pre.parentNode!==e&&(e.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(t){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const e of Array.from(t.children))e instanceof HTMLElement&&("unified"in e.dataset?this.codeUnified=e:"deletions"in e.dataset?this.codeDeletions=e:"additions"in e.dataset&&(this.codeAdditions=e))}applyHeaderToDOM(t,e){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const n=gi(t);if(n!==this.lastRenderedHeaderHTML){const a=document.createElement("div");a.innerHTML=n;const l=a.firstElementChild;if(!(l instanceof HTMLElement))return;this.headerElement!=null?e.shadowRoot?.replaceChild(l,this.headerElement):e.shadowRoot?.prepend(l),this.headerElement=l,this.lastRenderedHeaderHTML=n}if(this.isContainerManaged)return;const{renderHeaderPrefix:r,renderHeaderMetadata:i}=this.options;this.headerPrefix!=null&&this.headerPrefix.parentNode?.removeChild(this.headerPrefix),this.headerMetadata!=null&&this.headerMetadata.parentNode?.removeChild(this.headerMetadata);const s=r?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0,o=i?.({deletionFile:this.deletionFile,additionFile:this.additionFile,fileDiff:this.fileDiff})??void 0;s!=null&&(this.headerPrefix=document.createElement("div"),this.headerPrefix.slot=Tv,s instanceof Element?this.headerPrefix.appendChild(s):this.headerPrefix.innerText=`${s}`,e.appendChild(this.headerPrefix)),o!=null&&(this.headerMetadata=document.createElement("div"),this.headerMetadata.slot=Lv,o instanceof Element?this.headerMetadata.appendChild(o):this.headerMetadata.innerText=`${o}`,e.appendChild(this.headerMetadata))}injectUnsafeCSS(){if(this.fileContainer?.shadowRoot==null)return;const{unsafeCSS:t}=this.options;t==null||t===""||(this.unsafeCSSStyle==null&&(this.unsafeCSSStyle=Mx(),this.fileContainer.shadowRoot.appendChild(this.unsafeCSSStyle)),this.unsafeCSSStyle.innerText=Ix(t))}applyHunksToDOM(t,e){const{overflow:n="scroll"}=this.options,r=(this.options.hunkSeparators??"line-info")==="line-info",i=n==="wrap"?e.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let s=!1;const o=[],a=this.hunksRenderer.renderCodeAST("unified",e),l=this.hunksRenderer.renderCodeAST("deletions",e),c=this.hunksRenderer.renderCodeAST("additions",e);a!=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=nf({code:this.codeUnified,columnType:"unified",rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(a),o.push(this.codeUnified)):l!=null||c!=null?(l!=null?(s=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=nf({code:this.codeDeletions,columnType:"deletions",rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),c!=null?(s=s||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=nf({code:this.codeAdditions,columnType:"additions",rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.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),o.length===0?t.textContent="":s&&t.replaceChildren(...o),this.lastRowCount=e.rowCount}applyPartialRender({previousRenderRange:t,renderRange:e}){const{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:s,options:{diffStyle:o="split"}}=this;if(n==null||t==null||e==null||!Number.isFinite(t.totalLines)||!Number.isFinite(e.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(o,r,s,i);if(a==null)return!1;const l=t.startingLine,c=e.startingLine,u=l+t.totalLines,d=c+e.totalLines,f=Math.max(l,c),h=Math.min(u,d);if(h<=f)return!1;const p=Math.max(0,f-l),m=Math.max(0,u-h),g=this.trimColumns({columns:a,trimStart:p,trimEnd:m,previousStart:l,overlapStart:f,overlapEnd:h,diffStyle:o});if(g<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount{if(!(L<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:S,totalLines:L,bufferBefore:0,bufferAfter:0})},w=v(c,Math.max(f-c,0));if(w==null&&ch)return!1;const k=(S,L)=>{if(S!=null){if(o==="unified"&&!Array.isArray(a))this.insertPartialHTML(o,a,S,L);else if(o==="split"&&Array.isArray(a))this.insertPartialHTML(o,a,S,L);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");y+=S.rowCount}};return this.cleanupErrorWrapper(),k(w,"afterbegin"),k(_,"beforeend"),this.lastRowCount!==y&&(this.applyRowSpan(o,a,y),this.lastRowCount=y),!0}insertPartialHTML(t,e,n,r){if(t==="unified"&&!Array.isArray(e)){const i=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(e,i,r)}else if(t==="split"&&Array.isArray(e)){const i=this.hunksRenderer.renderCodeAST("deletions",n),s=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(e[0],i,r),this.renderPartialColumn(e[1],s,r)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(t,e,n){if(t==null||e==null)return;const r=h3(e[0]),i=h3(e[1]);if(r==null||i==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const s=i.at(0);n==="beforeend"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],t.content.children[t.content.children.length-1],t.gutter.children[t.gutter.children.length-1],r,i,!0);const o=i.at(-1);n==="afterbegin"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],t.content.children[0],t.gutter.children[0],r,i,!1),t.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),t.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(t,e,n,r,i,s){if(!(e instanceof HTMLElement)||!(n instanceof HTMLElement))return;const o=this.getBufferSize(e.dataset);o!=null&&(s?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(e,o+t),this.updateBufferSize(n,o+t))}applyRowSpan(t,e,n){const r=i=>{i!=null&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`))};if(t==="unified"&&!Array.isArray(e))r(e);else if(t==="split"&&Array.isArray(e))r(e[0]),r(e[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(t,e,n){let r=0,i=0,s=0,o=!1;const a=n>=0;if(t==null)return 0;const l=Array.from(t.content.children),c=Array.from(t.gutter.children);if(l.length!==c.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;s0||a&&r>=n)&&(u.remove(),d.remove(),e>0&&(e--,e===0&&(o=!0)),i++),r++;continue}if("separator"in u.dataset&&"separator"in d.dataset){(e>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in d.dataset){(e>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="metadata"&&"noNewline"in d.dataset){(e>0||a&&r>=n)&&(u.remove(),d.remove(),i++);continue}if(u.dataset.gutterBuffer==="buffer"&&"contentBuffer"in d.dataset){const f=this.getBufferSize(d.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(e>0){const h=Math.min(e,f),p=f-h;p>0?(this.updateBufferSize(u,p),this.updateBufferSize(d,p),i+=h):(u.remove(),d.remove(),i+=f),e-=h}else if(a){const h=r,p=r+f-1;if(n<=h)u.remove(),d.remove(),i+=f;else if(n<=p){const m=p-n+1,g=f-m;this.updateBufferSize(u,g),this.updateBufferSize(d,g),i+=m}}r+=f;continue}throw console.error({gutterElement:u,contentElement:d}),new Error("FileDiff.trimColumnRows: unknown row elements")}return i}trimColumns({columns:t,diffStyle:e,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:s,trimStart:o}){const a=Math.max(0,r-i),l=n-i;if(l<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const c=o>0,u=s>0;if(!c&&!u)return 0;const d=c?a:0,f=u?l:-1;if(e==="unified"&&!Array.isArray(t))return this.trimColumnRows(t,d,f);if(e==="split"&&Array.isArray(t)){const h=this.trimColumnRows(t[0],d,f),p=this.trimColumnRows(t[1],d,f);if(t[0]!=null&&t[1]!=null&&h!==p)throw new Error("FileDiff.trimColumns: split columns out of sync");return t[0]!=null?h:p}else throw console.error({diffStyle:e,columns:t}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(t){const e=Number.parseInt(t?.bufferSize??"",10);return Number.isNaN(e)?void 0:e}updateBufferSize(t,e){t.dataset.bufferSize=`${e}`,t.style.setProperty("grid-row",`span ${e}`),t.style.setProperty("min-height",`calc(${e} * 1lh)`)}getCodeColumns(t,e,n,r){function i(s){if(s==null)return;const o=s.children[0],a=s.children[1];if(!(!(o instanceof HTMLElement)||!(a instanceof HTMLElement)||o.dataset.gutter==null||a.dataset.content==null))return{gutter:o,content:a}}if(t==="unified")return i(e);{const s=i(n),o=i(r);return s!=null||o!=null?[s,o]:void 0}}applyBuffers(t,e){const{disableVirtualizationBuffers:n=!1}=this.options;if(n||e==null){this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0);return}e.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${e.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.parentNode?.removeChild(this.bufferBefore),this.bufferBefore=void 0),e.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${e.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.parentNode?.removeChild(this.bufferAfter),this.bufferAfter=void 0)}applyPreNodeAttributes(t,{themeStyles:e,baseThemeType:n,additionsContentAST:r,deletionsContentAST:i,totalLines:s}){const{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:c="scroll",themeType:u="system",diffStyle:d="split"}=this.options,f={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:l,overflow:c,split:d==="unified"?!1:r!=null&&i!=null,themeStyles:e,themeType:n??u,totalLines:s};Tx(f,this.appliedPreAttributes)||(Dx(t,f),this.appliedPreAttributes=f)}applyErrorToDOM(t,e){this.cleanupErrorWrapper();const n=this.getOrCreatePreNode(e);n.innerHTML="",n.parentNode?.removeChild(n),this.pre=void 0,this.appliedPreAttributes=void 0;const r=e.shadowRoot??e.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",r.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=t.message,this.errorWrapper.appendChild(i);const s=document.createElement("pre");s.dataset.errorStack="",s.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(s)}cleanupErrorWrapper(){this.errorWrapper?.parentNode?.removeChild(this.errorWrapper),this.errorWrapper=void 0}};function h3(t){if(!(t==null||t.type!=="element"))return t.children??[]}const rf=new Set;let sf=new Set,s1=null,o1=!1;function Fr(t){if(o1){rf.add(t);return}sf.add(t),s1??=requestAnimationFrame(Vx)}function Vx(t){o1=!0;for(const e of sf)try{e(t)}catch(n){console.error(n)}sf.clear(),rf.size>0?(sf=new Set(rf),rf.clear(),s1=requestAnimationFrame(Vx)):s1=null,o1=!1}let fj=-1;var hj=class extends Px{__id=`virtualized-file:${++fj}`;top;height=0;heightCache=new Map;isVisible=!1;constructor(t,e,n=Mv,r,i=!1){super(t,r,i),this.virtualizer=e,this.metrics=n}getLineHeight(t,e=!1){const n=this.heightCache.get(t);if(n!=null)return n;const r=e?2:1;return this.metrics.lineHeight*r}setOptions(t){if(t==null)return;const e=this.options.overflow,n=this.options.collapsed;super.setOptions(t),(e!==this.options.overflow||n!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){if(this.fileContainer==null||this.file==null){this.height=0;return}const{overflow:t="scroll"}=this.options;if(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),t==="scroll"&&this.lineAnnotations.length===0&&!this.virtualizer.config.resizeDebugging)return;let e=!1;if(this.code==null)return;const n=this.code.children[1];if(n instanceof HTMLElement){for(const r of n.children){if(!(r instanceof HTMLElement))continue;const i=r.dataset.lineIndex;if(i==null)continue;const s=Number(i);let o=r.getBoundingClientRect().height,a=!1;r.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in r.nextElementSibling.dataset||"noNewline"in r.nextElementSibling.dataset)&&("noNewline"in r.nextElementSibling.dataset&&(a=!0),o+=r.nextElementSibling.getBoundingClientRect().height);const l=this.getLineHeight(s,a);o!==l&&(e=!0,o===this.metrics.lineHeight*(a?2:1)?this.heightCache.delete(s):this.heightCache.set(s,o))}(e||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}}onRender=t=>this.fileContainer==null||this.file==null?!1:(t&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render({file:this.file}));cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}computeApproximateSize(){const t=this.height===0;if(this.height=0,this.file==null)return;const{disableFileHeader:e=!1,collapsed:n=!1,overflow:r="scroll"}=this.options,{diffHeaderHeight:i,fileGap:s,lineHeight:o}=this.metrics,a=this.getOrCreateLineCache(this.file);if(e?this.height+=s:this.height+=i,!n&&(r==="scroll"&&this.lineAnnotations.length===0?this.height+=this.getOrCreateLineCache(this.file).length*o:Gf({lines:a,callback:({lineIndex:l})=>{this.height+=this.getLineHeight(l,!1)}}),a.length>0&&(this.height+=s),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!t)){const l=this.fileContainer.getBoundingClientRect();l.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:l.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}}setVisibility(t){this.fileContainer!=null&&(t&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!t&&this.isVisible&&(this.isVisible=!1,this.rerender()))}render({fileContainer:t,file:e,...n}){const r=this.fileContainer==null;if(this.file??=e,t=this.getOrCreateFileContainerNode(t),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(r?(this.computeApproximateSize(),this.virtualizer.connect(t,this),this.top??=this.virtualizer.getOffsetInScrollContainer(t),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(t),!this.isVisible)return this.renderPlaceholder(this.height);const i=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(this.file,this.top,i);return super.render({file:this.file,fileContainer:t,renderRange:s,...n})}computeRenderRangeFromWindow(t,e,{top:n,bottom:r}){const{disableFileHeader:i=!1,overflow:s="scroll"}=this.options,{diffHeaderHeight:o,fileGap:a,hunkLineCount:l,lineHeight:c}=this.metrics,u=this.getOrCreateLineCache(t),d=u.length,f=this.height,h=i?a:o;if(er)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-h-a};if(d<=l)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};const p=Math.ceil(Math.max(r-n,0)/c),m=Math.ceil(p/l)*l+l*2,g=m/l,y=(n+r)/2;if(s==="scroll"&&this.lineAnnotations.length===0){const H=Math.floor((y-(e+h))/c),U=Math.floor(H/l)-Math.floor(g/2),j=Math.ceil(d/l),G=Math.max(0,Math.min(U,j))*l,Z=U<0?m+U*l:m,Q=G*c,ee=Math.min(Z,d-G);return{startingLine:G,totalLines:Z,bufferBefore:Q,bufferAfter:Math.max(0,(d-G-ee)*c)}}const v=g,w=[];let _=e+h,k=0,S,L,E;if(Gf({lines:u,callback:({lineIndex:H})=>{const U=k%l===0;if(U&&(w.push(_-(e+h)),E!=null)){if(E<=0)return!0;E--}const j=this.getLineHeight(H,!1),G=Math.floor(k/l);return _>n-j&&_y&&(L??=G),E==null&&_>=r&&U&&(E=v),k++,_+=j,!1}}),S==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-h-a};const C=w.length;L??=S;const V=Math.round(L-g/2),R=Math.max(0,C-g),F=Math.max(0,Math.min(V,R)),T=F*l,D=V<0?m+V*l:m,M=w[F]??0,$=F+D/l;return{startingLine:T,totalLines:D,bufferBefore:M,bufferAfter:$this.fileContainer==null?!1:(t&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){this.fileContainer!=null&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk(t,e){this.hunksRenderer.expandHunk(t,e),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}expandHunkFully(t){this.hunksRenderer.expandHunkFully(t),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)}setVisibility(t){this.fileContainer!=null&&(this.renderRange=void 0,t&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!t&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){const t=this.height===0;if(this.height=0,this.fileDiff==null)return;const{disableFileHeader:e=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=Ia,hunkSeparators:s="line-info"}=this.options,{diffHeaderHeight:o,fileGap:a,hunkSeparatorHeight:l}=this.metrics,c=this.getDiffStyle(),u=s!=="simple"&&s!=="metadata"&&s!=="line-info-basic"?a:0;if(e?s!=="simple"&&s!=="metadata"&&(this.height+=a):this.height+=o,!r&&(Zf({diff:this.fileDiff,diffStyle:c,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:d,collapsedBefore:f,collapsedAfter:h,deletionLine:p,additionLine:m})=>{const g=m!=null?m.splitLineIndex:p.splitLineIndex,y=m!=null?m.unifiedLineIndex:p.unifiedLineIndex,v=(m?.noEOFCR??!1)||(p?.noEOFCR??!1);f>0&&(d>0&&(this.height+=u),this.height+=l+u),this.height+=this.getLineHeight(c==="split"?g:y,v),h>0&&s!=="simple"&&(this.height+=u+l)}}),this.fileDiff.hunks.length>0&&(this.height+=a),this.fileContainer!=null&&this.virtualizer.config.resizeDebugging&&!t)){const d=this.fileContainer.getBoundingClientRect();d.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:d.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}}render({fileContainer:t,oldFile:e,newFile:n,fileDiff:r,...i}={}){const s=this.fileContainer==null;if(this.fileDiff??=r??(e!=null&&n!=null?i1(e,n):void 0),t=this.getOrCreateFileContainer(t),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(s?(this.computeApproximateSize(),this.virtualizer.connect(t,this),this.top??=this.virtualizer.getOffsetInScrollContainer(t),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(t),!this.isVisible)return this.renderPlaceholder(this.height);const o=this.virtualizer.getWindowSpecs(),a=this.computeRenderRangeFromWindow(this.fileDiff,this.top,o);return super.render({fileDiff:this.fileDiff,fileContainer:t,renderRange:a,oldFile:e,newFile:n,...i})}getDiffStyle(){return this.options.diffStyle??"split"}getExpandedRegion(t,e,n){if(n<=0||t)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(n,0),renderAll:!1};const{expandUnchanged:r=!1,collapsedContextThreshold:i=Ia}=this.options;if(r||n<=i)return{fromStart:n,fromEnd:0,collapsedLines:0,renderAll:!0};const s=this.hunksRenderer.getExpandedHunk(e),o=Math.min(Math.max(s.fromStart,0),n),a=Math.min(Math.max(s.fromEnd,0),n),l=o+a,c=l>=n;return{fromStart:o,fromEnd:a,collapsedLines:Math.max(n-l,0),renderAll:c}}getExpandedLineCount(t,e){let n=0;if(t.isPartial){for(const i of t.hunks)n+=e==="split"?i.splitLineCount:i.unifiedLineCount;return n}for(const[i,s]of t.hunks.entries()){const o=e==="split"?s.splitLineCount:s.unifiedLineCount;n+=o;const a=Math.max(s.collapsedBefore,0),{fromStart:l,fromEnd:c,renderAll:u}=this.getExpandedRegion(t.isPartial,i,a);a>0&&(n+=u?a:l+c)}const r=t.hunks.at(-1);if(r!=null&&vj(t)){const i=t.additionLines.length-(r.additionLineIndex+r.additionCount),s=t.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(r!=null&&i!==s)throw new Error(`VirtualizedFileDiff: trailing context mismatch (additions=${i}, deletions=${s}) for ${t.name}`);const o=Math.min(i,s);if(r!=null&&o>0){const{fromStart:a,renderAll:l}=this.getExpandedRegion(t.isPartial,t.hunks.length,o);n+=l?o:a}}return n}computeRenderRangeFromWindow(t,e,{top:n,bottom:r}){const{disableFileHeader:i=!1,expandUnchanged:s=!1,collapsedContextThreshold:o=Ia,hunkSeparators:a="line-info"}=this.options,{diffHeaderHeight:l,fileGap:c,hunkLineCount:u,hunkSeparatorHeight:d,lineHeight:f}=this.metrics,h=this.getDiffStyle(),p=this.height,m=this.getExpandedLineCount(t,h),g=i?c:l;if(er)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-c};if(m<=u||t.hunks.length===0)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};const y=Math.ceil(Math.max(r-n,0)/f),v=Math.ceil(y/u)*u+u,w=v/u,_=w,k=[],S=(n+r)/2,L=a==="simple"||a==="metadata"||a==="line-info-basic"?0:c;let E=e+g,C=0,V,R,F;if(Zf({diff:t,diffStyle:h,expandedHunks:s?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:Z,collapsedBefore:Q,collapsedAfter:ee,deletionLine:le,additionLine:ye})=>{const xe=ye!=null?ye.splitLineIndex:le.splitLineIndex,Ce=ye!=null?ye.unifiedLineIndex:le.unifiedLineIndex,me=(ye?.noEOFCR??!1)||(le?.noEOFCR??!1);let Re=Q>0?d+L+(Z>0?L:0):0;Z===0&&a==="simple"&&(Re=0),E+=Re;const ge=C%u===0;if(ge&&(k.push(E-(e+g+Re)),F!=null)){if(F<=0)return!0;F--}const Ye=this.getLineHeight(h==="split"?xe:Ce,me),cn=Math.floor(C/u);return E>n-Ye&&ES&&(R=cn),F==null&&E>=r&&ge&&(F=_),C++,E+=Ye,ee>0&&a!=="simple"&&(E+=d+L),!1}}),V==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-c};const T=k.length;R??=V;const D=Math.round(R-w/2),M=Math.max(0,T-w),$=Math.max(0,Math.min(D,M)),H=$*u,U=D<0?v+D*u:v,j=k[$]??0,G=$+U/u;return{startingLine:H,totalLines:U,bufferBefore:j,bufferAfter:G=e||i){const u=Math.max(t-r,0),d=Math.min(t+a,e)-r;return{top:u,bottom:Math.max(d,u)}}let l=t+n/2-o/2,c=l+o;return l<0&&(l=0),c>e&&(c=e),l=Math.floor(Math.max(l-r,0)),{top:l,bottom:Math.ceil(Math.max(Math.min(c,e)-r,l))}}const zx=1e3,kj=zx*4,xj=[0,1e-6,.99999,1],Sj={overscrollSize:zx,intersectionObserverMargin:kj,resizeDebugging:!1};let md=0,_j=-1;var Bx=class ai{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++_j}`;config;type="basic";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...Sj,...e}}setup(e,n){if(this.root==null){this.root=e,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:xj,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),e instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{ai.__STOP?(ai.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:ai.__lastScrollPosition}),Fr(this.computeRenderRangeAndEmit)):(ai.__lastScrollPosition=this.getScrollTop(),ai.__STOP=!0)};for(const[r,i]of this.connectQueue.entries())this.connect(r,i);this.connectQueue.clear(),this.markDOMDirty(),Fr(this.computeRenderRangeAndEmit)}}instanceChanged(e){this.instancesChanged.add(e),this.markDOMDirty(),Fr(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=p3({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,n){const r=this.getScrollTop(),i=this.getHeight(),s=this.config.intersectionObserverMargin,o=r-s,a=r+i+s;return!(ea)}handleContainerResize=e=>{if(this.root==null)return;let n=!1;for(const r of e){const i=r.borderBoxSize[0].blockSize;this.root instanceof Document?i!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:i-md,newSize:i}),md=i)):r.target===this.root?i!==this.height&&(this.heightDirty=!0,n=!0):r.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:i-md,newSize:i}),md=i))}n&&Fr(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+zl(e,this.getScrollContainerElement())}connect(e,n){if(this.observers.has(e))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(e,n):(this.intersectionObserver.observe(e),this.observers.set(e,n),this.instancesChanged.add(n),this.markDOMDirty(),Fr(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){const n=this.observers.get(e);this.connectQueue.delete(e),n!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Fr(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{ai.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Fr(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{ai.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,Fr(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{ai.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Fr(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(ai.__STOP)return;const e=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;if(this.instancesChanged.size===0){const i=p3({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(wj(this.windowSpecs,i)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;this.windowSpecs=i}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const n=this.getScrollAnchor(this.height),r=new Set;for(const i of e?this.observers.values():this.visibleInstances.values())i.onRender(e)&&r.add(i);for(const i of this.instancesChanged)r.has(i)||i.onRender(e)&&r.add(i);this.scrollFix(n),this.instancesChanged.size>0&&this.markDOMDirty();for(const i of r)i.reconcileHeights();(this.instancesChanged.size>0||e)&&Fr(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;const n=this.getScrollContainerElement(),{lineIndex:r,lineOffset:i,fileElement:s,fileOffset:o,fileTypeOffset:a}=e;if(r!=null&&i!=null){const c=s.shadowRoot?.querySelector(`[data-line][data-line-index="${r}"]`);if(c instanceof HTMLElement){const u=zl(c,n);if(u!==i){const d=u-i;this.applyScrollFix(d)}return}}const l=zl(s,n);if(a==="top")l!==o&&this.applyScrollFix(l-o);else{const c=l+s.getBoundingClientRect().height;c!==o&&this.applyScrollFix(c-o)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(e){const n=this.getScrollContainerElement();let r;for(const[i]of this.visibleInstances.entries()){const s=zl(i,n),o=s+i.offsetHeight;let a,l;o<=0?(a=o,l="bottom"):(a=s,l="top");let c,u;if(o>0&&s=0&&(r.fileOffset<0||ar.fileOffset))&&(d=!0),d&&(r={fileElement:i,fileTypeOffset:l,fileOffset:a,lineIndex:c,lineOffset:u})}return r}handleIntersectionChange=e=>{this.scrollDirty=!0;for(const{target:n,isIntersecting:r}of e){if(!(n instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const i=this.observers.get(n);if(i==null)throw new Error("Virtualizer.handleIntersectionChange: no instance for target");r&&!this.visibleInstances.has(n)?(i.setVisibility(!0),this.visibleInstances.set(n,i),this.visibleInstancesDirty=!0):!r&&this.visibleInstances.has(n)&&(i.setVisibility(!1),this.visibleInstances.delete(n),this.visibleInstancesDirty=!0)}this.visibleInstancesDirty&&Fr(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function zl(t,e){const n=t.getBoundingClientRect(),r=e?.getBoundingClientRect().top??0;return n.top-r}function m3(t){const e=[];for(const n of t){const r=To.get(n);if(r==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);e.push(r)}return e}function g3(t){for(const e of Array.isArray(t)?t:[t])if(!To.has(e))return!1;return!0}async function y3(t){const e=[],n=[];for(const r of t){if(r==="text"||r==="ansi")continue;const i=mx(r)??px(r);"then"in i?n.push(i):e.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r){if(i==null)throw new Error("resolvedLanguages: unable to resolve language");e.push(i)}}),e}function v3(t){const e=[];for(const n of t){const r=Xi.get(n);if(r==null)throw new Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);e.push(r)}return e}async function b3(t){const e=[],n=[];for(const r of t){const i=yx(r)??gx(r);"then"in i?n.push(i):e.push(i)}return n.length>0&&await Promise.all(n).then(r=>{for(const i of r)i!=null&&e.push(i)}),e}Iv("OpenCode",()=>Promise.resolve({name:"OpenCode",colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}}));function Cj(t){let e=t;const n=/\$\$([\s\S]*?)\$\$/g;e=e.replace(n,(i,s)=>{try{return Og.renderToString(s,{displayMode:!0,throwOnError:!1})}catch{return`$$${s}$$`}});const r=/(?{try{return Og.renderToString(s,{displayMode:!1,throwOnError:!1})}catch{return`$${s}$`}}),e}function Ej(t){const e=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return t.split(e).map((r,i)=>i%2===1?r:Cj(r)).join("")}async function Tj(t){const e=/

    ([\s\S]*?)<\/code><\/pre>/g,n=[...t.matchAll(e)];if(n.length===0)return t;const r=await Ka({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});let i=t;for(const s of n){const[o,a,l]=s,c=l.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'");let u=a||"text";u in Rc||(u="text"),r.getLoadedLanguages().includes(u)||await r.loadLanguage(u);const d=r.codeToHtml(c,{lang:u,theme:"OpenCode",tabindex:!1});i=i.replace(o,()=>d)}return i}const{use:Nue,provider:Lj}=zt({name:"Marked",init:t=>{const e=wt.use({renderer:{link({href:n,title:r,text:i}){const s=r?` title="${r}"`:"";return`${i}`}}},rF({throwOnError:!1,nonStandard:!0}),oF({async highlight(n,r){const i=await Ka({themes:["OpenCode"],langs:[],preferredHighlighter:"shiki-wasm"});return r in Rc||(r="text"),i.getLoadedLanguages().includes(r)||await i.loadLanguage(r),i.codeToHtml(n,{lang:r||"text",theme:"OpenCode",tabindex:!1})}}));if(t.nativeParser){const n=t.nativeParser;return{async parse(r){const i=await n(r),s=Ej(i);return Tj(s)}}}return e}});function An(t){const e=new TextEncoder().encode(t),n=Array.from(e,r=>String.fromCharCode(r)).join("");return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Aj(t){const e=atob(t.replace(/-/g,"+").replace(/_/g,"/")),n=Uint8Array.from(e,r=>r.charCodeAt(0));return new TextDecoder().decode(n)}function Yf(t){if(!t)return;let e=2166136261;for(let n=0;n>>0).toString(36)}function w3(t,e=5e5){if(!t)return;if(t.length<=e)return Yf(t);const n=4096,i=[0,Math.floor(t.length*.25),Math.floor(t.length*.5),Math.floor(t.length*.75),t.length-n].map(s=>{const o=Math.max(0,Math.min(t.length-n,s-Math.floor(n/2)));return Yf(t.slice(o,o+n))??""}).join(":");return`${t.length}:${i}`}const qx=`
    [data-annotation-slot] {
      padding: 12px;
      box-sizing: border-box;
    }
    
    [data-component="line-comment"] {
      position: absolute;
      right: 24px;
      z-index: var(--line-comment-z, 30);
    }
    
    [data-component="line-comment"][data-inline] {
      position: relative;
      right: auto;
      display: flex;
      width: 100%;
      min-width: 0;
      align-items: flex-start;
    }
    
    [data-component="line-comment"][data-open] {
      z-index: var(--line-comment-open-z, 100);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"] {
      width: 20px;
      height: 20px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--icon-interactive-base);
      box-shadow: var(--shadow-xs);
      cursor: default;
      border: none;
    }
    
    [data-component="line-comment"][data-variant="add"] [data-slot="line-comment-button"] {
      background: var(--syntax-diff-add);
    }
    
    [data-component="line-comment"] [data-component="icon"] {
      color: var(--white);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-icon"] {
      width: 12px;
      height: 12px;
      color: var(--white);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"]:focus {
      outline: none;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-button"]:focus-visible {
      box-shadow: var(--shadow-xs-border-focus);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-popover"] {
      position: absolute;
      top: calc(100% + 4px);
      right: -8px;
      z-index: var(--line-comment-popover-z, 40);
      min-width: 200px;
      max-width: none;
      box-sizing: border-box;
      border-radius: 8px;
      background: var(--surface-raised-stronger-non-alpha);
      box-shadow: var(--shadow-xxs-border);
      padding: 12px;
    }
    
    [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"] {
      position: relative;
      top: auto;
      right: auto;
      margin-left: 8px;
      flex: 1 1 0%;
      width: auto;
      max-width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"][data-inline-body] {
      margin-left: 0;
    }
    
    [data-component="line-comment"][data-inline][data-variant="default"] [data-slot="line-comment-popover"][data-inline-body] {
      cursor: pointer;
    }
    
    [data-component="line-comment"][data-variant="editor"] [data-slot="line-comment-popover"] {
      width: 380px;
      max-width: none;
      padding: 8px;
      border-radius: 14px;
    }
    
    [data-component="line-comment"][data-inline][data-variant="editor"] [data-slot="line-comment-popover"] {
      width: 100%;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-content"] {
      display: flex;
      flex-direction: column;
      gap: 6px;
      width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-head"] {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-text"] {
      flex: 1;
      min-width: 0;
      font-family: var(--font-family-sans);
      font-size: var(--font-size-base);
      font-weight: var(--font-weight-regular);
      line-height: var(--line-height-x-large);
      letter-spacing: var(--letter-spacing-normal);
      color: var(--text-strong);
      white-space: pre-wrap;
      overflow-wrap: anywhere;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-tools"] {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-label"],
    [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      font-weight: var(--font-weight-medium);
      line-height: var(--line-height-large);
      letter-spacing: var(--letter-spacing-normal);
      color: var(--text-weak);
      min-width: 0;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-editor"] {
      display: flex;
      flex-direction: column;
      gap: 8px;
      width: 100%;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-textarea"] {
      width: 100%;
      box-sizing: border-box;
      resize: vertical;
      padding: 8px;
      border-radius: var(--radius-md);
      background: var(--surface-base);
      border: 1px solid var(--border-base);
      color: var(--text-strong);
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      line-height: var(--line-height-large);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-textarea"]:focus {
      outline: none;
      box-shadow: var(--shadow-xs-border-select);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-list"] {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 180px;
      overflow: auto;
      padding: 4px;
      border: 1px solid var(--border-base);
      border-radius: var(--radius-md);
      background: var(--surface-base);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-item"] {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      min-width: 0;
      padding: 6px 8px;
      border: 0;
      border-radius: var(--radius-sm);
      background: transparent;
      color: var(--text-strong);
      text-align: left;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-item"][data-active] {
      background: var(--surface-raised-base-hover);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-path"] {
      display: flex;
      align-items: center;
      min-width: 0;
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      line-height: var(--line-height-large);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-dir"] {
      min-width: 0;
      color: var(--text-weak);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-mention-file"] {
      color: var(--text-strong);
      white-space: nowrap;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-actions"] {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      padding-left: 8px;
      min-width: 0;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
      flex: 1 1 220px;
      margin-right: auto;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"] {
      border: 1px solid var(--border-base);
      background: var(--surface-base);
      color: var(--text-strong);
      border-radius: var(--radius-md);
      height: 28px;
      padding: 0 10px;
      font-family: var(--font-family-sans);
      font-size: var(--font-size-small);
      font-weight: var(--font-weight-medium);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="ghost"] {
      background: transparent;
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="primary"] {
      background: var(--text-strong);
      border-color: var(--text-strong);
      color: var(--background-base);
    }
    
    [data-component="line-comment"] [data-slot="line-comment-action"]:disabled {
      opacity: 0.5;
      pointer-events: none;
    }
    `;let Yp=!1;function $ue(){if(Yp||typeof document>"u")return;const t="opencode-line-comment-styles";if(document.getElementById(t)){Yp=!0;return}const e=document.createElement("style");e.id=t,e.textContent=qx,document.head.appendChild(e),Yp=!0}const Mj=`
    [data-diff],
    [data-file] {
      --diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
      --diffs-bg-buffer: var(--diffs-bg-buffer-override, light-dark( color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));
      --diffs-bg-hover: var(--diffs-bg-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))));
      --diffs-bg-context: var(--diffs-bg-context-override, light-dark( color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));
      --diffs-bg-separator: var(--diffs-bg-separator-override, light-dark( color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));
      --diffs-fg: light-dark(var(--diffs-light), var(--diffs-dark));
      --diffs-fg-number: var(--diffs-fg-number-override, light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)), color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));
      --diffs-deletion-base: var(--syntax-diff-delete);
      --diffs-addition-base: var(--syntax-diff-add);
      --diffs-modified-base: var(--syntax-diff-unknown);
      --diffs-bg-deletion: var(--diffs-bg-deletion-override, light-dark( color-mix(in lab, var(--diffs-bg) 98%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-number: var(--diffs-bg-deletion-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-hover: var(--diffs-bg-deletion-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)), color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))));
      --diffs-bg-deletion-emphasis: var(--diffs-bg-deletion-emphasis-override, light-dark(rgb(from var(--diffs-deletion-base) r g b / 0.7), rgb(from var(--diffs-deletion-base) r g b / 0.1)));
      --diffs-bg-addition: var(--diffs-bg-addition-override, light-dark( color-mix(in lab, var(--diffs-bg) 98%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-addition-base))));
      --diffs-bg-addition-number: var(--diffs-bg-addition-number-override, light-dark( color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))));
      --diffs-bg-addition-hover: var(--diffs-bg-addition-hover-override, light-dark( color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)), color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))));
      --diffs-bg-addition-emphasis: var(--diffs-bg-addition-emphasis-override, light-dark(rgb(from var(--diffs-addition-base) r g b / 0.07), rgb(from var(--diffs-addition-base) r g b / 0.1)));
      --diffs-selection-base: var(--surface-warning-strong);
      --diffs-selection-border: var(--border-warning-base);
      --diffs-selection-number-fg: #1c1917;
      /* Use explicit alpha instead of color-mix(..., transparent) to avoid Safari's non-premultiplied interpolation bugs. */
      --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--surface-warning-base) r g b / 0.65));
      --diffs-bg-selection-number: var(
        --diffs-bg-selection-number-override,
        rgb(from var(--surface-warning-base) r g b / 0.85)
      );
      --diffs-bg-selection-text: rgb(from var(--surface-warning-strong) r g b / 0.2);
    }
    
    :host([data-color-scheme='dark']) [data-diff],
    :host([data-color-scheme='dark']) [data-file] {
      --diffs-selection-number-fg: #fdfbfb;
      --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--solaris-dark-6) r g b / 0.65));
      --diffs-bg-selection-number: var(
        --diffs-bg-selection-number-override,
        rgb(from var(--solaris-dark-6) r g b / 0.85)
      );
    }
    
    [data-diff] ::selection,
    [data-file] ::selection {
      background-color: var(--diffs-bg-selection-text);
    }
    
    ::highlight(opencode-find) {
      background-color: rgb(from var(--surface-warning-base) r g b / 0.35);
    }
    
    ::highlight(opencode-find-current) {
      background-color: rgb(from var(--surface-warning-strong) r g b / 0.55);
    }
    
    [data-diff] [data-line][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-file] [data-line][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-diff] [data-column-number][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-file] [data-column-number][data-comment-selected]:not([data-selected-line]) {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-diff] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-file] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
      box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
    }
    
    [data-diff] [data-line][data-selected-line] {
      background-color: var(--diffs-bg-selection);
      box-shadow: inset 2px 0 0 var(--diffs-selection-border);
    }
    
    [data-file] [data-line][data-selected-line] {
      background-color: var(--diffs-bg-selection);
      box-shadow: inset 2px 0 0 var(--diffs-selection-border);
    }
    
    [data-diff] [data-column-number][data-selected-line] {
      background-color: var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-file] [data-column-number][data-selected-line] {
      background-color: var(--diffs-bg-selection-number);
      color: var(--diffs-selection-number-fg);
    }
    
    [data-diff] [data-column-number][data-line-type='context'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='context-expanded'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='change-addition'][data-selected-line],
    [data-diff] [data-column-number][data-line-type='change-deletion'][data-selected-line] {
      color: var(--diffs-selection-number-fg);
    }
    
    /* The deletion word-diff emphasis is stronger than additions; soften it while selected so the selection highlight reads consistently. */
    [data-diff] [data-line][data-line-type='change-deletion'][data-selected-line] {
      --diffs-bg-deletion-emphasis: light-dark(
        rgb(from var(--diffs-deletion-base) r g b / 0.07),
        rgb(from var(--diffs-deletion-base) r g b / 0.1)
      );
    }
    
    [data-diff-header],
    [data-diff],
    [data-file] {
      [data-separator] {
        height: 24px;
      }
      [data-column-number] {
        background-color: var(--background-stronger);
        cursor: default !important;
      }
    
      &[data-interactive-line-numbers] [data-column-number] {
        cursor: default !important;
      }
    
      &[data-interactive-lines] [data-line] {
        cursor: auto !important;
      }
      [data-code] {
        overflow-x: auto !important;
        overflow-y: clip !important;
      }
    }
    
    ${qx}
    
    `;function jx(t){return{theme:"OpenCode",themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:t??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:t==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:Mj}}const Ij={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function Ux(t){const e=t.closest("[data-line], [data-alt-line]");if(e instanceof HTMLElement){const r=e.dataset.lineType;if(r==="change-deletion")return"deletions";if(r==="change-addition"||r==="change-additions")return"additions"}const n=t.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function a1(t,e){const n=e.dataset.lineIndex;if(!n)return;const r=n.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(r.length!==0)return t&&r.length===2?r[1]:r[0]}function Qf(t,e,n,r){const i=Array.from(t.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const s=r??"additions";for(const o of i)if(Ux(o)===s||parseInt(o.dataset.altLine??"",10)===n)return a1(e,o)}function k3(t,e){if(!e)return e;if(!t)return;const n=t.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Qf(t,r,e.start,e.side),s=Qf(t,r,e.end,e.endSide??e.side);if(i===void 0||s===void 0)return t.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=s)return e;const o=e.endSide??e.side,a={start:e.end,end:e.start};return o&&(a.side=o),e.endSide&&e.side&&(a.endSide=e.side),a}function Wx(t){const e=t.dataset.lineAnnotation?.split(",")[1];if(!e)return;const n=parseInt(e,10);if(!Number.isNaN(n))return n}function Gx(t){const e=Array.from(t.querySelectorAll("[data-comment-selected]"));for(const n of e)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function Oj(t,e){Gx(t);const n=t.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Array.from(n.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const s=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of e){const a=Qf(t,r,o.start,o.side);if(a===void 0)continue;const l=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?a:Qf(t,r,o.end,o.endSide??o.side);if(l===void 0)continue;const c=Math.min(a,l),u=Math.max(a,l);for(const d of i){const f=a1(r,d);f===void 0||fu||d.setAttribute("data-comment-selected","")}for(const d of s){const f=Wx(d);f===void 0||fu||d.setAttribute("data-comment-selected","")}}}function Dj(t,e){Gx(t);const n=Array.from(t.querySelectorAll("[data-line-annotation]")).filter(r=>r instanceof HTMLElement);for(const r of e){const i=Math.max(1,Math.min(r.start,r.end)),s=Math.max(r.start,r.end);for(let o=i;o<=s;o++){const a=Array.from(t.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const l of a)l instanceof HTMLElement&&l.setAttribute("data-comment-selected","")}for(const o of n){const a=Wx(o);a===void 0||as||o.setAttribute("data-comment-selected","")}}}function Rj(t,e){const n=new ResizeObserver(t);return ae(n.disconnect.bind(n)),{observe:r=>n.observe(r,e),unobserve:n.unobserve.bind(n)}}function Pj(t,e,n){const r=new WeakMap,{observe:i,unobserve:s}=Rj(o=>{for(const a of o){const{contentRect:l,target:c}=a,u=Math.round(l.width),d=Math.round(l.height),f=r.get(c);(!f||f.width!==u||f.height!==d)&&(e(l,c,a),r.set(c,{width:u,height:d}))}},n);re(o=>{const a=sR(mg(se(t)));return cR(a,o,i,s),a},[])}const Xf=Symbol("store-raw"),Oa=Symbol("store-node"),zi=Symbol("store-has"),Kx=Symbol("store-self");function Zx(t){let e=t[Xr];if(!e&&(Object.defineProperty(t,Xr,{value:e=new Proxy(t,Fj)}),!Array.isArray(t))){const n=Object.keys(t),r=Object.getOwnPropertyDescriptors(t);for(let i=0,s=n.length;it[Xr][e]),n}function Yx(t){Km()&&$c(Jf(t,Oa),Kx)()}function $j(t){return Yx(t),Reflect.ownKeys(t)}const Fj={get(t,e,n){if(e===Xf)return t;if(e===Xr)return n;if(e===mf)return Yx(t),n;const r=Jf(t,Oa),i=r[e];let s=i?i():t[e];if(e===Oa||e===zi||e==="__proto__")return s;if(!i){const o=Object.getOwnPropertyDescriptor(t,e);Km()&&(typeof s!="function"||t.hasOwnProperty(e))&&!(o&&o.get)&&(s=$c(r,e,s)())}return ki(s)?Zx(s):s},has(t,e){return e===Xf||e===Xr||e===mf||e===Oa||e===zi||e==="__proto__"?!0:(Km()&&$c(Jf(t,zi),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:$j,getOwnPropertyDescriptor:Nj};function jn(t,e,n,r=!1){if(!r&&t[e]===n)return;const i=t[e],s=t.length;n===void 0?(delete t[e],t[zi]&&t[zi][e]&&i!==void 0&&t[zi][e].$()):(t[e]=n,t[zi]&&t[zi][e]&&i===void 0&&t[zi][e].$());let o=Jf(t,Oa),a;if((a=$c(o,e,i))&&a.$(()=>n),Array.isArray(t)&&t.length!==s){for(let l=t.length;l1){r=e.shift();const o=typeof r,a=Array.isArray(t);if(Array.isArray(r)){for(let l=0;l1){ec(t[r],e,[r].concat(n));return}i=t[r],n=[r].concat(n)}let s=e[0];typeof s=="function"&&(s=s(i,n),s===i)||r===void 0&&s==null||(s=or(s),r===void 0||ki(i)&&ki(s)&&!Array.isArray(s)?Qx(i,s):jn(t,r,s))}function Ve(...[t,e]){const n=or(t||{}),r=Array.isArray(n),i=Zx(n);function s(...o){et(()=>{r&&o.length===1?Hj(n,o[0]):ec(n,o)})}return[i,s]}const l1=Symbol("store-root");function ga(t,e,n,r,i){const s=e[n];if(t===s)return;const o=Array.isArray(t);if(n!==l1&&(!ki(t)||!ki(s)||o!==Array.isArray(s)||i&&t[i]!==s[i])){jn(e,n,t);return}if(o){if(t.length&&s.length&&(!r||i&&t[0]&&t[0][i]!=null)){let c,u,d,f,h,p,m,g;for(d=0,f=Math.min(s.length,t.length);d=d&&h>=d&&(s[f]===t[h]||i&&s[f]&&t[h]&&s[f][i]&&s[f][i]===t[h][i]);f--,h--)y[h]=s[f];if(d>h||d>f){for(u=d;u<=h;u++)jn(s,u,t[u]);for(;ut.length&&jn(s,"length",t.length);return}for(m=new Array(h+1),u=h;u>=d;u--)p=t[u],g=i&&p?p[i]:p,c=v.get(g),m[u]=c===void 0?-1:c,v.set(g,u);for(c=d;c<=f;c++)p=s[c],g=i&&p?p[i]:p,u=v.get(g),u!==void 0&&u!==-1&&(y[u]=s[c],u=m[u],v.set(g,u));for(u=d;ut.length&&jn(s,"length",t.length);return}const a=Object.keys(t);for(let c=0,u=a.length;c{if(!ki(s)||!ki(i))return i;const o=ga(i,{[l1]:s},l1,n,r);return o===void 0?s:o}}const e0=new WeakMap,Xx={get(t,e){if(e===Xf)return t;const n=t[e];let r;return ki(n)?e0.get(n)||(e0.set(n,r=new Proxy(n,Xx)),r):n},set(t,e,n){return jn(t,e,or(n)),!0},deleteProperty(t,e){return jn(t,e,void 0,!0),!0}};function Ie(t){return e=>{if(ki(e)){let n;(n=e0.get(e))||e0.set(e,n=new Proxy(e,Xx)),t(n)}return e}}const t0=new Set;let Cs,wr,x3=!1;function Vj(t){return t instanceof HTMLElement?t.closest("[data-prevent-autofocus]")||t.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(t.tagName):!1}function S3(t){if(t instanceof Node)for(const e of t0){const n=e.element();if(n&&n.isConnected&&n.contains(t))return e}}function zj(){x3||typeof window>"u"||(x3=!0,window.addEventListener("keydown",t=>{if(t.defaultPrevented||Vj(t.target)||!(t.metaKey||t.ctrlKey))return;const n=t.key.toLowerCase();if(n==="g"){const s=wr;if(!s||!s.isOpen())return;t.preventDefault(),t.stopPropagation(),s.next(t.shiftKey?-1:1);return}if(n!=="f")return;const r=wr;if(r&&r.isOpen()){t.preventDefault(),t.stopPropagation(),r.open();return}const i=S3(document.activeElement)??S3(t.target)??Cs??Array.from(t0)[0];i&&(t.preventDefault(),t.stopPropagation(),i.open())},{capture:!0}))}function ra(){const t=globalThis.CSS?.highlights;t&&(t.delete("opencode-find"),t.delete("opencode-find-current"))}function _3(){const t=globalThis;return typeof t.Highlight=="function"&&t.CSS?.highlights!=null}function C3(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);if(n.overflowY==="auto"||n.overflowY==="scroll")return e;e=e.parentElement}}function Bj(t){let e,n,r="overlay",i=[];const[s,o]=be([]),[a,l]=Ve({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),c=()=>a.open,u=()=>a.query,d=()=>a.index,f=()=>a.count,h=()=>a.pos,p=()=>{o([])},m=()=>{const T=t.overlay();T&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),T.innerHTML="")},g=()=>{if(r!=="overlay"){m();return}const T=t.wrapper(),D=t.overlay();if(!T||!D||(m(),i.length===0))return;const M=T.getBoundingClientRect(),$=d(),H=document.createDocumentFragment();for(let U=0;U{n=void 0,g()}))}const v=()=>{if(r!=="overlay")return;const T=t.getRoot(),D=T?Array.from(T.querySelectorAll("[data-code]")).filter($=>$ instanceof HTMLElement):[],M=s();D.length===M.length&&D.every(($,H)=>$===M[H])||(p(),o(D))},w=()=>{ra(),m(),p(),i=[],l("count",0),l("index",0)},_=()=>{if(typeof window>"u")return;const T=t.wrapper();if(!T)return;const D=C3(T)??T,M=D.getBoundingClientRect(),$=parseFloat(getComputedStyle(D).getPropertyValue("--session-title-height")),H=Number.isNaN($)?0:$;l("pos",{top:Math.round(M.top)+H-4,right:Math.round(window.innerWidth-M.right)+8})},k=(T,D)=>{const M=D.toLowerCase(),$=[],H=Array.from(T.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(U=>U instanceof HTMLElement);for(const U of H){const j=U.textContent;if(!j)continue;const G=j.toLowerCase();let Z=G.indexOf(M);if(Z===-1)continue;const Q=[],ee=[],le=document.createTreeWalker(U,NodeFilter.SHOW_TEXT);let ye=le.nextNode(),xe=0;for(;ye;)ye instanceof Text&&(xe+=ye.data.length,Q.push(ye),ee.push(xe)),ye=le.nextNode();if(Q.length===0)continue;const Ce=me=>{let Re=0,ge=ee.length-1;for(;Re>1;ee[cn]>=me?ge=cn:Re=cn+1}const Ye=Re===0?0:ee[Re-1];return{node:Q[Re],offset:me-Ye}};for(;Z!==-1;){const me=Ce(Z),Re=Ce(Z+D.length),ge=document.createRange();ge.setStart(me.node,me.offset),ge.setEnd(Re.node,Re.offset),$.push(ge),Z=G.indexOf(M,Z+D.length)}}return $},S=T=>{const D=T.startContainer;(D instanceof Element?D:D.parentElement)?.scrollIntoView({block:"center",inline:"center"})},L=(T,D)=>{const M=globalThis.CSS?.highlights,$=globalThis.Highlight;if(!M||typeof $!="function")return!1;M.delete("opencode-find"),M.delete("opencode-find-current");const H=T[D];H&&M.set("opencode-find-current",new $(H));const U=T.filter((j,G)=>G!==D);return U.length>0&&M.set("opencode-find",new $(...U)),!0},E=T=>{if(!c())return;const D=u().trim();if(!D){w();return}const M=t.getRoot();if(!M)return;r=_3()?"highlights":"overlay";const $=k(M,D),H=$.length,U=T?.reset?0:d(),j=H?Math.min(U,H-1):0;i=$,l("count",H),l("index",j);const G=$[j];if(r==="highlights"){m(),p(),L($,j)||(r="overlay",ra(),v(),y()),T?.scroll&&G&&S(G);return}ra(),v(),T?.scroll&&G&&S(G),y()},C=()=>{l("open",!1),l("query",""),w(),wr===F&&(wr=void 0)},V=()=>{wr&&wr!==F&&wr.close(),wr=F,Cs=F,c()||l("open",!0),requestAnimationFrame(()=>{E({scroll:!0}),e?.focus(),e?.select()})},R=T=>{if(!c())return;const D=f();if(D<=0)return;const M=(d()+T+D)%D;l("index",M);const $=i[M];if($){if(r==="highlights"){if(!L(i,M)){r="overlay",E({reset:!0,scroll:!0});return}S($);return}ra(),v(),S($),y()}},F={element:t.wrapper,isOpen:()=>c(),next:R,open:V,close:C};return re(()=>{for(const T of s())Rt(T,"scroll",y,{passive:!0})}),Vt(()=>{r=_3()?"highlights":"overlay",zj(),t0.add(F),Cs||(Cs=F),ae(()=>{t0.delete(F),wr===F&&(wr=void 0,ra()),Cs===F&&(Cs=void 0)})}),re(()=>{if(!c())return;const T=()=>_();requestAnimationFrame(T),Rt(window,"resize",T,{passive:!0});const D=t.wrapper();if(!D)return;const M=C3(D)??D;Pj(M,T)}),ae(()=>{p(),m(),wr===F&&(wr=void 0,ra())}),{open:c,query:u,count:f,index:d,pos:h,setInput:T=>{e=T},setQuery:T=>{l("query",T),l("index",0),E({reset:!0,scroll:!0})},focus:V,close:C,next:R,refresh:T=>E(T),onPointerDown:()=>{Cs=F,t.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Cs=F},onInputKeyDown:T=>{if(T.key==="Escape"){T.preventDefault(),C();return}T.key==="Enter"&&(T.preventDefault(),R(T.shiftKey?-1:1))}}}function qj(){return{token:0}}function mc(t){t.observer?.disconnect(),t.observer=void 0}function Jx(t){if(!t)return;const e=t.querySelector("diffs-container");if(e instanceof HTMLElement)return e}function jj(t){return Jx(t)?.shadowRoot??void 0}function c1(t){if(!t||typeof document>"u")return;const e=document.documentElement.dataset.colorScheme;if(e==="dark"||e==="light"){t.dataset.colorScheme=e;return}t.removeAttribute("data-color-scheme")}function Uj(t){if(typeof document>"u")return()=>{};if(c1(t()),typeof MutationObserver>"u")return()=>{};const e=document.documentElement,n=new MutationObserver(()=>c1(t()));return n.observe(e,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function Wj(t){mc(t.state),t.state.token+=1;const e=t.state.token,n=Math.max(0,t.settleFrames??0),r=()=>{const o=a=>{if(e===t.state.token){if(a<=0){t.onReady();return}requestAnimationFrame(()=>o(a-1))}};requestAnimationFrame(()=>o(n))},i=o=>{if(t.isReady(o)){r();return}typeof MutationObserver>"u"||(mc(t.state),t.state.observer=new MutationObserver(()=>{e===t.state.token&&t.isReady(o)&&(mc(t.state),r())}),t.state.observer.observe(o,{childList:!0,subtree:!0}))},s=t.getRoot();if(!s){if(typeof MutationObserver>"u")return;t.state.observer=new MutationObserver(()=>{if(e!==t.state.token)return;const o=t.getRoot();o&&i(o)}),t.state.observer.observe(t.container,{childList:!0,subtree:!0});return}i(s)}function Fue(t,e){const n=Math.min(t.start,t.end),r=Math.max(t.start,t.end);return n===r?e("ui.sessionReview.selection.line",{line:n}):e("ui.sessionReview.selection.lines",{start:n,end:r})}function Hue(t,e){const n=Math.max(1,Math.min(e.start,e.end)),r=Math.max(e.start,e.end),i=t.split(`
    `).slice(n-1,r);if(i.length!==0)return i.slice(0,2).join(`
    `)}function Vue(t){const e={start:t.start,end:t.end};return t.side&&(e.side=t.side),t.endSide&&(e.endSide=t.endSide),e}function zue(t,e,n){if(!t)return!1;const r=Math.min(t.start,t.end),i=Math.max(t.start,t.end);if(ei)return!1;if(!n)return!0;const s=t.side,o=t.endSide??s;return!s&&!o?!0:!s||!o?(s??o)===n:s===o||e===r?s===n:e===i?o===n:!0}function Gj(t){return t?t.start===t.end&&(t.endSide==null||t.endSide===t.side):!1}function Kj(t){if(t instanceof Range)return t;const e=new Range;return e.setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),e}function eS(t,e){!t||!e||requestAnimationFrame(()=>{const n=t.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(e)}catch{}})}function Zj(){let t="none",e,n=!1,r=!1;const i=()=>{t="none",e=void 0,n=!1};return{begin(s,o){if(!s){t="text";return}t="numbers",e=o,n=!1},track(s,o){return t!=="numbers"?!1:(s&1)===0?(i(),!0):(o!==void 0&&e!==void 0&&o!==e&&(n=!0),!0)},finish(){const s=t;return r=s==="numbers"&&n,i(),s},consume(s){const o=r&&!Gj(s);return r=!1,o},reset(){r=!1,i()}}}function ih(t){if(t)return t instanceof HTMLElement?t:t.parentElement??void 0}function Yj(t){const e=ih(t);if(!e)return;const n=e.closest("[data-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r}function E3(t){const e=ih(t);if(!e)return;const n=e.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r;const i=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function Qj(t){const e=ih(t);if(!e)return;const n=e.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function tS(t){const e=t.root.getSelection?.()??window.getSelection();if(!e||e.isCollapsed)return;const n=e.getComposedRanges?.({shadowRoots:[t.root]})?.[0]??(e.rangeCount>0?e.getRangeAt(0):void 0),r=n?.startContainer??e.anchorNode,i=n?.endContainer??e.focusNode;if(!r||!i||!t.root.contains(r)||!t.root.contains(i))return;const s=t.lineForNode(r),o=t.lineForNode(i);if(s===void 0||o===void 0)return;const a=t.sideForNode?.(r),l=t.sideForNode?.(i),c=a??l,u={start:s,end:o};return c&&(u.side=c),l&&c&&l!==c&&(u.endSide=l),{range:u,text:t.preserveTextSelection&&n?Kj(n).cloneRange():void 0}}const gd=new WeakMap,Xj={lineHeight:24,hunkSeparatorHeight:24,fileGap:0};function Jj(t){return t==="auto"||t==="scroll"||t==="overlay"}function T3(t){let e=t.parentElement;for(;e;){const n=getComputedStyle(e);if(Jj(n.overflowY))return e;e=e.parentElement}}function eU(t){if(typeof document>"u")return;const e=t.closest("[data-component='session-review']");if(e instanceof HTMLElement){const r=T3(t)??e,i=e.querySelector("[data-slot='session-review-container']");return{key:e,root:r,content:i instanceof HTMLElement?i:void 0}}const n=T3(t);if(n){const r=n.querySelector("[role='log']");return{key:n,root:n,content:r instanceof HTMLElement?r:void 0}}return{key:document,root:document,content:void 0}}function tU(t){const e=eU(t);if(!e)return;let n=gd.get(e.key);if(!n){const i=new Bx;i.setup(e.root,e.content),n={virtualizer:i,refs:0},gd.set(e.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;const i=gd.get(e.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),gd.delete(e.key)))}}}function nU(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tc={exports:{}},rU=tc.exports,L3;function iU(){return L3||(L3=1,(function(t,e){(function(n,r){r(e)})(rU,function(n){const r=Symbol("newer"),i=Symbol("older");class s{constructor(d,f){typeof d!="number"&&(f=d,d=0),this.size=0,this.limit=d,this.oldest=this.newest=void 0,this._keymap=new Map,f&&(this.assign(f),d<1&&(this.limit=this.size))}_markEntryAsUsed(d){d!==this.newest&&(d[r]&&(d===this.oldest&&(this.oldest=d[r]),d[r][i]=d[i]),d[i]&&(d[i][r]=d[r]),d[r]=void 0,d[i]=this.newest,this.newest&&(this.newest[r]=d),this.newest=d)}assign(d){let f,h=this.limit||Number.MAX_VALUE;this._keymap.clear();let p=d[Symbol.iterator]();for(let m=p.next();!m.done;m=p.next()){let g=new o(m.value[0],m.value[1]);if(this._keymap.set(g.key,g),f?(f[r]=g,g[i]=f):this.oldest=g,f=g,h--==0)throw new Error("overflow")}this.newest=f,this.size=this._keymap.size}get(d){var f=this._keymap.get(d);return f?(this._markEntryAsUsed(f),f.value):void 0}set(d,f){var h=this._keymap.get(d);return h?(h.value=f,this._markEntryAsUsed(h),this):(this._keymap.set(d,h=new o(d,f)),this.newest?(this.newest[r]=h,h[i]=this.newest):this.oldest=h,this.newest=h,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var d=this.oldest;if(d)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),d[r]=d[i]=void 0,this._keymap.delete(d.key),--this.size,[d.key,d.value]}find(d){let f=this._keymap.get(d);return f?f.value:void 0}has(d){return this._keymap.has(d)}delete(d){var f=this._keymap.get(d);return f?(this._keymap.delete(f.key),f[r]&&f[i]?(f[i][r]=f[r],f[r][i]=f[i]):f[r]?(f[r][i]=void 0,this.oldest=f[r]):f[i]?(f[i][r]=void 0,this.newest=f[i]):this.oldest=this.newest=void 0,this.size--,f.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new c(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(d,f){typeof f!="object"&&(f=this);let h=this.oldest;for(;h;)d.call(f,h.value,h.key,this),h=h[r]}toJSON(){for(var d=new Array(this.size),f=0,h=this.oldest;h;)d[f++]={key:h.key,value:h.value},h=h[r];return d}toString(){for(var d="",f=this.oldest;f;)d+=String(f.key)+":"+f.value,f=f[r],f&&(d+=" < ");return d}}n.LRUMap=s;function o(u,d){this.key=u,this.value=d,this[r]=void 0,this[i]=void 0}function a(u){this.entry=u}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:[u.key,u.value]}):{done:!0,value:void 0}};function l(u){this.entry=u}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.key}):{done:!0,value:void 0}};function c(u){this.entry=u}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(tc,tc.exports)),tc.exports}var sU=iU();const A3=nU(sU),Qp=Symbol("IGNORE_RESPONSE");var oU=class{highlighter;preferredHighlighter;renderOptions;initialized=!1;workers=[];taskQueue=new Map;pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;constructor(t,{langs:e,theme:n=Dn,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3,preferredHighlighter:s="shiki-js"}){this.options=t,this.preferredHighlighter=s,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new A3.LRUMap(t.totalASTLRUCacheSize??100),this.diffCache=new A3.LRUMap(t.totalASTLRUCacheSize??100),this.initialize(e)}isWorkingPool(){return!this.workersFailed}getFileResultCache(t){return t.cacheKey!=null?this.fileCache.get(t.cacheKey):void 0}getDiffResultCache(t){return t.cacheKey!=null?this.diffCache.get(t.cacheKey):void 0}inspectCaches(){const{fileCache:t,diffCache:e}=this;return{fileCache:t,diffCache:e}}evictFileFromCache(t){try{return this.fileCache.delete(t)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(t){try{return this.diffCache.delete(t)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:t=Dn,lineDiffType:e="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:t,lineDiffType:e,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=Ov(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const s=Nc(t);let o=[];if(i||(t1(s)?o=v3(s):o=await b3(s)),this.highlighter!=null)e1(o,this.highlighter),await this.setRenderOptionsOnWorkers(r,o);else{const[a]=await Promise.all([Ka({themes:s,langs:["text"],preferredHighlighter:this.preferredHighlighter}),this.setRenderOptionsOnWorkers(r,o)]);this.highlighter=a}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const a of this.themeSubscribers)a.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:t,theme:e}=this.renderOptions;return{theme:e,tokenizeMaxLineLength:t}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(t,e){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,s)=>{const o=this.generateRequestId(),a={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:t,resolvedThemes:e},resolve:i,reject:s,requestStart:Date.now()};this.pendingTasks.set(o,a),r.worker.postMessage(a.request)}))}await Promise.all(n)}subscribeToThemeChanges(t){return this.themeSubscribers.add(t),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(t),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(t){this.themeSubscribers.delete(t),this.queueBroadcastStateChanges()}subscribeToStatChanges(t){return this.statSubscribers.add(t),t(this.getStats()),()=>{this.statSubscribers.delete(t)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const t=this.getStats();for(const e of this.statSubscribers)e(t)};cleanUpPendingTasks(t){this.taskQueue.delete(t);const e=this.instanceRequestMap.get(t);e!=null&&(this.pendingTasks.delete(e),this.instanceRequestMap.delete(t)),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(t=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((e,n)=>{(async()=>{try{const r=Nc(this.renderOptions.theme);let i=[];t1(r)?i=v3(r):i=await b3(r);let s=[];g3(t)?s=m3(t):s=await y3(t);const[o]=await Promise.all([Ka({themes:r,langs:["text",...t],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,s)]);if(this.initialized===!1)throw this.terminateWorkers(),new Error("WorkerPoolManager: workers failed to initialize");this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),e()}catch(r){this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(r)}})()}),this.queueBroadcastStateChanges();else return this.initialized}async initializeWorkers(t,e){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),s={worker:i,request_id:void 0,initialized:!1,langs:new Set(["text",...e.map(({name:o})=>o)])};i.addEventListener("message",o=>{this.handleWorkerMessage(s,o.data)}),i.addEventListener("error",o=>console.error("Worker error:",o,s)),this.workers.push(s),n.push(new Promise((o,a)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:t,resolvedLanguages:e},resolve(){s.initialized=!0,o()},reject:a,requestStart:Date.now()};this.pendingTasks.set(l,c),this.executeTask(s,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.size===0)){for(const[t,e]of this.taskQueue){if(this.instanceRequestMap.has(t))continue;const n=M3(e),r=this.getAvailableWorker(n);if(r==null)break;this.assignWorkerToTask(e,r),this.resolveLanguagesAndExecuteTask(r,e,n)}this.queueBroadcastStateChanges()}};highlightFileAST(t,e){if((e.lang??Ir(e.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===t&&r.request.type==="file"&&Kf(e,r.request.file))return;this.submitTask(t,{type:"file",file:e})}}getPlainFileAST(t,e,n,r){if(this.highlighter==null){this.initialize();return}return _x(t,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:n,lines:r})}highlightDiffAST(t,e){if((e.lang??Ir(e.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===t&&r.request.type==="diff"&&r.request.diff===e)return;this.submitTask(t,{type:"diff",diff:e})}}getPlainDiffAST(t,e,n,r,i){return this.highlighter!=null?$x(t,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:e,totalLines:n,expandedHunks:r,collapsedContextThreshold:i}):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.clear(),this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}terminateWorkers(){for(const t of this.workers)t.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(t=>t.request_id!=null).length,queuedTasks:this.taskQueue.size,pendingTasks:this.pendingTasks.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(t,e){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instance:t,requestStart:r};case"diff":return{type:"diff",id:n,request:{...e,id:n},instance:t,requestStart:r}}})();this.taskQueue.set(t,i),this.queueDrain()}async resolveLanguagesAndExecuteTask(t,e,n){try{const r=n.filter(i=>!t.langs.has(i));r.length>0&&(g3(r)?e.request.resolvedLanguages=m3(r):e.request.resolvedLanguages=await y3(r)),this.executeTask(t,e)}catch{this.cleanWorkerAndTask(t,e)}}handleWorkerMessage(t,e){const n=this.pendingTasks.get(e.id);try{if(n==null)throw Qp;if(e.type==="error"){const r=new Error(e.error);throw e.stack&&(r.stack=e.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==e.id)throw Qp;switch(e.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");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:r,options:i}=e,{instance:s,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=e,{instance:s,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:r,options:i}),s.onHighlightSuccess(o.diff,r,i);break}}}}catch(r){r!==Qp&&console.error(r,n,e)}this.cleanWorkerAndTask(t,n),this.queueBroadcastStateChanges(),this.taskQueue.size>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(t,e){e.request_id=t.id,"instance"in t&&(this.taskQueue.delete(t.instance),this.instanceRequestMap.set(t.instance,t.id)),this.pendingTasks.set(t.id,t)}cleanWorkerAndTask(t,e){t.request_id=void 0,e!=null&&("instance"in e&&this.instanceRequestMap.delete(e.instance),this.pendingTasks.delete(e.id))}executeTask(t,e){this.assignWorkerToTask(e,t);for(const n of M3(e))t.langs.add(n);try{t.worker.postMessage(e.request)}catch(n){this.cleanWorkerAndTask(t,e),console.error("Failed to post message to worker:",n),"instance"in e?e.instance.onHighlightError(n):"reject"in e&&e.reject(n)}this.queueBroadcastStateChanges()}getAvailableWorker(t){let e;for(const n of this.workers){if(n.request_id!=null||!n.initialized)continue;if(e=n,t.length===0)break;let r=!0;for(const i of t)if(!n.langs.has(i)){r=!1;break}if(r)break}return e}generateRequestId(){return`req_${++this.nextRequestId}`}};function M3(t){const e=new Set;if(t.type==="initialize"||t.type==="set-render-options")return[];switch(t.type){case"file":e.add(t.request.file.lang??Ir(t.request.file.name));break;case"diff":e.add(t.request.diff.lang??Ir(t.request.diff.name)),e.add(t.request.diff.lang??Ir(t.request.diff.prevName??"-"));break}return e.delete("text"),Array.from(e)}const aU="/assets/worker-BDowWIry.js";function lU(){return new Worker(aU,{type:"module"})}function I3(t){const e=new oU({workerFactory:lU,poolSize:2},{theme:"OpenCode",lineDiffType:t,preferredHighlighter:"shiki-wasm"});return e.initialize(),e}let Xp,Jp;function u1(t){if(!(typeof window>"u"))return t==="split"?(Jp||(Jp=I3("word-alt")),Jp):(Xp||(Xp=I3("none")),Xp)}const cU=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),uU=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function sh(t){if(!(!t||typeof t!="object"))return t}function Rv(t){if(!t)return;const e=t.split(";",1)[0]?.trim().toLowerCase();if(e)return e==="audio/x-aac"?"audio/aac":e==="audio/x-m4a"?"audio/mp4":e}function dU(t){if(!t)return"";const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1).toLowerCase()}function fU(t){const e=dU(t);if(e==="svg")return"svg";if(cU.has(e))return"image";if(uU.has(e))return"audio"}function hU(t){return sh(t)?.type==="binary"}function pU(t,e){if(e==="svg")return t.startsWith("data:image/svg+xml")?t:void 0;if(e==="image")return t.startsWith("data:image/")?t:void 0;if(t.startsWith("data:audio/x-aac;"))return t.replace("data:audio/x-aac;","data:audio/aac;");if(t.startsWith("data:audio/x-m4a;"))return t.replace("data:audio/x-m4a;","data:audio/mp4;");if(t.startsWith("data:audio/"))return t}function em(t,e){if(!t)return;if(typeof t=="string")return pU(t,e);const n=sh(t);if(!n||typeof n.content!="string")return;const r=Rv(typeof n.mimeType=="string"?n.mimeType:void 0);if(r){if(e==="svg")return r!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(e==="image"&&!r.startsWith("image/"))&&!(e==="audio"&&!r.startsWith("audio/"))&&n.encoding==="base64")return`data:${r};base64,${n.content}`}}function mU(t){if(typeof atob=="function")try{const e=atob(t),n=Uint8Array.from(e,r=>r.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):e}catch{}}function gU(t){const e=sh(t);if(!(!e||typeof e.content!="string"||Rv(typeof e.mimeType=="string"?e.mimeType:void 0)!=="image/svg+xml"))return e.encoding==="base64"?mU(e.content):e.content}function tm(t){if(typeof t=="string")return t.length>0;const e=sh(t);return e?typeof e.content=="string"&&e.content.length>0:!1}var yU=Te('
    '),yd=Te('
    '),vU=Te('
    '),bU=Te('